From ffc4f4519d4649aa98ff6c80412f2af5f16ad028 Mon Sep 17 00:00:00 2001 From: Marland Sitt Date: Mon, 4 Mar 2019 20:49:26 -0800 Subject: [PATCH 01/23] Bump to version 3.12.2. --- PKG-INFO | 4 +- README | 54 +- blpapi/__init__.py | 30 +- blpapi/abstractsession.py | 36 +- blpapi/datetime.py | 23 +- blpapi/debug.py | 72 + blpapi/element.py | 3 +- blpapi/eventdispatcher.py | 24 +- blpapi/eventformatter.py | 105 +- blpapi/internals.py | 119 +- blpapi/internals_wrap.cxx | 2106 +++++++-- blpapi/message.py | 23 + blpapi/providersession.py | 127 +- blpapi/requesttemplate.py | 64 + blpapi/session.py | 97 + blpapi/sessionoptions.py | 145 +- blpapi/utils.py | 28 +- blpapi/version.py | 26 + blpapi/versionhelper.py | 115 + blpapi/versionhelper_wrap.cxx | 4024 ++++++++++++++++++ changelog.txt | 36 +- examples/ContributionsMktdataExample.py | 58 +- examples/ContributionsPageExample.py | 111 +- examples/IntradayTickExample.py | 112 +- examples/LocalMktdataSubscriptionExample.py | 109 +- examples/LocalPageSubscriptionExample.py | 4 +- examples/MktdataBroadcastPublisherExample.py | 4 +- examples/MktdataPublisher.py | 4 +- examples/PagePublisherExample.py | 4 +- examples/RequestServiceExample.py | 4 +- examples/ServiceSchema.py | 4 +- examples/SnapshotRequestTemplateExample.py | 271 ++ setup.cfg | 1 - setup.py | 16 +- 34 files changed, 7367 insertions(+), 596 deletions(-) create mode 100644 blpapi/debug.py create mode 100644 blpapi/requesttemplate.py create mode 100644 blpapi/version.py create mode 100644 blpapi/versionhelper.py create mode 100644 blpapi/versionhelper_wrap.cxx create mode 100644 examples/SnapshotRequestTemplateExample.py diff --git a/PKG-INFO b/PKG-INFO index ca3af1a..b1c30fe 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,7 +1,7 @@ Metadata-Version: 1.1 Name: blpapi -Version: 3.9.2 -Summary: Python SDK for Bloomberg BLPAPI (<=3.9) +Version: 3.12.2 +Summary: Python SDK for Bloomberg BLPAPI Home-page: http://www.bloomberglabs.com/api/ Author: Bloomberg L.P. Author-email: open-tech@bloomberg.net diff --git a/README b/README index 33f4713..0b0f265 100644 --- a/README +++ b/README @@ -1,28 +1,48 @@ -Bloomberg Python API version 3.9 -================================ +Bloomberg Python API +==================== This directory contains an interface for interacting with Bloomberg API services using the Python programming language. This package is the source -installer, and requires a C compilation environment compatible with Python's -`distutils` package. Windows users without such an environment are encourage to -instead use the appropriate binary installer, available from -. +installer, and requires a C/C++ compilation environment compatible with +Python's `setuptools` package. +Users are encouraged to install using `pip` directly, as documented in + Dependencies ------------ This SDK requires the following products: -- CPython version 2.6 or higher +- CPython version 2.7 or higher -- Bloomberg C++ SDK version 3.9 or later +- Bloomberg C++ SDK same major and minor version as the Python SDK -- Visual C++ 2008 or 2010 (Windows) or GCC 4.1+ (Linux) +- Optionally, C/C++ compiler for your CPython installation +- On Windows, the VC redistributable package for the Python install -Installation ------------- +The C/C++ compilers are only needed for building the binary part of the module. +We provide pre-built binaries for different versions of CPython on Windows, but +you may need to have the compiler to build on other operating systems or +unsupported versions of CPython. + +On Windows, the VS redistributable package for the compiler used in the target +CPython installation is needed. You can find the compiler version for a +CPython version in [1] and the VC redistributable package in [2]. + +[1] https://wiki.python.org/moin/WindowsCompilers + +[2] https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads + + +Installation from sources +------------------------- + +Installation using pip is strongly recommended, and can handle installing from +sources by building the Python SDK binaries locally. The C++ SDK and setting +the `BLPAPI_ROOT` environment is still needed to build with `pip`, but the rest +of the steps are equivalent to a normal installation. Note that installation requires a working C compiler and the C headers distributed as part of the Bloomberg C++ SDK. @@ -30,8 +50,8 @@ distributed as part of the Bloomberg C++ SDK. 1. Set the `BLPAPI_ROOT` environment variable to the location at which the Bloomberg C++ SDK is installed. (This is the directory containing the `include` directory. On linux this may be of the form - `$HOME/blpapi_cpp_3.9.5.1`; on Windows, this location may be of the - form `C:\blp\API\APIv3\C++API\v3.9.5.1\`.) Note that this is environment + `$HOME/blpapi_cpp_3.x.y.z`; on Windows, this location may be of the + form `C:\blp\API\APIv3\C++API\v3.x.y.z\`.) Note that this is environment variable is required only for *installing* the `blpapi` package, not for running blpapi python applications. @@ -57,8 +77,9 @@ distributed as part of the Bloomberg C++ SDK. (configured by `/etc/ld.so.conf` on Linux and by setting the `PATH` environment variable on Windows) to include the directory containing the C++ SDK library. Note that this step is not necessary for users who already - have a system-wide installation of the C++ SDK, including Windows users who - have the Bloomberg Terminal software installed. + have a system-wide installation of the C++ SDK with the same or newer + version, including Windows users who have the Bloomberg Terminal software + installed. Writing Bloomberg API Programs in Python @@ -96,7 +117,8 @@ Documentation for individual Bloomberg API classes and functions is provided through Python's built-in help system. Further documentation on programming the Bloomberg API is available in the -Developer's Guide, available at . +Developer's Guide, available at +. Examples diff --git a/blpapi/__init__.py b/blpapi/__init__.py index bdb6e92..da74c1a 100644 --- a/blpapi/__init__.py +++ b/blpapi/__init__.py @@ -5,33 +5,13 @@ except ImportError as error: # The most likely reason for a failure here is a failure to locate the # shared object for the C++ library. Provide a meaningful error message. - import platform - s = platform.system() - if s == 'Windows': - env = 'PATH' - elif s == 'Darwin': - env = 'DYLD_LIBRARY_PATH' - else: - env = 'LD_LIBRARY_PATH' - - msg = """%s - -Could not open the C++ SDK library. - -Download and install the latest C++ SDK from: - - http://www.bloomberg.com/professional/api-library - -If the C++ SDK is already installed, please ensure that the path to the library -was added to %s before entering the interpreter. - -""" % (str(error), env) - raise ImportError(msg) + from .debug import debug_load_error + raise debug_load_error(error) from .abstractsession import AbstractSession from .constant import Constant, ConstantList -from .datetime import FixedOffset from .datatype import DataType +from .datetime import FixedOffset from .element import Element from .event import Event, EventQueue from .eventdispatcher import EventDispatcher @@ -46,11 +26,11 @@ from .schema import SchemaElementDefinition, SchemaStatus, SchemaTypeDefinition from .service import Service from .session import Session -from .sessionoptions import SessionOptions +from .sessionoptions import SessionOptions, TlsOptions from .subscriptionlist import SubscriptionList from .topic import Topic from .topiclist import TopicList - +from .version import __version__, version, cpp_sdk_version, print_version __copyright__ = """ Copyright 2012. Bloomberg Finance L.P. diff --git a/blpapi/abstractsession.py b/blpapi/abstractsession.py index 3f9fed2..97d5bb6 100644 --- a/blpapi/abstractsession.py +++ b/blpapi/abstractsession.py @@ -17,7 +17,7 @@ """ - +from . import exception from .exception import _ExceptionUtil from .identity import Identity from .service import Service @@ -223,20 +223,36 @@ def cancel(self, correlationId): None, # no request label 0)) # request label length 0 - def generateToken(self, correlationId=None, eventQueue=None): + def generateToken(self, correlationId=None, + eventQueue=None, authId=None, ipAddress=None): """Generate a token to be used for authorization. - If invalid authentication option is specified in session option or - there is failure to get authentication information based on - authentication option, then an InvalidArgumentException is raised. + The 'authId' and 'ipAddress' must be provided together and can only be + provided if the authentication mode is 'MANUAL'. + + Raises 'InvalidArgumentException' if the authentication options in + 'SessionOptions' or the arguments to the function are invalid. """ if correlationId is None: correlationId = CorrelationId() - _ExceptionUtil.raiseOnError( - internals.blpapi_AbstractSession_generateToken( - self.__handle, - correlationId._handle(), - None if eventQueue is None else eventQueue._handle())) + + if authId is None and ipAddress is None: + _ExceptionUtil.raiseOnError( + internals.blpapi_AbstractSession_generateToken( + self.__handle, + correlationId._handle(), + None if eventQueue is None else eventQueue._handle())) + elif authId is not None and ipAddress is not None: + _ExceptionUtil.raiseOnError( + internals.blpapi_AbstractSession_generateManualToken( + self.__handle, + correlationId._handle(), + authId, + ipAddress, + None if eventQueue is None else eventQueue._handle())) + else: + raise exception.InvalidArgumentException( + "'authId' and 'ipAddress' must be provided together", 0) if eventQueue is not None: eventQueue._registerSession(self) return correlationId diff --git a/blpapi/datetime.py b/blpapi/datetime.py index 70abe38..22745cf 100644 --- a/blpapi/datetime.py +++ b/blpapi/datetime.py @@ -88,15 +88,30 @@ def __le__(self, other): class _DatetimeUtil(object): """Utility methods that deal with BLPAPI dates and times.""" @staticmethod - def convertToNative(blpapiDatetime): + def convertToNative(blpapiDatetimeObj): """Convert BLPAPI Datetime object to a suitable Python object.""" + + isHighPrecision = isinstance(blpapiDatetimeObj, + internals.blpapi_HighPrecisionDatetime_tag) + + if isHighPrecision: + # used for (get/set)Element, (get/set/append)Value methods + blpapiDatetime = blpapiDatetimeObj.datetime + else: + # used by: + # * blpapi_Constant_getValue + # * blpapi_HighResolutionClock_now_wrapper + blpapiDatetime = blpapiDatetimeObj + parts = blpapiDatetime.parts hasDate = parts & internals.DATETIME_DATE_PART == \ internals.DATETIME_DATE_PART hasTime = parts & internals.DATETIME_TIME_PART == \ internals.DATETIME_TIME_PART - mlsecs = blpapiDatetime.milliSeconds * 1000 if parts & \ + microsecs = blpapiDatetime.milliSeconds * 1000 if parts & \ internals.DATETIME_MILLISECONDS_PART else 0 + if isHighPrecision and parts & internals.DATETIME_FRACSECONDS_PART: + microsecs += blpapiDatetimeObj.picoseconds // 1000 // 1000 tzinfo = FixedOffset(blpapiDatetime.offset) if parts & \ internals.DATETIME_OFFSET_PART else None if hasDate: @@ -107,7 +122,7 @@ def convertToNative(blpapiDatetime): blpapiDatetime.hours, blpapiDatetime.minutes, blpapiDatetime.seconds, - mlsecs, + microsecs, tzinfo) else: # Skip an offset, because it's not informative in case of @@ -122,7 +137,7 @@ def convertToNative(blpapiDatetime): return _dt.time(blpapiDatetime.hours, blpapiDatetime.minutes, blpapiDatetime.seconds, - mlsecs, + microsecs, tzinfo) @staticmethod diff --git a/blpapi/debug.py b/blpapi/debug.py new file mode 100644 index 0000000..926d47a --- /dev/null +++ b/blpapi/debug.py @@ -0,0 +1,72 @@ +# debug.py + +"""Provide debugging information for import errors""" + +import platform + +def debug_load_error(error): + """Called when the module fails to import "internals". + Returns ImportError with some debugging message. + """ + # Try to load just the version.py + try: + from .version import version, cpp_sdk_version + except ImportError as version_error: + return _version_load_error(version_error) + + # If the version loading succeeds, the most likely reason for a failure + # is a mismatch between C++ and Python SDKs. + return _version_mismatch_error(error, version(), cpp_sdk_version()) + +def _linker_env(): + """Return the name of the right environment variable for linking in the + current platform. + """ + s = platform.system() + if s == 'Windows': + env = 'PATH' + elif s == 'Darwin': + env = 'DYLD_LIBRARY_PATH' + else: + env = 'LD_LIBRARY_PATH' + return env + +def _version_load_error(error): + """Called when the module fails to import "versionhelper". + Returns ImportError with some debugging message. + """ + msg = """%s + +Could not open the C++ SDK library. + +Download and install the latest C++ SDK from: + + http://www.bloomberg.com/professional/api-library + +If the C++ SDK is already installed, please ensure that the path to the library +was added to %s before entering the interpreter. + +""" % (str(error), _linker_env()) + return ImportError(msg) + + +def _version_mismatch_error(error, py_version, cpp_version): + """Called when "import version" succeeds after "import internals" fails + Returns ImportError with some debugging message. + """ + msg = """%s + +Mismatch between C++ and Python SDK libraries. + +Python SDK version %s +Found C++ SDK version %s + +Download and install the latest C++ SDK from: + + http://www.bloomberg.com/professional/api-library + +If a recent version of the C++ SDK is already installed, please ensure that the +path to the library is added to %s before entering the interpreter. + +""" % (str(error), py_version, cpp_version, _linker_env()) + return ImportError(msg) diff --git a/blpapi/element.py b/blpapi/element.py index e2e71bf..4c7e7cb 100644 --- a/blpapi/element.py +++ b/blpapi/element.py @@ -432,7 +432,8 @@ def getValueAsDatetime(self, index=0): """ self.__assertIsValid() - res = internals.blpapi_Element_getValueAsDatetime(self.__handle, index) + res = internals.blpapi_Element_getValueAsHighPrecisionDatetime( + self.__handle, index) _ExceptionUtil.raiseOnError(res[0]) return _DatetimeUtil.convertToNative(res[1]) diff --git a/blpapi/eventdispatcher.py b/blpapi/eventdispatcher.py index 7cf218a..4a3c198 100644 --- a/blpapi/eventdispatcher.py +++ b/blpapi/eventdispatcher.py @@ -10,6 +10,7 @@ from . import internals +import warnings class EventDispatcher(object): @@ -59,21 +60,32 @@ def start(self): return internals.blpapi_EventDispatcher_start(self.__handle) - def stop(self, async=False): + def stop(self, async_=False, **kwargs): """Stop generating callbacks. Stop generating callbacks for events from sessions associated with this - EventDispatcher. If the specified 'async' is False (the default) then + EventDispatcher. If the specified 'async_' is False (the default) then this method blocks until all current callbacks which were dispatched - through this EventDispatcher have completed. If 'async' is True, this + through this EventDispatcher have completed. If 'async_' is True, this method returns immediately and no further callbacks will be dispatched. - Note: If stop is called with 'async' of False from within a callback - dispatched by this EventDispatcher then the 'async' parameter is + Note: If stop is called with 'async_' of False from within a callback + dispatched by this EventDispatcher then the 'async_' parameter is overridden to True. """ - return internals.blpapi_EventDispatcher_stop(self.__handle, async) + if 'async' in kwargs: + warnings.warn( + "async parameter has been deprecated in favor of async_", + DeprecationWarning) + async_ = kwargs.pop('async') + + if kwargs: + raise TypeError("EventDispatcher.stop() got an unexpected keyword " + "argument. Only 'async' is allowed for backwards " + "compatibility.") + + return internals.blpapi_EventDispatcher_stop(self.__handle, async_) def _handle(self): """Return the internal implementation.""" diff --git a/blpapi/eventformatter.py b/blpapi/eventformatter.py index e73580c..dd9937c 100644 --- a/blpapi/eventformatter.py +++ b/blpapi/eventformatter.py @@ -12,9 +12,9 @@ from .message import Message from .name import Name, getNamePair from . import internals -from .internals import CorrelationId - +from .utils import get_handle, invoke_if_valid +#pylint: disable=useless-object-inheritance class EventFormatter(object): """EventFormatter is used to populate 'Event's for publishing. @@ -63,7 +63,7 @@ class EventFormatter(object): __nameTraits = ( internals.blpapi_EventFormatter_setValueFromName, internals.blpapi_EventFormatter_appendValueFromName, - Name._handle) + Name._handle) #pylint: disable=protected-access __stringTraits = ( internals.blpapi_EventFormatter_setValueString, @@ -75,27 +75,27 @@ class EventFormatter(object): internals.blpapi_EventFormatter_appendValueString, str) + #pylint: disable=too-many-return-statements @staticmethod def __getTraits(value): + """Returns traits for value based on its type""" if isinstance(value, str): return EventFormatter.__stringTraits - elif isinstance(value, bool): + if isinstance(value, bool): return EventFormatter.__boolTraits - elif isinstance(value, int): - if value >= -(2 ** 31) and value <= (2 ** 31 - 1): + if isinstance(value, int): + if -(2 ** 31) <= value <= (2 ** 31 - 1): return EventFormatter.__int32Traits - elif value >= -(2 ** 63) and value <= (2 ** 63 - 1): + if -(2 ** 63) <= value <= (2 ** 63 - 1): return EventFormatter.__int64Traits - else: - raise ValueError("value is out of supported range") - elif isinstance(value, float): + raise ValueError("value is out of supported range") + if isinstance(value, float): return EventFormatter.__floatTraits - elif _DatetimeUtil.isDatetime(value): + if _DatetimeUtil.isDatetime(value): return EventFormatter.__datetimeTraits - elif isinstance(value, Name): + if isinstance(value, Name): return EventFormatter.__nameTraits - else: - return EventFormatter.__defaultTraits + return EventFormatter.__defaultTraits def __init__(self, event): """Create an EventFormatter to create Messages in the specified 'event' @@ -106,7 +106,8 @@ def __init__(self, event): Event will result in an exception being raised. """ - self.__handle = internals.blpapi_EventFormatter_create(event._handle()) + self.__handle = internals.blpapi_EventFormatter_create( + get_handle(event)) def __del__(self): try: @@ -141,14 +142,14 @@ def appendMessage(self, messageType, topic, sequenceNumber=None): self.__handle, name[0], name[1], - topic._handle())) + get_handle(topic))) else: _ExceptionUtil.raiseOnError( internals.blpapi_EventFormatter_appendMessageSeq( self.__handle, name[0], name[1], - topic._handle(), + get_handle(topic), sequenceNumber, 0)) @@ -169,7 +170,8 @@ def appendResponse(self, opType): name[1])) def appendRecapMessage(self, topic, correlationId=None, - sequenceNumber=None): + sequenceNumber=None, + fragmentType=Message.FRAGMENT_NONE): """Append a (empty) recap message that will be published. Append a (empty) recap message that will be published under the @@ -183,23 +185,49 @@ def appendRecapMessage(self, topic, correlationId=None, After a message has been appended its elements can be set using the various 'setElement()' methods. It is an error to create append a recap message to an Admin event. + + Single-tick recap messages should have + 'fragmentType'= Message.FRAGMENT_NONE. Multi-tick recaps can have + either Message.FRAGMENT_START, Message.FRAGMENT_INTERMEDIATE, or + Message.FRAGMENT_END as the 'fragmentType'. """ - cIdHandle = None if correlationId is None else correlationId._handle() + # pylint: disable=line-too-long + cIdHandle = None if correlationId is None else get_handle(correlationId) if sequenceNumber is None: - _ExceptionUtil.raiseOnError( - internals.blpapi_EventFormatter_appendRecapMessage( - self.__handle, - topic._handle(), - cIdHandle)) + if fragmentType == Message.FRAGMENT_NONE: + _ExceptionUtil.raiseOnError( + internals.blpapi_EventFormatter_appendRecapMessage( + self.__handle, + get_handle(topic), + cIdHandle)) + else: + _ExceptionUtil.raiseOnError( + internals.blpapi_EventFormatter_appendFragmentedRecapMessage( + self.__handle, + None, + None, + get_handle(topic), + cIdHandle, + fragmentType)) else: - _ExceptionUtil.raiseOnError( - internals.blpapi_EventFormatter_appendRecapMessageSeq( - self.__handle, - topic._handle(), - cIdHandle, - sequenceNumber, - 0)) + if fragmentType == Message.FRAGMENT_NONE: + _ExceptionUtil.raiseOnError( + internals.blpapi_EventFormatter_appendRecapMessageSeq( + self.__handle, + get_handle(topic), + cIdHandle, + sequenceNumber, + 0)) + else: + _ExceptionUtil.raiseOnError( + internals.blpapi_EventFormatter_appendFragmentedRecapMessageSeq( + self.__handle, + None, + None, + get_handle(topic), + fragmentType, + sequenceNumber)) def setElement(self, name, value): """Set the element with the specified 'name' to the specified 'value'. @@ -216,8 +244,7 @@ def setElement(self, name, value): """ traits = EventFormatter.__getTraits(value) name = getNamePair(name) - if traits[2] is not None: - value = traits[2](value) + value = invoke_if_valid(traits[2], value) _ExceptionUtil.raiseOnError( traits[0](self.__handle, name[0], name[1], value)) @@ -247,10 +274,11 @@ def pushElement(self, name): this returns the context of the EventFormatter is set to the element 'name' in the schema and any calls to 'setElement()' or 'pushElement()' are applied at that level. If 'name' represents an array of scalars then - 'appendValue()' must be used to add values. If 'name' represents an array - of complex types then 'appendElement()' creates the first entry and set - the context of the EventFormatter to that element. Calling - 'appendElement()' again will create another entry. + 'appendValue()' must be used to add values. + If 'name' represents an array of complex types then 'appendElement()' + creates the first entry and sets the context of the EventFormatter + to that element. Calling 'appendElement()' again will create + another entry. """ name = getNamePair(name) _ExceptionUtil.raiseOnError( @@ -273,8 +301,7 @@ def popElement(self): def appendValue(self, value): traits = EventFormatter.__getTraits(value) - if traits[2] is not None: - value = traits[2](value) + value = invoke_if_valid(traits[2], value) _ExceptionUtil.raiseOnError(traits[1](self.__handle, value)) def appendElement(self): diff --git a/blpapi/internals.py b/blpapi/internals.py index c82689c..4a2d116 100644 --- a/blpapi/internals.py +++ b/blpapi/internals.py @@ -133,6 +133,9 @@ class _object: MESSAGE_FRAGMENT_START = _internals.MESSAGE_FRAGMENT_START MESSAGE_FRAGMENT_INTERMEDIATE = _internals.MESSAGE_FRAGMENT_INTERMEDIATE MESSAGE_FRAGMENT_END = _internals.MESSAGE_FRAGMENT_END +MESSAGE_RECAPTYPE_NONE = _internals.MESSAGE_RECAPTYPE_NONE +MESSAGE_RECAPTYPE_SOLICITED = _internals.MESSAGE_RECAPTYPE_SOLICITED +MESSAGE_RECAPTYPE_UNSOLICITED = _internals.MESSAGE_RECAPTYPE_UNSOLICITED ELEMENTDEFINITION_UNBOUNDED = _internals.ELEMENTDEFINITION_UNBOUNDED ELEMENT_INDEX_END = _internals.ELEMENT_INDEX_END SERVICEREGISTRATIONOPTIONS_PRIORITY_MEDIUM = _internals.SERVICEREGISTRATIONOPTIONS_PRIORITY_MEDIUM @@ -244,6 +247,10 @@ def blpapi_HighResolutionClock_now_wrapper(): return _internals.blpapi_HighResolutionClock_now_wrapper() blpapi_HighResolutionClock_now_wrapper = _internals.blpapi_HighResolutionClock_now_wrapper +def blpapi_EventDispatcher_stop(handle, asynch): + return _internals.blpapi_EventDispatcher_stop(handle, asynch) +blpapi_EventDispatcher_stop = _internals.blpapi_EventDispatcher_stop + def blpapi_Service_printHelper(service, level, spacesPerLevel): return _internals.blpapi_Service_printHelper(service, level, spacesPerLevel) blpapi_Service_printHelper = _internals.blpapi_Service_printHelper @@ -256,6 +263,10 @@ def blpapi_SchemaTypeDefinition_printHelper(item, level, spacesPerLevel): return _internals.blpapi_SchemaTypeDefinition_printHelper(item, level, spacesPerLevel) blpapi_SchemaTypeDefinition_printHelper = _internals.blpapi_SchemaTypeDefinition_printHelper +def blpapi_SessionOptions_printHelper(sessionOptions, level, spacesPerLevel): + return _internals.blpapi_SessionOptions_printHelper(sessionOptions, level, spacesPerLevel) +blpapi_SessionOptions_printHelper = _internals.blpapi_SessionOptions_printHelper + def blpapi_SchemaTypeDefinition_hasElementDefinition(type, nameString, name): return _internals.blpapi_SchemaTypeDefinition_hasElementDefinition(type, nameString, name) blpapi_SchemaTypeDefinition_hasElementDefinition = _internals.blpapi_SchemaTypeDefinition_hasElementDefinition @@ -633,8 +644,8 @@ def blpapi_Element_getValueAsDatetime(element, index): return _internals.blpapi_Element_getValueAsDatetime(element, index) blpapi_Element_getValueAsDatetime = _internals.blpapi_Element_getValueAsDatetime -def blpapi_Element_getValueAsHighPrecisionDatetime(element, buffer, index): - return _internals.blpapi_Element_getValueAsHighPrecisionDatetime(element, buffer, index) +def blpapi_Element_getValueAsHighPrecisionDatetime(element, index): + return _internals.blpapi_Element_getValueAsHighPrecisionDatetime(element, index) blpapi_Element_getValueAsHighPrecisionDatetime = _internals.blpapi_Element_getValueAsHighPrecisionDatetime def blpapi_Element_getValueAsElement(element, index): @@ -669,10 +680,6 @@ def blpapi_Element_setValueDatetime(element, value, index): return _internals.blpapi_Element_setValueDatetime(element, value, index) blpapi_Element_setValueDatetime = _internals.blpapi_Element_setValueDatetime -def blpapi_Element_setValueHighPrecisionDatetime(element, value, index): - return _internals.blpapi_Element_setValueHighPrecisionDatetime(element, value, index) -blpapi_Element_setValueHighPrecisionDatetime = _internals.blpapi_Element_setValueHighPrecisionDatetime - def blpapi_Element_setValueFromName(element, value, index): return _internals.blpapi_Element_setValueFromName(element, value, index) blpapi_Element_setValueFromName = _internals.blpapi_Element_setValueFromName @@ -697,10 +704,6 @@ def blpapi_Element_setElementDatetime(element, nameString, name, value): return _internals.blpapi_Element_setElementDatetime(element, nameString, name, value) blpapi_Element_setElementDatetime = _internals.blpapi_Element_setElementDatetime -def blpapi_Element_setElementHighPrecisionDatetime(element, nameString, name, value): - return _internals.blpapi_Element_setElementHighPrecisionDatetime(element, nameString, name, value) -blpapi_Element_setElementHighPrecisionDatetime = _internals.blpapi_Element_setElementHighPrecisionDatetime - def blpapi_Element_setElementFromName(element, elementName, name, buffer): return _internals.blpapi_Element_setElementFromName(element, elementName, name, buffer) blpapi_Element_setElementFromName = _internals.blpapi_Element_setElementFromName @@ -749,6 +752,14 @@ def blpapi_EventFormatter_appendRecapMessageSeq(formatter, topic, cid, sequenceN return _internals.blpapi_EventFormatter_appendRecapMessageSeq(formatter, topic, cid, sequenceNumber, arg5) blpapi_EventFormatter_appendRecapMessageSeq = _internals.blpapi_EventFormatter_appendRecapMessageSeq +def blpapi_EventFormatter_appendFragmentedRecapMessage(formatter, typeString, typeName, topic, cid, fragmentType): + return _internals.blpapi_EventFormatter_appendFragmentedRecapMessage(formatter, typeString, typeName, topic, cid, fragmentType) +blpapi_EventFormatter_appendFragmentedRecapMessage = _internals.blpapi_EventFormatter_appendFragmentedRecapMessage + +def blpapi_EventFormatter_appendFragmentedRecapMessageSeq(formatter, typeString, typeName, topic, fragmentType, sequenceNumber): + return _internals.blpapi_EventFormatter_appendFragmentedRecapMessageSeq(formatter, typeString, typeName, topic, fragmentType, sequenceNumber) +blpapi_EventFormatter_appendFragmentedRecapMessageSeq = _internals.blpapi_EventFormatter_appendFragmentedRecapMessageSeq + def blpapi_EventFormatter_setValueBool(formatter, typeString, typeName, value): return _internals.blpapi_EventFormatter_setValueBool(formatter, typeString, typeName, value) blpapi_EventFormatter_setValueBool = _internals.blpapi_EventFormatter_setValueBool @@ -841,10 +852,6 @@ def blpapi_EventDispatcher_start(handle): return _internals.blpapi_EventDispatcher_start(handle) blpapi_EventDispatcher_start = _internals.blpapi_EventDispatcher_start -def blpapi_EventDispatcher_stop(handle, async): - return _internals.blpapi_EventDispatcher_stop(handle, async) -blpapi_EventDispatcher_stop = _internals.blpapi_EventDispatcher_stop - def ProviderSession_createHelper(parameters, eventHandlerFunc, dispatcher): return _internals.ProviderSession_createHelper(parameters, eventHandlerFunc, dispatcher) ProviderSession_createHelper = _internals.ProviderSession_createHelper @@ -852,6 +859,14 @@ def ProviderSession_createHelper(parameters, eventHandlerFunc, dispatcher): def ProviderSession_destroyHelper(sessionHandle, eventHandlerFunc): return _internals.ProviderSession_destroyHelper(sessionHandle, eventHandlerFunc) ProviderSession_destroyHelper = _internals.ProviderSession_destroyHelper + +def ProviderSession_terminateSubscriptionsOnTopic(sessionHandle, topic, message): + return _internals.ProviderSession_terminateSubscriptionsOnTopic(sessionHandle, topic, message) +ProviderSession_terminateSubscriptionsOnTopic = _internals.ProviderSession_terminateSubscriptionsOnTopic + +def ProviderSession_flushPublishedEvents(handle, timeoutMsecs): + return _internals.ProviderSession_flushPublishedEvents(handle, timeoutMsecs) +ProviderSession_flushPublishedEvents = _internals.ProviderSession_flushPublishedEvents UNKNOWN_CLASS = _internals.UNKNOWN_CLASS INVALIDSTATE_CLASS = _internals.INVALIDSTATE_CLASS INVALIDARG_CLASS = _internals.INVALIDARG_CLASS @@ -978,6 +993,22 @@ def blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes(parameters, shou return _internals.blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes(parameters, shouldRecord) blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes = _internals.blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes +def blpapi_SessionOptions_setServiceCheckTimeout(paramaters, timeoutMsecs): + return _internals.blpapi_SessionOptions_setServiceCheckTimeout(paramaters, timeoutMsecs) +blpapi_SessionOptions_setServiceCheckTimeout = _internals.blpapi_SessionOptions_setServiceCheckTimeout + +def blpapi_SessionOptions_setServiceDownloadTimeout(paramaters, timeoutMsecs): + return _internals.blpapi_SessionOptions_setServiceDownloadTimeout(paramaters, timeoutMsecs) +blpapi_SessionOptions_setServiceDownloadTimeout = _internals.blpapi_SessionOptions_setServiceDownloadTimeout + +def blpapi_SessionOptions_setTlsOptions(paramaters, tlsOptions): + return _internals.blpapi_SessionOptions_setTlsOptions(paramaters, tlsOptions) +blpapi_SessionOptions_setTlsOptions = _internals.blpapi_SessionOptions_setTlsOptions + +def blpapi_SessionOptions_setFlushPublishedEventsTimeout(paramaters, timeoutMsecs): + return _internals.blpapi_SessionOptions_setFlushPublishedEventsTimeout(paramaters, timeoutMsecs) +blpapi_SessionOptions_setFlushPublishedEventsTimeout = _internals.blpapi_SessionOptions_setFlushPublishedEventsTimeout + def blpapi_SessionOptions_serverHost(parameters): return _internals.blpapi_SessionOptions_serverHost(parameters) blpapi_SessionOptions_serverHost = _internals.blpapi_SessionOptions_serverHost @@ -1062,6 +1093,38 @@ def blpapi_SessionOptions_recordSubscriptionDataReceiveTimes(parameters): return _internals.blpapi_SessionOptions_recordSubscriptionDataReceiveTimes(parameters) blpapi_SessionOptions_recordSubscriptionDataReceiveTimes = _internals.blpapi_SessionOptions_recordSubscriptionDataReceiveTimes +def blpapi_SessionOptions_serviceCheckTimeout(parameters): + return _internals.blpapi_SessionOptions_serviceCheckTimeout(parameters) +blpapi_SessionOptions_serviceCheckTimeout = _internals.blpapi_SessionOptions_serviceCheckTimeout + +def blpapi_SessionOptions_serviceDownloadTimeout(parameters): + return _internals.blpapi_SessionOptions_serviceDownloadTimeout(parameters) +blpapi_SessionOptions_serviceDownloadTimeout = _internals.blpapi_SessionOptions_serviceDownloadTimeout + +def blpapi_SessionOptions_flushPublishedEventsTimeout(parameters): + return _internals.blpapi_SessionOptions_flushPublishedEventsTimeout(parameters) +blpapi_SessionOptions_flushPublishedEventsTimeout = _internals.blpapi_SessionOptions_flushPublishedEventsTimeout + +def blpapi_TlsOptions_destroy(parameters): + return _internals.blpapi_TlsOptions_destroy(parameters) +blpapi_TlsOptions_destroy = _internals.blpapi_TlsOptions_destroy + +def blpapi_TlsOptions_createFromFiles(clientCredentialsFileName, clientCredentialsPassword, trustedCertificatesFileName): + return _internals.blpapi_TlsOptions_createFromFiles(clientCredentialsFileName, clientCredentialsPassword, trustedCertificatesFileName) +blpapi_TlsOptions_createFromFiles = _internals.blpapi_TlsOptions_createFromFiles + +def blpapi_TlsOptions_createFromBlobs(clientCredentialsRawData, clientCredentialsPassword, trustedCertificatesRawData): + return _internals.blpapi_TlsOptions_createFromBlobs(clientCredentialsRawData, clientCredentialsPassword, trustedCertificatesRawData) +blpapi_TlsOptions_createFromBlobs = _internals.blpapi_TlsOptions_createFromBlobs + +def blpapi_TlsOptions_setTlsHandshakeTimeoutMs(paramaters, tlsHandshakeTimeoutMs): + return _internals.blpapi_TlsOptions_setTlsHandshakeTimeoutMs(paramaters, tlsHandshakeTimeoutMs) +blpapi_TlsOptions_setTlsHandshakeTimeoutMs = _internals.blpapi_TlsOptions_setTlsHandshakeTimeoutMs + +def blpapi_TlsOptions_setCrlFetchTimeoutMs(paramaters, crlFetchTimeoutMs): + return _internals.blpapi_TlsOptions_setCrlFetchTimeoutMs(paramaters, crlFetchTimeoutMs) +blpapi_TlsOptions_setCrlFetchTimeoutMs = _internals.blpapi_TlsOptions_setCrlFetchTimeoutMs + def blpapi_Name_create(nameString): return _internals.blpapi_Name_create(nameString) blpapi_Name_create = _internals.blpapi_Name_create @@ -1362,6 +1425,10 @@ def blpapi_Request_setPreferredRoute(request, correlationId): return _internals.blpapi_Request_setPreferredRoute(request, correlationId) blpapi_Request_setPreferredRoute = _internals.blpapi_Request_setPreferredRoute +def blpapi_RequestTemplate_release(requestTemplate): + return _internals.blpapi_RequestTemplate_release(requestTemplate) +blpapi_RequestTemplate_release = _internals.blpapi_RequestTemplate_release + def blpapi_Operation_name(service): return _internals.blpapi_Operation_name(service) blpapi_Operation_name = _internals.blpapi_Operation_name @@ -1474,6 +1541,14 @@ def blpapi_Message_fragmentType(message): return _internals.blpapi_Message_fragmentType(message) blpapi_Message_fragmentType = _internals.blpapi_Message_fragmentType +def blpapi_Message_recapType(message): + return _internals.blpapi_Message_recapType(message) +blpapi_Message_recapType = _internals.blpapi_Message_recapType + +def blpapi_Message_print(message, streamWriter, stream, indentLevel, spacesPerLevel): + return _internals.blpapi_Message_print(message, streamWriter, stream, indentLevel, spacesPerLevel) +blpapi_Message_print = _internals.blpapi_Message_print + def blpapi_Message_addRef(message): return _internals.blpapi_Message_addRef(message) blpapi_Message_addRef = _internals.blpapi_Message_addRef @@ -1566,6 +1641,10 @@ def blpapi_AbstractSession_generateToken(session, correlationId, eventQueue): return _internals.blpapi_AbstractSession_generateToken(session, correlationId, eventQueue) blpapi_AbstractSession_generateToken = _internals.blpapi_AbstractSession_generateToken +def blpapi_AbstractSession_generateManualToken(session, correlationId, user, manualIp, eventQueue): + return _internals.blpapi_AbstractSession_generateManualToken(session, correlationId, user, manualIp, eventQueue) +blpapi_AbstractSession_generateManualToken = _internals.blpapi_AbstractSession_generateManualToken + def blpapi_AbstractSession_getService(session, serviceIdentifier): return _internals.blpapi_AbstractSession_getService(session, serviceIdentifier) blpapi_AbstractSession_getService = _internals.blpapi_AbstractSession_getService @@ -1622,6 +1701,14 @@ def blpapi_Session_sendRequest(session, request, correlationId, identity, eventQ return _internals.blpapi_Session_sendRequest(session, request, correlationId, identity, eventQueue, requestLabel, requestLabelLen) blpapi_Session_sendRequest = _internals.blpapi_Session_sendRequest +def blpapi_Session_sendRequestTemplate(session, requestTemplate, correlationId): + return _internals.blpapi_Session_sendRequestTemplate(session, requestTemplate, correlationId) +blpapi_Session_sendRequestTemplate = _internals.blpapi_Session_sendRequestTemplate + +def blpapi_Session_createSnapshotRequestTemplate(session, subscriptionString, identity, correlationId): + return _internals.blpapi_Session_createSnapshotRequestTemplate(session, subscriptionString, identity, correlationId) +blpapi_Session_createSnapshotRequestTemplate = _internals.blpapi_Session_createSnapshotRequestTemplate + def blpapi_Session_getAbstractSession(session): return _internals.blpapi_Session_getAbstractSession(session) blpapi_Session_getAbstractSession = _internals.blpapi_Session_getAbstractSession @@ -1842,6 +1929,10 @@ def blpapi_ProviderSession_deleteTopics(session, topics, numTopics): return _internals.blpapi_ProviderSession_deleteTopics(session, topics, numTopics) blpapi_ProviderSession_deleteTopics = _internals.blpapi_ProviderSession_deleteTopics +def blpapi_ProviderSession_terminateSubscriptionsOnTopics(session, topics, numTopics, message): + return _internals.blpapi_ProviderSession_terminateSubscriptionsOnTopics(session, topics, numTopics, message) +blpapi_ProviderSession_terminateSubscriptionsOnTopics = _internals.blpapi_ProviderSession_terminateSubscriptionsOnTopics + def blpapi_ProviderSession_publish(session, event): return _internals.blpapi_ProviderSession_publish(session, event) blpapi_ProviderSession_publish = _internals.blpapi_ProviderSession_publish diff --git a/blpapi/internals_wrap.cxx b/blpapi/internals_wrap.cxx index cf149af..01583fe 100644 --- a/blpapi/internals_wrap.cxx +++ b/blpapi/internals_wrap.cxx @@ -3031,42 +3031,45 @@ SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { #define SWIGTYPE_p_blpapi_Operation swig_types[21] #define SWIGTYPE_p_blpapi_ProviderSession swig_types[22] #define SWIGTYPE_p_blpapi_Request swig_types[23] -#define SWIGTYPE_p_blpapi_ResolutionList swig_types[24] -#define SWIGTYPE_p_blpapi_Service swig_types[25] -#define SWIGTYPE_p_blpapi_ServiceRegistrationOptions swig_types[26] -#define SWIGTYPE_p_blpapi_Session swig_types[27] -#define SWIGTYPE_p_blpapi_SessionOptions swig_types[28] -#define SWIGTYPE_p_blpapi_StreamWriter_t swig_types[29] -#define SWIGTYPE_p_blpapi_SubscriptionItrerator swig_types[30] -#define SWIGTYPE_p_blpapi_SubscriptionList swig_types[31] -#define SWIGTYPE_p_blpapi_TimePoint_t swig_types[32] -#define SWIGTYPE_p_blpapi_Topic swig_types[33] -#define SWIGTYPE_p_blpapi_TopicList swig_types[34] -#define SWIGTYPE_p_char swig_types[35] -#define SWIGTYPE_p_double swig_types[36] -#define SWIGTYPE_p_f_p_blpapi_Event_p_blpapi_ProviderSession_p_void__void swig_types[37] -#define SWIGTYPE_p_float swig_types[38] -#define SWIGTYPE_p_int swig_types[39] -#define SWIGTYPE_p_intArray swig_types[40] -#define SWIGTYPE_p_long_long swig_types[41] -#define SWIGTYPE_p_p_blpapi_Element swig_types[42] -#define SWIGTYPE_p_p_blpapi_Event swig_types[43] -#define SWIGTYPE_p_p_blpapi_Message swig_types[44] -#define SWIGTYPE_p_p_blpapi_Name swig_types[45] -#define SWIGTYPE_p_p_blpapi_Operation swig_types[46] -#define SWIGTYPE_p_p_blpapi_Request swig_types[47] -#define SWIGTYPE_p_p_blpapi_Service swig_types[48] -#define SWIGTYPE_p_p_blpapi_Topic swig_types[49] -#define SWIGTYPE_p_p_char swig_types[50] -#define SWIGTYPE_p_p_p_void swig_types[51] -#define SWIGTYPE_p_p_void swig_types[52] -#define SWIGTYPE_p_short swig_types[53] -#define SWIGTYPE_p_unsigned_char swig_types[54] -#define SWIGTYPE_p_unsigned_int swig_types[55] -#define SWIGTYPE_p_unsigned_long_long swig_types[56] -#define SWIGTYPE_p_unsigned_short swig_types[57] -static swig_type_info *swig_types[59]; -static swig_module_info swig_module = {swig_types, 58, 0, 0, 0, 0}; +#define SWIGTYPE_p_blpapi_RequestTemplate swig_types[24] +#define SWIGTYPE_p_blpapi_ResolutionList swig_types[25] +#define SWIGTYPE_p_blpapi_Service swig_types[26] +#define SWIGTYPE_p_blpapi_ServiceRegistrationOptions swig_types[27] +#define SWIGTYPE_p_blpapi_Session swig_types[28] +#define SWIGTYPE_p_blpapi_SessionOptions swig_types[29] +#define SWIGTYPE_p_blpapi_StreamWriter_t swig_types[30] +#define SWIGTYPE_p_blpapi_SubscriptionItrerator swig_types[31] +#define SWIGTYPE_p_blpapi_SubscriptionList swig_types[32] +#define SWIGTYPE_p_blpapi_TimePoint_t swig_types[33] +#define SWIGTYPE_p_blpapi_TlsOptions swig_types[34] +#define SWIGTYPE_p_blpapi_Topic swig_types[35] +#define SWIGTYPE_p_blpapi_TopicList swig_types[36] +#define SWIGTYPE_p_char swig_types[37] +#define SWIGTYPE_p_double swig_types[38] +#define SWIGTYPE_p_f_p_blpapi_Event_p_blpapi_ProviderSession_p_void__void swig_types[39] +#define SWIGTYPE_p_float swig_types[40] +#define SWIGTYPE_p_int swig_types[41] +#define SWIGTYPE_p_intArray swig_types[42] +#define SWIGTYPE_p_long_long swig_types[43] +#define SWIGTYPE_p_p_blpapi_Element swig_types[44] +#define SWIGTYPE_p_p_blpapi_Event swig_types[45] +#define SWIGTYPE_p_p_blpapi_Message swig_types[46] +#define SWIGTYPE_p_p_blpapi_Name swig_types[47] +#define SWIGTYPE_p_p_blpapi_Operation swig_types[48] +#define SWIGTYPE_p_p_blpapi_Request swig_types[49] +#define SWIGTYPE_p_p_blpapi_RequestTemplate swig_types[50] +#define SWIGTYPE_p_p_blpapi_Service swig_types[51] +#define SWIGTYPE_p_p_blpapi_Topic swig_types[52] +#define SWIGTYPE_p_p_char swig_types[53] +#define SWIGTYPE_p_p_p_void swig_types[54] +#define SWIGTYPE_p_p_void swig_types[55] +#define SWIGTYPE_p_short swig_types[56] +#define SWIGTYPE_p_unsigned_char swig_types[57] +#define SWIGTYPE_p_unsigned_int swig_types[58] +#define SWIGTYPE_p_unsigned_long_long swig_types[59] +#define SWIGTYPE_p_unsigned_short swig_types[60] +static swig_type_info *swig_types[62]; +static swig_module_info swig_module = {swig_types, 61, 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) @@ -3333,6 +3336,23 @@ std::string blpapi_SchemaTypeDefinition_printHelper( return stream.str(); } +std::string blpapi_SessionOptions_printHelper( + blpapi_SessionOptions_t *sessionOptions, + int level, + int spacesPerLevel) +{ + std::ostringstream stream; + + blpapi_SessionOptions_print( + sessionOptions, + BloombergLP::blpapi::OstreamWriter, + &stream, + level, + spacesPerLevel); + + return stream.str(); +} + bool blpapi_SchemaTypeDefinition_hasElementDefinition( const blpapi_SchemaTypeDefinition_t *type, const char *nameString, @@ -4533,6 +4553,30 @@ void ProviderSession_destroyHelper(blpapi_ProviderSession_t *sessionHandle, Py_XDECREF(eventHandlerFunc); } +int ProviderSession_terminateSubscriptionsOnTopic(blpapi_ProviderSession_t *sessionHandle, + const blpapi_Topic_t *topic, + const char *message=0) +{ + int res; + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + res = blpapi_ProviderSession_terminateSubscriptionsOnTopics(sessionHandle, &topic, 1, message); + SWIG_PYTHON_THREAD_END_ALLOW; + return res; +} + +bool ProviderSession_flushPublishedEvents(blpapi_ProviderSession_t *handle, int timeoutMsecs) +{ + int allFlushed = -1; + int rc = blpapi_ProviderSession_flushPublishedEvents( + handle, + &allFlushed, + timeoutMsecs); + if (rc != 0) { + throw std::runtime_error("Flush published events failed"); + } + return static_cast(allFlushed); +} + /* Getting isfinite working pre C99 across multiple platforms is non-trivial. Users can provide SWIG_isfinite on older platforms. */ @@ -4896,6 +4940,57 @@ SWIGINTERN PyObject *_wrap_blpapi_HighResolutionClock_now_wrapper(PyObject *SWIG } +SWIGINTERN PyObject *_wrap_blpapi_EventDispatcher_stop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_EventDispatcher_t *arg1 = (blpapi_EventDispatcher_t *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_EventDispatcher_stop",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventDispatcher, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventDispatcher_stop" "', argument " "1"" of type '" "blpapi_EventDispatcher_t *""'"); + } + arg1 = reinterpret_cast< blpapi_EventDispatcher_t * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_EventDispatcher_stop" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + + try { + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_EventDispatcher_stop(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + } catch(std::out_of_range const& error) { + SWIG_exception(SWIG_IndexError, error.what()); + } catch(std::bad_alloc const& error) { + SWIG_exception(SWIG_MemoryError, error.what()); + } catch(std::overflow_error const& error) { + SWIG_exception(SWIG_OverflowError, error.what()); + } catch(std::invalid_argument const& error) { + SWIG_exception(SWIG_ValueError, error.what()); + } catch(std::runtime_error const& error) { + SWIG_exception(SWIG_RuntimeError, error.what()); + } catch(std::exception const& error) { + SWIG_exception(SWIG_UnknownError, error.what()); + } + + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_blpapi_Service_printHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; @@ -5076,6 +5171,66 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_printHelper(PyObject *SWI } +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_printHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + int arg2 ; + int arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + std::string result; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_SessionOptions_printHelper",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_printHelper" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_printHelper" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_SessionOptions_printHelper" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + + try { + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = blpapi_SessionOptions_printHelper(arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + } catch(std::out_of_range const& error) { + SWIG_exception(SWIG_IndexError, error.what()); + } catch(std::bad_alloc const& error) { + SWIG_exception(SWIG_MemoryError, error.what()); + } catch(std::overflow_error const& error) { + SWIG_exception(SWIG_OverflowError, error.what()); + } catch(std::invalid_argument const& error) { + SWIG_exception(SWIG_ValueError, error.what()); + } catch(std::runtime_error const& error) { + SWIG_exception(SWIG_RuntimeError, error.what()); + } catch(std::exception const& error) { + SWIG_exception(SWIG_UnknownError, error.what()); + } + + resultobj = SWIG_From_std_string(static_cast< std::string >(result)); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_hasElementDefinition(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; @@ -7824,27 +7979,20 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsHighPrecisionDatetime(PyObje size_t arg3 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; size_t val3 ; int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Element_getValueAsHighPrecisionDatetime",&obj0,&obj1,&obj2)) SWIG_fail; + arg2 = new blpapi_HighPrecisionDatetime_t; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Element_getValueAsHighPrecisionDatetime",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsHighPrecisionDatetime" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); } arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_getValueAsHighPrecisionDatetime" "', argument " "2"" of type '" "blpapi_HighPrecisionDatetime_t *""'"); - } - arg2 = reinterpret_cast< blpapi_HighPrecisionDatetime_t * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); + ecode3 = SWIG_AsVal_size_t(obj1, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getValueAsHighPrecisionDatetime" "', argument " "3"" of type '" "size_t""'"); } @@ -7871,8 +8019,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsHighPrecisionDatetime(PyObje } resultobj = SWIG_From_int(static_cast< int >(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((arg2), SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, SWIG_POINTER_OWN)); + arg2 = 0; + if(arg2) delete arg2; return resultobj; fail: + if(arg2) delete arg2; return NULL; } @@ -8336,66 +8488,6 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_setValueDatetime(PyObject *SWIGUNUSEDP } -SWIGINTERN PyObject *_wrap_blpapi_Element_setValueHighPrecisionDatetime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - blpapi_HighPrecisionDatetime_t *arg2 = (blpapi_HighPrecisionDatetime_t *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Element_setValueHighPrecisionDatetime",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setValueHighPrecisionDatetime" "', argument " "1"" of type '" "blpapi_Element_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setValueHighPrecisionDatetime" "', argument " "2"" of type '" "blpapi_HighPrecisionDatetime_t const *""'"); - } - arg2 = reinterpret_cast< blpapi_HighPrecisionDatetime_t * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_setValueHighPrecisionDatetime" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_setValueHighPrecisionDatetime(arg1,(blpapi_HighPrecisionDatetime_tag const *)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - SWIGINTERN PyObject *_wrap_blpapi_Element_setValueFromName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; @@ -8819,78 +8911,6 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_setElementDatetime(PyObject *SWIGUNUSE } -SWIGINTERN PyObject *_wrap_blpapi_Element_setElementHighPrecisionDatetime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - blpapi_HighPrecisionDatetime_t *arg4 = (blpapi_HighPrecisionDatetime_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Element_setElementHighPrecisionDatetime",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setElementHighPrecisionDatetime" "', argument " "1"" of type '" "blpapi_Element_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setElementHighPrecisionDatetime" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_setElementHighPrecisionDatetime" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_Name_t * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Element_setElementHighPrecisionDatetime" "', argument " "4"" of type '" "blpapi_HighPrecisionDatetime_t const *""'"); - } - arg4 = reinterpret_cast< blpapi_HighPrecisionDatetime_t * >(argp4); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_setElementHighPrecisionDatetime(arg1,(char const *)arg2,(blpapi_Name const *)arg3,(blpapi_HighPrecisionDatetime_tag const *)arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - SWIGINTERN PyObject *_wrap_blpapi_Element_setElementFromName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; @@ -9654,6 +9674,186 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendRecapMessageSeq(PyObject } +SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendFragmentedRecapMessage(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; + blpapi_Topic_t *arg4 = (blpapi_Topic_t *) 0 ; + blpapi_CorrelationId_t *arg5 = (blpapi_CorrelationId_t *) 0 ; + int arg6 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + void *argp5 = 0 ; + int res5 = 0 ; + int val6 ; + int ecode6 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOO:blpapi_EventFormatter_appendFragmentedRecapMessage",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessage" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); + } + arg1 = reinterpret_cast< blpapi_EventFormatter_t * >(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessage" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessage" "', argument " "3"" of type '" "blpapi_Name_t *""'"); + } + arg3 = reinterpret_cast< blpapi_Name_t * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessage" "', argument " "4"" of type '" "blpapi_Topic_t const *""'"); + } + arg4 = reinterpret_cast< blpapi_Topic_t * >(argp4); + res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res5)) { + SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessage" "', argument " "5"" of type '" "blpapi_CorrelationId_t const *""'"); + } + arg5 = reinterpret_cast< blpapi_CorrelationId_t * >(argp5); + ecode6 = SWIG_AsVal_int(obj5, &val6); + if (!SWIG_IsOK(ecode6)) { + SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessage" "', argument " "6"" of type '" "int""'"); + } + arg6 = static_cast< int >(val6); + + try { + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_EventFormatter_appendFragmentedRecapMessage(arg1,(char const *)arg2,arg3,(blpapi_Topic const *)arg4,(blpapi_CorrelationId_t_ const *)arg5,arg6); + SWIG_PYTHON_THREAD_END_ALLOW; + } + } catch(std::out_of_range const& error) { + SWIG_exception(SWIG_IndexError, error.what()); + } catch(std::bad_alloc const& error) { + SWIG_exception(SWIG_MemoryError, error.what()); + } catch(std::overflow_error const& error) { + SWIG_exception(SWIG_OverflowError, error.what()); + } catch(std::invalid_argument const& error) { + SWIG_exception(SWIG_ValueError, error.what()); + } catch(std::runtime_error const& error) { + SWIG_exception(SWIG_RuntimeError, error.what()); + } catch(std::exception const& error) { + SWIG_exception(SWIG_UnknownError, error.what()); + } + + resultobj = SWIG_From_int(static_cast< int >(result)); + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendFragmentedRecapMessageSeq(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; + blpapi_Topic_t *arg4 = (blpapi_Topic_t *) 0 ; + int arg5 ; + unsigned int arg6 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + int val5 ; + int ecode5 = 0 ; + unsigned int val6 ; + int ecode6 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOO:blpapi_EventFormatter_appendFragmentedRecapMessageSeq",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessageSeq" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); + } + arg1 = reinterpret_cast< blpapi_EventFormatter_t * >(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessageSeq" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessageSeq" "', argument " "3"" of type '" "blpapi_Name_t *""'"); + } + arg3 = reinterpret_cast< blpapi_Name_t * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessageSeq" "', argument " "4"" of type '" "blpapi_Topic_t const *""'"); + } + arg4 = reinterpret_cast< blpapi_Topic_t * >(argp4); + ecode5 = SWIG_AsVal_int(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessageSeq" "', argument " "5"" of type '" "int""'"); + } + arg5 = static_cast< int >(val5); + ecode6 = SWIG_AsVal_unsigned_SS_int(obj5, &val6); + if (!SWIG_IsOK(ecode6)) { + SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessageSeq" "', argument " "6"" of type '" "unsigned int""'"); + } + arg6 = static_cast< unsigned int >(val6); + + try { + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_EventFormatter_appendFragmentedRecapMessageSeq(arg1,(char const *)arg2,arg3,(blpapi_Topic const *)arg4,arg5,arg6); + SWIG_PYTHON_THREAD_END_ALLOW; + } + } catch(std::out_of_range const& error) { + SWIG_exception(SWIG_IndexError, error.what()); + } catch(std::bad_alloc const& error) { + SWIG_exception(SWIG_MemoryError, error.what()); + } catch(std::overflow_error const& error) { + SWIG_exception(SWIG_OverflowError, error.what()); + } catch(std::invalid_argument const& error) { + SWIG_exception(SWIG_ValueError, error.what()); + } catch(std::runtime_error const& error) { + SWIG_exception(SWIG_RuntimeError, error.what()); + } catch(std::exception const& error) { + SWIG_exception(SWIG_UnknownError, error.what()); + } + + resultobj = SWIG_From_int(static_cast< int >(result)); + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return NULL; +} + + SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueBool(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; @@ -10950,57 +11150,6 @@ SWIGINTERN PyObject *_wrap_blpapi_EventDispatcher_start(PyObject *SWIGUNUSEDPARM } -SWIGINTERN PyObject *_wrap_blpapi_EventDispatcher_stop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventDispatcher_t *arg1 = (blpapi_EventDispatcher_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_EventDispatcher_stop",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventDispatcher, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventDispatcher_stop" "', argument " "1"" of type '" "blpapi_EventDispatcher_t *""'"); - } - arg1 = reinterpret_cast< blpapi_EventDispatcher_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_EventDispatcher_stop" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventDispatcher_stop(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - SWIGINTERN PyObject *_wrap_ProviderSession_createHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; @@ -11095,27 +11244,42 @@ SWIGINTERN PyObject *_wrap_ProviderSession_destroyHelper(PyObject *SWIGUNUSEDPAR } -SWIGINTERN PyObject *_wrap_blpapi_getLastErrorDescription(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_ProviderSession_terminateSubscriptionsOnTopic(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - int arg1 ; - int val1 ; - int ecode1 = 0 ; + blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; + blpapi_Topic_t *arg2 = (blpapi_Topic_t *) 0 ; + char *arg3 = (char *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; PyObject * obj0 = 0 ; - char *result = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_getLastErrorDescription",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "blpapi_getLastErrorDescription" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); + if (!PyArg_ParseTuple(args,(char *)"OOO:ProviderSession_terminateSubscriptionsOnTopic",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProviderSession_terminateSubscriptionsOnTopic" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); + } + arg1 = reinterpret_cast< blpapi_ProviderSession_t * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProviderSession_terminateSubscriptionsOnTopic" "', argument " "2"" of type '" "blpapi_Topic_t const *""'"); + } + arg2 = reinterpret_cast< blpapi_Topic_t * >(argp2); + res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProviderSession_terminateSubscriptionsOnTopic" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = reinterpret_cast< char * >(buf3); try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_getLastErrorDescription(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (int)ProviderSession_terminateSubscriptionsOnTopic(arg1,(blpapi_Topic const *)arg2,(char const *)arg3); } catch(std::out_of_range const& error) { SWIG_exception(SWIG_IndexError, error.what()); } catch(std::bad_alloc const& error) { @@ -11130,19 +11294,114 @@ SWIGINTERN PyObject *_wrap_blpapi_getLastErrorDescription(PyObject *SWIGUNUSEDPA SWIG_exception(SWIG_UnknownError, error.what()); } - resultobj = SWIG_FromCharPtr((const char *)result); + resultobj = SWIG_From_int(static_cast< int >(result)); + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; return resultobj; fail: + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_ProviderSession_flushPublishedEvents(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SessionOptions_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":blpapi_SessionOptions_create")) SWIG_fail; - + blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + bool result; + + if (!PyArg_ParseTuple(args,(char *)"OO:ProviderSession_flushPublishedEvents",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProviderSession_flushPublishedEvents" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); + } + arg1 = reinterpret_cast< blpapi_ProviderSession_t * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProviderSession_flushPublishedEvents" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + + try { + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (bool)ProviderSession_flushPublishedEvents(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + } catch(std::out_of_range const& error) { + SWIG_exception(SWIG_IndexError, error.what()); + } catch(std::bad_alloc const& error) { + SWIG_exception(SWIG_MemoryError, error.what()); + } catch(std::overflow_error const& error) { + SWIG_exception(SWIG_OverflowError, error.what()); + } catch(std::invalid_argument const& error) { + SWIG_exception(SWIG_ValueError, error.what()); + } catch(std::runtime_error const& error) { + SWIG_exception(SWIG_RuntimeError, error.what()); + } catch(std::exception const& error) { + SWIG_exception(SWIG_UnknownError, error.what()); + } + + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_getLastErrorDescription(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int val1 ; + int ecode1 = 0 ; + PyObject * obj0 = 0 ; + char *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_getLastErrorDescription",&obj0)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "blpapi_getLastErrorDescription" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + + try { + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (char *)blpapi_getLastErrorDescription(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + } catch(std::out_of_range const& error) { + SWIG_exception(SWIG_IndexError, error.what()); + } catch(std::bad_alloc const& error) { + SWIG_exception(SWIG_MemoryError, error.what()); + } catch(std::overflow_error const& error) { + SWIG_exception(SWIG_OverflowError, error.what()); + } catch(std::invalid_argument const& error) { + SWIG_exception(SWIG_ValueError, error.what()); + } catch(std::runtime_error const& error) { + SWIG_exception(SWIG_RuntimeError, error.what()); + } catch(std::exception const& error) { + SWIG_exception(SWIG_UnknownError, error.what()); + } + + resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)":blpapi_SessionOptions_create")) SWIG_fail; + try { { SWIG_PYTHON_THREAD_BEGIN_ALLOW; @@ -12309,25 +12568,34 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setRecordSubscriptionDataReceiv } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_serverHost(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setServiceCheckTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + int arg2 ; void *argp1 = 0 ; int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; - char *result = 0 ; + PyObject * obj1 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_serverHost",&obj0)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setServiceCheckTimeout",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_serverHost" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setServiceCheckTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setServiceCheckTimeout" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); try { { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_SessionOptions_serverHost(arg1); + result = (int)blpapi_SessionOptions_setServiceCheckTimeout(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } } catch(std::out_of_range const& error) { @@ -12344,32 +12612,41 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_serverHost(PyObject *SWIGUNUSED SWIG_exception(SWIG_UnknownError, error.what()); } - resultobj = SWIG_FromCharPtr((const char *)result); + resultobj = SWIG_From_int(static_cast< int >(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_serverPort(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setServiceDownloadTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + int arg2 ; void *argp1 = 0 ; int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; - unsigned int result; + PyObject * obj1 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_serverPort",&obj0)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setServiceDownloadTimeout",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_serverPort" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setServiceDownloadTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setServiceDownloadTimeout" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); try { { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (unsigned int)blpapi_SessionOptions_serverPort(arg1); + result = (int)blpapi_SessionOptions_setServiceDownloadTimeout(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } } catch(std::out_of_range const& error) { @@ -12386,32 +12663,40 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_serverPort(PyObject *SWIGUNUSED SWIG_exception(SWIG_UnknownError, error.what()); } - resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)); + resultobj = SWIG_From_int(static_cast< int >(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_numServerAddresses(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setTlsOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + blpapi_TlsOptions_t *arg2 = (blpapi_TlsOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; PyObject * obj0 = 0 ; - int result; + PyObject * obj1 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_numServerAddresses",&obj0)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setTlsOptions",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_numServerAddresses" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setTlsOptions" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setTlsOptions" "', argument " "2"" of type '" "blpapi_TlsOptions_t const *""'"); + } + arg2 = reinterpret_cast< blpapi_TlsOptions_t * >(argp2); try { { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_numServerAddresses(arg1); + blpapi_SessionOptions_setTlsOptions(arg1,(blpapi_TlsOptions const *)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } } catch(std::out_of_range const& error) { @@ -12428,47 +12713,41 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_numServerAddresses(PyObject *SW SWIG_exception(SWIG_UnknownError, error.what()); } - resultobj = SWIG_From_int(static_cast< int >(result)); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_getServerAddress(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setFlushPublishedEventsTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - char **arg2 = (char **) 0 ; - unsigned short *arg3 = (unsigned short *) 0 ; - size_t arg4 ; + int arg2 ; void *argp1 = 0 ; int res1 = 0 ; - char *tempServerHost2 = 0 ; - unsigned short tempServerPort2 = 0 ; - size_t val4 ; - int ecode4 = 0 ; + int val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; - arg2 = &tempServerHost2; - arg3 = &tempServerPort2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_getServerAddress",&obj0,&obj1)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setFlushPublishedEventsTimeout",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_getServerAddress" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setFlushPublishedEventsTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - ecode4 = SWIG_AsVal_size_t(obj1, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_SessionOptions_getServerAddress" "', argument " "4"" of type '" "size_t""'"); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setFlushPublishedEventsTimeout" "', argument " "2"" of type '" "int""'"); } - arg4 = static_cast< size_t >(val4); + arg2 = static_cast< int >(val2); try { { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_getServerAddress(arg1,(char const **)arg2,arg3,arg4); + result = (int)blpapi_SessionOptions_setFlushPublishedEventsTimeout(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } } catch(std::out_of_range const& error) { @@ -12486,35 +12765,31 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_getServerAddress(PyObject *SWIG } resultobj = SWIG_From_int(static_cast< int >(result)); - { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int(*arg3)); - } return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_connectTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_serverHost(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - unsigned int result; + char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_connectTimeout",&obj0)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_serverHost",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_connectTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_serverHost" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); try { { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (unsigned int)blpapi_SessionOptions_connectTimeout(arg1); + result = (char *)blpapi_SessionOptions_serverHost(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } } catch(std::out_of_range const& error) { @@ -12531,32 +12806,32 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_connectTimeout(PyObject *SWIGUN SWIG_exception(SWIG_UnknownError, error.what()); } - resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)); + resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultServices(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_serverPort(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - char *result = 0 ; + unsigned int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_defaultServices",&obj0)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_serverPort",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_defaultServices" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_serverPort" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); try { { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_SessionOptions_defaultServices(arg1); + result = (unsigned int)blpapi_SessionOptions_serverPort(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } } catch(std::out_of_range const& error) { @@ -12573,32 +12848,32 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultServices(PyObject *SWIGU SWIG_exception(SWIG_UnknownError, error.what()); } - resultobj = SWIG_FromCharPtr((const char *)result); + resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultSubscriptionService(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_numServerAddresses(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - char *result = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_defaultSubscriptionService",&obj0)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_numServerAddresses",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_defaultSubscriptionService" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_numServerAddresses" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); try { { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_SessionOptions_defaultSubscriptionService(arg1); + result = (int)blpapi_SessionOptions_numServerAddresses(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } } catch(std::out_of_range const& error) { @@ -12615,32 +12890,47 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultSubscriptionService(PyOb SWIG_exception(SWIG_UnknownError, error.what()); } - resultobj = SWIG_FromCharPtr((const char *)result); + resultobj = SWIG_From_int(static_cast< int >(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultTopicPrefix(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_getServerAddress(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + char **arg2 = (char **) 0 ; + unsigned short *arg3 = (unsigned short *) 0 ; + size_t arg4 ; void *argp1 = 0 ; int res1 = 0 ; + char *tempServerHost2 = 0 ; + unsigned short tempServerPort2 = 0 ; + size_t val4 ; + int ecode4 = 0 ; PyObject * obj0 = 0 ; - char *result = 0 ; + PyObject * obj1 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_defaultTopicPrefix",&obj0)) SWIG_fail; + arg2 = &tempServerHost2; + arg3 = &tempServerPort2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_getServerAddress",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_defaultTopicPrefix" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_getServerAddress" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); + ecode4 = SWIG_AsVal_size_t(obj1, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_SessionOptions_getServerAddress" "', argument " "4"" of type '" "size_t""'"); + } + arg4 = static_cast< size_t >(val4); try { { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_SessionOptions_defaultTopicPrefix(arg1); + result = (int)blpapi_SessionOptions_getServerAddress(arg1,(char const **)arg2,arg3,arg4); SWIG_PYTHON_THREAD_END_ALLOW; } } catch(std::out_of_range const& error) { @@ -12657,32 +12947,36 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultTopicPrefix(PyObject *SW SWIG_exception(SWIG_UnknownError, error.what()); } - resultobj = SWIG_FromCharPtr((const char *)result); + resultobj = SWIG_From_int(static_cast< int >(result)); + { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int(*arg3)); + } return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_connectTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - int result; + unsigned int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg",&obj0)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_connectTimeout",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_connectTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); try { { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg(arg1); + result = (unsigned int)blpapi_SessionOptions_connectTimeout(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } } catch(std::out_of_range const& error) { @@ -12699,32 +12993,32 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg( SWIG_exception(SWIG_UnknownError, error.what()); } - resultobj = SWIG_From_int(static_cast< int >(result)); + resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_clientMode(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultServices(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - int result; + char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_clientMode",&obj0)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_defaultServices",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_clientMode" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_defaultServices" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); try { { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_clientMode(arg1); + result = (char *)blpapi_SessionOptions_defaultServices(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } } catch(std::out_of_range const& error) { @@ -12741,14 +13035,182 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_clientMode(PyObject *SWIGUNUSED SWIG_exception(SWIG_UnknownError, error.what()); } - resultobj = SWIG_From_int(static_cast< int >(result)); + resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_maxPendingRequests(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultSubscriptionService(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + char *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_defaultSubscriptionService",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_defaultSubscriptionService" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); + + try { + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (char *)blpapi_SessionOptions_defaultSubscriptionService(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + } catch(std::out_of_range const& error) { + SWIG_exception(SWIG_IndexError, error.what()); + } catch(std::bad_alloc const& error) { + SWIG_exception(SWIG_MemoryError, error.what()); + } catch(std::overflow_error const& error) { + SWIG_exception(SWIG_OverflowError, error.what()); + } catch(std::invalid_argument const& error) { + SWIG_exception(SWIG_ValueError, error.what()); + } catch(std::runtime_error const& error) { + SWIG_exception(SWIG_RuntimeError, error.what()); + } catch(std::exception const& error) { + SWIG_exception(SWIG_UnknownError, error.what()); + } + + resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultTopicPrefix(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + char *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_defaultTopicPrefix",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_defaultTopicPrefix" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); + + try { + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (char *)blpapi_SessionOptions_defaultTopicPrefix(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + } catch(std::out_of_range const& error) { + SWIG_exception(SWIG_IndexError, error.what()); + } catch(std::bad_alloc const& error) { + SWIG_exception(SWIG_MemoryError, error.what()); + } catch(std::overflow_error const& error) { + SWIG_exception(SWIG_OverflowError, error.what()); + } catch(std::invalid_argument const& error) { + SWIG_exception(SWIG_ValueError, error.what()); + } catch(std::runtime_error const& error) { + SWIG_exception(SWIG_RuntimeError, error.what()); + } catch(std::exception const& error) { + SWIG_exception(SWIG_UnknownError, error.what()); + } + + resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); + + try { + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + } catch(std::out_of_range const& error) { + SWIG_exception(SWIG_IndexError, error.what()); + } catch(std::bad_alloc const& error) { + SWIG_exception(SWIG_MemoryError, error.what()); + } catch(std::overflow_error const& error) { + SWIG_exception(SWIG_OverflowError, error.what()); + } catch(std::invalid_argument const& error) { + SWIG_exception(SWIG_ValueError, error.what()); + } catch(std::runtime_error const& error) { + SWIG_exception(SWIG_RuntimeError, error.what()); + } catch(std::exception const& error) { + SWIG_exception(SWIG_UnknownError, error.what()); + } + + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_clientMode(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_clientMode",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_clientMode" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); + + try { + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_clientMode(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + } catch(std::out_of_range const& error) { + SWIG_exception(SWIG_IndexError, error.what()); + } catch(std::bad_alloc const& error) { + SWIG_exception(SWIG_MemoryError, error.what()); + } catch(std::overflow_error const& error) { + SWIG_exception(SWIG_OverflowError, error.what()); + } catch(std::invalid_argument const& error) { + SWIG_exception(SWIG_ValueError, error.what()); + } catch(std::runtime_error const& error) { + SWIG_exception(SWIG_RuntimeError, error.what()); + } catch(std::exception const& error) { + SWIG_exception(SWIG_UnknownError, error.what()); + } + + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_maxPendingRequests(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; @@ -13048,19 +13510,375 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultKeepAliveInactivityTime( void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - int result; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_defaultKeepAliveInactivityTime",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_defaultKeepAliveInactivityTime" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); + + try { + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_defaultKeepAliveInactivityTime(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + } catch(std::out_of_range const& error) { + SWIG_exception(SWIG_IndexError, error.what()); + } catch(std::bad_alloc const& error) { + SWIG_exception(SWIG_MemoryError, error.what()); + } catch(std::overflow_error const& error) { + SWIG_exception(SWIG_OverflowError, error.what()); + } catch(std::invalid_argument const& error) { + SWIG_exception(SWIG_ValueError, error.what()); + } catch(std::runtime_error const& error) { + SWIG_exception(SWIG_RuntimeError, error.what()); + } catch(std::exception const& error) { + SWIG_exception(SWIG_UnknownError, error.what()); + } + + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultKeepAliveResponseTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_defaultKeepAliveResponseTimeout",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_defaultKeepAliveResponseTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); + + try { + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_defaultKeepAliveResponseTimeout(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + } catch(std::out_of_range const& error) { + SWIG_exception(SWIG_IndexError, error.what()); + } catch(std::bad_alloc const& error) { + SWIG_exception(SWIG_MemoryError, error.what()); + } catch(std::overflow_error const& error) { + SWIG_exception(SWIG_OverflowError, error.what()); + } catch(std::invalid_argument const& error) { + SWIG_exception(SWIG_ValueError, error.what()); + } catch(std::runtime_error const& error) { + SWIG_exception(SWIG_RuntimeError, error.what()); + } catch(std::exception const& error) { + SWIG_exception(SWIG_UnknownError, error.what()); + } + + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_keepAliveEnabled(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_keepAliveEnabled",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_keepAliveEnabled" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); + + try { + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_keepAliveEnabled(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + } catch(std::out_of_range const& error) { + SWIG_exception(SWIG_IndexError, error.what()); + } catch(std::bad_alloc const& error) { + SWIG_exception(SWIG_MemoryError, error.what()); + } catch(std::overflow_error const& error) { + SWIG_exception(SWIG_OverflowError, error.what()); + } catch(std::invalid_argument const& error) { + SWIG_exception(SWIG_ValueError, error.what()); + } catch(std::runtime_error const& error) { + SWIG_exception(SWIG_RuntimeError, error.what()); + } catch(std::exception const& error) { + SWIG_exception(SWIG_UnknownError, error.what()); + } + + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_recordSubscriptionDataReceiveTimes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_recordSubscriptionDataReceiveTimes",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_recordSubscriptionDataReceiveTimes" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); + + try { + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_recordSubscriptionDataReceiveTimes(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + } catch(std::out_of_range const& error) { + SWIG_exception(SWIG_IndexError, error.what()); + } catch(std::bad_alloc const& error) { + SWIG_exception(SWIG_MemoryError, error.what()); + } catch(std::overflow_error const& error) { + SWIG_exception(SWIG_OverflowError, error.what()); + } catch(std::invalid_argument const& error) { + SWIG_exception(SWIG_ValueError, error.what()); + } catch(std::runtime_error const& error) { + SWIG_exception(SWIG_RuntimeError, error.what()); + } catch(std::exception const& error) { + SWIG_exception(SWIG_UnknownError, error.what()); + } + + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_serviceCheckTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_serviceCheckTimeout",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_serviceCheckTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); + + try { + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_serviceCheckTimeout(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + } catch(std::out_of_range const& error) { + SWIG_exception(SWIG_IndexError, error.what()); + } catch(std::bad_alloc const& error) { + SWIG_exception(SWIG_MemoryError, error.what()); + } catch(std::overflow_error const& error) { + SWIG_exception(SWIG_OverflowError, error.what()); + } catch(std::invalid_argument const& error) { + SWIG_exception(SWIG_ValueError, error.what()); + } catch(std::runtime_error const& error) { + SWIG_exception(SWIG_RuntimeError, error.what()); + } catch(std::exception const& error) { + SWIG_exception(SWIG_UnknownError, error.what()); + } + + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_serviceDownloadTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_serviceDownloadTimeout",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_serviceDownloadTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); + + try { + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_serviceDownloadTimeout(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + } catch(std::out_of_range const& error) { + SWIG_exception(SWIG_IndexError, error.what()); + } catch(std::bad_alloc const& error) { + SWIG_exception(SWIG_MemoryError, error.what()); + } catch(std::overflow_error const& error) { + SWIG_exception(SWIG_OverflowError, error.what()); + } catch(std::invalid_argument const& error) { + SWIG_exception(SWIG_ValueError, error.what()); + } catch(std::runtime_error const& error) { + SWIG_exception(SWIG_RuntimeError, error.what()); + } catch(std::exception const& error) { + SWIG_exception(SWIG_UnknownError, error.what()); + } + + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_flushPublishedEventsTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_flushPublishedEventsTimeout",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_flushPublishedEventsTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); + + try { + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_flushPublishedEventsTimeout(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + } catch(std::out_of_range const& error) { + SWIG_exception(SWIG_IndexError, error.what()); + } catch(std::bad_alloc const& error) { + SWIG_exception(SWIG_MemoryError, error.what()); + } catch(std::overflow_error const& error) { + SWIG_exception(SWIG_OverflowError, error.what()); + } catch(std::invalid_argument const& error) { + SWIG_exception(SWIG_ValueError, error.what()); + } catch(std::runtime_error const& error) { + SWIG_exception(SWIG_RuntimeError, error.what()); + } catch(std::exception const& error) { + SWIG_exception(SWIG_UnknownError, error.what()); + } + + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_TlsOptions_t *arg1 = (blpapi_TlsOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_TlsOptions_destroy",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TlsOptions_destroy" "', argument " "1"" of type '" "blpapi_TlsOptions_t *""'"); + } + arg1 = reinterpret_cast< blpapi_TlsOptions_t * >(argp1); + + try { + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_TlsOptions_destroy(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + } catch(std::out_of_range const& error) { + SWIG_exception(SWIG_IndexError, error.what()); + } catch(std::bad_alloc const& error) { + SWIG_exception(SWIG_MemoryError, error.what()); + } catch(std::overflow_error const& error) { + SWIG_exception(SWIG_OverflowError, error.what()); + } catch(std::invalid_argument const& error) { + SWIG_exception(SWIG_ValueError, error.what()); + } catch(std::runtime_error const& error) { + SWIG_exception(SWIG_RuntimeError, error.what()); + } catch(std::exception const& error) { + SWIG_exception(SWIG_UnknownError, error.what()); + } + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_createFromFiles(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + char *arg1 = (char *) 0 ; + char *arg2 = (char *) 0 ; + char *arg3 = (char *) 0 ; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + blpapi_TlsOptions_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_defaultKeepAliveInactivityTime",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_TlsOptions_createFromFiles",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_defaultKeepAliveInactivityTime" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TlsOptions_createFromFiles" "', argument " "1"" of type '" "char const *""'"); } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); + arg1 = reinterpret_cast< char * >(buf1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_TlsOptions_createFromFiles" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_TlsOptions_createFromFiles" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = reinterpret_cast< char * >(buf3); try { { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_defaultKeepAliveInactivityTime(arg1); + result = (blpapi_TlsOptions_t *)blpapi_TlsOptions_createFromFiles((char const *)arg1,(char const *)arg2,(char const *)arg3); SWIG_PYTHON_THREAD_END_ALLOW; } } catch(std::out_of_range const& error) { @@ -13077,32 +13895,69 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultKeepAliveInactivityTime( SWIG_exception(SWIG_UnknownError, error.what()); } - resultobj = SWIG_From_int(static_cast< int >(result)); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); + if (alloc1 == SWIG_NEWOBJ) delete[] buf1; + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; return resultobj; fail: + if (alloc1 == SWIG_NEWOBJ) delete[] buf1; + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultKeepAliveResponseTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_createFromBlobs(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; + char *arg1 = (char *) 0 ; + int arg2 ; + char *arg3 = (char *) 0 ; + char *arg4 = (char *) 0 ; + int arg5 ; + int res1 ; + Py_ssize_t size1 = 0 ; + void const *buf1 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + int res4 ; + Py_ssize_t size4 = 0 ; + void const *buf4 = 0 ; PyObject * obj0 = 0 ; - int result; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + blpapi_TlsOptions_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_defaultKeepAliveResponseTimeout",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_defaultKeepAliveResponseTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_TlsOptions_createFromBlobs",&obj0,&obj1,&obj2)) SWIG_fail; + { + res1 = PyObject_AsReadBuffer(obj0, &buf1, &size1); + if (res1<0) { + PyErr_Clear(); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TlsOptions_createFromBlobs" "', argument " "1"" of type '" "(const char *clientCredentialsRawData, int clientCredentialsRawDataLength)""'"); + } + arg1 = (char *) buf1; + arg2 = (int) (size1 / sizeof(char const)); + } + res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_TlsOptions_createFromBlobs" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = reinterpret_cast< char * >(buf3); + { + res4 = PyObject_AsReadBuffer(obj2, &buf4, &size4); + if (res4<0) { + PyErr_Clear(); + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_TlsOptions_createFromBlobs" "', argument " "4"" of type '" "(const char *trustedCertificatesRawData, int trustedCertificatesRawDataLength)""'"); + } + arg4 = (char *) buf4; + arg5 = (int) (size4 / sizeof(char const)); } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); try { { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_defaultKeepAliveResponseTimeout(arg1); + result = (blpapi_TlsOptions_t *)blpapi_TlsOptions_createFromBlobs((char const *)arg1,arg2,(char const *)arg3,(char const *)arg4,arg5); SWIG_PYTHON_THREAD_END_ALLOW; } } catch(std::out_of_range const& error) { @@ -13119,32 +13974,42 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultKeepAliveResponseTimeout SWIG_exception(SWIG_UnknownError, error.what()); } - resultobj = SWIG_From_int(static_cast< int >(result)); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; return resultobj; fail: + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_keepAliveEnabled(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_setTlsHandshakeTimeoutMs(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + blpapi_TlsOptions_t *arg1 = (blpapi_TlsOptions_t *) 0 ; + int arg2 ; void *argp1 = 0 ; int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; - int result; + PyObject * obj1 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_keepAliveEnabled",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TlsOptions_setTlsHandshakeTimeoutMs",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_keepAliveEnabled" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TlsOptions_setTlsHandshakeTimeoutMs" "', argument " "1"" of type '" "blpapi_TlsOptions_t *""'"); } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); + arg1 = reinterpret_cast< blpapi_TlsOptions_t * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_TlsOptions_setTlsHandshakeTimeoutMs" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); try { { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_keepAliveEnabled(arg1); + blpapi_TlsOptions_setTlsHandshakeTimeoutMs(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } } catch(std::out_of_range const& error) { @@ -13161,32 +14026,40 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_keepAliveEnabled(PyObject *SWIG SWIG_exception(SWIG_UnknownError, error.what()); } - resultobj = SWIG_From_int(static_cast< int >(result)); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_recordSubscriptionDataReceiveTimes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_setCrlFetchTimeoutMs(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + blpapi_TlsOptions_t *arg1 = (blpapi_TlsOptions_t *) 0 ; + int arg2 ; void *argp1 = 0 ; int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; - int result; + PyObject * obj1 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_recordSubscriptionDataReceiveTimes",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TlsOptions_setCrlFetchTimeoutMs",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_recordSubscriptionDataReceiveTimes" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TlsOptions_setCrlFetchTimeoutMs" "', argument " "1"" of type '" "blpapi_TlsOptions_t *""'"); } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); + arg1 = reinterpret_cast< blpapi_TlsOptions_t * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_TlsOptions_setCrlFetchTimeoutMs" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); try { { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_recordSubscriptionDataReceiveTimes(arg1); + blpapi_TlsOptions_setCrlFetchTimeoutMs(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } } catch(std::out_of_range const& error) { @@ -13203,7 +14076,7 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_recordSubscriptionDataReceiveTi SWIG_exception(SWIG_UnknownError, error.what()); } - resultobj = SWIG_From_int(static_cast< int >(result)); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; @@ -16599,6 +17472,48 @@ SWIGINTERN PyObject *_wrap_blpapi_Request_setPreferredRoute(PyObject *SWIGUNUSED } +SWIGINTERN PyObject *_wrap_blpapi_RequestTemplate_release(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_RequestTemplate_t *arg1 = (blpapi_RequestTemplate_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_RequestTemplate_release",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_RequestTemplate, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_RequestTemplate_release" "', argument " "1"" of type '" "blpapi_RequestTemplate_t const *""'"); + } + arg1 = reinterpret_cast< blpapi_RequestTemplate_t * >(argp1); + + try { + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_RequestTemplate_release((blpapi_RequestTemplate const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + } catch(std::out_of_range const& error) { + SWIG_exception(SWIG_IndexError, error.what()); + } catch(std::bad_alloc const& error) { + SWIG_exception(SWIG_MemoryError, error.what()); + } catch(std::overflow_error const& error) { + SWIG_exception(SWIG_OverflowError, error.what()); + } catch(std::invalid_argument const& error) { + SWIG_exception(SWIG_ValueError, error.what()); + } catch(std::runtime_error const& error) { + SWIG_exception(SWIG_RuntimeError, error.what()); + } catch(std::exception const& error) { + SWIG_exception(SWIG_UnknownError, error.what()); + } + + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_blpapi_Operation_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_Operation_t *arg1 = (blpapi_Operation_t *) 0 ; @@ -17907,7 +18822,133 @@ SWIGINTERN PyObject *_wrap_blpapi_Message_fragmentType(PyObject *SWIGUNUSEDPARM( try { { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Message_fragmentType((blpapi_Message const *)arg1); + result = (int)blpapi_Message_fragmentType((blpapi_Message const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + } catch(std::out_of_range const& error) { + SWIG_exception(SWIG_IndexError, error.what()); + } catch(std::bad_alloc const& error) { + SWIG_exception(SWIG_MemoryError, error.what()); + } catch(std::overflow_error const& error) { + SWIG_exception(SWIG_OverflowError, error.what()); + } catch(std::invalid_argument const& error) { + SWIG_exception(SWIG_ValueError, error.what()); + } catch(std::runtime_error const& error) { + SWIG_exception(SWIG_RuntimeError, error.what()); + } catch(std::exception const& error) { + SWIG_exception(SWIG_UnknownError, error.what()); + } + + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Message_recapType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_recapType",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_recapType" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); + } + arg1 = reinterpret_cast< blpapi_Message_t * >(argp1); + + try { + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Message_recapType((blpapi_Message const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + } catch(std::out_of_range const& error) { + SWIG_exception(SWIG_IndexError, error.what()); + } catch(std::bad_alloc const& error) { + SWIG_exception(SWIG_MemoryError, error.what()); + } catch(std::overflow_error const& error) { + SWIG_exception(SWIG_OverflowError, error.what()); + } catch(std::invalid_argument const& error) { + SWIG_exception(SWIG_ValueError, error.what()); + } catch(std::runtime_error const& error) { + SWIG_exception(SWIG_RuntimeError, error.what()); + } catch(std::exception const& error) { + SWIG_exception(SWIG_UnknownError, error.what()); + } + + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Message_print(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; + blpapi_StreamWriter_t arg2 ; + void *arg3 = (void *) 0 ; + int arg4 ; + int arg5 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 ; + int res2 = 0 ; + int res3 ; + int val4 ; + int ecode4 = 0 ; + int val5 ; + int ecode5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOOO:blpapi_Message_print",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_print" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); + } + arg1 = reinterpret_cast< blpapi_Message_t * >(argp1); + { + res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_blpapi_StreamWriter_t, 0 | 0); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Message_print" "', argument " "2"" of type '" "blpapi_StreamWriter_t""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "blpapi_Message_print" "', argument " "2"" of type '" "blpapi_StreamWriter_t""'"); + } else { + blpapi_StreamWriter_t * temp = reinterpret_cast< blpapi_StreamWriter_t * >(argp2); + arg2 = *temp; + if (SWIG_IsNewObj(res2)) delete temp; + } + } + res3 = SWIG_ConvertPtr(obj2,SWIG_as_voidptrptr(&arg3), 0, 0); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Message_print" "', argument " "3"" of type '" "void *""'"); + } + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_Message_print" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + ecode5 = SWIG_AsVal_int(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_Message_print" "', argument " "5"" of type '" "int""'"); + } + arg5 = static_cast< int >(val5); + + try { + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Message_print((blpapi_Message const *)arg1,arg2,arg3,arg4,arg5); SWIG_PYTHON_THREAD_END_ALLOW; } } catch(std::out_of_range const& error) { @@ -19132,6 +20173,90 @@ SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_generateToken(PyObject *SWIGUN } +SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_generateManualToken(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; + blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; + char *arg3 = (char *) 0 ; + char *arg4 = (char *) 0 ; + blpapi_EventQueue_t *arg5 = (blpapi_EventQueue_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + int res4 ; + char *buf4 = 0 ; + int alloc4 = 0 ; + void *argp5 = 0 ; + int res5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOOO:blpapi_AbstractSession_generateManualToken",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_generateManualToken" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); + } + arg1 = reinterpret_cast< blpapi_AbstractSession_t * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_generateManualToken" "', argument " "2"" of type '" "blpapi_CorrelationId_t *""'"); + } + arg2 = reinterpret_cast< blpapi_CorrelationId_t * >(argp2); + res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AbstractSession_generateManualToken" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = reinterpret_cast< char * >(buf3); + res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_AbstractSession_generateManualToken" "', argument " "4"" of type '" "char const *""'"); + } + arg4 = reinterpret_cast< char * >(buf4); + res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); + if (!SWIG_IsOK(res5)) { + SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "blpapi_AbstractSession_generateManualToken" "', argument " "5"" of type '" "blpapi_EventQueue_t *""'"); + } + arg5 = reinterpret_cast< blpapi_EventQueue_t * >(argp5); + + try { + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_AbstractSession_generateManualToken(arg1,arg2,(char const *)arg3,(char const *)arg4,arg5); + SWIG_PYTHON_THREAD_END_ALLOW; + } + } catch(std::out_of_range const& error) { + SWIG_exception(SWIG_IndexError, error.what()); + } catch(std::bad_alloc const& error) { + SWIG_exception(SWIG_MemoryError, error.what()); + } catch(std::overflow_error const& error) { + SWIG_exception(SWIG_OverflowError, error.what()); + } catch(std::invalid_argument const& error) { + SWIG_exception(SWIG_ValueError, error.what()); + } catch(std::runtime_error const& error) { + SWIG_exception(SWIG_RuntimeError, error.what()); + } catch(std::exception const& error) { + SWIG_exception(SWIG_UnknownError, error.what()); + } + + resultobj = SWIG_From_int(static_cast< int >(result)); + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + if (alloc4 == SWIG_NEWOBJ) delete[] buf4; + return resultobj; +fail: + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + if (alloc4 == SWIG_NEWOBJ) delete[] buf4; + return NULL; +} + + SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_getService(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; @@ -19975,6 +21100,142 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_sendRequest(PyObject *SWIGUNUSEDPARM(s } +SWIGINTERN PyObject *_wrap_blpapi_Session_sendRequestTemplate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; + blpapi_RequestTemplate_t *arg2 = (blpapi_RequestTemplate_t *) 0 ; + blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Session_sendRequestTemplate",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_sendRequestTemplate" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + } + arg1 = reinterpret_cast< blpapi_Session_t * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_RequestTemplate, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_sendRequestTemplate" "', argument " "2"" of type '" "blpapi_RequestTemplate_t const *""'"); + } + arg2 = reinterpret_cast< blpapi_RequestTemplate_t * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_sendRequestTemplate" "', argument " "3"" of type '" "blpapi_CorrelationId_t *""'"); + } + arg3 = reinterpret_cast< blpapi_CorrelationId_t * >(argp3); + + try { + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Session_sendRequestTemplate(arg1,(blpapi_RequestTemplate const *)arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + } catch(std::out_of_range const& error) { + SWIG_exception(SWIG_IndexError, error.what()); + } catch(std::bad_alloc const& error) { + SWIG_exception(SWIG_MemoryError, error.what()); + } catch(std::overflow_error const& error) { + SWIG_exception(SWIG_OverflowError, error.what()); + } catch(std::invalid_argument const& error) { + SWIG_exception(SWIG_ValueError, error.what()); + } catch(std::runtime_error const& error) { + SWIG_exception(SWIG_RuntimeError, error.what()); + } catch(std::exception const& error) { + SWIG_exception(SWIG_UnknownError, error.what()); + } + + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Session_createSnapshotRequestTemplate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_RequestTemplate_t **arg1 = (blpapi_RequestTemplate_t **) 0 ; + blpapi_Session_t *arg2 = (blpapi_Session_t *) 0 ; + char *arg3 = (char *) 0 ; + blpapi_Identity_t *arg4 = (blpapi_Identity_t *) 0 ; + blpapi_CorrelationId_t *arg5 = (blpapi_CorrelationId_t *) 0 ; + blpapi_RequestTemplate_t *temp1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + void *argp5 = 0 ; + int res5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + int result; + + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Session_createSnapshotRequestTemplate",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_createSnapshotRequestTemplate" "', argument " "2"" of type '" "blpapi_Session_t *""'"); + } + arg2 = reinterpret_cast< blpapi_Session_t * >(argp2); + res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_createSnapshotRequestTemplate" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = reinterpret_cast< char * >(buf3); + res4 = SWIG_ConvertPtr(obj2, &argp4,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Session_createSnapshotRequestTemplate" "', argument " "4"" of type '" "blpapi_Identity_t const *""'"); + } + arg4 = reinterpret_cast< blpapi_Identity_t * >(argp4); + res5 = SWIG_ConvertPtr(obj3, &argp5,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res5)) { + SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "blpapi_Session_createSnapshotRequestTemplate" "', argument " "5"" of type '" "blpapi_CorrelationId_t *""'"); + } + arg5 = reinterpret_cast< blpapi_CorrelationId_t * >(argp5); + + try { + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Session_createSnapshotRequestTemplate(arg1,arg2,(char const *)arg3,(blpapi_Identity const *)arg4,arg5); + SWIG_PYTHON_THREAD_END_ALLOW; + } + } catch(std::out_of_range const& error) { + SWIG_exception(SWIG_IndexError, error.what()); + } catch(std::bad_alloc const& error) { + SWIG_exception(SWIG_MemoryError, error.what()); + } catch(std::overflow_error const& error) { + SWIG_exception(SWIG_OverflowError, error.what()); + } catch(std::invalid_argument const& error) { + SWIG_exception(SWIG_ValueError, error.what()); + } catch(std::runtime_error const& error) { + SWIG_exception(SWIG_RuntimeError, error.what()); + } catch(std::exception const& error) { + SWIG_exception(SWIG_UnknownError, error.what()); + } + + resultobj = SWIG_From_int(static_cast< int >(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_RequestTemplate, 0)); + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + return resultobj; +fail: + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + return NULL; +} + + SWIGINTERN PyObject *_wrap_blpapi_Session_getAbstractSession(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; @@ -22992,6 +24253,78 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_deleteTopics(PyObject *SWIGUNU } +SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_terminateSubscriptionsOnTopics(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; + blpapi_Topic_t **arg2 = (blpapi_Topic_t **) 0 ; + size_t arg3 ; + char *arg4 = (char *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; + int res4 ; + char *buf4 = 0 ; + int alloc4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_ProviderSession_terminateSubscriptionsOnTopics",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_terminateSubscriptionsOnTopics" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); + } + arg1 = reinterpret_cast< blpapi_ProviderSession_t * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_p_blpapi_Topic, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_terminateSubscriptionsOnTopics" "', argument " "2"" of type '" "blpapi_Topic_t const **""'"); + } + arg2 = reinterpret_cast< blpapi_Topic_t ** >(argp2); + ecode3 = SWIG_AsVal_size_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_terminateSubscriptionsOnTopics" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = static_cast< size_t >(val3); + res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_ProviderSession_terminateSubscriptionsOnTopics" "', argument " "4"" of type '" "char const *""'"); + } + arg4 = reinterpret_cast< char * >(buf4); + + try { + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ProviderSession_terminateSubscriptionsOnTopics(arg1,(blpapi_Topic const **)arg2,arg3,(char const *)arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + } catch(std::out_of_range const& error) { + SWIG_exception(SWIG_IndexError, error.what()); + } catch(std::bad_alloc const& error) { + SWIG_exception(SWIG_MemoryError, error.what()); + } catch(std::overflow_error const& error) { + SWIG_exception(SWIG_OverflowError, error.what()); + } catch(std::invalid_argument const& error) { + SWIG_exception(SWIG_ValueError, error.what()); + } catch(std::runtime_error const& error) { + SWIG_exception(SWIG_RuntimeError, error.what()); + } catch(std::exception const& error) { + SWIG_exception(SWIG_UnknownError, error.what()); + } + + resultobj = SWIG_From_int(static_cast< int >(result)); + if (alloc4 == SWIG_NEWOBJ) delete[] buf4; + return resultobj; +fail: + if (alloc4 == SWIG_NEWOBJ) delete[] buf4; + return NULL; +} + + SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_publish(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; @@ -23718,9 +25051,11 @@ static PyMethodDef SwigMethods[] = { { (char *)"blpapi_DiagnosticsUtil_memoryInfo_wrapper", _wrap_blpapi_DiagnosticsUtil_memoryInfo_wrapper, METH_VARARGS, NULL}, { (char *)"blpapi_Message_timeReceived_wrapper", _wrap_blpapi_Message_timeReceived_wrapper, METH_VARARGS, NULL}, { (char *)"blpapi_HighResolutionClock_now_wrapper", _wrap_blpapi_HighResolutionClock_now_wrapper, METH_VARARGS, NULL}, + { (char *)"blpapi_EventDispatcher_stop", _wrap_blpapi_EventDispatcher_stop, METH_VARARGS, NULL}, { (char *)"blpapi_Service_printHelper", _wrap_blpapi_Service_printHelper, METH_VARARGS, NULL}, { (char *)"blpapi_SchemaElementDefinition_printHelper", _wrap_blpapi_SchemaElementDefinition_printHelper, METH_VARARGS, NULL}, { (char *)"blpapi_SchemaTypeDefinition_printHelper", _wrap_blpapi_SchemaTypeDefinition_printHelper, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_printHelper", _wrap_blpapi_SessionOptions_printHelper, METH_VARARGS, NULL}, { (char *)"blpapi_SchemaTypeDefinition_hasElementDefinition", _wrap_blpapi_SchemaTypeDefinition_hasElementDefinition, METH_VARARGS, NULL}, { (char *)"blpapi_ConstantList_hasConstant", _wrap_blpapi_ConstantList_hasConstant, METH_VARARGS, NULL}, { (char *)"blpapi_Service_hasEventDefinition", _wrap_blpapi_Service_hasEventDefinition, METH_VARARGS, NULL}, @@ -23828,14 +25163,12 @@ static PyMethodDef SwigMethods[] = { { (char *)"blpapi_Element_setValueInt64", _wrap_blpapi_Element_setValueInt64, METH_VARARGS, NULL}, { (char *)"blpapi_Element_setValueString", _wrap_blpapi_Element_setValueString, METH_VARARGS, NULL}, { (char *)"blpapi_Element_setValueDatetime", _wrap_blpapi_Element_setValueDatetime, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_setValueHighPrecisionDatetime", _wrap_blpapi_Element_setValueHighPrecisionDatetime, METH_VARARGS, NULL}, { (char *)"blpapi_Element_setValueFromName", _wrap_blpapi_Element_setValueFromName, METH_VARARGS, NULL}, { (char *)"blpapi_Element_setElementBool", _wrap_blpapi_Element_setElementBool, METH_VARARGS, NULL}, { (char *)"blpapi_Element_setElementInt32", _wrap_blpapi_Element_setElementInt32, METH_VARARGS, NULL}, { (char *)"blpapi_Element_setElementInt64", _wrap_blpapi_Element_setElementInt64, METH_VARARGS, NULL}, { (char *)"blpapi_Element_setElementString", _wrap_blpapi_Element_setElementString, METH_VARARGS, NULL}, { (char *)"blpapi_Element_setElementDatetime", _wrap_blpapi_Element_setElementDatetime, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_setElementHighPrecisionDatetime", _wrap_blpapi_Element_setElementHighPrecisionDatetime, METH_VARARGS, NULL}, { (char *)"blpapi_Element_setElementFromName", _wrap_blpapi_Element_setElementFromName, METH_VARARGS, NULL}, { (char *)"blpapi_Element_appendElement", _wrap_blpapi_Element_appendElement, METH_VARARGS, NULL}, { (char *)"blpapi_Element_setChoice", _wrap_blpapi_Element_setChoice, METH_VARARGS, NULL}, @@ -23848,6 +25181,8 @@ static PyMethodDef SwigMethods[] = { { (char *)"blpapi_EventFormatter_appendResponse", _wrap_blpapi_EventFormatter_appendResponse, METH_VARARGS, NULL}, { (char *)"blpapi_EventFormatter_appendRecapMessage", _wrap_blpapi_EventFormatter_appendRecapMessage, METH_VARARGS, NULL}, { (char *)"blpapi_EventFormatter_appendRecapMessageSeq", _wrap_blpapi_EventFormatter_appendRecapMessageSeq, METH_VARARGS, NULL}, + { (char *)"blpapi_EventFormatter_appendFragmentedRecapMessage", _wrap_blpapi_EventFormatter_appendFragmentedRecapMessage, METH_VARARGS, NULL}, + { (char *)"blpapi_EventFormatter_appendFragmentedRecapMessageSeq", _wrap_blpapi_EventFormatter_appendFragmentedRecapMessageSeq, METH_VARARGS, NULL}, { (char *)"blpapi_EventFormatter_setValueBool", _wrap_blpapi_EventFormatter_setValueBool, METH_VARARGS, NULL}, { (char *)"blpapi_EventFormatter_setValueChar", _wrap_blpapi_EventFormatter_setValueChar, METH_VARARGS, NULL}, { (char *)"blpapi_EventFormatter_setValueInt32", _wrap_blpapi_EventFormatter_setValueInt32, METH_VARARGS, NULL}, @@ -23871,9 +25206,10 @@ static PyMethodDef SwigMethods[] = { { (char *)"blpapi_EventDispatcher_create", _wrap_blpapi_EventDispatcher_create, METH_VARARGS, NULL}, { (char *)"blpapi_EventDispatcher_destroy", _wrap_blpapi_EventDispatcher_destroy, METH_VARARGS, NULL}, { (char *)"blpapi_EventDispatcher_start", _wrap_blpapi_EventDispatcher_start, METH_VARARGS, NULL}, - { (char *)"blpapi_EventDispatcher_stop", _wrap_blpapi_EventDispatcher_stop, METH_VARARGS, NULL}, { (char *)"ProviderSession_createHelper", _wrap_ProviderSession_createHelper, METH_VARARGS, NULL}, { (char *)"ProviderSession_destroyHelper", _wrap_ProviderSession_destroyHelper, METH_VARARGS, NULL}, + { (char *)"ProviderSession_terminateSubscriptionsOnTopic", _wrap_ProviderSession_terminateSubscriptionsOnTopic, METH_VARARGS, NULL}, + { (char *)"ProviderSession_flushPublishedEvents", _wrap_ProviderSession_flushPublishedEvents, METH_VARARGS, NULL}, { (char *)"blpapi_getLastErrorDescription", _wrap_blpapi_getLastErrorDescription, METH_VARARGS, NULL}, { (char *)"blpapi_SessionOptions_create", _wrap_blpapi_SessionOptions_create, METH_VARARGS, NULL}, { (char *)"blpapi_SessionOptions_destroy", _wrap_blpapi_SessionOptions_destroy, METH_VARARGS, NULL}, @@ -23898,6 +25234,10 @@ static PyMethodDef SwigMethods[] = { { (char *)"blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout", _wrap_blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout, METH_VARARGS, NULL}, { (char *)"blpapi_SessionOptions_setKeepAliveEnabled", _wrap_blpapi_SessionOptions_setKeepAliveEnabled, METH_VARARGS, NULL}, { (char *)"blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes", _wrap_blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_setServiceCheckTimeout", _wrap_blpapi_SessionOptions_setServiceCheckTimeout, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_setServiceDownloadTimeout", _wrap_blpapi_SessionOptions_setServiceDownloadTimeout, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_setTlsOptions", _wrap_blpapi_SessionOptions_setTlsOptions, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_setFlushPublishedEventsTimeout", _wrap_blpapi_SessionOptions_setFlushPublishedEventsTimeout, METH_VARARGS, NULL}, { (char *)"blpapi_SessionOptions_serverHost", _wrap_blpapi_SessionOptions_serverHost, METH_VARARGS, NULL}, { (char *)"blpapi_SessionOptions_serverPort", _wrap_blpapi_SessionOptions_serverPort, METH_VARARGS, NULL}, { (char *)"blpapi_SessionOptions_numServerAddresses", _wrap_blpapi_SessionOptions_numServerAddresses, METH_VARARGS, NULL}, @@ -23919,6 +25259,14 @@ static PyMethodDef SwigMethods[] = { { (char *)"blpapi_SessionOptions_defaultKeepAliveResponseTimeout", _wrap_blpapi_SessionOptions_defaultKeepAliveResponseTimeout, METH_VARARGS, NULL}, { (char *)"blpapi_SessionOptions_keepAliveEnabled", _wrap_blpapi_SessionOptions_keepAliveEnabled, METH_VARARGS, NULL}, { (char *)"blpapi_SessionOptions_recordSubscriptionDataReceiveTimes", _wrap_blpapi_SessionOptions_recordSubscriptionDataReceiveTimes, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_serviceCheckTimeout", _wrap_blpapi_SessionOptions_serviceCheckTimeout, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_serviceDownloadTimeout", _wrap_blpapi_SessionOptions_serviceDownloadTimeout, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_flushPublishedEventsTimeout", _wrap_blpapi_SessionOptions_flushPublishedEventsTimeout, METH_VARARGS, NULL}, + { (char *)"blpapi_TlsOptions_destroy", _wrap_blpapi_TlsOptions_destroy, METH_VARARGS, NULL}, + { (char *)"blpapi_TlsOptions_createFromFiles", _wrap_blpapi_TlsOptions_createFromFiles, METH_VARARGS, NULL}, + { (char *)"blpapi_TlsOptions_createFromBlobs", _wrap_blpapi_TlsOptions_createFromBlobs, METH_VARARGS, NULL}, + { (char *)"blpapi_TlsOptions_setTlsHandshakeTimeoutMs", _wrap_blpapi_TlsOptions_setTlsHandshakeTimeoutMs, METH_VARARGS, NULL}, + { (char *)"blpapi_TlsOptions_setCrlFetchTimeoutMs", _wrap_blpapi_TlsOptions_setCrlFetchTimeoutMs, METH_VARARGS, NULL}, { (char *)"blpapi_Name_create", _wrap_blpapi_Name_create, METH_VARARGS, NULL}, { (char *)"blpapi_Name_destroy", _wrap_blpapi_Name_destroy, METH_VARARGS, NULL}, { (char *)"blpapi_Name_equalsStr", _wrap_blpapi_Name_equalsStr, METH_VARARGS, NULL}, @@ -24002,6 +25350,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"blpapi_Request_destroy", _wrap_blpapi_Request_destroy, METH_VARARGS, NULL}, { (char *)"blpapi_Request_elements", _wrap_blpapi_Request_elements, METH_VARARGS, NULL}, { (char *)"blpapi_Request_setPreferredRoute", _wrap_blpapi_Request_setPreferredRoute, METH_VARARGS, NULL}, + { (char *)"blpapi_RequestTemplate_release", _wrap_blpapi_RequestTemplate_release, METH_VARARGS, NULL}, { (char *)"blpapi_Operation_name", _wrap_blpapi_Operation_name, METH_VARARGS, NULL}, { (char *)"blpapi_Operation_description", _wrap_blpapi_Operation_description, METH_VARARGS, NULL}, { (char *)"blpapi_Operation_requestDefinition", _wrap_blpapi_Operation_requestDefinition, METH_VARARGS, NULL}, @@ -24030,6 +25379,8 @@ static PyMethodDef SwigMethods[] = { { (char *)"blpapi_Message_correlationId", _wrap_blpapi_Message_correlationId, METH_VARARGS, NULL}, { (char *)"blpapi_Message_elements", _wrap_blpapi_Message_elements, METH_VARARGS, NULL}, { (char *)"blpapi_Message_fragmentType", _wrap_blpapi_Message_fragmentType, METH_VARARGS, NULL}, + { (char *)"blpapi_Message_recapType", _wrap_blpapi_Message_recapType, METH_VARARGS, NULL}, + { (char *)"blpapi_Message_print", _wrap_blpapi_Message_print, METH_VARARGS, NULL}, { (char *)"blpapi_Message_addRef", _wrap_blpapi_Message_addRef, METH_VARARGS, NULL}, { (char *)"blpapi_Message_release", _wrap_blpapi_Message_release, METH_VARARGS, NULL}, { (char *)"blpapi_Message_timeReceived", _wrap_blpapi_Message_timeReceived, METH_VARARGS, NULL}, @@ -24053,6 +25404,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"blpapi_AbstractSession_openService", _wrap_blpapi_AbstractSession_openService, METH_VARARGS, NULL}, { (char *)"blpapi_AbstractSession_openServiceAsync", _wrap_blpapi_AbstractSession_openServiceAsync, METH_VARARGS, NULL}, { (char *)"blpapi_AbstractSession_generateToken", _wrap_blpapi_AbstractSession_generateToken, METH_VARARGS, NULL}, + { (char *)"blpapi_AbstractSession_generateManualToken", _wrap_blpapi_AbstractSession_generateManualToken, METH_VARARGS, NULL}, { (char *)"blpapi_AbstractSession_getService", _wrap_blpapi_AbstractSession_getService, METH_VARARGS, NULL}, { (char *)"blpapi_AbstractSession_createIdentity", _wrap_blpapi_AbstractSession_createIdentity, METH_VARARGS, NULL}, { (char *)"blpapi_Session_start", _wrap_blpapi_Session_start, METH_VARARGS, NULL}, @@ -24067,6 +25419,8 @@ static PyMethodDef SwigMethods[] = { { (char *)"blpapi_Session_unsubscribe", _wrap_blpapi_Session_unsubscribe, METH_VARARGS, NULL}, { (char *)"blpapi_Session_setStatusCorrelationId", _wrap_blpapi_Session_setStatusCorrelationId, METH_VARARGS, NULL}, { (char *)"blpapi_Session_sendRequest", _wrap_blpapi_Session_sendRequest, METH_VARARGS, NULL}, + { (char *)"blpapi_Session_sendRequestTemplate", _wrap_blpapi_Session_sendRequestTemplate, METH_VARARGS, NULL}, + { (char *)"blpapi_Session_createSnapshotRequestTemplate", _wrap_blpapi_Session_createSnapshotRequestTemplate, METH_VARARGS, NULL}, { (char *)"blpapi_Session_getAbstractSession", _wrap_blpapi_Session_getAbstractSession, METH_VARARGS, NULL}, { (char *)"blpapi_ResolutionList_extractAttributeFromResolutionSuccess", _wrap_blpapi_ResolutionList_extractAttributeFromResolutionSuccess, METH_VARARGS, NULL}, { (char *)"blpapi_ResolutionList_create", _wrap_blpapi_ResolutionList_create, METH_VARARGS, NULL}, @@ -24122,6 +25476,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"blpapi_ProviderSession_createTopic", _wrap_blpapi_ProviderSession_createTopic, METH_VARARGS, NULL}, { (char *)"blpapi_ProviderSession_createServiceStatusTopic", _wrap_blpapi_ProviderSession_createServiceStatusTopic, METH_VARARGS, NULL}, { (char *)"blpapi_ProviderSession_deleteTopics", _wrap_blpapi_ProviderSession_deleteTopics, METH_VARARGS, NULL}, + { (char *)"blpapi_ProviderSession_terminateSubscriptionsOnTopics", _wrap_blpapi_ProviderSession_terminateSubscriptionsOnTopics, METH_VARARGS, NULL}, { (char *)"blpapi_ProviderSession_publish", _wrap_blpapi_ProviderSession_publish, METH_VARARGS, NULL}, { (char *)"blpapi_ProviderSession_sendResponse", _wrap_blpapi_ProviderSession_sendResponse, METH_VARARGS, NULL}, { (char *)"blpapi_ProviderSession_getAbstractSession", _wrap_blpapi_ProviderSession_getAbstractSession, METH_VARARGS, NULL}, @@ -24176,6 +25531,7 @@ static swig_type_info _swigt__p_blpapi_Name = {"_p_blpapi_Name", "blpapi_Name *| static swig_type_info _swigt__p_blpapi_Operation = {"_p_blpapi_Operation", "blpapi_Operation_t *|blpapi_Operation *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_blpapi_ProviderSession = {"_p_blpapi_ProviderSession", "blpapi_ProviderSession *|blpapi_ProviderSession_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_blpapi_Request = {"_p_blpapi_Request", "blpapi_Request *|blpapi_Request_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_RequestTemplate = {"_p_blpapi_RequestTemplate", "blpapi_RequestTemplate_t *|blpapi_RequestTemplate *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_blpapi_ResolutionList = {"_p_blpapi_ResolutionList", "blpapi_ResolutionList *|blpapi_ResolutionList_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_blpapi_Service = {"_p_blpapi_Service", "blpapi_Service_t *|blpapi_Service *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_blpapi_ServiceRegistrationOptions = {"_p_blpapi_ServiceRegistrationOptions", "blpapi_ServiceRegistrationOptions *|blpapi_ServiceRegistrationOptions_t *", 0, 0, (void*)0, 0}; @@ -24185,6 +25541,7 @@ static swig_type_info _swigt__p_blpapi_StreamWriter_t = {"_p_blpapi_StreamWriter static swig_type_info _swigt__p_blpapi_SubscriptionItrerator = {"_p_blpapi_SubscriptionItrerator", "blpapi_SubscriptionItrerator *|blpapi_SubscriptionIterator_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_blpapi_SubscriptionList = {"_p_blpapi_SubscriptionList", "blpapi_SubscriptionList *|blpapi_SubscriptionList_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_blpapi_TimePoint_t = {"_p_blpapi_TimePoint_t", "blpapi_TimePoint_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_TlsOptions = {"_p_blpapi_TlsOptions", "blpapi_TlsOptions *|blpapi_TlsOptions_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_blpapi_Topic = {"_p_blpapi_Topic", "blpapi_Topic *|blpapi_Topic_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_blpapi_TopicList = {"_p_blpapi_TopicList", "blpapi_TopicList *|blpapi_TopicList_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_char = {"_p_char", "char *|blpapi_Char_t *", 0, 0, (void*)0, 0}; @@ -24200,6 +25557,7 @@ static swig_type_info _swigt__p_p_blpapi_Message = {"_p_p_blpapi_Message", "blpa static swig_type_info _swigt__p_p_blpapi_Name = {"_p_p_blpapi_Name", "blpapi_Name **|blpapi_Name_t **", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_p_blpapi_Operation = {"_p_p_blpapi_Operation", "blpapi_Operation **|blpapi_Operation_t **", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_p_blpapi_Request = {"_p_p_blpapi_Request", "blpapi_Request_t **|blpapi_Request **", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_p_blpapi_RequestTemplate = {"_p_p_blpapi_RequestTemplate", "blpapi_RequestTemplate **|blpapi_RequestTemplate_t **", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_p_blpapi_Service = {"_p_p_blpapi_Service", "blpapi_Service_t **|blpapi_Service **", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_p_blpapi_Topic = {"_p_p_blpapi_Topic", "blpapi_Topic **|blpapi_Topic_t **", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, (void*)0, 0}; @@ -24236,6 +25594,7 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_blpapi_Operation, &_swigt__p_blpapi_ProviderSession, &_swigt__p_blpapi_Request, + &_swigt__p_blpapi_RequestTemplate, &_swigt__p_blpapi_ResolutionList, &_swigt__p_blpapi_Service, &_swigt__p_blpapi_ServiceRegistrationOptions, @@ -24245,6 +25604,7 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_blpapi_SubscriptionItrerator, &_swigt__p_blpapi_SubscriptionList, &_swigt__p_blpapi_TimePoint_t, + &_swigt__p_blpapi_TlsOptions, &_swigt__p_blpapi_Topic, &_swigt__p_blpapi_TopicList, &_swigt__p_char, @@ -24260,6 +25620,7 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_p_blpapi_Name, &_swigt__p_p_blpapi_Operation, &_swigt__p_p_blpapi_Request, + &_swigt__p_p_blpapi_RequestTemplate, &_swigt__p_p_blpapi_Service, &_swigt__p_p_blpapi_Topic, &_swigt__p_p_char, @@ -24296,6 +25657,7 @@ static swig_cast_info _swigc__p_blpapi_Name[] = { {&_swigt__p_blpapi_Name, 0, 0 static swig_cast_info _swigc__p_blpapi_Operation[] = { {&_swigt__p_blpapi_Operation, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_blpapi_ProviderSession[] = { {&_swigt__p_blpapi_ProviderSession, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_blpapi_Request[] = { {&_swigt__p_blpapi_Request, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_RequestTemplate[] = { {&_swigt__p_blpapi_RequestTemplate, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_blpapi_ResolutionList[] = { {&_swigt__p_blpapi_ResolutionList, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_blpapi_Service[] = { {&_swigt__p_blpapi_Service, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_blpapi_ServiceRegistrationOptions[] = { {&_swigt__p_blpapi_ServiceRegistrationOptions, 0, 0, 0},{0, 0, 0, 0}}; @@ -24305,6 +25667,7 @@ static swig_cast_info _swigc__p_blpapi_StreamWriter_t[] = { {&_swigt__p_blpapi_ static swig_cast_info _swigc__p_blpapi_SubscriptionItrerator[] = { {&_swigt__p_blpapi_SubscriptionItrerator, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_blpapi_SubscriptionList[] = { {&_swigt__p_blpapi_SubscriptionList, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_blpapi_TimePoint_t[] = { {&_swigt__p_blpapi_TimePoint_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_TlsOptions[] = { {&_swigt__p_blpapi_TlsOptions, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_blpapi_Topic[] = { {&_swigt__p_blpapi_Topic, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_blpapi_TopicList[] = { {&_swigt__p_blpapi_TopicList, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; @@ -24320,6 +25683,7 @@ static swig_cast_info _swigc__p_p_blpapi_Message[] = { {&_swigt__p_p_blpapi_Mes static swig_cast_info _swigc__p_p_blpapi_Name[] = { {&_swigt__p_p_blpapi_Name, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_p_blpapi_Operation[] = { {&_swigt__p_p_blpapi_Operation, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_p_blpapi_Request[] = { {&_swigt__p_p_blpapi_Request, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_p_blpapi_RequestTemplate[] = { {&_swigt__p_p_blpapi_RequestTemplate, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_p_blpapi_Service[] = { {&_swigt__p_p_blpapi_Service, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_p_blpapi_Topic[] = { {&_swigt__p_p_blpapi_Topic, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_p_char[] = { {&_swigt__p_p_char, 0, 0, 0},{0, 0, 0, 0}}; @@ -24356,6 +25720,7 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_blpapi_Operation, _swigc__p_blpapi_ProviderSession, _swigc__p_blpapi_Request, + _swigc__p_blpapi_RequestTemplate, _swigc__p_blpapi_ResolutionList, _swigc__p_blpapi_Service, _swigc__p_blpapi_ServiceRegistrationOptions, @@ -24365,6 +25730,7 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_blpapi_SubscriptionItrerator, _swigc__p_blpapi_SubscriptionList, _swigc__p_blpapi_TimePoint_t, + _swigc__p_blpapi_TlsOptions, _swigc__p_blpapi_Topic, _swigc__p_blpapi_TopicList, _swigc__p_char, @@ -24380,6 +25746,7 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_p_blpapi_Name, _swigc__p_p_blpapi_Operation, _swigc__p_p_blpapi_Request, + _swigc__p_p_blpapi_RequestTemplate, _swigc__p_p_blpapi_Service, _swigc__p_p_blpapi_Topic, _swigc__p_p_char, @@ -25093,6 +26460,9 @@ SWIG_init(void) { SWIG_Python_SetConstant(d, "MESSAGE_FRAGMENT_START",SWIG_From_int(static_cast< int >(BloombergLP::blpapi::Message::FRAGMENT_START))); SWIG_Python_SetConstant(d, "MESSAGE_FRAGMENT_INTERMEDIATE",SWIG_From_int(static_cast< int >(BloombergLP::blpapi::Message::FRAGMENT_INTERMEDIATE))); SWIG_Python_SetConstant(d, "MESSAGE_FRAGMENT_END",SWIG_From_int(static_cast< int >(BloombergLP::blpapi::Message::FRAGMENT_END))); + SWIG_Python_SetConstant(d, "MESSAGE_RECAPTYPE_NONE",SWIG_From_int(static_cast< int >(BloombergLP::blpapi::Message::RecapType::e_none))); + SWIG_Python_SetConstant(d, "MESSAGE_RECAPTYPE_SOLICITED",SWIG_From_int(static_cast< int >(BloombergLP::blpapi::Message::RecapType::e_solicited))); + SWIG_Python_SetConstant(d, "MESSAGE_RECAPTYPE_UNSOLICITED",SWIG_From_int(static_cast< int >(BloombergLP::blpapi::Message::RecapType::e_unsolicited))); SWIG_Python_SetConstant(d, "ELEMENTDEFINITION_UNBOUNDED",SWIG_From_unsigned_SS_int(static_cast< unsigned int >(BLPAPI_ELEMENTDEFINITION_UNBOUNDED))); SWIG_Python_SetConstant(d, "ELEMENT_INDEX_END",SWIG_From_size_t(static_cast< size_t >(BLPAPI_ELEMENT_INDEX_END))); SWIG_Python_SetConstant(d, "SERVICEREGISTRATIONOPTIONS_PRIORITY_MEDIUM",SWIG_From_int(static_cast< int >(INT_MAX/2))); diff --git a/blpapi/message.py b/blpapi/message.py index 348969d..eb3add6 100644 --- a/blpapi/message.py +++ b/blpapi/message.py @@ -12,6 +12,8 @@ from .element import Element from .name import Name from . import internals +from . import utils +from .compat import with_metaclass import datetime import weakref from blpapi.datetime import _DatetimeUtil, UTC @@ -24,6 +26,7 @@ from . import service +@with_metaclass(utils.MetaClassForClassesWithEnums) class Message(object): """A handle to a single message. @@ -38,6 +41,11 @@ class Message(object): FRAGMENT_START Start of a fragmented message FRAGMENT_INTERMEDIATE Intermediate fragment FRAGMENT_END Final part of a fragmented message + + The possible types of recap types: + RECAPTYPE_NONE Normal data tick + RECAPTTYPE_SOLICITED Generated on request by subscriber + RECAPTYPE_UNSOLICITED Generated by the service """ __handle = None @@ -51,6 +59,13 @@ class Message(object): FRAGMENT_END = internals.MESSAGE_FRAGMENT_END """Final part of a fragmented message""" + RECAPTYPE_NONE = internals.MESSAGE_RECAPTYPE_NONE + """Normal data tick""" + RECAPTYPE_SOLICITED = internals.MESSAGE_RECAPTYPE_SOLICITED + """Generated on request by subscriber""" + RECAPTYPE_UNSOLICITED = internals.MESSAGE_RECAPTYPE_UNSOLICITED + """Generated by the service""" + def __init__(self, handle, event=None, sessions=None): internals.blpapi_Message_addRef(handle) self.__handle = handle @@ -98,6 +113,14 @@ def fragmentType(self): MESSAGE_FRAGMENT_END.""" return internals.blpapi_Message_fragmentType(self.__handle) + def recapType(self): + """Return the recap type + + The recap type is one of MESSAGE_RECAPTYPE_NONE, + MESSAGE_RECAPTYPE_SOLICITED or MESSAGE_RECAPTYPE_UNSOLICITED""" + return internals.blpapi_Message_recapType(self.__handle) + + def topicName(self): """Return a string containing the topic string of this message. diff --git a/blpapi/providersession.py b/blpapi/providersession.py index 1f858c3..820f884 100644 --- a/blpapi/providersession.py +++ b/blpapi/providersession.py @@ -68,14 +68,15 @@ from .event import Event from . import exception from .exception import _ExceptionUtil -from .identity import Identity from . import internals from .internals import CorrelationId from .sessionoptions import SessionOptions from .topic import Topic from . import utils -from .compat import with_metaclass, conv2str, isstr +from .utils import get_handle +from .compat import with_metaclass +# pylint: disable=line-too-long,bad-continuation @with_metaclass(utils.MetaClassForClassesWithEnums) class ServiceRegistrationOptions(object): @@ -148,11 +149,14 @@ def setServicePriority(self, priority): """Set the priority with which a service will be registered. Set the priority with which a service will be registered to the - non-negative value specified in priority. This call returns with a - non-zero value indicating error when a negative priority is specified. - Any non-negative priority value, other than the one pre-defined in - ServiceRegistrationPriority can be used. Default value is - PRIORITY_HIGH. + specified 'priority', where numerically greater values of 'priority' + indicate higher priorities. The behavior is undefined unless + 'priority' is non-negative. Note that while the values pre-defined in + ServiceRegistrationOptions are suitable for use here, any non-negative + 'priority' is acceptable. + + By default, a service will be registered with priority + ServiceRegistrationOptions.PRIORITY_HIGH. """ return internals.blpapi_ServiceRegistrationOptions_setServicePriority( self.__handle, @@ -160,7 +164,7 @@ def setServicePriority(self, priority): def getGroupId(self): """Return the value of the service Group Id in this instance.""" - errorCode, groupId = \ + _, groupId = \ internals.blpapi_ServiceRegistrationOptions_getGroupId( self.__handle) return groupId @@ -176,8 +180,10 @@ def addActiveSubServiceCodeRange(self, begin, end, priority): """Advertise the service to be registered to receive, with the specified 'priority', subscriptions that the resolver has mapped to a service code between the specified 'begin' and the specified 'end' - values, inclusive. The behavior of this function is undefined unless '0 - <= begin <= end < (1 << 24)', and 'priority' is non-negative.""" + values, inclusive. Numerically greater values of 'priority' indicate + higher priorities. The behavior of this function is undefined unless + '0 <= begin <= end < (1 << 24)', and 'priority' is non-negative. + """ err = internals.blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange( self.__handle, begin, end, priority) _ExceptionUtil.raiseOnError(err) @@ -245,6 +251,7 @@ class ProviderSession(AbstractSession): @staticmethod def __dispatchEvent(sessionRef, eventHandle): + """Use sessions ref to dispatch an event""" try: session = sessionRef() if session is not None: @@ -303,9 +310,9 @@ def __init__(self, options=None, eventHandler=None, eventDispatcher=None): self.__handlerProxy = functools.partial( ProviderSession.__dispatchEvent, weakref.ref(self)) self.__handle = internals.ProviderSession_createHelper( - options._handle(), + get_handle(options), self.__handlerProxy, - None if eventDispatcher is None else eventDispatcher._handle()) + get_handle(eventDispatcher)) AbstractSession.__init__( self, internals.blpapi_ProviderSession_getAbstractSession(self.__handle)) @@ -349,6 +356,18 @@ def startAsync(self): """ return internals.blpapi_ProviderSession_startAsync(self.__handle) == 0 + def flushPublishedEvents(self, timeoutMsecs): + """Wait at most 'timeoutMsecs' milliseconds for all the published + events to be sent through the underlying channel. The method returns + either as soon as all the published events have been sent out or + when it has waited 'timeoutMs' milliseconds. Return true if + all the published events have been sent; false otherwise. + The behavior is undefined unless the specified 'timeoutMsecs' is + a non-negative value. When 'timeoutMsecs' is 0, the method checks + if all the published events have been sent and returns without + waiting.""" + return internals.ProviderSession_flushPublishedEvents(self.__handle, timeoutMsecs) + def stop(self): """Stop operation of this session and wait until it stops. @@ -407,8 +426,7 @@ def tryNextEvent(self): self.__handle) if retCode: return None - else: - return Event(event, self) + return Event(event, self) def registerService(self, uri, identity=None, options=None): """Attempt to register the service and block until it is done. @@ -435,8 +453,8 @@ def registerService(self, uri, identity=None, options=None): options = ServiceRegistrationOptions() if internals.blpapi_ProviderSession_registerService( self.__handle, uri, - None if identity is None else identity._handle(), - options._handle()) == 0: + get_handle(identity), + get_handle(options)) == 0: return True return False @@ -469,9 +487,9 @@ def registerServiceAsync(self, uri, identity=None, correlationId=None, internals.blpapi_ProviderSession_registerServiceAsync( self.__handle, uri, - None if identity is None else identity._handle(), - correlationId._handle(), - options._handle() + get_handle(identity), + get_handle(correlationId), + get_handle(options) )) return correlationId @@ -502,9 +520,9 @@ def resolve(self, resolutionList, resolveMode=DONT_REGISTER_SERVICES, _ExceptionUtil.raiseOnError( internals.blpapi_ProviderSession_resolve( self.__handle, - resolutionList._handle(), + get_handle(resolutionList), resolveMode, - None if identity is None else identity._handle())) + get_handle(identity))) def resolveAsync(self, resolutionList, resolveMode=DONT_REGISTER_SERVICES, identity=None): @@ -530,9 +548,9 @@ def resolveAsync(self, resolutionList, resolveMode=DONT_REGISTER_SERVICES, _ExceptionUtil.raiseOnError( internals.blpapi_ProviderSession_resolveAsync( self.__handle, - resolutionList._handle(), + get_handle(resolutionList), resolveMode, - None if identity is None else identity._handle())) + get_handle(identity))) def getTopic(self, message): """Find a previously created Topic object based on the 'message'. @@ -546,7 +564,7 @@ def getTopic(self, message): """ errorCode, topic = internals.blpapi_ProviderSession_getTopic( self.__handle, - message._handle()) + get_handle(message)) _ExceptionUtil.raiseOnError(errorCode) return Topic(topic, sessions=(self,)) @@ -560,8 +578,7 @@ def createServiceStatusTopic(self, service): errorCode, topic = \ internals.blpapi_ProviderSession_createServiceStatusTopic( self.__handle, - service._handle() - ) + get_handle(service)) _ExceptionUtil.raiseOnError(errorCode) return Topic(topic) @@ -570,14 +587,14 @@ def publish(self, event): _ExceptionUtil.raiseOnError( internals.blpapi_ProviderSession_publish( self.__handle, - event._handle())) + get_handle(event))) def sendResponse(self, event, isPartialResponse=False): """Send the response event for previously received request.""" _ExceptionUtil.raiseOnError( internals.blpapi_ProviderSession_sendResponse( self.__handle, - event._handle(), + get_handle(event), isPartialResponse)) def createTopics(self, topicList, @@ -601,9 +618,9 @@ def createTopics(self, topicList, _ExceptionUtil.raiseOnError( internals.blpapi_ProviderSession_createTopics( self.__handle, - topicList._handle(), + get_handle(topicList), resolveMode, - None if identity is None else identity._handle())) + get_handle(identity))) def createTopicsAsync(self, topicList, resolveMode=DONT_REGISTER_SERVICES, @@ -624,17 +641,19 @@ def createTopicsAsync(self, topicList, _ExceptionUtil.raiseOnError( internals.blpapi_ProviderSession_createTopicsAsync( self.__handle, - topicList._handle(), + get_handle(topicList), resolveMode, - None if identity is None else identity._handle())) + get_handle(identity))) def activateSubServiceCodeRange(self, serviceName, begin, end, priority): """Register to receive, with the specified 'priority', subscriptions for the specified 'service' that the resolver has mapped to a service code between the specified 'begin' and the specified 'end' values, - inclusive. The behavior of this function is undefined unless 'service' + inclusive. Numerically greater values of 'priority' indicate higher + priorities. The behavior of this function is undefined unless 'service' has already been successfully registered, '0 <= begin <= end < (1 << - 24)', and 'priority' is non-negative.""" + 24)', and 'priority' is non-negative. + """ err = internals.blpapi_ProviderSession_activateSubServiceCodeRange( self.__handle, serviceName, begin, end, priority) _ExceptionUtil.raiseOnError(err) @@ -668,6 +687,44 @@ def deregisterService(self, serviceName): self.__handle, serviceName) return res == 0 + def terminateSubscriptionsOnTopic(self, topic, message=None): + """Delete the specified 'topic' (See deleteTopic(topic) for + additional details). Furthermore, proactively terminate all current + subscriptions on 'topic'. The optionally specified 'message' can be + used to convey additional information to subscribers regarding the + termination. This message is contained in the 'description' of + 'reason' in a 'SubscriptionTerminated' message. + """ + if not topic: + return + _ExceptionUtil.raiseOnError( + internals.ProviderSession_terminateSubscriptionsOnTopic( + self.__handle, get_handle(topic), message)) + + def terminateSubscriptionsOnTopics(self, topics, message=None): + """Terminate subscriptions on the first 'numTopics' topics in the + specified 'topics'. + + See terminateSubscriptionsOnTopic(topic,message) for additional details. + """ + if not topics: + return + topicsCArraySize = len(topics) + topicsCArray = internals.new_topicPtrArray(topicsCArraySize) + try: + for i, topic in enumerate(topics): + internals.topicPtrArray_setitem(topicsCArray, + i, + get_handle(topic)) + _ExceptionUtil.raiseOnError( + internals.blpapi_ProviderSession_terminateSubscriptionsOnTopics( + self.__handle, + topicsCArray, + topicsCArraySize, + message)) + finally: + internals.delete_topicPtrArray(topicsCArray) + def deleteTopic(self, topic): """Remove one reference from the specified 'topic'. If this function has been called the same number of times that 'topic' was created @@ -693,7 +750,7 @@ def deleteTopics(self, topics): for i, topic in enumerate(topics): internals.topicPtrArray_setitem(topicsCArray, i, - topic._handle()) + get_handle(topic)) _ExceptionUtil.raiseOnError( internals.blpapi_ProviderSession_deleteTopics( self.__handle, diff --git a/blpapi/requesttemplate.py b/blpapi/requesttemplate.py new file mode 100644 index 0000000..5140680 --- /dev/null +++ b/blpapi/requesttemplate.py @@ -0,0 +1,64 @@ +# requesttemplate.py + +""" +This component provides a class, RequestTemplate, that can be used to obtain +snapshots from subscription data without having to handle the ticks on an +actual subscription. + +Request templates are obtained from a Session and should be always used with +the session that creates the template. When a session is terminated, any +request templates associated with that session become invalid. Results of +sending or canceling of invalid request templates is undefined. + +In order to send a request represented by a template, +'blpapi.Session.sendRequestTemplate' method should be called. + +Check 'blpapi.Session.createSnapshotRequestTemplate' for details about creation +and management of snapshot request templates. +""" + +from . import internals + +class RequestTemplate(object): + """Request templates cache the necessary information to make a request and + eliminate the need to create new requests for snapshot services. + """ + + def __init__(self, handle): + self.__handle = handle + + def __del__(self): + try: + self.destroy() + except (NameError, AttributeError): + pass + + def destroy(self): + if self.__handle: + internals.blpapi_RequestTemplate_release(self.__handle) + self.__handle = None + + def _handle(self): + """Return the internal implementation.""" + return self.__handle + +__copyright__ = """ +Copyright 2018. Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above +copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/blpapi/session.py b/blpapi/session.py index bf90715..7ecca79 100644 --- a/blpapi/session.py +++ b/blpapi/session.py @@ -19,6 +19,7 @@ from . import internals from .internals import CorrelationId from .sessionoptions import SessionOptions +from .requesttemplate import RequestTemplate class Session(AbstractSession): @@ -390,6 +391,102 @@ def sendRequest(self, eventQueue._registerSession(self) return correlationId + def sendRequestTemplate(self, requestTemplate, correlationId=None): + """Send a request defined by the specified 'requestTemplate'. If the + optionally specified 'correlationId' is supplied, use it otherwise + create a new 'CorrelationId'. The actual 'CorrelationId' used is + returned. + + A successful request will generate zero or more 'PARTIAL_RESPONSE' + events followed by exactly one 'RESPONSE' event. Once the final + 'RESPONSE' event has been received the 'CorrelationId' associated + with this request may be re-used. If the request fails at any stage + a 'REQUEST_STATUS' will be generated after which the 'CorrelationId' + associated with the request may be re-used. + """ + if correlationId is None: + correlationId = CorrelationId() + res = internals.blpapi_Session_sendRequestTemplate( + self.__handle, + requestTemplate._handle(), + correlationId._handle()) + _ExceptionUtil.raiseOnError(res) + return correlationId + + def createSnapshotRequestTemplate(self, + subscriptionString, + identity, + correlationId): + """Create a snapshot request template for getting subscription data + specified by the 'subscriptionString' using the specified 'identity' + if all the following conditions are met: the session is + established, 'subscriptionString' is a valid subscription string and + 'correlationId' is not used in this session. If one or more conditions + are not met, an exception is thrown. The provided 'correlationId' will + be used for status updates about the created request template state + and an implied subscription associated with it delivered by + 'SUBSCRIPTION_STATUS' events. + + The benefit of the snapshot request templates is that these requests + may be serviced from a cache and the user may expect to see + significantly lower response time. + + There are 3 possible states for a created request template: + 'Pending', 'Available', and 'Terminated'. Right after creation a + request template is in the 'Pending' state. + + If a state is 'Pending', the user may send a request using this + template but there are no guarantees about response time since cache + is not available yet. Request template may transition into 'Pending' + state only from the 'Available' state. In this case the + 'RequestTemplatePending' message is generated. + + If state is 'Available', all requests will be serviced from a cache + and the user may expect to see significantly reduced latency. Note, + that a snapshot request template can transition out of the + 'Available' state concurrently with requests being sent, so no + guarantee of service from the cache can be provided. Request + template may transition into 'Available' state only from the + 'Pending' state. In this case the 'RequestTemplateAvailable' message + is generated. This message will also contain information about + currently used connection in the 'boundTo' field. Note that it is + possible to get the 'RequestTemplateAvailable' message with a new + connection information, even if a request template is already in the + 'Available' state. + + If state is 'Terminated', sending request will always result in a + failure response. Request template may transition into this state + from any other state. This is a final state and it is guaranteed + that the last message associated with the provided 'correlationId' will + be the 'RequestTemplateTerminated' message which is generated when a + request template transitions into this state. If a request template + transitions into this state, all outstanding requests will be failed + and appropriate messages will be generated for each request. After + receiving the 'RequestTemplateTerminated' message, 'correlationId' may + be reused. + + Note that resources used by a snapshot request template are released + only when request template transitions into the 'Terminated' state + or when session is destroyed. In order to release resources when + request template is not needed anymore, user should call the + 'Session::cancel(correlationId)' unless the 'RequestTemplateTerminated' + message was already received due to some problems. When the last + copy of a 'RequestTemplate' object goes out of scope and there are + no outstanding requests left, the snapshot request template will be + destroyed automatically. If the last copy of a 'RequestTemplate' + object goes out of scope while there are still some outstanding + requests left, snapshot service request template will be destroyed + automatically when the last request gets a final response. + """ + rc, template = internals.blpapi_Session_createSnapshotRequestTemplate( + self.__handle, + subscriptionString, + identity._handle(), + correlationId._handle()) + _ExceptionUtil.raiseOnError(rc) + reqTemplate = RequestTemplate(template) + return reqTemplate + __copyright__ = """ Copyright 2012. Bloomberg Finance L.P. diff --git a/blpapi/sessionoptions.py b/blpapi/sessionoptions.py index 44b150e..a961f71 100644 --- a/blpapi/sessionoptions.py +++ b/blpapi/sessionoptions.py @@ -59,6 +59,16 @@ def __del__(self): except (NameError, AttributeError): pass + def __str__(self): + """x.__str__() <==> str(x) + + Return a string representation of this SessionOptions. Call of + 'str(options)' is equivalent to 'options.toString()' called with + default parameters. + + """ + return self.toString() + def destroy(self): """Destroy this SessionOptions.""" if self.__handle: @@ -223,7 +233,7 @@ def setAuthenticationOptions(self, authOptions): def setNumStartAttempts(self, numStartAttempts): """Set the maximum number of attempts to start a session. - + Set the maximum number of attempts to start a session by connecting a server. """ @@ -313,6 +323,14 @@ def setDefaultKeepAliveResponseTimeout(self, timeoutMsecs): self.__handle, timeoutMsecs) _ExceptionUtil.raiseOnError(err) + def setFlushPublishedEventsTimeout(self, timeoutMsecs): + """Set the timeout, in milliseconds, for ProviderSession to flush + published events before stopping. The behavior is not defined + unless the specified 'timeoutMsecs' is a positive value. The + default value is 2000.""" + internals.blpapi_SessionOptions_setFlushPublishedEventsTimeout( + self.__handle, timeoutMsecs) + def setRecordSubscriptionDataReceiveTimes(self, shouldRecord): """Set whether the receipt time (accessed via 'blpapi.Message.timeReceived') should be recorded for subscription data @@ -321,6 +339,29 @@ def setRecordSubscriptionDataReceiveTimes(self, shouldRecord): internals.blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes( self.__handle, shouldRecord) + def setServiceCheckTimeout(self, timeoutMsecs): + """Set the timeout, in milliseconds, when opening a service for checking + what version of the schema should be downloaded. The behavior is not + defined unless 'timeoutMsecs' is a positive value. The default timeout + is 60,000 milliseconds.""" + err = internals.blpapi_SessionOptions_setServiceCheckTimeout( + self.__handle, timeoutMsecs) + _ExceptionUtil.raiseOnError(err) + + def setServiceDownloadTimeout(self, timeoutMsecs): + """Set the timeout, in milliseconds, when opening a service for + downloading the service schema. The behavior is not defined unless the + specified 'timeoutMsecs' is a positive value. The default timeout + is 120,000 milliseconds.""" + err = internals.blpapi_SessionOptions_setServiceDownloadTimeout( + self.__handle, timeoutMsecs) + _ExceptionUtil.raiseOnError(err) + + def setTlsOptions(self, tlsOptions): + """Set the TLS options""" + internals.blpapi_SessionOptions_setTlsOptions(self.__handle, + tlsOptions._handle()) + def serverHost(self): """Return the server host option in this SessionOptions instance.""" @@ -476,15 +517,117 @@ def defaultKeepAliveResponseTimeout(self): return internals.blpapi_SessionOptions_defaultKeepAliveResponseTimeout( self.__handle) + def flushPublishedEventsTimeout(self): + """Return the timeout, in milliseconds, for ProviderSession to flush + published events before stopping. The default value is 2000.""" + return internals.blpapi_SessionOptions_flushPublishedEventsTimeout( + self.__handle) + def keepAliveEnabled(self): """Return True if the keep-alive mechanism is enabled; otherwise return False.""" return internals.blpapi_SessionOptions_keepAliveEnabled(self.__handle) + def serviceCheckTimeout(self): + """Return the value of the service check timeout option in this + SessionOptions instance in milliseconds.""" + return internals.blpapi_SessionOptions_serviceCheckTimeout(self.__handle) + + def serviceDownloadTimeout(self): + """Return the value of the service download timeout option in this + SessionOptions instance in milliseconds.""" + return internals.blpapi_SessionOptions_serviceDownloadTimeout(self.__handle) + def _handle(self): """Return the internal implementation.""" return self.__handle + def toString(self, level=0, spacesPerLevel=4): + """Format this SessionOptions to the string. + + You could optionally specify 'spacesPerLevel' - the number of spaces + per indentation level for this and all of its nested objects. If + 'level' is negative, suppress indentation of the first line. If + 'spacesPerLevel' is negative, format the entire output on one line, + suppressing all but the initial indentation (as governed by 'level'). + """ + return internals.blpapi_SessionOptions_printHelper(self.__handle, + level, + spacesPerLevel) + +class TlsOptions(object): + """SSL configuration options + + TlsOptions instances maintain client credentials and trust material used + by a session to establish secure mutually authenticated connections to + endpoints. + + The client credentials comprise an encrypted private key with a client + certificate. The trust material comprises one or more certificates. + + TlsOptions objects are created using 'createFromFiles' or 'createFromBlobs' + accepting the DER encoded client credentials in PKCS#12 format and the DER + encoded trusted material in PKCS#7 format.""" + + def __init__(self, handle): + self.__handle = handle + + def __del__(self): + try: + self.destroy() + except (NameError, AttributeError): + pass + + def destroy(self): + if self.__handle: + internals.blpapi_TlsOptions_destroy(self.__handle) + self.__handle = None + + def _handle(self): + return self.__handle + + def setTlsHandshakeTimeoutMs(self, timeoutMs): + """Set the TLS handshake timeout to the specified + 'tlsHandshakeTimeoutMs'. The default is 10,000 milliseconds. + The TLS handshake timeout will be set to the default if + the specified 'tlsHandshakeTimeoutMs' is not positive.""" + internals.blpapi_TlsOptions_setTlsHandshakeTimeoutMs(self.__handle, + timeoutMs) + def setCrlFetchTimeoutMs(self, timeoutMs): + """Set the CRL fetch timeout to the specified 'timeoutMs'. The default + is 20,000 milliseconds. The TLS handshake timeout will be set to the + default if the specified 'crlFetchTimeoutMs' is not positive.""" + internals.blpapi_TlsOptions_setCrlFetchTimeoutMs(self.__handle, timeoutMs) + + @staticmethod + def createFromFiles(clientCredentialsFilename, + clientCredentialsPassword, + trustedCertificatesFilename): + """Creates a TlsOptions using a DER encoded client credentials in + PKCS#12 format and DER encoded trust material in PKCS#7 format from + the specified files""" + handle = internals.blpapi_TlsOptions_createFromFiles(clientCredentialsFilename, + clientCredentialsPassword, + trustedCertificatesFilename) + return TlsOptions(handle) + + @staticmethod + def createFromBlobs(clientCredentials, + clientCredentialsPassword, + trustedCertificates): + """Creates a TlsOptions using a DER encoded client credentials in + PKCS#12 format and DER encoded trust material in PKCS#7 format from + the given raw data. + The type of clientCredentials and trustedCertificates should be + either 'bytes' or 'bytearray'. + clientCredentialsPassword is a regular string.""" + credentials = bytearray(clientCredentials) + certs = bytearray(trustedCertificates) + handle = internals.blpapi_TlsOptions_createFromBlobs( + credentials, + clientCredentialsPassword, + certs) + return TlsOptions(handle) __copyright__ = """ Copyright 2012. Bloomberg Finance L.P. diff --git a/blpapi/utils.py b/blpapi/utils.py index 54315ba..a7d74a6 100644 --- a/blpapi/utils.py +++ b/blpapi/utils.py @@ -2,7 +2,7 @@ """Internal utils.""" - +#pylint: disable=too-few-public-methods, useless-object-inheritance class Iterator(object): """Universal iterator for many of BLPAPI objects. @@ -60,25 +60,35 @@ class EnumError(TypeError): """ pass - def __setattr__(mcs, name, value): + def __setattr__(cls, name, value): """Change the value of an attribute if it is not an enum. Raise EnumError exception otherwise. """ - if name.isupper() and name in mcs.__dict__: - raise mcs.EnumError("Can't change value of enum %s" % name) + if name.isupper() and name in cls.__dict__: + raise cls.EnumError("Can't change value of enum %s" % name) else: - type.__setattr__(mcs, name, value) + type.__setattr__(cls, name, value) - def __delattr__(mcs, name): + def __delattr__(cls, name): """Unbind the attribute if it is not an enum. Raise EnumError exception otherwise. """ - if name.isupper() and name in mcs.__dict__: - raise mcs.EnumError("Can't unbind enum %s" % name) + if name.isupper() and name in cls.__dict__: + raise cls.EnumError("Can't unbind enum %s" % name) else: - type.__delattr__(mcs, name) + type.__delattr__(cls, name) + +def get_handle(thing): + """Returns the result of thing._handle() or None if thing is None""" + return None if thing is None else thing._handle() #pylint: disable=protected-access + +def invoke_if_valid(cb, value): + """Returns the result of cb(value) if cb is callable, else -- just value""" + if cb is None or not callable(cb): + return value + return cb(value) __copyright__ = """ Copyright 2012. Bloomberg Finance L.P. diff --git a/blpapi/version.py b/blpapi/version.py new file mode 100644 index 0000000..301b499 --- /dev/null +++ b/blpapi/version.py @@ -0,0 +1,26 @@ +# version.py + +"""Provide BLPAPI SDK versions""" + +from __future__ import print_function +from . import versionhelper + +__version__ = "3.12.1" + +def print_version(): + "Print version information of BLPAPI python module and blpapi C++ SDK" + print("Python BLPAPI SDK version: ", version()) + print("C++ BLPAPI SDK version: ", cpp_sdk_version()) + +def version(): + "Return BLPAPI Python module version" + return __version__ + +def cpp_sdk_version(): + "Return BLPAPI C++ SDK dependency version" + version_string = ".".join(map(str, versionhelper.blpapi_getVersionInfo())) + + commit_id = versionhelper.blpapi_getVersionIdentifier() + if commit_id != "Unknown": + version_string += " (" + commit_id + ")" + return version_string diff --git a/blpapi/versionhelper.py b/blpapi/versionhelper.py new file mode 100644 index 0000000..24478bd --- /dev/null +++ b/blpapi/versionhelper.py @@ -0,0 +1,115 @@ +# This file was automatically generated by SWIG (http://www.swig.org). +# Version 3.0.12 +# +# Do not make changes to this file unless you know what you are doing--modify +# the SWIG interface file instead. + +"""blpapi version helper""" + + +from sys import version_info as _swig_python_version_info +if _swig_python_version_info >= (2, 7, 0): + def swig_import_helper(): + import importlib + pkg = __name__.rpartition('.')[0] + mname = '.'.join((pkg, '_versionhelper')).lstrip('.') + try: + return importlib.import_module(mname) + except ImportError: + return importlib.import_module('_versionhelper') + _versionhelper = swig_import_helper() + del swig_import_helper +elif _swig_python_version_info >= (2, 6, 0): + def swig_import_helper(): + from os.path import dirname + import imp + fp = None + try: + fp, pathname, description = imp.find_module('_versionhelper', [dirname(__file__)]) + except ImportError: + import _versionhelper + return _versionhelper + try: + _mod = imp.load_module('_versionhelper', fp, pathname, description) + finally: + if fp is not None: + fp.close() + return _mod + _versionhelper = swig_import_helper() + del swig_import_helper +else: + import _versionhelper +del _swig_python_version_info + +try: + _swig_property = property +except NameError: + pass # Python < 2.2 doesn't have 'property'. + +try: + import builtins as __builtin__ +except ImportError: + import __builtin__ + +def _swig_setattr_nondynamic(self, class_type, name, value, static=1): + if (name == "thisown"): + return self.this.own(value) + if (name == "this"): + if type(value).__name__ == 'SwigPyObject': + self.__dict__[name] = value + return + method = class_type.__swig_setmethods__.get(name, None) + if method: + return method(self, value) + if (not static): + if _newclass: + object.__setattr__(self, name, value) + else: + self.__dict__[name] = value + else: + raise AttributeError("You cannot add attributes to %s" % self) + + +def _swig_setattr(self, class_type, name, value): + return _swig_setattr_nondynamic(self, class_type, name, value, 0) + + +def _swig_getattr(self, class_type, name): + if (name == "thisown"): + return self.this.own() + method = class_type.__swig_getmethods__.get(name, None) + if method: + return method(self) + raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name)) + + +def _swig_repr(self): + try: + strthis = "proxy of " + self.this.__repr__() + except __builtin__.Exception: + strthis = "" + return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) + +try: + _object = object + _newclass = 1 +except __builtin__.Exception: + class _object: + pass + _newclass = 0 + + +def blpapi_getVersionInfo(): + return _versionhelper.blpapi_getVersionInfo() +blpapi_getVersionInfo = _versionhelper.blpapi_getVersionInfo + +def blpapi_getVersionIdentifier(): + return _versionhelper.blpapi_getVersionIdentifier() +blpapi_getVersionIdentifier = _versionhelper.blpapi_getVersionIdentifier + +def __lshift__(stream, rhs): + return _versionhelper.__lshift__(stream, rhs) +__lshift__ = _versionhelper.__lshift__ +# This file is compatible with both classic and new-style classes. + + diff --git a/blpapi/versionhelper_wrap.cxx b/blpapi/versionhelper_wrap.cxx new file mode 100644 index 0000000..53fb4b1 --- /dev/null +++ b/blpapi/versionhelper_wrap.cxx @@ -0,0 +1,4024 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 3.0.12 + * + * 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. + * ----------------------------------------------------------------------------- */ + + +#ifndef SWIGPYTHON +#define SWIGPYTHON +#endif + +#define SWIG_PYTHON_THREADS +#define SWIG_PYTHON_DIRECTOR_NO_VTABLE + + +#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. + * ----------------------------------------------------------------------------- */ + +/* template workaround for compilers that cannot correctly implement the C++ standard */ +#ifndef SWIGTEMPLATEDISAMBIGUATOR +# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) +# define SWIGTEMPLATEDISAMBIGUATOR template +# elif defined(__HP_aCC) +/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ +/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ +# define SWIGTEMPLATEDISAMBIGUATOR template +# else +# define SWIGTEMPLATEDISAMBIGUATOR +# endif +#endif + +/* inline attribute */ +#ifndef SWIGINLINE +# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) +# define SWIGINLINE inline +# else +# define SWIGINLINE +# endif +#endif + +/* attribute recognised by some compilers to avoid 'unused' warnings */ +#ifndef SWIGUNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +# elif defined(__ICC) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +#endif + +#ifndef SWIG_MSC_UNSUPPRESS_4505 +# if defined(_MSC_VER) +# pragma warning(disable : 4505) /* unreferenced local function has been removed */ +# endif +#endif + +#ifndef SWIGUNUSEDPARM +# ifdef __cplusplus +# define SWIGUNUSEDPARM(p) +# else +# define SWIGUNUSEDPARM(p) p SWIGUNUSED +# endif +#endif + +/* internal SWIG method */ +#ifndef SWIGINTERN +# define SWIGINTERN static SWIGUNUSED +#endif + +/* internal inline SWIG method */ +#ifndef SWIGINTERNINLINE +# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE +#endif + +/* exporting methods */ +#if defined(__GNUC__) +# if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +# ifndef GCC_HASCLASSVISIBILITY +# define GCC_HASCLASSVISIBILITY +# endif +# endif +#endif + +#ifndef SWIGEXPORT +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# if defined(STATIC_LINKED) +# define SWIGEXPORT +# else +# define SWIGEXPORT __declspec(dllexport) +# endif +# else +# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) +# define SWIGEXPORT __attribute__ ((visibility("default"))) +# else +# define SWIGEXPORT +# endif +# endif +#endif + +/* calling conventions for Windows */ +#ifndef SWIGSTDCALL +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# define SWIGSTDCALL __stdcall +# else +# define SWIGSTDCALL +# endif +#endif + +/* Deal with Microsoft's attempt at deprecating C standard runtime functions */ +#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) +# define _CRT_SECURE_NO_DEPRECATE +#endif + +/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ +#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) +# define _SCL_SECURE_NO_DEPRECATE +#endif + +/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */ +#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES) +# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0 +#endif + +/* Intel's compiler complains if a variable which was never initialised is + * cast to void, which is a common idiom which we use to indicate that we + * are aware a variable isn't used. So we just silence that warning. + * See: https://github.com/swig/swig/issues/192 for more discussion. + */ +#ifdef __INTEL_COMPILER +# pragma warning disable 592 +#endif + + +#if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG) +/* Use debug wrappers with the Python release dll */ +# undef _DEBUG +# include +# define _DEBUG +#else +# include +#endif + +/* ----------------------------------------------------------------------------- + * swigrun.swg + * + * This file contains generic C API SWIG runtime support for pointer + * type checking. + * ----------------------------------------------------------------------------- */ + +/* This should only be incremented when either the layout of swig_type_info changes, + or for whatever reason, the runtime changes incompatibly */ +#define SWIG_RUNTIME_VERSION "4" + +/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ +#ifdef SWIG_TYPE_TABLE +# define SWIG_QUOTE_STRING(x) #x +# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x) +# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE) +#else +# define SWIG_TYPE_TABLE_NAME +#endif + +/* + You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for + creating a static or dynamic library from the SWIG runtime code. + In 99.9% of the cases, SWIG just needs to declare them as 'static'. + + But only do this if strictly necessary, ie, if you have problems + with your compiler or suchlike. +*/ + +#ifndef SWIGRUNTIME +# define SWIGRUNTIME SWIGINTERN +#endif + +#ifndef SWIGRUNTIMEINLINE +# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE +#endif + +/* Generic buffer size */ +#ifndef SWIG_BUFFER_SIZE +# define SWIG_BUFFER_SIZE 1024 +#endif + +/* Flags for pointer conversions */ +#define SWIG_POINTER_DISOWN 0x1 +#define SWIG_CAST_NEW_MEMORY 0x2 + +/* Flags for new pointer objects */ +#define SWIG_POINTER_OWN 0x1 + + +/* + Flags/methods for returning states. + + The SWIG conversion methods, as ConvertPtr, return an integer + that tells if the conversion was successful or not. And if not, + an error code can be returned (see swigerrors.swg for the codes). + + Use the following macros/flags to set or process the returning + states. + + In old versions of SWIG, code such as the following was usually written: + + if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { + // success code + } else { + //fail code + } + + Now you can be more explicit: + + int res = SWIG_ConvertPtr(obj,vptr,ty.flags); + if (SWIG_IsOK(res)) { + // success code + } else { + // fail code + } + + which is the same really, but now you can also do + + Type *ptr; + int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags); + if (SWIG_IsOK(res)) { + // success code + if (SWIG_IsNewObj(res) { + ... + delete *ptr; + } else { + ... + } + } else { + // fail code + } + + I.e., now SWIG_ConvertPtr can return new objects and you can + identify the case and take care of the deallocation. Of course that + also requires SWIG_ConvertPtr to return new result values, such as + + int SWIG_ConvertPtr(obj, ptr,...) { + if () { + if () { + *ptr = ; + return SWIG_NEWOBJ; + } else { + *ptr = ; + return SWIG_OLDOBJ; + } + } else { + return SWIG_BADOBJ; + } + } + + Of course, returning the plain '0(success)/-1(fail)' still works, but you can be + more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the + 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 + + int food(double) + int fooi(int); + + and you call + + food(1) // cast rank '1' (1 -> 1.0) + fooi(1) // cast rank '0' + + just use the SWIG_AddCast()/SWIG_CheckState() +*/ + +#define SWIG_OK (0) +#define SWIG_ERROR (-1) +#define SWIG_IsOK(r) (r >= 0) +#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError) + +/* The CastRankLimit says how many bits are used for the cast rank */ +#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 */ +#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 */ +#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)) +#define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r) +#define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r) +#define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK)) + +/* Cast-Rank Mode */ +#if defined(SWIG_CASTRANK_MODE) +# ifndef SWIG_TypeRank +# define SWIG_TypeRank unsigned long +# endif +# ifndef SWIG_MAXCASTRANK /* Default cast allowed */ +# define SWIG_MAXCASTRANK (2) +# endif +# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1) +# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK) +SWIGINTERNINLINE int SWIG_AddCast(int r) { + return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r; +} +SWIGINTERNINLINE int SWIG_CheckState(int r) { + return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; +} +#else /* no cast-rank mode */ +# define SWIG_AddCast(r) (r) +# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0) +#endif + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void *(*swig_converter_func)(void *, int *); +typedef struct swig_type_info *(*swig_dycast_func)(void **); + +/* Structure to store information on one type */ +typedef struct swig_type_info { + const char *name; /* mangled name of this type */ + const char *str; /* human readable name of this type */ + swig_dycast_func dcast; /* dynamic cast function down a hierarchy */ + struct swig_cast_info *cast; /* linked list of types that can cast into this type */ + void *clientdata; /* language specific type data */ + int owndata; /* flag if the structure owns the clientdata */ +} swig_type_info; + +/* Structure to store a type and conversion function used for casting */ +typedef struct swig_cast_info { + swig_type_info *type; /* pointer to type that is equivalent to this type */ + swig_converter_func converter; /* function to cast the void pointers */ + struct swig_cast_info *next; /* pointer to next cast in linked list */ + struct swig_cast_info *prev; /* pointer to the previous cast */ +} swig_cast_info; + +/* Structure used to store module information + * Each module generates one structure like this, and the runtime collects + * all of these structures and stores them in a circularly linked list.*/ +typedef struct swig_module_info { + swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */ + size_t size; /* Number of types in this module */ + struct swig_module_info *next; /* Pointer to next element in circularly linked list */ + swig_type_info **type_initial; /* Array of initially generated type structures */ + swig_cast_info **cast_initial; /* Array of initially generated casting structures */ + void *clientdata; /* Language specific module data */ +} swig_module_info; + +/* + Compare two type names skipping the space characters, therefore + "char*" == "char *" and "Class" == "Class", etc. + + Return 0 when the two name types are equivalent, as in + strncmp, but skipping ' '. +*/ +SWIGRUNTIME int +SWIG_TypeNameComp(const char *f1, const char *l1, + const char *f2, const char *l2) { + for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) { + while ((*f1 == ' ') && (f1 != l1)) ++f1; + while ((*f2 == ' ') && (f2 != l2)) ++f2; + if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1; + } + return (int)((l1 - f1) - (l2 - f2)); +} + +/* + Check type equivalence in a name list like ||... + Return 0 if equal, -1 if nb < tb, 1 if nb > tb +*/ +SWIGRUNTIME int +SWIG_TypeCmp(const char *nb, const char *tb) { + int equiv = 1; + const char* te = tb + strlen(tb); + const char* ne = nb; + while (equiv != 0 && *ne) { + for (nb = ne; *ne; ++ne) { + if (*ne == '|') break; + } + equiv = SWIG_TypeNameComp(nb, ne, tb, te); + if (*ne) ++ne; + } + return equiv; +} + +/* + Check type equivalence in a name list like ||... + Return 0 if not equal, 1 if equal +*/ +SWIGRUNTIME int +SWIG_TypeEquiv(const char *nb, const char *tb) { + return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0; +} + +/* + Check the typename +*/ +SWIGRUNTIME swig_cast_info * +SWIG_TypeCheck(const char *c, swig_type_info *ty) { + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (strcmp(iter->type->name, c) == 0) { + if (iter == ty->cast) + return iter; + /* Move iter to the top of the linked list */ + iter->prev->next = iter->next; + if (iter->next) + iter->next->prev = iter->prev; + iter->next = ty->cast; + iter->prev = 0; + if (ty->cast) ty->cast->prev = iter; + ty->cast = iter; + return iter; + } + iter = iter->next; + } + } + return 0; +} + +/* + 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) { + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (iter->type == from) { + if (iter == ty->cast) + return iter; + /* Move iter to the top of the linked list */ + iter->prev->next = iter->next; + if (iter->next) + iter->next->prev = iter->prev; + iter->next = ty->cast; + iter->prev = 0; + if (ty->cast) ty->cast->prev = iter; + ty->cast = iter; + return iter; + } + iter = iter->next; + } + } + return 0; +} + +/* + Cast a pointer up an inheritance hierarchy +*/ +SWIGRUNTIMEINLINE void * +SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) { + return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory); +} + +/* + Dynamic pointer casting. Down an inheritance hierarchy +*/ +SWIGRUNTIME swig_type_info * +SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) { + swig_type_info *lastty = ty; + if (!ty || !ty->dcast) return ty; + while (ty && (ty->dcast)) { + ty = (*ty->dcast)(ptr); + if (ty) lastty = ty; + } + return lastty; +} + +/* + Return the name associated with this type +*/ +SWIGRUNTIMEINLINE const char * +SWIG_TypeName(const swig_type_info *ty) { + return ty->name; +} + +/* + Return the pretty name associated with this type, + that is an unmangled type name in a form presentable to the user. +*/ +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. */ + if (!type) return NULL; + if (type->str != NULL) { + const char *last_name = type->str; + const char *s; + for (s = type->str; *s; s++) + if (*s == '|') last_name = s+1; + return last_name; + } + else + return type->name; +} + +/* + Set the clientdata field for a type +*/ +SWIGRUNTIME void +SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { + swig_cast_info *cast = ti->cast; + /* if (ti->clientdata == clientdata) return; */ + ti->clientdata = clientdata; + + while (cast) { + if (!cast->converter) { + swig_type_info *tc = cast->type; + if (!tc->clientdata) { + SWIG_TypeClientData(tc, clientdata); + } + } + cast = cast->next; + } +} +SWIGRUNTIME void +SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) { + SWIG_TypeClientData(ti, clientdata); + ti->owndata = 1; +} + +/* + Search for a swig_type_info structure only by mangled name + Search is a O(log #types) + + We start searching at module start, and finish searching when start == end. + Note: if start == end at the beginning of the function, we go all the way around + the circular list. +*/ +SWIGRUNTIME swig_type_info * +SWIG_MangledTypeQueryModule(swig_module_info *start, + swig_module_info *end, + const char *name) { + swig_module_info *iter = start; + do { + if (iter->size) { + size_t l = 0; + size_t r = iter->size - 1; + do { + /* since l+r >= 0, we can (>> 1) instead (/ 2) */ + size_t i = (l + r) >> 1; + const char *iname = iter->types[i]->name; + if (iname) { + int compare = strcmp(name, iname); + if (compare == 0) { + return iter->types[i]; + } else if (compare < 0) { + if (i) { + r = i - 1; + } else { + break; + } + } else if (compare > 0) { + l = i + 1; + } + } else { + break; /* should never happen */ + } + } while (l <= r); + } + iter = iter->next; + } while (iter != end); + return 0; +} + +/* + Search for a swig_type_info structure for either a mangled name or a human readable name. + It first searches the mangled names of the types, which is a O(log #types) + If a type is not found it then searches the human readable names, which is O(#types). + + We start searching at module start, and finish searching when start == end. + Note: if start == end at the beginning of the function, we go all the way around + the circular list. +*/ +SWIGRUNTIME swig_type_info * +SWIG_TypeQueryModule(swig_module_info *start, + swig_module_info *end, + const char *name) { + /* STEP 1: Search the name field using binary search */ + swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name); + if (ret) { + return ret; + } else { + /* STEP 2: If the type hasn't been found, do a complete search + of the str field (the human readable name) */ + swig_module_info *iter = start; + do { + size_t i = 0; + for (; i < iter->size; ++i) { + if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name))) + return iter->types[i]; + } + iter = iter->next; + } while (iter != end); + } + + /* neither found a match */ + return 0; +} + +/* + Pack binary data into a string +*/ +SWIGRUNTIME char * +SWIG_PackData(char *c, void *ptr, size_t sz) { + static const char hex[17] = "0123456789abcdef"; + const unsigned char *u = (unsigned char *) ptr; + const unsigned char *eu = u + sz; + for (; u != eu; ++u) { + unsigned char uu = *u; + *(c++) = hex[(uu & 0xf0) >> 4]; + *(c++) = hex[uu & 0xf]; + } + return c; +} + +/* + Unpack binary data from a string +*/ +SWIGRUNTIME const char * +SWIG_UnpackData(const char *c, void *ptr, size_t sz) { + unsigned char *u = (unsigned char *) ptr; + const unsigned char *eu = u + sz; + for (; u != eu; ++u) { + char d = *(c++); + unsigned char uu; + if ((d >= '0') && (d <= '9')) + uu = (unsigned char)((d - '0') << 4); + else if ((d >= 'a') && (d <= 'f')) + uu = (unsigned char)((d - ('a'-10)) << 4); + else + return (char *) 0; + d = *(c++); + if ((d >= '0') && (d <= '9')) + uu |= (unsigned char)(d - '0'); + else if ((d >= 'a') && (d <= 'f')) + uu |= (unsigned char)(d - ('a'-10)); + else + return (char *) 0; + *u = uu; + } + return c; +} + +/* + Pack 'void *' into a string buffer. +*/ +SWIGRUNTIME char * +SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) { + char *r = buff; + if ((2*sizeof(void *) + 2) > bsz) return 0; + *(r++) = '_'; + r = SWIG_PackData(r,&ptr,sizeof(void *)); + if (strlen(name) + 1 > (bsz - (r - buff))) return 0; + strcpy(r,name); + return buff; +} + +SWIGRUNTIME const char * +SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) { + if (*c != '_') { + if (strcmp(c,"NULL") == 0) { + *ptr = (void *) 0; + return name; + } else { + return 0; + } + } + return SWIG_UnpackData(++c,ptr,sizeof(void *)); +} + +SWIGRUNTIME char * +SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) { + char *r = buff; + size_t lname = (name ? strlen(name) : 0); + if ((2*sz + 2 + lname) > bsz) return 0; + *(r++) = '_'; + r = SWIG_PackData(r,ptr,sz); + if (lname) { + strncpy(r,name,lname+1); + } else { + *r = 0; + } + return buff; +} + +SWIGRUNTIME const char * +SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { + if (*c != '_') { + if (strcmp(c,"NULL") == 0) { + memset(ptr,0,sz); + return name; + } else { + return 0; + } + } + return SWIG_UnpackData(++c,ptr,sz); +} + +#ifdef __cplusplus +} +#endif + +/* Errors in SWIG */ +#define SWIG_UnknownError -1 +#define SWIG_IOError -2 +#define SWIG_RuntimeError -3 +#define SWIG_IndexError -4 +#define SWIG_TypeError -5 +#define SWIG_DivisionByZero -6 +#define SWIG_OverflowError -7 +#define SWIG_SyntaxError -8 +#define SWIG_ValueError -9 +#define SWIG_SystemError -10 +#define SWIG_AttributeError -11 +#define SWIG_MemoryError -12 +#define SWIG_NullReferenceError -13 + + + +/* Compatibility macros for Python 3 */ +#if PY_VERSION_HEX >= 0x03000000 + +#define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type) +#define PyInt_Check(x) PyLong_Check(x) +#define PyInt_AsLong(x) PyLong_AsLong(x) +#define PyInt_FromLong(x) PyLong_FromLong(x) +#define PyInt_FromSize_t(x) PyLong_FromSize_t(x) +#define PyString_Check(name) PyBytes_Check(name) +#define PyString_FromString(x) PyUnicode_FromString(x) +#define PyString_Format(fmt, args) PyUnicode_Format(fmt, args) +#define PyString_AsString(str) PyBytes_AsString(str) +#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 + +#ifndef Py_TYPE +# define Py_TYPE(op) ((op)->ob_type) +#endif + +/* SWIG APIs for compatibility of both Python 2 & 3 */ + +#if PY_VERSION_HEX >= 0x03000000 +# define SWIG_Python_str_FromFormat PyUnicode_FromFormat +#else +# define SWIG_Python_str_FromFormat PyString_FromFormat +#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 >= 0x03000000 + char *cstr; + char *newstr; + Py_ssize_t len; + str = PyUnicode_AsUTF8String(str); + PyBytes_AsStringAndSize(str, &cstr, &len); + newstr = (char *) malloc(len+1); + memcpy(newstr, cstr, len+1); + Py_XDECREF(str); + return newstr; +#else + return PyString_AsString(str); +#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) +{ +#if PY_VERSION_HEX >= 0x03000000 + return PyUnicode_FromString(c); +#else + return PyString_FromString(c); +#endif +} + +/* Add PyOS_snprintf for old Pythons */ +#if PY_VERSION_HEX < 0x02020000 +# if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM) +# define PyOS_snprintf _snprintf +# else +# define PyOS_snprintf snprintf +# endif +#endif + +/* A crude PyString_FromFormat implementation for old Pythons */ +#if PY_VERSION_HEX < 0x02020000 + +#ifndef SWIG_PYBUFFER_SIZE +# define SWIG_PYBUFFER_SIZE 1024 +#endif + +static PyObject * +PyString_FromFormat(const char *fmt, ...) { + va_list ap; + char buf[SWIG_PYBUFFER_SIZE * 2]; + int res; + va_start(ap, fmt); + res = vsnprintf(buf, sizeof(buf), fmt, ap); + va_end(ap); + return (res < 0 || res >= (int)sizeof(buf)) ? 0 : PyString_FromString(buf); +} +#endif + +#ifndef PyObject_DEL +# define PyObject_DEL PyObject_Del +#endif + +/* A crude PyExc_StopIteration exception for old Pythons */ +#if PY_VERSION_HEX < 0x02020000 +# ifndef PyExc_StopIteration +# define PyExc_StopIteration PyExc_RuntimeError +# endif +# ifndef PyObject_GenericGetAttr +# define PyObject_GenericGetAttr 0 +# endif +#endif + +/* Py_NotImplemented is defined in 2.1 and up. */ +#if PY_VERSION_HEX < 0x02010000 +# ifndef Py_NotImplemented +# define Py_NotImplemented PyExc_RuntimeError +# endif +#endif + +/* A crude PyString_AsStringAndSize implementation for old Pythons */ +#if PY_VERSION_HEX < 0x02010000 +# ifndef PyString_AsStringAndSize +# define PyString_AsStringAndSize(obj, s, len) {*s = PyString_AsString(obj); *len = *s ? strlen(*s) : 0;} +# endif +#endif + +/* PySequence_Size for old Pythons */ +#if PY_VERSION_HEX < 0x02000000 +# ifndef PySequence_Size +# define PySequence_Size PySequence_Length +# endif +#endif + +/* PyBool_FromLong for old Pythons */ +#if PY_VERSION_HEX < 0x02030000 +static +PyObject *PyBool_FromLong(long ok) +{ + PyObject *result = ok ? Py_True : Py_False; + Py_INCREF(result); + return result; +} +#endif + +/* Py_ssize_t for old Pythons */ +/* This code is as recommended by: */ +/* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */ +#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) +typedef int Py_ssize_t; +# define PY_SSIZE_T_MAX INT_MAX +# define PY_SSIZE_T_MIN INT_MIN +typedef inquiry lenfunc; +typedef intargfunc ssizeargfunc; +typedef intintargfunc ssizessizeargfunc; +typedef intobjargproc ssizeobjargproc; +typedef intintobjargproc ssizessizeobjargproc; +typedef getreadbufferproc readbufferproc; +typedef getwritebufferproc writebufferproc; +typedef getsegcountproc segcountproc; +typedef getcharbufferproc charbufferproc; +static long PyNumber_AsSsize_t (PyObject *x, void *SWIGUNUSEDPARM(exc)) +{ + long result = 0; + PyObject *i = PyNumber_Int(x); + if (i) { + result = PyInt_AsLong(i); + Py_DECREF(i); + } + return result; +} +#endif + +#if PY_VERSION_HEX < 0x02050000 +#define PyInt_FromSize_t(x) PyInt_FromLong((long)x) +#endif + +#if PY_VERSION_HEX < 0x02040000 +#define Py_VISIT(op) \ + do { \ + if (op) { \ + int vret = visit((op), arg); \ + if (vret) \ + return vret; \ + } \ + } while (0) +#endif + +#if PY_VERSION_HEX < 0x02030000 +typedef struct { + PyTypeObject type; + PyNumberMethods as_number; + PyMappingMethods as_mapping; + PySequenceMethods as_sequence; + PyBufferProcs as_buffer; + PyObject *name, *slots; +} PyHeapTypeObject; +#endif + +#if PY_VERSION_HEX < 0x02030000 +typedef destructor freefunc; +#endif + +#if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION > 6) || \ + (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION > 0) || \ + (PY_MAJOR_VERSION > 3)) +# define SWIGPY_USE_CAPSULE +# define SWIGPY_CAPSULE_NAME ((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME) +#endif + +#if PY_VERSION_HEX < 0x03020000 +#define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type) +#define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name) +#define Py_hash_t long +#endif + +/* ----------------------------------------------------------------------------- + * error manipulation + * ----------------------------------------------------------------------------- */ + +SWIGRUNTIME PyObject* +SWIG_Python_ErrorType(int code) { + PyObject* type = 0; + switch(code) { + case SWIG_MemoryError: + type = PyExc_MemoryError; + break; + case SWIG_IOError: + type = PyExc_IOError; + break; + case SWIG_RuntimeError: + type = PyExc_RuntimeError; + break; + case SWIG_IndexError: + type = PyExc_IndexError; + break; + case SWIG_TypeError: + type = PyExc_TypeError; + break; + case SWIG_DivisionByZero: + type = PyExc_ZeroDivisionError; + break; + case SWIG_OverflowError: + type = PyExc_OverflowError; + break; + case SWIG_SyntaxError: + type = PyExc_SyntaxError; + break; + case SWIG_ValueError: + type = PyExc_ValueError; + break; + case SWIG_SystemError: + type = PyExc_SystemError; + break; + case SWIG_AttributeError: + type = PyExc_AttributeError; + break; + default: + type = PyExc_RuntimeError; + } + return type; +} + + +SWIGRUNTIME void +SWIG_Python_AddErrorMsg(const char* mesg) +{ + PyObject *type = 0; + PyObject *value = 0; + PyObject *traceback = 0; + + if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback); + if (value) { + char *tmp; + PyObject *old_str = PyObject_Str(value); + PyErr_Clear(); + Py_XINCREF(type); + + PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); + SWIG_Python_str_DelForPy3(tmp); + Py_DECREF(old_str); + Py_DECREF(value); + } else { + PyErr_SetString(PyExc_RuntimeError, mesg); + } +} + +#if defined(SWIG_PYTHON_NO_THREADS) +# if defined(SWIG_PYTHON_THREADS) +# undef SWIG_PYTHON_THREADS +# endif +#endif +#if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */ +# if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL) +# if (PY_VERSION_HEX >= 0x02030000) /* For 2.3 or later, use the PyGILState calls */ +# define SWIG_PYTHON_USE_GIL +# endif +# endif +# if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */ +# ifndef SWIG_PYTHON_INITIALIZE_THREADS +# define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads() +# endif +# ifdef __cplusplus /* C++ code */ + class SWIG_Python_Thread_Block { + bool status; + PyGILState_STATE state; + public: + void end() { if (status) { PyGILState_Release(state); status = false;} } + SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {} + ~SWIG_Python_Thread_Block() { end(); } + }; + class SWIG_Python_Thread_Allow { + bool status; + PyThreadState *save; + public: + void end() { if (status) { PyEval_RestoreThread(save); status = false; }} + SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {} + ~SWIG_Python_Thread_Allow() { end(); } + }; +# define SWIG_PYTHON_THREAD_BEGIN_BLOCK SWIG_Python_Thread_Block _swig_thread_block +# define SWIG_PYTHON_THREAD_END_BLOCK _swig_thread_block.end() +# define SWIG_PYTHON_THREAD_BEGIN_ALLOW SWIG_Python_Thread_Allow _swig_thread_allow +# define SWIG_PYTHON_THREAD_END_ALLOW _swig_thread_allow.end() +# else /* C code */ +# define SWIG_PYTHON_THREAD_BEGIN_BLOCK PyGILState_STATE _swig_thread_block = PyGILState_Ensure() +# define SWIG_PYTHON_THREAD_END_BLOCK PyGILState_Release(_swig_thread_block) +# define SWIG_PYTHON_THREAD_BEGIN_ALLOW PyThreadState *_swig_thread_allow = PyEval_SaveThread() +# define SWIG_PYTHON_THREAD_END_ALLOW PyEval_RestoreThread(_swig_thread_allow) +# endif +# else /* Old thread way, not implemented, user must provide it */ +# if !defined(SWIG_PYTHON_INITIALIZE_THREADS) +# define SWIG_PYTHON_INITIALIZE_THREADS +# endif +# if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK) +# define SWIG_PYTHON_THREAD_BEGIN_BLOCK +# endif +# if !defined(SWIG_PYTHON_THREAD_END_BLOCK) +# define SWIG_PYTHON_THREAD_END_BLOCK +# endif +# if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW) +# define SWIG_PYTHON_THREAD_BEGIN_ALLOW +# endif +# if !defined(SWIG_PYTHON_THREAD_END_ALLOW) +# define SWIG_PYTHON_THREAD_END_ALLOW +# endif +# endif +#else /* No thread support */ +# define SWIG_PYTHON_INITIALIZE_THREADS +# define SWIG_PYTHON_THREAD_BEGIN_BLOCK +# define SWIG_PYTHON_THREAD_END_BLOCK +# define SWIG_PYTHON_THREAD_BEGIN_ALLOW +# define SWIG_PYTHON_THREAD_END_ALLOW +#endif + +/* ----------------------------------------------------------------------------- + * Python API portion that goes into the runtime + * ----------------------------------------------------------------------------- */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* ----------------------------------------------------------------------------- + * Constant declarations + * ----------------------------------------------------------------------------- */ + +/* Constant Types */ +#define SWIG_PY_POINTER 4 +#define SWIG_PY_BINARY 5 + +/* Constant information structure */ +typedef struct swig_const_info { + int type; + char *name; + long lvalue; + double dvalue; + void *pvalue; + swig_type_info **ptype; +} swig_const_info; + + +/* ----------------------------------------------------------------------------- + * Wrapper of PyInstanceMethod_New() used in Python 3 + * It is exported to the generated module, used for -fastproxy + * ----------------------------------------------------------------------------- */ +#if PY_VERSION_HEX >= 0x03000000 +SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) +{ + return PyInstanceMethod_New(func); +} +#else +SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *SWIGUNUSEDPARM(func)) +{ + return NULL; +} +#endif + +#ifdef __cplusplus +} +#endif + + +/* ----------------------------------------------------------------------------- + * pyrun.swg + * + * This file contains the runtime support for Python modules + * and includes code for managing global variables and pointer + * type checking. + * + * ----------------------------------------------------------------------------- */ + +/* Common SWIG API */ + +/* for raw pointers */ +#define SWIG_Python_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0) +#define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtr(obj, pptr, type, flags) +#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own) + +#ifdef SWIGPYTHON_BUILTIN +#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(self, ptr, type, flags) +#else +#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags) +#endif + +#define SWIG_InternalNewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags) + +#define SWIG_CheckImplicit(ty) SWIG_Python_CheckImplicit(ty) +#define SWIG_AcquirePtr(ptr, src) SWIG_Python_AcquirePtr(ptr, src) +#define swig_owntype int + +/* for raw packed data */ +#define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty) +#define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) + +/* for class or struct pointers */ +#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags) +#define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags) + +/* for C or C++ function pointers */ +#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_Python_ConvertFunctionPtr(obj, pptr, type) +#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Python_NewPointerObj(NULL, ptr, type, 0) + +/* for C++ member pointers, ie, member methods */ +#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty) +#define SWIG_NewMemberObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) + + +/* Runtime API */ + +#define SWIG_GetModule(clientdata) SWIG_Python_GetModule(clientdata) +#define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer) +#define SWIG_NewClientData(obj) SwigPyClientData_New(obj) + +#define SWIG_SetErrorObj SWIG_Python_SetErrorObj +#define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg +#define SWIG_ErrorType(code) SWIG_Python_ErrorType(code) +#define SWIG_Error(code, msg) SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg) +#define SWIG_fail goto fail + + +/* Runtime API implementation */ + +/* Error manipulation */ + +SWIGINTERN void +SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) { + SWIG_PYTHON_THREAD_BEGIN_BLOCK; + PyErr_SetObject(errtype, obj); + Py_DECREF(obj); + SWIG_PYTHON_THREAD_END_BLOCK; +} + +SWIGINTERN void +SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) { + SWIG_PYTHON_THREAD_BEGIN_BLOCK; + PyErr_SetString(errtype, msg); + SWIG_PYTHON_THREAD_END_BLOCK; +} + +#define SWIG_Python_Raise(obj, type, desc) SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj) + +/* Set a constant value */ + +#if defined(SWIGPYTHON_BUILTIN) + +SWIGINTERN void +SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) { + PyObject *s = PyString_InternFromString(key); + PyList_Append(seq, s); + Py_DECREF(s); +} + +SWIGINTERN void +SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) { +#if PY_VERSION_HEX < 0x02030000 + PyDict_SetItemString(d, (char *)name, obj); +#else + PyDict_SetItemString(d, name, obj); +#endif + Py_DECREF(obj); + if (public_interface) + SwigPyBuiltin_AddPublicSymbol(public_interface, name); +} + +#else + +SWIGINTERN void +SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) { +#if PY_VERSION_HEX < 0x02030000 + PyDict_SetItemString(d, (char *)name, obj); +#else + PyDict_SetItemString(d, name, obj); +#endif + Py_DECREF(obj); +} + +#endif + +/* Append a value to the result obj */ + +SWIGINTERN PyObject* +SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) { +#if !defined(SWIG_PYTHON_OUTPUT_TUPLE) + if (!result) { + result = obj; + } else if (result == Py_None) { + Py_DECREF(result); + result = obj; + } else { + if (!PyList_Check(result)) { + PyObject *o2 = result; + result = PyList_New(1); + PyList_SetItem(result, 0, o2); + } + PyList_Append(result,obj); + Py_DECREF(obj); + } + return result; +#else + PyObject* o2; + PyObject* o3; + if (!result) { + result = obj; + } else if (result == Py_None) { + Py_DECREF(result); + result = obj; + } else { + if (!PyTuple_Check(result)) { + o2 = result; + result = PyTuple_New(1); + PyTuple_SET_ITEM(result, 0, o2); + } + o3 = PyTuple_New(1); + PyTuple_SET_ITEM(o3, 0, obj); + o2 = result; + result = PySequence_Concat(o2, o3); + Py_DECREF(o2); + Py_DECREF(o3); + } + return result; +#endif +} + +/* Unpack the argument tuple */ + +SWIGINTERN Py_ssize_t +SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs) +{ + if (!args) { + if (!min && !max) { + return 1; + } else { + PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none", + name, (min == max ? "" : "at least "), (int)min); + return 0; + } + } + if (!PyTuple_Check(args)) { + if (min <= 1 && max >= 1) { + Py_ssize_t i; + objs[0] = args; + for (i = 1; i < max; ++i) { + objs[i] = 0; + } + return 2; + } + PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple"); + return 0; + } else { + Py_ssize_t l = PyTuple_GET_SIZE(args); + if (l < min) { + PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", + name, (min == max ? "" : "at least "), (int)min, (int)l); + return 0; + } else if (l > max) { + PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", + name, (min == max ? "" : "at most "), (int)max, (int)l); + return 0; + } else { + Py_ssize_t i; + for (i = 0; i < l; ++i) { + objs[i] = PyTuple_GET_ITEM(args, i); + } + for (; l < max; ++l) { + objs[l] = 0; + } + return i + 1; + } + } +} + +/* A functor is a function object with one single object argument */ +#if PY_VERSION_HEX >= 0x02020000 +#define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL); +#else +#define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunction(functor, "O", obj); +#endif + +/* + Helper for static pointer initialization for both C and C++ code, for example + static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...); +*/ +#ifdef __cplusplus +#define SWIG_STATIC_POINTER(var) var +#else +#define SWIG_STATIC_POINTER(var) var = 0; if (!var) var +#endif + +/* ----------------------------------------------------------------------------- + * Pointer declarations + * ----------------------------------------------------------------------------- */ + +/* Flags for new pointer objects */ +#define SWIG_POINTER_NOSHADOW (SWIG_POINTER_OWN << 1) +#define SWIG_POINTER_NEW (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN) + +#define SWIG_POINTER_IMPLICIT_CONV (SWIG_POINTER_DISOWN << 1) + +#define SWIG_BUILTIN_TP_INIT (SWIG_POINTER_OWN << 2) +#define SWIG_BUILTIN_INIT (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN) + +#ifdef __cplusplus +extern "C" { +#endif + +/* How to access Py_None */ +#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# ifndef SWIG_PYTHON_NO_BUILD_NONE +# ifndef SWIG_PYTHON_BUILD_NONE +# define SWIG_PYTHON_BUILD_NONE +# endif +# endif +#endif + +#ifdef SWIG_PYTHON_BUILD_NONE +# ifdef Py_None +# undef Py_None +# define Py_None SWIG_Py_None() +# endif +SWIGRUNTIMEINLINE PyObject * +_SWIG_Py_None(void) +{ + PyObject *none = Py_BuildValue((char*)""); + Py_DECREF(none); + return none; +} +SWIGRUNTIME PyObject * +SWIG_Py_None(void) +{ + static PyObject *SWIG_STATIC_POINTER(none) = _SWIG_Py_None(); + return none; +} +#endif + +/* The python void return value */ + +SWIGRUNTIMEINLINE PyObject * +SWIG_Py_Void(void) +{ + PyObject *none = Py_None; + Py_INCREF(none); + return none; +} + +/* SwigPyClientData */ + +typedef struct { + PyObject *klass; + PyObject *newraw; + PyObject *newargs; + PyObject *destroy; + int delargs; + int implicitconv; + PyTypeObject *pytype; +} SwigPyClientData; + +SWIGRUNTIMEINLINE int +SWIG_Python_CheckImplicit(swig_type_info *ty) +{ + SwigPyClientData *data = (SwigPyClientData *)ty->clientdata; + return data ? data->implicitconv : 0; +} + +SWIGRUNTIMEINLINE PyObject * +SWIG_Python_ExceptionType(swig_type_info *desc) { + SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0; + PyObject *klass = data ? data->klass : 0; + return (klass ? klass : PyExc_RuntimeError); +} + + +SWIGRUNTIME SwigPyClientData * +SwigPyClientData_New(PyObject* obj) +{ + if (!obj) { + return 0; + } else { + SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData)); + /* the klass element */ + data->klass = obj; + Py_INCREF(data->klass); + /* 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); + } else { +#if (PY_VERSION_HEX < 0x02020000) + data->newraw = 0; +#else + data->newraw = PyObject_GetAttrString(data->klass, (char *)"__new__"); +#endif + if (data->newraw) { + Py_INCREF(data->newraw); + data->newargs = PyTuple_New(1); + PyTuple_SetItem(data->newargs, 0, obj); + } else { + data->newargs = obj; + } + Py_INCREF(data->newargs); + } + /* the destroy method, aka as the C++ delete method */ + data->destroy = PyObject_GetAttrString(data->klass, (char *)"__swig_destroy__"); + if (PyErr_Occurred()) { + PyErr_Clear(); + data->destroy = 0; + } + if (data->destroy) { + int flags; + Py_INCREF(data->destroy); + flags = PyCFunction_GET_FLAGS(data->destroy); +#ifdef METH_O + data->delargs = !(flags & (METH_O)); +#else + data->delargs = 0; +#endif + } else { + data->delargs = 0; + } + data->implicitconv = 0; + data->pytype = 0; + return data; + } +} + +SWIGRUNTIME void +SwigPyClientData_Del(SwigPyClientData *data) { + Py_XDECREF(data->newraw); + Py_XDECREF(data->newargs); + Py_XDECREF(data->destroy); +} + +/* =============== SwigPyObject =====================*/ + +typedef struct { + PyObject_HEAD + void *ptr; + swig_type_info *ty; + int own; + PyObject *next; +#ifdef SWIGPYTHON_BUILTIN + PyObject *dict; +#endif +} SwigPyObject; + + +#ifdef SWIGPYTHON_BUILTIN + +SWIGRUNTIME PyObject * +SwigPyObject_get___dict__(PyObject *v, PyObject *SWIGUNUSEDPARM(args)) +{ + SwigPyObject *sobj = (SwigPyObject *)v; + + if (!sobj->dict) + sobj->dict = PyDict_New(); + + Py_INCREF(sobj->dict); + return sobj->dict; +} + +#endif + +SWIGRUNTIME PyObject * +SwigPyObject_long(SwigPyObject *v) +{ + return PyLong_FromVoidPtr(v->ptr); +} + +SWIGRUNTIME PyObject * +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); + if (ofmt) { +#if PY_VERSION_HEX >= 0x03000000 + res = PyUnicode_Format(ofmt,args); +#else + res = PyString_Format(ofmt,args); +#endif + Py_DECREF(ofmt); + } + Py_DECREF(args); + } + } + return res; +} + +SWIGRUNTIME PyObject * +SwigPyObject_oct(SwigPyObject *v) +{ + return SwigPyObject_format("%o",v); +} + +SWIGRUNTIME PyObject * +SwigPyObject_hex(SwigPyObject *v) +{ + return SwigPyObject_format("%x",v); +} + +SWIGRUNTIME PyObject * +#ifdef METH_NOARGS +SwigPyObject_repr(SwigPyObject *v) +#else +SwigPyObject_repr(SwigPyObject *v, PyObject *args) +#endif +{ + const char *name = SWIG_TypePrettyName(v->ty); + PyObject *repr = SWIG_Python_str_FromFormat("", (name ? name : "unknown"), (void *)v); + if (v->next) { +# ifdef METH_NOARGS + PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next); +# else + PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args); +# endif +# if PY_VERSION_HEX >= 0x03000000 + PyObject *joined = PyUnicode_Concat(repr, nrep); + Py_DecRef(repr); + Py_DecRef(nrep); + repr = joined; +# else + PyString_ConcatAndDel(&repr,nrep); +# endif + } + return repr; +} + +SWIGRUNTIME int +SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w) +{ + void *i = v->ptr; + void *j = w->ptr; + return (i < j) ? -1 : ((i > j) ? 1 : 0); +} + +/* Added for Python 3.x, would it also be useful for Python 2.x? */ +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; + } + res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0); + return res; +} + + +SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void); + +#ifdef SWIGPYTHON_BUILTIN +static swig_type_info *SwigPyObject_stype = 0; +SWIGRUNTIME PyTypeObject* +SwigPyObject_type(void) { + SwigPyClientData *cd; + assert(SwigPyObject_stype); + cd = (SwigPyClientData*) SwigPyObject_stype->clientdata; + assert(cd); + assert(cd->pytype); + return cd->pytype; +} +#else +SWIGRUNTIME PyTypeObject* +SwigPyObject_type(void) { + static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyObject_TypeOnce(); + return type; +} +#endif + +SWIGRUNTIMEINLINE int +SwigPyObject_Check(PyObject *op) { +#ifdef SWIGPYTHON_BUILTIN + PyTypeObject *target_tp = SwigPyObject_type(); + if (PyType_IsSubtype(op->ob_type, target_tp)) + return 1; + return (strcmp(op->ob_type->tp_name, "SwigPyObject") == 0); +#else + return (Py_TYPE(op) == SwigPyObject_type()) + || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0); +#endif +} + +SWIGRUNTIME PyObject * +SwigPyObject_New(void *ptr, swig_type_info *ty, int own); + +SWIGRUNTIME void +SwigPyObject_dealloc(PyObject *v) +{ + SwigPyObject *sobj = (SwigPyObject *) v; + PyObject *next = sobj->next; + if (sobj->own == SWIG_POINTER_OWN) { + swig_type_info *ty = sobj->ty; + SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; + PyObject *destroy = data ? data->destroy : 0; + if (destroy) { + /* destroy is always a VARARGS method */ + PyObject *res; + + /* PyObject_CallFunction() has the potential to silently drop + the active active exception. In cases of unnamed temporary + variable or where we just finished iterating over a generator + StopIteration will be active right now, and this needs to + remain true upon return from SwigPyObject_dealloc. So save + and restore. */ + + PyObject *val = NULL, *type = NULL, *tb = NULL; + PyErr_Fetch(&val, &type, &tb); + + 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); + } else { + PyCFunction meth = PyCFunction_GET_FUNCTION(destroy); + PyObject *mself = PyCFunction_GET_SELF(destroy); + res = ((*meth)(mself, v)); + } + if (!res) + PyErr_WriteUnraisable(destroy); + + PyErr_Restore(val, type, tb); + + Py_XDECREF(res); + } +#if !defined(SWIG_PYTHON_SILENT_MEMLEAK) + else { + const char *name = SWIG_TypePrettyName(ty); + printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown")); + } +#endif + } + Py_XDECREF(next); + PyObject_DEL(v); +} + +SWIGRUNTIME PyObject* +SwigPyObject_append(PyObject* v, PyObject* next) +{ + SwigPyObject *sobj = (SwigPyObject *) v; +#ifndef METH_O + PyObject *tmp = 0; + if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL; + next = tmp; +#endif + if (!SwigPyObject_Check(next)) { + PyErr_SetString(PyExc_TypeError, "Attempt to append a non SwigPyObject"); + return NULL; + } + sobj->next = next; + Py_INCREF(next); + return SWIG_Py_Void(); +} + +SWIGRUNTIME PyObject* +#ifdef METH_NOARGS +SwigPyObject_next(PyObject* v) +#else +SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) +#endif +{ + SwigPyObject *sobj = (SwigPyObject *) v; + if (sobj->next) { + Py_INCREF(sobj->next); + return sobj->next; + } else { + return SWIG_Py_Void(); + } +} + +SWIGINTERN PyObject* +#ifdef METH_NOARGS +SwigPyObject_disown(PyObject *v) +#else +SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) +#endif +{ + SwigPyObject *sobj = (SwigPyObject *)v; + sobj->own = 0; + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject* +#ifdef METH_NOARGS +SwigPyObject_acquire(PyObject *v) +#else +SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) +#endif +{ + SwigPyObject *sobj = (SwigPyObject *)v; + sobj->own = SWIG_POINTER_OWN; + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject* +SwigPyObject_own(PyObject *v, PyObject *args) +{ + PyObject *val = 0; +#if (PY_VERSION_HEX < 0x02020000) + if (!PyArg_ParseTuple(args,(char *)"|O:own",&val)) +#elif (PY_VERSION_HEX < 0x02050000) + if (!PyArg_UnpackTuple(args, (char *)"own", 0, 1, &val)) +#else + if (!PyArg_UnpackTuple(args, "own", 0, 1, &val)) +#endif + { + return NULL; + } + else + { + SwigPyObject *sobj = (SwigPyObject *)v; + PyObject *obj = PyBool_FromLong(sobj->own); + if (val) { +#ifdef METH_NOARGS + if (PyObject_IsTrue(val)) { + SwigPyObject_acquire(v); + } else { + SwigPyObject_disown(v); + } +#else + if (PyObject_IsTrue(val)) { + SwigPyObject_acquire(v,args); + } else { + SwigPyObject_disown(v,args); + } +#endif + } + return obj; + } +} + +#ifdef METH_O +static PyMethodDef +swigobject_methods[] = { + {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"}, + {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS, (char *)"acquires ownership of the pointer"}, + {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, + {(char *)"append", (PyCFunction)SwigPyObject_append, METH_O, (char *)"appends another 'this' object"}, + {(char *)"next", (PyCFunction)SwigPyObject_next, METH_NOARGS, (char *)"returns the next 'this' object"}, + {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_NOARGS, (char *)"returns object representation"}, + {0, 0, 0, 0} +}; +#else +static PyMethodDef +swigobject_methods[] = { + {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"}, + {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS, (char *)"acquires ownership of the pointer"}, + {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, + {(char *)"append", (PyCFunction)SwigPyObject_append, METH_VARARGS, (char *)"appends another 'this' object"}, + {(char *)"next", (PyCFunction)SwigPyObject_next, METH_VARARGS, (char *)"returns the next 'this' object"}, + {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_VARARGS, (char *)"returns object representation"}, + {0, 0, 0, 0} +}; +#endif + +#if PY_VERSION_HEX < 0x02020000 +SWIGINTERN PyObject * +SwigPyObject_getattr(SwigPyObject *sobj,char *name) +{ + return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name); +} +#endif + +SWIGRUNTIME PyTypeObject* +SwigPyObject_TypeOnce(void) { + static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer"; + + static PyNumberMethods SwigPyObject_as_number = { + (binaryfunc)0, /*nb_add*/ + (binaryfunc)0, /*nb_subtract*/ + (binaryfunc)0, /*nb_multiply*/ + /* nb_divide removed in Python 3 */ +#if PY_VERSION_HEX < 0x03000000 + (binaryfunc)0, /*nb_divide*/ +#endif + (binaryfunc)0, /*nb_remainder*/ + (binaryfunc)0, /*nb_divmod*/ + (ternaryfunc)0,/*nb_power*/ + (unaryfunc)0, /*nb_negative*/ + (unaryfunc)0, /*nb_positive*/ + (unaryfunc)0, /*nb_absolute*/ + (inquiry)0, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ +#if PY_VERSION_HEX < 0x03000000 + 0, /*nb_coerce*/ +#endif + (unaryfunc)SwigPyObject_long, /*nb_int*/ +#if PY_VERSION_HEX < 0x03000000 + (unaryfunc)SwigPyObject_long, /*nb_long*/ +#else + 0, /*nb_reserved*/ +#endif + (unaryfunc)0, /*nb_float*/ +#if PY_VERSION_HEX < 0x03000000 + (unaryfunc)SwigPyObject_oct, /*nb_oct*/ + (unaryfunc)SwigPyObject_hex, /*nb_hex*/ +#endif +#if PY_VERSION_HEX >= 0x03050000 /* 3.5 */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_matrix_multiply */ +#elif PY_VERSION_HEX >= 0x03000000 /* 3.0 */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */ +#elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */ +#elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */ +#elif PY_VERSION_HEX >= 0x02000000 /* 2.0.0 */ + 0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_or */ +#endif + }; + + static PyTypeObject swigpyobject_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 + (char *)"SwigPyObject", /* tp_name */ + sizeof(SwigPyObject), /* tp_basicsize */ + 0, /* tp_itemsize */ + (destructor)SwigPyObject_dealloc, /* tp_dealloc */ + 0, /* tp_print */ +#if PY_VERSION_HEX < 0x02020000 + (getattrfunc)SwigPyObject_getattr, /* tp_getattr */ +#else + (getattrfunc)0, /* tp_getattr */ +#endif + (setattrfunc)0, /* tp_setattr */ +#if PY_VERSION_HEX >= 0x03000000 + 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */ +#else + (cmpfunc)SwigPyObject_compare, /* tp_compare */ +#endif + (reprfunc)SwigPyObject_repr, /* tp_repr */ + &SwigPyObject_as_number, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + (hashfunc)0, /* tp_hash */ + (ternaryfunc)0, /* tp_call */ + 0, /* tp_str */ + PyObject_GenericGetAttr, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT, /* tp_flags */ + swigobject_doc, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + (richcmpfunc)SwigPyObject_richcompare,/* tp_richcompare */ + 0, /* tp_weaklistoffset */ +#if PY_VERSION_HEX >= 0x02020000 + 0, /* tp_iter */ + 0, /* tp_iternext */ + swigobject_methods, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + 0, /* tp_free */ + 0, /* tp_is_gc */ + 0, /* tp_bases */ + 0, /* tp_mro */ + 0, /* tp_cache */ + 0, /* tp_subclasses */ + 0, /* tp_weaklist */ +#endif +#if PY_VERSION_HEX >= 0x02030000 + 0, /* tp_del */ +#endif +#if PY_VERSION_HEX >= 0x02060000 + 0, /* tp_version_tag */ +#endif +#if PY_VERSION_HEX >= 0x03040000 + 0, /* tp_finalize */ +#endif +#ifdef COUNT_ALLOCS + 0, /* tp_allocs */ + 0, /* tp_frees */ + 0, /* tp_maxalloc */ +#if PY_VERSION_HEX >= 0x02050000 + 0, /* tp_prev */ +#endif + 0 /* tp_next */ +#endif + }; + swigpyobject_type = tmp; + type_init = 1; +#if PY_VERSION_HEX < 0x02020000 + swigpyobject_type.ob_type = &PyType_Type; +#else + if (PyType_Ready(&swigpyobject_type) < 0) + return NULL; +#endif + } + return &swigpyobject_type; +} + +SWIGRUNTIME PyObject * +SwigPyObject_New(void *ptr, swig_type_info *ty, int own) +{ + SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type()); + if (sobj) { + sobj->ptr = ptr; + sobj->ty = ty; + sobj->own = own; + sobj->next = 0; + } + return (PyObject *)sobj; +} + +/* ----------------------------------------------------------------------------- + * Implements a simple Swig Packed type, and use it instead of string + * ----------------------------------------------------------------------------- */ + +typedef struct { + PyObject_HEAD + void *pack; + swig_type_info *ty; + size_t size; +} SwigPyPacked; + +SWIGRUNTIME int +SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags)) +{ + char result[SWIG_BUFFER_SIZE]; + fputs("pack, v->size, 0, sizeof(result))) { + fputs("at ", fp); + fputs(result, fp); + } + fputs(v->ty->name,fp); + fputs(">", fp); + return 0; +} + +SWIGRUNTIME PyObject * +SwigPyPacked_repr(SwigPyPacked *v) +{ + char result[SWIG_BUFFER_SIZE]; + if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) { + return SWIG_Python_str_FromFormat("", result, v->ty->name); + } else { + return SWIG_Python_str_FromFormat("", v->ty->name); + } +} + +SWIGRUNTIME PyObject * +SwigPyPacked_str(SwigPyPacked *v) +{ + char result[SWIG_BUFFER_SIZE]; + if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){ + return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name); + } else { + return SWIG_Python_str_FromChar(v->ty->name); + } +} + +SWIGRUNTIME int +SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w) +{ + size_t i = v->size; + size_t j = w->size; + int s = (i < j) ? -1 : ((i > j) ? 1 : 0); + return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size); +} + +SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void); + +SWIGRUNTIME PyTypeObject* +SwigPyPacked_type(void) { + static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyPacked_TypeOnce(); + return type; +} + +SWIGRUNTIMEINLINE int +SwigPyPacked_Check(PyObject *op) { + return ((op)->ob_type == SwigPyPacked_TypeOnce()) + || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0); +} + +SWIGRUNTIME void +SwigPyPacked_dealloc(PyObject *v) +{ + if (SwigPyPacked_Check(v)) { + SwigPyPacked *sobj = (SwigPyPacked *) v; + free(sobj->pack); + } + PyObject_DEL(v); +} + +SWIGRUNTIME PyTypeObject* +SwigPyPacked_TypeOnce(void) { + static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer"; + static PyTypeObject swigpypacked_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 + (char *)"SwigPyPacked", /* tp_name */ + sizeof(SwigPyPacked), /* tp_basicsize */ + 0, /* tp_itemsize */ + (destructor)SwigPyPacked_dealloc, /* tp_dealloc */ + (printfunc)SwigPyPacked_print, /* tp_print */ + (getattrfunc)0, /* tp_getattr */ + (setattrfunc)0, /* tp_setattr */ +#if PY_VERSION_HEX>=0x03000000 + 0, /* tp_reserved in 3.0.1 */ +#else + (cmpfunc)SwigPyPacked_compare, /* tp_compare */ +#endif + (reprfunc)SwigPyPacked_repr, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + (hashfunc)0, /* tp_hash */ + (ternaryfunc)0, /* tp_call */ + (reprfunc)SwigPyPacked_str, /* tp_str */ + PyObject_GenericGetAttr, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT, /* tp_flags */ + swigpacked_doc, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ +#if PY_VERSION_HEX >= 0x02020000 + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + 0, /* tp_free */ + 0, /* tp_is_gc */ + 0, /* tp_bases */ + 0, /* tp_mro */ + 0, /* tp_cache */ + 0, /* tp_subclasses */ + 0, /* tp_weaklist */ +#endif +#if PY_VERSION_HEX >= 0x02030000 + 0, /* tp_del */ +#endif +#if PY_VERSION_HEX >= 0x02060000 + 0, /* tp_version_tag */ +#endif +#if PY_VERSION_HEX >= 0x03040000 + 0, /* tp_finalize */ +#endif +#ifdef COUNT_ALLOCS + 0, /* tp_allocs */ + 0, /* tp_frees */ + 0, /* tp_maxalloc */ +#if PY_VERSION_HEX >= 0x02050000 + 0, /* tp_prev */ +#endif + 0 /* tp_next */ +#endif + }; + swigpypacked_type = tmp; + type_init = 1; +#if PY_VERSION_HEX < 0x02020000 + swigpypacked_type.ob_type = &PyType_Type; +#else + if (PyType_Ready(&swigpypacked_type) < 0) + return NULL; +#endif + } + return &swigpypacked_type; +} + +SWIGRUNTIME PyObject * +SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty) +{ + SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type()); + if (sobj) { + void *pack = malloc(size); + if (pack) { + memcpy(pack, ptr, size); + sobj->pack = pack; + sobj->ty = ty; + sobj->size = size; + } else { + PyObject_DEL((PyObject *) sobj); + sobj = 0; + } + } + return (PyObject *) sobj; +} + +SWIGRUNTIME swig_type_info * +SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size) +{ + if (SwigPyPacked_Check(obj)) { + SwigPyPacked *sobj = (SwigPyPacked *)obj; + if (sobj->size != size) return 0; + memcpy(ptr, sobj->pack, size); + return sobj->ty; + } else { + return 0; + } +} + +/* ----------------------------------------------------------------------------- + * pointers/data manipulation + * ----------------------------------------------------------------------------- */ + +SWIGRUNTIMEINLINE PyObject * +_SWIG_This(void) +{ + return SWIG_Python_str_FromChar("this"); +} + +static PyObject *swig_this = NULL; + +SWIGRUNTIME PyObject * +SWIG_This(void) +{ + if (swig_this == NULL) + swig_this = _SWIG_This(); + return swig_this; +} + +/* #define SWIG_PYTHON_SLOW_GETSET_THIS */ + +/* TODO: I don't know how to implement the fast getset in Python 3 right now */ +#if PY_VERSION_HEX>=0x03000000 +#define SWIG_PYTHON_SLOW_GETSET_THIS +#endif + +SWIGRUNTIME SwigPyObject * +SWIG_Python_GetSwigThis(PyObject *pyobj) +{ + PyObject *obj; + + if (SwigPyObject_Check(pyobj)) + return (SwigPyObject *) pyobj; + +#ifdef SWIGPYTHON_BUILTIN + (void)obj; +# ifdef PyWeakref_CheckProxy + if (PyWeakref_CheckProxy(pyobj)) { + pyobj = PyWeakref_GET_OBJECT(pyobj); + if (pyobj && SwigPyObject_Check(pyobj)) + return (SwigPyObject*) pyobj; + } +# endif + return NULL; +#else + + obj = 0; + +#if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000)) + if (PyInstance_Check(pyobj)) { + obj = _PyInstance_Lookup(pyobj, SWIG_This()); + } else { + PyObject **dictptr = _PyObject_GetDictPtr(pyobj); + if (dictptr != NULL) { + PyObject *dict = *dictptr; + obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0; + } else { +#ifdef PyWeakref_CheckProxy + if (PyWeakref_CheckProxy(pyobj)) { + PyObject *wobj = PyWeakref_GET_OBJECT(pyobj); + return wobj ? SWIG_Python_GetSwigThis(wobj) : 0; + } +#endif + obj = PyObject_GetAttr(pyobj,SWIG_This()); + if (obj) { + Py_DECREF(obj); + } else { + if (PyErr_Occurred()) PyErr_Clear(); + return 0; + } + } + } +#else + obj = PyObject_GetAttr(pyobj,SWIG_This()); + if (obj) { + Py_DECREF(obj); + } else { + if (PyErr_Occurred()) PyErr_Clear(); + return 0; + } +#endif + if (obj && !SwigPyObject_Check(obj)) { + /* a PyObject is called 'this', try to get the 'real this' + SwigPyObject from it */ + return SWIG_Python_GetSwigThis(obj); + } + return (SwigPyObject *)obj; +#endif +} + +/* Acquire a pointer value */ + +SWIGRUNTIME int +SWIG_Python_AcquirePtr(PyObject *obj, int own) { + if (own == SWIG_POINTER_OWN) { + SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj); + if (sobj) { + int oldown = sobj->own; + sobj->own = own; + return oldown; + } + } + return 0; +} + +/* Convert a pointer value */ + +SWIGRUNTIME int +SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) { + int res; + SwigPyObject *sobj; + int implicit_conv = (flags & SWIG_POINTER_IMPLICIT_CONV) != 0; + + if (!obj) + return SWIG_ERROR; + if (obj == Py_None && !implicit_conv) { + if (ptr) + *ptr = 0; + return SWIG_OK; + } + + res = SWIG_ERROR; + + sobj = SWIG_Python_GetSwigThis(obj); + if (own) + *own = 0; + while (sobj) { + void *vptr = sobj->ptr; + if (ty) { + swig_type_info *to = sobj->ty; + if (to == ty) { + /* no type cast needed */ + if (ptr) *ptr = vptr; + break; + } else { + swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); + if (!tc) { + sobj = (SwigPyObject *)sobj->next; + } else { + if (ptr) { + int newmemory = 0; + *ptr = SWIG_TypeCast(tc,vptr,&newmemory); + if (newmemory == SWIG_CAST_NEW_MEMORY) { + assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */ + if (own) + *own = *own | SWIG_CAST_NEW_MEMORY; + } + } + break; + } + } + } else { + if (ptr) *ptr = vptr; + break; + } + } + if (sobj) { + if (own) + *own = *own | sobj->own; + if (flags & SWIG_POINTER_DISOWN) { + sobj->own = 0; + } + res = SWIG_OK; + } else { + if (implicit_conv) { + SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; + if (data && !data->implicitconv) { + PyObject *klass = data->klass; + if (klass) { + PyObject *impconv; + data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/ + impconv = SWIG_Python_CallFunctor(klass, obj); + data->implicitconv = 0; + if (PyErr_Occurred()) { + PyErr_Clear(); + impconv = 0; + } + if (impconv) { + SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv); + if (iobj) { + void *vptr; + res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0); + if (SWIG_IsOK(res)) { + if (ptr) { + *ptr = vptr; + /* transfer the ownership to 'ptr' */ + iobj->own = 0; + res = SWIG_AddCast(res); + res = SWIG_AddNewMask(res); + } else { + res = SWIG_AddCast(res); + } + } + } + Py_DECREF(impconv); + } + } + } + } + if (!SWIG_IsOK(res) && obj == Py_None) { + if (ptr) + *ptr = 0; + if (PyErr_Occurred()) + PyErr_Clear(); + res = SWIG_OK; + } + } + return res; +} + +/* Convert a function ptr value */ + +SWIGRUNTIME int +SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) { + if (!PyCFunction_Check(obj)) { + return SWIG_ConvertPtr(obj, ptr, ty, 0); + } else { + void *vptr = 0; + + /* here we get the method pointer for callbacks */ + const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); + const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0; + if (desc) + desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0; + if (!desc) + return SWIG_ERROR; + if (ty) { + swig_cast_info *tc = SWIG_TypeCheck(desc,ty); + if (tc) { + int newmemory = 0; + *ptr = SWIG_TypeCast(tc,vptr,&newmemory); + assert(!newmemory); /* newmemory handling not yet implemented */ + } else { + return SWIG_ERROR; + } + } else { + *ptr = vptr; + } + return SWIG_OK; + } +} + +/* Convert a packed value value */ + +SWIGRUNTIME int +SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) { + swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz); + if (!to) return SWIG_ERROR; + if (ty) { + if (to != ty) { + /* check type cast? */ + swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); + if (!tc) return SWIG_ERROR; + } + } + return SWIG_OK; +} + +/* ----------------------------------------------------------------------------- + * Create a new pointer object + * ----------------------------------------------------------------------------- */ + +/* + Create a new instance object, without calling __init__, and set the + 'this' attribute. +*/ + +SWIGRUNTIME PyObject* +SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) +{ +#if (PY_VERSION_HEX >= 0x02020000) + PyObject *inst = 0; + PyObject *newraw = data->newraw; + if (newraw) { + inst = PyObject_Call(newraw, data->newargs, NULL); + if (inst) { +#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); + } + } +#else + PyObject *key = SWIG_This(); + PyObject_SetAttr(inst, key, swig_this); +#endif + } + } else { +#if PY_VERSION_HEX >= 0x03000000 + inst = ((PyTypeObject*) data->newargs)->tp_new((PyTypeObject*) data->newargs, Py_None, Py_None); + if (inst) { + PyObject_SetAttr(inst, SWIG_This(), swig_this); + Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG; + } +#else + PyObject *dict = PyDict_New(); + if (dict) { + PyDict_SetItem(dict, SWIG_This(), swig_this); + inst = PyInstance_NewRaw(data->newargs, dict); + Py_DECREF(dict); + } +#endif + } + return inst; +#else +#if (PY_VERSION_HEX >= 0x02010000) + PyObject *inst = 0; + PyObject *dict = PyDict_New(); + if (dict) { + PyDict_SetItem(dict, SWIG_This(), swig_this); + inst = PyInstance_NewRaw(data->newargs, dict); + Py_DECREF(dict); + } + return (PyObject *) inst; +#else + PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type); + if (inst == NULL) { + return NULL; + } + inst->in_class = (PyClassObject *)data->newargs; + Py_INCREF(inst->in_class); + inst->in_dict = PyDict_New(); + if (inst->in_dict == NULL) { + Py_DECREF(inst); + return NULL; + } +#ifdef Py_TPFLAGS_HAVE_WEAKREFS + inst->in_weakreflist = NULL; +#endif +#ifdef Py_TPFLAGS_GC + PyObject_GC_Init(inst); +#endif + PyDict_SetItem(inst->in_dict, SWIG_This(), swig_this); + return (PyObject *) inst; +#endif +#endif +} + +SWIGRUNTIME void +SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this) +{ + PyObject *dict; +#if (PY_VERSION_HEX >= 0x02020000) && !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; + } +#endif + dict = PyObject_GetAttrString(inst, (char*)"__dict__"); + PyDict_SetItem(dict, SWIG_This(), swig_this); + Py_DECREF(dict); +} + + +SWIGINTERN PyObject * +SWIG_Python_InitShadowInstance(PyObject *args) { + PyObject *obj[2]; + if (!SWIG_Python_UnpackTuple(args, "swiginit", 2, 2, obj)) { + return NULL; + } else { + SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]); + if (sthis) { + SwigPyObject_append((PyObject*) sthis, obj[1]); + } else { + SWIG_Python_SetSwigThis(obj[0], obj[1]); + } + return SWIG_Py_Void(); + } +} + +/* Create a new pointer object */ + +SWIGRUNTIME PyObject * +SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags) { + SwigPyClientData *clientdata; + PyObject * robj; + int own; + + if (!ptr) + return SWIG_Py_Void(); + + clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0; + own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0; + if (clientdata && clientdata->pytype) { + SwigPyObject *newobj; + if (flags & SWIG_BUILTIN_TP_INIT) { + newobj = (SwigPyObject*) self; + if (newobj->ptr) { + PyObject *next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0); + while (newobj->next) + newobj = (SwigPyObject *) newobj->next; + newobj->next = next_self; + newobj = (SwigPyObject *)next_self; +#ifdef SWIGPYTHON_BUILTIN + newobj->dict = 0; +#endif + } + } else { + newobj = PyObject_New(SwigPyObject, clientdata->pytype); +#ifdef SWIGPYTHON_BUILTIN + newobj->dict = 0; +#endif + } + if (newobj) { + newobj->ptr = ptr; + newobj->ty = type; + newobj->own = own; + newobj->next = 0; + return (PyObject*) newobj; + } + return SWIG_Py_Void(); + } + + assert(!(flags & SWIG_BUILTIN_TP_INIT)); + + robj = SwigPyObject_New(ptr, type, own); + if (robj && clientdata && !(flags & SWIG_POINTER_NOSHADOW)) { + PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj); + Py_DECREF(robj); + robj = inst; + } + return robj; +} + +/* Create a new packed object */ + +SWIGRUNTIMEINLINE PyObject * +SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) { + return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void(); +} + +/* -----------------------------------------------------------------------------* + * Get type list + * -----------------------------------------------------------------------------*/ + +#ifdef SWIG_LINK_RUNTIME +void *SWIG_ReturnGlobalTypeList(void *); +#endif + +SWIGRUNTIME swig_module_info * +SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata)) { + 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 +# ifdef SWIGPY_USE_CAPSULE + type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0); +# else + type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, + (char*)"type_pointer" SWIG_TYPE_TABLE_NAME); +# endif + if (PyErr_Occurred()) { + PyErr_Clear(); + type_pointer = (void *)0; + } +#endif + } + return (swig_module_info *) type_pointer; +} + +#if PY_MAJOR_VERSION < 2 +/* PyModule_AddObject function was introduced in Python 2.0. The following function + is copied out of Python/modsupport.c in python version 2.3.4 */ +SWIGINTERN int +PyModule_AddObject(PyObject *m, char *name, PyObject *o) +{ + PyObject *dict; + if (!PyModule_Check(m)) { + PyErr_SetString(PyExc_TypeError, "PyModule_AddObject() needs module as first arg"); + return SWIG_ERROR; + } + if (!o) { + PyErr_SetString(PyExc_TypeError, "PyModule_AddObject() needs non-NULL value"); + return SWIG_ERROR; + } + + dict = PyModule_GetDict(m); + if (dict == NULL) { + /* Internal error -- modules must have a dict! */ + PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__", + PyModule_GetName(m)); + return SWIG_ERROR; + } + if (PyDict_SetItemString(dict, name, o)) + return SWIG_ERROR; + Py_DECREF(o); + return SWIG_OK; +} +#endif + +SWIGRUNTIME void +#ifdef SWIGPY_USE_CAPSULE +SWIG_Python_DestroyModule(PyObject *obj) +#else +SWIG_Python_DestroyModule(void *vptr) +#endif +{ +#ifdef SWIGPY_USE_CAPSULE + swig_module_info *swig_module = (swig_module_info *) PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME); +#else + swig_module_info *swig_module = (swig_module_info *) vptr; +#endif + swig_type_info **types = swig_module->types; + size_t i; + for (i =0; i < swig_module->size; ++i) { + swig_type_info *ty = types[i]; + if (ty->owndata) { + SwigPyClientData *data = (SwigPyClientData *) ty->clientdata; + if (data) SwigPyClientData_Del(data); + } + } + Py_DECREF(SWIG_This()); + swig_this = NULL; +} + +SWIGRUNTIME void +SWIG_Python_SetModule(swig_module_info *swig_module) { +#if PY_VERSION_HEX >= 0x03000000 + /* Add a dummy module object into sys.modules */ + PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION); +#else + static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} }; /* Sentinel */ + PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table); +#endif +#ifdef SWIGPY_USE_CAPSULE + PyObject *pointer = PyCapsule_New((void *) swig_module, SWIGPY_CAPSULE_NAME, SWIG_Python_DestroyModule); + if (pointer && module) { + PyModule_AddObject(module, (char*)"type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer); + } else { + Py_XDECREF(pointer); + } +#else + PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule); + if (pointer && module) { + PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer); + } else { + Py_XDECREF(pointer); + } +#endif +} + +/* 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) +{ + PyObject *cache = SWIG_Python_TypeCache(); + PyObject *key = SWIG_Python_str_FromChar(type); + PyObject *obj = PyDict_GetItem(cache, key); + swig_type_info *descriptor; + if (obj) { +#ifdef SWIGPY_USE_CAPSULE + descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, NULL); +#else + descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj); +#endif + } else { + swig_module_info *swig_module = SWIG_GetModule(0); + descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type); + if (descriptor) { +#ifdef SWIGPY_USE_CAPSULE + obj = PyCapsule_New((void*) descriptor, NULL, NULL); +#else + obj = PyCObject_FromVoidPtr(descriptor, NULL); +#endif + PyDict_SetItem(cache, key, obj); + Py_DECREF(obj); + } + } + Py_DECREF(key); + return descriptor; +} + +/* + For backward compatibility only +*/ +#define SWIG_POINTER_EXCEPTION 0 +#define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg) +#define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags) + +SWIGRUNTIME int +SWIG_Python_AddErrMesg(const char* mesg, int infront) +{ + if (PyErr_Occurred()) { + PyObject *type = 0; + PyObject *value = 0; + PyObject *traceback = 0; + PyErr_Fetch(&type, &value, &traceback); + if (value) { + char *tmp; + PyObject *old_str = PyObject_Str(value); + Py_XINCREF(type); + PyErr_Clear(); + if (infront) { + PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str)); + } else { + PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); + } + SWIG_Python_str_DelForPy3(tmp); + Py_DECREF(old_str); + } + return 1; + } else { + return 0; + } +} + +SWIGRUNTIME int +SWIG_Python_ArgFail(int argnum) +{ + if (PyErr_Occurred()) { + /* add information about failing argument */ + char mesg[256]; + PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum); + return SWIG_Python_AddErrMesg(mesg, 1); + } else { + return 0; + } +} + +SWIGRUNTIMEINLINE const char * +SwigPyObject_GetDesc(PyObject *self) +{ + SwigPyObject *v = (SwigPyObject *)self; + swig_type_info *ty = v ? v->ty : 0; + return ty ? ty->str : ""; +} + +SWIGRUNTIME void +SWIG_Python_TypeError(const char *type, PyObject *obj) +{ + if (type) { +#if defined(SWIG_COBJECT_TYPES) + if (obj && SwigPyObject_Check(obj)) { + const char *otype = (const char *) SwigPyObject_GetDesc(obj); + if (otype) { + PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received", + type, otype); + return; + } + } else +#endif + { + 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; + 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(str); + return; + } + } + PyErr_Format(PyExc_TypeError, "a '%s' is expected", type); + } else { + PyErr_Format(PyExc_TypeError, "unexpected type is received"); + } +} + + +/* Convert a pointer value, signal an exception on a type mismatch */ +SWIGRUNTIME void * +SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags) { + 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; +} + +#ifdef SWIGPYTHON_BUILTIN +SWIGRUNTIME int +SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { + PyTypeObject *tp = obj->ob_type; + PyObject *descr; + PyObject *encoded_name; + descrsetfunc f; + int res = -1; + +# ifdef Py_USING_UNICODE + if (PyString_Check(name)) { + name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL); + if (!name) + return -1; + } else if (!PyUnicode_Check(name)) +# else + if (!PyString_Check(name)) +# endif + { + PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name); + return -1; + } else { + Py_INCREF(name); + } + + if (!tp->tp_dict) { + if (PyType_Ready(tp) < 0) + goto done; + } + + descr = _PyType_Lookup(tp, name); + f = NULL; + if (descr != NULL) + f = descr->ob_type->tp_descr_set; + if (!f) { + if (PyString_Check(name)) { + encoded_name = name; + Py_INCREF(name); + } else { + encoded_name = PyUnicode_AsUTF8String(name); + } + PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name)); + Py_DECREF(encoded_name); + } else { + res = f(descr, obj, value); + } + + done: + Py_DECREF(name); + return res; +} +#endif + + +#ifdef __cplusplus +} +#endif + + + +#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 + + + +/* -------- TYPES TABLE (BEGIN) -------- */ + +#define SWIGTYPE_p_BloombergLP__blpapi__VersionInfo swig_types[0] +#define SWIGTYPE_p_char swig_types[1] +#define SWIGTYPE_p_int swig_types[2] +#define SWIGTYPE_p_std__ostream swig_types[3] +static swig_type_info *swig_types[5]; +static swig_module_info swig_module = {swig_types, 4, 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) + +/* -------- TYPES TABLE (END) -------- */ + +#if (PY_VERSION_HEX <= 0x02000000) +# if !defined(SWIG_PYTHON_CLASSIC) +# error "This python version requires swig to be run with the '-classic' option" +# endif +#endif + +/*----------------------------------------------- + @(target):= _versionhelper.so + ------------------------------------------------*/ +#if PY_VERSION_HEX >= 0x03000000 +# define SWIG_init PyInit__versionhelper + +#else +# define SWIG_init init_versionhelper + +#endif +#define SWIG_name "_versionhelper" + +#define SWIGVERSION 0x030012 +#define SWIG_VERSION SWIGVERSION + + +#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a)) +#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a)) + + +#include + + +namespace swig { + class SwigPtr_PyObject { + protected: + PyObject *_obj; + + public: + SwigPtr_PyObject() :_obj(0) + { + } + + SwigPtr_PyObject(const SwigPtr_PyObject& item) : _obj(item._obj) + { + SWIG_PYTHON_THREAD_BEGIN_BLOCK; + Py_XINCREF(_obj); + SWIG_PYTHON_THREAD_END_BLOCK; + } + + SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj) + { + if (initial_ref) { + SWIG_PYTHON_THREAD_BEGIN_BLOCK; + Py_XINCREF(_obj); + SWIG_PYTHON_THREAD_END_BLOCK; + } + } + + SwigPtr_PyObject & operator=(const SwigPtr_PyObject& item) + { + SWIG_PYTHON_THREAD_BEGIN_BLOCK; + Py_XINCREF(item._obj); + Py_XDECREF(_obj); + _obj = item._obj; + SWIG_PYTHON_THREAD_END_BLOCK; + return *this; + } + + ~SwigPtr_PyObject() + { + SWIG_PYTHON_THREAD_BEGIN_BLOCK; + Py_XDECREF(_obj); + SWIG_PYTHON_THREAD_END_BLOCK; + } + + operator PyObject *() const + { + return _obj; + } + + PyObject *operator->() const + { + return _obj; + } + }; +} + + +namespace swig { + struct SwigVar_PyObject : SwigPtr_PyObject { + SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) { } + + SwigVar_PyObject & operator = (PyObject* obj) + { + Py_XDECREF(_obj); + _obj = obj; + return *this; + } + }; +} + + +#include "blpapi_versioninfo.h" + + +SWIGINTERNINLINE PyObject* + SWIG_From_int (int value) +{ + return PyInt_FromLong((long) value); +} + + +SWIGINTERN swig_type_info* +SWIG_pchar_descriptor(void) +{ + static int init = 0; + static swig_type_info* info = 0; + if (!init) { + info = SWIG_TypeQuery("_p_char"); + init = 1; + } + return info; +} + + +SWIGINTERNINLINE PyObject * +SWIG_FromCharPtrAndSize(const char* carray, size_t size) +{ + if (carray) { + if (size > INT_MAX) { + swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); + return pchar_descriptor ? + SWIG_InternalNewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : SWIG_Py_Void(); + } else { +#if PY_VERSION_HEX >= 0x03000000 +#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) + return PyBytes_FromStringAndSize(carray, static_cast< Py_ssize_t >(size)); +#else +#if PY_VERSION_HEX >= 0x03010000 + return PyUnicode_DecodeUTF8(carray, static_cast< Py_ssize_t >(size), "surrogateescape"); +#else + return PyUnicode_FromStringAndSize(carray, static_cast< Py_ssize_t >(size)); +#endif +#endif +#else + return PyString_FromStringAndSize(carray, static_cast< Py_ssize_t >(size)); +#endif + } + } else { + return SWIG_Py_Void(); + } +} + + +SWIGINTERNINLINE PyObject * +SWIG_FromCharPtr(const char *cptr) +{ + return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0)); +} + +#ifdef __cplusplus +extern "C" { +#endif +SWIGINTERN PyObject *_wrap_blpapi_getVersionInfo(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int *arg1 = (int *) 0 ; + int *arg2 = (int *) 0 ; + int *arg3 = (int *) 0 ; + int *arg4 = (int *) 0 ; + int temp1 ; + int res1 = SWIG_TMPOBJ ; + int temp2 ; + int res2 = SWIG_TMPOBJ ; + int temp3 ; + int res3 = SWIG_TMPOBJ ; + int temp4 ; + int res4 = SWIG_TMPOBJ ; + + arg1 = &temp1; + arg2 = &temp2; + arg3 = &temp3; + arg4 = &temp4; + if (!PyArg_ParseTuple(args,(char *)":blpapi_getVersionInfo")) SWIG_fail; + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_getVersionInfo(arg1,arg2,arg3,arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + if (SWIG_IsTmpObj(res1)) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg1))); + } else { + int new_flags = SWIG_IsNewObj(res1) ? (SWIG_POINTER_OWN | 0 ) : 0 ; + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg1), SWIGTYPE_p_int, new_flags)); + } + if (SWIG_IsTmpObj(res2)) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg2))); + } else { + int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_int, new_flags)); + } + if (SWIG_IsTmpObj(res3)) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg3))); + } else { + int new_flags = SWIG_IsNewObj(res3) ? (SWIG_POINTER_OWN | 0 ) : 0 ; + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg3), SWIGTYPE_p_int, new_flags)); + } + if (SWIG_IsTmpObj(res4)) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg4))); + } else { + int new_flags = SWIG_IsNewObj(res4) ? (SWIG_POINTER_OWN | 0 ) : 0 ; + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg4), SWIGTYPE_p_int, new_flags)); + } + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_getVersionIdentifier(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + char *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)":blpapi_getVersionIdentifier")) SWIG_fail; + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (char *)blpapi_getVersionIdentifier(); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap___lshift__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::ostream *arg1 = 0 ; + BloombergLP::blpapi::VersionInfo *arg2 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + std::ostream *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:__lshift__",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_std__ostream, 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "__lshift__" "', argument " "1"" of type '" "std::ostream &""'"); + } + if (!argp1) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "__lshift__" "', argument " "1"" of type '" "std::ostream &""'"); + } + arg1 = reinterpret_cast< std::ostream * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_BloombergLP__blpapi__VersionInfo, 0 | 0); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "__lshift__" "', argument " "2"" of type '" "BloombergLP::blpapi::VersionInfo const &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "__lshift__" "', argument " "2"" of type '" "BloombergLP::blpapi::VersionInfo const &""'"); + } + arg2 = reinterpret_cast< BloombergLP::blpapi::VersionInfo * >(argp2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (std::ostream *) &BloombergLP::blpapi::operator <<(*arg1,(BloombergLP::blpapi::VersionInfo const &)*arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__ostream, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +static PyMethodDef SwigMethods[] = { + { (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL}, + { (char *)"blpapi_getVersionInfo", _wrap_blpapi_getVersionInfo, METH_VARARGS, NULL}, + { (char *)"blpapi_getVersionIdentifier", _wrap_blpapi_getVersionIdentifier, METH_VARARGS, NULL}, + { (char *)"__lshift__", _wrap___lshift__, METH_VARARGS, NULL}, + { NULL, NULL, 0, NULL } +}; + + +/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ + +static swig_type_info _swigt__p_BloombergLP__blpapi__VersionInfo = {"_p_BloombergLP__blpapi__VersionInfo", "BloombergLP::blpapi::VersionInfo *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_int = {"_p_int", "int *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__ostream = {"_p_std__ostream", "std::ostream *", 0, 0, (void*)0, 0}; + +static swig_type_info *swig_type_initial[] = { + &_swigt__p_BloombergLP__blpapi__VersionInfo, + &_swigt__p_char, + &_swigt__p_int, + &_swigt__p_std__ostream, +}; + +static swig_cast_info _swigc__p_BloombergLP__blpapi__VersionInfo[] = { {&_swigt__p_BloombergLP__blpapi__VersionInfo, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__ostream[] = { {&_swigt__p_std__ostream, 0, 0, 0},{0, 0, 0, 0}}; + +static swig_cast_info *swig_cast_initial[] = { + _swigc__p_BloombergLP__blpapi__VersionInfo, + _swigc__p_char, + _swigc__p_int, + _swigc__p_std__ostream, +}; + + +/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */ + +static swig_const_info swig_const_table[] = { +{0, 0, 0, 0.0, 0, 0}}; + +#ifdef __cplusplus +} +#endif +/* ----------------------------------------------------------------------------- + * Type initialization: + * This problem is tough by the requirement that no dynamic + * memory is used. Also, since swig_type_info structures store pointers to + * swig_cast_info structures and swig_cast_info structures store pointers back + * to swig_type_info structures, we need some lookup code at initialization. + * The idea is that swig generates all the structures that are needed. + * The runtime then collects these partially filled structures. + * The SWIG_InitializeModule function takes these initial arrays out of + * swig_module, and does all the lookup, filling in the swig_module.types + * array with the correct data and linking the correct swig_cast_info + * structures together. + * + * The generated swig_type_info structures are assigned statically to an initial + * array. We just loop through that array, and handle each type individually. + * First we lookup if this type has been already loaded, and if so, use the + * loaded structure instead of the generated one. Then we have to fill in the + * cast linked list. The cast data is initially stored in something like a + * two-dimensional array. Each row corresponds to a type (there are the same + * number of rows as there are in the swig_type_initial array). Each entry in + * a column is one of the swig_cast_info structures for that type. + * The cast_initial array is actually an array of arrays, because each row has + * a variable number of columns. So to actually build the cast linked list, + * we find the array of casts associated with the type, and loop through it + * adding the casts to the list. The one last trick we need to do is making + * sure the type pointer in the swig_cast_info struct is correct. + * + * First off, we lookup the cast->type name to see if it is already loaded. + * There are three cases to handle: + * 1) If the cast->type has already been loaded AND the type we are adding + * casting info to has not been loaded (it is in this module), THEN we + * replace the cast->type pointer with the type pointer that has already + * been loaded. + * 2) If BOTH types (the one we are adding casting info to, and the + * cast->type) are loaded, THEN the cast info has already been loaded by + * the previous module so we just ignore it. + * 3) Finally, if cast->type has not already been loaded, then we add that + * swig_cast_info to the linked list (because the cast->type) pointer will + * be correct. + * ----------------------------------------------------------------------------- */ + +#ifdef __cplusplus +extern "C" { +#if 0 +} /* c-mode */ +#endif +#endif + +#if 0 +#define SWIGRUNTIME_DEBUG +#endif + + +SWIGRUNTIME void +SWIG_InitializeModule(void *clientdata) { + size_t i; + swig_module_info *module_head, *iter; + int init; + + /* check to see if the circular list has been setup, if not, set it up */ + if (swig_module.next==0) { + /* Initialize the swig_module */ + swig_module.type_initial = swig_type_initial; + swig_module.cast_initial = swig_cast_initial; + swig_module.next = &swig_module; + init = 1; + } else { + init = 0; + } + + /* Try and load any already created modules */ + module_head = SWIG_GetModule(clientdata); + if (!module_head) { + /* This is the first module loaded for this interpreter */ + /* so set the swig module into the interpreter */ + SWIG_SetModule(clientdata, &swig_module); + } else { + /* the interpreter has loaded a SWIG module, but has it loaded this one? */ + iter=module_head; + do { + if (iter==&swig_module) { + /* Our module is already in the list, so there's nothing more to do. */ + return; + } + iter=iter->next; + } while (iter!= module_head); + + /* otherwise we must add our module into the list */ + swig_module.next = module_head->next; + module_head->next = &swig_module; + } + + /* When multiple interpreters are used, a module could have already been initialized in + a different interpreter, but not yet have a pointer in this interpreter. + In this case, we do not want to continue adding types... everything should be + set up already */ + if (init == 0) return; + + /* Now work on filling in swig_module.types */ +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: size %d\n", swig_module.size); +#endif + for (i = 0; i < swig_module.size; ++i) { + swig_type_info *type = 0; + swig_type_info *ret; + swig_cast_info *cast; + +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); +#endif + + /* if there is another module already loaded */ + if (swig_module.next != &swig_module) { + type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name); + } + if (type) { + /* Overwrite clientdata field */ +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: found type %s\n", type->name); +#endif + if (swig_module.type_initial[i]->clientdata) { + type->clientdata = swig_module.type_initial[i]->clientdata; +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name); +#endif + } + } else { + type = swig_module.type_initial[i]; + } + + /* Insert casting types */ + cast = swig_module.cast_initial[i]; + while (cast->type) { + /* Don't need to add information already in the list */ + ret = 0; +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: look cast %s\n", cast->type->name); +#endif + if (swig_module.next != &swig_module) { + ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name); +#ifdef SWIGRUNTIME_DEBUG + if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name); +#endif + } + if (ret) { + if (type == swig_module.type_initial[i]) { +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: skip old type %s\n", ret->name); +#endif + cast->type = ret; + ret = 0; + } else { + /* Check for casting already in the list */ + swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type); +#ifdef SWIGRUNTIME_DEBUG + if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name); +#endif + if (!ocast) ret = 0; + } + } + + if (!ret) { +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name); +#endif + if (type->cast) { + type->cast->prev = cast; + cast->next = type->cast; + } + type->cast = cast; + } + cast++; + } + /* Set entry in modules->types array equal to the type */ + swig_module.types[i] = type; + } + swig_module.types[i] = 0; + +#ifdef SWIGRUNTIME_DEBUG + printf("**** SWIG_InitializeModule: Cast List ******\n"); + for (i = 0; i < swig_module.size; ++i) { + int j = 0; + swig_cast_info *cast = swig_module.cast_initial[i]; + printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); + while (cast->type) { + printf("SWIG_InitializeModule: cast type %s\n", cast->type->name); + cast++; + ++j; + } + printf("---- Total casts: %d\n",j); + } + printf("**** SWIG_InitializeModule: Cast List ******\n"); +#endif +} + +/* This function will propagate the clientdata field of type to +* any new swig_type_info structures that have been added into the list +* of equivalent types. It is like calling +* SWIG_TypeClientData(type, clientdata) a second time. +*/ +SWIGRUNTIME void +SWIG_PropagateClientData(void) { + size_t i; + swig_cast_info *equiv; + static int init_run = 0; + + if (init_run) return; + init_run = 1; + + for (i = 0; i < swig_module.size; i++) { + if (swig_module.types[i]->clientdata) { + equiv = swig_module.types[i]->cast; + while (equiv) { + if (!equiv->converter) { + if (equiv->type && !equiv->type->clientdata) + SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata); + } + equiv = equiv->next; + } + } + } +} + +#ifdef __cplusplus +#if 0 +{ + /* c-mode */ +#endif +} +#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(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 int + swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { + char *tmp; + PyObject *str = swig_varlink_str(v); + fprintf(fp,"Swig global variables "); + fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str)); + SWIG_Python_str_DelForPy3(tmp); + Py_DECREF(str); + return 0; + } + + 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 + (char *)"swigvarlink", /* tp_name */ + sizeof(swig_varlinkobject), /* tp_basicsize */ + 0, /* tp_itemsize */ + (destructor) swig_varlink_dealloc, /* tp_dealloc */ + (printfunc) swig_varlink_print, /* 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 */ +#if PY_VERSION_HEX >= 0x02020000 + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */ +#endif +#if PY_VERSION_HEX >= 0x02030000 + 0, /* tp_del */ +#endif +#if PY_VERSION_HEX >= 0x02060000 + 0, /* tp_version_tag */ +#endif +#if PY_VERSION_HEX >= 0x03040000 + 0, /* tp_finalize */ +#endif +#ifdef COUNT_ALLOCS + 0, /* tp_allocs */ + 0, /* tp_frees */ + 0, /* tp_maxalloc */ +#if PY_VERSION_HEX >= 0x02050000 + 0, /* tp_prev */ +#endif + 0 /* tp_next */ +#endif + }; + varlink_type = tmp; + type_init = 1; +#if PY_VERSION_HEX < 0x02020000 + varlink_type.ob_type = &PyType_Type; +#else + if (PyType_Ready(&varlink_type) < 0) + return NULL; +#endif + } + 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, 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) { + strncpy(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 *_SWIG_globals = 0; + if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink(); + return _SWIG_globals; + } + + /* ----------------------------------------------------------------------------- + * constants/methods manipulation + * ----------------------------------------------------------------------------- */ + + /* Install Constants */ + SWIGINTERN void + SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) { + PyObject *obj = 0; + size_t i; + for (i = 0; constants[i].type; ++i) { + switch(constants[i].type) { + case SWIG_PY_POINTER: + obj = SWIG_InternalNewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0); + break; + case SWIG_PY_BINARY: + obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype)); + break; + default: + obj = 0; + break; + } + if (obj) { + PyDict_SetItemString(d, constants[i].name, obj); + Py_DECREF(obj); + } + } + } + + /* -----------------------------------------------------------------------------*/ + /* Fix SwigMethods to carry the callback ptrs when needed */ + /* -----------------------------------------------------------------------------*/ + + SWIGINTERN void + SWIG_Python_FixMethods(PyMethodDef *methods, + 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; + if (!c) continue; + c = strstr(c, "swig_ptr: "); + if (c) { + int j; + 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, + strlen(const_table[j].name)) == 0) { + ci = &(const_table[j]); + break; + } + } + if (ci) { + void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0; + if (ptr) { + size_t shift = (ci->ptype) - types; + swig_type_info *ty = types_initial[shift]; + size_t ldoc = (c - methods[i].ml_doc); + size_t lptr = strlen(ty->name)+2*sizeof(void*)+2; + char *ndoc = (char*)malloc(ldoc + lptr + 10); + if (ndoc) { + char *buff = ndoc; + strncpy(buff, methods[i].ml_doc, ldoc); + buff += ldoc; + strncpy(buff, "swig_ptr: ", 10); + buff += 10; + SWIG_PackVoidPtr(buff, ptr, ty->name, lptr); + methods[i].ml_doc = ndoc; + } + } + } + } + } + } + +#ifdef __cplusplus +} +#endif + +/* -----------------------------------------------------------------------------* + * Partial Init method + * -----------------------------------------------------------------------------*/ + +#ifdef __cplusplus +extern "C" +#endif + +SWIGEXPORT +#if PY_VERSION_HEX >= 0x03000000 +PyObject* +#else +void +#endif +SWIG_init(void) { + PyObject *m, *d, *md; +#if PY_VERSION_HEX >= 0x03000000 + static struct PyModuleDef SWIG_module = { +# if PY_VERSION_HEX >= 0x03020000 + PyModuleDef_HEAD_INIT, +# else + { + PyObject_HEAD_INIT(NULL) + NULL, /* m_init */ + 0, /* m_index */ + NULL, /* m_copy */ + }, +# endif + (char *) SWIG_name, + NULL, + -1, + SwigMethods, + NULL, + NULL, + NULL, + NULL + }; +#endif + +#if defined(SWIGPYTHON_BUILTIN) + static SwigPyClientData SwigPyObject_clientdata = { + 0, 0, 0, 0, 0, 0, 0 + }; + static PyGetSetDef this_getset_def = { + (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL + }; + static SwigPyGetSet thisown_getset_closure = { + (PyCFunction) SwigPyObject_own, + (PyCFunction) SwigPyObject_own + }; + static PyGetSetDef thisown_getset_def = { + (char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure + }; + PyTypeObject *builtin_pytype; + int builtin_base_count; + swig_type_info *builtin_basetype; + PyObject *tuple; + PyGetSetDescrObject *static_getset; + PyTypeObject *metatype; + PyTypeObject *swigpyobject; + SwigPyClientData *cd; + PyObject *public_interface, *public_symbol; + PyObject *this_descr; + PyObject *thisown_descr; + PyObject *self = 0; + int i; + + (void)builtin_pytype; + (void)builtin_base_count; + (void)builtin_basetype; + (void)tuple; + (void)static_getset; + (void)self; + + /* Metaclass is used to implement static member variables */ + metatype = SwigPyObjectType(); + assert(metatype); +#endif + + /* Fix SwigMethods to carry the callback ptrs when needed */ + SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial); + +#if PY_VERSION_HEX >= 0x03000000 + m = PyModule_Create(&SWIG_module); +#else + m = Py_InitModule((char *) SWIG_name, SwigMethods); +#endif + + md = d = PyModule_GetDict(m); + (void)md; + + SWIG_InitializeModule(0); + +#ifdef SWIGPYTHON_BUILTIN + swigpyobject = SwigPyObject_TypeOnce(); + + SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject"); + assert(SwigPyObject_stype); + cd = (SwigPyClientData*) SwigPyObject_stype->clientdata; + if (!cd) { + SwigPyObject_stype->clientdata = &SwigPyObject_clientdata; + SwigPyObject_clientdata.pytype = swigpyobject; + } else if (swigpyobject->tp_basicsize != cd->pytype->tp_basicsize) { + PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules."); +# if PY_VERSION_HEX >= 0x03000000 + return NULL; +# else + return; +# endif + } + + /* All objects have a 'this' attribute */ + this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def); + (void)this_descr; + + /* All objects have a 'thisown' attribute */ + thisown_descr = PyDescr_NewGetSet(SwigPyObject_type(), &thisown_getset_def); + (void)thisown_descr; + + public_interface = PyList_New(0); + public_symbol = 0; + (void)public_symbol; + + PyDict_SetItemString(md, "__all__", public_interface); + Py_DECREF(public_interface); + for (i = 0; SwigMethods[i].ml_name != NULL; ++i) + SwigPyBuiltin_AddPublicSymbol(public_interface, SwigMethods[i].ml_name); + for (i = 0; swig_const_table[i].name != 0; ++i) + SwigPyBuiltin_AddPublicSymbol(public_interface, swig_const_table[i].name); +#endif + + SWIG_InstallConstants(d,swig_const_table); + + + /* Initialize threading */ + SWIG_PYTHON_INITIALIZE_THREADS; +#if PY_VERSION_HEX >= 0x03000000 + return m; +#else + return; +#endif +} + diff --git a/changelog.txt b/changelog.txt index bb99836..a28ffea 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,37 @@ +Version 3.12.2: +=============== +- Stability and performance improvements + +Version 3.12.1: +=============== +- Stability and performance improvements + +Version 3.12.0: +=============== +- Add SessionOptions.toString() and SessionOptions.__str__ +- Add version helpers +- Python3.7 compatibility + - Deprecated the named parameter 'async' for blpapi.EventFormatter.stop in + favor of 'async_'. 'async' is a reserved keyword with Python3.7. + +Version 3.11.0: +=============== +- Add support for zero footprint connections +- Add support for fragmented recaps +- Add support for consuming microseconds + +Version 3.10.0: +=============== +- Documentation change + Clarify the meaning of integer priorities in 'ProviderSession'. Greater + values indicate higher priorities. + +- Add support for 3.10 features + - Provide access to the Message recap type + - Enable configuration of service timeouts in SessionOptions + - Add support for publisher terminated subscriptions + For more details on these features, please refer to the C++ release notes + Version 3.9.2: ============== - Fix Message.fragmentType @@ -33,4 +67,4 @@ Version 3.5.3: Version 3.5.2: ============== -- Initial public release of Python SDK \ No newline at end of file +- Initial public release of Python SDK diff --git a/examples/ContributionsMktdataExample.py b/examples/ContributionsMktdataExample.py index 7f593ee..d4decc6 100644 --- a/examples/ContributionsMktdataExample.py +++ b/examples/ContributionsMktdataExample.py @@ -119,6 +119,30 @@ def parseCmdLine(): type="string", default="user") + # TLS Options + parser.add_option("--tls-client-credentials", + dest="tls_client_credentials", + help="name a PKCS#12 file to use as a source of client credentials", + metavar="option", + type="string") + parser.add_option("--tls-client-credentials-password", + dest="tls_client_credentials_password", + help="specify password for accessing client credentials", + metavar="option", + type="string", + default="") + parser.add_option("--tls-trust-material", + dest="tls_trust_material", + help="name a PKCS#7 file to use as a source of trusted certificates", + metavar="option", + type="string") + parser.add_option("--read-certificate-files", + dest="read_certificate_files", + help="(optional) read the TLS files and pass the blobs", + metavar="option", + action="store_true") + + (options, args) = parser.parse_args() if not options.hosts: @@ -151,11 +175,11 @@ def authorize(authService, identity, session, cid): print("Failed to get token") return False - # Create and fill the authorithation request + # Create and fill the authorization request authRequest = authService.createAuthorizationRequest() authRequest.set(TOKEN, token) - # Send authorithation request to "fill" the Identity + # Send authorization request to "fill" the Identity session.sendAuthorizationRequest(authRequest, identity, cid) # Process related responses @@ -173,6 +197,31 @@ def authorize(authService, identity, session, cid): time.sleep(1) +def getTlsOptions(options): + if (options.tls_client_credentials is None or + options.tls_trust_material is None): + return None + + print("TlsOptions enabled") + if (options.read_certificate_files): + credential_blob = None + trust_blob = None + with open(options.tls_client_credentials, 'rb') as credentialfile: + credential_blob = credentialfile.read() + with open(options.tls_trust_material, 'rb') as trustfile: + trust_blob = trustfile.read() + + return blpapi.TlsOptions.createFromBlobs( + credential_blob, + options.tls_client_credentials_password, + trust_blob) + else: + return blpapi.TlsOptions.createFromFiles( + options.tls_client_credentials, + options.tls_client_credentials_password, + options.tls_trust_material) + + def main(): options = parseCmdLine() @@ -185,6 +234,11 @@ def main(): sessionOptions.setAutoRestartOnDisconnection(True) sessionOptions.setNumStartAttempts(len(options.hosts)) + tlsOptions = getTlsOptions(options) + if tlsOptions is not None: + sessionOptions.setTlsOptions(tlsOptions) + + myEventHandler = MyEventHandler() # Create a Session diff --git a/examples/ContributionsPageExample.py b/examples/ContributionsPageExample.py index cde5ab1..84ac8d1 100644 --- a/examples/ContributionsPageExample.py +++ b/examples/ContributionsPageExample.py @@ -65,21 +65,38 @@ def authOptionCallback(option, opt, value, parser): vals = value.split('=', 1) if value == "user": - parser.values.auth = "AuthenticationType=OS_LOGON" + parser.values.auth = { 'option' : "AuthenticationType=OS_LOGON" } elif value == "none": - parser.values.auth = None + parser.values.auth = { 'option' : None } elif vals[0] == "app" and len(vals) == 2: - parser.values.auth = "AuthenticationMode=APPLICATION_ONLY;"\ + parser.values.auth = { 'option' : "AuthenticationMode=APPLICATION_ONLY;"\ "ApplicationAuthenticationType=APPNAME_AND_KEY;"\ - "ApplicationName=" + vals[1] + "ApplicationName=" + vals[1] } elif vals[0] == "userapp" and len(vals) == 2: - parser.values.auth = "AuthenticationMode=USER_AND_APPLICATION;"\ + parser.values.auth = { 'option' : "AuthenticationMode=USER_AND_APPLICATION;"\ "AuthenticationType=OS_LOGON;"\ "ApplicationAuthenticationType=APPNAME_AND_KEY;"\ - "ApplicationName=" + vals[1] + "ApplicationName=" + vals[1] } elif vals[0] == "dir" and len(vals) == 2: - parser.values.auth = "AuthenticationType=DIRECTORY_SERVICE;"\ - "DirSvcPropertyName=" + vals[1] + parser.values.auth = { 'option' : "AuthenticationType=DIRECTORY_SERVICE;"\ + "DirSvcPropertyName=" + vals[1] } + elif vals[0] == "manual": + parts = [] + if len(vals) == 2: + parts = vals[1].split(',') + + # TODO: Add support for user+ip only + if len(parts) != 3: + raise OptionValueError("Invalid auth option '%s'" % value) + + option = "AuthenticationMode=USER_AND_APPLICATION;" + \ + "AuthenticationType=MANUAL;" + \ + "ApplicationAuthenticationType=APPNAME_AND_KEY;" + \ + "ApplicationName=" + parts[0] + + parser.values.auth = { 'option' : option, + 'manual' : { 'ip' : parts[1], + 'user' : parts[2] } } else: raise OptionValueError("Invalid auth option '%s'" % value) @@ -118,13 +135,36 @@ def parseCmdLine(): parser.add_option("--auth", dest="auth", help="authentication option: " - "user|none|app=|userapp=|dir=" + "user|none|app=|userapp=|dir=|manual=" " (default: %default)", metavar="option", action="callback", callback=authOptionCallback, type="string", - default="user") + default={ "option" : None }) + + # TLS Options + parser.add_option("--tls-client-credentials", + dest="tls_client_credentials", + help="name a PKCS#12 file to use as a source of client credentials", + metavar="option", + type="string") + parser.add_option("--tls-client-credentials-password", + dest="tls_client_credentials_password", + help="specify password for accessing client credentials", + metavar="option", + type="string", + default="") + parser.add_option("--tls-trust-material", + dest="tls_trust_material", + help="name a PKCS#7 file to use as a source of trusted certificates", + metavar="option", + type="string") + parser.add_option("--read-certificate-files", + dest="read_certificate_files", + help="(optional) read the TLS files and pass the blobs", + metavar="option", + action="store_true") (options, args) = parser.parse_args() @@ -133,15 +173,18 @@ def parseCmdLine(): return options - -def authorize(authService, identity, session, cid): +def authorize(authService, identity, session, cid, manual_options = None): with g_mutex: g_authorizationStatus[cid] = AuthorizationStatus.WAITING tokenEventQueue = blpapi.EventQueue() - # Generate token - session.generateToken(eventQueue=tokenEventQueue) + if manual_options: + session.generateToken(authId=manual_options['user'], + ipAddress=manual_options['ip'], + eventQueue=tokenEventQueue) + else: + session.generateToken(eventQueue=tokenEventQueue) # Process related response ev = tokenEventQueue.nextEvent() @@ -154,15 +197,16 @@ def authorize(authService, identity, session, cid): token = msg.getElementAsString(TOKEN) elif msg.messageType() == TOKEN_FAILURE: break + if not token: print("Failed to get token") return False - # Create and fill the authorithation request + # Create and fill the authorization request authRequest = authService.createAuthorizationRequest() authRequest.set(TOKEN, token) - # Send authorithation request to "fill" the Identity + # Send authorization request to "fill" the Identity session.sendAuthorizationRequest(authRequest, identity, cid) # Process related responses @@ -180,6 +224,29 @@ def authorize(authService, identity, session, cid): time.sleep(1) +def getTlsOptions(options): + if (options.tls_client_credentials is None or + options.tls_trust_material is None): + return None + + print("TlsOptions enabled") + if (options.read_certificate_files): + credential_blob = None + trust_blob = None + with open(options.tls_client_credentials, 'rb') as credentialfile: + credential_blob = credentialfile.read() + with open(options.tls_trust_material, 'rb') as trustfile: + trust_blob = trustfile.read() + + return blpapi.TlsOptions.createFromBlobs( + credential_blob, + options.tls_client_credentials_password, + trust_blob) + else: + return blpapi.TlsOptions.createFromFiles( + options.tls_client_credentials, + options.tls_client_credentials_password, + options.tls_trust_material) def main(): options = parseCmdLine() @@ -188,10 +255,13 @@ def main(): sessionOptions = blpapi.SessionOptions() for idx, host in enumerate(options.hosts): sessionOptions.setServerAddress(host, options.port, idx) - sessionOptions.setAuthenticationOptions(options.auth) + sessionOptions.setAuthenticationOptions(options.auth['option']) sessionOptions.setAutoRestartOnDisconnection(True) sessionOptions.setNumStartAttempts(len(options.hosts)) + tlsOptions = getTlsOptions(options) + if tlsOptions is not None: + sessionOptions.setTlsOptions(tlsOptions) myEventHandler = MyEventHandler() # Create a Session @@ -205,20 +275,21 @@ def main(): providerIdentity = session.createIdentity() - if options.auth: + if options.auth['option']: isAuthorized = False authServiceName = "//blp/apiauth" if session.openService(authServiceName): authService = session.getService(authServiceName) isAuthorized = authorize( authService, providerIdentity, session, - blpapi.CorrelationId("auth")) + blpapi.CorrelationId("auth"), + options.auth.get('manual')) if not isAuthorized: print("No authorization") return topicList = blpapi.TopicList() - topicList.add(options.service + "/" + options.topic, + topicList.add(options.service + options.topic, blpapi.CorrelationId(MyStream(options.topic))) # Create topics diff --git a/examples/IntradayTickExample.py b/examples/IntradayTickExample.py index 78f0239..ae7ed9c 100644 --- a/examples/IntradayTickExample.py +++ b/examples/IntradayTickExample.py @@ -7,7 +7,6 @@ import datetime from optparse import OptionParser, Option, OptionValueError - TICK_DATA = blpapi.Name("tickData") COND_CODE = blpapi.Name("conditionCodes") TICK_SIZE = blpapi.Name("size") @@ -18,6 +17,32 @@ CATEGORY = blpapi.Name("category") MESSAGE = blpapi.Name("message") SESSION_TERMINATED = blpapi.Name("SessionTerminated") +TOKEN_SUCCESS = blpapi.Name("TokenGenerationSuccess") +TOKEN_FAILURE = blpapi.Name("TokenGenerationFailure") +AUTHORIZATION_SUCCESS = blpapi.Name("AuthorizationSuccess") +TOKEN = blpapi.Name("token") + +def authOptionCallback(option, opt, value, parser): + vals = value.split('=', 1) + + if value == "user": + parser.values.auth = "AuthenticationType=OS_LOGON" + elif value == "none": + parser.values.auth = None + elif vals[0] == "app" and len(vals) == 2: + parser.values.auth = "AuthenticationMode=APPLICATION_ONLY;"\ + "ApplicationAuthenticationType=APPNAME_AND_KEY;"\ + "ApplicationName=" + vals[1] + elif vals[0] == "userapp" and len(vals) == 2: + parser.values.auth = "AuthenticationMode=USER_AND_APPLICATION;"\ + "AuthenticationType=OS_LOGON;"\ + "ApplicationAuthenticationType=APPNAME_AND_KEY;"\ + "ApplicationName=" + vals[1] + elif vals[0] == "dir" and len(vals) == 2: + parser.values.auth = "AuthenticationType=DIRECTORY_SERVICE;"\ + "DirSvcPropertyName=" + vals[1] + else: + raise OptionValueError("Invalid auth option '%s'" % value) def checkDateTime(option, opt, value): @@ -69,26 +94,86 @@ def parseCmdLine(): type="datetime", help="start date/time (default: %default)", metavar="startDateTime", - default=datetime.datetime(2008, 8, 11, 15, 30, 0)) + default=None) parser.add_option("--ed", dest="endDateTime", type="datetime", help="end date/time (default: %default)", metavar="endDateTime", - default=datetime.datetime(2008, 8, 11, 15, 35, 0)) + default=None) parser.add_option("--cc", dest="conditionCodes", help="include condition codes", action="store_true", default=False) + parser.add_option("--auth", + dest="auth", + help="authentication option: " + "user|none|app=|userapp=|dir=" + " (default: %default)", + metavar="option", + action="callback", + callback=authOptionCallback, + type="string", + default="user") (options, args) = parser.parse_args() + if not options.host: + options.host = ["localhost"] + if not options.events: options.events = ["TRADE"] return options +def authorize(authService, identity, session, cid): + tokenEventQueue = blpapi.EventQueue() + + session.generateToken(eventQueue=tokenEventQueue) + + # Process related response + ev = tokenEventQueue.nextEvent() + token = None + if ev.eventType() == blpapi.Event.TOKEN_STATUS or \ + ev.eventType() == blpapi.Event.REQUEST_STATUS: + for msg in ev: + print(msg) + if msg.messageType() == TOKEN_SUCCESS: + token = msg.getElementAsString(TOKEN) + elif msg.messageType() == TOKEN_FAILURE: + break + + if not token: + print("Failed to get token") + return False + + # Create and fill the authorization request + authRequest = authService.createAuthorizationRequest() + authRequest.set(TOKEN, token) + + # Send authorization request to "fill" the Identity + session.sendAuthorizationRequest(authRequest, identity, cid) + + # Process related responses + startTime = datetime.datetime.today() + WAIT_TIME_SECONDS = 10 + while True: + event = session.nextEvent(WAIT_TIME_SECONDS * 1000) + if event.eventType() == blpapi.Event.RESPONSE or \ + event.eventType() == blpapi.Event.REQUEST_STATUS or \ + event.eventType() == blpapi.Event.PARTIAL_RESPONSE: + for msg in event: + print(msg) + if msg.messageType() == AUTHORIZATION_SUCCESS: + return True + print("Authorization failed") + return False + + endTime = datetime.datetime.today() + if endTime - startTime > datetime.timedelta(seconds=WAIT_TIME_SECONDS): + return False + def printErrorInfo(leadingStr, errorInfo): print("%s%s (%s)" % (leadingStr, errorInfo.getElementAsString(CATEGORY), @@ -123,7 +208,7 @@ def processResponseEvent(event): processMessage(msg) -def sendIntradayTickRequest(session, options): +def sendIntradayTickRequest(session, options, identity = None): refDataService = session.getService("//blp/refdata") request = refDataService.createRequest("IntradayTickRequest") @@ -154,7 +239,7 @@ def sendIntradayTickRequest(session, options): request.set("includeConditionCodes", True) print("Sending Request:", request) - session.sendRequest(request) + session.sendRequest(request, identity) def eventLoop(session): @@ -197,6 +282,7 @@ def main(): sessionOptions = blpapi.SessionOptions() sessionOptions.setServerHost(options.host) sessionOptions.setServerPort(options.port) + sessionOptions.setAuthenticationOptions(options.auth) print("Connecting to %s:%s" % (options.host, options.port)) # Create a Session @@ -207,13 +293,27 @@ def main(): print("Failed to start session.") return + identity = None + if options.auth: + identity = session.createIdentity() + isAuthorized = False + authServiceName = "//blp/apiauth" + if session.openService(authServiceName): + authService = session.getService(authServiceName) + isAuthorized = authorize( + authService, identity, session, + blpapi.CorrelationId("auth")) + if not isAuthorized: + print("No authorization") + return + try: # Open service to get historical data from if not session.openService("//blp/refdata"): print("Failed to open //blp/refdata") return - sendIntradayTickRequest(session, options) + sendIntradayTickRequest(session, options, identity) # wait for events from session. eventLoop(session) diff --git a/examples/LocalMktdataSubscriptionExample.py b/examples/LocalMktdataSubscriptionExample.py index 61052ea..9142362 100644 --- a/examples/LocalMktdataSubscriptionExample.py +++ b/examples/LocalMktdataSubscriptionExample.py @@ -4,41 +4,52 @@ import blpapi import datetime -import time -import traceback -import weakref from optparse import OptionParser, OptionValueError -from blpapi import Event as EventType TOKEN_SUCCESS = blpapi.Name("TokenGenerationSuccess") TOKEN_FAILURE = blpapi.Name("TokenGenerationFailure") AUTHORIZATION_SUCCESS = blpapi.Name("AuthorizationSuccess") TOKEN = blpapi.Name("token") - def authOptionCallback(option, opt, value, parser): vals = value.split('=', 1) if value == "user": - parser.values.auth = "AuthenticationType=OS_LOGON" + parser.values.auth = { 'option' : "AuthenticationType=OS_LOGON" } elif value == "none": - parser.values.auth = None + parser.values.auth = { 'option' : None } elif vals[0] == "app" and len(vals) == 2: - parser.values.auth = "AuthenticationMode=APPLICATION_ONLY;"\ + parser.values.auth = { 'option' : "AuthenticationMode=APPLICATION_ONLY;"\ "ApplicationAuthenticationType=APPNAME_AND_KEY;"\ - "ApplicationName=" + vals[1] + "ApplicationName=" + vals[1] } elif vals[0] == "userapp" and len(vals) == 2: - parser.values.auth = "AuthenticationMode=USER_AND_APPLICATION;"\ + parser.values.auth = { 'option' : "AuthenticationMode=USER_AND_APPLICATION;"\ "AuthenticationType=OS_LOGON;"\ "ApplicationAuthenticationType=APPNAME_AND_KEY;"\ - "ApplicationName=" + vals[1] + "ApplicationName=" + vals[1] } elif vals[0] == "dir" and len(vals) == 2: - parser.values.auth = "AuthenticationType=DIRECTORY_SERVICE;"\ - "DirSvcPropertyName=" + vals[1] + parser.values.auth = { 'option' : "AuthenticationType=DIRECTORY_SERVICE;"\ + "DirSvcPropertyName=" + vals[1] } + elif vals[0] == "manual": + parts = [] + if len(vals) == 2: + parts = vals[1].split(',') + + # TODO: Add support for user+ip only + if len(parts) != 3: + raise OptionValueError("Invalid auth option '%s'" % value) + + option = "AuthenticationMode=USER_AND_APPLICATION;" + \ + "AuthenticationType=MANUAL;" + \ + "ApplicationAuthenticationType=APPNAME_AND_KEY;" + \ + "ApplicationName=" + parts[0] + + parser.values.auth = { 'option' : option, + 'manual' : { 'ip' : parts[1], + 'user' : parts[2] } } else: raise OptionValueError("Invalid auth option '%s'" % value) - def parseCmdLine(): parser = OptionParser(description="Retrieve realtime data.") parser.add_option("-a", @@ -86,13 +97,36 @@ def parseCmdLine(): parser.add_option("--auth", dest="auth", help="authentication option: " - "user|none|app=|userapp=|dir=" + "user|none|app=|userapp=|dir=|manual=" " (default: %default)", metavar="option", action="callback", callback=authOptionCallback, type="string", - default="user") + default={ "option" : None }) + + # TLS Options + parser.add_option("--tls-client-credentials", + dest="tls_client_credentials", + help="name a PKCS#12 file to use as a source of client credentials", + metavar="option", + type="string") + parser.add_option("--tls-client-credentials-password", + dest="tls_client_credentials_password", + help="specify password for accessing client credentials", + metavar="option", + type="string", + default="") + parser.add_option("--tls-trust-material", + dest="tls_trust_material", + help="name a PKCS#7 file to use as a source of trusted certificates", + metavar="option", + type="string") + parser.add_option("--read-certificate-files", + dest="read_certificate_files", + help="(optional) read the TLS files and pass the blobs", + metavar="option", + action="store_true") (options, args) = parser.parse_args() @@ -105,9 +139,15 @@ def parseCmdLine(): return options -def authorize(authService, identity, session, cid): +def authorize(authService, identity, session, cid, manual_options = None): tokenEventQueue = blpapi.EventQueue() - session.generateToken(eventQueue=tokenEventQueue) + + if manual_options: + session.generateToken(authId=manual_options['user'], + ipAddress=manual_options['ip'], + eventQueue=tokenEventQueue) + else: + session.generateToken(eventQueue=tokenEventQueue) # Process related response ev = tokenEventQueue.nextEvent() @@ -151,6 +191,28 @@ def authorize(authService, identity, session, cid): if endTime - startTime > datetime.timedelta(seconds=WAIT_TIME_SECONDS): return False +def getTlsOptions(options): + if (options.tls_client_credentials is None or + options.tls_trust_material is None): + return None + + print("TlsOptions enabled") + if (options.read_certificate_files): + credential_blob = None + trust_blob = None + with open(options.tls_client_credentials, 'rb') as credentialfile: + credential_blob = credentialfile.read() + with open(options.tls_trust_material, 'rb') as trustfile: + trust_blob = trustfile.read() + return blpapi.TlsOptions.createFromBlobs( + credential_blob, + options.tls_client_credentials_password, + trust_blob) + else: + return blpapi.TlsOptions.createFromFiles( + options.tls_client_credentials, + options.tls_client_credentials_password, + options.tls_trust_material) def main(): global options @@ -160,7 +222,7 @@ def main(): sessionOptions = blpapi.SessionOptions() for idx, host in enumerate(options.hosts): sessionOptions.setServerAddress(host, options.port, idx) - sessionOptions.setAuthenticationOptions(options.auth) + sessionOptions.setAuthenticationOptions(options.auth['option']) sessionOptions.setAutoRestartOnDisconnection(True) # NOTE: If running without a backup server, make many attempts to @@ -175,6 +237,10 @@ def main(): print("Connecting to port %d on %s" % ( options.port, ", ".join(options.hosts))) + tlsOptions = getTlsOptions(options) + if tlsOptions is not None: + sessionOptions.setTlsOptions(tlsOptions) + session = blpapi.Session(sessionOptions) if not session.start(): @@ -183,14 +249,15 @@ def main(): subscriptionIdentity = session.createIdentity() - if options.auth: + if options.auth['option']: isAuthorized = False authServiceName = "//blp/apiauth" if session.openService(authServiceName): authService = session.getService(authServiceName) isAuthorized = authorize( authService, subscriptionIdentity, session, - blpapi.CorrelationId("auth")) + blpapi.CorrelationId("auth"), + options.auth.get('manual')) if not isAuthorized: print("No authorization") return diff --git a/examples/LocalPageSubscriptionExample.py b/examples/LocalPageSubscriptionExample.py index 2d9747f..0314bf8 100644 --- a/examples/LocalPageSubscriptionExample.py +++ b/examples/LocalPageSubscriptionExample.py @@ -104,11 +104,11 @@ def authorize(authService, identity, session, cid): print("Failed to get token") return False - # Create and fill the authorithation request + # Create and fill the authorization request authRequest = authService.createAuthorizationRequest() authRequest.set(TOKEN, token) - # Send authorithation request to "fill" the Identity + # Send authorization request to "fill" the Identity session.sendAuthorizationRequest(authRequest, identity, cid) # Process related responses diff --git a/examples/MktdataBroadcastPublisherExample.py b/examples/MktdataBroadcastPublisherExample.py index 190bc1a..407f688 100644 --- a/examples/MktdataBroadcastPublisherExample.py +++ b/examples/MktdataBroadcastPublisherExample.py @@ -167,11 +167,11 @@ def authorize(authService, identity, session, cid): print("Failed to get token") return False - # Create and fill the authorithation request + # Create and fill the authorization request authRequest = authService.createAuthorizationRequest() authRequest.set(TOKEN, token) - # Send authorithation request to "fill" the Identity + # Send authorization request to "fill" the Identity session.sendAuthorizationRequest(authRequest, identity, cid) # Process related responses diff --git a/examples/MktdataPublisher.py b/examples/MktdataPublisher.py index 50398db..180c76e 100644 --- a/examples/MktdataPublisher.py +++ b/examples/MktdataPublisher.py @@ -463,11 +463,11 @@ def authorize(authService, identity, session, cid): print("Failed to get token") return False - # Create and fill the authorithation request + # Create and fill the authorization request authRequest = authService.createAuthorizationRequest() authRequest.set(TOKEN, token) - # Send authorithation request to "fill" the Identity + # Send authorization request to "fill" the Identity session.sendAuthorizationRequest(authRequest, identity, cid) # Process related responses diff --git a/examples/PagePublisherExample.py b/examples/PagePublisherExample.py index cc01dd5..3c67f9b 100644 --- a/examples/PagePublisherExample.py +++ b/examples/PagePublisherExample.py @@ -315,11 +315,11 @@ def authorize(authService, identity, session, cid): print("Failed to get token") return False - # Create and fill the authorithation request + # Create and fill the authorization request authRequest = authService.createAuthorizationRequest() authRequest.set(TOKEN, token) - # Send authorithation request to "fill" the Identity + # Send authorization request to "fill" the Identity session.sendAuthorizationRequest(authRequest, identity, cid) # Process related responses diff --git a/examples/RequestServiceExample.py b/examples/RequestServiceExample.py index 8bcf5f9..abc8211 100644 --- a/examples/RequestServiceExample.py +++ b/examples/RequestServiceExample.py @@ -337,11 +337,11 @@ def authorize(authService, identity, session, cid): print("Failed to get token") return False - # Create and fill the authorithation request + # Create and fill the authorization request authRequest = authService.createAuthorizationRequest() authRequest.set(TOKEN, token) - # Send authorithation request to "fill" the Identity + # Send authorization request to "fill" the Identity session.sendAuthorizationRequest(authRequest, identity, cid) # Process related responses diff --git a/examples/ServiceSchema.py b/examples/ServiceSchema.py index dcf1dfd..cde7309 100644 --- a/examples/ServiceSchema.py +++ b/examples/ServiceSchema.py @@ -153,14 +153,14 @@ def auth(session): # Obtain opened service authService = session.getService(AUTH_SERVICE) - # Create and fill the authorithation request + # Create and fill the authorization request authRequest = authService.createAuthorizationRequest() authRequest.set(TOKEN, token) # Create Identity identity = session.createIdentity() - # Send authorithation request to "fill" the Identity + # Send authorization request to "fill" the Identity session.sendAuthorizationRequest(authRequest, identity, eventQueue=eq) # Process related responses diff --git a/examples/SnapshotRequestTemplateExample.py b/examples/SnapshotRequestTemplateExample.py new file mode 100644 index 0000000..06add59 --- /dev/null +++ b/examples/SnapshotRequestTemplateExample.py @@ -0,0 +1,271 @@ +# SnapshotRequestTemplateExample.py +from __future__ import print_function +from __future__ import absolute_import + +import blpapi +import datetime +import time +import traceback +import weakref +from optparse import OptionParser, OptionValueError +from blpapi import Event as EventType + +TOKEN_SUCCESS = blpapi.Name("TokenGenerationSuccess") +TOKEN_FAILURE = blpapi.Name("TokenGenerationFailure") +AUTHORIZATION_SUCCESS = blpapi.Name("AuthorizationSuccess") +TOKEN = blpapi.Name("token") + + +def authOptionCallback(option, opt, value, parser): + vals = value.split('=', 1) + + if value == "user": + parser.values.auth = "AuthenticationType=OS_LOGON" + elif value == "none": + parser.values.auth = None + elif vals[0] == "app" and len(vals) == 2: + parser.values.auth = "AuthenticationMode=APPLICATION_ONLY;"\ + "ApplicationAuthenticationType=APPNAME_AND_KEY;"\ + "ApplicationName=" + vals[1] + elif vals[0] == "userapp" and len(vals) == 2: + parser.values.auth = "AuthenticationMode=USER_AND_APPLICATION;"\ + "AuthenticationType=OS_LOGON;"\ + "ApplicationAuthenticationType=APPNAME_AND_KEY;"\ + "ApplicationName=" + vals[1] + elif vals[0] == "dir" and len(vals) == 2: + parser.values.auth = "AuthenticationType=DIRECTORY_SERVICE;"\ + "DirSvcPropertyName=" + vals[1] + else: + raise OptionValueError("Invalid auth option '%s'" % value) + + +def parseCmdLine(): + parser = OptionParser(description="Retrieve realtime data.") + parser.add_option("-a", + "--ip", + dest="hosts", + help="server name or IP (default: localhost)", + metavar="ipAddress", + action="append", + default=[]) + parser.add_option("-p", + dest="port", + type="int", + help="server port (default: %default)", + metavar="tcpPort", + default=8194) + parser.add_option("-s", + dest="service", + help="service name (default: %default)", + metavar="service", + default="//viper/mktdata") + parser.add_option("-t", + dest="topics", + help="topic name (default: /ticker/IBM Equity)", + metavar="topic", + action="append", + default=[]) + parser.add_option("-f", + dest="fields", + help="field to subscribe to (default: empty)", + metavar="field", + action="append", + default=[]) + parser.add_option("-o", + dest="options", + help="subscription options (default: empty)", + metavar="option", + action="append", + default=[]) + parser.add_option("--me", + dest="maxEvents", + type="int", + help="stop after this many events (default: %default)", + metavar="maxEvents", + default=1000000) + parser.add_option("--auth", + dest="auth", + help="authentication option: " + "user|none|app=|userapp=|dir=" + " (default: %default)", + metavar="option", + action="callback", + callback=authOptionCallback, + type="string", + default="user") + + (opts, args) = parser.parse_args() + + if not opts.hosts: + opts.hosts = ["localhost"] + + if not opts.topics: + opts.topics = ["/ticker/IBM US Equity"] + + return opts + + +def authorize(authService, identity, session, cid): + tokenEventQueue = blpapi.EventQueue() + session.generateToken(eventQueue=tokenEventQueue) + + # Process related response + ev = tokenEventQueue.nextEvent() + token = None + if ev.eventType() == blpapi.Event.TOKEN_STATUS or \ + ev.eventType() == blpapi.Event.REQUEST_STATUS: + for msg in ev: + print(msg) + if msg.messageType() == TOKEN_SUCCESS: + token = msg.getElementAsString(TOKEN) + elif msg.messageType() == TOKEN_FAILURE: + break + + if not token: + print("Failed to get token") + return False + + # Create and fill the authorization request + authRequest = authService.createAuthorizationRequest() + authRequest.set(TOKEN, token) + + # Send authorization request to "fill" the Identity + session.sendAuthorizationRequest(authRequest, identity, cid) + + # Process related responses + startTime = datetime.datetime.today() + WAIT_TIME_SECONDS = 10 + while True: + event = session.nextEvent(WAIT_TIME_SECONDS * 1000) + if event.eventType() == blpapi.Event.RESPONSE or \ + event.eventType() == blpapi.Event.REQUEST_STATUS or \ + event.eventType() == blpapi.Event.PARTIAL_RESPONSE: + for msg in event: + print(msg) + if msg.messageType() == AUTHORIZATION_SUCCESS: + return True + print("Authorization failed") + return False + + endTime = datetime.datetime.today() + if endTime - startTime > datetime.timedelta(seconds=WAIT_TIME_SECONDS): + return False + + +def main(): + global options + options = parseCmdLine() + + # Fill SessionOptions + sessionOptions = blpapi.SessionOptions() + for idx, host in enumerate(options.hosts): + sessionOptions.setServerAddress(host, options.port, idx) + sessionOptions.setAuthenticationOptions(options.auth) + sessionOptions.setAutoRestartOnDisconnection(True) + + # NOTE: If running without a backup server, make many attempts to + # connect/reconnect to give that host a chance to come back up (the + # larger the number, the longer it will take for SessionStartupFailure + # to come on startup, or SessionTerminated due to inability to fail + # over). We don't have to do that in a redundant configuration - it's + # expected at least one server is up and reachable at any given time, + # so only try to connect to each server once. + sessionOptions.setNumStartAttempts(1 if len(options.hosts) > 1 else 1000) + + print("Connecting to port %d on %s" % ( + options.port, ", ".join(options.hosts))) + + session = blpapi.Session(sessionOptions) + + if not session.start(): + print("Failed to start session.") + return + + subscriptionIdentity = session.createIdentity() + + if options.auth: + isAuthorized = False + authServiceName = "//blp/apiauth" + if session.openService(authServiceName): + authService = session.getService(authServiceName) + isAuthorized = authorize(authService, subscriptionIdentity, + session, blpapi.CorrelationId("auth")) + if not isAuthorized: + print("No authorization") + return + + fieldStr = "?fields=" + ",".join(options.fields) + + snapshots = [] + nextCorrelationId = 0 + for i, topic in enumerate(options.topics): + subscriptionString = options.service + topic + fieldStr + snapshots.append(session.createSnapshotRequestTemplate( + subscriptionString, + subscriptionIdentity, + blpapi.CorrelationId(i))) + nextCorrelationId += 1 + + requestTemplateAvailable = blpapi.Name('RequestTemplateAvailable') + eventCount = 0 + try: + while True: + # Specify timeout to give a chance for Ctrl-C + event = session.nextEvent(1000) + for msg in event: + if event.eventType() == blpapi.Event.ADMIN and \ + msg.messageType() == requestTemplateAvailable: + + for requestTemplate in snapshots: + session.sendRequestTemplate(requestTemplate, + blpapi.CorrelationId(nextCorrelationId)) + nextCorrelationId += 1 + + elif event.eventType() == blpapi.Event.RESPONSE or \ + event.eventType() == blpapi.Event.PARTIAL_RESPONSE: + + cid = msg.correlationIds()[0].value() + print("%s - %s" % (cid, msg)) + else: + print(msg) + if event.eventType() == blpapi.Event.RESPONSE: + eventCount += 1 + if eventCount >= options.maxEvents: + print("%d events processed, terminating." % eventCount) + break + elif event.eventType() == blpapi.Event.TIMEOUT: + for requestTemplate in snapshots: + session.sendRequestTemplate(requestTemplate, + blpapi.CorrelationId(nextCorrelationId)) + nextCorrelationId += 1 + + finally: + session.stop() + +if __name__ == "__main__": + print("SnapshotRequestTemplateExample") + try: + main() + except KeyboardInterrupt: + print("Ctrl+C pressed. Stopping...") + +__copyright__ = """ +Copyright 2018. Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above +copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/setup.cfg b/setup.cfg index 18cf3ff..50902e0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -4,5 +4,4 @@ doc_files = README examples changelog.txt NOTES [egg_info] tag_build = tag_date = 0 -tag_svn_revision = 0 diff --git a/setup.py b/setup.py index ca04cd6..0fafedc 100644 --- a/setup.py +++ b/setup.py @@ -9,8 +9,9 @@ import platform as plat from sys import version +os.chdir(os.path.dirname(os.path.realpath(__file__))) platform = plat.system().lower() -versionString = '3.9.2' +versionString = '3.12.2' if version < '2.6': raise Exception( @@ -61,13 +62,22 @@ extra_link_args=extraLinkArgs ) +versionhelper_wrap = Extension( + 'blpapi._versionhelper', + sources=['blpapi/versionhelper_wrap.cxx'], + include_dirs=[blpapiIncludes], + library_dirs=[blpapiLibraryPath], + libraries=[blpapiLibraryName], + extra_link_args=extraLinkArgs +) + setup( name='blpapi', version=versionString, author='Bloomberg L.P.', author_email='open-tech@bloomberg.net', - description='Python SDK for Bloomberg BLPAPI (<=3.9)', - ext_modules=[blpapi_wrap], + description='Python SDK for Bloomberg BLPAPI', + ext_modules=[blpapi_wrap, versionhelper_wrap], url='http://www.bloomberglabs.com/api/', packages=["blpapi"], classifiers=[ From 211d77a1622de0301b3a44243a0a6d699807ad5e Mon Sep 17 00:00:00 2001 From: Marland Sitt Date: Mon, 15 Apr 2019 20:43:55 -0700 Subject: [PATCH 02/23] Bump to v3.13.0 --- PKG-INFO | 2 +- blpapi/__init__.py | 6 +- blpapi/abstractsession.py | 26 +- blpapi/compat.py | 48 +- blpapi/constant.py | 7 +- blpapi/datatype.py | 3 +- blpapi/datetime.py | 53 +- blpapi/debug.py | 46 +- blpapi/debug_environment.py | 89 + blpapi/diagnosticsutil.py | 13 +- blpapi/element.py | 71 +- blpapi/event.py | 76 +- blpapi/eventdispatcher.py | 25 +- blpapi/exception.py | 9 +- blpapi/highresclock.py | 7 +- blpapi/identity.py | 24 +- blpapi/internals.py | 184 +- blpapi/internals_wrap.c | 20699 +++++++++++++++++ blpapi/logging.py | 30 +- blpapi/message.py | 17 +- blpapi/name.py | 21 +- blpapi/providersession.py | 10 +- blpapi/request.py | 5 +- blpapi/requesttemplate.py | 2 + blpapi/resolutionlist.py | 45 +- blpapi/schema.py | 30 +- blpapi/service.py | 21 +- blpapi/session.py | 81 +- blpapi/sessionoptions.py | 84 +- blpapi/subscriptionlist.py | 53 +- blpapi/testtools.py | 74 +- blpapi/topic.py | 23 +- blpapi/topiclist.py | 25 +- blpapi/version.py | 2 +- blpapi/versionhelper.py | 4 - blpapi/versionhelper_wrap.c | 3875 +++ blpapi/zfputil.py | 78 + changelog.txt | 22 + examples/ContributionsMktdataExample.py | 113 +- examples/ContributionsPageExample.py | 155 +- examples/LocalMktdataSubscriptionExample.py | 137 +- examples/SnapshotRequestTemplateExample.py | 38 +- examples/ZfpOverLeasedLinesSessionExample.py | 220 + setup.py | 31 +- 44 files changed, 25944 insertions(+), 640 deletions(-) create mode 100644 blpapi/debug_environment.py create mode 100644 blpapi/internals_wrap.c create mode 100644 blpapi/versionhelper_wrap.c create mode 100644 blpapi/zfputil.py create mode 100644 examples/ZfpOverLeasedLinesSessionExample.py diff --git a/PKG-INFO b/PKG-INFO index b1c30fe..164d013 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: blpapi -Version: 3.12.2 +Version: 3.13.0 Summary: Python SDK for Bloomberg BLPAPI Home-page: http://www.bloomberglabs.com/api/ Author: Bloomberg L.P. diff --git a/blpapi/__init__.py b/blpapi/__init__.py index da74c1a..93c25df 100644 --- a/blpapi/__init__.py +++ b/blpapi/__init__.py @@ -1,5 +1,7 @@ # __init__.py +# pylint: disable=missing-docstring,redefined-builtin,wildcard-import + try: from .internals import CorrelationId except ImportError as error: @@ -22,14 +24,16 @@ from .name import Name from .providersession import ProviderSession, ServiceRegistrationOptions from .request import Request +from .requesttemplate import RequestTemplate from .resolutionlist import ResolutionList from .schema import SchemaElementDefinition, SchemaStatus, SchemaTypeDefinition -from .service import Service +from .service import Service, Operation from .session import Session from .sessionoptions import SessionOptions, TlsOptions from .subscriptionlist import SubscriptionList from .topic import Topic from .topiclist import TopicList +from .zfputil import ZfpUtil from .version import __version__, version, cpp_sdk_version, print_version __copyright__ = """ diff --git a/blpapi/abstractsession.py b/blpapi/abstractsession.py index 97d5bb6..e6aa0cf 100644 --- a/blpapi/abstractsession.py +++ b/blpapi/abstractsession.py @@ -16,6 +16,7 @@ cannot contain the character '/'. """ +# pylint: disable=protected-access,useless-object-inheritance from . import exception from .exception import _ExceptionUtil @@ -24,6 +25,7 @@ from . import internals from .internals import CorrelationId from . import utils +from .utils import get_handle from .compat import with_metaclass @with_metaclass(utils.MetaClassForClassesWithEnums) @@ -141,7 +143,7 @@ def openServiceAsync(self, serviceName, correlationId=None): internals.blpapi_AbstractSession_openServiceAsync( self.__handle, serviceName, - correlationId._handle())) + get_handle(correlationId))) return correlationId def sendAuthorizationRequest(self, @@ -182,10 +184,10 @@ def sendAuthorizationRequest(self, _ExceptionUtil.raiseOnError( internals.blpapi_AbstractSession_sendAuthorizationRequest( self.__handle, - request._handle(), - identity._handle(), - correlationId._handle(), - None if eventQueue is None else eventQueue._handle(), + get_handle(request), + get_handle(identity), + get_handle(correlationId), + get_handle(eventQueue), None, # no request label 0)) # request label length 0 if eventQueue is not None: @@ -218,7 +220,7 @@ def cancel(self, correlationId): _ExceptionUtil.raiseOnError(internals.blpapi_AbstractSession_cancel( self.__handle, - correlationId._handle(), + get_handle(correlationId), 1, # number of correlation IDs supplied None, # no request label 0)) # request label length 0 @@ -240,19 +242,19 @@ def generateToken(self, correlationId=None, _ExceptionUtil.raiseOnError( internals.blpapi_AbstractSession_generateToken( self.__handle, - correlationId._handle(), - None if eventQueue is None else eventQueue._handle())) + get_handle(correlationId), + get_handle(eventQueue))) elif authId is not None and ipAddress is not None: _ExceptionUtil.raiseOnError( internals.blpapi_AbstractSession_generateManualToken( self.__handle, - correlationId._handle(), + get_handle(correlationId), authId, ipAddress, - None if eventQueue is None else eventQueue._handle())) + get_handle(eventQueue))) else: raise exception.InvalidArgumentException( - "'authId' and 'ipAddress' must be provided together", 0) + "'authId' and 'ipAddress' must be provided together", 0) if eventQueue is not None: eventQueue._registerSession(self) return correlationId @@ -283,7 +285,7 @@ def createIdentity(self): # Protect enumeration constant(s) defined in this class and in classes # derived from this class from changes: - + __copyright__ = """ Copyright 2012. Bloomberg Finance L.P. diff --git a/blpapi/compat.py b/blpapi/compat.py index 1f40390..8b68f64 100644 --- a/blpapi/compat.py +++ b/blpapi/compat.py @@ -1,23 +1,25 @@ -# compat.py +""" Different compatibility tools. Needed to support both +2.x and 3.x python versions.""" import sys -""" Different compatibility tools. Needed to support both -2.x and 3.x python versions.""" +# pylint: disable=undefined-variable def with_metaclass(metaclass): - """Python 2 and 3 different metaclass syntax workaround. Should be used as a decorator.""" + """Python 2 and 3 different metaclass syntax workaround. + Should be used as a decorator.""" def wrapper(cls): - vars = cls.__dict__.copy() - slots = vars.get('__slots__') + """ decorator """ + lvars = cls.__dict__.copy() + slots = lvars.get('__slots__') if slots is not None: if isinstance(slots, str): slots = [slots] for slots_var in slots: - vars.pop(slots_var) - vars.pop('__dict__', None) - vars.pop('__weakref__', None) - return metaclass(cls.__name__, cls.__bases__, vars) + lvars.pop(slots_var) + lvars.pop('__dict__', None) + lvars.pop('__weakref__', None) + return metaclass(cls.__name__, cls.__bases__, lvars) return wrapper # NOTE: this function should be used to convert integer values to long @@ -30,22 +32,22 @@ def tolong(val): def tolong(val): return int(val) -# NOTE: python2 wrapper uses byte strings (str type) to pass strings to C-functions, -# unicode type is not supported so we need to encode all strings first. -# On the other hand, python3 wrapper uses unicode strings (str type) for this so we need -# to decode byte-strings first to get unicode strings. Rule of thumb: to pass string to any -# wrapper function convert it using `conv2str` function first, to check that type of the -# string is correct - use `isstr` function. +# NOTE: python2 wrapper uses byte strings (str type) to pass strings +# to C-functions, unicode type is not supported so we need to encode +# all strings first. On the other hand, python3 wrapper uses unicode strings +# (str type) for this so we need to decode byte-strings first to get unicode +# strings. Rule of thumb: to pass string to any wrapper function convert +# it using `conv2str` function first, to check that type of the string +# is correct - use `isstr` function. if sys.version.startswith('2'): def conv2str(s): """Convert unicode string to byte string.""" if isinstance(s, str): return s - elif isinstance(s, unicode): + if isinstance(s, unicode): return s.encode('utf-8') - else: - return None + return None def isstr(s): if isinstance(s, (str, unicode)): @@ -56,17 +58,17 @@ def conv2str(s): """Convert byte string to unicode string.""" if isinstance(s, bytes): return s.decode() - elif isinstance(s, str): + if isinstance(s, str): return s - else: - return None + return None def isstr(s): if isinstance(s, (bytes, str)): return True return False -# NOTE: integer typelist for different python versions to use with isinstance builtin function +# NOTE: integer typelist for different python versions +# to use with isinstance builtin function if sys.version.startswith('2'): int_typelist = (int, long) else: diff --git a/blpapi/constant.py b/blpapi/constant.py index aa9b1ac..b32d154 100644 --- a/blpapi/constant.py +++ b/blpapi/constant.py @@ -20,6 +20,7 @@ from . import utils from . import internals +# pylint: disable=protected-access,old-style-class class Constant: """Represents the value of a schema enumeration constant. @@ -185,9 +186,9 @@ def hasConstant(self, name): Exception is raised if 'name' is neither a Name nor a string. """ names = getNamePair(name) - return internals.blpapi_ConstantList_hasConstant(self.__handle, - names[0], - names[1]) + return bool(internals.blpapi_ConstantList_hasConstant(self.__handle, + names[0], + names[1])) def getConstant(self, name): """Return the 'Constant' with the specified 'name'. diff --git a/blpapi/datatype.py b/blpapi/datatype.py index cbcfac9..1d420bd 100644 --- a/blpapi/datatype.py +++ b/blpapi/datatype.py @@ -6,12 +6,11 @@ 'DataType' - "enum" representing all possible data types in an Element. """ - - from . import internals from . import utils from .compat import with_metaclass +# pylint: disable=too-few-public-methods,useless-object-inheritance @with_metaclass(utils.MetaClassForClassesWithEnums) class DataType(object): diff --git a/blpapi/datetime.py b/blpapi/datetime.py index 22745cf..f554bf3 100644 --- a/blpapi/datetime.py +++ b/blpapi/datetime.py @@ -5,12 +5,14 @@ from __future__ import absolute_import from __future__ import division +import datetime as _dt + from . import internals from . import utils from .compat import with_metaclass -import datetime as _dt +# pylint: disable=no-member,useless-object-inheritance @with_metaclass(utils.MetaClassForClassesWithEnums) class FixedOffset(_dt.tzinfo): @@ -48,12 +50,18 @@ class FixedOffset(_dt.tzinfo): def __init__(self, offsetInMinutes=0): self.__offset = _dt.timedelta(minutes=offsetInMinutes) - def utcoffset(self, unused): + def utcoffset(self, dt): + del dt return self.__offset - def dst(self, unused): + def dst(self, dt): # pylint: disable=no-self-use + del dt return _dt.timedelta(0) + def tzname(self, dt): + del dt + return self.__offset + def getOffsetInMinutes(self): return self.__offset.days * 24 * 60 + self.__offset.seconds // 60 @@ -63,10 +71,10 @@ def __hash__(self): def __cmp__(self, other): """Let the comparison operations work based on the time delta. - NOTE: (compatibility) this method have no special meaning in python3, + NOTE: (compatibility) this method have no special meaning in python3, we should use __eq__, __lt__ and __le__ instead. Built-in cmp function is also gone. This method can be called only from python2.""" - return cmp(self.getOffsetInMinutes(), other.getOffsetInMinutes()) + return cmp(self.getOffsetInMinutes(), other.getOffsetInMinutes()) # pylint: disable=undefined-variable def __eq__(self, other): """Let the equality operator work based on the time delta.""" @@ -91,8 +99,9 @@ class _DatetimeUtil(object): def convertToNative(blpapiDatetimeObj): """Convert BLPAPI Datetime object to a suitable Python object.""" - isHighPrecision = isinstance(blpapiDatetimeObj, - internals.blpapi_HighPrecisionDatetime_tag) + isHighPrecision = isinstance( + blpapiDatetimeObj, + internals.blpapi_HighPrecisionDatetime_tag) if isHighPrecision: # used for (get/set)Element, (get/set/append)Value methods @@ -124,21 +133,21 @@ def convertToNative(blpapiDatetimeObj): blpapiDatetime.seconds, microsecs, tzinfo) - else: - # Skip an offset, because it's not informative in case of - # there is a date without the time - return _dt.date(blpapiDatetime.year, - blpapiDatetime.month, - blpapiDatetime.day) - else: - if not hasTime: - raise ValueError("Datetime object misses both time and date \ -parts", blpapiDatetime) - return _dt.time(blpapiDatetime.hours, - blpapiDatetime.minutes, - blpapiDatetime.seconds, - microsecs, - tzinfo) + # Skip an offset, because it's not informative in case of + # there is a date without the time + return _dt.date(blpapiDatetime.year, + blpapiDatetime.month, + blpapiDatetime.day) + + if not hasTime: + raise ValueError( + "Datetime object misses both time and date parts", + blpapiDatetime) + return _dt.time(blpapiDatetime.hours, + blpapiDatetime.minutes, + blpapiDatetime.seconds, + microsecs, + tzinfo) @staticmethod def isDatetime(dtime): diff --git a/blpapi/debug.py b/blpapi/debug.py index 926d47a..c7c370a 100644 --- a/blpapi/debug.py +++ b/blpapi/debug.py @@ -3,20 +3,54 @@ """Provide debugging information for import errors""" import platform +import os + +from .debug_environment import get_env_diagnostics def debug_load_error(error): """Called when the module fails to import "internals". Returns ImportError with some debugging message. """ # Try to load just the version.py + version_imported = True try: from .version import version, cpp_sdk_version except ImportError as version_error: - return _version_load_error(version_error) + import_error = _version_load_error(version_error) + version_imported = False + + if version_imported: + # If the version loading succeeds, the most likely reason for a failure + # is a mismatch between C++ and Python SDKs. + import_error = _version_mismatch_error( + error, version(), cpp_sdk_version()) + + # Environment diagnostics currently only works for windows + if platform.system().lower() == "windows": + env_diagnostics = get_env_diagnostics() + + full_error_msg = """ +---------------------------- ENVIRONMENT ----------------------------- +%s +---------------------------------------------------------------------- +%s +""" % (env_diagnostics, import_error) + else: + full_error_msg = import_error + + # Also output the error message to a file if BLPAPI_DIAGNOSTICS is set + diagnostics_path_env_var = "BLPAPI_DIAGNOSTICS" + if diagnostics_path_env_var in os.environ: + diagnostics_path = os.environ[diagnostics_path_env_var] + try: + with open(diagnostics_path, "w") as f: + f.write(full_error_msg) + except IOError: + print("Failed to write to path defined by %s: \"%s\"" \ + % (diagnostics_path_env_var, diagnostics_path)) + + return ImportError(full_error_msg) - # If the version loading succeeds, the most likely reason for a failure - # is a mismatch between C++ and Python SDKs. - return _version_mismatch_error(error, version(), cpp_sdk_version()) def _linker_env(): """Return the name of the right environment variable for linking in the @@ -47,7 +81,7 @@ def _version_load_error(error): was added to %s before entering the interpreter. """ % (str(error), _linker_env()) - return ImportError(msg) + return msg def _version_mismatch_error(error, py_version, cpp_version): @@ -69,4 +103,4 @@ def _version_mismatch_error(error, py_version, cpp_version): path to the library is added to %s before entering the interpreter. """ % (str(error), py_version, cpp_version, _linker_env()) - return ImportError(msg) + return msg diff --git a/blpapi/debug_environment.py b/blpapi/debug_environment.py new file mode 100644 index 0000000..d861803 --- /dev/null +++ b/blpapi/debug_environment.py @@ -0,0 +1,89 @@ +""" +Print various potentially useful information to debug environment setup +related issues +""" +from __future__ import print_function + +import platform +import sys +import os +import pkgutil +import functools + +from ctypes import util + +# Python 2/3 compatibility +try: + from StringIO import StringIO +except ImportError: + from io import StringIO + + +def get_env_diagnostics(): + """ + Get various potentially useful information to debug environment setup + related issues + """ + + strIO = StringIO() + print_to_str = functools.partial(print, file=strIO) + + # General information about the platform + print_to_str("Platform:", platform.platform()) + print_to_str("Architecture:", platform.architecture()) + print_to_str("Python:", sys.version) + print_to_str("Python implementation:", platform.python_implementation()) + print_to_str() + + # Information for PATH related issues + print_to_str("blpapi 64-bit will be loaded from: \"%s\"" + % util.find_library("blpapi3_64")) + print_to_str("blpapi 32-bit will be loaded from: \"%s\"" + % util.find_library("blpapi3_32")) + print_to_str("System PATH: (* marks locations where blpapi was found)") + for p in os.environ["PATH"].split(os.pathsep): + if p: # Skip empty entries + dll_32 = os.path.join(p, "blpapi3_32.dll") + dll_64 = os.path.join(p, "blpapi3_64.dll") + found_blpapi_dll = os.path.isfile(dll_32) or os.path.isfile(dll_64) + print_to_str(" %s \"%s\"" % ("*" if found_blpapi_dll else " ", p)) + print_to_str() + + # Check if the blpapi package has been installed. If not, + # include information about the current python environment + blpapi_package_found = False + for i in pkgutil.iter_modules(): + if i[1] == "blpapi": + print_to_str("blpapi package at: \"%s\"" % i[0].path) + blpapi_package_found = True + + if not blpapi_package_found: + print_to_str("ERROR: Failed to find the blpapi package") + print_to_str("Python prefix: \"%s\"" % sys.prefix) + print_to_str("Python path:") + for p in sys.path: + print_to_str(" \"%s\"" % p) + print_to_str() + + # There is currently a known issue where attempting to import blpapi + # from the local directory (e.g. if trying to run a script in the root + # of our repository) will fail. Check that this is not the case. + print_to_str("Current directory: \"%s\"" % os.getcwd()) + if os.path.isfile(os.path.join(".", "blpapi", "__init__.py")): + print_to_str("WARNING: Using the blpapi module from current path") + print_to_str(" CWD files:", ", ".join( + [x for x in os.listdir(".") if os.path.isfile(x)])) + print_to_str(" CWD dirs:", ", ".join( + [x for x in os.listdir(".") if not os.path.isfile(x)])) + + return strIO.getvalue() + + +if __name__ == "__main__": + env_diagnostics = get_env_diagnostics() + + if len(sys.argv) > 1: + with open(sys.argv[1], "w") as f: + print(env_diagnostics, file=f) + else: + print(env_diagnostics) diff --git a/blpapi/diagnosticsutil.py b/blpapi/diagnosticsutil.py index 207c938..a0a6c72 100644 --- a/blpapi/diagnosticsutil.py +++ b/blpapi/diagnosticsutil.py @@ -1,12 +1,9 @@ -# coding: utf-8 - -#@PURPOSE: Provide api to access diagnostics information on the blpapi library -# -#@DESCRIPTION: This component provide a collection of functions which give -# access to various sets of diagnostics information on the 'blpapi' library. - -import internals +"""@PURPOSE: Provide api to access diagnostics information +on the blpapi library +@DESCRIPTION: This component provide a collection of functions which give +access to various sets of diagnostics information on the 'blpapi' library.""" +from . import internals def memoryInfo(): """Return the string describing the 'blpapi' library's memory usage; the diff --git a/blpapi/element.py b/blpapi/element.py index 4c7e7cb..c51b073 100644 --- a/blpapi/element.py +++ b/blpapi/element.py @@ -7,8 +7,6 @@ """ - - from .exception import _ExceptionUtil from .exception import UnsupportedOperationException from .datetime import _DatetimeUtil @@ -19,8 +17,7 @@ from . import utils from . import internals -import sys - +# pylint: disable=useless-object-inheritance,protected-access,too-many-return-statements,too-many-public-methods class Element(object): """Element represents an item in a message. @@ -48,7 +45,7 @@ class Element(object): values, it will return either 0 or 1. For arrays it will return the actual number of values in the array. - To retrieve values from a complex element types (sequnces and choices) use + To retrieve values from a complex element types (sequences and choices) use the 'getElementAs...()' family of methods. This example shows how to get the value of the the element 'city' in the sequence element 'address': @@ -58,9 +55,9 @@ class Element(object): 'getElement(name).getValueAsXYZ()'. The value(s) of an Element can be set in a number of ways. For an Element - which represents a single value or an array of values use the 'setValue()' or - 'appendValue()' functions. For an element which represents a seqeunce or a - choice use the 'setElement()' functions. + which represents a single value or an array of values use the 'setValue()' + or 'appendValue()' functions. For an element which represents a sequence + or a choice use the 'setElement()' functions. This example shows how to set the value of an Element 's': @@ -78,9 +75,10 @@ class Element(object): address.setElement("city", "New York") - Methods which specify an Element name accept name in two forms: 'blpapi.Name' - or a string. Passing 'blpapi.Name' is more efficient. However, it requires - the Name to have been created in the global name table. + Methods which specify an Element name accept name in two forms: + 'blpapi.Name' or a string. Passing 'blpapi.Name' is more efficient. + However, it requires the Name to have been created in the + global name table. The form which takes a string is less efficient but will not cause a new Name to be created in the global Name table. Because all valid Element @@ -138,25 +136,24 @@ class Element(object): @staticmethod def __getTraits(value): + """ traits dispatcher """ if isstr(value): return Element.__stringTraits - elif isinstance(value, bool): + if isinstance(value, bool): return Element.__boolTraits - elif isinstance(value, int_typelist): - if value >= -(2 ** 31) and value <= (2 ** 31 - 1): + if isinstance(value, int_typelist): + if -(2 ** 31) <= value <= (2 ** 31 - 1): return Element.__int32Traits - elif value >= -(2 ** 63) and value <= (2 ** 63 - 1): + if -(2 ** 63) <= value <= (2 ** 63 - 1): return Element.__int64Traits - else: - raise ValueError("value is out of element's supported range") - elif isinstance(value, float): + raise ValueError("value is out of element's supported range") + if isinstance(value, float): return Element.__floatTraits - elif _DatetimeUtil.isDatetime(value): + if _DatetimeUtil.isDatetime(value): return Element.__datetimeTraits - elif isinstance(value, Name): + if isinstance(value, Name): return Element.__nameTraits - else: - return Element.__defaultTraits + return Element.__defaultTraits def __assertIsValid(self): if not self.isValid(): @@ -176,14 +173,13 @@ def _sessions(self): For internal use.""" if self.__dataHolder is None: return list() - else: - return self.__dataHolder._sessions() + return self.__dataHolder._sessions() def __str__(self): """x.__str__() <==> str(x) - Return a string representation of this Element. Call of 'str(element)' is - equivalent to 'element.toString()' called with default parameters. + Return a string representation of this Element. Call of 'str(element)' + is equivalent to 'element.toString()' called with default parameters. """ @@ -302,9 +298,10 @@ def isNullValue(self, position=0): self.__assertIsValid() res = internals.blpapi_Element_isNullValue(self.__handle, position) - if res == 0 or res == 1: + if res in (0, 1): return bool(res) _ExceptionUtil.raiseOnError(res) + return None # unreachable def toString(self, level=0, spacesPerLevel=4): """Format this Element to the string. @@ -325,9 +322,9 @@ def toString(self, level=0, spacesPerLevel=4): spacesPerLevel) def getElement(self, nameOrIndex): - """Return a specified subelement. + """Return a specified sub-element. - Return a subelement identified by the specified 'nameOrIndex', which + Return a sub-element identified by the specified 'nameOrIndex', which must be either a string, a Name, or an integer. If 'nameOrIndex' is a string or a Name and 'hasElement(nameOrIndex) != True', or if 'nameOrIndex' is an integer and 'nameOrIndex >= numElements()', then @@ -357,8 +354,9 @@ def elements(self): An exception is raised if this 'Element' is not a sequence. """ - if (self.datatype() != DataType.SEQUENCE): - raise UnsupportedOperationException() + if self.datatype() != DataType.SEQUENCE: + raise UnsupportedOperationException( + description="Only sequences are supported", errorCode=None) return utils.Iterator(self, Element.numElements, Element.getElement) def hasElement(self, name, excludeNullElements=False): @@ -384,7 +382,7 @@ def hasElement(self, name, excludeNullElements=False): def getChoice(self): """Return the selection name of this element as Element. - Return the selection name of this element if + Return the selection name of this element if 'datatype() == DataType.CHOICE'; otherwise, an exception is raised. """ @@ -433,7 +431,7 @@ def getValueAsDatetime(self, index=0): self.__assertIsValid() res = internals.blpapi_Element_getValueAsHighPrecisionDatetime( - self.__handle, index) + self.__handle, index) _ExceptionUtil.raiseOnError(res[0]) return _DatetimeUtil.convertToNative(res[1]) @@ -508,9 +506,8 @@ def getValue(self, index=0): def values(self): """Return an iterator over values contained in this Element. - If 'isComplexType()' returns True for this Element, the empty iterator is - returned. - + If 'isComplexType()' returns True for this Element, the empty iterator + is returned. """ if self.isComplexType(): @@ -625,7 +622,7 @@ def setElement(self, name, value): then processed in the same way as string 'value'. An exception is raised if 'name' is neither a Name nor a string, or if - this element has no sub-elemen with the specified 'name', or if the + this element has no sub-element with the specified 'name', or if the Element identified by the specified 'name' cannot be initialized from the type of the specified 'value'. diff --git a/blpapi/event.py b/blpapi/event.py index a7b21a1..ff5a887 100644 --- a/blpapi/event.py +++ b/blpapi/event.py @@ -33,17 +33,13 @@ """ - - from .message import Message from . import internals from . import utils +from .utils import get_handle from .compat import with_metaclass -import sys - -#sys.modules[__name__] = utils._Constants() - +# pylint: disable=useless-object-inheritance class MessageIterator(object): """An iterator over the 'Message' objects within an Event. @@ -55,7 +51,7 @@ class MessageIterator(object): def __init__(self, event): self.__handle = \ - internals.blpapi_MessageIterator_create(event._handle()) + internals.blpapi_MessageIterator_create(get_handle(event)) self.__event = event def __del__(self): @@ -104,54 +100,53 @@ class Event(object): Class attributes: The possible types of event: - ADMIN Admin event - SESSION_STATUS Status updates for a session - SUBSCRIPTION_STATUS Status updates for a subscription - REQUEST_STATUS Status updates for a request - RESPONSE The final (possibly only) response to a request - PARTIAL_RESPONSE A partial response to a request - SUBSCRIPTION_DATA Data updates resulting from a subscription - SERVICE_STATUS Status updates for a service - TIMEOUT An Event returned from nextEvent() if it - timed out - AUTHORIZATION_STATUS Status updates for user authorization - RESOLUTION_STATUS Status updates for a resolution operation - TOPIC_STATUS Status updates about topics for service providers - ROKEN_STATUS Status updates for a generate token request - REQUEST Request event - UNKNOWN Unknown event + ADMIN: + Admin event + SESSION_STATUS: + Status updates for a session + SUBSCRIPTION_STATUS: + Status updates for a subscription + REQUEST_STATUS: + Status updates for a request + RESPONSE: + The final (possibly only) response to a request + PARTIAL_RESPONSE: + A partial response to a request + SUBSCRIPTION_DATA: + Data updates resulting from a subscription + SERVICE_STATUS: + Status updates for a service + TIMEOUT: + An Event returned from nextEvent() if it timed out + AUTHORIZATION_STATUS: + Status updates for user authorization + RESOLUTION_STATUS: + Status updates for a resolution operation + TOPIC_STATUS: + Status updates about topics for service providers + ROKEN_STATUS: + Status updates for a generate token request + REQUEST: + Request event + UNKNOWN: + Unknown event """ ADMIN = internals.EVENTTYPE_ADMIN - """Admin event""" SESSION_STATUS = internals.EVENTTYPE_SESSION_STATUS - """Status updates for a session""" SUBSCRIPTION_STATUS = internals.EVENTTYPE_SUBSCRIPTION_STATUS - """Status updates for a subscription""" REQUEST_STATUS = internals.EVENTTYPE_REQUEST_STATUS - """Status updates for a request""" RESPONSE = internals.EVENTTYPE_RESPONSE - """The final (possibly only) response to a request""" PARTIAL_RESPONSE = internals.EVENTTYPE_PARTIAL_RESPONSE - """A partial response to a request""" SUBSCRIPTION_DATA = internals.EVENTTYPE_SUBSCRIPTION_DATA - """Data updates resulting from a subscription""" SERVICE_STATUS = internals.EVENTTYPE_SERVICE_STATUS - """Status updates for a service""" TIMEOUT = internals.EVENTTYPE_TIMEOUT - """An Event returned from nextEvent() if it timed out""" AUTHORIZATION_STATUS = internals.EVENTTYPE_AUTHORIZATION_STATUS - """Status updates for user authorization""" RESOLUTION_STATUS = internals.EVENTTYPE_RESOLUTION_STATUS - """Status updates for a resolution operation""" TOPIC_STATUS = internals.EVENTTYPE_TOPIC_STATUS - """Status updates about topics for service providers""" TOKEN_STATUS = internals.EVENTTYPE_TOKEN_STATUS - """Status updates for a generate token request""" REQUEST = internals.EVENTTYPE_REQUEST - """Request event""" UNKNOWN = -1 - """Unknown event""" def __init__(self, handle, sessions): self.__handle = handle @@ -188,7 +183,7 @@ def _sessions(self): # Protect enumeration constant(s) defined in this class and in classes # derived from this class from changes: - + class EventQueue(object): """A construct used to handle replies to request synchronously. @@ -239,8 +234,7 @@ def tryNextEvent(self): res = internals.blpapi_EventQueue_tryNextEvent(self.__handle) if res[0]: return None - else: - return Event(res[1], self._getSessions()) + return Event(res[1], self._getSessions()) def purge(self): """Purge any 'Event' objects in this 'EventQueue'. diff --git a/blpapi/eventdispatcher.py b/blpapi/eventdispatcher.py index 4a3c198..a22cad7 100644 --- a/blpapi/eventdispatcher.py +++ b/blpapi/eventdispatcher.py @@ -6,12 +6,10 @@ Sessions through callbacks. """ - - - -from . import internals import warnings +from . import internals +# pylint: disable=useless-object-inheritance class EventDispatcher(object): """Dispatches events from one or more Sessions through callbacks @@ -64,26 +62,27 @@ def stop(self, async_=False, **kwargs): """Stop generating callbacks. Stop generating callbacks for events from sessions associated with this - EventDispatcher. If the specified 'async_' is False (the default) then + EventDispatcher. If the specified `async_` is False (the default) then this method blocks until all current callbacks which were dispatched - through this EventDispatcher have completed. If 'async_' is True, this + through this EventDispatcher have completed. If `async_` is True, this method returns immediately and no further callbacks will be dispatched. - Note: If stop is called with 'async_' of False from within a callback - dispatched by this EventDispatcher then the 'async_' parameter is + Note: If stop is called with `async_` of False from within a callback + dispatched by this EventDispatcher then the `async_` parameter is overridden to True. """ if 'async' in kwargs: warnings.warn( - "async parameter has been deprecated in favor of async_", - DeprecationWarning) + "async parameter has been deprecated in favor of async_", + DeprecationWarning) async_ = kwargs.pop('async') if kwargs: - raise TypeError("EventDispatcher.stop() got an unexpected keyword " - "argument. Only 'async' is allowed for backwards " - "compatibility.") + raise TypeError( + "EventDispatcher.stop() got an unexpected keyword " + "argument. Only 'async' is allowed for backwards " + "compatibility.") return internals.blpapi_EventDispatcher_stop(self.__handle, async_) diff --git a/blpapi/exception.py b/blpapi/exception.py index fa04f82..d666260 100644 --- a/blpapi/exception.py +++ b/blpapi/exception.py @@ -6,7 +6,6 @@ """ - try: from builtins import Exception as _StandardException except ImportError: @@ -14,6 +13,8 @@ from . import internals +# pylint: disable=useless-object-inheritance, redefined-builtin + class Exception(_StandardException): """This class defines a base exception for blpapi operations. @@ -23,13 +24,14 @@ def __init__(self, description, errorCode): _StandardException.__init__(self, description, errorCode) def __str__(self): - return "{0} ({1:#010x})".format(self.args[0], self.args[1]) + args_arr = list(self.args) + return "{0} ({1:#010x})".format(args_arr[0], args_arr[1]) class DuplicateCorrelationIdException(Exception): """Duplicate CorrelationId exception. - The class defines an exception for non unqiue 'blpapi.CorrelationId'. + The class defines an exception for non unique 'blpapi.CorrelationId'. """ pass @@ -120,6 +122,7 @@ class _ExceptionUtil(object): @staticmethod def __getErrorClass(errorCode): + """ returns proper error class for the code """ if errorCode == internals.ERROR_DUPLICATE_CORRELATIONID: return DuplicateCorrelationIdException errorClass = errorCode & 0xff0000 diff --git a/blpapi/highresclock.py b/blpapi/highresclock.py index b9f9152..9c99b8d 100644 --- a/blpapi/highresclock.py +++ b/blpapi/highresclock.py @@ -1,4 +1,5 @@ # coding: utf-8 +""" Support highres clock""" from __future__ import absolute_import from blpapi import internals @@ -10,6 +11,10 @@ def now(tzinfo=UTC): necessarily the same clock as is accessed by calls to 'datetime.now'. The resulting datetime will be represented using the specified 'tzinfo'. """ - original = internals.blpapi_HighResolutionClock_now_wrapper() + err_code, time_point = internals.blpapi_HighResolutionClock_now() + if err_code != 0: + raise RuntimeError("High resolution clock error") + original = internals.blpapi_HighPrecisionDatetime_fromTimePoint_wrapper( + time_point) native = _DatetimeUtil.convertToNative(original) return native.astimezone(tzinfo) diff --git a/blpapi/identity.py b/blpapi/identity.py index dd5f6da..bbfea45 100644 --- a/blpapi/identity.py +++ b/blpapi/identity.py @@ -6,15 +6,14 @@ to the entitlements. """ - - - from .element import Element from .exception import _ExceptionUtil from . import internals from . import utils +from .utils import get_handle from .compat import with_metaclass +# pylint: disable=useless-object-inheritance @with_metaclass(utils.MetaClassForClassesWithEnums) class Identity(object): @@ -76,8 +75,8 @@ def hasEntitlements(self, service, entitlements): if isinstance(entitlements, Element): res = internals.blpapi_Identity_hasEntitlements( self.__handle, - service._handle(), - entitlements._handle(), + get_handle(service), + get_handle(entitlements), None, 0, None, @@ -90,7 +89,7 @@ def hasEntitlements(self, service, entitlements): carrayOfEIDs[i] = eid res = internals.blpapi_Identity_hasEntitlements( self.__handle, - service._handle(), + get_handle(service), None, carrayOfEIDs, numberOfEIDs, @@ -117,8 +116,8 @@ def getFailedEntitlements(self, service, entitlements): failedEIDsSize[0] = maxFailedEIDs res = internals.blpapi_Identity_hasEntitlements( self.__handle, - service._handle(), - entitlements._handle(), + get_handle(service), + get_handle(entitlements), None, 0, failedEIDs, @@ -135,7 +134,7 @@ def getFailedEntitlements(self, service, entitlements): failedEIDsSize[0] = maxFailedEIDs res = internals.blpapi_Identity_hasEntitlements( self.__handle, - service._handle(), + get_handle(service), None, carrayOfEIDs, numberOfEIDs, @@ -152,8 +151,9 @@ def isAuthorized(self, service): Return True if this 'Identity' is authorized for the specified 'service'; otherwise return False. """ - res = internals.blpapi_Identity_isAuthorized(self.__handle, - service._handle()) + res = internals.blpapi_Identity_isAuthorized( + self.__handle, + get_handle(service)) return True if res else False def getSeatType(self): @@ -168,7 +168,7 @@ def _handle(self): # Protect enumeration constant(s) defined in this class and in classes # derived from this class from changes: - + __copyright__ = """ Copyright 2012. Bloomberg Finance L.P. diff --git a/blpapi/internals.py b/blpapi/internals.py index 4a2d116..f6b6a33 100644 --- a/blpapi/internals.py +++ b/blpapi/internals.py @@ -120,22 +120,6 @@ class _object: pass _newclass = 0 -TOPICLIST_NOT_CREATED = _internals.TOPICLIST_NOT_CREATED -TOPICLIST_CREATED = _internals.TOPICLIST_CREATED -TOPICLIST_FAILURE = _internals.TOPICLIST_FAILURE -RESOLUTIONLIST_UNRESOLVED = _internals.RESOLUTIONLIST_UNRESOLVED -RESOLUTIONLIST_RESOLVED = _internals.RESOLUTIONLIST_RESOLVED -RESOLUTIONLIST_RESOLUTION_FAILURE_BAD_SERVICE = _internals.RESOLUTIONLIST_RESOLUTION_FAILURE_BAD_SERVICE -RESOLUTIONLIST_RESOLUTION_FAILURE_SERVICE_AUTHORIZATION_FAILED = _internals.RESOLUTIONLIST_RESOLUTION_FAILURE_SERVICE_AUTHORIZATION_FAILED -RESOLUTIONLIST_RESOLUTION_FAILURE_BAD_TOPIC = _internals.RESOLUTIONLIST_RESOLUTION_FAILURE_BAD_TOPIC -RESOLUTIONLIST_RESOLUTION_FAILURE_TOPIC_AUTHORIZATION_FAILED = _internals.RESOLUTIONLIST_RESOLUTION_FAILURE_TOPIC_AUTHORIZATION_FAILED -MESSAGE_FRAGMENT_NONE = _internals.MESSAGE_FRAGMENT_NONE -MESSAGE_FRAGMENT_START = _internals.MESSAGE_FRAGMENT_START -MESSAGE_FRAGMENT_INTERMEDIATE = _internals.MESSAGE_FRAGMENT_INTERMEDIATE -MESSAGE_FRAGMENT_END = _internals.MESSAGE_FRAGMENT_END -MESSAGE_RECAPTYPE_NONE = _internals.MESSAGE_RECAPTYPE_NONE -MESSAGE_RECAPTYPE_SOLICITED = _internals.MESSAGE_RECAPTYPE_SOLICITED -MESSAGE_RECAPTYPE_UNSOLICITED = _internals.MESSAGE_RECAPTYPE_UNSOLICITED ELEMENTDEFINITION_UNBOUNDED = _internals.ELEMENTDEFINITION_UNBOUNDED ELEMENT_INDEX_END = _internals.ELEMENT_INDEX_END SERVICEREGISTRATIONOPTIONS_PRIORITY_MEDIUM = _internals.SERVICEREGISTRATIONOPTIONS_PRIORITY_MEDIUM @@ -198,6 +182,24 @@ class _object: REGISTRATIONPARTS_OPERATIONS = _internals.REGISTRATIONPARTS_OPERATIONS REGISTRATIONPARTS_SUBSCRIBER_RESOLUTION = _internals.REGISTRATIONPARTS_SUBSCRIBER_RESOLUTION REGISTRATIONPARTS_PUBLISHER_RESOLUTION = _internals.REGISTRATIONPARTS_PUBLISHER_RESOLUTION +TOPICLIST_NOT_CREATED = _internals.TOPICLIST_NOT_CREATED +TOPICLIST_CREATED = _internals.TOPICLIST_CREATED +TOPICLIST_FAILURE = _internals.TOPICLIST_FAILURE +RESOLUTIONLIST_UNRESOLVED = _internals.RESOLUTIONLIST_UNRESOLVED +RESOLUTIONLIST_RESOLVED = _internals.RESOLUTIONLIST_RESOLVED +RESOLUTIONLIST_RESOLUTION_FAILURE_BAD_SERVICE = _internals.RESOLUTIONLIST_RESOLUTION_FAILURE_BAD_SERVICE +RESOLUTIONLIST_RESOLUTION_FAILURE_SERVICE_AUTHORIZATION_FAILED = _internals.RESOLUTIONLIST_RESOLUTION_FAILURE_SERVICE_AUTHORIZATION_FAILED +RESOLUTIONLIST_RESOLUTION_FAILURE_BAD_TOPIC = _internals.RESOLUTIONLIST_RESOLUTION_FAILURE_BAD_TOPIC +RESOLUTIONLIST_RESOLUTION_FAILURE_TOPIC_AUTHORIZATION_FAILED = _internals.RESOLUTIONLIST_RESOLUTION_FAILURE_TOPIC_AUTHORIZATION_FAILED +MESSAGE_FRAGMENT_NONE = _internals.MESSAGE_FRAGMENT_NONE +MESSAGE_FRAGMENT_START = _internals.MESSAGE_FRAGMENT_START +MESSAGE_FRAGMENT_INTERMEDIATE = _internals.MESSAGE_FRAGMENT_INTERMEDIATE +MESSAGE_FRAGMENT_END = _internals.MESSAGE_FRAGMENT_END +MESSAGE_RECAPTYPE_NONE = _internals.MESSAGE_RECAPTYPE_NONE +MESSAGE_RECAPTYPE_SOLICITED = _internals.MESSAGE_RECAPTYPE_SOLICITED +MESSAGE_RECAPTYPE_UNSOLICITED = _internals.MESSAGE_RECAPTYPE_UNSOLICITED +ZFPUTIL_REMOTE_8194 = _internals.ZFPUTIL_REMOTE_8194 +ZFPUTIL_REMOTE_8196 = _internals.ZFPUTIL_REMOTE_8196 DATATYPE_BOOL = _internals.DATATYPE_BOOL DATATYPE_CHAR = _internals.DATATYPE_CHAR DATATYPE_BYTE = _internals.DATATYPE_BYTE @@ -227,6 +229,10 @@ def setLoggerCallbackWrapper(cb, severity): return _internals.setLoggerCallbackWrapper(cb, severity) setLoggerCallbackWrapper = _internals.setLoggerCallbackWrapper +def blpapi_HighPrecisionDatetime_fromTimePoint_wrapper(original): + return _internals.blpapi_HighPrecisionDatetime_fromTimePoint_wrapper(original) +blpapi_HighPrecisionDatetime_fromTimePoint_wrapper = _internals.blpapi_HighPrecisionDatetime_fromTimePoint_wrapper + def blpapi_Logging_registerCallback(callback, thresholdSeverity): return _internals.blpapi_Logging_registerCallback(callback, thresholdSeverity) blpapi_Logging_registerCallback = _internals.blpapi_Logging_registerCallback @@ -239,14 +245,6 @@ def blpapi_DiagnosticsUtil_memoryInfo_wrapper(): return _internals.blpapi_DiagnosticsUtil_memoryInfo_wrapper() blpapi_DiagnosticsUtil_memoryInfo_wrapper = _internals.blpapi_DiagnosticsUtil_memoryInfo_wrapper -def blpapi_Message_timeReceived_wrapper(message): - return _internals.blpapi_Message_timeReceived_wrapper(message) -blpapi_Message_timeReceived_wrapper = _internals.blpapi_Message_timeReceived_wrapper - -def blpapi_HighResolutionClock_now_wrapper(): - return _internals.blpapi_HighResolutionClock_now_wrapper() -blpapi_HighResolutionClock_now_wrapper = _internals.blpapi_HighResolutionClock_now_wrapper - def blpapi_EventDispatcher_stop(handle, asynch): return _internals.blpapi_EventDispatcher_stop(handle, asynch) blpapi_EventDispatcher_stop = _internals.blpapi_EventDispatcher_stop @@ -361,13 +359,14 @@ class CorrelationId(_object): Two CorrelationIds are considered equal if they have the same type() and: + - holds the same (not just equal!) objects in case of - type() == CorrelationId.OBJECT_TYPE + type() == CorrelationId.OBJECT_TYPE - holds equal integers in case of - type() == CorrelationId.INT_TYPE or - type() == CorrelationId.AUTOGEN_TYPE + type() == CorrelationId.INT_TYPE or + type() == CorrelationId.AUTOGEN_TYPE - True otherwise - (i.e. in case of type() == CorrelationId.UNSET_TYPE) + (i.e. in case of type() == CorrelationId.UNSET_TYPE) It is possible that an user constructed CorrelationId and a CorrelationId generated by the API could return the same @@ -387,16 +386,20 @@ class CorrelationId(_object): whilst the original request or subscription is still active. Class attributes: + MAX_CLASS_ID: + The maximum value allowed for classId. Possible return values for type() method: - UNSET_TYPE The CorrelationId is unset. That is, it was created by - the default CorrelationId constructor. - INT_TYPE The CorrelationId was created from an integer (or long) - supplied by the user. - OBJECT_TYPE The CorrelationId was created from an object supplied by - the user. - AUTOGEN_TYPE The CorrelationId was created internally by API. - - MAX_CLASS_ID The maximum value allowed for classId. + UNSET_TYPE: + The CorrelationId is unset. That is, it was created by + the default CorrelationId constructor. + INT_TYPE: + The CorrelationId was created from an integer (or long) + supplied by the user. + OBJECT_TYPE: + The CorrelationId was created from an object supplied by + the user. + AUTOGEN_TYPE: + The CorrelationId was created internally by API. """ __swig_setmethods__ = {} @@ -404,6 +407,9 @@ class CorrelationId(_object): __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, CorrelationId, name) __repr__ = _swig_repr + __swig_getmethods__["value"] = _internals.CorrelationId_value_get + if _newclass: + value = _swig_property(_internals.CorrelationId_value_get) UNSET_TYPE = _internals.CORRELATION_TYPE_UNSET @@ -439,7 +445,7 @@ def __hash__(self): def __eq__(self, other): """x.__eq__(y) <==> x==y""" try: - return CorrelationId_t_equals(self, other) + return bool(CorrelationId_t_equals(self, other)) except Exception: return NotImplemented @@ -451,8 +457,9 @@ def __ne__(self, other): def value(self): """Return the value of this CorrelationId object. The return value depends on this CorrelationId's value type and could be: + - integer (type() == CorrelationId.INT_TYPE - or type() == CorrelationId.AUTOGEN_TYPE) + or type() == CorrelationId.AUTOGEN_TYPE) - object (type() == CorrelationId.OBJECT_TYPE) - None (type() == CorrelationId.UNSET_TYPE) """ @@ -481,13 +488,14 @@ def __init__(self, *args): Two CorrelationIds are considered equal if they have the same type() and: + - holds the same (not just equal!) objects in case of - type() == CorrelationId.OBJECT_TYPE + type() == CorrelationId.OBJECT_TYPE - holds equal integers in case of - type() == CorrelationId.INT_TYPE or - type() == CorrelationId.AUTOGEN_TYPE + type() == CorrelationId.INT_TYPE or + type() == CorrelationId.AUTOGEN_TYPE - True otherwise - (i.e. in case of type() == CorrelationId.UNSET_TYPE) + (i.e. in case of type() == CorrelationId.UNSET_TYPE) It is possible that an user constructed CorrelationId and a CorrelationId generated by the API could return the same @@ -507,16 +515,20 @@ def __init__(self, *args): whilst the original request or subscription is still active. Class attributes: + MAX_CLASS_ID: + The maximum value allowed for classId. Possible return values for type() method: - UNSET_TYPE The CorrelationId is unset. That is, it was created by - the default CorrelationId constructor. - INT_TYPE The CorrelationId was created from an integer (or long) - supplied by the user. - OBJECT_TYPE The CorrelationId was created from an object supplied by - the user. - AUTOGEN_TYPE The CorrelationId was created internally by API. - - MAX_CLASS_ID The maximum value allowed for classId. + UNSET_TYPE: + The CorrelationId is unset. That is, it was created by + the default CorrelationId constructor. + INT_TYPE: + The CorrelationId was created from an integer (or long) + supplied by the user. + OBJECT_TYPE: + The CorrelationId was created from an object supplied by + the user. + AUTOGEN_TYPE: + The CorrelationId was created internally by API. """ this = _internals.new_CorrelationId(*args) try: @@ -547,6 +559,24 @@ def __toInteger(self): CorrelationId_swigregister = _internals.CorrelationId_swigregister CorrelationId_swigregister(CorrelationId) +class blpapi_CorrelationId_t__value(_object): + __swig_setmethods__ = {} + __setattr__ = lambda self, name, value: _swig_setattr(self, blpapi_CorrelationId_t__value, name, value) + __swig_getmethods__ = {} + __getattr__ = lambda self, name: _swig_getattr(self, blpapi_CorrelationId_t__value, name) + __repr__ = _swig_repr + + def __init__(self): + this = _internals.new_blpapi_CorrelationId_t__value() + try: + self.this.append(this) + except __builtin__.Exception: + self.this = this + __swig_destroy__ = _internals.delete_blpapi_CorrelationId_t__value + __del__ = lambda self: None +blpapi_CorrelationId_t__value_swigregister = _internals.blpapi_CorrelationId_t__value_swigregister +blpapi_CorrelationId_t__value_swigregister(blpapi_CorrelationId_t__value) + def blpapi_Element_setElementFloat(element, nameString, name, value): return _internals.blpapi_Element_setElementFloat(element, nameString, name, value) @@ -863,10 +893,6 @@ def ProviderSession_destroyHelper(sessionHandle, eventHandlerFunc): def ProviderSession_terminateSubscriptionsOnTopic(sessionHandle, topic, message): return _internals.ProviderSession_terminateSubscriptionsOnTopic(sessionHandle, topic, message) ProviderSession_terminateSubscriptionsOnTopic = _internals.ProviderSession_terminateSubscriptionsOnTopic - -def ProviderSession_flushPublishedEvents(handle, timeoutMsecs): - return _internals.ProviderSession_flushPublishedEvents(handle, timeoutMsecs) -ProviderSession_flushPublishedEvents = _internals.ProviderSession_flushPublishedEvents UNKNOWN_CLASS = _internals.UNKNOWN_CLASS INVALIDSTATE_CLASS = _internals.INVALIDSTATE_CLASS INVALIDARG_CLASS = _internals.INVALIDARG_CLASS @@ -1184,6 +1210,32 @@ def blpapi_SubscriptionList_topicStringAt(list, index): def blpapi_SubscriptionList_isResolvedAt(list, index): return _internals.blpapi_SubscriptionList_isResolvedAt(list, index) blpapi_SubscriptionList_isResolvedAt = _internals.blpapi_SubscriptionList_isResolvedAt +class blpapi_TimePoint(_object): + __swig_setmethods__ = {} + __setattr__ = lambda self, name, value: _swig_setattr(self, blpapi_TimePoint, name, value) + __swig_getmethods__ = {} + __getattr__ = lambda self, name: _swig_getattr(self, blpapi_TimePoint, name) + __repr__ = _swig_repr + __swig_setmethods__["d_value"] = _internals.blpapi_TimePoint_d_value_set + __swig_getmethods__["d_value"] = _internals.blpapi_TimePoint_d_value_get + if _newclass: + d_value = _swig_property(_internals.blpapi_TimePoint_d_value_get, _internals.blpapi_TimePoint_d_value_set) + + def __init__(self): + this = _internals.new_blpapi_TimePoint() + try: + self.this.append(this) + except __builtin__.Exception: + self.this = this + __swig_destroy__ = _internals.delete_blpapi_TimePoint + __del__ = lambda self: None +blpapi_TimePoint_swigregister = _internals.blpapi_TimePoint_swigregister +blpapi_TimePoint_swigregister(blpapi_TimePoint) + + +def blpapi_TimePointUtil_nanosecondsBetween(start, end): + return _internals.blpapi_TimePointUtil_nanosecondsBetween(start, end) +blpapi_TimePointUtil_nanosecondsBetween = _internals.blpapi_TimePointUtil_nanosecondsBetween class blpapi_Datetime_tag(_object): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, blpapi_Datetime_tag, name, value) @@ -1273,8 +1325,8 @@ def blpapi_HighPrecisionDatetime_print(datetime, streamWriter, stream, level, sp return _internals.blpapi_HighPrecisionDatetime_print(datetime, streamWriter, stream, level, spacesPerLevel) blpapi_HighPrecisionDatetime_print = _internals.blpapi_HighPrecisionDatetime_print -def blpapi_HighPrecisionDatetime_fromTimePoint(datetime, timePoint, offset): - return _internals.blpapi_HighPrecisionDatetime_fromTimePoint(datetime, timePoint, offset) +def blpapi_HighPrecisionDatetime_fromTimePoint(datetime, offset): + return _internals.blpapi_HighPrecisionDatetime_fromTimePoint(datetime, offset) blpapi_HighPrecisionDatetime_fromTimePoint = _internals.blpapi_HighPrecisionDatetime_fromTimePoint def blpapi_Constant_name(constant): @@ -1557,8 +1609,8 @@ def blpapi_Message_release(message): return _internals.blpapi_Message_release(message) blpapi_Message_release = _internals.blpapi_Message_release -def blpapi_Message_timeReceived(message, timeReceived): - return _internals.blpapi_Message_timeReceived(message, timeReceived) +def blpapi_Message_timeReceived(message): + return _internals.blpapi_Message_timeReceived(message) blpapi_Message_timeReceived = _internals.blpapi_Message_timeReceived def blpapi_Event_eventType(event): @@ -1621,6 +1673,10 @@ def blpapi_Identity_getSeatType(handle): return _internals.blpapi_Identity_getSeatType(handle) blpapi_Identity_getSeatType = _internals.blpapi_Identity_getSeatType +def blpapi_HighResolutionClock_now(): + return _internals.blpapi_HighResolutionClock_now() +blpapi_HighResolutionClock_now = _internals.blpapi_HighResolutionClock_now + def blpapi_AbstractSession_cancel(session, correlationIds, numCorrelationIds, requestLabel, requestLabelLen): return _internals.blpapi_AbstractSession_cancel(session, correlationIds, numCorrelationIds, requestLabel, requestLabelLen) blpapi_AbstractSession_cancel = _internals.blpapi_AbstractSession_cancel @@ -1945,6 +2001,10 @@ def blpapi_ProviderSession_getAbstractSession(session): return _internals.blpapi_ProviderSession_getAbstractSession(session) blpapi_ProviderSession_getAbstractSession = _internals.blpapi_ProviderSession_getAbstractSession +def blpapi_ProviderSession_flushPublishedEvents(session, timeoutMsecs): + return _internals.blpapi_ProviderSession_flushPublishedEvents(session, timeoutMsecs) +blpapi_ProviderSession_flushPublishedEvents = _internals.blpapi_ProviderSession_flushPublishedEvents + def blpapi_ServiceRegistrationOptions_create(): return _internals.blpapi_ServiceRegistrationOptions_create() blpapi_ServiceRegistrationOptions_create = _internals.blpapi_ServiceRegistrationOptions_create @@ -1992,6 +2052,10 @@ def blpapi_ServiceRegistrationOptions_getServicePriority(parameters): def blpapi_ServiceRegistrationOptions_getPartsToRegister(parameters): return _internals.blpapi_ServiceRegistrationOptions_getPartsToRegister(parameters) blpapi_ServiceRegistrationOptions_getPartsToRegister = _internals.blpapi_ServiceRegistrationOptions_getPartsToRegister + +def blpapi_ZfpUtil_getOptionsForLeasedLines(sessionOptions, tlsOptions, remote): + return _internals.blpapi_ZfpUtil_getOptionsForLeasedLines(sessionOptions, tlsOptions, remote) +blpapi_ZfpUtil_getOptionsForLeasedLines = _internals.blpapi_ZfpUtil_getOptionsForLeasedLines # This file is compatible with both classic and new-style classes. diff --git a/blpapi/internals_wrap.c b/blpapi/internals_wrap.c new file mode 100644 index 0000000..46eb162 --- /dev/null +++ b/blpapi/internals_wrap.c @@ -0,0 +1,20699 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 3.0.12 + * + * 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. + * ----------------------------------------------------------------------------- */ + + +#ifndef SWIGPYTHON +#define SWIGPYTHON +#endif + +#define SWIG_PYTHON_THREADS +#define SWIG_PYTHON_DIRECTOR_NO_VTABLE + +/* ----------------------------------------------------------------------------- + * This section contains generic SWIG labels for method/variable + * declarations/attributes, and other compiler dependent labels. + * ----------------------------------------------------------------------------- */ + +/* template workaround for compilers that cannot correctly implement the C++ standard */ +#ifndef SWIGTEMPLATEDISAMBIGUATOR +# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) +# define SWIGTEMPLATEDISAMBIGUATOR template +# elif defined(__HP_aCC) +/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ +/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ +# define SWIGTEMPLATEDISAMBIGUATOR template +# else +# define SWIGTEMPLATEDISAMBIGUATOR +# endif +#endif + +/* inline attribute */ +#ifndef SWIGINLINE +# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) +# define SWIGINLINE inline +# else +# define SWIGINLINE +# endif +#endif + +/* attribute recognised by some compilers to avoid 'unused' warnings */ +#ifndef SWIGUNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +# elif defined(__ICC) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +#endif + +#ifndef SWIG_MSC_UNSUPPRESS_4505 +# if defined(_MSC_VER) +# pragma warning(disable : 4505) /* unreferenced local function has been removed */ +# endif +#endif + +#ifndef SWIGUNUSEDPARM +# ifdef __cplusplus +# define SWIGUNUSEDPARM(p) +# else +# define SWIGUNUSEDPARM(p) p SWIGUNUSED +# endif +#endif + +/* internal SWIG method */ +#ifndef SWIGINTERN +# define SWIGINTERN static SWIGUNUSED +#endif + +/* internal inline SWIG method */ +#ifndef SWIGINTERNINLINE +# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE +#endif + +/* exporting methods */ +#if defined(__GNUC__) +# if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +# ifndef GCC_HASCLASSVISIBILITY +# define GCC_HASCLASSVISIBILITY +# endif +# endif +#endif + +#ifndef SWIGEXPORT +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# if defined(STATIC_LINKED) +# define SWIGEXPORT +# else +# define SWIGEXPORT __declspec(dllexport) +# endif +# else +# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) +# define SWIGEXPORT __attribute__ ((visibility("default"))) +# else +# define SWIGEXPORT +# endif +# endif +#endif + +/* calling conventions for Windows */ +#ifndef SWIGSTDCALL +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# define SWIGSTDCALL __stdcall +# else +# define SWIGSTDCALL +# endif +#endif + +/* Deal with Microsoft's attempt at deprecating C standard runtime functions */ +#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) +# define _CRT_SECURE_NO_DEPRECATE +#endif + +/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ +#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) +# define _SCL_SECURE_NO_DEPRECATE +#endif + +/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */ +#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES) +# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0 +#endif + +/* Intel's compiler complains if a variable which was never initialised is + * cast to void, which is a common idiom which we use to indicate that we + * are aware a variable isn't used. So we just silence that warning. + * See: https://github.com/swig/swig/issues/192 for more discussion. + */ +#ifdef __INTEL_COMPILER +# pragma warning disable 592 +#endif + + +#if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG) +/* Use debug wrappers with the Python release dll */ +# undef _DEBUG +# include +# define _DEBUG +#else +# include +#endif + +/* ----------------------------------------------------------------------------- + * swigrun.swg + * + * This file contains generic C API SWIG runtime support for pointer + * type checking. + * ----------------------------------------------------------------------------- */ + +/* This should only be incremented when either the layout of swig_type_info changes, + or for whatever reason, the runtime changes incompatibly */ +#define SWIG_RUNTIME_VERSION "4" + +/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ +#ifdef SWIG_TYPE_TABLE +# define SWIG_QUOTE_STRING(x) #x +# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x) +# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE) +#else +# define SWIG_TYPE_TABLE_NAME +#endif + +/* + You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for + creating a static or dynamic library from the SWIG runtime code. + In 99.9% of the cases, SWIG just needs to declare them as 'static'. + + But only do this if strictly necessary, ie, if you have problems + with your compiler or suchlike. +*/ + +#ifndef SWIGRUNTIME +# define SWIGRUNTIME SWIGINTERN +#endif + +#ifndef SWIGRUNTIMEINLINE +# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE +#endif + +/* Generic buffer size */ +#ifndef SWIG_BUFFER_SIZE +# define SWIG_BUFFER_SIZE 1024 +#endif + +/* Flags for pointer conversions */ +#define SWIG_POINTER_DISOWN 0x1 +#define SWIG_CAST_NEW_MEMORY 0x2 + +/* Flags for new pointer objects */ +#define SWIG_POINTER_OWN 0x1 + + +/* + Flags/methods for returning states. + + The SWIG conversion methods, as ConvertPtr, return an integer + that tells if the conversion was successful or not. And if not, + an error code can be returned (see swigerrors.swg for the codes). + + Use the following macros/flags to set or process the returning + states. + + In old versions of SWIG, code such as the following was usually written: + + if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { + // success code + } else { + //fail code + } + + Now you can be more explicit: + + int res = SWIG_ConvertPtr(obj,vptr,ty.flags); + if (SWIG_IsOK(res)) { + // success code + } else { + // fail code + } + + which is the same really, but now you can also do + + Type *ptr; + int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags); + if (SWIG_IsOK(res)) { + // success code + if (SWIG_IsNewObj(res) { + ... + delete *ptr; + } else { + ... + } + } else { + // fail code + } + + I.e., now SWIG_ConvertPtr can return new objects and you can + identify the case and take care of the deallocation. Of course that + also requires SWIG_ConvertPtr to return new result values, such as + + int SWIG_ConvertPtr(obj, ptr,...) { + if () { + if () { + *ptr = ; + return SWIG_NEWOBJ; + } else { + *ptr = ; + return SWIG_OLDOBJ; + } + } else { + return SWIG_BADOBJ; + } + } + + Of course, returning the plain '0(success)/-1(fail)' still works, but you can be + more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the + 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 + + int food(double) + int fooi(int); + + and you call + + food(1) // cast rank '1' (1 -> 1.0) + fooi(1) // cast rank '0' + + just use the SWIG_AddCast()/SWIG_CheckState() +*/ + +#define SWIG_OK (0) +#define SWIG_ERROR (-1) +#define SWIG_IsOK(r) (r >= 0) +#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError) + +/* The CastRankLimit says how many bits are used for the cast rank */ +#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 */ +#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 */ +#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)) +#define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r) +#define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r) +#define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK)) + +/* Cast-Rank Mode */ +#if defined(SWIG_CASTRANK_MODE) +# ifndef SWIG_TypeRank +# define SWIG_TypeRank unsigned long +# endif +# ifndef SWIG_MAXCASTRANK /* Default cast allowed */ +# define SWIG_MAXCASTRANK (2) +# endif +# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1) +# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK) +SWIGINTERNINLINE int SWIG_AddCast(int r) { + return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r; +} +SWIGINTERNINLINE int SWIG_CheckState(int r) { + return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; +} +#else /* no cast-rank mode */ +# define SWIG_AddCast(r) (r) +# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0) +#endif + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void *(*swig_converter_func)(void *, int *); +typedef struct swig_type_info *(*swig_dycast_func)(void **); + +/* Structure to store information on one type */ +typedef struct swig_type_info { + const char *name; /* mangled name of this type */ + const char *str; /* human readable name of this type */ + swig_dycast_func dcast; /* dynamic cast function down a hierarchy */ + struct swig_cast_info *cast; /* linked list of types that can cast into this type */ + void *clientdata; /* language specific type data */ + int owndata; /* flag if the structure owns the clientdata */ +} swig_type_info; + +/* Structure to store a type and conversion function used for casting */ +typedef struct swig_cast_info { + swig_type_info *type; /* pointer to type that is equivalent to this type */ + swig_converter_func converter; /* function to cast the void pointers */ + struct swig_cast_info *next; /* pointer to next cast in linked list */ + struct swig_cast_info *prev; /* pointer to the previous cast */ +} swig_cast_info; + +/* Structure used to store module information + * Each module generates one structure like this, and the runtime collects + * all of these structures and stores them in a circularly linked list.*/ +typedef struct swig_module_info { + swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */ + size_t size; /* Number of types in this module */ + struct swig_module_info *next; /* Pointer to next element in circularly linked list */ + swig_type_info **type_initial; /* Array of initially generated type structures */ + swig_cast_info **cast_initial; /* Array of initially generated casting structures */ + void *clientdata; /* Language specific module data */ +} swig_module_info; + +/* + Compare two type names skipping the space characters, therefore + "char*" == "char *" and "Class" == "Class", etc. + + Return 0 when the two name types are equivalent, as in + strncmp, but skipping ' '. +*/ +SWIGRUNTIME int +SWIG_TypeNameComp(const char *f1, const char *l1, + const char *f2, const char *l2) { + for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) { + while ((*f1 == ' ') && (f1 != l1)) ++f1; + while ((*f2 == ' ') && (f2 != l2)) ++f2; + if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1; + } + return (int)((l1 - f1) - (l2 - f2)); +} + +/* + Check type equivalence in a name list like ||... + Return 0 if equal, -1 if nb < tb, 1 if nb > tb +*/ +SWIGRUNTIME int +SWIG_TypeCmp(const char *nb, const char *tb) { + int equiv = 1; + const char* te = tb + strlen(tb); + const char* ne = nb; + while (equiv != 0 && *ne) { + for (nb = ne; *ne; ++ne) { + if (*ne == '|') break; + } + equiv = SWIG_TypeNameComp(nb, ne, tb, te); + if (*ne) ++ne; + } + return equiv; +} + +/* + Check type equivalence in a name list like ||... + Return 0 if not equal, 1 if equal +*/ +SWIGRUNTIME int +SWIG_TypeEquiv(const char *nb, const char *tb) { + return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0; +} + +/* + Check the typename +*/ +SWIGRUNTIME swig_cast_info * +SWIG_TypeCheck(const char *c, swig_type_info *ty) { + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (strcmp(iter->type->name, c) == 0) { + if (iter == ty->cast) + return iter; + /* Move iter to the top of the linked list */ + iter->prev->next = iter->next; + if (iter->next) + iter->next->prev = iter->prev; + iter->next = ty->cast; + iter->prev = 0; + if (ty->cast) ty->cast->prev = iter; + ty->cast = iter; + return iter; + } + iter = iter->next; + } + } + return 0; +} + +/* + 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) { + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (iter->type == from) { + if (iter == ty->cast) + return iter; + /* Move iter to the top of the linked list */ + iter->prev->next = iter->next; + if (iter->next) + iter->next->prev = iter->prev; + iter->next = ty->cast; + iter->prev = 0; + if (ty->cast) ty->cast->prev = iter; + ty->cast = iter; + return iter; + } + iter = iter->next; + } + } + return 0; +} + +/* + Cast a pointer up an inheritance hierarchy +*/ +SWIGRUNTIMEINLINE void * +SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) { + return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory); +} + +/* + Dynamic pointer casting. Down an inheritance hierarchy +*/ +SWIGRUNTIME swig_type_info * +SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) { + swig_type_info *lastty = ty; + if (!ty || !ty->dcast) return ty; + while (ty && (ty->dcast)) { + ty = (*ty->dcast)(ptr); + if (ty) lastty = ty; + } + return lastty; +} + +/* + Return the name associated with this type +*/ +SWIGRUNTIMEINLINE const char * +SWIG_TypeName(const swig_type_info *ty) { + return ty->name; +} + +/* + Return the pretty name associated with this type, + that is an unmangled type name in a form presentable to the user. +*/ +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. */ + if (!type) return NULL; + if (type->str != NULL) { + const char *last_name = type->str; + const char *s; + for (s = type->str; *s; s++) + if (*s == '|') last_name = s+1; + return last_name; + } + else + return type->name; +} + +/* + Set the clientdata field for a type +*/ +SWIGRUNTIME void +SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { + swig_cast_info *cast = ti->cast; + /* if (ti->clientdata == clientdata) return; */ + ti->clientdata = clientdata; + + while (cast) { + if (!cast->converter) { + swig_type_info *tc = cast->type; + if (!tc->clientdata) { + SWIG_TypeClientData(tc, clientdata); + } + } + cast = cast->next; + } +} +SWIGRUNTIME void +SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) { + SWIG_TypeClientData(ti, clientdata); + ti->owndata = 1; +} + +/* + Search for a swig_type_info structure only by mangled name + Search is a O(log #types) + + We start searching at module start, and finish searching when start == end. + Note: if start == end at the beginning of the function, we go all the way around + the circular list. +*/ +SWIGRUNTIME swig_type_info * +SWIG_MangledTypeQueryModule(swig_module_info *start, + swig_module_info *end, + const char *name) { + swig_module_info *iter = start; + do { + if (iter->size) { + size_t l = 0; + size_t r = iter->size - 1; + do { + /* since l+r >= 0, we can (>> 1) instead (/ 2) */ + size_t i = (l + r) >> 1; + const char *iname = iter->types[i]->name; + if (iname) { + int compare = strcmp(name, iname); + if (compare == 0) { + return iter->types[i]; + } else if (compare < 0) { + if (i) { + r = i - 1; + } else { + break; + } + } else if (compare > 0) { + l = i + 1; + } + } else { + break; /* should never happen */ + } + } while (l <= r); + } + iter = iter->next; + } while (iter != end); + return 0; +} + +/* + Search for a swig_type_info structure for either a mangled name or a human readable name. + It first searches the mangled names of the types, which is a O(log #types) + If a type is not found it then searches the human readable names, which is O(#types). + + We start searching at module start, and finish searching when start == end. + Note: if start == end at the beginning of the function, we go all the way around + the circular list. +*/ +SWIGRUNTIME swig_type_info * +SWIG_TypeQueryModule(swig_module_info *start, + swig_module_info *end, + const char *name) { + /* STEP 1: Search the name field using binary search */ + swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name); + if (ret) { + return ret; + } else { + /* STEP 2: If the type hasn't been found, do a complete search + of the str field (the human readable name) */ + swig_module_info *iter = start; + do { + size_t i = 0; + for (; i < iter->size; ++i) { + if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name))) + return iter->types[i]; + } + iter = iter->next; + } while (iter != end); + } + + /* neither found a match */ + return 0; +} + +/* + Pack binary data into a string +*/ +SWIGRUNTIME char * +SWIG_PackData(char *c, void *ptr, size_t sz) { + static const char hex[17] = "0123456789abcdef"; + const unsigned char *u = (unsigned char *) ptr; + const unsigned char *eu = u + sz; + for (; u != eu; ++u) { + unsigned char uu = *u; + *(c++) = hex[(uu & 0xf0) >> 4]; + *(c++) = hex[uu & 0xf]; + } + return c; +} + +/* + Unpack binary data from a string +*/ +SWIGRUNTIME const char * +SWIG_UnpackData(const char *c, void *ptr, size_t sz) { + unsigned char *u = (unsigned char *) ptr; + const unsigned char *eu = u + sz; + for (; u != eu; ++u) { + char d = *(c++); + unsigned char uu; + if ((d >= '0') && (d <= '9')) + uu = (unsigned char)((d - '0') << 4); + else if ((d >= 'a') && (d <= 'f')) + uu = (unsigned char)((d - ('a'-10)) << 4); + else + return (char *) 0; + d = *(c++); + if ((d >= '0') && (d <= '9')) + uu |= (unsigned char)(d - '0'); + else if ((d >= 'a') && (d <= 'f')) + uu |= (unsigned char)(d - ('a'-10)); + else + return (char *) 0; + *u = uu; + } + return c; +} + +/* + Pack 'void *' into a string buffer. +*/ +SWIGRUNTIME char * +SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) { + char *r = buff; + if ((2*sizeof(void *) + 2) > bsz) return 0; + *(r++) = '_'; + r = SWIG_PackData(r,&ptr,sizeof(void *)); + if (strlen(name) + 1 > (bsz - (r - buff))) return 0; + strcpy(r,name); + return buff; +} + +SWIGRUNTIME const char * +SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) { + if (*c != '_') { + if (strcmp(c,"NULL") == 0) { + *ptr = (void *) 0; + return name; + } else { + return 0; + } + } + return SWIG_UnpackData(++c,ptr,sizeof(void *)); +} + +SWIGRUNTIME char * +SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) { + char *r = buff; + size_t lname = (name ? strlen(name) : 0); + if ((2*sz + 2 + lname) > bsz) return 0; + *(r++) = '_'; + r = SWIG_PackData(r,ptr,sz); + if (lname) { + strncpy(r,name,lname+1); + } else { + *r = 0; + } + return buff; +} + +SWIGRUNTIME const char * +SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { + if (*c != '_') { + if (strcmp(c,"NULL") == 0) { + memset(ptr,0,sz); + return name; + } else { + return 0; + } + } + return SWIG_UnpackData(++c,ptr,sz); +} + +#ifdef __cplusplus +} +#endif + +/* Errors in SWIG */ +#define SWIG_UnknownError -1 +#define SWIG_IOError -2 +#define SWIG_RuntimeError -3 +#define SWIG_IndexError -4 +#define SWIG_TypeError -5 +#define SWIG_DivisionByZero -6 +#define SWIG_OverflowError -7 +#define SWIG_SyntaxError -8 +#define SWIG_ValueError -9 +#define SWIG_SystemError -10 +#define SWIG_AttributeError -11 +#define SWIG_MemoryError -12 +#define SWIG_NullReferenceError -13 + + + +/* Compatibility macros for Python 3 */ +#if PY_VERSION_HEX >= 0x03000000 + +#define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type) +#define PyInt_Check(x) PyLong_Check(x) +#define PyInt_AsLong(x) PyLong_AsLong(x) +#define PyInt_FromLong(x) PyLong_FromLong(x) +#define PyInt_FromSize_t(x) PyLong_FromSize_t(x) +#define PyString_Check(name) PyBytes_Check(name) +#define PyString_FromString(x) PyUnicode_FromString(x) +#define PyString_Format(fmt, args) PyUnicode_Format(fmt, args) +#define PyString_AsString(str) PyBytes_AsString(str) +#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 + +#ifndef Py_TYPE +# define Py_TYPE(op) ((op)->ob_type) +#endif + +/* SWIG APIs for compatibility of both Python 2 & 3 */ + +#if PY_VERSION_HEX >= 0x03000000 +# define SWIG_Python_str_FromFormat PyUnicode_FromFormat +#else +# define SWIG_Python_str_FromFormat PyString_FromFormat +#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 >= 0x03000000 + char *cstr; + char *newstr; + Py_ssize_t len; + str = PyUnicode_AsUTF8String(str); + PyBytes_AsStringAndSize(str, &cstr, &len); + newstr = (char *) malloc(len+1); + memcpy(newstr, cstr, len+1); + Py_XDECREF(str); + return newstr; +#else + return PyString_AsString(str); +#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) +{ +#if PY_VERSION_HEX >= 0x03000000 + return PyUnicode_FromString(c); +#else + return PyString_FromString(c); +#endif +} + +/* Add PyOS_snprintf for old Pythons */ +#if PY_VERSION_HEX < 0x02020000 +# if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM) +# define PyOS_snprintf _snprintf +# else +# define PyOS_snprintf snprintf +# endif +#endif + +/* A crude PyString_FromFormat implementation for old Pythons */ +#if PY_VERSION_HEX < 0x02020000 + +#ifndef SWIG_PYBUFFER_SIZE +# define SWIG_PYBUFFER_SIZE 1024 +#endif + +static PyObject * +PyString_FromFormat(const char *fmt, ...) { + va_list ap; + char buf[SWIG_PYBUFFER_SIZE * 2]; + int res; + va_start(ap, fmt); + res = vsnprintf(buf, sizeof(buf), fmt, ap); + va_end(ap); + return (res < 0 || res >= (int)sizeof(buf)) ? 0 : PyString_FromString(buf); +} +#endif + +#ifndef PyObject_DEL +# define PyObject_DEL PyObject_Del +#endif + +/* A crude PyExc_StopIteration exception for old Pythons */ +#if PY_VERSION_HEX < 0x02020000 +# ifndef PyExc_StopIteration +# define PyExc_StopIteration PyExc_RuntimeError +# endif +# ifndef PyObject_GenericGetAttr +# define PyObject_GenericGetAttr 0 +# endif +#endif + +/* Py_NotImplemented is defined in 2.1 and up. */ +#if PY_VERSION_HEX < 0x02010000 +# ifndef Py_NotImplemented +# define Py_NotImplemented PyExc_RuntimeError +# endif +#endif + +/* A crude PyString_AsStringAndSize implementation for old Pythons */ +#if PY_VERSION_HEX < 0x02010000 +# ifndef PyString_AsStringAndSize +# define PyString_AsStringAndSize(obj, s, len) {*s = PyString_AsString(obj); *len = *s ? strlen(*s) : 0;} +# endif +#endif + +/* PySequence_Size for old Pythons */ +#if PY_VERSION_HEX < 0x02000000 +# ifndef PySequence_Size +# define PySequence_Size PySequence_Length +# endif +#endif + +/* PyBool_FromLong for old Pythons */ +#if PY_VERSION_HEX < 0x02030000 +static +PyObject *PyBool_FromLong(long ok) +{ + PyObject *result = ok ? Py_True : Py_False; + Py_INCREF(result); + return result; +} +#endif + +/* Py_ssize_t for old Pythons */ +/* This code is as recommended by: */ +/* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */ +#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) +typedef int Py_ssize_t; +# define PY_SSIZE_T_MAX INT_MAX +# define PY_SSIZE_T_MIN INT_MIN +typedef inquiry lenfunc; +typedef intargfunc ssizeargfunc; +typedef intintargfunc ssizessizeargfunc; +typedef intobjargproc ssizeobjargproc; +typedef intintobjargproc ssizessizeobjargproc; +typedef getreadbufferproc readbufferproc; +typedef getwritebufferproc writebufferproc; +typedef getsegcountproc segcountproc; +typedef getcharbufferproc charbufferproc; +static long PyNumber_AsSsize_t (PyObject *x, void *SWIGUNUSEDPARM(exc)) +{ + long result = 0; + PyObject *i = PyNumber_Int(x); + if (i) { + result = PyInt_AsLong(i); + Py_DECREF(i); + } + return result; +} +#endif + +#if PY_VERSION_HEX < 0x02050000 +#define PyInt_FromSize_t(x) PyInt_FromLong((long)x) +#endif + +#if PY_VERSION_HEX < 0x02040000 +#define Py_VISIT(op) \ + do { \ + if (op) { \ + int vret = visit((op), arg); \ + if (vret) \ + return vret; \ + } \ + } while (0) +#endif + +#if PY_VERSION_HEX < 0x02030000 +typedef struct { + PyTypeObject type; + PyNumberMethods as_number; + PyMappingMethods as_mapping; + PySequenceMethods as_sequence; + PyBufferProcs as_buffer; + PyObject *name, *slots; +} PyHeapTypeObject; +#endif + +#if PY_VERSION_HEX < 0x02030000 +typedef destructor freefunc; +#endif + +#if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION > 6) || \ + (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION > 0) || \ + (PY_MAJOR_VERSION > 3)) +# define SWIGPY_USE_CAPSULE +# define SWIGPY_CAPSULE_NAME ((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME) +#endif + +#if PY_VERSION_HEX < 0x03020000 +#define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type) +#define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name) +#define Py_hash_t long +#endif + +/* ----------------------------------------------------------------------------- + * error manipulation + * ----------------------------------------------------------------------------- */ + +SWIGRUNTIME PyObject* +SWIG_Python_ErrorType(int code) { + PyObject* type = 0; + switch(code) { + case SWIG_MemoryError: + type = PyExc_MemoryError; + break; + case SWIG_IOError: + type = PyExc_IOError; + break; + case SWIG_RuntimeError: + type = PyExc_RuntimeError; + break; + case SWIG_IndexError: + type = PyExc_IndexError; + break; + case SWIG_TypeError: + type = PyExc_TypeError; + break; + case SWIG_DivisionByZero: + type = PyExc_ZeroDivisionError; + break; + case SWIG_OverflowError: + type = PyExc_OverflowError; + break; + case SWIG_SyntaxError: + type = PyExc_SyntaxError; + break; + case SWIG_ValueError: + type = PyExc_ValueError; + break; + case SWIG_SystemError: + type = PyExc_SystemError; + break; + case SWIG_AttributeError: + type = PyExc_AttributeError; + break; + default: + type = PyExc_RuntimeError; + } + return type; +} + + +SWIGRUNTIME void +SWIG_Python_AddErrorMsg(const char* mesg) +{ + PyObject *type = 0; + PyObject *value = 0; + PyObject *traceback = 0; + + if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback); + if (value) { + char *tmp; + PyObject *old_str = PyObject_Str(value); + PyErr_Clear(); + Py_XINCREF(type); + + PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); + SWIG_Python_str_DelForPy3(tmp); + Py_DECREF(old_str); + Py_DECREF(value); + } else { + PyErr_SetString(PyExc_RuntimeError, mesg); + } +} + +#if defined(SWIG_PYTHON_NO_THREADS) +# if defined(SWIG_PYTHON_THREADS) +# undef SWIG_PYTHON_THREADS +# endif +#endif +#if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */ +# if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL) +# if (PY_VERSION_HEX >= 0x02030000) /* For 2.3 or later, use the PyGILState calls */ +# define SWIG_PYTHON_USE_GIL +# endif +# endif +# if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */ +# ifndef SWIG_PYTHON_INITIALIZE_THREADS +# define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads() +# endif +# ifdef __cplusplus /* C++ code */ + class SWIG_Python_Thread_Block { + bool status; + PyGILState_STATE state; + public: + void end() { if (status) { PyGILState_Release(state); status = false;} } + SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {} + ~SWIG_Python_Thread_Block() { end(); } + }; + class SWIG_Python_Thread_Allow { + bool status; + PyThreadState *save; + public: + void end() { if (status) { PyEval_RestoreThread(save); status = false; }} + SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {} + ~SWIG_Python_Thread_Allow() { end(); } + }; +# define SWIG_PYTHON_THREAD_BEGIN_BLOCK SWIG_Python_Thread_Block _swig_thread_block +# define SWIG_PYTHON_THREAD_END_BLOCK _swig_thread_block.end() +# define SWIG_PYTHON_THREAD_BEGIN_ALLOW SWIG_Python_Thread_Allow _swig_thread_allow +# define SWIG_PYTHON_THREAD_END_ALLOW _swig_thread_allow.end() +# else /* C code */ +# define SWIG_PYTHON_THREAD_BEGIN_BLOCK PyGILState_STATE _swig_thread_block = PyGILState_Ensure() +# define SWIG_PYTHON_THREAD_END_BLOCK PyGILState_Release(_swig_thread_block) +# define SWIG_PYTHON_THREAD_BEGIN_ALLOW PyThreadState *_swig_thread_allow = PyEval_SaveThread() +# define SWIG_PYTHON_THREAD_END_ALLOW PyEval_RestoreThread(_swig_thread_allow) +# endif +# else /* Old thread way, not implemented, user must provide it */ +# if !defined(SWIG_PYTHON_INITIALIZE_THREADS) +# define SWIG_PYTHON_INITIALIZE_THREADS +# endif +# if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK) +# define SWIG_PYTHON_THREAD_BEGIN_BLOCK +# endif +# if !defined(SWIG_PYTHON_THREAD_END_BLOCK) +# define SWIG_PYTHON_THREAD_END_BLOCK +# endif +# if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW) +# define SWIG_PYTHON_THREAD_BEGIN_ALLOW +# endif +# if !defined(SWIG_PYTHON_THREAD_END_ALLOW) +# define SWIG_PYTHON_THREAD_END_ALLOW +# endif +# endif +#else /* No thread support */ +# define SWIG_PYTHON_INITIALIZE_THREADS +# define SWIG_PYTHON_THREAD_BEGIN_BLOCK +# define SWIG_PYTHON_THREAD_END_BLOCK +# define SWIG_PYTHON_THREAD_BEGIN_ALLOW +# define SWIG_PYTHON_THREAD_END_ALLOW +#endif + +/* ----------------------------------------------------------------------------- + * Python API portion that goes into the runtime + * ----------------------------------------------------------------------------- */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* ----------------------------------------------------------------------------- + * Constant declarations + * ----------------------------------------------------------------------------- */ + +/* Constant Types */ +#define SWIG_PY_POINTER 4 +#define SWIG_PY_BINARY 5 + +/* Constant information structure */ +typedef struct swig_const_info { + int type; + char *name; + long lvalue; + double dvalue; + void *pvalue; + swig_type_info **ptype; +} swig_const_info; + + +/* ----------------------------------------------------------------------------- + * Wrapper of PyInstanceMethod_New() used in Python 3 + * It is exported to the generated module, used for -fastproxy + * ----------------------------------------------------------------------------- */ +#if PY_VERSION_HEX >= 0x03000000 +SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) +{ + return PyInstanceMethod_New(func); +} +#else +SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *SWIGUNUSEDPARM(func)) +{ + return NULL; +} +#endif + +#ifdef __cplusplus +} +#endif + + +/* ----------------------------------------------------------------------------- + * pyrun.swg + * + * This file contains the runtime support for Python modules + * and includes code for managing global variables and pointer + * type checking. + * + * ----------------------------------------------------------------------------- */ + +/* Common SWIG API */ + +/* for raw pointers */ +#define SWIG_Python_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0) +#define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtr(obj, pptr, type, flags) +#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own) + +#ifdef SWIGPYTHON_BUILTIN +#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(self, ptr, type, flags) +#else +#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags) +#endif + +#define SWIG_InternalNewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags) + +#define SWIG_CheckImplicit(ty) SWIG_Python_CheckImplicit(ty) +#define SWIG_AcquirePtr(ptr, src) SWIG_Python_AcquirePtr(ptr, src) +#define swig_owntype int + +/* for raw packed data */ +#define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty) +#define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) + +/* for class or struct pointers */ +#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags) +#define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags) + +/* for C or C++ function pointers */ +#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_Python_ConvertFunctionPtr(obj, pptr, type) +#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Python_NewPointerObj(NULL, ptr, type, 0) + +/* for C++ member pointers, ie, member methods */ +#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty) +#define SWIG_NewMemberObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) + + +/* Runtime API */ + +#define SWIG_GetModule(clientdata) SWIG_Python_GetModule(clientdata) +#define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer) +#define SWIG_NewClientData(obj) SwigPyClientData_New(obj) + +#define SWIG_SetErrorObj SWIG_Python_SetErrorObj +#define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg +#define SWIG_ErrorType(code) SWIG_Python_ErrorType(code) +#define SWIG_Error(code, msg) SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg) +#define SWIG_fail goto fail + + +/* Runtime API implementation */ + +/* Error manipulation */ + +SWIGINTERN void +SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) { + SWIG_PYTHON_THREAD_BEGIN_BLOCK; + PyErr_SetObject(errtype, obj); + Py_DECREF(obj); + SWIG_PYTHON_THREAD_END_BLOCK; +} + +SWIGINTERN void +SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) { + SWIG_PYTHON_THREAD_BEGIN_BLOCK; + PyErr_SetString(errtype, msg); + SWIG_PYTHON_THREAD_END_BLOCK; +} + +#define SWIG_Python_Raise(obj, type, desc) SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj) + +/* Set a constant value */ + +#if defined(SWIGPYTHON_BUILTIN) + +SWIGINTERN void +SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) { + PyObject *s = PyString_InternFromString(key); + PyList_Append(seq, s); + Py_DECREF(s); +} + +SWIGINTERN void +SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) { +#if PY_VERSION_HEX < 0x02030000 + PyDict_SetItemString(d, (char *)name, obj); +#else + PyDict_SetItemString(d, name, obj); +#endif + Py_DECREF(obj); + if (public_interface) + SwigPyBuiltin_AddPublicSymbol(public_interface, name); +} + +#else + +SWIGINTERN void +SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) { +#if PY_VERSION_HEX < 0x02030000 + PyDict_SetItemString(d, (char *)name, obj); +#else + PyDict_SetItemString(d, name, obj); +#endif + Py_DECREF(obj); +} + +#endif + +/* Append a value to the result obj */ + +SWIGINTERN PyObject* +SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) { +#if !defined(SWIG_PYTHON_OUTPUT_TUPLE) + if (!result) { + result = obj; + } else if (result == Py_None) { + Py_DECREF(result); + result = obj; + } else { + if (!PyList_Check(result)) { + PyObject *o2 = result; + result = PyList_New(1); + PyList_SetItem(result, 0, o2); + } + PyList_Append(result,obj); + Py_DECREF(obj); + } + return result; +#else + PyObject* o2; + PyObject* o3; + if (!result) { + result = obj; + } else if (result == Py_None) { + Py_DECREF(result); + result = obj; + } else { + if (!PyTuple_Check(result)) { + o2 = result; + result = PyTuple_New(1); + PyTuple_SET_ITEM(result, 0, o2); + } + o3 = PyTuple_New(1); + PyTuple_SET_ITEM(o3, 0, obj); + o2 = result; + result = PySequence_Concat(o2, o3); + Py_DECREF(o2); + Py_DECREF(o3); + } + return result; +#endif +} + +/* Unpack the argument tuple */ + +SWIGINTERN Py_ssize_t +SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs) +{ + if (!args) { + if (!min && !max) { + return 1; + } else { + PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none", + name, (min == max ? "" : "at least "), (int)min); + return 0; + } + } + if (!PyTuple_Check(args)) { + if (min <= 1 && max >= 1) { + Py_ssize_t i; + objs[0] = args; + for (i = 1; i < max; ++i) { + objs[i] = 0; + } + return 2; + } + PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple"); + return 0; + } else { + Py_ssize_t l = PyTuple_GET_SIZE(args); + if (l < min) { + PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", + name, (min == max ? "" : "at least "), (int)min, (int)l); + return 0; + } else if (l > max) { + PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", + name, (min == max ? "" : "at most "), (int)max, (int)l); + return 0; + } else { + Py_ssize_t i; + for (i = 0; i < l; ++i) { + objs[i] = PyTuple_GET_ITEM(args, i); + } + for (; l < max; ++l) { + objs[l] = 0; + } + return i + 1; + } + } +} + +/* A functor is a function object with one single object argument */ +#if PY_VERSION_HEX >= 0x02020000 +#define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL); +#else +#define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunction(functor, "O", obj); +#endif + +/* + Helper for static pointer initialization for both C and C++ code, for example + static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...); +*/ +#ifdef __cplusplus +#define SWIG_STATIC_POINTER(var) var +#else +#define SWIG_STATIC_POINTER(var) var = 0; if (!var) var +#endif + +/* ----------------------------------------------------------------------------- + * Pointer declarations + * ----------------------------------------------------------------------------- */ + +/* Flags for new pointer objects */ +#define SWIG_POINTER_NOSHADOW (SWIG_POINTER_OWN << 1) +#define SWIG_POINTER_NEW (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN) + +#define SWIG_POINTER_IMPLICIT_CONV (SWIG_POINTER_DISOWN << 1) + +#define SWIG_BUILTIN_TP_INIT (SWIG_POINTER_OWN << 2) +#define SWIG_BUILTIN_INIT (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN) + +#ifdef __cplusplus +extern "C" { +#endif + +/* How to access Py_None */ +#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# ifndef SWIG_PYTHON_NO_BUILD_NONE +# ifndef SWIG_PYTHON_BUILD_NONE +# define SWIG_PYTHON_BUILD_NONE +# endif +# endif +#endif + +#ifdef SWIG_PYTHON_BUILD_NONE +# ifdef Py_None +# undef Py_None +# define Py_None SWIG_Py_None() +# endif +SWIGRUNTIMEINLINE PyObject * +_SWIG_Py_None(void) +{ + PyObject *none = Py_BuildValue((char*)""); + Py_DECREF(none); + return none; +} +SWIGRUNTIME PyObject * +SWIG_Py_None(void) +{ + static PyObject *SWIG_STATIC_POINTER(none) = _SWIG_Py_None(); + return none; +} +#endif + +/* The python void return value */ + +SWIGRUNTIMEINLINE PyObject * +SWIG_Py_Void(void) +{ + PyObject *none = Py_None; + Py_INCREF(none); + return none; +} + +/* SwigPyClientData */ + +typedef struct { + PyObject *klass; + PyObject *newraw; + PyObject *newargs; + PyObject *destroy; + int delargs; + int implicitconv; + PyTypeObject *pytype; +} SwigPyClientData; + +SWIGRUNTIMEINLINE int +SWIG_Python_CheckImplicit(swig_type_info *ty) +{ + SwigPyClientData *data = (SwigPyClientData *)ty->clientdata; + return data ? data->implicitconv : 0; +} + +SWIGRUNTIMEINLINE PyObject * +SWIG_Python_ExceptionType(swig_type_info *desc) { + SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0; + PyObject *klass = data ? data->klass : 0; + return (klass ? klass : PyExc_RuntimeError); +} + + +SWIGRUNTIME SwigPyClientData * +SwigPyClientData_New(PyObject* obj) +{ + if (!obj) { + return 0; + } else { + SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData)); + /* the klass element */ + data->klass = obj; + Py_INCREF(data->klass); + /* 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); + } else { +#if (PY_VERSION_HEX < 0x02020000) + data->newraw = 0; +#else + data->newraw = PyObject_GetAttrString(data->klass, (char *)"__new__"); +#endif + if (data->newraw) { + Py_INCREF(data->newraw); + data->newargs = PyTuple_New(1); + PyTuple_SetItem(data->newargs, 0, obj); + } else { + data->newargs = obj; + } + Py_INCREF(data->newargs); + } + /* the destroy method, aka as the C++ delete method */ + data->destroy = PyObject_GetAttrString(data->klass, (char *)"__swig_destroy__"); + if (PyErr_Occurred()) { + PyErr_Clear(); + data->destroy = 0; + } + if (data->destroy) { + int flags; + Py_INCREF(data->destroy); + flags = PyCFunction_GET_FLAGS(data->destroy); +#ifdef METH_O + data->delargs = !(flags & (METH_O)); +#else + data->delargs = 0; +#endif + } else { + data->delargs = 0; + } + data->implicitconv = 0; + data->pytype = 0; + return data; + } +} + +SWIGRUNTIME void +SwigPyClientData_Del(SwigPyClientData *data) { + Py_XDECREF(data->newraw); + Py_XDECREF(data->newargs); + Py_XDECREF(data->destroy); +} + +/* =============== SwigPyObject =====================*/ + +typedef struct { + PyObject_HEAD + void *ptr; + swig_type_info *ty; + int own; + PyObject *next; +#ifdef SWIGPYTHON_BUILTIN + PyObject *dict; +#endif +} SwigPyObject; + + +#ifdef SWIGPYTHON_BUILTIN + +SWIGRUNTIME PyObject * +SwigPyObject_get___dict__(PyObject *v, PyObject *SWIGUNUSEDPARM(args)) +{ + SwigPyObject *sobj = (SwigPyObject *)v; + + if (!sobj->dict) + sobj->dict = PyDict_New(); + + Py_INCREF(sobj->dict); + return sobj->dict; +} + +#endif + +SWIGRUNTIME PyObject * +SwigPyObject_long(SwigPyObject *v) +{ + return PyLong_FromVoidPtr(v->ptr); +} + +SWIGRUNTIME PyObject * +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); + if (ofmt) { +#if PY_VERSION_HEX >= 0x03000000 + res = PyUnicode_Format(ofmt,args); +#else + res = PyString_Format(ofmt,args); +#endif + Py_DECREF(ofmt); + } + Py_DECREF(args); + } + } + return res; +} + +SWIGRUNTIME PyObject * +SwigPyObject_oct(SwigPyObject *v) +{ + return SwigPyObject_format("%o",v); +} + +SWIGRUNTIME PyObject * +SwigPyObject_hex(SwigPyObject *v) +{ + return SwigPyObject_format("%x",v); +} + +SWIGRUNTIME PyObject * +#ifdef METH_NOARGS +SwigPyObject_repr(SwigPyObject *v) +#else +SwigPyObject_repr(SwigPyObject *v, PyObject *args) +#endif +{ + const char *name = SWIG_TypePrettyName(v->ty); + PyObject *repr = SWIG_Python_str_FromFormat("", (name ? name : "unknown"), (void *)v); + if (v->next) { +# ifdef METH_NOARGS + PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next); +# else + PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args); +# endif +# if PY_VERSION_HEX >= 0x03000000 + PyObject *joined = PyUnicode_Concat(repr, nrep); + Py_DecRef(repr); + Py_DecRef(nrep); + repr = joined; +# else + PyString_ConcatAndDel(&repr,nrep); +# endif + } + return repr; +} + +SWIGRUNTIME int +SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w) +{ + void *i = v->ptr; + void *j = w->ptr; + return (i < j) ? -1 : ((i > j) ? 1 : 0); +} + +/* Added for Python 3.x, would it also be useful for Python 2.x? */ +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; + } + res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0); + return res; +} + + +SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void); + +#ifdef SWIGPYTHON_BUILTIN +static swig_type_info *SwigPyObject_stype = 0; +SWIGRUNTIME PyTypeObject* +SwigPyObject_type(void) { + SwigPyClientData *cd; + assert(SwigPyObject_stype); + cd = (SwigPyClientData*) SwigPyObject_stype->clientdata; + assert(cd); + assert(cd->pytype); + return cd->pytype; +} +#else +SWIGRUNTIME PyTypeObject* +SwigPyObject_type(void) { + static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyObject_TypeOnce(); + return type; +} +#endif + +SWIGRUNTIMEINLINE int +SwigPyObject_Check(PyObject *op) { +#ifdef SWIGPYTHON_BUILTIN + PyTypeObject *target_tp = SwigPyObject_type(); + if (PyType_IsSubtype(op->ob_type, target_tp)) + return 1; + return (strcmp(op->ob_type->tp_name, "SwigPyObject") == 0); +#else + return (Py_TYPE(op) == SwigPyObject_type()) + || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0); +#endif +} + +SWIGRUNTIME PyObject * +SwigPyObject_New(void *ptr, swig_type_info *ty, int own); + +SWIGRUNTIME void +SwigPyObject_dealloc(PyObject *v) +{ + SwigPyObject *sobj = (SwigPyObject *) v; + PyObject *next = sobj->next; + if (sobj->own == SWIG_POINTER_OWN) { + swig_type_info *ty = sobj->ty; + SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; + PyObject *destroy = data ? data->destroy : 0; + if (destroy) { + /* destroy is always a VARARGS method */ + PyObject *res; + + /* PyObject_CallFunction() has the potential to silently drop + the active active exception. In cases of unnamed temporary + variable or where we just finished iterating over a generator + StopIteration will be active right now, and this needs to + remain true upon return from SwigPyObject_dealloc. So save + and restore. */ + + PyObject *val = NULL, *type = NULL, *tb = NULL; + PyErr_Fetch(&val, &type, &tb); + + 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); + } else { + PyCFunction meth = PyCFunction_GET_FUNCTION(destroy); + PyObject *mself = PyCFunction_GET_SELF(destroy); + res = ((*meth)(mself, v)); + } + if (!res) + PyErr_WriteUnraisable(destroy); + + PyErr_Restore(val, type, tb); + + Py_XDECREF(res); + } +#if !defined(SWIG_PYTHON_SILENT_MEMLEAK) + else { + const char *name = SWIG_TypePrettyName(ty); + printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown")); + } +#endif + } + Py_XDECREF(next); + PyObject_DEL(v); +} + +SWIGRUNTIME PyObject* +SwigPyObject_append(PyObject* v, PyObject* next) +{ + SwigPyObject *sobj = (SwigPyObject *) v; +#ifndef METH_O + PyObject *tmp = 0; + if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL; + next = tmp; +#endif + if (!SwigPyObject_Check(next)) { + PyErr_SetString(PyExc_TypeError, "Attempt to append a non SwigPyObject"); + return NULL; + } + sobj->next = next; + Py_INCREF(next); + return SWIG_Py_Void(); +} + +SWIGRUNTIME PyObject* +#ifdef METH_NOARGS +SwigPyObject_next(PyObject* v) +#else +SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) +#endif +{ + SwigPyObject *sobj = (SwigPyObject *) v; + if (sobj->next) { + Py_INCREF(sobj->next); + return sobj->next; + } else { + return SWIG_Py_Void(); + } +} + +SWIGINTERN PyObject* +#ifdef METH_NOARGS +SwigPyObject_disown(PyObject *v) +#else +SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) +#endif +{ + SwigPyObject *sobj = (SwigPyObject *)v; + sobj->own = 0; + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject* +#ifdef METH_NOARGS +SwigPyObject_acquire(PyObject *v) +#else +SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) +#endif +{ + SwigPyObject *sobj = (SwigPyObject *)v; + sobj->own = SWIG_POINTER_OWN; + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject* +SwigPyObject_own(PyObject *v, PyObject *args) +{ + PyObject *val = 0; +#if (PY_VERSION_HEX < 0x02020000) + if (!PyArg_ParseTuple(args,(char *)"|O:own",&val)) +#elif (PY_VERSION_HEX < 0x02050000) + if (!PyArg_UnpackTuple(args, (char *)"own", 0, 1, &val)) +#else + if (!PyArg_UnpackTuple(args, "own", 0, 1, &val)) +#endif + { + return NULL; + } + else + { + SwigPyObject *sobj = (SwigPyObject *)v; + PyObject *obj = PyBool_FromLong(sobj->own); + if (val) { +#ifdef METH_NOARGS + if (PyObject_IsTrue(val)) { + SwigPyObject_acquire(v); + } else { + SwigPyObject_disown(v); + } +#else + if (PyObject_IsTrue(val)) { + SwigPyObject_acquire(v,args); + } else { + SwigPyObject_disown(v,args); + } +#endif + } + return obj; + } +} + +#ifdef METH_O +static PyMethodDef +swigobject_methods[] = { + {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"}, + {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS, (char *)"acquires ownership of the pointer"}, + {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, + {(char *)"append", (PyCFunction)SwigPyObject_append, METH_O, (char *)"appends another 'this' object"}, + {(char *)"next", (PyCFunction)SwigPyObject_next, METH_NOARGS, (char *)"returns the next 'this' object"}, + {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_NOARGS, (char *)"returns object representation"}, + {0, 0, 0, 0} +}; +#else +static PyMethodDef +swigobject_methods[] = { + {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"}, + {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS, (char *)"acquires ownership of the pointer"}, + {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, + {(char *)"append", (PyCFunction)SwigPyObject_append, METH_VARARGS, (char *)"appends another 'this' object"}, + {(char *)"next", (PyCFunction)SwigPyObject_next, METH_VARARGS, (char *)"returns the next 'this' object"}, + {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_VARARGS, (char *)"returns object representation"}, + {0, 0, 0, 0} +}; +#endif + +#if PY_VERSION_HEX < 0x02020000 +SWIGINTERN PyObject * +SwigPyObject_getattr(SwigPyObject *sobj,char *name) +{ + return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name); +} +#endif + +SWIGRUNTIME PyTypeObject* +SwigPyObject_TypeOnce(void) { + static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer"; + + static PyNumberMethods SwigPyObject_as_number = { + (binaryfunc)0, /*nb_add*/ + (binaryfunc)0, /*nb_subtract*/ + (binaryfunc)0, /*nb_multiply*/ + /* nb_divide removed in Python 3 */ +#if PY_VERSION_HEX < 0x03000000 + (binaryfunc)0, /*nb_divide*/ +#endif + (binaryfunc)0, /*nb_remainder*/ + (binaryfunc)0, /*nb_divmod*/ + (ternaryfunc)0,/*nb_power*/ + (unaryfunc)0, /*nb_negative*/ + (unaryfunc)0, /*nb_positive*/ + (unaryfunc)0, /*nb_absolute*/ + (inquiry)0, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ +#if PY_VERSION_HEX < 0x03000000 + 0, /*nb_coerce*/ +#endif + (unaryfunc)SwigPyObject_long, /*nb_int*/ +#if PY_VERSION_HEX < 0x03000000 + (unaryfunc)SwigPyObject_long, /*nb_long*/ +#else + 0, /*nb_reserved*/ +#endif + (unaryfunc)0, /*nb_float*/ +#if PY_VERSION_HEX < 0x03000000 + (unaryfunc)SwigPyObject_oct, /*nb_oct*/ + (unaryfunc)SwigPyObject_hex, /*nb_hex*/ +#endif +#if PY_VERSION_HEX >= 0x03050000 /* 3.5 */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_matrix_multiply */ +#elif PY_VERSION_HEX >= 0x03000000 /* 3.0 */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */ +#elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */ +#elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */ +#elif PY_VERSION_HEX >= 0x02000000 /* 2.0.0 */ + 0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_or */ +#endif + }; + + static PyTypeObject swigpyobject_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 + (char *)"SwigPyObject", /* tp_name */ + sizeof(SwigPyObject), /* tp_basicsize */ + 0, /* tp_itemsize */ + (destructor)SwigPyObject_dealloc, /* tp_dealloc */ + 0, /* tp_print */ +#if PY_VERSION_HEX < 0x02020000 + (getattrfunc)SwigPyObject_getattr, /* tp_getattr */ +#else + (getattrfunc)0, /* tp_getattr */ +#endif + (setattrfunc)0, /* tp_setattr */ +#if PY_VERSION_HEX >= 0x03000000 + 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */ +#else + (cmpfunc)SwigPyObject_compare, /* tp_compare */ +#endif + (reprfunc)SwigPyObject_repr, /* tp_repr */ + &SwigPyObject_as_number, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + (hashfunc)0, /* tp_hash */ + (ternaryfunc)0, /* tp_call */ + 0, /* tp_str */ + PyObject_GenericGetAttr, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT, /* tp_flags */ + swigobject_doc, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + (richcmpfunc)SwigPyObject_richcompare,/* tp_richcompare */ + 0, /* tp_weaklistoffset */ +#if PY_VERSION_HEX >= 0x02020000 + 0, /* tp_iter */ + 0, /* tp_iternext */ + swigobject_methods, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + 0, /* tp_free */ + 0, /* tp_is_gc */ + 0, /* tp_bases */ + 0, /* tp_mro */ + 0, /* tp_cache */ + 0, /* tp_subclasses */ + 0, /* tp_weaklist */ +#endif +#if PY_VERSION_HEX >= 0x02030000 + 0, /* tp_del */ +#endif +#if PY_VERSION_HEX >= 0x02060000 + 0, /* tp_version_tag */ +#endif +#if PY_VERSION_HEX >= 0x03040000 + 0, /* tp_finalize */ +#endif +#ifdef COUNT_ALLOCS + 0, /* tp_allocs */ + 0, /* tp_frees */ + 0, /* tp_maxalloc */ +#if PY_VERSION_HEX >= 0x02050000 + 0, /* tp_prev */ +#endif + 0 /* tp_next */ +#endif + }; + swigpyobject_type = tmp; + type_init = 1; +#if PY_VERSION_HEX < 0x02020000 + swigpyobject_type.ob_type = &PyType_Type; +#else + if (PyType_Ready(&swigpyobject_type) < 0) + return NULL; +#endif + } + return &swigpyobject_type; +} + +SWIGRUNTIME PyObject * +SwigPyObject_New(void *ptr, swig_type_info *ty, int own) +{ + SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type()); + if (sobj) { + sobj->ptr = ptr; + sobj->ty = ty; + sobj->own = own; + sobj->next = 0; + } + return (PyObject *)sobj; +} + +/* ----------------------------------------------------------------------------- + * Implements a simple Swig Packed type, and use it instead of string + * ----------------------------------------------------------------------------- */ + +typedef struct { + PyObject_HEAD + void *pack; + swig_type_info *ty; + size_t size; +} SwigPyPacked; + +SWIGRUNTIME int +SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags)) +{ + char result[SWIG_BUFFER_SIZE]; + fputs("pack, v->size, 0, sizeof(result))) { + fputs("at ", fp); + fputs(result, fp); + } + fputs(v->ty->name,fp); + fputs(">", fp); + return 0; +} + +SWIGRUNTIME PyObject * +SwigPyPacked_repr(SwigPyPacked *v) +{ + char result[SWIG_BUFFER_SIZE]; + if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) { + return SWIG_Python_str_FromFormat("", result, v->ty->name); + } else { + return SWIG_Python_str_FromFormat("", v->ty->name); + } +} + +SWIGRUNTIME PyObject * +SwigPyPacked_str(SwigPyPacked *v) +{ + char result[SWIG_BUFFER_SIZE]; + if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){ + return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name); + } else { + return SWIG_Python_str_FromChar(v->ty->name); + } +} + +SWIGRUNTIME int +SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w) +{ + size_t i = v->size; + size_t j = w->size; + int s = (i < j) ? -1 : ((i > j) ? 1 : 0); + return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size); +} + +SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void); + +SWIGRUNTIME PyTypeObject* +SwigPyPacked_type(void) { + static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyPacked_TypeOnce(); + return type; +} + +SWIGRUNTIMEINLINE int +SwigPyPacked_Check(PyObject *op) { + return ((op)->ob_type == SwigPyPacked_TypeOnce()) + || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0); +} + +SWIGRUNTIME void +SwigPyPacked_dealloc(PyObject *v) +{ + if (SwigPyPacked_Check(v)) { + SwigPyPacked *sobj = (SwigPyPacked *) v; + free(sobj->pack); + } + PyObject_DEL(v); +} + +SWIGRUNTIME PyTypeObject* +SwigPyPacked_TypeOnce(void) { + static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer"; + static PyTypeObject swigpypacked_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 + (char *)"SwigPyPacked", /* tp_name */ + sizeof(SwigPyPacked), /* tp_basicsize */ + 0, /* tp_itemsize */ + (destructor)SwigPyPacked_dealloc, /* tp_dealloc */ + (printfunc)SwigPyPacked_print, /* tp_print */ + (getattrfunc)0, /* tp_getattr */ + (setattrfunc)0, /* tp_setattr */ +#if PY_VERSION_HEX>=0x03000000 + 0, /* tp_reserved in 3.0.1 */ +#else + (cmpfunc)SwigPyPacked_compare, /* tp_compare */ +#endif + (reprfunc)SwigPyPacked_repr, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + (hashfunc)0, /* tp_hash */ + (ternaryfunc)0, /* tp_call */ + (reprfunc)SwigPyPacked_str, /* tp_str */ + PyObject_GenericGetAttr, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT, /* tp_flags */ + swigpacked_doc, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ +#if PY_VERSION_HEX >= 0x02020000 + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + 0, /* tp_free */ + 0, /* tp_is_gc */ + 0, /* tp_bases */ + 0, /* tp_mro */ + 0, /* tp_cache */ + 0, /* tp_subclasses */ + 0, /* tp_weaklist */ +#endif +#if PY_VERSION_HEX >= 0x02030000 + 0, /* tp_del */ +#endif +#if PY_VERSION_HEX >= 0x02060000 + 0, /* tp_version_tag */ +#endif +#if PY_VERSION_HEX >= 0x03040000 + 0, /* tp_finalize */ +#endif +#ifdef COUNT_ALLOCS + 0, /* tp_allocs */ + 0, /* tp_frees */ + 0, /* tp_maxalloc */ +#if PY_VERSION_HEX >= 0x02050000 + 0, /* tp_prev */ +#endif + 0 /* tp_next */ +#endif + }; + swigpypacked_type = tmp; + type_init = 1; +#if PY_VERSION_HEX < 0x02020000 + swigpypacked_type.ob_type = &PyType_Type; +#else + if (PyType_Ready(&swigpypacked_type) < 0) + return NULL; +#endif + } + return &swigpypacked_type; +} + +SWIGRUNTIME PyObject * +SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty) +{ + SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type()); + if (sobj) { + void *pack = malloc(size); + if (pack) { + memcpy(pack, ptr, size); + sobj->pack = pack; + sobj->ty = ty; + sobj->size = size; + } else { + PyObject_DEL((PyObject *) sobj); + sobj = 0; + } + } + return (PyObject *) sobj; +} + +SWIGRUNTIME swig_type_info * +SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size) +{ + if (SwigPyPacked_Check(obj)) { + SwigPyPacked *sobj = (SwigPyPacked *)obj; + if (sobj->size != size) return 0; + memcpy(ptr, sobj->pack, size); + return sobj->ty; + } else { + return 0; + } +} + +/* ----------------------------------------------------------------------------- + * pointers/data manipulation + * ----------------------------------------------------------------------------- */ + +SWIGRUNTIMEINLINE PyObject * +_SWIG_This(void) +{ + return SWIG_Python_str_FromChar("this"); +} + +static PyObject *swig_this = NULL; + +SWIGRUNTIME PyObject * +SWIG_This(void) +{ + if (swig_this == NULL) + swig_this = _SWIG_This(); + return swig_this; +} + +/* #define SWIG_PYTHON_SLOW_GETSET_THIS */ + +/* TODO: I don't know how to implement the fast getset in Python 3 right now */ +#if PY_VERSION_HEX>=0x03000000 +#define SWIG_PYTHON_SLOW_GETSET_THIS +#endif + +SWIGRUNTIME SwigPyObject * +SWIG_Python_GetSwigThis(PyObject *pyobj) +{ + PyObject *obj; + + if (SwigPyObject_Check(pyobj)) + return (SwigPyObject *) pyobj; + +#ifdef SWIGPYTHON_BUILTIN + (void)obj; +# ifdef PyWeakref_CheckProxy + if (PyWeakref_CheckProxy(pyobj)) { + pyobj = PyWeakref_GET_OBJECT(pyobj); + if (pyobj && SwigPyObject_Check(pyobj)) + return (SwigPyObject*) pyobj; + } +# endif + return NULL; +#else + + obj = 0; + +#if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000)) + if (PyInstance_Check(pyobj)) { + obj = _PyInstance_Lookup(pyobj, SWIG_This()); + } else { + PyObject **dictptr = _PyObject_GetDictPtr(pyobj); + if (dictptr != NULL) { + PyObject *dict = *dictptr; + obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0; + } else { +#ifdef PyWeakref_CheckProxy + if (PyWeakref_CheckProxy(pyobj)) { + PyObject *wobj = PyWeakref_GET_OBJECT(pyobj); + return wobj ? SWIG_Python_GetSwigThis(wobj) : 0; + } +#endif + obj = PyObject_GetAttr(pyobj,SWIG_This()); + if (obj) { + Py_DECREF(obj); + } else { + if (PyErr_Occurred()) PyErr_Clear(); + return 0; + } + } + } +#else + obj = PyObject_GetAttr(pyobj,SWIG_This()); + if (obj) { + Py_DECREF(obj); + } else { + if (PyErr_Occurred()) PyErr_Clear(); + return 0; + } +#endif + if (obj && !SwigPyObject_Check(obj)) { + /* a PyObject is called 'this', try to get the 'real this' + SwigPyObject from it */ + return SWIG_Python_GetSwigThis(obj); + } + return (SwigPyObject *)obj; +#endif +} + +/* Acquire a pointer value */ + +SWIGRUNTIME int +SWIG_Python_AcquirePtr(PyObject *obj, int own) { + if (own == SWIG_POINTER_OWN) { + SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj); + if (sobj) { + int oldown = sobj->own; + sobj->own = own; + return oldown; + } + } + return 0; +} + +/* Convert a pointer value */ + +SWIGRUNTIME int +SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) { + int res; + SwigPyObject *sobj; + int implicit_conv = (flags & SWIG_POINTER_IMPLICIT_CONV) != 0; + + if (!obj) + return SWIG_ERROR; + if (obj == Py_None && !implicit_conv) { + if (ptr) + *ptr = 0; + return SWIG_OK; + } + + res = SWIG_ERROR; + + sobj = SWIG_Python_GetSwigThis(obj); + if (own) + *own = 0; + while (sobj) { + void *vptr = sobj->ptr; + if (ty) { + swig_type_info *to = sobj->ty; + if (to == ty) { + /* no type cast needed */ + if (ptr) *ptr = vptr; + break; + } else { + swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); + if (!tc) { + sobj = (SwigPyObject *)sobj->next; + } else { + if (ptr) { + int newmemory = 0; + *ptr = SWIG_TypeCast(tc,vptr,&newmemory); + if (newmemory == SWIG_CAST_NEW_MEMORY) { + assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */ + if (own) + *own = *own | SWIG_CAST_NEW_MEMORY; + } + } + break; + } + } + } else { + if (ptr) *ptr = vptr; + break; + } + } + if (sobj) { + if (own) + *own = *own | sobj->own; + if (flags & SWIG_POINTER_DISOWN) { + sobj->own = 0; + } + res = SWIG_OK; + } else { + if (implicit_conv) { + SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; + if (data && !data->implicitconv) { + PyObject *klass = data->klass; + if (klass) { + PyObject *impconv; + data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/ + impconv = SWIG_Python_CallFunctor(klass, obj); + data->implicitconv = 0; + if (PyErr_Occurred()) { + PyErr_Clear(); + impconv = 0; + } + if (impconv) { + SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv); + if (iobj) { + void *vptr; + res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0); + if (SWIG_IsOK(res)) { + if (ptr) { + *ptr = vptr; + /* transfer the ownership to 'ptr' */ + iobj->own = 0; + res = SWIG_AddCast(res); + res = SWIG_AddNewMask(res); + } else { + res = SWIG_AddCast(res); + } + } + } + Py_DECREF(impconv); + } + } + } + } + if (!SWIG_IsOK(res) && obj == Py_None) { + if (ptr) + *ptr = 0; + if (PyErr_Occurred()) + PyErr_Clear(); + res = SWIG_OK; + } + } + return res; +} + +/* Convert a function ptr value */ + +SWIGRUNTIME int +SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) { + if (!PyCFunction_Check(obj)) { + return SWIG_ConvertPtr(obj, ptr, ty, 0); + } else { + void *vptr = 0; + + /* here we get the method pointer for callbacks */ + const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); + const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0; + if (desc) + desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0; + if (!desc) + return SWIG_ERROR; + if (ty) { + swig_cast_info *tc = SWIG_TypeCheck(desc,ty); + if (tc) { + int newmemory = 0; + *ptr = SWIG_TypeCast(tc,vptr,&newmemory); + assert(!newmemory); /* newmemory handling not yet implemented */ + } else { + return SWIG_ERROR; + } + } else { + *ptr = vptr; + } + return SWIG_OK; + } +} + +/* Convert a packed value value */ + +SWIGRUNTIME int +SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) { + swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz); + if (!to) return SWIG_ERROR; + if (ty) { + if (to != ty) { + /* check type cast? */ + swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); + if (!tc) return SWIG_ERROR; + } + } + return SWIG_OK; +} + +/* ----------------------------------------------------------------------------- + * Create a new pointer object + * ----------------------------------------------------------------------------- */ + +/* + Create a new instance object, without calling __init__, and set the + 'this' attribute. +*/ + +SWIGRUNTIME PyObject* +SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) +{ +#if (PY_VERSION_HEX >= 0x02020000) + PyObject *inst = 0; + PyObject *newraw = data->newraw; + if (newraw) { + inst = PyObject_Call(newraw, data->newargs, NULL); + if (inst) { +#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); + } + } +#else + PyObject *key = SWIG_This(); + PyObject_SetAttr(inst, key, swig_this); +#endif + } + } else { +#if PY_VERSION_HEX >= 0x03000000 + inst = ((PyTypeObject*) data->newargs)->tp_new((PyTypeObject*) data->newargs, Py_None, Py_None); + if (inst) { + PyObject_SetAttr(inst, SWIG_This(), swig_this); + Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG; + } +#else + PyObject *dict = PyDict_New(); + if (dict) { + PyDict_SetItem(dict, SWIG_This(), swig_this); + inst = PyInstance_NewRaw(data->newargs, dict); + Py_DECREF(dict); + } +#endif + } + return inst; +#else +#if (PY_VERSION_HEX >= 0x02010000) + PyObject *inst = 0; + PyObject *dict = PyDict_New(); + if (dict) { + PyDict_SetItem(dict, SWIG_This(), swig_this); + inst = PyInstance_NewRaw(data->newargs, dict); + Py_DECREF(dict); + } + return (PyObject *) inst; +#else + PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type); + if (inst == NULL) { + return NULL; + } + inst->in_class = (PyClassObject *)data->newargs; + Py_INCREF(inst->in_class); + inst->in_dict = PyDict_New(); + if (inst->in_dict == NULL) { + Py_DECREF(inst); + return NULL; + } +#ifdef Py_TPFLAGS_HAVE_WEAKREFS + inst->in_weakreflist = NULL; +#endif +#ifdef Py_TPFLAGS_GC + PyObject_GC_Init(inst); +#endif + PyDict_SetItem(inst->in_dict, SWIG_This(), swig_this); + return (PyObject *) inst; +#endif +#endif +} + +SWIGRUNTIME void +SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this) +{ + PyObject *dict; +#if (PY_VERSION_HEX >= 0x02020000) && !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; + } +#endif + dict = PyObject_GetAttrString(inst, (char*)"__dict__"); + PyDict_SetItem(dict, SWIG_This(), swig_this); + Py_DECREF(dict); +} + + +SWIGINTERN PyObject * +SWIG_Python_InitShadowInstance(PyObject *args) { + PyObject *obj[2]; + if (!SWIG_Python_UnpackTuple(args, "swiginit", 2, 2, obj)) { + return NULL; + } else { + SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]); + if (sthis) { + SwigPyObject_append((PyObject*) sthis, obj[1]); + } else { + SWIG_Python_SetSwigThis(obj[0], obj[1]); + } + return SWIG_Py_Void(); + } +} + +/* Create a new pointer object */ + +SWIGRUNTIME PyObject * +SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags) { + SwigPyClientData *clientdata; + PyObject * robj; + int own; + + if (!ptr) + return SWIG_Py_Void(); + + clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0; + own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0; + if (clientdata && clientdata->pytype) { + SwigPyObject *newobj; + if (flags & SWIG_BUILTIN_TP_INIT) { + newobj = (SwigPyObject*) self; + if (newobj->ptr) { + PyObject *next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0); + while (newobj->next) + newobj = (SwigPyObject *) newobj->next; + newobj->next = next_self; + newobj = (SwigPyObject *)next_self; +#ifdef SWIGPYTHON_BUILTIN + newobj->dict = 0; +#endif + } + } else { + newobj = PyObject_New(SwigPyObject, clientdata->pytype); +#ifdef SWIGPYTHON_BUILTIN + newobj->dict = 0; +#endif + } + if (newobj) { + newobj->ptr = ptr; + newobj->ty = type; + newobj->own = own; + newobj->next = 0; + return (PyObject*) newobj; + } + return SWIG_Py_Void(); + } + + assert(!(flags & SWIG_BUILTIN_TP_INIT)); + + robj = SwigPyObject_New(ptr, type, own); + if (robj && clientdata && !(flags & SWIG_POINTER_NOSHADOW)) { + PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj); + Py_DECREF(robj); + robj = inst; + } + return robj; +} + +/* Create a new packed object */ + +SWIGRUNTIMEINLINE PyObject * +SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) { + return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void(); +} + +/* -----------------------------------------------------------------------------* + * Get type list + * -----------------------------------------------------------------------------*/ + +#ifdef SWIG_LINK_RUNTIME +void *SWIG_ReturnGlobalTypeList(void *); +#endif + +SWIGRUNTIME swig_module_info * +SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata)) { + 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 +# ifdef SWIGPY_USE_CAPSULE + type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0); +# else + type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, + (char*)"type_pointer" SWIG_TYPE_TABLE_NAME); +# endif + if (PyErr_Occurred()) { + PyErr_Clear(); + type_pointer = (void *)0; + } +#endif + } + return (swig_module_info *) type_pointer; +} + +#if PY_MAJOR_VERSION < 2 +/* PyModule_AddObject function was introduced in Python 2.0. The following function + is copied out of Python/modsupport.c in python version 2.3.4 */ +SWIGINTERN int +PyModule_AddObject(PyObject *m, char *name, PyObject *o) +{ + PyObject *dict; + if (!PyModule_Check(m)) { + PyErr_SetString(PyExc_TypeError, "PyModule_AddObject() needs module as first arg"); + return SWIG_ERROR; + } + if (!o) { + PyErr_SetString(PyExc_TypeError, "PyModule_AddObject() needs non-NULL value"); + return SWIG_ERROR; + } + + dict = PyModule_GetDict(m); + if (dict == NULL) { + /* Internal error -- modules must have a dict! */ + PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__", + PyModule_GetName(m)); + return SWIG_ERROR; + } + if (PyDict_SetItemString(dict, name, o)) + return SWIG_ERROR; + Py_DECREF(o); + return SWIG_OK; +} +#endif + +SWIGRUNTIME void +#ifdef SWIGPY_USE_CAPSULE +SWIG_Python_DestroyModule(PyObject *obj) +#else +SWIG_Python_DestroyModule(void *vptr) +#endif +{ +#ifdef SWIGPY_USE_CAPSULE + swig_module_info *swig_module = (swig_module_info *) PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME); +#else + swig_module_info *swig_module = (swig_module_info *) vptr; +#endif + swig_type_info **types = swig_module->types; + size_t i; + for (i =0; i < swig_module->size; ++i) { + swig_type_info *ty = types[i]; + if (ty->owndata) { + SwigPyClientData *data = (SwigPyClientData *) ty->clientdata; + if (data) SwigPyClientData_Del(data); + } + } + Py_DECREF(SWIG_This()); + swig_this = NULL; +} + +SWIGRUNTIME void +SWIG_Python_SetModule(swig_module_info *swig_module) { +#if PY_VERSION_HEX >= 0x03000000 + /* Add a dummy module object into sys.modules */ + PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION); +#else + static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} }; /* Sentinel */ + PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table); +#endif +#ifdef SWIGPY_USE_CAPSULE + PyObject *pointer = PyCapsule_New((void *) swig_module, SWIGPY_CAPSULE_NAME, SWIG_Python_DestroyModule); + if (pointer && module) { + PyModule_AddObject(module, (char*)"type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer); + } else { + Py_XDECREF(pointer); + } +#else + PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule); + if (pointer && module) { + PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer); + } else { + Py_XDECREF(pointer); + } +#endif +} + +/* 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) +{ + PyObject *cache = SWIG_Python_TypeCache(); + PyObject *key = SWIG_Python_str_FromChar(type); + PyObject *obj = PyDict_GetItem(cache, key); + swig_type_info *descriptor; + if (obj) { +#ifdef SWIGPY_USE_CAPSULE + descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, NULL); +#else + descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj); +#endif + } else { + swig_module_info *swig_module = SWIG_GetModule(0); + descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type); + if (descriptor) { +#ifdef SWIGPY_USE_CAPSULE + obj = PyCapsule_New((void*) descriptor, NULL, NULL); +#else + obj = PyCObject_FromVoidPtr(descriptor, NULL); +#endif + PyDict_SetItem(cache, key, obj); + Py_DECREF(obj); + } + } + Py_DECREF(key); + return descriptor; +} + +/* + For backward compatibility only +*/ +#define SWIG_POINTER_EXCEPTION 0 +#define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg) +#define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags) + +SWIGRUNTIME int +SWIG_Python_AddErrMesg(const char* mesg, int infront) +{ + if (PyErr_Occurred()) { + PyObject *type = 0; + PyObject *value = 0; + PyObject *traceback = 0; + PyErr_Fetch(&type, &value, &traceback); + if (value) { + char *tmp; + PyObject *old_str = PyObject_Str(value); + Py_XINCREF(type); + PyErr_Clear(); + if (infront) { + PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str)); + } else { + PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); + } + SWIG_Python_str_DelForPy3(tmp); + Py_DECREF(old_str); + } + return 1; + } else { + return 0; + } +} + +SWIGRUNTIME int +SWIG_Python_ArgFail(int argnum) +{ + if (PyErr_Occurred()) { + /* add information about failing argument */ + char mesg[256]; + PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum); + return SWIG_Python_AddErrMesg(mesg, 1); + } else { + return 0; + } +} + +SWIGRUNTIMEINLINE const char * +SwigPyObject_GetDesc(PyObject *self) +{ + SwigPyObject *v = (SwigPyObject *)self; + swig_type_info *ty = v ? v->ty : 0; + return ty ? ty->str : ""; +} + +SWIGRUNTIME void +SWIG_Python_TypeError(const char *type, PyObject *obj) +{ + if (type) { +#if defined(SWIG_COBJECT_TYPES) + if (obj && SwigPyObject_Check(obj)) { + const char *otype = (const char *) SwigPyObject_GetDesc(obj); + if (otype) { + PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received", + type, otype); + return; + } + } else +#endif + { + 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; + 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(str); + return; + } + } + PyErr_Format(PyExc_TypeError, "a '%s' is expected", type); + } else { + PyErr_Format(PyExc_TypeError, "unexpected type is received"); + } +} + + +/* Convert a pointer value, signal an exception on a type mismatch */ +SWIGRUNTIME void * +SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags) { + 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; +} + +#ifdef SWIGPYTHON_BUILTIN +SWIGRUNTIME int +SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { + PyTypeObject *tp = obj->ob_type; + PyObject *descr; + PyObject *encoded_name; + descrsetfunc f; + int res = -1; + +# ifdef Py_USING_UNICODE + if (PyString_Check(name)) { + name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL); + if (!name) + return -1; + } else if (!PyUnicode_Check(name)) +# else + if (!PyString_Check(name)) +# endif + { + PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name); + return -1; + } else { + Py_INCREF(name); + } + + if (!tp->tp_dict) { + if (PyType_Ready(tp) < 0) + goto done; + } + + descr = _PyType_Lookup(tp, name); + f = NULL; + if (descr != NULL) + f = descr->ob_type->tp_descr_set; + if (!f) { + if (PyString_Check(name)) { + encoded_name = name; + Py_INCREF(name); + } else { + encoded_name = PyUnicode_AsUTF8String(name); + } + PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name)); + Py_DECREF(encoded_name); + } else { + res = f(descr, obj, value); + } + + done: + Py_DECREF(name); + return res; +} +#endif + + +#ifdef __cplusplus +} +#endif + + + +#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 + + + + #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0) + + +/* -------- TYPES TABLE (BEGIN) -------- */ + +#define SWIGTYPE_p_blpapi_AbstractSession swig_types[0] +#define SWIGTYPE_p_blpapi_Constant swig_types[1] +#define SWIGTYPE_p_blpapi_ConstantList swig_types[2] +#define SWIGTYPE_p_blpapi_CorrelationId_t_ swig_types[3] +#define SWIGTYPE_p_blpapi_CorrelationId_t__value swig_types[4] +#define SWIGTYPE_p_blpapi_Datetime_tag swig_types[5] +#define SWIGTYPE_p_blpapi_Element swig_types[6] +#define SWIGTYPE_p_blpapi_Event swig_types[7] +#define SWIGTYPE_p_blpapi_EventDispatcher swig_types[8] +#define SWIGTYPE_p_blpapi_EventFormatter swig_types[9] +#define SWIGTYPE_p_blpapi_EventQueue swig_types[10] +#define SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag swig_types[11] +#define SWIGTYPE_p_blpapi_Identity swig_types[12] +#define SWIGTYPE_p_blpapi_Logging_Func_t swig_types[13] +#define SWIGTYPE_p_blpapi_Logging_Severity_t swig_types[14] +#define SWIGTYPE_p_blpapi_ManagedPtr_t_ swig_types[15] +#define SWIGTYPE_p_blpapi_Message swig_types[16] +#define SWIGTYPE_p_blpapi_MessageIterator swig_types[17] +#define SWIGTYPE_p_blpapi_Name swig_types[18] +#define SWIGTYPE_p_blpapi_Operation swig_types[19] +#define SWIGTYPE_p_blpapi_ProviderSession swig_types[20] +#define SWIGTYPE_p_blpapi_Request swig_types[21] +#define SWIGTYPE_p_blpapi_RequestTemplate swig_types[22] +#define SWIGTYPE_p_blpapi_ResolutionList swig_types[23] +#define SWIGTYPE_p_blpapi_Service swig_types[24] +#define SWIGTYPE_p_blpapi_ServiceRegistrationOptions swig_types[25] +#define SWIGTYPE_p_blpapi_Session swig_types[26] +#define SWIGTYPE_p_blpapi_SessionOptions swig_types[27] +#define SWIGTYPE_p_blpapi_StreamWriter_t swig_types[28] +#define SWIGTYPE_p_blpapi_SubscriptionItrerator swig_types[29] +#define SWIGTYPE_p_blpapi_SubscriptionList swig_types[30] +#define SWIGTYPE_p_blpapi_TimePoint swig_types[31] +#define SWIGTYPE_p_blpapi_TlsOptions swig_types[32] +#define SWIGTYPE_p_blpapi_Topic swig_types[33] +#define SWIGTYPE_p_blpapi_TopicList swig_types[34] +#define SWIGTYPE_p_char swig_types[35] +#define SWIGTYPE_p_double swig_types[36] +#define SWIGTYPE_p_f_p_struct_blpapi_Event_p_struct_blpapi_ProviderSession_p_void__void swig_types[37] +#define SWIGTYPE_p_float swig_types[38] +#define SWIGTYPE_p_int swig_types[39] +#define SWIGTYPE_p_intArray swig_types[40] +#define SWIGTYPE_p_long_long swig_types[41] +#define SWIGTYPE_p_p_blpapi_Element swig_types[42] +#define SWIGTYPE_p_p_blpapi_Event swig_types[43] +#define SWIGTYPE_p_p_blpapi_Message swig_types[44] +#define SWIGTYPE_p_p_blpapi_Name swig_types[45] +#define SWIGTYPE_p_p_blpapi_Operation swig_types[46] +#define SWIGTYPE_p_p_blpapi_Request swig_types[47] +#define SWIGTYPE_p_p_blpapi_RequestTemplate swig_types[48] +#define SWIGTYPE_p_p_blpapi_Service swig_types[49] +#define SWIGTYPE_p_p_blpapi_Topic swig_types[50] +#define SWIGTYPE_p_p_char swig_types[51] +#define SWIGTYPE_p_p_p_void swig_types[52] +#define SWIGTYPE_p_p_void swig_types[53] +#define SWIGTYPE_p_short swig_types[54] +#define SWIGTYPE_p_unsigned_char swig_types[55] +#define SWIGTYPE_p_unsigned_int swig_types[56] +#define SWIGTYPE_p_unsigned_long_long swig_types[57] +#define SWIGTYPE_p_unsigned_short swig_types[58] +static swig_type_info *swig_types[60]; +static swig_module_info swig_module = {swig_types, 59, 0, 0, 0, 0}; +#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) +#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) + +/* -------- TYPES TABLE (END) -------- */ + +#if (PY_VERSION_HEX <= 0x02000000) +# if !defined(SWIG_PYTHON_CLASSIC) +# error "This python version requires swig to be run with the '-classic' option" +# endif +#endif + +/*----------------------------------------------- + @(target):= _internals.so + ------------------------------------------------*/ +#if PY_VERSION_HEX >= 0x03000000 +# define SWIG_init PyInit__internals + +#else +# define SWIG_init init_internals + +#endif +#define SWIG_name "_internals" + +#define SWIGVERSION 0x030012 +#define SWIG_VERSION SWIGVERSION + + +#define SWIG_as_voidptr(a) (void *)((const void *)(a)) +#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a)) + + +#define SWIG_FILE_WITH_INIT +#include "blpapi_types.h" + + +SWIGINTERNINLINE PyObject* + SWIG_From_unsigned_SS_int (unsigned int value) +{ + return PyInt_FromSize_t((size_t) value); +} + + + #define SWIG_From_long PyInt_FromLong + + +SWIGINTERNINLINE PyObject* +SWIG_From_unsigned_SS_long (unsigned long value) +{ + return (value > LONG_MAX) ? + PyLong_FromUnsignedLong(value) : PyInt_FromLong((long)(value)); +} + + +#include +#if !defined(SWIG_NO_LLONG_MAX) +# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__) +# define LLONG_MAX __LONG_LONG_MAX__ +# define LLONG_MIN (-LLONG_MAX - 1LL) +# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL) +# endif +#endif + + +#if defined(LLONG_MAX) && !defined(SWIG_LONG_LONG_AVAILABLE) +# define SWIG_LONG_LONG_AVAILABLE +#endif + + +#ifdef SWIG_LONG_LONG_AVAILABLE +SWIGINTERNINLINE PyObject* +SWIG_From_unsigned_SS_long_SS_long (unsigned long long value) +{ + return (value > LONG_MAX) ? + PyLong_FromUnsignedLongLong(value) : PyInt_FromLong((long)(value)); +} +#endif + + +SWIGINTERNINLINE PyObject * +SWIG_From_size_t (size_t value) +{ +#ifdef SWIG_LONG_LONG_AVAILABLE + if (sizeof(size_t) <= sizeof(unsigned long)) { +#endif + return SWIG_From_unsigned_SS_long ((unsigned long)(value)); +#ifdef SWIG_LONG_LONG_AVAILABLE + } else { + /* assume sizeof(size_t) <= sizeof(unsigned long long) */ + return SWIG_From_unsigned_SS_long_SS_long ((unsigned long long)(value)); + } +#endif +} + + +SWIGINTERNINLINE PyObject* + SWIG_From_int (int value) +{ + return PyInt_FromLong((long) value); +} + + +#include "blpapi_constant.h" +#include "blpapi_datetime.h" +#include "blpapi_diagnosticsutil.h" +#include "blpapi_element.h" +#include "blpapi_error.h" +#include "blpapi_event.h" +#include "blpapi_eventdispatcher.h" +#include "blpapi_highresolutionclock.h" +#include "blpapi_identity.h" +#include "blpapi_logging.h" +#include "blpapi_message.h" +#include "blpapi_name.h" +#include "blpapi_request.h" +#include "blpapi_schema.h" +#include "blpapi_service.h" +#include "blpapi_session.h" +#include "blpapi_sessionoptions.h" +#include "blpapi_streamproxy.h" +#include "blpapi_subscriptionlist.h" +#include "blpapi_timepoint.h" + +// publishing support +#include "blpapi_eventformatter.h" +#include "blpapi_providersession.h" +#include "blpapi_resolutionlist.h" +#include "blpapi_topic.h" +#include "blpapi_topiclist.h" + +#ifndef MAX_GROUP_ID_SIZE +// MAX_GROUP_ID_SIZE is not defined in BLPAPI, but docs say its value is 64 +#define MAX_GROUP_ID_SIZE 64 +#endif + +#include // for tm and mktime + +#include // for PyObject +#include // for malloc() and free() +#include // for strncpy() + +int cstr_StreamWriter(const char *data, int length, void *stream) +{ + char **targetStr = (char **) stream; + *targetStr = (char *) malloc(length + 1); + strncpy(*targetStr, data, length + 1); + return 0; +} + +PyObject *blpapi_Service_printHelper( + blpapi_Service_t *service, + int level, + int spacesPerLevel) +{ + char *stream; + PyObject *elementStr; + + blpapi_Service_print( + service, + cstr_StreamWriter, + &stream, + level, + spacesPerLevel); + + elementStr = PyString_FromString(stream); + free(stream); + return elementStr; +} + +PyObject *blpapi_SchemaElementDefinition_printHelper( + blpapi_SchemaElementDefinition_t *item, + int level, + int spacesPerLevel) +{ + char *stream; + PyObject *elementStr; + + blpapi_SchemaElementDefinition_print( + item, + cstr_StreamWriter, + &stream, + level, + spacesPerLevel); + + elementStr = PyString_FromString(stream); + free(stream); + return elementStr; +} + +PyObject *blpapi_SchemaTypeDefinition_printHelper( + blpapi_SchemaTypeDefinition_t *item, + int level, + int spacesPerLevel) +{ + char *stream; + PyObject *elementStr; + + blpapi_SchemaTypeDefinition_print( + item, + cstr_StreamWriter, + &stream, + level, + spacesPerLevel); + + elementStr = PyString_FromString(stream); + free(stream); + return elementStr; +} + +PyObject *blpapi_SessionOptions_printHelper( + blpapi_SessionOptions_t *sessionOptions, + int level, + int spacesPerLevel) +{ + char *stream; + PyObject *elementStr; + + blpapi_SessionOptions_print( + sessionOptions, + cstr_StreamWriter, + &stream, + level, + spacesPerLevel); + + elementStr = PyString_FromString(stream); + free(stream); + return elementStr; +} + +int blpapi_SchemaTypeDefinition_hasElementDefinition( + const blpapi_SchemaTypeDefinition_t *type, + const char *nameString, + const blpapi_Name_t *name) +{ + return 0 != blpapi_SchemaTypeDefinition_getElementDefinition( + type, nameString, name); +} + +int blpapi_ConstantList_hasConstant( + const blpapi_ConstantList_t *list, + const char *nameString, + const blpapi_Name_t *name) +{ + return 0 != blpapi_ConstantList_getConstant(list, nameString, name); +} + +int blpapi_Service_hasEventDefinition( + blpapi_Service_t *service, + const char* nameString, + const blpapi_Name_t *name) +{ + blpapi_SchemaElementDefinition_t *eventDefinition; + + return 0 == blpapi_Service_getEventDefinition( + service, &eventDefinition, nameString, name); +} + +int blpapi_Service_hasOperation( + blpapi_Service_t *service, + const char* nameString, + const blpapi_Name_t *name) +{ + blpapi_Operation_t *operation; + + return 0 == blpapi_Service_getOperation( + service, &operation, nameString, name); +} + +int blpapi_SubscriptionList_addHelper( + blpapi_SubscriptionList_t *list, + const char *topic, + const blpapi_CorrelationId_t *correlationId, + const char *fields, + const char *options) +{ + return blpapi_SubscriptionList_add( + list, + topic, + correlationId, + &fields, + &options, + fields ? 1 : 0, + options ? 1: 0); +} + +int blpapi_Name_hasName(const char *nameString) +{ + return blpapi_Name_findName(nameString) ? 1 : 0; +} + +blpapi_TopicList_t* blpapi_TopicList_createFromResolutionList( + blpapi_ResolutionList_t* from) +{ + return blpapi_TopicList_create((blpapi_TopicList_t*) (from)); +} + +PyObject *blpapi_DiagnosticsUtil_memoryInfo_wrapper() +{ + // Get the length of the buffer first + int len = blpapi_DiagnosticsUtil_memoryInfo(0, 0); + int buffer_length; + char *buffer; + PyObject *diagnostics_str; + + if (len < 0) { + PyErr_SetString(PyExc_RuntimeError, "blpapi_DiagnosticsUtil_memoryInfo error"); + return NULL; + } + + buffer_length = len + 1; + buffer = (char *) malloc(buffer_length); + blpapi_DiagnosticsUtil_memoryInfo(buffer, buffer_length); + diagnostics_str = PyString_FromString(buffer); + free(buffer); + + return diagnostics_str; +} + +typedef void (*blpapi_Logging_Func_t)(blpapi_UInt64_t threadId, + int severity, + blpapi_Datetime_t timestamp, + const char *category, + const char *message); + +// Shared global object guarded by GIL +PyObject* loggerCallback = 0; + +static time_t blpapi_Datetime_to_unix(blpapi_Datetime_t const *original) { + time_t rawtime = time(NULL); + time_t result; + struct tm *ts = localtime(&rawtime); + + if (original->parts & BLPAPI_DATETIME_DATE_PART) { + ts->tm_year = original->year - 1900; // tm_year should contain number of years since 1900 + ts->tm_mon = original->month - 1; // tm_mon is zero based + ts->tm_mday = original->day; + if (original->parts & BLPAPI_DATETIME_TIME_PART) { + ts->tm_hour = original->hours; + ts->tm_min = original->minutes; + ts->tm_sec = original->seconds; + } + } + result = mktime(ts); + return result; +} + +void loggerCallbackWrapper(blpapi_UInt64_t threadId, + int severity, + blpapi_Datetime_t original, + const char *category, + const char *message) +{ + time_t ts = blpapi_Datetime_to_unix(&original); + + PyGILState_STATE gilstate = PyGILState_Ensure(); + PyObject* result = PyObject_CallFunction(loggerCallback, "KiIss", + threadId, severity, ts, + category, message); + PyGILState_Release(gilstate); + Py_XDECREF(result); +} + +int setLoggerCallbackWrapper(PyObject *cb, int severity) +{ + int err; + + if (!PyCallable_Check(cb)) { + return -1; + } + Py_XINCREF(cb); + Py_XDECREF(loggerCallback); + loggerCallback = cb; + // Set actual callback + err = blpapi_Logging_registerCallback(&loggerCallbackWrapper, (blpapi_Logging_Severity_t)severity); + if (err != 0) { + return -2; + } + + return 0; +} + +/** Convert `blpapi_TimePoint_t` value to `blpapi_Datetime_t`. Function + * always returns UTC time. + */ +blpapi_Datetime_t blpapi_HighPrecisionDatetime_fromTimePoint_wrapper(blpapi_TimePoint_t original) +{ + blpapi_HighPrecisionDatetime_t highPrecisionDatetime; + blpapi_Datetime_t datetime; + + blpapi_HighPrecisionDatetime_fromTimePoint( + &highPrecisionDatetime, + &original, + 0); + + datetime = highPrecisionDatetime.datetime; + + return datetime; +} + + + +SWIGINTERN int +SWIG_AsVal_double (PyObject *obj, double *val) +{ + int res = SWIG_TypeError; + if (PyFloat_Check(obj)) { + if (val) *val = PyFloat_AsDouble(obj); + return SWIG_OK; +#if PY_VERSION_HEX < 0x03000000 + } else if (PyInt_Check(obj)) { + if (val) *val = (double) PyInt_AsLong(obj); + return SWIG_OK; +#endif + } else if (PyLong_Check(obj)) { + double v = PyLong_AsDouble(obj); + if (!PyErr_Occurred()) { + if (val) *val = v; + return SWIG_OK; + } else { + PyErr_Clear(); + } + } +#ifdef SWIG_PYTHON_CAST_MODE + { + int dispatch = 0; + double d = PyFloat_AsDouble(obj); + if (!PyErr_Occurred()) { + if (val) *val = d; + return SWIG_AddCast(SWIG_OK); + } else { + PyErr_Clear(); + } + if (!dispatch) { + long v = PyLong_AsLong(obj); + if (!PyErr_Occurred()) { + if (val) *val = v; + return SWIG_AddCast(SWIG_AddCast(SWIG_OK)); + } else { + PyErr_Clear(); + } + } + } +#endif + return res; +} + + +#include + + +#include + + +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 */ + if ((errno == EDOM) || (errno == ERANGE)) { + errno = 0; + } else { + double summ, reps, diff; + if (rd < x) { + diff = x - rd; + } else if (rd > x) { + diff = rd - x; + } else { + return 1; + } + summ = rd + x; + reps = diff/summ; + if (reps < 8*DBL_EPSILON) { + *d = rd; + return 1; + } + } + } + return 0; +} + + +SWIGINTERN int +SWIG_AsVal_long (PyObject *obj, long* val) +{ +#if PY_VERSION_HEX < 0x03000000 + if (PyInt_Check(obj)) { + if (val) *val = PyInt_AsLong(obj); + return SWIG_OK; + } else +#endif + if (PyLong_Check(obj)) { + long v = PyLong_AsLong(obj); + if (!PyErr_Occurred()) { + if (val) *val = v; + return SWIG_OK; + } else { + PyErr_Clear(); + return SWIG_OverflowError; + } + } +#ifdef SWIG_PYTHON_CAST_MODE + { + int dispatch = 0; + long v = PyInt_AsLong(obj); + if (!PyErr_Occurred()) { + if (val) *val = v; + return SWIG_AddCast(SWIG_OK); + } else { + PyErr_Clear(); + } + if (!dispatch) { + double d; + int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d)); + if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) { + if (val) *val = (long)(d); + return res; + } + } + } +#endif + return SWIG_TypeError; +} + + +SWIGINTERN int +SWIG_AsVal_int (PyObject * obj, int *val) +{ + long v; + int res = SWIG_AsVal_long (obj, &v); + if (SWIG_IsOK(res)) { + if ((v < INT_MIN || v > INT_MAX)) { + return SWIG_OverflowError; + } else { + if (val) *val = (int)(v); + } + } + return res; +} + + +SWIGINTERN swig_type_info* +SWIG_pchar_descriptor(void) +{ + static int init = 0; + static swig_type_info* info = 0; + if (!init) { + info = SWIG_TypeQuery("_p_char"); + init = 1; + } + return info; +} + + +SWIGINTERN int +SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) +{ +#if PY_VERSION_HEX>=0x03000000 +#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) + if (PyBytes_Check(obj)) +#else + if (PyUnicode_Check(obj)) +#endif +#else + if (PyString_Check(obj)) +#endif + { + char *cstr; Py_ssize_t len; +#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(alloc) *alloc = SWIG_NEWOBJ; +#endif + PyBytes_AsStringAndSize(obj, &cstr, &len); +#else + PyString_AsStringAndSize(obj, &cstr, &len); +#endif + if (cptr) { + if (alloc) { + /* + In python the user should not be able to modify the inner + string representation. To warranty that, if you define + SWIG_PYTHON_SAFE_CSTRINGS, a new/copy of the python string + buffer is always returned. + + The default behavior is just to return the pointer value, + so, be careful. + */ +#if defined(SWIG_PYTHON_SAFE_CSTRINGS) + if (*alloc != SWIG_OLDOBJ) +#else + if (*alloc == SWIG_NEWOBJ) +#endif + { + *cptr = (char *)memcpy(malloc((len + 1)*sizeof(char)), cstr, sizeof(char)*(len + 1)); + *alloc = SWIG_NEWOBJ; + } else { + *cptr = cstr; + *alloc = SWIG_OLDOBJ; + } + } 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); +#endif + } + } + if (psize) *psize = len + 1; +#if PY_VERSION_HEX>=0x03000000 && !defined(SWIG_PYTHON_STRICT_BYTE_CHAR) + Py_XDECREF(obj); +#endif + return SWIG_OK; + } else { +#if defined(SWIG_PYTHON_2_UNICODE) +#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) +#error "Cannot use both SWIG_PYTHON_2_UNICODE and SWIG_PYTHON_STRICT_BYTE_CHAR at once" +#endif +#if PY_VERSION_HEX<0x03000000 + if (PyUnicode_Check(obj)) { + char *cstr; Py_ssize_t len; + if (!alloc && cptr) { + return SWIG_RuntimeError; + } + obj = PyUnicode_AsUTF8String(obj); + if (PyString_AsStringAndSize(obj, &cstr, &len) != -1) { + if (cptr) { + if (alloc) *alloc = SWIG_NEWOBJ; + *cptr = (char *)memcpy(malloc((len + 1)*sizeof(char)), cstr, sizeof(char)*(len + 1)); + } + if (psize) *psize = len + 1; + + Py_XDECREF(obj); + return SWIG_OK; + } else { + Py_XDECREF(obj); + } + } +#endif +#endif + + swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); + if (pchar_descriptor) { + void* vptr = 0; + if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) { + if (cptr) *cptr = (char *) vptr; + if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0; + if (alloc) *alloc = SWIG_OLDOBJ; + return SWIG_OK; + } + } + } + return SWIG_TypeError; +} + + + + + +typedef int intArray; + + +SWIGINTERN int +SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val) +{ +#if PY_VERSION_HEX < 0x03000000 + if (PyInt_Check(obj)) { + long v = PyInt_AsLong(obj); + if (v >= 0) { + if (val) *val = v; + return SWIG_OK; + } else { + return SWIG_OverflowError; + } + } else +#endif + if (PyLong_Check(obj)) { + unsigned long v = PyLong_AsUnsignedLong(obj); + if (!PyErr_Occurred()) { + if (val) *val = v; + return SWIG_OK; + } else { + PyErr_Clear(); + return SWIG_OverflowError; + } + } +#ifdef SWIG_PYTHON_CAST_MODE + { + int dispatch = 0; + unsigned long v = PyLong_AsUnsignedLong(obj); + if (!PyErr_Occurred()) { + if (val) *val = v; + return SWIG_AddCast(SWIG_OK); + } else { + PyErr_Clear(); + } + if (!dispatch) { + double d; + int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d)); + if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) { + if (val) *val = (unsigned long)(d); + return res; + } + } + } +#endif + return SWIG_TypeError; +} + + +#ifdef SWIG_LONG_LONG_AVAILABLE +SWIGINTERN int +SWIG_AsVal_unsigned_SS_long_SS_long (PyObject *obj, unsigned long long *val) +{ + int res = SWIG_TypeError; + if (PyLong_Check(obj)) { + unsigned long long v = PyLong_AsUnsignedLongLong(obj); + if (!PyErr_Occurred()) { + if (val) *val = v; + return SWIG_OK; + } else { + PyErr_Clear(); + res = SWIG_OverflowError; + } + } else { + unsigned long v; + res = SWIG_AsVal_unsigned_SS_long (obj,&v); + if (SWIG_IsOK(res)) { + if (val) *val = v; + return res; + } + } +#ifdef SWIG_PYTHON_CAST_MODE + { + const double mant_max = 1LL << DBL_MANT_DIG; + double d; + res = SWIG_AsVal_double (obj,&d); + if (SWIG_IsOK(res) && !SWIG_CanCastAsInteger(&d, 0, mant_max)) + return SWIG_OverflowError; + if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, mant_max)) { + if (val) *val = (unsigned long long)(d); + return SWIG_AddCast(res); + } + res = SWIG_TypeError; + } +#endif + return res; +} +#endif + + +SWIGINTERNINLINE int +SWIG_AsVal_size_t (PyObject * obj, size_t *val) +{ + int res = SWIG_TypeError; +#ifdef SWIG_LONG_LONG_AVAILABLE + if (sizeof(size_t) <= sizeof(unsigned long)) { +#endif + unsigned long v; + res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0); + if (SWIG_IsOK(res) && val) *val = (size_t)(v); +#ifdef SWIG_LONG_LONG_AVAILABLE + } else if (sizeof(size_t) <= sizeof(unsigned long long)) { + unsigned long long v; + res = SWIG_AsVal_unsigned_SS_long_SS_long (obj, val ? &v : 0); + if (SWIG_IsOK(res) && val) *val = (size_t)(v); + } +#endif + return res; +} + +SWIGINTERN intArray *new_intArray(size_t nelements){ + return (int *)calloc(nelements, sizeof(int)); + } +SWIGINTERN void delete_intArray(intArray *self){ + free((char*)self); + } +SWIGINTERN int intArray___getitem__(intArray *self,size_t index){ + return self[index]; + } +SWIGINTERN void intArray___setitem__(intArray *self,size_t index,int value){ + self[index] = value; + } +SWIGINTERN int *intArray_cast(intArray *self){ + return self; + } +SWIGINTERN intArray *intArray_frompointer(int *t){ + return (intArray *)(t); + } + + static blpapi_Topic_t* *new_topicPtrArray(size_t nelements) { + return (blpapi_Topic_t* *)calloc(nelements, sizeof(blpapi_Topic_t*)); + } + + static void delete_topicPtrArray(blpapi_Topic_t* *ary) { + free((char*)ary); + } + + static blpapi_Topic_t* topicPtrArray_getitem(blpapi_Topic_t* *ary, size_t index) { + return ary[index]; + } + static void topicPtrArray_setitem(blpapi_Topic_t* *ary, size_t index, blpapi_Topic_t* value) { + ary[index] = value; + } + + + +#include "blpapi_correlationid.h" + +int pyObjectManagerFunc( + blpapi_ManagedPtr_t *managedPtr, + const blpapi_ManagedPtr_t *srcPtr, + int operation) +{ + SWIG_PYTHON_THREAD_BEGIN_BLOCK; + if (operation == BLPAPI_MANAGEDPTR_COPY) { + managedPtr->pointer = srcPtr->pointer; + managedPtr->manager = srcPtr->manager; + Py_INCREF((PyObject *) (managedPtr->pointer)); + } + else if (operation == BLPAPI_MANAGEDPTR_DESTROY) { + Py_DECREF((PyObject *) (managedPtr->pointer)); + } + SWIG_PYTHON_THREAD_END_BLOCK; + + return 0; +} + +blpapi_CorrelationId_t *CorrelationId_t_createEmpty() +{ + blpapi_CorrelationId_t *cid; + + Py_BEGIN_ALLOW_THREADS + cid = (blpapi_CorrelationId_t *) malloc(sizeof(blpapi_CorrelationId_t)); + memset(cid, 0, sizeof(blpapi_CorrelationId_t)); + Py_END_ALLOW_THREADS + + return cid; +} + +blpapi_CorrelationId_t *CorrelationId_t_createFromInteger(long long value, unsigned short classId) +{ + blpapi_CorrelationId_t *cid; + + Py_BEGIN_ALLOW_THREADS + cid = (blpapi_CorrelationId_t *) malloc(sizeof(blpapi_CorrelationId_t)); + memset(cid, 0, sizeof(blpapi_CorrelationId_t)); + + cid->size = sizeof(blpapi_CorrelationId_t); + cid->valueType = BLPAPI_CORRELATION_TYPE_INT; + cid->classId = classId; + cid->value.intValue = value; + Py_END_ALLOW_THREADS + + return cid; +} + +blpapi_CorrelationId_t *CorrelationId_t_createFromObject(PyObject *value, unsigned short classId) +{ + blpapi_CorrelationId_t *cid; + if (!value) { + value = Py_None; + } + + Py_BEGIN_ALLOW_THREADS + cid = (blpapi_CorrelationId_t *) malloc(sizeof(blpapi_CorrelationId_t)); + memset(cid, 0, sizeof(blpapi_CorrelationId_t)); + + cid->size = sizeof(blpapi_CorrelationId_t); + cid->valueType = BLPAPI_CORRELATION_TYPE_POINTER; + cid->classId = classId; + + cid->value.ptrValue.manager = &pyObjectManagerFunc; + cid->value.ptrValue.pointer = value; + Py_END_ALLOW_THREADS + + Py_INCREF(value); + + return cid; +} + +blpapi_CorrelationId_t *CorrelationId_t_clone(const blpapi_CorrelationId_t *original) +{ + blpapi_CorrelationId_t *cid; + Py_BEGIN_ALLOW_THREADS + cid = (blpapi_CorrelationId_t *) malloc(sizeof(blpapi_CorrelationId_t)); + *cid = *original; + Py_END_ALLOW_THREADS + + if (BLPAPI_CORRELATION_TYPE_POINTER == cid->valueType) { + blpapi_ManagedPtr_ManagerFunction_t manager = + cid->value.ptrValue.manager; + if (manager) { + manager(&cid->value.ptrValue, &original->value.ptrValue, + BLPAPI_MANAGEDPTR_COPY); + } + } + + return cid; +} + +void CorrelationId_t_cleanup(blpapi_CorrelationId_t *cid) +{ + if (BLPAPI_CORRELATION_TYPE_POINTER == cid->valueType) { + blpapi_ManagedPtr_ManagerFunction_t manager = + cid->value.ptrValue.manager; + if (manager) { + manager(&cid->value.ptrValue, 0, BLPAPI_MANAGEDPTR_DESTROY); + } + } +} + +void CorrelationId_t_delete(blpapi_CorrelationId_t *cid) +{ + if (!cid) { + return; + } + + CorrelationId_t_cleanup(cid); + + Py_BEGIN_ALLOW_THREADS + free(cid); + Py_END_ALLOW_THREADS +} + +int CorrelationId_t_equals( + const blpapi_CorrelationId_t *cid1, + const blpapi_CorrelationId_t *cid2) +{ + if (cid1 == cid2) { + return 1; + } + + if (!cid1 || !cid2) { + return 0; + } + + if (cid1->valueType != cid2->valueType) { + return 0; + } + + if (cid1->classId != cid2->classId) { + return 0; + } + + if (cid1->valueType == BLPAPI_CORRELATION_TYPE_POINTER) { + return cid1->value.ptrValue.pointer == cid2->value.ptrValue.pointer; + } else { + return cid1->value.intValue == cid2->value.intValue; + } +} + +long long CorrelationId_t_toInteger(const blpapi_CorrelationId_t *cid) +{ + if (cid->valueType == BLPAPI_CORRELATION_TYPE_POINTER) + return (long long) (cid->value.ptrValue.pointer); + return cid->value.intValue; +} + +PyObject *CorrelationId_t_getObject(const blpapi_CorrelationId_t *cid) { + PyObject *res; + + if (BLPAPI_CORRELATION_TYPE_POINTER == cid->valueType + && &pyObjectManagerFunc == cid->value.ptrValue.manager) + { + res = (PyObject *) (cid->value.ptrValue.pointer); + } + else { + res = Py_None; + } + + Py_INCREF(res); + return res; +} + + +typedef union { + blpapi_UInt64_t intValue; + blpapi_ManagedPtr_t ptrValue; +} blpapi_CorrelationId_t__value; + +SWIGINTERN struct blpapi_CorrelationId_t_ *new_blpapi_CorrelationId_t___SWIG_0(void){ + return CorrelationId_t_createEmpty(); + } + +#ifdef SWIG_LONG_LONG_AVAILABLE +SWIGINTERN int +SWIG_AsVal_long_SS_long (PyObject *obj, long long *val) +{ + int res = SWIG_TypeError; + if (PyLong_Check(obj)) { + long long v = PyLong_AsLongLong(obj); + if (!PyErr_Occurred()) { + if (val) *val = v; + return SWIG_OK; + } else { + PyErr_Clear(); + res = SWIG_OverflowError; + } + } else { + long v; + res = SWIG_AsVal_long (obj,&v); + if (SWIG_IsOK(res)) { + if (val) *val = v; + return res; + } + } +#ifdef SWIG_PYTHON_CAST_MODE + { + const double mant_max = 1LL << DBL_MANT_DIG; + const double mant_min = -mant_max; + double d; + res = SWIG_AsVal_double (obj,&d); + if (SWIG_IsOK(res) && !SWIG_CanCastAsInteger(&d, mant_min, mant_max)) + return SWIG_OverflowError; + if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, mant_min, mant_max)) { + if (val) *val = (long long)(d); + return SWIG_AddCast(res); + } + res = SWIG_TypeError; + } +#endif + return res; +} +#endif + + +SWIGINTERN int +SWIG_AsVal_unsigned_SS_short (PyObject * obj, unsigned short *val) +{ + unsigned long v; + int res = SWIG_AsVal_unsigned_SS_long (obj, &v); + if (SWIG_IsOK(res)) { + if ((v > USHRT_MAX)) { + return SWIG_OverflowError; + } else { + if (val) *val = (unsigned short)(v); + } + } + return res; +} + +SWIGINTERN struct blpapi_CorrelationId_t_ *new_blpapi_CorrelationId_t___SWIG_1(long long value,unsigned short classId){ + return CorrelationId_t_createFromInteger(value, classId); + } +SWIGINTERN struct blpapi_CorrelationId_t_ *new_blpapi_CorrelationId_t___SWIG_2(PyObject *value,unsigned short classId){ + return CorrelationId_t_createFromObject(value, classId); + } +SWIGINTERN void delete_blpapi_CorrelationId_t_(struct blpapi_CorrelationId_t_ *self){ + CorrelationId_t_delete((self)); + } +SWIGINTERN unsigned short blpapi_CorrelationId_t__type(struct blpapi_CorrelationId_t_ const *self){ + return self->valueType; + } + +SWIGINTERNINLINE PyObject * +SWIG_From_unsigned_SS_short (unsigned short value) +{ + return SWIG_From_unsigned_SS_long (value); +} + +SWIGINTERN unsigned short blpapi_CorrelationId_t__classId(struct blpapi_CorrelationId_t_ const *self){ + return self->classId; + } +SWIGINTERN PyObject *blpapi_CorrelationId_t____asObject(struct blpapi_CorrelationId_t_ const *self){ + return CorrelationId_t_getObject(self); + } +SWIGINTERN long long blpapi_CorrelationId_t____asInteger(struct blpapi_CorrelationId_t_ const *self){ + return self->value.intValue; + } + +#ifdef SWIG_LONG_LONG_AVAILABLE +SWIGINTERNINLINE PyObject* +SWIG_From_long_SS_long (long long value) +{ + return ((value < LONG_MIN) || (value > LONG_MAX)) ? + PyLong_FromLongLong(value) : PyInt_FromLong((long)(value)); +} +#endif + +SWIGINTERN long long blpapi_CorrelationId_t____toInteger(struct blpapi_CorrelationId_t_ const *self){ + return CorrelationId_t_toInteger(self); + } + + +#include "blpapi_element.h" + +int blpapi_Element_setElementFloat( + blpapi_Element_t *element, + const char* nameString, + const blpapi_Name_t* name, + blpapi_Float64_t value) +{ + // The C interface will not silently discard precision to store a 64-bit + // float in a field whose schema type is 32-bit, however all Python floats + // are 64-bit, so we explicitly allow narrowing to 32 bits if necessary. + + blpapi_Element_t *fldt; + int ret = blpapi_Element_getElement(element, &fldt, nameString, name); + if (ret == 0) { + // Able to get field, consider its datatype + if (blpapi_Element_datatype(fldt) == BLPAPI_DATATYPE_FLOAT32) { + ret = blpapi_Element_setElementFloat32(element, + nameString, name, value); + } else { + ret = blpapi_Element_setElementFloat64(element, + nameString, name, value); + } + return ret; + } + + // Unable to get field. Try to set element anyway + ret = blpapi_Element_setElementFloat64(element, + nameString, name, value); + + if (ret) { + ret = blpapi_Element_setElementFloat32(element, + nameString, name, value); + } + + return ret; +} + +int blpapi_Element_setValueFloat( + blpapi_Element_t *element, + blpapi_Float64_t value, + size_t index) +{ + // The C interface will not silently discard precision to store a 64-bit + // float in a field whose schema type is 32-bit, however all Python floats + // are 64-bit, so we explicitly allow narrowing to 32 bits if necessary. + + int ret; + + // Consider field datatype + if (blpapi_Element_datatype(element) == BLPAPI_DATATYPE_FLOAT32) { + ret = blpapi_Element_setValueFloat32(element, value, index); + } else { + ret = blpapi_Element_setValueFloat64(element, value, index); + } + + return ret; +} + +PyObject *blpapi_Element_printHelper( + blpapi_Element_t *element, + int level, + int spacesPerLevel) +{ + char *stream; + PyObject *elementStr; + + blpapi_Element_print( + element, + cstr_StreamWriter, + &stream, + level, + spacesPerLevel); + + elementStr = PyString_FromString(stream); + free(stream); + return elementStr; +} + + + +SWIGINTERNINLINE PyObject * +SWIG_FromCharPtrAndSize(const char* carray, size_t size) +{ + if (carray) { + if (size > INT_MAX) { + swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); + return pchar_descriptor ? + SWIG_InternalNewPointerObj((char *)(carray), pchar_descriptor, 0) : SWIG_Py_Void(); + } else { +#if PY_VERSION_HEX >= 0x03000000 +#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) + return PyBytes_FromStringAndSize(carray, (Py_ssize_t)(size)); +#else +#if PY_VERSION_HEX >= 0x03010000 + return PyUnicode_DecodeUTF8(carray, (Py_ssize_t)(size), "surrogateescape"); +#else + return PyUnicode_FromStringAndSize(carray, (Py_ssize_t)(size)); +#endif +#endif +#else + return PyString_FromStringAndSize(carray, (Py_ssize_t)(size)); +#endif + } + } else { + return SWIG_Py_Void(); + } +} + + +SWIGINTERNINLINE PyObject * +SWIG_FromCharPtr(const char *cptr) +{ + return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0)); +} + + + #define SWIG_From_double PyFloat_FromDouble + + + +#include "blpapi_eventformatter.h" + +int blpapi_EventFormatter_setValueFloat( + blpapi_EventFormatter_t* formatter, + char const* typeString, + const blpapi_Name_t* typeName, + blpapi_Float64_t value) +{ + // The C interface will not silently discard precision to store a 64-bit + // float in a field whose schema type is 32-bit, however all Python floats + // are 64-bit, so we explicitly allow narrowing to 32 bits if necessary. + + int ret = blpapi_EventFormatter_setValueFloat64(formatter, typeString, + typeName, value); + if (ret) { + ret = blpapi_EventFormatter_setValueFloat32(formatter, typeString, + typeName, value); + } + + return ret; +} + +int blpapi_EventFormatter_appendValueFloat( + blpapi_EventFormatter_t* formatter, + blpapi_Float64_t value) +{ + // The C interface will not silently discard precision to store a 64-bit + // float in a field whose schema type is 32-bit, however all Python floats + // are 64-bit, so we explicitly allow narrowing to 32 bits if necessary. + + int ret = blpapi_EventFormatter_appendValueFloat64(formatter, value); + + if (ret) { + ret = blpapi_EventFormatter_appendValueFloat32(formatter, value); + } + + return ret; +} + + + +SWIGINTERN int +SWIG_AsVal_unsigned_SS_int (PyObject * obj, unsigned int *val) +{ + unsigned long v; + int res = SWIG_AsVal_unsigned_SS_long (obj, &v); + if (SWIG_IsOK(res)) { + if ((v > UINT_MAX)) { + return SWIG_OverflowError; + } else { + if (val) *val = (unsigned int)(v); + } + } + return res; +} + + +SWIGINTERN int +SWIG_AsCharArray(PyObject * obj, char *val, size_t size) +{ + char* cptr = 0; size_t csize = 0; int alloc = SWIG_OLDOBJ; + int res = SWIG_AsCharPtrAndSize(obj, &cptr, &csize, &alloc); + if (SWIG_IsOK(res)) { + /* special case of single char conversion when we don't need space for NUL */ + if (size == 1 && csize == 2 && cptr && !cptr[1]) --csize; + if (csize <= size) { + if (val) { + if (csize) memcpy(val, cptr, csize*sizeof(char)); + if (csize < size) memset(val + csize, 0, (size - csize)*sizeof(char)); + } + if (alloc == SWIG_NEWOBJ) { + free((char*)cptr); + res = SWIG_DelNewMask(res); + } + return res; + } + if (alloc == SWIG_NEWOBJ) free((char*)cptr); + } + return SWIG_TypeError; +} + + +SWIGINTERN int +SWIG_AsVal_char (PyObject * obj, char *val) +{ + int res = SWIG_AsCharArray(obj, val, 1); + if (!SWIG_IsOK(res)) { + long v; + res = SWIG_AddCast(SWIG_AsVal_long (obj, &v)); + if (SWIG_IsOK(res)) { + if ((CHAR_MIN <= v) && (v <= CHAR_MAX)) { + if (val) *val = (char)(v); + } else { + res = SWIG_OverflowError; + } + } + } + return res; +} + + +#include "blpapi_session.h" + +void dispatchEventProxy(blpapi_Event_t *event, blpapi_Session_t *session, void *userData) +{ + PyObject *eventDispatcherFunc = (PyObject *) (userData); + PyObject *result; + + SWIG_PYTHON_THREAD_BEGIN_BLOCK; + + PyObject *arglist = PyTuple_New(1); + PyTuple_SET_ITEM(arglist, 0, + SWIG_NewPointerObj(SWIG_as_voidptr(event), SWIGTYPE_p_blpapi_Event, 0)); + + result = PyEval_CallObject(eventDispatcherFunc, arglist); + + Py_DECREF(arglist); + Py_XDECREF(result); + + SWIG_PYTHON_THREAD_END_BLOCK; +} + +blpapi_Session_t *Session_createHelper(blpapi_SessionOptions_t *parameters, + PyObject *eventHandlerFunc, + blpapi_EventDispatcher_t *dispatcher) +{ + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + const int hasHandler = + eventHandlerFunc != 0 && eventHandlerFunc != Py_None; + + blpapi_Session_t *const res = blpapi_Session_create( + parameters, + hasHandler ? &dispatchEventProxy : 0, + dispatcher, + hasHandler ? eventHandlerFunc : 0); + + if (!res) { + return 0; + } + SWIG_PYTHON_THREAD_END_ALLOW; + + Py_XINCREF(eventHandlerFunc); + + return res; +} + +void Session_destroyHelper(blpapi_Session_t *sessionHandle, PyObject *eventHandlerFunc) +{ + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_Session_destroy(sessionHandle); + SWIG_PYTHON_THREAD_END_ALLOW; + + Py_XDECREF(eventHandlerFunc); +} + + + +#include "blpapi_providersession.h" + +void dispatchProviderEventProxy(blpapi_Event_t *event, blpapi_ProviderSession_t *providerSession, void *userData) +{ + PyObject *eventDispatcherFunc = (PyObject *) (userData); + PyObject *result; + PyObject *arglist; + + SWIG_PYTHON_THREAD_BEGIN_BLOCK; + + arglist = PyTuple_New(1); + PyTuple_SET_ITEM(arglist, 0, + SWIG_NewPointerObj(SWIG_as_voidptr(event), SWIGTYPE_p_blpapi_Event, 0)); + + result = PyEval_CallObject(eventDispatcherFunc, arglist); + + Py_DECREF(arglist); + Py_XDECREF(result); + + SWIG_PYTHON_THREAD_END_BLOCK; +} + +blpapi_ProviderSession_t *ProviderSession_createHelper(blpapi_SessionOptions_t *parameters, + PyObject *eventHandlerFunc, + blpapi_EventDispatcher_t *dispatcher) +{ + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + const int hasHandler = + eventHandlerFunc != 0 && eventHandlerFunc != Py_None; + + blpapi_ProviderSession_t *const res = blpapi_ProviderSession_create( + parameters, + hasHandler ? &dispatchProviderEventProxy : 0, + dispatcher, + hasHandler ? eventHandlerFunc : 0); + + if (!res) { + return 0; + } + SWIG_PYTHON_THREAD_END_ALLOW; + + Py_XINCREF(eventHandlerFunc); + + return res; +} + +void ProviderSession_destroyHelper(blpapi_ProviderSession_t *sessionHandle, + PyObject *eventHandlerFunc) +{ + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_ProviderSession_destroy(sessionHandle); + SWIG_PYTHON_THREAD_END_ALLOW; + + Py_XDECREF(eventHandlerFunc); +} + +int ProviderSession_terminateSubscriptionsOnTopic(blpapi_ProviderSession_t *sessionHandle, + const blpapi_Topic_t *topic, + const char *message) +{ + int res; + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + res = blpapi_ProviderSession_terminateSubscriptionsOnTopics(sessionHandle, &topic, 1, message); + SWIG_PYTHON_THREAD_END_ALLOW; + return res; +} + + + +/* Getting isfinite working pre C99 across multiple platforms is non-trivial. Users can provide SWIG_isfinite on older platforms. */ +#ifndef SWIG_isfinite +/* isfinite() is a macro for C99 */ +# if defined(isfinite) +# define SWIG_isfinite(X) (isfinite(X)) +# elif defined __cplusplus && __cplusplus >= 201103L +/* Use a template so that this works whether isfinite() is std::isfinite() or + * in the global namespace. The reality seems to vary between compiler + * versions. + * + * Make sure namespace std exists to avoid compiler warnings. + * + * extern "C++" is required as this fragment can end up inside an extern "C" { } block + */ +namespace std { } +extern "C++" template +inline int SWIG_isfinite_func(T x) { + using namespace std; + return isfinite(x); +} +# define SWIG_isfinite(X) (SWIG_isfinite_func(X)) +# elif defined(_MSC_VER) +# define SWIG_isfinite(X) (_finite(X)) +# elif defined(__sun) && defined(__SVR4) +# include +# define SWIG_isfinite(X) (finite(X)) +# endif +#endif + + +/* Accept infinite as a valid float value unless we are unable to check if a value is finite */ +#ifdef SWIG_isfinite +# define SWIG_Float_Overflow_Check(X) ((X < -FLT_MAX || X > FLT_MAX) && SWIG_isfinite(X)) +#else +# define SWIG_Float_Overflow_Check(X) ((X < -FLT_MAX || X > FLT_MAX)) +#endif + + +SWIGINTERN int +SWIG_AsVal_float (PyObject * obj, float *val) +{ + double v; + int res = SWIG_AsVal_double (obj, &v); + if (SWIG_IsOK(res)) { + if (SWIG_Float_Overflow_Check(v)) { + return SWIG_OverflowError; + } else { + if (val) *val = (float)(v); + } + } + return res; +} + + +SWIGINTERNINLINE PyObject * +SWIG_From_float (float value) +{ + return SWIG_From_double (value); +} + + +SWIGINTERN int +SWIG_AsVal_unsigned_SS_char (PyObject * obj, unsigned char *val) +{ + unsigned long v; + int res = SWIG_AsVal_unsigned_SS_long (obj, &v); + if (SWIG_IsOK(res)) { + if ((v > UCHAR_MAX)) { + return SWIG_OverflowError; + } else { + if (val) *val = (unsigned char)(v); + } + } + return res; +} + + +SWIGINTERNINLINE PyObject * +SWIG_From_unsigned_SS_char (unsigned char value) +{ + return SWIG_From_unsigned_SS_long (value); +} + + +SWIGINTERN int +SWIG_AsVal_short (PyObject * obj, short *val) +{ + long v; + int res = SWIG_AsVal_long (obj, &v); + if (SWIG_IsOK(res)) { + if ((v < SHRT_MIN || v > SHRT_MAX)) { + return SWIG_OverflowError; + } else { + if (val) *val = (short)(v); + } + } + return res; +} + + +SWIGINTERNINLINE PyObject * +SWIG_From_short (short value) +{ + return SWIG_From_long (value); +} + +#ifdef __cplusplus +extern "C" { +#endif +SWIGINTERN PyObject *_wrap_setLoggerCallbackWrapper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + PyObject *arg1 = (PyObject *) 0 ; + int arg2 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:setLoggerCallbackWrapper",&obj0,&obj1)) SWIG_fail; + arg1 = obj0; + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "setLoggerCallbackWrapper" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)setLoggerCallbackWrapper(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_fromTimePoint_wrapper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_TimePoint_t arg1 ; + void *argp1 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_Datetime_t result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_HighPrecisionDatetime_fromTimePoint_wrapper",&obj0)) SWIG_fail; + { + res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_blpapi_TimePoint, 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_fromTimePoint_wrapper" "', argument " "1"" of type '" "blpapi_TimePoint_t""'"); + } + if (!argp1) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "blpapi_HighPrecisionDatetime_fromTimePoint_wrapper" "', argument " "1"" of type '" "blpapi_TimePoint_t""'"); + } else { + arg1 = *((blpapi_TimePoint_t *)(argp1)); + } + } + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = blpapi_HighPrecisionDatetime_fromTimePoint_wrapper(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj((blpapi_Datetime_t *)memcpy((blpapi_Datetime_t *)calloc(1,sizeof(blpapi_Datetime_t)),&result,sizeof(blpapi_Datetime_t)), SWIGTYPE_p_blpapi_Datetime_tag, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Logging_registerCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Logging_Func_t arg1 ; + blpapi_Logging_Severity_t arg2 ; + void *argp1 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Logging_registerCallback",&obj0,&obj1)) SWIG_fail; + { + res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_blpapi_Logging_Func_t, 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Logging_registerCallback" "', argument " "1"" of type '" "blpapi_Logging_Func_t""'"); + } + if (!argp1) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "blpapi_Logging_registerCallback" "', argument " "1"" of type '" "blpapi_Logging_Func_t""'"); + } else { + arg1 = *((blpapi_Logging_Func_t *)(argp1)); + } + } + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Logging_registerCallback" "', argument " "2"" of type '" "blpapi_Logging_Severity_t""'"); + } + arg2 = (blpapi_Logging_Severity_t)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Logging_registerCallback(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Logging_logTestMessage(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Logging_Severity_t arg1 ; + int val1 ; + int ecode1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Logging_logTestMessage",&obj0)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "blpapi_Logging_logTestMessage" "', argument " "1"" of type '" "blpapi_Logging_Severity_t""'"); + } + arg1 = (blpapi_Logging_Severity_t)(val1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_Logging_logTestMessage(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_DiagnosticsUtil_memoryInfo_wrapper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + PyObject *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)":blpapi_DiagnosticsUtil_memoryInfo_wrapper")) SWIG_fail; + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (PyObject *)blpapi_DiagnosticsUtil_memoryInfo_wrapper(); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = result; + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_EventDispatcher_stop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_EventDispatcher_t *arg1 = (blpapi_EventDispatcher_t *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_EventDispatcher_stop",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventDispatcher, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventDispatcher_stop" "', argument " "1"" of type '" "blpapi_EventDispatcher_t *""'"); + } + arg1 = (blpapi_EventDispatcher_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_EventDispatcher_stop" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_EventDispatcher_stop(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Service_printHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; + int arg2 ; + int arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Service_printHelper",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_printHelper" "', argument " "1"" of type '" "blpapi_Service_t *""'"); + } + arg1 = (blpapi_Service_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Service_printHelper" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Service_printHelper" "', argument " "3"" of type '" "int""'"); + } + arg3 = (int)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (PyObject *)blpapi_Service_printHelper(arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = result; + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_printHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; + int arg2 ; + int arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_SchemaElementDefinition_printHelper",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_printHelper" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t *""'"); + } + arg1 = (blpapi_SchemaElementDefinition_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SchemaElementDefinition_printHelper" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_SchemaElementDefinition_printHelper" "', argument " "3"" of type '" "int""'"); + } + arg3 = (int)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (PyObject *)blpapi_SchemaElementDefinition_printHelper(arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = result; + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_printHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; + int arg2 ; + int arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_SchemaTypeDefinition_printHelper",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_printHelper" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t *""'"); + } + arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SchemaTypeDefinition_printHelper" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_SchemaTypeDefinition_printHelper" "', argument " "3"" of type '" "int""'"); + } + arg3 = (int)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (PyObject *)blpapi_SchemaTypeDefinition_printHelper(arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = result; + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_printHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + int arg2 ; + int arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_SessionOptions_printHelper",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_printHelper" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_printHelper" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_SessionOptions_printHelper" "', argument " "3"" of type '" "int""'"); + } + arg3 = (int)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (PyObject *)blpapi_SessionOptions_printHelper(arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = result; + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_hasElementDefinition(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_SchemaTypeDefinition_hasElementDefinition",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_hasElementDefinition" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); + } + arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SchemaTypeDefinition_hasElementDefinition" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_SchemaTypeDefinition_hasElementDefinition" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); + } + arg3 = (blpapi_Name_t *)(argp3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SchemaTypeDefinition_hasElementDefinition((void *const *)arg1,(char const *)arg2,(struct blpapi_Name const *)arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ConstantList_hasConstant(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ConstantList_t *arg1 = (blpapi_ConstantList_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_ConstantList_hasConstant",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_hasConstant" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); + } + arg1 = (blpapi_ConstantList_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ConstantList_hasConstant" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ConstantList_hasConstant" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); + } + arg3 = (blpapi_Name_t *)(argp3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ConstantList_hasConstant((struct blpapi_ConstantList const *)arg1,(char const *)arg2,(struct blpapi_Name const *)arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Service_hasEventDefinition(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Service_hasEventDefinition",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_hasEventDefinition" "', argument " "1"" of type '" "blpapi_Service_t *""'"); + } + arg1 = (blpapi_Service_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Service_hasEventDefinition" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Service_hasEventDefinition" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); + } + arg3 = (blpapi_Name_t *)(argp3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Service_hasEventDefinition(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Service_hasOperation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Service_hasOperation",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_hasOperation" "', argument " "1"" of type '" "blpapi_Service_t *""'"); + } + arg1 = (blpapi_Service_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Service_hasOperation" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Service_hasOperation" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); + } + arg3 = (blpapi_Name_t *)(argp3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Service_hasOperation(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_addHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; + char *arg4 = (char *) 0 ; + char *arg5 = (char *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + int res4 ; + char *buf4 = 0 ; + int alloc4 = 0 ; + int res5 ; + char *buf5 = 0 ; + int alloc5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOOO:blpapi_SubscriptionList_addHelper",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_addHelper" "', argument " "1"" of type '" "blpapi_SubscriptionList_t *""'"); + } + arg1 = (blpapi_SubscriptionList_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SubscriptionList_addHelper" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_SubscriptionList_addHelper" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); + } + arg3 = (blpapi_CorrelationId_t *)(argp3); + res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_SubscriptionList_addHelper" "', argument " "4"" of type '" "char const *""'"); + } + arg4 = (char *)(buf4); + res5 = SWIG_AsCharPtrAndSize(obj4, &buf5, NULL, &alloc5); + if (!SWIG_IsOK(res5)) { + SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "blpapi_SubscriptionList_addHelper" "', argument " "5"" of type '" "char const *""'"); + } + arg5 = (char *)(buf5); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SubscriptionList_addHelper(arg1,(char const *)arg2,(struct blpapi_CorrelationId_t_ const *)arg3,(char const *)arg4,(char const *)arg5); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); + if (alloc5 == SWIG_NEWOBJ) free((char*)buf5); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); + if (alloc5 == SWIG_NEWOBJ) free((char*)buf5); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Name_hasName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + char *arg1 = (char *) 0 ; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Name_hasName",&obj0)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Name_hasName" "', argument " "1"" of type '" "char const *""'"); + } + arg1 = (char *)(buf1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Name_hasName((char const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return resultobj; +fail: + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_TopicList_createFromResolutionList(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_TopicList_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_TopicList_createFromResolutionList",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_createFromResolutionList" "', argument " "1"" of type '" "blpapi_ResolutionList_t *""'"); + } + arg1 = (blpapi_ResolutionList_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_TopicList_t *)blpapi_TopicList_createFromResolutionList(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_intArray(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + size_t arg1 ; + size_t val1 ; + int ecode1 = 0 ; + PyObject * obj0 = 0 ; + intArray *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:new_intArray",&obj0)) SWIG_fail; + ecode1 = SWIG_AsVal_size_t(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_intArray" "', argument " "1"" of type '" "size_t""'"); + } + arg1 = (size_t)(val1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (intArray *)new_intArray(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_intArray, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_delete_intArray(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + intArray *arg1 = (intArray *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:delete_intArray",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_intArray, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_intArray" "', argument " "1"" of type '" "intArray *""'"); + } + arg1 = (intArray *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + delete_intArray(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_intArray___getitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + intArray *arg1 = (intArray *) 0 ; + size_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:intArray___getitem__",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_intArray, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "intArray___getitem__" "', argument " "1"" of type '" "intArray *""'"); + } + arg1 = (intArray *)(argp1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "intArray___getitem__" "', argument " "2"" of type '" "size_t""'"); + } + arg2 = (size_t)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)intArray___getitem__(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_intArray___setitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + intArray *arg1 = (intArray *) 0 ; + size_t arg2 ; + int arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:intArray___setitem__",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_intArray, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "intArray___setitem__" "', argument " "1"" of type '" "intArray *""'"); + } + arg1 = (intArray *)(argp1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "intArray___setitem__" "', argument " "2"" of type '" "size_t""'"); + } + arg2 = (size_t)(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "intArray___setitem__" "', argument " "3"" of type '" "int""'"); + } + arg3 = (int)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + intArray___setitem__(arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_intArray_cast(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + intArray *arg1 = (intArray *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:intArray_cast",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_intArray, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "intArray_cast" "', argument " "1"" of type '" "intArray *""'"); + } + arg1 = (intArray *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int *)intArray_cast(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_intArray_frompointer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int *arg1 = (int *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + intArray *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:intArray_frompointer",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_int, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "intArray_frompointer" "', argument " "1"" of type '" "int *""'"); + } + arg1 = (int *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (intArray *)intArray_frompointer(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_intArray, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *intArray_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *obj; + if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_intArray, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject *_wrap_new_topicPtrArray(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + size_t arg1 ; + size_t val1 ; + int ecode1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_Topic_t **result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:new_topicPtrArray",&obj0)) SWIG_fail; + ecode1 = SWIG_AsVal_size_t(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_topicPtrArray" "', argument " "1"" of type '" "size_t""'"); + } + arg1 = (size_t)(val1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_Topic_t **)new_topicPtrArray(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_blpapi_Topic, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_delete_topicPtrArray(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Topic_t **arg1 = (blpapi_Topic_t **) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:delete_topicPtrArray",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_blpapi_Topic, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_topicPtrArray" "', argument " "1"" of type '" "blpapi_Topic_t **""'"); + } + arg1 = (blpapi_Topic_t **)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + delete_topicPtrArray(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_topicPtrArray_getitem(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Topic_t **arg1 = (blpapi_Topic_t **) 0 ; + size_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + blpapi_Topic_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:topicPtrArray_getitem",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_blpapi_Topic, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "topicPtrArray_getitem" "', argument " "1"" of type '" "blpapi_Topic_t **""'"); + } + arg1 = (blpapi_Topic_t **)(argp1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "topicPtrArray_getitem" "', argument " "2"" of type '" "size_t""'"); + } + arg2 = (size_t)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_Topic_t *)topicPtrArray_getitem(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Topic, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_topicPtrArray_setitem(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Topic_t **arg1 = (blpapi_Topic_t **) 0 ; + size_t arg2 ; + blpapi_Topic_t *arg3 = (blpapi_Topic_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:topicPtrArray_setitem",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_blpapi_Topic, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "topicPtrArray_setitem" "', argument " "1"" of type '" "blpapi_Topic_t **""'"); + } + arg1 = (blpapi_Topic_t **)(argp1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "topicPtrArray_setitem" "', argument " "2"" of type '" "size_t""'"); + } + arg2 = (size_t)(val2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "topicPtrArray_setitem" "', argument " "3"" of type '" "blpapi_Topic_t *""'"); + } + arg3 = (blpapi_Topic_t *)(argp3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + topicPtrArray_setitem(arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_CorrelationId_t_equals(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_CorrelationId_t *arg1 = (blpapi_CorrelationId_t *) 0 ; + blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:CorrelationId_t_equals",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CorrelationId_t_equals" "', argument " "1"" of type '" "blpapi_CorrelationId_t const *""'"); + } + arg1 = (blpapi_CorrelationId_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CorrelationId_t_equals" "', argument " "2"" of type '" "blpapi_CorrelationId_t const *""'"); + } + arg2 = (blpapi_CorrelationId_t *)(argp2); + result = (int)CorrelationId_t_equals((struct blpapi_CorrelationId_t_ const *)arg1,(struct blpapi_CorrelationId_t_ const *)arg2); + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_CorrelationId_value_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + struct blpapi_CorrelationId_t_ *arg1 = (struct blpapi_CorrelationId_t_ *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_CorrelationId_t__value *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:CorrelationId_value_get",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CorrelationId_value_get" "', argument " "1"" of type '" "struct blpapi_CorrelationId_t_ *""'"); + } + arg1 = (struct blpapi_CorrelationId_t_ *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_CorrelationId_t__value *)& ((arg1)->value); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_CorrelationId_t__value, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_CorrelationId__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + struct blpapi_CorrelationId_t_ *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)":new_CorrelationId")) SWIG_fail; + result = (struct blpapi_CorrelationId_t_ *)new_blpapi_CorrelationId_t___SWIG_0(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_CorrelationId_t_, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_CorrelationId__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + long long arg1 ; + unsigned short arg2 = (unsigned short) 0 ; + long long val1 ; + int ecode1 = 0 ; + unsigned short val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + struct blpapi_CorrelationId_t_ *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O|O:new_CorrelationId",&obj0,&obj1)) SWIG_fail; + ecode1 = SWIG_AsVal_long_SS_long(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_CorrelationId" "', argument " "1"" of type '" "long long""'"); + } + arg1 = (long long)(val1); + if (obj1) { + ecode2 = SWIG_AsVal_unsigned_SS_short(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CorrelationId" "', argument " "2"" of type '" "unsigned short""'"); + } + arg2 = (unsigned short)(val2); + } + result = (struct blpapi_CorrelationId_t_ *)new_blpapi_CorrelationId_t___SWIG_1(arg1,arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_CorrelationId_t_, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_CorrelationId__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + PyObject *arg1 = (PyObject *) 0 ; + unsigned short arg2 = (unsigned short) 0 ; + unsigned short val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + struct blpapi_CorrelationId_t_ *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O|O:new_CorrelationId",&obj0,&obj1)) SWIG_fail; + { + arg1 = obj0; + } + if (obj1) { + ecode2 = SWIG_AsVal_unsigned_SS_short(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CorrelationId" "', argument " "2"" of type '" "unsigned short""'"); + } + arg2 = (unsigned short)(val2); + } + result = (struct blpapi_CorrelationId_t_ *)new_blpapi_CorrelationId_t___SWIG_2(arg1,arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_CorrelationId_t_, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_CorrelationId(PyObject *self, PyObject *args) { + Py_ssize_t argc; + PyObject *argv[3] = { + 0 + }; + Py_ssize_t ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = args ? PyObject_Length(args) : 0; + for (ii = 0; (ii < 2) && (ii < argc); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 0) { + return _wrap_new_CorrelationId__SWIG_0(self, args); + } + if ((argc >= 1) && (argc <= 2)) { + int _v; + { + int res = SWIG_AsVal_long_SS_long(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + if (argc <= 1) { + return _wrap_new_CorrelationId__SWIG_1(self, args); + } + { + int res = SWIG_AsVal_unsigned_SS_short(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_new_CorrelationId__SWIG_1(self, args); + } + } + } + if ((argc >= 1) && (argc <= 2)) { + int _v; + _v = (argv[0] != 0); + if (_v) { + if (argc <= 1) { + return _wrap_new_CorrelationId__SWIG_2(self, args); + } + { + int res = SWIG_AsVal_unsigned_SS_short(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_new_CorrelationId__SWIG_2(self, args); + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_CorrelationId'.\n" + " Possible C/C++ prototypes are:\n" + " blpapi_CorrelationId_t_::blpapi_CorrelationId_t_()\n" + " blpapi_CorrelationId_t_::blpapi_CorrelationId_t_(long long,unsigned short)\n" + " blpapi_CorrelationId_t_::blpapi_CorrelationId_t_(PyObject *,unsigned short)\n"); + return 0; +} + + +SWIGINTERN PyObject *_wrap_delete_CorrelationId(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + struct blpapi_CorrelationId_t_ *arg1 = (struct blpapi_CorrelationId_t_ *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:delete_CorrelationId",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_CorrelationId_t_, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CorrelationId" "', argument " "1"" of type '" "struct blpapi_CorrelationId_t_ *""'"); + } + arg1 = (struct blpapi_CorrelationId_t_ *)(argp1); + delete_blpapi_CorrelationId_t_(arg1); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_CorrelationId_type(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + struct blpapi_CorrelationId_t_ *arg1 = (struct blpapi_CorrelationId_t_ *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + unsigned short result; + + if (!PyArg_ParseTuple(args,(char *)"O:CorrelationId_type",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CorrelationId_type" "', argument " "1"" of type '" "struct blpapi_CorrelationId_t_ const *""'"); + } + arg1 = (struct blpapi_CorrelationId_t_ *)(argp1); + result = (unsigned short)blpapi_CorrelationId_t__type((struct blpapi_CorrelationId_t_ const *)arg1); + resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_CorrelationId_classId(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + struct blpapi_CorrelationId_t_ *arg1 = (struct blpapi_CorrelationId_t_ *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + unsigned short result; + + if (!PyArg_ParseTuple(args,(char *)"O:CorrelationId_classId",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CorrelationId_classId" "', argument " "1"" of type '" "struct blpapi_CorrelationId_t_ const *""'"); + } + arg1 = (struct blpapi_CorrelationId_t_ *)(argp1); + result = (unsigned short)blpapi_CorrelationId_t__classId((struct blpapi_CorrelationId_t_ const *)arg1); + resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_CorrelationId___asObject(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + struct blpapi_CorrelationId_t_ *arg1 = (struct blpapi_CorrelationId_t_ *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + PyObject *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:CorrelationId___asObject",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CorrelationId___asObject" "', argument " "1"" of type '" "struct blpapi_CorrelationId_t_ const *""'"); + } + arg1 = (struct blpapi_CorrelationId_t_ *)(argp1); + result = (PyObject *)blpapi_CorrelationId_t____asObject((struct blpapi_CorrelationId_t_ const *)arg1); + { + resultobj = result; + } + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_CorrelationId___asInteger(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + struct blpapi_CorrelationId_t_ *arg1 = (struct blpapi_CorrelationId_t_ *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + long long result; + + if (!PyArg_ParseTuple(args,(char *)"O:CorrelationId___asInteger",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CorrelationId___asInteger" "', argument " "1"" of type '" "struct blpapi_CorrelationId_t_ const *""'"); + } + arg1 = (struct blpapi_CorrelationId_t_ *)(argp1); + result = (long long)blpapi_CorrelationId_t____asInteger((struct blpapi_CorrelationId_t_ const *)arg1); + resultobj = SWIG_From_long_SS_long((long long)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_CorrelationId___toInteger(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + struct blpapi_CorrelationId_t_ *arg1 = (struct blpapi_CorrelationId_t_ *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + long long result; + + if (!PyArg_ParseTuple(args,(char *)"O:CorrelationId___toInteger",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CorrelationId___toInteger" "', argument " "1"" of type '" "struct blpapi_CorrelationId_t_ const *""'"); + } + arg1 = (struct blpapi_CorrelationId_t_ *)(argp1); + result = (long long)blpapi_CorrelationId_t____toInteger((struct blpapi_CorrelationId_t_ const *)arg1); + resultobj = SWIG_From_long_SS_long((long long)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *CorrelationId_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *obj; + if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_blpapi_CorrelationId_t_, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject *_wrap_new_blpapi_CorrelationId_t__value(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_CorrelationId_t__value *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)":new_blpapi_CorrelationId_t__value")) SWIG_fail; + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_CorrelationId_t__value *)calloc(1, sizeof(blpapi_CorrelationId_t__value)); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_CorrelationId_t__value, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_delete_blpapi_CorrelationId_t__value(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_CorrelationId_t__value *arg1 = (blpapi_CorrelationId_t__value *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:delete_blpapi_CorrelationId_t__value",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_CorrelationId_t__value, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_blpapi_CorrelationId_t__value" "', argument " "1"" of type '" "blpapi_CorrelationId_t__value *""'"); + } + arg1 = (blpapi_CorrelationId_t__value *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + free((char *) arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *blpapi_CorrelationId_t__value_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *obj; + if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_blpapi_CorrelationId_t__value, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject *_wrap_blpapi_Element_setElementFloat(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; + blpapi_Float64_t arg4 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + double val4 ; + int ecode4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Element_setElementFloat",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setElementFloat" "', argument " "1"" of type '" "blpapi_Element_t *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setElementFloat" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_setElementFloat" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); + } + arg3 = (blpapi_Name_t *)(argp3); + ecode4 = SWIG_AsVal_double(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_Element_setElementFloat" "', argument " "4"" of type '" "blpapi_Float64_t""'"); + } + arg4 = (blpapi_Float64_t)(val4); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Element_setElementFloat(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3,arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Element_setValueFloat(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + blpapi_Float64_t arg2 ; + size_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + double val2 ; + int ecode2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Element_setValueFloat",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setValueFloat" "', argument " "1"" of type '" "blpapi_Element_t *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + ecode2 = SWIG_AsVal_double(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Element_setValueFloat" "', argument " "2"" of type '" "blpapi_Float64_t""'"); + } + arg2 = (blpapi_Float64_t)(val2); + ecode3 = SWIG_AsVal_size_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_setValueFloat" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Element_setValueFloat(arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Element_printHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + int arg2 ; + int arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Element_printHelper",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_printHelper" "', argument " "1"" of type '" "blpapi_Element_t *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Element_printHelper" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_printHelper" "', argument " "3"" of type '" "int""'"); + } + arg3 = (int)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (PyObject *)blpapi_Element_printHelper(arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + { + resultobj = result; + } + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Element_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_Name_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Element_name",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_name" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_Name_t *)blpapi_Element_name((struct blpapi_Element const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Element_nameString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + char *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Element_nameString",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_nameString" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (char *)blpapi_Element_nameString((struct blpapi_Element const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Element_definition(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_SchemaElementDefinition_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Element_definition",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_definition" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_SchemaElementDefinition_t *)blpapi_Element_definition((struct blpapi_Element const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_void, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Element_datatype(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Element_datatype",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_datatype" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Element_datatype((struct blpapi_Element const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Element_isComplexType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Element_isComplexType",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_isComplexType" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Element_isComplexType((struct blpapi_Element const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Element_isArray(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Element_isArray",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_isArray" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Element_isArray((struct blpapi_Element const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Element_isReadOnly(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Element_isReadOnly",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_isReadOnly" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Element_isReadOnly((struct blpapi_Element const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Element_numValues(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + size_t result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Element_numValues",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_numValues" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = blpapi_Element_numValues((struct blpapi_Element const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_size_t((size_t)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Element_numElements(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + size_t result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Element_numElements",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_numElements" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = blpapi_Element_numElements((struct blpapi_Element const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_size_t((size_t)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Element_isNullValue(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + size_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Element_isNullValue",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_isNullValue" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Element_isNullValue" "', argument " "2"" of type '" "size_t""'"); + } + arg2 = (size_t)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Element_isNullValue((struct blpapi_Element const *)arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Element_isNull(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Element_isNull",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_isNull" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Element_isNull((struct blpapi_Element const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Element_getElementAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + blpapi_Element_t **arg2 = (blpapi_Element_t **) 0 ; + size_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_Element_t *temp2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Element_getElementAt",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getElementAt" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + ecode3 = SWIG_AsVal_size_t(obj1, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getElementAt" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Element_getElementAt((struct blpapi_Element const *)arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Element, 0)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Element_getElement(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + blpapi_Element_t **arg2 = (blpapi_Element_t **) 0 ; + char *arg3 = (char *) 0 ; + blpapi_Name_t *arg4 = (blpapi_Name_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_Element_t *temp2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Element_getElement",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getElement" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_getElement" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = (char *)(buf3); + res4 = SWIG_ConvertPtr(obj2, &argp4,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Element_getElement" "', argument " "4"" of type '" "blpapi_Name_t const *""'"); + } + arg4 = (blpapi_Name_t *)(argp4); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Element_getElement((struct blpapi_Element const *)arg1,arg2,(char const *)arg3,(struct blpapi_Name const *)arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Element, 0)); + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + return resultobj; +fail: + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Element_hasElementEx(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; + int arg4 ; + int arg5 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + int val4 ; + int ecode4 = 0 ; + int val5 ; + int ecode5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOOO:blpapi_Element_hasElementEx",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_hasElementEx" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_hasElementEx" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_hasElementEx" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); + } + arg3 = (blpapi_Name_t *)(argp3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_Element_hasElementEx" "', argument " "4"" of type '" "int""'"); + } + arg4 = (int)(val4); + ecode5 = SWIG_AsVal_int(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_Element_hasElementEx" "', argument " "5"" of type '" "int""'"); + } + arg5 = (int)(val5); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Element_hasElementEx((struct blpapi_Element const *)arg1,(char const *)arg2,(struct blpapi_Name const *)arg3,arg4,arg5); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsBool(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + blpapi_Bool_t *arg2 = (blpapi_Bool_t *) 0 ; + size_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_Bool_t temp2 ; + int res2 = SWIG_TMPOBJ ; + size_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Element_getValueAsBool",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsBool" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + ecode3 = SWIG_AsVal_size_t(obj1, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getValueAsBool" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Element_getValueAsBool((struct blpapi_Element const *)arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (SWIG_IsTmpObj(res2)) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg2))); + } else { + int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_int, new_flags)); + } + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsChar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + blpapi_Char_t *arg2 = (blpapi_Char_t *) 0 ; + size_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Element_getValueAsChar",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsChar" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_getValueAsChar" "', argument " "2"" of type '" "blpapi_Char_t *""'"); + } + arg2 = (blpapi_Char_t *)(buf2); + ecode3 = SWIG_AsVal_size_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getValueAsChar" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Element_getValueAsChar((struct blpapi_Element const *)arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsInt32(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + blpapi_Int32_t *arg2 = (blpapi_Int32_t *) 0 ; + size_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Element_getValueAsInt32",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsInt32" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_getValueAsInt32" "', argument " "2"" of type '" "blpapi_Int32_t *""'"); + } + arg2 = (blpapi_Int32_t *)(argp2); + ecode3 = SWIG_AsVal_size_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getValueAsInt32" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Element_getValueAsInt32((struct blpapi_Element const *)arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsInt64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + blpapi_Int64_t *arg2 = (blpapi_Int64_t *) 0 ; + size_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_Int64_t temp2 ; + int res2 = SWIG_TMPOBJ ; + size_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Element_getValueAsInt64",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsInt64" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + ecode3 = SWIG_AsVal_size_t(obj1, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getValueAsInt64" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Element_getValueAsInt64((struct blpapi_Element const *)arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (SWIG_IsTmpObj(res2)) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_long_SS_long((*arg2))); + } else { + int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_long_long, new_flags)); + } + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsFloat64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + blpapi_Float64_t *arg2 = (blpapi_Float64_t *) 0 ; + size_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_Float64_t temp2 ; + int res2 = SWIG_TMPOBJ ; + size_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Element_getValueAsFloat64",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsFloat64" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + ecode3 = SWIG_AsVal_size_t(obj1, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getValueAsFloat64" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Element_getValueAsFloat64((struct blpapi_Element const *)arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (SWIG_IsTmpObj(res2)) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_double((*arg2))); + } else { + int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_double, new_flags)); + } + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + char **arg2 = (char **) 0 ; + size_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + char *temp2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Element_getValueAsString",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsString" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + ecode3 = SWIG_AsVal_size_t(obj1, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getValueAsString" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Element_getValueAsString((struct blpapi_Element const *)arg1,(char const **)arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsDatetime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + blpapi_Datetime_t *arg2 = (blpapi_Datetime_t *) 0 ; + size_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_Datetime_t temp2 ; + size_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Element_getValueAsDatetime",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsDatetime" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + ecode3 = SWIG_AsVal_size_t(obj1, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getValueAsDatetime" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Element_getValueAsDatetime((struct blpapi_Element const *)arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + { + blpapi_Datetime_t *outputPtr = (blpapi_Datetime_t *) malloc(sizeof(blpapi_Datetime_t)); + *outputPtr = *arg2; + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(outputPtr, SWIGTYPE_p_blpapi_Datetime_tag, SWIG_POINTER_OWN)); + } + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsHighPrecisionDatetime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + blpapi_HighPrecisionDatetime_t *arg2 = (blpapi_HighPrecisionDatetime_t *) 0 ; + size_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_HighPrecisionDatetime_t temp2 ; + size_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Element_getValueAsHighPrecisionDatetime",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsHighPrecisionDatetime" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + ecode3 = SWIG_AsVal_size_t(obj1, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getValueAsHighPrecisionDatetime" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Element_getValueAsHighPrecisionDatetime((struct blpapi_Element const *)arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + { + blpapi_HighPrecisionDatetime_t *outputPtr = (blpapi_HighPrecisionDatetime_t *) malloc(sizeof(blpapi_HighPrecisionDatetime_t)); + *outputPtr = *arg2; + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(outputPtr, SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, SWIG_POINTER_OWN)); + } + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsElement(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + blpapi_Element_t **arg2 = (blpapi_Element_t **) 0 ; + size_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_Element_t *temp2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Element_getValueAsElement",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsElement" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + ecode3 = SWIG_AsVal_size_t(obj1, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getValueAsElement" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Element_getValueAsElement((struct blpapi_Element const *)arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Element, 0)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + blpapi_Name_t **arg2 = (blpapi_Name_t **) 0 ; + size_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_Name_t *temp2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Element_getValueAsName",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsName" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + ecode3 = SWIG_AsVal_size_t(obj1, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getValueAsName" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Element_getValueAsName((struct blpapi_Element const *)arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Name, 0)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Element_getChoice(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + blpapi_Element_t **arg2 = (blpapi_Element_t **) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_Element_t *temp2 = 0 ; + PyObject * obj0 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Element_getChoice",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getChoice" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Element_getChoice((struct blpapi_Element const *)arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Element, 0)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Element_setValueBool(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + blpapi_Bool_t arg2 ; + size_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Element_setValueBool",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setValueBool" "', argument " "1"" of type '" "blpapi_Element_t *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Element_setValueBool" "', argument " "2"" of type '" "blpapi_Bool_t""'"); + } + arg2 = (blpapi_Bool_t)(val2); + ecode3 = SWIG_AsVal_size_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_setValueBool" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Element_setValueBool(arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Element_setValueInt32(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + blpapi_Int32_t arg2 ; + size_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Element_setValueInt32",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setValueInt32" "', argument " "1"" of type '" "blpapi_Element_t *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Element_setValueInt32" "', argument " "2"" of type '" "blpapi_Int32_t""'"); + } + arg2 = (blpapi_Int32_t)(val2); + ecode3 = SWIG_AsVal_size_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_setValueInt32" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Element_setValueInt32(arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Element_setValueInt64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + blpapi_Int64_t arg2 ; + size_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + long long val2 ; + int ecode2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Element_setValueInt64",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setValueInt64" "', argument " "1"" of type '" "blpapi_Element_t *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + ecode2 = SWIG_AsVal_long_SS_long(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Element_setValueInt64" "', argument " "2"" of type '" "blpapi_Int64_t""'"); + } + arg2 = (blpapi_Int64_t)(val2); + ecode3 = SWIG_AsVal_size_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_setValueInt64" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Element_setValueInt64(arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Element_setValueString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + char *arg2 = (char *) 0 ; + size_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Element_setValueString",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setValueString" "', argument " "1"" of type '" "blpapi_Element_t *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setValueString" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + ecode3 = SWIG_AsVal_size_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_setValueString" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Element_setValueString(arg1,(char const *)arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Element_setValueDatetime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + blpapi_Datetime_t *arg2 = (blpapi_Datetime_t *) 0 ; + size_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Element_setValueDatetime",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setValueDatetime" "', argument " "1"" of type '" "blpapi_Element_t *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setValueDatetime" "', argument " "2"" of type '" "blpapi_Datetime_t const *""'"); + } + arg2 = (blpapi_Datetime_t *)(argp2); + ecode3 = SWIG_AsVal_size_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_setValueDatetime" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Element_setValueDatetime(arg1,(struct blpapi_Datetime_tag const *)arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Element_setValueFromName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; + size_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Element_setValueFromName",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setValueFromName" "', argument " "1"" of type '" "blpapi_Element_t *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setValueFromName" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); + } + arg2 = (blpapi_Name_t *)(argp2); + ecode3 = SWIG_AsVal_size_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_setValueFromName" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Element_setValueFromName(arg1,(struct blpapi_Name const *)arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Element_setElementBool(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; + blpapi_Bool_t arg4 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Element_setElementBool",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setElementBool" "', argument " "1"" of type '" "blpapi_Element_t *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setElementBool" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_setElementBool" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); + } + arg3 = (blpapi_Name_t *)(argp3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_Element_setElementBool" "', argument " "4"" of type '" "blpapi_Bool_t""'"); + } + arg4 = (blpapi_Bool_t)(val4); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Element_setElementBool(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3,arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Element_setElementInt32(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; + blpapi_Int32_t arg4 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Element_setElementInt32",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setElementInt32" "', argument " "1"" of type '" "blpapi_Element_t *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setElementInt32" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_setElementInt32" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); + } + arg3 = (blpapi_Name_t *)(argp3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_Element_setElementInt32" "', argument " "4"" of type '" "blpapi_Int32_t""'"); + } + arg4 = (blpapi_Int32_t)(val4); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Element_setElementInt32(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3,arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Element_setElementInt64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; + blpapi_Int64_t arg4 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + long long val4 ; + int ecode4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Element_setElementInt64",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setElementInt64" "', argument " "1"" of type '" "blpapi_Element_t *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setElementInt64" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_setElementInt64" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); + } + arg3 = (blpapi_Name_t *)(argp3); + ecode4 = SWIG_AsVal_long_SS_long(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_Element_setElementInt64" "', argument " "4"" of type '" "blpapi_Int64_t""'"); + } + arg4 = (blpapi_Int64_t)(val4); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Element_setElementInt64(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3,arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Element_setElementString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; + char *arg4 = (char *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + int res4 ; + char *buf4 = 0 ; + int alloc4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Element_setElementString",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setElementString" "', argument " "1"" of type '" "blpapi_Element_t *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setElementString" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_setElementString" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); + } + arg3 = (blpapi_Name_t *)(argp3); + res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Element_setElementString" "', argument " "4"" of type '" "char const *""'"); + } + arg4 = (char *)(buf4); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Element_setElementString(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3,(char const *)arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Element_setElementDatetime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; + blpapi_Datetime_t *arg4 = (blpapi_Datetime_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Element_setElementDatetime",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setElementDatetime" "', argument " "1"" of type '" "blpapi_Element_t *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setElementDatetime" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_setElementDatetime" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); + } + arg3 = (blpapi_Name_t *)(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Element_setElementDatetime" "', argument " "4"" of type '" "blpapi_Datetime_t const *""'"); + } + arg4 = (blpapi_Datetime_t *)(argp4); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Element_setElementDatetime(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3,(struct blpapi_Datetime_tag const *)arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Element_setElementFromName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; + blpapi_Name_t *arg4 = (blpapi_Name_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Element_setElementFromName",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setElementFromName" "', argument " "1"" of type '" "blpapi_Element_t *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setElementFromName" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_setElementFromName" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); + } + arg3 = (blpapi_Name_t *)(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Element_setElementFromName" "', argument " "4"" of type '" "blpapi_Name_t const *""'"); + } + arg4 = (blpapi_Name_t *)(argp4); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Element_setElementFromName(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3,(struct blpapi_Name const *)arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Element_appendElement(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + blpapi_Element_t **arg2 = (blpapi_Element_t **) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_Element_t *temp2 = 0 ; + PyObject * obj0 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Element_appendElement",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_appendElement" "', argument " "1"" of type '" "blpapi_Element_t *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Element_appendElement(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Element, 0)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Element_setChoice(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + blpapi_Element_t **arg2 = (blpapi_Element_t **) 0 ; + char *arg3 = (char *) 0 ; + blpapi_Name_t *arg4 = (blpapi_Name_t *) 0 ; + size_t arg5 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_Element_t *temp2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + size_t val5 ; + int ecode5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Element_setChoice",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setChoice" "', argument " "1"" of type '" "blpapi_Element_t *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_setChoice" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = (char *)(buf3); + res4 = SWIG_ConvertPtr(obj2, &argp4,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Element_setChoice" "', argument " "4"" of type '" "blpapi_Name_t const *""'"); + } + arg4 = (blpapi_Name_t *)(argp4); + ecode5 = SWIG_AsVal_size_t(obj3, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_Element_setChoice" "', argument " "5"" of type '" "size_t""'"); + } + arg5 = (size_t)(val5); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Element_setChoice(arg1,arg2,(char const *)arg3,(struct blpapi_Name const *)arg4,arg5); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Element, 0)); + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + return resultobj; +fail: + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueFloat(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; + blpapi_Float64_t arg4 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + double val4 ; + int ecode4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_EventFormatter_setValueFloat",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_setValueFloat" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); + } + arg1 = (blpapi_EventFormatter_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_setValueFloat" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_setValueFloat" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); + } + arg3 = (blpapi_Name_t *)(argp3); + ecode4 = SWIG_AsVal_double(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_EventFormatter_setValueFloat" "', argument " "4"" of type '" "blpapi_Float64_t""'"); + } + arg4 = (blpapi_Float64_t)(val4); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_EventFormatter_setValueFloat(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3,arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueFloat(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; + blpapi_Float64_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + double val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_EventFormatter_appendValueFloat",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendValueFloat" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); + } + arg1 = (blpapi_EventFormatter_t *)(argp1); + ecode2 = SWIG_AsVal_double(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_EventFormatter_appendValueFloat" "', argument " "2"" of type '" "blpapi_Float64_t""'"); + } + arg2 = (blpapi_Float64_t)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_EventFormatter_appendValueFloat(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Event_t *arg1 = (blpapi_Event_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_EventFormatter_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_EventFormatter_create",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Event, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_create" "', argument " "1"" of type '" "blpapi_Event_t *""'"); + } + arg1 = (blpapi_Event_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_EventFormatter_t *)blpapi_EventFormatter_create(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_EventFormatter_destroy",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_destroy" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); + } + arg1 = (blpapi_EventFormatter_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_EventFormatter_destroy(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendMessage(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; + blpapi_Topic_t *arg4 = (blpapi_Topic_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_EventFormatter_appendMessage",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendMessage" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); + } + arg1 = (blpapi_EventFormatter_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendMessage" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_appendMessage" "', argument " "3"" of type '" "blpapi_Name_t *""'"); + } + arg3 = (blpapi_Name_t *)(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_EventFormatter_appendMessage" "', argument " "4"" of type '" "blpapi_Topic_t const *""'"); + } + arg4 = (blpapi_Topic_t *)(argp4); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_EventFormatter_appendMessage(arg1,(char const *)arg2,arg3,(struct blpapi_Topic const *)arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendMessageSeq(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; + blpapi_Topic_t *arg4 = (blpapi_Topic_t *) 0 ; + unsigned int arg5 ; + unsigned int arg6 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + unsigned int val5 ; + int ecode5 = 0 ; + unsigned int val6 ; + int ecode6 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOO:blpapi_EventFormatter_appendMessageSeq",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendMessageSeq" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); + } + arg1 = (blpapi_EventFormatter_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendMessageSeq" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_appendMessageSeq" "', argument " "3"" of type '" "blpapi_Name_t *""'"); + } + arg3 = (blpapi_Name_t *)(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_EventFormatter_appendMessageSeq" "', argument " "4"" of type '" "blpapi_Topic_t const *""'"); + } + arg4 = (blpapi_Topic_t *)(argp4); + ecode5 = SWIG_AsVal_unsigned_SS_int(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_EventFormatter_appendMessageSeq" "', argument " "5"" of type '" "unsigned int""'"); + } + arg5 = (unsigned int)(val5); + ecode6 = SWIG_AsVal_unsigned_SS_int(obj5, &val6); + if (!SWIG_IsOK(ecode6)) { + SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "blpapi_EventFormatter_appendMessageSeq" "', argument " "6"" of type '" "unsigned int""'"); + } + arg6 = (unsigned int)(val6); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_EventFormatter_appendMessageSeq(arg1,(char const *)arg2,arg3,(struct blpapi_Topic const *)arg4,arg5,arg6); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendResponse(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_EventFormatter_appendResponse",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendResponse" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); + } + arg1 = (blpapi_EventFormatter_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendResponse" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_appendResponse" "', argument " "3"" of type '" "blpapi_Name_t *""'"); + } + arg3 = (blpapi_Name_t *)(argp3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_EventFormatter_appendResponse(arg1,(char const *)arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendRecapMessage(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; + blpapi_Topic_t *arg2 = (blpapi_Topic_t *) 0 ; + blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_EventFormatter_appendRecapMessage",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendRecapMessage" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); + } + arg1 = (blpapi_EventFormatter_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendRecapMessage" "', argument " "2"" of type '" "blpapi_Topic_t const *""'"); + } + arg2 = (blpapi_Topic_t *)(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_appendRecapMessage" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); + } + arg3 = (blpapi_CorrelationId_t *)(argp3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_EventFormatter_appendRecapMessage(arg1,(struct blpapi_Topic const *)arg2,(struct blpapi_CorrelationId_t_ const *)arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendRecapMessageSeq(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; + blpapi_Topic_t *arg2 = (blpapi_Topic_t *) 0 ; + blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; + unsigned int arg4 ; + unsigned int arg5 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + unsigned int val4 ; + int ecode4 = 0 ; + unsigned int val5 ; + int ecode5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOOO:blpapi_EventFormatter_appendRecapMessageSeq",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendRecapMessageSeq" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); + } + arg1 = (blpapi_EventFormatter_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendRecapMessageSeq" "', argument " "2"" of type '" "blpapi_Topic_t const *""'"); + } + arg2 = (blpapi_Topic_t *)(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_appendRecapMessageSeq" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); + } + arg3 = (blpapi_CorrelationId_t *)(argp3); + ecode4 = SWIG_AsVal_unsigned_SS_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_EventFormatter_appendRecapMessageSeq" "', argument " "4"" of type '" "unsigned int""'"); + } + arg4 = (unsigned int)(val4); + ecode5 = SWIG_AsVal_unsigned_SS_int(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_EventFormatter_appendRecapMessageSeq" "', argument " "5"" of type '" "unsigned int""'"); + } + arg5 = (unsigned int)(val5); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_EventFormatter_appendRecapMessageSeq(arg1,(struct blpapi_Topic const *)arg2,(struct blpapi_CorrelationId_t_ const *)arg3,arg4,arg5); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendFragmentedRecapMessage(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; + blpapi_Topic_t *arg4 = (blpapi_Topic_t *) 0 ; + blpapi_CorrelationId_t *arg5 = (blpapi_CorrelationId_t *) 0 ; + int arg6 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + void *argp5 = 0 ; + int res5 = 0 ; + int val6 ; + int ecode6 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOO:blpapi_EventFormatter_appendFragmentedRecapMessage",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessage" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); + } + arg1 = (blpapi_EventFormatter_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessage" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessage" "', argument " "3"" of type '" "blpapi_Name_t *""'"); + } + arg3 = (blpapi_Name_t *)(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessage" "', argument " "4"" of type '" "blpapi_Topic_t const *""'"); + } + arg4 = (blpapi_Topic_t *)(argp4); + res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res5)) { + SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessage" "', argument " "5"" of type '" "blpapi_CorrelationId_t const *""'"); + } + arg5 = (blpapi_CorrelationId_t *)(argp5); + ecode6 = SWIG_AsVal_int(obj5, &val6); + if (!SWIG_IsOK(ecode6)) { + SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessage" "', argument " "6"" of type '" "int""'"); + } + arg6 = (int)(val6); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_EventFormatter_appendFragmentedRecapMessage(arg1,(char const *)arg2,arg3,(struct blpapi_Topic const *)arg4,(struct blpapi_CorrelationId_t_ const *)arg5,arg6); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendFragmentedRecapMessageSeq(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; + blpapi_Topic_t *arg4 = (blpapi_Topic_t *) 0 ; + int arg5 ; + unsigned int arg6 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + int val5 ; + int ecode5 = 0 ; + unsigned int val6 ; + int ecode6 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOO:blpapi_EventFormatter_appendFragmentedRecapMessageSeq",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessageSeq" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); + } + arg1 = (blpapi_EventFormatter_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessageSeq" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessageSeq" "', argument " "3"" of type '" "blpapi_Name_t *""'"); + } + arg3 = (blpapi_Name_t *)(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessageSeq" "', argument " "4"" of type '" "blpapi_Topic_t const *""'"); + } + arg4 = (blpapi_Topic_t *)(argp4); + ecode5 = SWIG_AsVal_int(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessageSeq" "', argument " "5"" of type '" "int""'"); + } + arg5 = (int)(val5); + ecode6 = SWIG_AsVal_unsigned_SS_int(obj5, &val6); + if (!SWIG_IsOK(ecode6)) { + SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessageSeq" "', argument " "6"" of type '" "unsigned int""'"); + } + arg6 = (unsigned int)(val6); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_EventFormatter_appendFragmentedRecapMessageSeq(arg1,(char const *)arg2,arg3,(struct blpapi_Topic const *)arg4,arg5,arg6); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueBool(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; + blpapi_Bool_t arg4 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_EventFormatter_setValueBool",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_setValueBool" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); + } + arg1 = (blpapi_EventFormatter_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_setValueBool" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_setValueBool" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); + } + arg3 = (blpapi_Name_t *)(argp3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_EventFormatter_setValueBool" "', argument " "4"" of type '" "blpapi_Bool_t""'"); + } + arg4 = (blpapi_Bool_t)(val4); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_EventFormatter_setValueBool(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3,arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueChar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; + char arg4 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + char val4 ; + int ecode4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_EventFormatter_setValueChar",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_setValueChar" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); + } + arg1 = (blpapi_EventFormatter_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_setValueChar" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_setValueChar" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); + } + arg3 = (blpapi_Name_t *)(argp3); + ecode4 = SWIG_AsVal_char(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_EventFormatter_setValueChar" "', argument " "4"" of type '" "char""'"); + } + arg4 = (char)(val4); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_EventFormatter_setValueChar(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3,arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueInt32(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; + blpapi_Int32_t arg4 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_EventFormatter_setValueInt32",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_setValueInt32" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); + } + arg1 = (blpapi_EventFormatter_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_setValueInt32" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_setValueInt32" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); + } + arg3 = (blpapi_Name_t *)(argp3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_EventFormatter_setValueInt32" "', argument " "4"" of type '" "blpapi_Int32_t""'"); + } + arg4 = (blpapi_Int32_t)(val4); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_EventFormatter_setValueInt32(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3,arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueInt64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; + blpapi_Int64_t arg4 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + long long val4 ; + int ecode4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_EventFormatter_setValueInt64",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_setValueInt64" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); + } + arg1 = (blpapi_EventFormatter_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_setValueInt64" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_setValueInt64" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); + } + arg3 = (blpapi_Name_t *)(argp3); + ecode4 = SWIG_AsVal_long_SS_long(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_EventFormatter_setValueInt64" "', argument " "4"" of type '" "blpapi_Int64_t""'"); + } + arg4 = (blpapi_Int64_t)(val4); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_EventFormatter_setValueInt64(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3,arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueDatetime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; + blpapi_Datetime_t *arg4 = (blpapi_Datetime_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_EventFormatter_setValueDatetime",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_setValueDatetime" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); + } + arg1 = (blpapi_EventFormatter_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_setValueDatetime" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_setValueDatetime" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); + } + arg3 = (blpapi_Name_t *)(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_EventFormatter_setValueDatetime" "', argument " "4"" of type '" "blpapi_Datetime_t const *""'"); + } + arg4 = (blpapi_Datetime_t *)(argp4); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_EventFormatter_setValueDatetime(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3,(struct blpapi_Datetime_tag const *)arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; + char *arg4 = (char *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + int res4 ; + char *buf4 = 0 ; + int alloc4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_EventFormatter_setValueString",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_setValueString" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); + } + arg1 = (blpapi_EventFormatter_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_setValueString" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_setValueString" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); + } + arg3 = (blpapi_Name_t *)(argp3); + res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_EventFormatter_setValueString" "', argument " "4"" of type '" "char const *""'"); + } + arg4 = (char *)(buf4); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_EventFormatter_setValueString(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3,(char const *)arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueFromName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; + blpapi_Name_t *arg4 = (blpapi_Name_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_EventFormatter_setValueFromName",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_setValueFromName" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); + } + arg1 = (blpapi_EventFormatter_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_setValueFromName" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_setValueFromName" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); + } + arg3 = (blpapi_Name_t *)(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_EventFormatter_setValueFromName" "', argument " "4"" of type '" "blpapi_Name_t const *""'"); + } + arg4 = (blpapi_Name_t *)(argp4); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_EventFormatter_setValueFromName(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3,(struct blpapi_Name const *)arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueNull(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_EventFormatter_setValueNull",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_setValueNull" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); + } + arg1 = (blpapi_EventFormatter_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_setValueNull" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_setValueNull" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); + } + arg3 = (blpapi_Name_t *)(argp3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_EventFormatter_setValueNull(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_pushElement(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_EventFormatter_pushElement",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_pushElement" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); + } + arg1 = (blpapi_EventFormatter_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_pushElement" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_pushElement" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); + } + arg3 = (blpapi_Name_t *)(argp3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_EventFormatter_pushElement(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_popElement(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_EventFormatter_popElement",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_popElement" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); + } + arg1 = (blpapi_EventFormatter_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_EventFormatter_popElement(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueBool(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; + blpapi_Bool_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_EventFormatter_appendValueBool",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendValueBool" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); + } + arg1 = (blpapi_EventFormatter_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_EventFormatter_appendValueBool" "', argument " "2"" of type '" "blpapi_Bool_t""'"); + } + arg2 = (blpapi_Bool_t)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_EventFormatter_appendValueBool(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueChar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; + char arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + char val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_EventFormatter_appendValueChar",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendValueChar" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); + } + arg1 = (blpapi_EventFormatter_t *)(argp1); + ecode2 = SWIG_AsVal_char(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_EventFormatter_appendValueChar" "', argument " "2"" of type '" "char""'"); + } + arg2 = (char)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_EventFormatter_appendValueChar(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueInt32(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; + blpapi_Int32_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_EventFormatter_appendValueInt32",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendValueInt32" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); + } + arg1 = (blpapi_EventFormatter_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_EventFormatter_appendValueInt32" "', argument " "2"" of type '" "blpapi_Int32_t""'"); + } + arg2 = (blpapi_Int32_t)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_EventFormatter_appendValueInt32(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueInt64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; + blpapi_Int64_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + long long val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_EventFormatter_appendValueInt64",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendValueInt64" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); + } + arg1 = (blpapi_EventFormatter_t *)(argp1); + ecode2 = SWIG_AsVal_long_SS_long(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_EventFormatter_appendValueInt64" "', argument " "2"" of type '" "blpapi_Int64_t""'"); + } + arg2 = (blpapi_Int64_t)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_EventFormatter_appendValueInt64(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueDatetime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; + blpapi_Datetime_t *arg2 = (blpapi_Datetime_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_EventFormatter_appendValueDatetime",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendValueDatetime" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); + } + arg1 = (blpapi_EventFormatter_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendValueDatetime" "', argument " "2"" of type '" "blpapi_Datetime_t const *""'"); + } + arg2 = (blpapi_Datetime_t *)(argp2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_EventFormatter_appendValueDatetime(arg1,(struct blpapi_Datetime_tag const *)arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; + char *arg2 = (char *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_EventFormatter_appendValueString",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendValueString" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); + } + arg1 = (blpapi_EventFormatter_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendValueString" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_EventFormatter_appendValueString(arg1,(char const *)arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueFromName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; + blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_EventFormatter_appendValueFromName",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendValueFromName" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); + } + arg1 = (blpapi_EventFormatter_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendValueFromName" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); + } + arg2 = (blpapi_Name_t *)(argp2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_EventFormatter_appendValueFromName(arg1,(struct blpapi_Name const *)arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendElement(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_EventFormatter_appendElement",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendElement" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); + } + arg1 = (blpapi_EventFormatter_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_EventFormatter_appendElement(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Session_createHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; + blpapi_EventDispatcher_t *arg3 = (blpapi_EventDispatcher_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + blpapi_Session_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:Session_createHelper",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_createHelper" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + { + arg2 = obj1; + } + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_EventDispatcher, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Session_createHelper" "', argument " "3"" of type '" "blpapi_EventDispatcher_t *""'"); + } + arg3 = (blpapi_EventDispatcher_t *)(argp3); + result = (blpapi_Session_t *)Session_createHelper(arg1,arg2,arg3); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Session, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Session_destroyHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Session_destroyHelper",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_destroyHelper" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + } + arg1 = (blpapi_Session_t *)(argp1); + { + arg2 = obj1; + } + Session_destroyHelper(arg1,arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_EventDispatcher_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + size_t arg1 ; + size_t val1 ; + int ecode1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_EventDispatcher_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_EventDispatcher_create",&obj0)) SWIG_fail; + ecode1 = SWIG_AsVal_size_t(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "blpapi_EventDispatcher_create" "', argument " "1"" of type '" "size_t""'"); + } + arg1 = (size_t)(val1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_EventDispatcher_t *)blpapi_EventDispatcher_create(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_EventDispatcher, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_EventDispatcher_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_EventDispatcher_t *arg1 = (blpapi_EventDispatcher_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_EventDispatcher_destroy",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventDispatcher, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventDispatcher_destroy" "', argument " "1"" of type '" "blpapi_EventDispatcher_t *""'"); + } + arg1 = (blpapi_EventDispatcher_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_EventDispatcher_destroy(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_EventDispatcher_start(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_EventDispatcher_t *arg1 = (blpapi_EventDispatcher_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_EventDispatcher_start",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventDispatcher, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventDispatcher_start" "', argument " "1"" of type '" "blpapi_EventDispatcher_t *""'"); + } + arg1 = (blpapi_EventDispatcher_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_EventDispatcher_start(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_ProviderSession_createHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; + blpapi_EventDispatcher_t *arg3 = (blpapi_EventDispatcher_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + blpapi_ProviderSession_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:ProviderSession_createHelper",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProviderSession_createHelper" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + { + arg2 = obj1; + } + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_EventDispatcher, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProviderSession_createHelper" "', argument " "3"" of type '" "blpapi_EventDispatcher_t *""'"); + } + arg3 = (blpapi_EventDispatcher_t *)(argp3); + result = (blpapi_ProviderSession_t *)ProviderSession_createHelper(arg1,arg2,arg3); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_ProviderSession_destroyHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:ProviderSession_destroyHelper",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProviderSession_destroyHelper" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); + } + arg1 = (blpapi_ProviderSession_t *)(argp1); + { + arg2 = obj1; + } + ProviderSession_destroyHelper(arg1,arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_ProviderSession_terminateSubscriptionsOnTopic(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; + blpapi_Topic_t *arg2 = (blpapi_Topic_t *) 0 ; + char *arg3 = (char *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOO:ProviderSession_terminateSubscriptionsOnTopic",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProviderSession_terminateSubscriptionsOnTopic" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); + } + arg1 = (blpapi_ProviderSession_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProviderSession_terminateSubscriptionsOnTopic" "', argument " "2"" of type '" "blpapi_Topic_t const *""'"); + } + arg2 = (blpapi_Topic_t *)(argp2); + res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProviderSession_terminateSubscriptionsOnTopic" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = (char *)(buf3); + result = (int)ProviderSession_terminateSubscriptionsOnTopic(arg1,(struct blpapi_Topic const *)arg2,(char const *)arg3); + resultobj = SWIG_From_int((int)(result)); + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + return resultobj; +fail: + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_getLastErrorDescription(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int val1 ; + int ecode1 = 0 ; + PyObject * obj0 = 0 ; + char *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_getLastErrorDescription",&obj0)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "blpapi_getLastErrorDescription" "', argument " "1"" of type '" "int""'"); + } + arg1 = (int)(val1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (char *)blpapi_getLastErrorDescription(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)":blpapi_SessionOptions_create")) SWIG_fail; + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_SessionOptions_t *)blpapi_SessionOptions_create(); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_destroy",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_destroy" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_SessionOptions_destroy(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setServerHost(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + char *arg2 = (char *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setServerHost",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setServerHost" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setServerHost" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_setServerHost(arg1,(char const *)arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setServerPort(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + unsigned short arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + unsigned short val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setServerPort",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setServerPort" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_short(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setServerPort" "', argument " "2"" of type '" "unsigned short""'"); + } + arg2 = (unsigned short)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_setServerPort(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setServerAddress(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + char *arg2 = (char *) 0 ; + unsigned short arg3 ; + size_t arg4 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + unsigned short val3 ; + int ecode3 = 0 ; + size_t val4 ; + int ecode4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_SessionOptions_setServerAddress",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setServerAddress" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setServerAddress" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_SessionOptions_setServerAddress" "', argument " "3"" of type '" "unsigned short""'"); + } + arg3 = (unsigned short)(val3); + ecode4 = SWIG_AsVal_size_t(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_SessionOptions_setServerAddress" "', argument " "4"" of type '" "size_t""'"); + } + arg4 = (size_t)(val4); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_setServerAddress(arg1,(char const *)arg2,arg3,arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_removeServerAddress(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + size_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_removeServerAddress",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_removeServerAddress" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_removeServerAddress" "', argument " "2"" of type '" "size_t""'"); + } + arg2 = (size_t)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_removeServerAddress(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setConnectTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + unsigned int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + unsigned int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setConnectTimeout",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setConnectTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setConnectTimeout" "', argument " "2"" of type '" "unsigned int""'"); + } + arg2 = (unsigned int)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_setConnectTimeout(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setDefaultServices(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + char *arg2 = (char *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setDefaultServices",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setDefaultServices" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setDefaultServices" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_setDefaultServices(arg1,(char const *)arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setDefaultSubscriptionService(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + char *arg2 = (char *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setDefaultSubscriptionService",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setDefaultSubscriptionService" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setDefaultSubscriptionService" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_setDefaultSubscriptionService(arg1,(char const *)arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setDefaultTopicPrefix(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + char *arg2 = (char *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setDefaultTopicPrefix",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setDefaultTopicPrefix" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setDefaultTopicPrefix" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_SessionOptions_setDefaultTopicPrefix(arg1,(char const *)arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setClientMode(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setClientMode",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setClientMode" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setClientMode" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_SessionOptions_setClientMode(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setMaxPendingRequests(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setMaxPendingRequests",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setMaxPendingRequests" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setMaxPendingRequests" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_SessionOptions_setMaxPendingRequests(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setAutoRestartOnDisconnection(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setAutoRestartOnDisconnection",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setAutoRestartOnDisconnection" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setAutoRestartOnDisconnection" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_SessionOptions_setAutoRestartOnDisconnection(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setAuthenticationOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + char *arg2 = (char *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setAuthenticationOptions",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setAuthenticationOptions" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setAuthenticationOptions" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_SessionOptions_setAuthenticationOptions(arg1,(char const *)arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setNumStartAttempts(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setNumStartAttempts",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setNumStartAttempts" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setNumStartAttempts" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_SessionOptions_setNumStartAttempts(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setMaxEventQueueSize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + size_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setMaxEventQueueSize",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setMaxEventQueueSize" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setMaxEventQueueSize" "', argument " "2"" of type '" "size_t""'"); + } + arg2 = (size_t)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_SessionOptions_setMaxEventQueueSize(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + float arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + float val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + ecode2 = SWIG_AsVal_float(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark" "', argument " "2"" of type '" "float""'"); + } + arg2 = (float)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + float arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + float val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + ecode2 = SWIG_AsVal_float(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark" "', argument " "2"" of type '" "float""'"); + } + arg2 = (float)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setDefaultKeepAliveInactivityTime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setDefaultKeepAliveInactivityTime",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setDefaultKeepAliveInactivityTime" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setDefaultKeepAliveInactivityTime" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_setDefaultKeepAliveInactivityTime(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setKeepAliveEnabled(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setKeepAliveEnabled",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setKeepAliveEnabled" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setKeepAliveEnabled" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_setKeepAliveEnabled(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setServiceCheckTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setServiceCheckTimeout",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setServiceCheckTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setServiceCheckTimeout" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_setServiceCheckTimeout(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setServiceDownloadTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setServiceDownloadTimeout",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setServiceDownloadTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setServiceDownloadTimeout" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_setServiceDownloadTimeout(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setTlsOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + blpapi_TlsOptions_t *arg2 = (blpapi_TlsOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setTlsOptions",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setTlsOptions" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setTlsOptions" "', argument " "2"" of type '" "blpapi_TlsOptions_t const *""'"); + } + arg2 = (blpapi_TlsOptions_t *)(argp2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_SessionOptions_setTlsOptions(arg1,(struct blpapi_TlsOptions const *)arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setFlushPublishedEventsTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setFlushPublishedEventsTimeout",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setFlushPublishedEventsTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setFlushPublishedEventsTimeout" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_setFlushPublishedEventsTimeout(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_serverHost(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + char *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_serverHost",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_serverHost" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (char *)blpapi_SessionOptions_serverHost(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_serverPort(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + unsigned int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_serverPort",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_serverPort" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (unsigned int)blpapi_SessionOptions_serverPort(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_numServerAddresses(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_numServerAddresses",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_numServerAddresses" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_numServerAddresses(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_getServerAddress(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + char **arg2 = (char **) 0 ; + unsigned short *arg3 = (unsigned short *) 0 ; + size_t arg4 ; + void *argp1 = 0 ; + int res1 = 0 ; + char *tempServerHost2 = 0 ; + unsigned short tempServerPort2 = 0 ; + size_t val4 ; + int ecode4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &tempServerHost2; + arg3 = &tempServerPort2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_getServerAddress",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_getServerAddress" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + ecode4 = SWIG_AsVal_size_t(obj1, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_SessionOptions_getServerAddress" "', argument " "4"" of type '" "size_t""'"); + } + arg4 = (size_t)(val4); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_getServerAddress(arg1,(char const **)arg2,arg3,arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int(*arg3)); + } + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_connectTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + unsigned int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_connectTimeout",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_connectTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (unsigned int)blpapi_SessionOptions_connectTimeout(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultServices(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + char *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_defaultServices",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_defaultServices" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (char *)blpapi_SessionOptions_defaultServices(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultSubscriptionService(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + char *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_defaultSubscriptionService",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_defaultSubscriptionService" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (char *)blpapi_SessionOptions_defaultSubscriptionService(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultTopicPrefix(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + char *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_defaultTopicPrefix",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_defaultTopicPrefix" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (char *)blpapi_SessionOptions_defaultTopicPrefix(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_clientMode(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_clientMode",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_clientMode" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_clientMode(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_maxPendingRequests(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_maxPendingRequests",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_maxPendingRequests" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_maxPendingRequests(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_autoRestartOnDisconnection(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_autoRestartOnDisconnection",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_autoRestartOnDisconnection" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_autoRestartOnDisconnection(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_authenticationOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + char *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_authenticationOptions",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_authenticationOptions" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (char *)blpapi_SessionOptions_authenticationOptions(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_numStartAttempts(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_numStartAttempts",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_numStartAttempts" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_numStartAttempts(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_maxEventQueueSize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + size_t result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_maxEventQueueSize",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_maxEventQueueSize" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = blpapi_SessionOptions_maxEventQueueSize(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_size_t((size_t)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_slowConsumerWarningHiWaterMark(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + float result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_slowConsumerWarningHiWaterMark",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_slowConsumerWarningHiWaterMark" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (float)blpapi_SessionOptions_slowConsumerWarningHiWaterMark(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_float((float)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_slowConsumerWarningLoWaterMark(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + float result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_slowConsumerWarningLoWaterMark",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_slowConsumerWarningLoWaterMark" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (float)blpapi_SessionOptions_slowConsumerWarningLoWaterMark(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_float((float)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultKeepAliveInactivityTime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_defaultKeepAliveInactivityTime",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_defaultKeepAliveInactivityTime" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_defaultKeepAliveInactivityTime(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultKeepAliveResponseTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_defaultKeepAliveResponseTimeout",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_defaultKeepAliveResponseTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_defaultKeepAliveResponseTimeout(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_keepAliveEnabled(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_keepAliveEnabled",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_keepAliveEnabled" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_keepAliveEnabled(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_recordSubscriptionDataReceiveTimes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_recordSubscriptionDataReceiveTimes",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_recordSubscriptionDataReceiveTimes" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_recordSubscriptionDataReceiveTimes(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_serviceCheckTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_serviceCheckTimeout",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_serviceCheckTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_serviceCheckTimeout(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_serviceDownloadTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_serviceDownloadTimeout",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_serviceDownloadTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_serviceDownloadTimeout(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_flushPublishedEventsTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_flushPublishedEventsTimeout",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_flushPublishedEventsTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_flushPublishedEventsTimeout(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_TlsOptions_t *arg1 = (blpapi_TlsOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_TlsOptions_destroy",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TlsOptions_destroy" "', argument " "1"" of type '" "blpapi_TlsOptions_t *""'"); + } + arg1 = (blpapi_TlsOptions_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_TlsOptions_destroy(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_createFromFiles(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + char *arg1 = (char *) 0 ; + char *arg2 = (char *) 0 ; + char *arg3 = (char *) 0 ; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + blpapi_TlsOptions_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_TlsOptions_createFromFiles",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TlsOptions_createFromFiles" "', argument " "1"" of type '" "char const *""'"); + } + arg1 = (char *)(buf1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_TlsOptions_createFromFiles" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_TlsOptions_createFromFiles" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = (char *)(buf3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_TlsOptions_t *)blpapi_TlsOptions_createFromFiles((char const *)arg1,(char const *)arg2,(char const *)arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + return resultobj; +fail: + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_createFromBlobs(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + char *arg1 = (char *) 0 ; + int arg2 ; + char *arg3 = (char *) 0 ; + char *arg4 = (char *) 0 ; + int arg5 ; + int res1 ; + Py_ssize_t size1 = 0 ; + void const *buf1 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + int res4 ; + Py_ssize_t size4 = 0 ; + void const *buf4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + blpapi_TlsOptions_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_TlsOptions_createFromBlobs",&obj0,&obj1,&obj2)) SWIG_fail; + { + res1 = PyObject_AsReadBuffer(obj0, &buf1, &size1); + if (res1<0) { + PyErr_Clear(); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TlsOptions_createFromBlobs" "', argument " "1"" of type '" "(const char *clientCredentialsRawData, int clientCredentialsRawDataLength)""'"); + } + arg1 = (char *) buf1; + arg2 = (int) (size1 / sizeof(char const)); + } + res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_TlsOptions_createFromBlobs" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = (char *)(buf3); + { + res4 = PyObject_AsReadBuffer(obj2, &buf4, &size4); + if (res4<0) { + PyErr_Clear(); + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_TlsOptions_createFromBlobs" "', argument " "4"" of type '" "(const char *trustedCertificatesRawData, int trustedCertificatesRawDataLength)""'"); + } + arg4 = (char *) buf4; + arg5 = (int) (size4 / sizeof(char const)); + } + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_TlsOptions_t *)blpapi_TlsOptions_createFromBlobs((char const *)arg1,arg2,(char const *)arg3,(char const *)arg4,arg5); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + return resultobj; +fail: + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_setTlsHandshakeTimeoutMs(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_TlsOptions_t *arg1 = (blpapi_TlsOptions_t *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TlsOptions_setTlsHandshakeTimeoutMs",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TlsOptions_setTlsHandshakeTimeoutMs" "', argument " "1"" of type '" "blpapi_TlsOptions_t *""'"); + } + arg1 = (blpapi_TlsOptions_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_TlsOptions_setTlsHandshakeTimeoutMs" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_TlsOptions_setTlsHandshakeTimeoutMs(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_setCrlFetchTimeoutMs(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_TlsOptions_t *arg1 = (blpapi_TlsOptions_t *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TlsOptions_setCrlFetchTimeoutMs",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TlsOptions_setCrlFetchTimeoutMs" "', argument " "1"" of type '" "blpapi_TlsOptions_t *""'"); + } + arg1 = (blpapi_TlsOptions_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_TlsOptions_setCrlFetchTimeoutMs" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_TlsOptions_setCrlFetchTimeoutMs(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Name_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + char *arg1 = (char *) 0 ; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_Name_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Name_create",&obj0)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Name_create" "', argument " "1"" of type '" "char const *""'"); + } + arg1 = (char *)(buf1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_Name_t *)blpapi_Name_create((char const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return resultobj; +fail: + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Name_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Name_t *arg1 = (blpapi_Name_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Name_destroy",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Name_destroy" "', argument " "1"" of type '" "blpapi_Name_t *""'"); + } + arg1 = (blpapi_Name_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_Name_destroy(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Name_equalsStr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Name_t *arg1 = (blpapi_Name_t *) 0 ; + char *arg2 = (char *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Name_equalsStr",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Name_equalsStr" "', argument " "1"" of type '" "blpapi_Name_t const *""'"); + } + arg1 = (blpapi_Name_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Name_equalsStr" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Name_equalsStr((struct blpapi_Name const *)arg1,(char const *)arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Name_string(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Name_t *arg1 = (blpapi_Name_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + char *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Name_string",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Name_string" "', argument " "1"" of type '" "blpapi_Name_t const *""'"); + } + arg1 = (blpapi_Name_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (char *)blpapi_Name_string((struct blpapi_Name const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Name_length(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Name_t *arg1 = (blpapi_Name_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + size_t result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Name_length",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Name_length" "', argument " "1"" of type '" "blpapi_Name_t const *""'"); + } + arg1 = (blpapi_Name_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = blpapi_Name_length((struct blpapi_Name const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_size_t((size_t)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Name_findName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + char *arg1 = (char *) 0 ; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_Name_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Name_findName",&obj0)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Name_findName" "', argument " "1"" of type '" "char const *""'"); + } + arg1 = (char *)(buf1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_Name_t *)blpapi_Name_findName((char const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return resultobj; +fail: + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SubscriptionList_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)":blpapi_SubscriptionList_create")) SWIG_fail; + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_SubscriptionList_t *)blpapi_SubscriptionList_create(); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SubscriptionList_destroy",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_destroy" "', argument " "1"" of type '" "blpapi_SubscriptionList_t *""'"); + } + arg1 = (blpapi_SubscriptionList_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_SubscriptionList_destroy(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_addResolved(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_SubscriptionList_addResolved",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_addResolved" "', argument " "1"" of type '" "blpapi_SubscriptionList_t *""'"); + } + arg1 = (blpapi_SubscriptionList_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SubscriptionList_addResolved" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_SubscriptionList_addResolved" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); + } + arg3 = (blpapi_CorrelationId_t *)(argp3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SubscriptionList_addResolved(arg1,(char const *)arg2,(struct blpapi_CorrelationId_t_ const *)arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SubscriptionList_clear",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_clear" "', argument " "1"" of type '" "blpapi_SubscriptionList_t *""'"); + } + arg1 = (blpapi_SubscriptionList_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SubscriptionList_clear(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_append(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; + blpapi_SubscriptionList_t *arg2 = (blpapi_SubscriptionList_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SubscriptionList_append",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_append" "', argument " "1"" of type '" "blpapi_SubscriptionList_t *""'"); + } + arg1 = (blpapi_SubscriptionList_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SubscriptionList_append" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); + } + arg2 = (blpapi_SubscriptionList_t *)(argp2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SubscriptionList_append(arg1,(struct blpapi_SubscriptionList const *)arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SubscriptionList_size",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_size" "', argument " "1"" of type '" "blpapi_SubscriptionList_t const *""'"); + } + arg1 = (blpapi_SubscriptionList_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SubscriptionList_size((struct blpapi_SubscriptionList const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_correlationIdAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; + blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; + size_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_CorrelationId_t temp2 ; + size_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SubscriptionList_correlationIdAt",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_correlationIdAt" "', argument " "1"" of type '" "blpapi_SubscriptionList_t const *""'"); + } + arg1 = (blpapi_SubscriptionList_t *)(argp1); + ecode3 = SWIG_AsVal_size_t(obj1, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_SubscriptionList_correlationIdAt" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SubscriptionList_correlationIdAt((struct blpapi_SubscriptionList const *)arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (!result) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(CorrelationId_t_clone(arg2), SWIGTYPE_p_blpapi_CorrelationId_t_, SWIG_POINTER_OWN)); + } else { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_Py_Void()); + } + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_topicStringAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; + char **arg2 = (char **) 0 ; + size_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + char *temp2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SubscriptionList_topicStringAt",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_topicStringAt" "', argument " "1"" of type '" "blpapi_SubscriptionList_t *""'"); + } + arg1 = (blpapi_SubscriptionList_t *)(argp1); + ecode3 = SWIG_AsVal_size_t(obj1, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_SubscriptionList_topicStringAt" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SubscriptionList_topicStringAt(arg1,(char const **)arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_isResolvedAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; + int *arg2 = (int *) 0 ; + size_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + int temp2 ; + int res2 = SWIG_TMPOBJ ; + size_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SubscriptionList_isResolvedAt",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_isResolvedAt" "', argument " "1"" of type '" "blpapi_SubscriptionList_t *""'"); + } + arg1 = (blpapi_SubscriptionList_t *)(argp1); + ecode3 = SWIG_AsVal_size_t(obj1, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_SubscriptionList_isResolvedAt" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SubscriptionList_isResolvedAt(arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (SWIG_IsTmpObj(res2)) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg2))); + } else { + int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_int, new_flags)); + } + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_TimePoint_d_value_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + struct blpapi_TimePoint *arg1 = (struct blpapi_TimePoint *) 0 ; + blpapi_Int64_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + long long val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TimePoint_d_value_set",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TimePoint, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TimePoint_d_value_set" "', argument " "1"" of type '" "struct blpapi_TimePoint *""'"); + } + arg1 = (struct blpapi_TimePoint *)(argp1); + ecode2 = SWIG_AsVal_long_SS_long(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_TimePoint_d_value_set" "', argument " "2"" of type '" "blpapi_Int64_t""'"); + } + arg2 = (blpapi_Int64_t)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + if (arg1) (arg1)->d_value = arg2; + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_TimePoint_d_value_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + struct blpapi_TimePoint *arg1 = (struct blpapi_TimePoint *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_Int64_t result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_TimePoint_d_value_get",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TimePoint, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TimePoint_d_value_get" "', argument " "1"" of type '" "struct blpapi_TimePoint *""'"); + } + arg1 = (struct blpapi_TimePoint *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_Int64_t) ((arg1)->d_value); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_long_SS_long((long long)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_blpapi_TimePoint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + struct blpapi_TimePoint *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)":new_blpapi_TimePoint")) SWIG_fail; + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (struct blpapi_TimePoint *)calloc(1, sizeof(struct blpapi_TimePoint)); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_TimePoint, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_delete_blpapi_TimePoint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + struct blpapi_TimePoint *arg1 = (struct blpapi_TimePoint *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:delete_blpapi_TimePoint",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TimePoint, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_blpapi_TimePoint" "', argument " "1"" of type '" "struct blpapi_TimePoint *""'"); + } + arg1 = (struct blpapi_TimePoint *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + free((char *) arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *blpapi_TimePoint_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *obj; + if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_blpapi_TimePoint, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject *_wrap_blpapi_TimePointUtil_nanosecondsBetween(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_TimePoint_t *arg1 = (blpapi_TimePoint_t *) 0 ; + blpapi_TimePoint_t *arg2 = (blpapi_TimePoint_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + long long result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TimePointUtil_nanosecondsBetween",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TimePoint, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TimePointUtil_nanosecondsBetween" "', argument " "1"" of type '" "blpapi_TimePoint_t const *""'"); + } + arg1 = (blpapi_TimePoint_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_TimePoint, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_TimePointUtil_nanosecondsBetween" "', argument " "2"" of type '" "blpapi_TimePoint_t const *""'"); + } + arg2 = (blpapi_TimePoint_t *)(argp2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (long long)blpapi_TimePointUtil_nanosecondsBetween((struct blpapi_TimePoint const *)arg1,(struct blpapi_TimePoint const *)arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_long_SS_long((long long)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_parts_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; + blpapi_UChar_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + unsigned char val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_parts_set",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_parts_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); + } + arg1 = (struct blpapi_Datetime_tag *)(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_parts_set" "', argument " "2"" of type '" "blpapi_UChar_t""'"); + } + arg2 = (blpapi_UChar_t)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + if (arg1) (arg1)->parts = arg2; + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_parts_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_UChar_t result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_parts_get",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_parts_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); + } + arg1 = (struct blpapi_Datetime_tag *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_UChar_t) ((arg1)->parts); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_unsigned_SS_char((unsigned char)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_hours_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; + blpapi_UChar_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + unsigned char val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_hours_set",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_hours_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); + } + arg1 = (struct blpapi_Datetime_tag *)(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_hours_set" "', argument " "2"" of type '" "blpapi_UChar_t""'"); + } + arg2 = (blpapi_UChar_t)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + if (arg1) (arg1)->hours = arg2; + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_hours_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_UChar_t result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_hours_get",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_hours_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); + } + arg1 = (struct blpapi_Datetime_tag *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_UChar_t) ((arg1)->hours); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_unsigned_SS_char((unsigned char)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_minutes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; + blpapi_UChar_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + unsigned char val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_minutes_set",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_minutes_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); + } + arg1 = (struct blpapi_Datetime_tag *)(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_minutes_set" "', argument " "2"" of type '" "blpapi_UChar_t""'"); + } + arg2 = (blpapi_UChar_t)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + if (arg1) (arg1)->minutes = arg2; + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_minutes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_UChar_t result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_minutes_get",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_minutes_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); + } + arg1 = (struct blpapi_Datetime_tag *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_UChar_t) ((arg1)->minutes); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_unsigned_SS_char((unsigned char)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_seconds_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; + blpapi_UChar_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + unsigned char val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_seconds_set",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_seconds_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); + } + arg1 = (struct blpapi_Datetime_tag *)(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_seconds_set" "', argument " "2"" of type '" "blpapi_UChar_t""'"); + } + arg2 = (blpapi_UChar_t)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + if (arg1) (arg1)->seconds = arg2; + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_seconds_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_UChar_t result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_seconds_get",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_seconds_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); + } + arg1 = (struct blpapi_Datetime_tag *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_UChar_t) ((arg1)->seconds); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_unsigned_SS_char((unsigned char)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_milliSeconds_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; + blpapi_UInt16_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + unsigned short val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_milliSeconds_set",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_milliSeconds_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); + } + arg1 = (struct blpapi_Datetime_tag *)(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_short(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_milliSeconds_set" "', argument " "2"" of type '" "blpapi_UInt16_t""'"); + } + arg2 = (blpapi_UInt16_t)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + if (arg1) (arg1)->milliSeconds = arg2; + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_milliSeconds_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_UInt16_t result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_milliSeconds_get",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_milliSeconds_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); + } + arg1 = (struct blpapi_Datetime_tag *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_UInt16_t) ((arg1)->milliSeconds); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_month_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; + blpapi_UChar_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + unsigned char val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_month_set",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_month_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); + } + arg1 = (struct blpapi_Datetime_tag *)(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_month_set" "', argument " "2"" of type '" "blpapi_UChar_t""'"); + } + arg2 = (blpapi_UChar_t)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + if (arg1) (arg1)->month = arg2; + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_month_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_UChar_t result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_month_get",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_month_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); + } + arg1 = (struct blpapi_Datetime_tag *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_UChar_t) ((arg1)->month); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_unsigned_SS_char((unsigned char)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_day_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; + blpapi_UChar_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + unsigned char val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_day_set",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_day_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); + } + arg1 = (struct blpapi_Datetime_tag *)(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_day_set" "', argument " "2"" of type '" "blpapi_UChar_t""'"); + } + arg2 = (blpapi_UChar_t)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + if (arg1) (arg1)->day = arg2; + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_day_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_UChar_t result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_day_get",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_day_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); + } + arg1 = (struct blpapi_Datetime_tag *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_UChar_t) ((arg1)->day); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_unsigned_SS_char((unsigned char)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_year_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; + blpapi_UInt16_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + unsigned short val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_year_set",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_year_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); + } + arg1 = (struct blpapi_Datetime_tag *)(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_short(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_year_set" "', argument " "2"" of type '" "blpapi_UInt16_t""'"); + } + arg2 = (blpapi_UInt16_t)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + if (arg1) (arg1)->year = arg2; + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_year_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_UInt16_t result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_year_get",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_year_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); + } + arg1 = (struct blpapi_Datetime_tag *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_UInt16_t) ((arg1)->year); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_offset_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; + blpapi_Int16_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + short val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_offset_set",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_offset_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); + } + arg1 = (struct blpapi_Datetime_tag *)(argp1); + ecode2 = SWIG_AsVal_short(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_offset_set" "', argument " "2"" of type '" "blpapi_Int16_t""'"); + } + arg2 = (blpapi_Int16_t)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + if (arg1) (arg1)->offset = arg2; + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_offset_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_Int16_t result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_offset_get",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_offset_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); + } + arg1 = (struct blpapi_Datetime_tag *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_Int16_t) ((arg1)->offset); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_short((short)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_blpapi_Datetime_tag(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + struct blpapi_Datetime_tag *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)":new_blpapi_Datetime_tag")) SWIG_fail; + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (struct blpapi_Datetime_tag *)calloc(1, sizeof(struct blpapi_Datetime_tag)); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Datetime_tag, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_delete_blpapi_Datetime_tag(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:delete_blpapi_Datetime_tag",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_blpapi_Datetime_tag" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); + } + arg1 = (struct blpapi_Datetime_tag *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + free((char *) arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *blpapi_Datetime_tag_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *obj; + if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_blpapi_Datetime_tag, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_tag_datetime_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + struct blpapi_HighPrecisionDatetime_tag *arg1 = (struct blpapi_HighPrecisionDatetime_tag *) 0 ; + blpapi_Datetime_t *arg2 = (blpapi_Datetime_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_HighPrecisionDatetime_tag_datetime_set",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_tag_datetime_set" "', argument " "1"" of type '" "struct blpapi_HighPrecisionDatetime_tag *""'"); + } + arg1 = (struct blpapi_HighPrecisionDatetime_tag *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_HighPrecisionDatetime_tag_datetime_set" "', argument " "2"" of type '" "blpapi_Datetime_t *""'"); + } + arg2 = (blpapi_Datetime_t *)(argp2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + if (arg1) (arg1)->datetime = *arg2; + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_tag_datetime_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + struct blpapi_HighPrecisionDatetime_tag *arg1 = (struct blpapi_HighPrecisionDatetime_tag *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_Datetime_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_HighPrecisionDatetime_tag_datetime_get",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_tag_datetime_get" "', argument " "1"" of type '" "struct blpapi_HighPrecisionDatetime_tag *""'"); + } + arg1 = (struct blpapi_HighPrecisionDatetime_tag *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_Datetime_t *)& ((arg1)->datetime); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_tag_picoseconds_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + struct blpapi_HighPrecisionDatetime_tag *arg1 = (struct blpapi_HighPrecisionDatetime_tag *) 0 ; + blpapi_UInt32_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + unsigned int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_HighPrecisionDatetime_tag_picoseconds_set",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_tag_picoseconds_set" "', argument " "1"" of type '" "struct blpapi_HighPrecisionDatetime_tag *""'"); + } + arg1 = (struct blpapi_HighPrecisionDatetime_tag *)(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_HighPrecisionDatetime_tag_picoseconds_set" "', argument " "2"" of type '" "blpapi_UInt32_t""'"); + } + arg2 = (blpapi_UInt32_t)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + if (arg1) (arg1)->picoseconds = arg2; + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_tag_picoseconds_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + struct blpapi_HighPrecisionDatetime_tag *arg1 = (struct blpapi_HighPrecisionDatetime_tag *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_UInt32_t result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_HighPrecisionDatetime_tag_picoseconds_get",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_tag_picoseconds_get" "', argument " "1"" of type '" "struct blpapi_HighPrecisionDatetime_tag *""'"); + } + arg1 = (struct blpapi_HighPrecisionDatetime_tag *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_UInt32_t) ((arg1)->picoseconds); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_blpapi_HighPrecisionDatetime_tag(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + struct blpapi_HighPrecisionDatetime_tag *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)":new_blpapi_HighPrecisionDatetime_tag")) SWIG_fail; + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (struct blpapi_HighPrecisionDatetime_tag *)calloc(1, sizeof(struct blpapi_HighPrecisionDatetime_tag)); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_delete_blpapi_HighPrecisionDatetime_tag(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + struct blpapi_HighPrecisionDatetime_tag *arg1 = (struct blpapi_HighPrecisionDatetime_tag *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:delete_blpapi_HighPrecisionDatetime_tag",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_blpapi_HighPrecisionDatetime_tag" "', argument " "1"" of type '" "struct blpapi_HighPrecisionDatetime_tag *""'"); + } + arg1 = (struct blpapi_HighPrecisionDatetime_tag *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + free((char *) arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *blpapi_HighPrecisionDatetime_tag_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *obj; + if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_compare(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_HighPrecisionDatetime_t *arg1 = (blpapi_HighPrecisionDatetime_t *) 0 ; + blpapi_HighPrecisionDatetime_t *arg2 = (blpapi_HighPrecisionDatetime_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_HighPrecisionDatetime_compare",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_compare" "', argument " "1"" of type '" "blpapi_HighPrecisionDatetime_t const *""'"); + } + arg1 = (blpapi_HighPrecisionDatetime_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_HighPrecisionDatetime_compare" "', argument " "2"" of type '" "blpapi_HighPrecisionDatetime_t const *""'"); + } + arg2 = (blpapi_HighPrecisionDatetime_t *)(argp2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_HighPrecisionDatetime_compare((struct blpapi_HighPrecisionDatetime_tag const *)arg1,(struct blpapi_HighPrecisionDatetime_tag const *)arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_print(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_HighPrecisionDatetime_t *arg1 = (blpapi_HighPrecisionDatetime_t *) 0 ; + blpapi_StreamWriter_t arg2 ; + void *arg3 = (void *) 0 ; + int arg4 ; + int arg5 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 ; + int res2 = 0 ; + int res3 ; + int val4 ; + int ecode4 = 0 ; + int val5 ; + int ecode5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOOO:blpapi_HighPrecisionDatetime_print",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_print" "', argument " "1"" of type '" "blpapi_HighPrecisionDatetime_t const *""'"); + } + arg1 = (blpapi_HighPrecisionDatetime_t *)(argp1); + { + res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_blpapi_StreamWriter_t, 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_HighPrecisionDatetime_print" "', argument " "2"" of type '" "blpapi_StreamWriter_t""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "blpapi_HighPrecisionDatetime_print" "', argument " "2"" of type '" "blpapi_StreamWriter_t""'"); + } else { + arg2 = *((blpapi_StreamWriter_t *)(argp2)); + } + } + res3 = SWIG_ConvertPtr(obj2,SWIG_as_voidptrptr(&arg3), 0, 0); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_HighPrecisionDatetime_print" "', argument " "3"" of type '" "void *""'"); + } + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_HighPrecisionDatetime_print" "', argument " "4"" of type '" "int""'"); + } + arg4 = (int)(val4); + ecode5 = SWIG_AsVal_int(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_HighPrecisionDatetime_print" "', argument " "5"" of type '" "int""'"); + } + arg5 = (int)(val5); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_HighPrecisionDatetime_print((struct blpapi_HighPrecisionDatetime_tag const *)arg1,arg2,arg3,arg4,arg5); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_fromTimePoint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_HighPrecisionDatetime_t *arg1 = (blpapi_HighPrecisionDatetime_t *) 0 ; + blpapi_TimePoint_t *arg2 = (blpapi_TimePoint_t *) 0 ; + short arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_TimePoint_t temp2 ; + short val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_HighPrecisionDatetime_fromTimePoint",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_fromTimePoint" "', argument " "1"" of type '" "blpapi_HighPrecisionDatetime_t *""'"); + } + arg1 = (blpapi_HighPrecisionDatetime_t *)(argp1); + ecode3 = SWIG_AsVal_short(obj1, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_HighPrecisionDatetime_fromTimePoint" "', argument " "3"" of type '" "short""'"); + } + arg3 = (short)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_HighPrecisionDatetime_fromTimePoint(arg1,(struct blpapi_TimePoint const *)arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + { + blpapi_TimePoint_t *outputPtr = (blpapi_TimePoint_t *) malloc(sizeof(blpapi_TimePoint_t)); + *outputPtr = *arg2; + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(outputPtr, SWIGTYPE_p_blpapi_TimePoint, SWIG_POINTER_OWN)); + } + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Constant_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_Name_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_name",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_name" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); + } + arg1 = (blpapi_Constant_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_Name_t *)blpapi_Constant_name((struct blpapi_Constant const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Constant_description(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + char *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_description",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_description" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); + } + arg1 = (blpapi_Constant_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (char *)blpapi_Constant_description((struct blpapi_Constant const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Constant_status(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_status",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_status" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); + } + arg1 = (blpapi_Constant_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Constant_status((struct blpapi_Constant const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Constant_datatype(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_datatype",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_datatype" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); + } + arg1 = (blpapi_Constant_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Constant_datatype((struct blpapi_Constant const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Constant_getValueAsInt64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; + blpapi_Int64_t *arg2 = (blpapi_Int64_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_Int64_t temp2 ; + int res2 = SWIG_TMPOBJ ; + PyObject * obj0 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_getValueAsInt64",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_getValueAsInt64" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); + } + arg1 = (blpapi_Constant_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Constant_getValueAsInt64((struct blpapi_Constant const *)arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (SWIG_IsTmpObj(res2)) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_long_SS_long((*arg2))); + } else { + int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_long_long, new_flags)); + } + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Constant_getValueAsFloat64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; + blpapi_Float64_t *arg2 = (blpapi_Float64_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_Float64_t temp2 ; + int res2 = SWIG_TMPOBJ ; + PyObject * obj0 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_getValueAsFloat64",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_getValueAsFloat64" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); + } + arg1 = (blpapi_Constant_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Constant_getValueAsFloat64((struct blpapi_Constant const *)arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (SWIG_IsTmpObj(res2)) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_double((*arg2))); + } else { + int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_double, new_flags)); + } + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Constant_getValueAsDatetime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; + blpapi_Datetime_t *arg2 = (blpapi_Datetime_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_Datetime_t temp2 ; + PyObject * obj0 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_getValueAsDatetime",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_getValueAsDatetime" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); + } + arg1 = (blpapi_Constant_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Constant_getValueAsDatetime((struct blpapi_Constant const *)arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + { + blpapi_Datetime_t *outputPtr = (blpapi_Datetime_t *) malloc(sizeof(blpapi_Datetime_t)); + *outputPtr = *arg2; + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(outputPtr, SWIGTYPE_p_blpapi_Datetime_tag, SWIG_POINTER_OWN)); + } + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Constant_getValueAsString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; + char **arg2 = (char **) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + char *temp2 = 0 ; + PyObject * obj0 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_getValueAsString",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_getValueAsString" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); + } + arg1 = (blpapi_Constant_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Constant_getValueAsString((struct blpapi_Constant const *)arg1,(char const **)arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ConstantList_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ConstantList_t *arg1 = (blpapi_ConstantList_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_Name_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ConstantList_name",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_name" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); + } + arg1 = (blpapi_ConstantList_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_Name_t *)blpapi_ConstantList_name((struct blpapi_ConstantList const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ConstantList_description(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ConstantList_t *arg1 = (blpapi_ConstantList_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + char *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ConstantList_description",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_description" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); + } + arg1 = (blpapi_ConstantList_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (char *)blpapi_ConstantList_description((struct blpapi_ConstantList const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ConstantList_numConstants(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ConstantList_t *arg1 = (blpapi_ConstantList_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ConstantList_numConstants",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_numConstants" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); + } + arg1 = (blpapi_ConstantList_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ConstantList_numConstants((struct blpapi_ConstantList const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ConstantList_datatype(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ConstantList_t *arg1 = (blpapi_ConstantList_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ConstantList_datatype",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_datatype" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); + } + arg1 = (blpapi_ConstantList_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ConstantList_datatype((struct blpapi_ConstantList const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ConstantList_status(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ConstantList_t *arg1 = (blpapi_ConstantList_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ConstantList_status",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_status" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); + } + arg1 = (blpapi_ConstantList_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ConstantList_status((struct blpapi_ConstantList const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ConstantList_getConstant(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ConstantList_t *arg1 = (blpapi_ConstantList_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + blpapi_Constant_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_ConstantList_getConstant",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_getConstant" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); + } + arg1 = (blpapi_ConstantList_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ConstantList_getConstant" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ConstantList_getConstant" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); + } + arg3 = (blpapi_Name_t *)(argp3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_Constant_t *)blpapi_ConstantList_getConstant((struct blpapi_ConstantList const *)arg1,(char const *)arg2,(struct blpapi_Name const *)arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Constant, 0 | 0 ); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ConstantList_getConstantAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ConstantList_t *arg1 = (blpapi_ConstantList_t *) 0 ; + size_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + blpapi_Constant_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ConstantList_getConstantAt",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_getConstantAt" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); + } + arg1 = (blpapi_ConstantList_t *)(argp1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_ConstantList_getConstantAt" "', argument " "2"" of type '" "size_t""'"); + } + arg2 = (size_t)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_Constant_t *)blpapi_ConstantList_getConstantAt((struct blpapi_ConstantList const *)arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Constant, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_Name_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaElementDefinition_name",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_name" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); + } + arg1 = (blpapi_SchemaElementDefinition_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_Name_t *)blpapi_SchemaElementDefinition_name((void *const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_description(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + char *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaElementDefinition_description",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_description" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); + } + arg1 = (blpapi_SchemaElementDefinition_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (char *)blpapi_SchemaElementDefinition_description((void *const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_status(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaElementDefinition_status",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_status" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); + } + arg1 = (blpapi_SchemaElementDefinition_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SchemaElementDefinition_status((void *const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_type(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_SchemaTypeDefinition_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaElementDefinition_type",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_type" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); + } + arg1 = (blpapi_SchemaElementDefinition_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_SchemaTypeDefinition_t *)blpapi_SchemaElementDefinition_type((void *const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_void, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_numAlternateNames(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + size_t result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaElementDefinition_numAlternateNames",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_numAlternateNames" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); + } + arg1 = (blpapi_SchemaElementDefinition_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = blpapi_SchemaElementDefinition_numAlternateNames((void *const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_size_t((size_t)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_getAlternateName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; + size_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + blpapi_Name_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SchemaElementDefinition_getAlternateName",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_getAlternateName" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); + } + arg1 = (blpapi_SchemaElementDefinition_t *)(argp1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SchemaElementDefinition_getAlternateName" "', argument " "2"" of type '" "size_t""'"); + } + arg2 = (size_t)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_Name_t *)blpapi_SchemaElementDefinition_getAlternateName((void *const *)arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_minValues(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + size_t result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaElementDefinition_minValues",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_minValues" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); + } + arg1 = (blpapi_SchemaElementDefinition_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = blpapi_SchemaElementDefinition_minValues((void *const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_size_t((size_t)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_maxValues(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + size_t result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaElementDefinition_maxValues",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_maxValues" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); + } + arg1 = (blpapi_SchemaElementDefinition_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = blpapi_SchemaElementDefinition_maxValues((void *const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_size_t((size_t)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_Name_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_name",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_name" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); + } + arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_Name_t *)blpapi_SchemaTypeDefinition_name((void *const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_description(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + char *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_description",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_description" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); + } + arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (char *)blpapi_SchemaTypeDefinition_description((void *const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_status(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_status",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_status" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); + } + arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SchemaTypeDefinition_status((void *const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_datatype(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_datatype",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_datatype" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); + } + arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SchemaTypeDefinition_datatype((void *const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_isComplexType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_isComplexType",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_isComplexType" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); + } + arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SchemaTypeDefinition_isComplexType((void *const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_isSimpleType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_isSimpleType",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_isSimpleType" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); + } + arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SchemaTypeDefinition_isSimpleType((void *const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_isEnumerationType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_isEnumerationType",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_isEnumerationType" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); + } + arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SchemaTypeDefinition_isEnumerationType((void *const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_numElementDefinitions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + size_t result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_numElementDefinitions",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_numElementDefinitions" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); + } + arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = blpapi_SchemaTypeDefinition_numElementDefinitions((void *const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_size_t((size_t)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_getElementDefinition(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + blpapi_SchemaElementDefinition_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_SchemaTypeDefinition_getElementDefinition",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_getElementDefinition" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); + } + arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SchemaTypeDefinition_getElementDefinition" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_SchemaTypeDefinition_getElementDefinition" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); + } + arg3 = (blpapi_Name_t *)(argp3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_SchemaElementDefinition_t *)blpapi_SchemaTypeDefinition_getElementDefinition((void *const *)arg1,(char const *)arg2,(struct blpapi_Name const *)arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_void, 0 | 0 ); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_getElementDefinitionAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; + size_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + blpapi_SchemaElementDefinition_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SchemaTypeDefinition_getElementDefinitionAt",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_getElementDefinitionAt" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); + } + arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SchemaTypeDefinition_getElementDefinitionAt" "', argument " "2"" of type '" "size_t""'"); + } + arg2 = (size_t)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_SchemaElementDefinition_t *)blpapi_SchemaTypeDefinition_getElementDefinitionAt((void *const *)arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_void, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_enumeration(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_ConstantList_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_enumeration",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_enumeration" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); + } + arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_ConstantList_t *)blpapi_SchemaTypeDefinition_enumeration((void *const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Request_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Request_t *arg1 = (blpapi_Request_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Request_destroy",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Request, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Request_destroy" "', argument " "1"" of type '" "blpapi_Request_t *""'"); + } + arg1 = (blpapi_Request_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_Request_destroy(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Request_elements(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Request_t *arg1 = (blpapi_Request_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_Element_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Request_elements",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Request, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Request_elements" "', argument " "1"" of type '" "blpapi_Request_t *""'"); + } + arg1 = (blpapi_Request_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_Element_t *)blpapi_Request_elements(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Element, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Request_setPreferredRoute(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Request_t *arg1 = (blpapi_Request_t *) 0 ; + blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Request_setPreferredRoute",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Request, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Request_setPreferredRoute" "', argument " "1"" of type '" "blpapi_Request_t *""'"); + } + arg1 = (blpapi_Request_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Request_setPreferredRoute" "', argument " "2"" of type '" "blpapi_CorrelationId_t *""'"); + } + arg2 = (blpapi_CorrelationId_t *)(argp2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_Request_setPreferredRoute(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_RequestTemplate_release(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_RequestTemplate_t *arg1 = (blpapi_RequestTemplate_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_RequestTemplate_release",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_RequestTemplate, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_RequestTemplate_release" "', argument " "1"" of type '" "blpapi_RequestTemplate_t const *""'"); + } + arg1 = (blpapi_RequestTemplate_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_RequestTemplate_release((struct blpapi_RequestTemplate const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Operation_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Operation_t *arg1 = (blpapi_Operation_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + char *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Operation_name",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Operation, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Operation_name" "', argument " "1"" of type '" "blpapi_Operation_t *""'"); + } + arg1 = (blpapi_Operation_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (char *)blpapi_Operation_name(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Operation_description(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Operation_t *arg1 = (blpapi_Operation_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + char *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Operation_description",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Operation, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Operation_description" "', argument " "1"" of type '" "blpapi_Operation_t *""'"); + } + arg1 = (blpapi_Operation_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (char *)blpapi_Operation_description(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Operation_requestDefinition(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Operation_t *arg1 = (blpapi_Operation_t *) 0 ; + blpapi_SchemaElementDefinition_t **arg2 = (blpapi_SchemaElementDefinition_t **) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_SchemaElementDefinition_t *temp2 = 0 ; + PyObject * obj0 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Operation_requestDefinition",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Operation, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Operation_requestDefinition" "', argument " "1"" of type '" "blpapi_Operation_t *""'"); + } + arg1 = (blpapi_Operation_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Operation_requestDefinition(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_p_void, 0)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Operation_numResponseDefinitions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Operation_t *arg1 = (blpapi_Operation_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Operation_numResponseDefinitions",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Operation, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Operation_numResponseDefinitions" "', argument " "1"" of type '" "blpapi_Operation_t *""'"); + } + arg1 = (blpapi_Operation_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Operation_numResponseDefinitions(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Operation_responseDefinition(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Operation_t *arg1 = (blpapi_Operation_t *) 0 ; + blpapi_SchemaElementDefinition_t **arg2 = (blpapi_SchemaElementDefinition_t **) 0 ; + size_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_SchemaElementDefinition_t *temp2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Operation_responseDefinition",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Operation, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Operation_responseDefinition" "', argument " "1"" of type '" "blpapi_Operation_t *""'"); + } + arg1 = (blpapi_Operation_t *)(argp1); + ecode3 = SWIG_AsVal_size_t(obj1, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Operation_responseDefinition" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Operation_responseDefinition(arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_p_void, 0)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Service_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + char *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_name",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_name" "', argument " "1"" of type '" "blpapi_Service_t *""'"); + } + arg1 = (blpapi_Service_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (char *)blpapi_Service_name(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Service_description(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + char *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_description",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_description" "', argument " "1"" of type '" "blpapi_Service_t *""'"); + } + arg1 = (blpapi_Service_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (char *)blpapi_Service_description(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Service_numOperations(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_numOperations",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_numOperations" "', argument " "1"" of type '" "blpapi_Service_t *""'"); + } + arg1 = (blpapi_Service_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Service_numOperations(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Service_numEventDefinitions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_numEventDefinitions",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_numEventDefinitions" "', argument " "1"" of type '" "blpapi_Service_t *""'"); + } + arg1 = (blpapi_Service_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Service_numEventDefinitions(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Service_addRef(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_addRef",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_addRef" "', argument " "1"" of type '" "blpapi_Service_t *""'"); + } + arg1 = (blpapi_Service_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Service_addRef(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Service_release(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_release",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_release" "', argument " "1"" of type '" "blpapi_Service_t *""'"); + } + arg1 = (blpapi_Service_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_Service_release(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Service_authorizationServiceName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + char *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_authorizationServiceName",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_authorizationServiceName" "', argument " "1"" of type '" "blpapi_Service_t *""'"); + } + arg1 = (blpapi_Service_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (char *)blpapi_Service_authorizationServiceName(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Service_getOperation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; + blpapi_Operation_t **arg2 = (blpapi_Operation_t **) 0 ; + char *arg3 = (char *) 0 ; + blpapi_Name_t *arg4 = (blpapi_Name_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_Operation_t *temp2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Service_getOperation",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_getOperation" "', argument " "1"" of type '" "blpapi_Service_t *""'"); + } + arg1 = (blpapi_Service_t *)(argp1); + res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Service_getOperation" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = (char *)(buf3); + res4 = SWIG_ConvertPtr(obj2, &argp4,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Service_getOperation" "', argument " "4"" of type '" "blpapi_Name_t const *""'"); + } + arg4 = (blpapi_Name_t *)(argp4); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Service_getOperation(arg1,arg2,(char const *)arg3,(struct blpapi_Name const *)arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Operation, 0)); + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + return resultobj; +fail: + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Service_getOperationAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; + blpapi_Operation_t **arg2 = (blpapi_Operation_t **) 0 ; + size_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_Operation_t *temp2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Service_getOperationAt",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_getOperationAt" "', argument " "1"" of type '" "blpapi_Service_t *""'"); + } + arg1 = (blpapi_Service_t *)(argp1); + ecode3 = SWIG_AsVal_size_t(obj1, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Service_getOperationAt" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Service_getOperationAt(arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Operation, 0)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Service_getEventDefinition(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; + blpapi_SchemaElementDefinition_t **arg2 = (blpapi_SchemaElementDefinition_t **) 0 ; + char *arg3 = (char *) 0 ; + blpapi_Name_t *arg4 = (blpapi_Name_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_SchemaElementDefinition_t *temp2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Service_getEventDefinition",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_getEventDefinition" "', argument " "1"" of type '" "blpapi_Service_t *""'"); + } + arg1 = (blpapi_Service_t *)(argp1); + res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Service_getEventDefinition" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = (char *)(buf3); + res4 = SWIG_ConvertPtr(obj2, &argp4,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Service_getEventDefinition" "', argument " "4"" of type '" "blpapi_Name_t const *""'"); + } + arg4 = (blpapi_Name_t *)(argp4); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Service_getEventDefinition(arg1,arg2,(char const *)arg3,(struct blpapi_Name const *)arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_p_void, 0)); + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + return resultobj; +fail: + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Service_getEventDefinitionAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; + blpapi_SchemaElementDefinition_t **arg2 = (blpapi_SchemaElementDefinition_t **) 0 ; + size_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_SchemaElementDefinition_t *temp2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Service_getEventDefinitionAt",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_getEventDefinitionAt" "', argument " "1"" of type '" "blpapi_Service_t *""'"); + } + arg1 = (blpapi_Service_t *)(argp1); + ecode3 = SWIG_AsVal_size_t(obj1, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Service_getEventDefinitionAt" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Service_getEventDefinitionAt(arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_p_void, 0)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Service_createRequest(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; + blpapi_Request_t **arg2 = (blpapi_Request_t **) 0 ; + char *arg3 = (char *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_Request_t *temp2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Service_createRequest",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_createRequest" "', argument " "1"" of type '" "blpapi_Service_t *""'"); + } + arg1 = (blpapi_Service_t *)(argp1); + res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Service_createRequest" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = (char *)(buf3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Service_createRequest(arg1,arg2,(char const *)arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Request, 0)); + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + return resultobj; +fail: + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Service_createAuthorizationRequest(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; + blpapi_Request_t **arg2 = (blpapi_Request_t **) 0 ; + char *arg3 = (char *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_Request_t *temp2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Service_createAuthorizationRequest",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_createAuthorizationRequest" "', argument " "1"" of type '" "blpapi_Service_t *""'"); + } + arg1 = (blpapi_Service_t *)(argp1); + res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Service_createAuthorizationRequest" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = (char *)(buf3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Service_createAuthorizationRequest(arg1,arg2,(char const *)arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Request, 0)); + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + return resultobj; +fail: + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Service_createPublishEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; + blpapi_Event_t **arg2 = (blpapi_Event_t **) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_Event_t *temp2 = 0 ; + PyObject * obj0 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_createPublishEvent",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_createPublishEvent" "', argument " "1"" of type '" "blpapi_Service_t *""'"); + } + arg1 = (blpapi_Service_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Service_createPublishEvent(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Event, 0)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Service_createAdminEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; + blpapi_Event_t **arg2 = (blpapi_Event_t **) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_Event_t *temp2 = 0 ; + PyObject * obj0 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_createAdminEvent",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_createAdminEvent" "', argument " "1"" of type '" "blpapi_Service_t *""'"); + } + arg1 = (blpapi_Service_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Service_createAdminEvent(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Event, 0)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Service_createResponseEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; + blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; + blpapi_Event_t **arg3 = (blpapi_Event_t **) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + blpapi_Event_t *temp3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg3 = &temp3; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Service_createResponseEvent",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_createResponseEvent" "', argument " "1"" of type '" "blpapi_Service_t *""'"); + } + arg1 = (blpapi_Service_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Service_createResponseEvent" "', argument " "2"" of type '" "blpapi_CorrelationId_t const *""'"); + } + arg2 = (blpapi_CorrelationId_t *)(argp2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Service_createResponseEvent(arg1,(struct blpapi_CorrelationId_t_ const *)arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg3), SWIGTYPE_p_blpapi_Event, 0)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Message_messageType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_Name_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_messageType",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_messageType" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); + } + arg1 = (blpapi_Message_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_Name_t *)blpapi_Message_messageType((struct blpapi_Message const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Message_topicName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + char *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_topicName",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_topicName" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); + } + arg1 = (blpapi_Message_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (char *)blpapi_Message_topicName((struct blpapi_Message const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Message_service(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_Service_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_service",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_service" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); + } + arg1 = (blpapi_Message_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_Service_t *)blpapi_Message_service((struct blpapi_Message const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Service, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Message_numCorrelationIds(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_numCorrelationIds",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_numCorrelationIds" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); + } + arg1 = (blpapi_Message_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Message_numCorrelationIds((struct blpapi_Message const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Message_correlationId(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; + size_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + blpapi_CorrelationId_t result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Message_correlationId",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_correlationId" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); + } + arg1 = (blpapi_Message_t *)(argp1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Message_correlationId" "', argument " "2"" of type '" "size_t""'"); + } + arg2 = (size_t)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = blpapi_Message_correlationId((struct blpapi_Message const *)arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(CorrelationId_t_clone(&result), SWIGTYPE_p_blpapi_CorrelationId_t_, SWIG_POINTER_OWN)); + } + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Message_elements(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_Element_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_elements",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_elements" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); + } + arg1 = (blpapi_Message_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_Element_t *)blpapi_Message_elements((struct blpapi_Message const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Element, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Message_fragmentType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_fragmentType",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_fragmentType" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); + } + arg1 = (blpapi_Message_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Message_fragmentType((struct blpapi_Message const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Message_recapType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_recapType",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_recapType" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); + } + arg1 = (blpapi_Message_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Message_recapType((struct blpapi_Message const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Message_print(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; + blpapi_StreamWriter_t arg2 ; + void *arg3 = (void *) 0 ; + int arg4 ; + int arg5 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 ; + int res2 = 0 ; + int res3 ; + int val4 ; + int ecode4 = 0 ; + int val5 ; + int ecode5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOOO:blpapi_Message_print",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_print" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); + } + arg1 = (blpapi_Message_t *)(argp1); + { + res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_blpapi_StreamWriter_t, 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Message_print" "', argument " "2"" of type '" "blpapi_StreamWriter_t""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "blpapi_Message_print" "', argument " "2"" of type '" "blpapi_StreamWriter_t""'"); + } else { + arg2 = *((blpapi_StreamWriter_t *)(argp2)); + } + } + res3 = SWIG_ConvertPtr(obj2,SWIG_as_voidptrptr(&arg3), 0, 0); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Message_print" "', argument " "3"" of type '" "void *""'"); + } + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_Message_print" "', argument " "4"" of type '" "int""'"); + } + arg4 = (int)(val4); + ecode5 = SWIG_AsVal_int(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_Message_print" "', argument " "5"" of type '" "int""'"); + } + arg5 = (int)(val5); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Message_print((struct blpapi_Message const *)arg1,arg2,arg3,arg4,arg5); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Message_addRef(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_addRef",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_addRef" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); + } + arg1 = (blpapi_Message_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Message_addRef((struct blpapi_Message const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Message_release(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_release",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_release" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); + } + arg1 = (blpapi_Message_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Message_release((struct blpapi_Message const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Message_timeReceived(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; + blpapi_TimePoint_t *arg2 = (blpapi_TimePoint_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_TimePoint_t temp2 ; + PyObject * obj0 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_timeReceived",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_timeReceived" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); + } + arg1 = (blpapi_Message_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Message_timeReceived((struct blpapi_Message const *)arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + { + blpapi_TimePoint_t *outputPtr = (blpapi_TimePoint_t *) malloc(sizeof(blpapi_TimePoint_t)); + *outputPtr = *arg2; + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(outputPtr, SWIGTYPE_p_blpapi_TimePoint, SWIG_POINTER_OWN)); + } + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Event_eventType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Event_t *arg1 = (blpapi_Event_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Event_eventType",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Event, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Event_eventType" "', argument " "1"" of type '" "blpapi_Event_t const *""'"); + } + arg1 = (blpapi_Event_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Event_eventType((struct blpapi_Event const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Event_release(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Event_t *arg1 = (blpapi_Event_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Event_release",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Event, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Event_release" "', argument " "1"" of type '" "blpapi_Event_t const *""'"); + } + arg1 = (blpapi_Event_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Event_release((struct blpapi_Event const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_EventQueue_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_EventQueue_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)":blpapi_EventQueue_create")) SWIG_fail; + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_EventQueue_t *)blpapi_EventQueue_create(); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_EventQueue_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_EventQueue_t *arg1 = (blpapi_EventQueue_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_EventQueue_destroy",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventQueue_destroy" "', argument " "1"" of type '" "blpapi_EventQueue_t *""'"); + } + arg1 = (blpapi_EventQueue_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_EventQueue_destroy(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_EventQueue_nextEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_EventQueue_t *arg1 = (blpapi_EventQueue_t *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + blpapi_Event_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_EventQueue_nextEvent",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventQueue_nextEvent" "', argument " "1"" of type '" "blpapi_EventQueue_t *""'"); + } + arg1 = (blpapi_EventQueue_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_EventQueue_nextEvent" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_Event_t *)blpapi_EventQueue_nextEvent(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Event, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_EventQueue_purge(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_EventQueue_t *arg1 = (blpapi_EventQueue_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_EventQueue_purge",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventQueue_purge" "', argument " "1"" of type '" "blpapi_EventQueue_t *""'"); + } + arg1 = (blpapi_EventQueue_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_EventQueue_purge(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_EventQueue_tryNextEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_EventQueue_t *arg1 = (blpapi_EventQueue_t *) 0 ; + blpapi_Event_t **arg2 = (blpapi_Event_t **) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_Event_t *temp2 = 0 ; + PyObject * obj0 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_EventQueue_tryNextEvent",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventQueue_tryNextEvent" "', argument " "1"" of type '" "blpapi_EventQueue_t *""'"); + } + arg1 = (blpapi_EventQueue_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_EventQueue_tryNextEvent(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Event, 0)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_MessageIterator_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Event_t *arg1 = (blpapi_Event_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_MessageIterator_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_MessageIterator_create",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Event, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageIterator_create" "', argument " "1"" of type '" "blpapi_Event_t const *""'"); + } + arg1 = (blpapi_Event_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_MessageIterator_t *)blpapi_MessageIterator_create((struct blpapi_Event const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_MessageIterator, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_MessageIterator_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_MessageIterator_t *arg1 = (blpapi_MessageIterator_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_MessageIterator_destroy",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageIterator, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageIterator_destroy" "', argument " "1"" of type '" "blpapi_MessageIterator_t *""'"); + } + arg1 = (blpapi_MessageIterator_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_MessageIterator_destroy(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_MessageIterator_next(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_MessageIterator_t *arg1 = (blpapi_MessageIterator_t *) 0 ; + blpapi_Message_t **arg2 = (blpapi_Message_t **) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_Message_t *temp2 = 0 ; + PyObject * obj0 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_MessageIterator_next",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageIterator, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageIterator_next" "', argument " "1"" of type '" "blpapi_MessageIterator_t *""'"); + } + arg1 = (blpapi_MessageIterator_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_MessageIterator_next(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Message, 0)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Identity_release(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Identity_t *arg1 = (blpapi_Identity_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Identity_release",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Identity_release" "', argument " "1"" of type '" "blpapi_Identity_t *""'"); + } + arg1 = (blpapi_Identity_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_Identity_release(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Identity_addRef(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Identity_t *arg1 = (blpapi_Identity_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Identity_addRef",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Identity_addRef" "', argument " "1"" of type '" "blpapi_Identity_t *""'"); + } + arg1 = (blpapi_Identity_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Identity_addRef(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Identity_hasEntitlements(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Identity_t *arg1 = (blpapi_Identity_t *) 0 ; + blpapi_Service_t *arg2 = (blpapi_Service_t *) 0 ; + blpapi_Element_t *arg3 = (blpapi_Element_t *) 0 ; + int *arg4 = (int *) 0 ; + size_t arg5 ; + int *arg6 = (int *) 0 ; + int *arg7 = (int *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + size_t val5 ; + int ecode5 = 0 ; + void *argp6 = 0 ; + int res6 = 0 ; + void *argp7 = 0 ; + int res7 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:blpapi_Identity_hasEntitlements",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Identity_hasEntitlements" "', argument " "1"" of type '" "blpapi_Identity_t const *""'"); + } + arg1 = (blpapi_Identity_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Identity_hasEntitlements" "', argument " "2"" of type '" "blpapi_Service_t const *""'"); + } + arg2 = (blpapi_Service_t *)(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Identity_hasEntitlements" "', argument " "3"" of type '" "blpapi_Element_t const *""'"); + } + arg3 = (blpapi_Element_t *)(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_int, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Identity_hasEntitlements" "', argument " "4"" of type '" "int const *""'"); + } + arg4 = (int *)(argp4); + ecode5 = SWIG_AsVal_size_t(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_Identity_hasEntitlements" "', argument " "5"" of type '" "size_t""'"); + } + arg5 = (size_t)(val5); + res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_int, 0 | 0 ); + if (!SWIG_IsOK(res6)) { + SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "blpapi_Identity_hasEntitlements" "', argument " "6"" of type '" "int *""'"); + } + arg6 = (int *)(argp6); + res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_int, 0 | 0 ); + if (!SWIG_IsOK(res7)) { + SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "blpapi_Identity_hasEntitlements" "', argument " "7"" of type '" "int *""'"); + } + arg7 = (int *)(argp7); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Identity_hasEntitlements((struct blpapi_Identity const *)arg1,(struct blpapi_Service const *)arg2,(struct blpapi_Element const *)arg3,(int const *)arg4,arg5,arg6,arg7); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Identity_isAuthorized(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Identity_t *arg1 = (blpapi_Identity_t *) 0 ; + blpapi_Service_t *arg2 = (blpapi_Service_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Identity_isAuthorized",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Identity_isAuthorized" "', argument " "1"" of type '" "blpapi_Identity_t const *""'"); + } + arg1 = (blpapi_Identity_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Identity_isAuthorized" "', argument " "2"" of type '" "blpapi_Service_t const *""'"); + } + arg2 = (blpapi_Service_t *)(argp2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Identity_isAuthorized((struct blpapi_Identity const *)arg1,(struct blpapi_Service const *)arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Identity_getSeatType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Identity_t *arg1 = (blpapi_Identity_t *) 0 ; + int *arg2 = (int *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int temp2 ; + int res2 = SWIG_TMPOBJ ; + PyObject * obj0 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Identity_getSeatType",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Identity_getSeatType" "', argument " "1"" of type '" "blpapi_Identity_t const *""'"); + } + arg1 = (blpapi_Identity_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Identity_getSeatType((struct blpapi_Identity const *)arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (SWIG_IsTmpObj(res2)) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg2))); + } else { + int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_int, new_flags)); + } + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_HighResolutionClock_now(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_TimePoint_t *arg1 = (blpapi_TimePoint_t *) 0 ; + blpapi_TimePoint_t temp1 ; + int result; + + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)":blpapi_HighResolutionClock_now")) SWIG_fail; + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_HighResolutionClock_now(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + { + blpapi_TimePoint_t *outputPtr = (blpapi_TimePoint_t *) malloc(sizeof(blpapi_TimePoint_t)); + *outputPtr = *arg1; + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(outputPtr, SWIGTYPE_p_blpapi_TimePoint, SWIG_POINTER_OWN)); + } + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_cancel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; + blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; + size_t arg3 ; + char *arg4 = (char *) 0 ; + int arg5 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; + int res4 ; + char *buf4 = 0 ; + int alloc4 = 0 ; + int val5 ; + int ecode5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOOO:blpapi_AbstractSession_cancel",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_cancel" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); + } + arg1 = (blpapi_AbstractSession_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_cancel" "', argument " "2"" of type '" "blpapi_CorrelationId_t const *""'"); + } + arg2 = (blpapi_CorrelationId_t *)(argp2); + ecode3 = SWIG_AsVal_size_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_AbstractSession_cancel" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); + res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_AbstractSession_cancel" "', argument " "4"" of type '" "char const *""'"); + } + arg4 = (char *)(buf4); + ecode5 = SWIG_AsVal_int(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_AbstractSession_cancel" "', argument " "5"" of type '" "int""'"); + } + arg5 = (int)(val5); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_AbstractSession_cancel(arg1,(struct blpapi_CorrelationId_t_ const *)arg2,arg3,(char const *)arg4,arg5); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); + return resultobj; +fail: + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_sendAuthorizationRequest(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; + blpapi_Request_t *arg2 = (blpapi_Request_t *) 0 ; + blpapi_Identity_t *arg3 = (blpapi_Identity_t *) 0 ; + blpapi_CorrelationId_t *arg4 = (blpapi_CorrelationId_t *) 0 ; + blpapi_EventQueue_t *arg5 = (blpapi_EventQueue_t *) 0 ; + char *arg6 = (char *) 0 ; + int arg7 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + void *argp5 = 0 ; + int res5 = 0 ; + int res6 ; + char *buf6 = 0 ; + int alloc6 = 0 ; + int val7 ; + int ecode7 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:blpapi_AbstractSession_sendAuthorizationRequest",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_sendAuthorizationRequest" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); + } + arg1 = (blpapi_AbstractSession_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Request, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_sendAuthorizationRequest" "', argument " "2"" of type '" "blpapi_Request_t const *""'"); + } + arg2 = (blpapi_Request_t *)(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AbstractSession_sendAuthorizationRequest" "', argument " "3"" of type '" "blpapi_Identity_t *""'"); + } + arg3 = (blpapi_Identity_t *)(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_AbstractSession_sendAuthorizationRequest" "', argument " "4"" of type '" "blpapi_CorrelationId_t *""'"); + } + arg4 = (blpapi_CorrelationId_t *)(argp4); + res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); + if (!SWIG_IsOK(res5)) { + SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "blpapi_AbstractSession_sendAuthorizationRequest" "', argument " "5"" of type '" "blpapi_EventQueue_t *""'"); + } + arg5 = (blpapi_EventQueue_t *)(argp5); + res6 = SWIG_AsCharPtrAndSize(obj5, &buf6, NULL, &alloc6); + if (!SWIG_IsOK(res6)) { + SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "blpapi_AbstractSession_sendAuthorizationRequest" "', argument " "6"" of type '" "char const *""'"); + } + arg6 = (char *)(buf6); + ecode7 = SWIG_AsVal_int(obj6, &val7); + if (!SWIG_IsOK(ecode7)) { + SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "blpapi_AbstractSession_sendAuthorizationRequest" "', argument " "7"" of type '" "int""'"); + } + arg7 = (int)(val7); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_AbstractSession_sendAuthorizationRequest(arg1,(struct blpapi_Request const *)arg2,arg3,arg4,arg5,(char const *)arg6,arg7); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc6 == SWIG_NEWOBJ) free((char*)buf6); + return resultobj; +fail: + if (alloc6 == SWIG_NEWOBJ) free((char*)buf6); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_openService(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; + char *arg2 = (char *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_AbstractSession_openService",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_openService" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); + } + arg1 = (blpapi_AbstractSession_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_openService" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_AbstractSession_openService(arg1,(char const *)arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_openServiceAsync(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_AbstractSession_openServiceAsync",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_openServiceAsync" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); + } + arg1 = (blpapi_AbstractSession_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_openServiceAsync" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AbstractSession_openServiceAsync" "', argument " "3"" of type '" "blpapi_CorrelationId_t *""'"); + } + arg3 = (blpapi_CorrelationId_t *)(argp3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_AbstractSession_openServiceAsync(arg1,(char const *)arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_generateToken(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; + blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; + blpapi_EventQueue_t *arg3 = (blpapi_EventQueue_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_AbstractSession_generateToken",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_generateToken" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); + } + arg1 = (blpapi_AbstractSession_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_generateToken" "', argument " "2"" of type '" "blpapi_CorrelationId_t *""'"); + } + arg2 = (blpapi_CorrelationId_t *)(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AbstractSession_generateToken" "', argument " "3"" of type '" "blpapi_EventQueue_t *""'"); + } + arg3 = (blpapi_EventQueue_t *)(argp3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_AbstractSession_generateToken(arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_generateManualToken(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; + blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; + char *arg3 = (char *) 0 ; + char *arg4 = (char *) 0 ; + blpapi_EventQueue_t *arg5 = (blpapi_EventQueue_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + int res4 ; + char *buf4 = 0 ; + int alloc4 = 0 ; + void *argp5 = 0 ; + int res5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOOO:blpapi_AbstractSession_generateManualToken",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_generateManualToken" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); + } + arg1 = (blpapi_AbstractSession_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_generateManualToken" "', argument " "2"" of type '" "blpapi_CorrelationId_t *""'"); + } + arg2 = (blpapi_CorrelationId_t *)(argp2); + res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AbstractSession_generateManualToken" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = (char *)(buf3); + res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_AbstractSession_generateManualToken" "', argument " "4"" of type '" "char const *""'"); + } + arg4 = (char *)(buf4); + res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); + if (!SWIG_IsOK(res5)) { + SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "blpapi_AbstractSession_generateManualToken" "', argument " "5"" of type '" "blpapi_EventQueue_t *""'"); + } + arg5 = (blpapi_EventQueue_t *)(argp5); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_AbstractSession_generateManualToken(arg1,arg2,(char const *)arg3,(char const *)arg4,arg5); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); + return resultobj; +fail: + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_getService(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; + blpapi_Service_t **arg2 = (blpapi_Service_t **) 0 ; + char *arg3 = (char *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_Service_t *temp2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_AbstractSession_getService",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_getService" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); + } + arg1 = (blpapi_AbstractSession_t *)(argp1); + res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AbstractSession_getService" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = (char *)(buf3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_AbstractSession_getService(arg1,arg2,(char const *)arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Service, 0)); + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + return resultobj; +fail: + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_createIdentity(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_Identity_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AbstractSession_createIdentity",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_createIdentity" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); + } + arg1 = (blpapi_AbstractSession_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_Identity_t *)blpapi_AbstractSession_createIdentity(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Session_start(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Session_start",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_start" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + } + arg1 = (blpapi_Session_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Session_start(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Session_startAsync(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Session_startAsync",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_startAsync" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + } + arg1 = (blpapi_Session_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Session_startAsync(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Session_stop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Session_stop",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_stop" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + } + arg1 = (blpapi_Session_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Session_stop(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Session_stopAsync(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Session_stopAsync",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_stopAsync" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + } + arg1 = (blpapi_Session_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Session_stopAsync(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Session_nextEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; + blpapi_Event_t **arg2 = (blpapi_Event_t **) 0 ; + unsigned int arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_Event_t *temp2 = 0 ; + unsigned int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Session_nextEvent",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_nextEvent" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + } + arg1 = (blpapi_Session_t *)(argp1); + ecode3 = SWIG_AsVal_unsigned_SS_int(obj1, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Session_nextEvent" "', argument " "3"" of type '" "unsigned int""'"); + } + arg3 = (unsigned int)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Session_nextEvent(arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Event, 0)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Session_tryNextEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; + blpapi_Event_t **arg2 = (blpapi_Event_t **) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_Event_t *temp2 = 0 ; + PyObject * obj0 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Session_tryNextEvent",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_tryNextEvent" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + } + arg1 = (blpapi_Session_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Session_tryNextEvent(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Event, 0)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Session_subscribe(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; + blpapi_SubscriptionList_t *arg2 = (blpapi_SubscriptionList_t *) 0 ; + blpapi_Identity_t *arg3 = (blpapi_Identity_t *) 0 ; + char *arg4 = (char *) 0 ; + int arg5 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + int res4 ; + char *buf4 = 0 ; + int alloc4 = 0 ; + int val5 ; + int ecode5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOOO:blpapi_Session_subscribe",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_subscribe" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + } + arg1 = (blpapi_Session_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_subscribe" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); + } + arg2 = (blpapi_SubscriptionList_t *)(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_subscribe" "', argument " "3"" of type '" "blpapi_Identity_t const *""'"); + } + arg3 = (blpapi_Identity_t *)(argp3); + res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Session_subscribe" "', argument " "4"" of type '" "char const *""'"); + } + arg4 = (char *)(buf4); + ecode5 = SWIG_AsVal_int(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_Session_subscribe" "', argument " "5"" of type '" "int""'"); + } + arg5 = (int)(val5); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Session_subscribe(arg1,(struct blpapi_SubscriptionList const *)arg2,(struct blpapi_Identity const *)arg3,(char const *)arg4,arg5); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); + return resultobj; +fail: + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Session_resubscribe(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; + blpapi_SubscriptionList_t *arg2 = (blpapi_SubscriptionList_t *) 0 ; + char *arg3 = (char *) 0 ; + int arg4 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Session_resubscribe",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_resubscribe" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + } + arg1 = (blpapi_Session_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_resubscribe" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); + } + arg2 = (blpapi_SubscriptionList_t *)(argp2); + res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_resubscribe" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = (char *)(buf3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_Session_resubscribe" "', argument " "4"" of type '" "int""'"); + } + arg4 = (int)(val4); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Session_resubscribe(arg1,(struct blpapi_SubscriptionList const *)arg2,(char const *)arg3,arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + return resultobj; +fail: + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Session_resubscribeWithId(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; + blpapi_SubscriptionList_t *arg2 = (blpapi_SubscriptionList_t *) 0 ; + int arg3 ; + char *arg4 = (char *) 0 ; + int arg5 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int res4 ; + char *buf4 = 0 ; + int alloc4 = 0 ; + int val5 ; + int ecode5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOOO:blpapi_Session_resubscribeWithId",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_resubscribeWithId" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + } + arg1 = (blpapi_Session_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_resubscribeWithId" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); + } + arg2 = (blpapi_SubscriptionList_t *)(argp2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Session_resubscribeWithId" "', argument " "3"" of type '" "int""'"); + } + arg3 = (int)(val3); + res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Session_resubscribeWithId" "', argument " "4"" of type '" "char const *""'"); + } + arg4 = (char *)(buf4); + ecode5 = SWIG_AsVal_int(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_Session_resubscribeWithId" "', argument " "5"" of type '" "int""'"); + } + arg5 = (int)(val5); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Session_resubscribeWithId(arg1,(struct blpapi_SubscriptionList const *)arg2,arg3,(char const *)arg4,arg5); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); + return resultobj; +fail: + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Session_unsubscribe(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; + blpapi_SubscriptionList_t *arg2 = (blpapi_SubscriptionList_t *) 0 ; + char *arg3 = (char *) 0 ; + int arg4 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Session_unsubscribe",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_unsubscribe" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + } + arg1 = (blpapi_Session_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_unsubscribe" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); + } + arg2 = (blpapi_SubscriptionList_t *)(argp2); + res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_unsubscribe" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = (char *)(buf3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_Session_unsubscribe" "', argument " "4"" of type '" "int""'"); + } + arg4 = (int)(val4); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Session_unsubscribe(arg1,(struct blpapi_SubscriptionList const *)arg2,(char const *)arg3,arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + return resultobj; +fail: + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Session_setStatusCorrelationId(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; + blpapi_Service_t *arg2 = (blpapi_Service_t *) 0 ; + blpapi_Identity_t *arg3 = (blpapi_Identity_t *) 0 ; + blpapi_CorrelationId_t *arg4 = (blpapi_CorrelationId_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Session_setStatusCorrelationId",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_setStatusCorrelationId" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + } + arg1 = (blpapi_Session_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_setStatusCorrelationId" "', argument " "2"" of type '" "blpapi_Service_t const *""'"); + } + arg2 = (blpapi_Service_t *)(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_setStatusCorrelationId" "', argument " "3"" of type '" "blpapi_Identity_t const *""'"); + } + arg3 = (blpapi_Identity_t *)(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Session_setStatusCorrelationId" "', argument " "4"" of type '" "blpapi_CorrelationId_t const *""'"); + } + arg4 = (blpapi_CorrelationId_t *)(argp4); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Session_setStatusCorrelationId(arg1,(struct blpapi_Service const *)arg2,(struct blpapi_Identity const *)arg3,(struct blpapi_CorrelationId_t_ const *)arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Session_sendRequest(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; + blpapi_Request_t *arg2 = (blpapi_Request_t *) 0 ; + blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; + blpapi_Identity_t *arg4 = (blpapi_Identity_t *) 0 ; + blpapi_EventQueue_t *arg5 = (blpapi_EventQueue_t *) 0 ; + char *arg6 = (char *) 0 ; + int arg7 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + void *argp5 = 0 ; + int res5 = 0 ; + int res6 ; + char *buf6 = 0 ; + int alloc6 = 0 ; + int val7 ; + int ecode7 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:blpapi_Session_sendRequest",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_sendRequest" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + } + arg1 = (blpapi_Session_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Request, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_sendRequest" "', argument " "2"" of type '" "blpapi_Request_t const *""'"); + } + arg2 = (blpapi_Request_t *)(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_sendRequest" "', argument " "3"" of type '" "blpapi_CorrelationId_t *""'"); + } + arg3 = (blpapi_CorrelationId_t *)(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Session_sendRequest" "', argument " "4"" of type '" "blpapi_Identity_t *""'"); + } + arg4 = (blpapi_Identity_t *)(argp4); + res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); + if (!SWIG_IsOK(res5)) { + SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "blpapi_Session_sendRequest" "', argument " "5"" of type '" "blpapi_EventQueue_t *""'"); + } + arg5 = (blpapi_EventQueue_t *)(argp5); + res6 = SWIG_AsCharPtrAndSize(obj5, &buf6, NULL, &alloc6); + if (!SWIG_IsOK(res6)) { + SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "blpapi_Session_sendRequest" "', argument " "6"" of type '" "char const *""'"); + } + arg6 = (char *)(buf6); + ecode7 = SWIG_AsVal_int(obj6, &val7); + if (!SWIG_IsOK(ecode7)) { + SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "blpapi_Session_sendRequest" "', argument " "7"" of type '" "int""'"); + } + arg7 = (int)(val7); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Session_sendRequest(arg1,(struct blpapi_Request const *)arg2,arg3,arg4,arg5,(char const *)arg6,arg7); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc6 == SWIG_NEWOBJ) free((char*)buf6); + return resultobj; +fail: + if (alloc6 == SWIG_NEWOBJ) free((char*)buf6); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Session_sendRequestTemplate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; + blpapi_RequestTemplate_t *arg2 = (blpapi_RequestTemplate_t *) 0 ; + blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Session_sendRequestTemplate",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_sendRequestTemplate" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + } + arg1 = (blpapi_Session_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_RequestTemplate, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_sendRequestTemplate" "', argument " "2"" of type '" "blpapi_RequestTemplate_t const *""'"); + } + arg2 = (blpapi_RequestTemplate_t *)(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_sendRequestTemplate" "', argument " "3"" of type '" "blpapi_CorrelationId_t *""'"); + } + arg3 = (blpapi_CorrelationId_t *)(argp3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Session_sendRequestTemplate(arg1,(struct blpapi_RequestTemplate const *)arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Session_createSnapshotRequestTemplate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_RequestTemplate_t **arg1 = (blpapi_RequestTemplate_t **) 0 ; + blpapi_Session_t *arg2 = (blpapi_Session_t *) 0 ; + char *arg3 = (char *) 0 ; + blpapi_Identity_t *arg4 = (blpapi_Identity_t *) 0 ; + blpapi_CorrelationId_t *arg5 = (blpapi_CorrelationId_t *) 0 ; + blpapi_RequestTemplate_t *temp1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + void *argp5 = 0 ; + int res5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + int result; + + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Session_createSnapshotRequestTemplate",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_createSnapshotRequestTemplate" "', argument " "2"" of type '" "blpapi_Session_t *""'"); + } + arg2 = (blpapi_Session_t *)(argp2); + res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_createSnapshotRequestTemplate" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = (char *)(buf3); + res4 = SWIG_ConvertPtr(obj2, &argp4,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Session_createSnapshotRequestTemplate" "', argument " "4"" of type '" "blpapi_Identity_t const *""'"); + } + arg4 = (blpapi_Identity_t *)(argp4); + res5 = SWIG_ConvertPtr(obj3, &argp5,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res5)) { + SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "blpapi_Session_createSnapshotRequestTemplate" "', argument " "5"" of type '" "blpapi_CorrelationId_t *""'"); + } + arg5 = (blpapi_CorrelationId_t *)(argp5); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Session_createSnapshotRequestTemplate(arg1,arg2,(char const *)arg3,(struct blpapi_Identity const *)arg4,arg5); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_RequestTemplate, 0)); + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + return resultobj; +fail: + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Session_getAbstractSession(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_AbstractSession_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Session_getAbstractSession",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_getAbstractSession" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + } + arg1 = (blpapi_Session_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_AbstractSession_t *)blpapi_Session_getAbstractSession(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_extractAttributeFromResolutionSuccess(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; + blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + blpapi_Element_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_extractAttributeFromResolutionSuccess",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_extractAttributeFromResolutionSuccess" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); + } + arg1 = (blpapi_Message_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ResolutionList_extractAttributeFromResolutionSuccess" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); + } + arg2 = (blpapi_Name_t *)(argp2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_Element_t *)blpapi_ResolutionList_extractAttributeFromResolutionSuccess((struct blpapi_Message const *)arg1,(struct blpapi_Name const *)arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Element, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_ResolutionList_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ResolutionList_create",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_create" "', argument " "1"" of type '" "blpapi_ResolutionList_t *""'"); + } + arg1 = (blpapi_ResolutionList_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_ResolutionList_t *)blpapi_ResolutionList_create(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ResolutionList_destroy",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_destroy" "', argument " "1"" of type '" "blpapi_ResolutionList_t *""'"); + } + arg1 = (blpapi_ResolutionList_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_ResolutionList_destroy(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_ResolutionList_add",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_add" "', argument " "1"" of type '" "blpapi_ResolutionList_t *""'"); + } + arg1 = (blpapi_ResolutionList_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ResolutionList_add" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ResolutionList_add" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); + } + arg3 = (blpapi_CorrelationId_t *)(argp3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ResolutionList_add(arg1,(char const *)arg2,(struct blpapi_CorrelationId_t_ const *)arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_addFromMessage(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; + blpapi_Message_t *arg2 = (blpapi_Message_t *) 0 ; + blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_ResolutionList_addFromMessage",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_addFromMessage" "', argument " "1"" of type '" "blpapi_ResolutionList_t *""'"); + } + arg1 = (blpapi_ResolutionList_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ResolutionList_addFromMessage" "', argument " "2"" of type '" "blpapi_Message_t const *""'"); + } + arg2 = (blpapi_Message_t *)(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ResolutionList_addFromMessage" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); + } + arg3 = (blpapi_CorrelationId_t *)(argp3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ResolutionList_addFromMessage(arg1,(struct blpapi_Message const *)arg2,(struct blpapi_CorrelationId_t_ const *)arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_addAttribute(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; + blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_addAttribute",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_addAttribute" "', argument " "1"" of type '" "blpapi_ResolutionList_t *""'"); + } + arg1 = (blpapi_ResolutionList_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ResolutionList_addAttribute" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); + } + arg2 = (blpapi_Name_t *)(argp2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ResolutionList_addAttribute(arg1,(struct blpapi_Name const *)arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_correlationIdAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; + blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; + size_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_CorrelationId_t temp2 ; + size_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_correlationIdAt",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_correlationIdAt" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); + } + arg1 = (blpapi_ResolutionList_t *)(argp1); + ecode3 = SWIG_AsVal_size_t(obj1, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ResolutionList_correlationIdAt" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ResolutionList_correlationIdAt((struct blpapi_ResolutionList const *)arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (!result) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(CorrelationId_t_clone(arg2), SWIGTYPE_p_blpapi_CorrelationId_t_, SWIG_POINTER_OWN)); + } else { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_Py_Void()); + } + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_topicString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; + char **arg2 = (char **) 0 ; + blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + char *temp2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_topicString",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_topicString" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); + } + arg1 = (blpapi_ResolutionList_t *)(argp1); + res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ResolutionList_topicString" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); + } + arg3 = (blpapi_CorrelationId_t *)(argp3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ResolutionList_topicString((struct blpapi_ResolutionList const *)arg1,(char const **)arg2,(struct blpapi_CorrelationId_t_ const *)arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_topicStringAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; + char **arg2 = (char **) 0 ; + size_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + char *temp2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_topicStringAt",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_topicStringAt" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); + } + arg1 = (blpapi_ResolutionList_t *)(argp1); + ecode3 = SWIG_AsVal_size_t(obj1, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ResolutionList_topicStringAt" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ResolutionList_topicStringAt((struct blpapi_ResolutionList const *)arg1,(char const **)arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_status(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; + int *arg2 = (int *) 0 ; + blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int temp2 ; + int res2 = SWIG_TMPOBJ ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_status",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_status" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); + } + arg1 = (blpapi_ResolutionList_t *)(argp1); + res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ResolutionList_status" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); + } + arg3 = (blpapi_CorrelationId_t *)(argp3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ResolutionList_status((struct blpapi_ResolutionList const *)arg1,arg2,(struct blpapi_CorrelationId_t_ const *)arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (SWIG_IsTmpObj(res2)) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg2))); + } else { + int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_int, new_flags)); + } + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_statusAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; + int *arg2 = (int *) 0 ; + size_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + int temp2 ; + int res2 = SWIG_TMPOBJ ; + size_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_statusAt",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_statusAt" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); + } + arg1 = (blpapi_ResolutionList_t *)(argp1); + ecode3 = SWIG_AsVal_size_t(obj1, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ResolutionList_statusAt" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ResolutionList_statusAt((struct blpapi_ResolutionList const *)arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (SWIG_IsTmpObj(res2)) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg2))); + } else { + int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_int, new_flags)); + } + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_attribute(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; + blpapi_Element_t **arg2 = (blpapi_Element_t **) 0 ; + blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; + blpapi_CorrelationId_t *arg4 = (blpapi_CorrelationId_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_Element_t *temp2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_ResolutionList_attribute",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_attribute" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); + } + arg1 = (blpapi_ResolutionList_t *)(argp1); + res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ResolutionList_attribute" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); + } + arg3 = (blpapi_Name_t *)(argp3); + res4 = SWIG_ConvertPtr(obj2, &argp4,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_ResolutionList_attribute" "', argument " "4"" of type '" "blpapi_CorrelationId_t const *""'"); + } + arg4 = (blpapi_CorrelationId_t *)(argp4); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ResolutionList_attribute((struct blpapi_ResolutionList const *)arg1,arg2,(struct blpapi_Name const *)arg3,(struct blpapi_CorrelationId_t_ const *)arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Element, 0)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_attributeAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; + blpapi_Element_t **arg2 = (blpapi_Element_t **) 0 ; + blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; + size_t arg4 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_Element_t *temp2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + size_t val4 ; + int ecode4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_ResolutionList_attributeAt",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_attributeAt" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); + } + arg1 = (blpapi_ResolutionList_t *)(argp1); + res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ResolutionList_attributeAt" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); + } + arg3 = (blpapi_Name_t *)(argp3); + ecode4 = SWIG_AsVal_size_t(obj2, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_ResolutionList_attributeAt" "', argument " "4"" of type '" "size_t""'"); + } + arg4 = (size_t)(val4); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ResolutionList_attributeAt((struct blpapi_ResolutionList const *)arg1,arg2,(struct blpapi_Name const *)arg3,arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Element, 0)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_message(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; + blpapi_Message_t **arg2 = (blpapi_Message_t **) 0 ; + blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_Message_t *temp2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_message",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_message" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); + } + arg1 = (blpapi_ResolutionList_t *)(argp1); + res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ResolutionList_message" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); + } + arg3 = (blpapi_CorrelationId_t *)(argp3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ResolutionList_message((struct blpapi_ResolutionList const *)arg1,arg2,(struct blpapi_CorrelationId_t_ const *)arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Message, 0)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_messageAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; + blpapi_Message_t **arg2 = (blpapi_Message_t **) 0 ; + size_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_Message_t *temp2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_messageAt",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_messageAt" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); + } + arg1 = (blpapi_ResolutionList_t *)(argp1); + ecode3 = SWIG_AsVal_size_t(obj1, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ResolutionList_messageAt" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ResolutionList_messageAt((struct blpapi_ResolutionList const *)arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Message, 0)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ResolutionList_size",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_size" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); + } + arg1 = (blpapi_ResolutionList_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ResolutionList_size((struct blpapi_ResolutionList const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Topic_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Topic_t *arg1 = (blpapi_Topic_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_Topic_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Topic_create",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Topic_create" "', argument " "1"" of type '" "blpapi_Topic_t *""'"); + } + arg1 = (blpapi_Topic_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_Topic_t *)blpapi_Topic_create(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Topic, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Topic_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Topic_t *arg1 = (blpapi_Topic_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Topic_destroy",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Topic_destroy" "', argument " "1"" of type '" "blpapi_Topic_t *""'"); + } + arg1 = (blpapi_Topic_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_Topic_destroy(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Topic_compare(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Topic_t *arg1 = (blpapi_Topic_t *) 0 ; + blpapi_Topic_t *arg2 = (blpapi_Topic_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Topic_compare",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Topic_compare" "', argument " "1"" of type '" "blpapi_Topic_t const *""'"); + } + arg1 = (blpapi_Topic_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Topic_compare" "', argument " "2"" of type '" "blpapi_Topic_t const *""'"); + } + arg2 = (blpapi_Topic_t *)(argp2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Topic_compare((struct blpapi_Topic const *)arg1,(struct blpapi_Topic const *)arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Topic_service(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Topic_t *arg1 = (blpapi_Topic_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_Service_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Topic_service",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Topic_service" "', argument " "1"" of type '" "blpapi_Topic_t const *""'"); + } + arg1 = (blpapi_Topic_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_Service_t *)blpapi_Topic_service((struct blpapi_Topic const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Service, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Topic_isActive(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Topic_t *arg1 = (blpapi_Topic_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Topic_isActive",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Topic_isActive" "', argument " "1"" of type '" "blpapi_Topic_t const *""'"); + } + arg1 = (blpapi_Topic_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Topic_isActive((struct blpapi_Topic const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_TopicList_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_TopicList_t *arg1 = (blpapi_TopicList_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_TopicList_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_TopicList_create",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_create" "', argument " "1"" of type '" "blpapi_TopicList_t *""'"); + } + arg1 = (blpapi_TopicList_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_TopicList_t *)blpapi_TopicList_create(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_TopicList_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_TopicList_t *arg1 = (blpapi_TopicList_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_TopicList_destroy",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_destroy" "', argument " "1"" of type '" "blpapi_TopicList_t *""'"); + } + arg1 = (blpapi_TopicList_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_TopicList_destroy(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_TopicList_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_TopicList_t *arg1 = (blpapi_TopicList_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_TopicList_add",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_add" "', argument " "1"" of type '" "blpapi_TopicList_t *""'"); + } + arg1 = (blpapi_TopicList_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_TopicList_add" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_TopicList_add" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); + } + arg3 = (blpapi_CorrelationId_t *)(argp3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_TopicList_add(arg1,(char const *)arg2,(struct blpapi_CorrelationId_t_ const *)arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_TopicList_addFromMessage(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_TopicList_t *arg1 = (blpapi_TopicList_t *) 0 ; + blpapi_Message_t *arg2 = (blpapi_Message_t *) 0 ; + blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_TopicList_addFromMessage",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_addFromMessage" "', argument " "1"" of type '" "blpapi_TopicList_t *""'"); + } + arg1 = (blpapi_TopicList_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_TopicList_addFromMessage" "', argument " "2"" of type '" "blpapi_Message_t const *""'"); + } + arg2 = (blpapi_Message_t *)(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_TopicList_addFromMessage" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); + } + arg3 = (blpapi_CorrelationId_t *)(argp3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_TopicList_addFromMessage(arg1,(struct blpapi_Message const *)arg2,(struct blpapi_CorrelationId_t_ const *)arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_TopicList_correlationIdAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_TopicList_t *arg1 = (blpapi_TopicList_t *) 0 ; + blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; + size_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_CorrelationId_t temp2 ; + size_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TopicList_correlationIdAt",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_correlationIdAt" "', argument " "1"" of type '" "blpapi_TopicList_t const *""'"); + } + arg1 = (blpapi_TopicList_t *)(argp1); + ecode3 = SWIG_AsVal_size_t(obj1, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_TopicList_correlationIdAt" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_TopicList_correlationIdAt((struct blpapi_TopicList const *)arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (!result) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(CorrelationId_t_clone(arg2), SWIGTYPE_p_blpapi_CorrelationId_t_, SWIG_POINTER_OWN)); + } else { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_Py_Void()); + } + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_TopicList_topicString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_TopicList_t *arg1 = (blpapi_TopicList_t *) 0 ; + char **arg2 = (char **) 0 ; + blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + char *temp2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TopicList_topicString",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_topicString" "', argument " "1"" of type '" "blpapi_TopicList_t const *""'"); + } + arg1 = (blpapi_TopicList_t *)(argp1); + res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_TopicList_topicString" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); + } + arg3 = (blpapi_CorrelationId_t *)(argp3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_TopicList_topicString((struct blpapi_TopicList const *)arg1,(char const **)arg2,(struct blpapi_CorrelationId_t_ const *)arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_TopicList_topicStringAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_TopicList_t *arg1 = (blpapi_TopicList_t *) 0 ; + char **arg2 = (char **) 0 ; + size_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + char *temp2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TopicList_topicStringAt",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_topicStringAt" "', argument " "1"" of type '" "blpapi_TopicList_t const *""'"); + } + arg1 = (blpapi_TopicList_t *)(argp1); + ecode3 = SWIG_AsVal_size_t(obj1, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_TopicList_topicStringAt" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_TopicList_topicStringAt((struct blpapi_TopicList const *)arg1,(char const **)arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_TopicList_status(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_TopicList_t *arg1 = (blpapi_TopicList_t *) 0 ; + int *arg2 = (int *) 0 ; + blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int temp2 ; + int res2 = SWIG_TMPOBJ ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TopicList_status",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_status" "', argument " "1"" of type '" "blpapi_TopicList_t const *""'"); + } + arg1 = (blpapi_TopicList_t *)(argp1); + res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_TopicList_status" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); + } + arg3 = (blpapi_CorrelationId_t *)(argp3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_TopicList_status((struct blpapi_TopicList const *)arg1,arg2,(struct blpapi_CorrelationId_t_ const *)arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (SWIG_IsTmpObj(res2)) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg2))); + } else { + int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_int, new_flags)); + } + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_TopicList_statusAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_TopicList_t *arg1 = (blpapi_TopicList_t *) 0 ; + int *arg2 = (int *) 0 ; + size_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + int temp2 ; + int res2 = SWIG_TMPOBJ ; + size_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TopicList_statusAt",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_statusAt" "', argument " "1"" of type '" "blpapi_TopicList_t const *""'"); + } + arg1 = (blpapi_TopicList_t *)(argp1); + ecode3 = SWIG_AsVal_size_t(obj1, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_TopicList_statusAt" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_TopicList_statusAt((struct blpapi_TopicList const *)arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (SWIG_IsTmpObj(res2)) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg2))); + } else { + int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_int, new_flags)); + } + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_TopicList_message(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_TopicList_t *arg1 = (blpapi_TopicList_t *) 0 ; + blpapi_Message_t **arg2 = (blpapi_Message_t **) 0 ; + blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_Message_t *temp2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TopicList_message",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_message" "', argument " "1"" of type '" "blpapi_TopicList_t const *""'"); + } + arg1 = (blpapi_TopicList_t *)(argp1); + res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_TopicList_message" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); + } + arg3 = (blpapi_CorrelationId_t *)(argp3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_TopicList_message((struct blpapi_TopicList const *)arg1,arg2,(struct blpapi_CorrelationId_t_ const *)arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Message, 0)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_TopicList_messageAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_TopicList_t *arg1 = (blpapi_TopicList_t *) 0 ; + blpapi_Message_t **arg2 = (blpapi_Message_t **) 0 ; + size_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_Message_t *temp2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TopicList_messageAt",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_messageAt" "', argument " "1"" of type '" "blpapi_TopicList_t const *""'"); + } + arg1 = (blpapi_TopicList_t *)(argp1); + ecode3 = SWIG_AsVal_size_t(obj1, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_TopicList_messageAt" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_TopicList_messageAt((struct blpapi_TopicList const *)arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Message, 0)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_TopicList_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_TopicList_t *arg1 = (blpapi_TopicList_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_TopicList_size",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_size" "', argument " "1"" of type '" "blpapi_TopicList_t const *""'"); + } + arg1 = (blpapi_TopicList_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_TopicList_size((struct blpapi_TopicList const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + blpapi_ProviderEventHandler_t arg2 = (blpapi_ProviderEventHandler_t) 0 ; + blpapi_EventDispatcher_t *arg3 = (blpapi_EventDispatcher_t *) 0 ; + void *arg4 = (void *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + int res4 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + blpapi_ProviderSession_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_ProviderSession_create",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_create" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + { + int res = SWIG_ConvertFunctionPtr(obj1, (void**)(&arg2), SWIGTYPE_p_f_p_struct_blpapi_Event_p_struct_blpapi_ProviderSession_p_void__void); + if (!SWIG_IsOK(res)) { + SWIG_exception_fail(SWIG_ArgError(res), "in method '" "blpapi_ProviderSession_create" "', argument " "2"" of type '" "blpapi_ProviderEventHandler_t""'"); + } + } + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_EventDispatcher, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ProviderSession_create" "', argument " "3"" of type '" "blpapi_EventDispatcher_t *""'"); + } + arg3 = (blpapi_EventDispatcher_t *)(argp3); + res4 = SWIG_ConvertPtr(obj3,SWIG_as_voidptrptr(&arg4), 0, 0); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_ProviderSession_create" "', argument " "4"" of type '" "void *""'"); + } + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_ProviderSession_t *)blpapi_ProviderSession_create(arg1,arg2,arg3,arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ProviderSession_destroy",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_destroy" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); + } + arg1 = (blpapi_ProviderSession_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_ProviderSession_destroy(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_start(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ProviderSession_start",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_start" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); + } + arg1 = (blpapi_ProviderSession_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ProviderSession_start(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_startAsync(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ProviderSession_startAsync",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_startAsync" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); + } + arg1 = (blpapi_ProviderSession_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ProviderSession_startAsync(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_stop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ProviderSession_stop",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_stop" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); + } + arg1 = (blpapi_ProviderSession_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ProviderSession_stop(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_stopAsync(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ProviderSession_stopAsync",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_stopAsync" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); + } + arg1 = (blpapi_ProviderSession_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ProviderSession_stopAsync(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_nextEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; + blpapi_Event_t **arg2 = (blpapi_Event_t **) 0 ; + unsigned int arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_Event_t *temp2 = 0 ; + unsigned int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ProviderSession_nextEvent",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_nextEvent" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); + } + arg1 = (blpapi_ProviderSession_t *)(argp1); + ecode3 = SWIG_AsVal_unsigned_SS_int(obj1, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_nextEvent" "', argument " "3"" of type '" "unsigned int""'"); + } + arg3 = (unsigned int)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ProviderSession_nextEvent(arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Event, 0)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_tryNextEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; + blpapi_Event_t **arg2 = (blpapi_Event_t **) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_Event_t *temp2 = 0 ; + PyObject * obj0 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ProviderSession_tryNextEvent",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_tryNextEvent" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); + } + arg1 = (blpapi_ProviderSession_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ProviderSession_tryNextEvent(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Event, 0)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_registerService(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_Identity_t *arg3 = (blpapi_Identity_t *) 0 ; + blpapi_ServiceRegistrationOptions_t *arg4 = (blpapi_ServiceRegistrationOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_ProviderSession_registerService",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_registerService" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); + } + arg1 = (blpapi_ProviderSession_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_registerService" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ProviderSession_registerService" "', argument " "3"" of type '" "blpapi_Identity_t const *""'"); + } + arg3 = (blpapi_Identity_t *)(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_ProviderSession_registerService" "', argument " "4"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); + } + arg4 = (blpapi_ServiceRegistrationOptions_t *)(argp4); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ProviderSession_registerService(arg1,(char const *)arg2,(struct blpapi_Identity const *)arg3,arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_activateSubServiceCodeRange(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; + char *arg2 = (char *) 0 ; + int arg3 ; + int arg4 ; + int arg5 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + int val5 ; + int ecode5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOOO:blpapi_ProviderSession_activateSubServiceCodeRange",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_activateSubServiceCodeRange" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); + } + arg1 = (blpapi_ProviderSession_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_activateSubServiceCodeRange" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_activateSubServiceCodeRange" "', argument " "3"" of type '" "int""'"); + } + arg3 = (int)(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_ProviderSession_activateSubServiceCodeRange" "', argument " "4"" of type '" "int""'"); + } + arg4 = (int)(val4); + ecode5 = SWIG_AsVal_int(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_ProviderSession_activateSubServiceCodeRange" "', argument " "5"" of type '" "int""'"); + } + arg5 = (int)(val5); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ProviderSession_activateSubServiceCodeRange(arg1,(char const *)arg2,arg3,arg4,arg5); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_deactivateSubServiceCodeRange(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; + char *arg2 = (char *) 0 ; + int arg3 ; + int arg4 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_ProviderSession_deactivateSubServiceCodeRange",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_deactivateSubServiceCodeRange" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); + } + arg1 = (blpapi_ProviderSession_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_deactivateSubServiceCodeRange" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_deactivateSubServiceCodeRange" "', argument " "3"" of type '" "int""'"); + } + arg3 = (int)(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_ProviderSession_deactivateSubServiceCodeRange" "', argument " "4"" of type '" "int""'"); + } + arg4 = (int)(val4); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ProviderSession_deactivateSubServiceCodeRange(arg1,(char const *)arg2,arg3,arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_registerServiceAsync(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_Identity_t *arg3 = (blpapi_Identity_t *) 0 ; + blpapi_CorrelationId_t *arg4 = (blpapi_CorrelationId_t *) 0 ; + blpapi_ServiceRegistrationOptions_t *arg5 = (blpapi_ServiceRegistrationOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + void *argp5 = 0 ; + int res5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOOO:blpapi_ProviderSession_registerServiceAsync",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_registerServiceAsync" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); + } + arg1 = (blpapi_ProviderSession_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_registerServiceAsync" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ProviderSession_registerServiceAsync" "', argument " "3"" of type '" "blpapi_Identity_t const *""'"); + } + arg3 = (blpapi_Identity_t *)(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_ProviderSession_registerServiceAsync" "', argument " "4"" of type '" "blpapi_CorrelationId_t *""'"); + } + arg4 = (blpapi_CorrelationId_t *)(argp4); + res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); + if (!SWIG_IsOK(res5)) { + SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "blpapi_ProviderSession_registerServiceAsync" "', argument " "5"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); + } + arg5 = (blpapi_ServiceRegistrationOptions_t *)(argp5); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ProviderSession_registerServiceAsync(arg1,(char const *)arg2,(struct blpapi_Identity const *)arg3,arg4,arg5); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_deregisterService(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; + char *arg2 = (char *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ProviderSession_deregisterService",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_deregisterService" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); + } + arg1 = (blpapi_ProviderSession_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_deregisterService" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ProviderSession_deregisterService(arg1,(char const *)arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_resolve(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; + blpapi_ResolutionList_t *arg2 = (blpapi_ResolutionList_t *) 0 ; + int arg3 ; + blpapi_Identity_t *arg4 = (blpapi_Identity_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int val3 ; + int ecode3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_ProviderSession_resolve",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_resolve" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); + } + arg1 = (blpapi_ProviderSession_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_resolve" "', argument " "2"" of type '" "blpapi_ResolutionList_t *""'"); + } + arg2 = (blpapi_ResolutionList_t *)(argp2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_resolve" "', argument " "3"" of type '" "int""'"); + } + arg3 = (int)(val3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_ProviderSession_resolve" "', argument " "4"" of type '" "blpapi_Identity_t const *""'"); + } + arg4 = (blpapi_Identity_t *)(argp4); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ProviderSession_resolve(arg1,arg2,arg3,(struct blpapi_Identity const *)arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_resolveAsync(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; + blpapi_ResolutionList_t *arg2 = (blpapi_ResolutionList_t *) 0 ; + int arg3 ; + blpapi_Identity_t *arg4 = (blpapi_Identity_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int val3 ; + int ecode3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_ProviderSession_resolveAsync",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_resolveAsync" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); + } + arg1 = (blpapi_ProviderSession_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_resolveAsync" "', argument " "2"" of type '" "blpapi_ResolutionList_t const *""'"); + } + arg2 = (blpapi_ResolutionList_t *)(argp2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_resolveAsync" "', argument " "3"" of type '" "int""'"); + } + arg3 = (int)(val3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_ProviderSession_resolveAsync" "', argument " "4"" of type '" "blpapi_Identity_t const *""'"); + } + arg4 = (blpapi_Identity_t *)(argp4); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ProviderSession_resolveAsync(arg1,(struct blpapi_ResolutionList const *)arg2,arg3,(struct blpapi_Identity const *)arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_createTopics(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; + blpapi_TopicList_t *arg2 = (blpapi_TopicList_t *) 0 ; + int arg3 ; + blpapi_Identity_t *arg4 = (blpapi_Identity_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int val3 ; + int ecode3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_ProviderSession_createTopics",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_createTopics" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); + } + arg1 = (blpapi_ProviderSession_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_createTopics" "', argument " "2"" of type '" "blpapi_TopicList_t *""'"); + } + arg2 = (blpapi_TopicList_t *)(argp2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_createTopics" "', argument " "3"" of type '" "int""'"); + } + arg3 = (int)(val3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_ProviderSession_createTopics" "', argument " "4"" of type '" "blpapi_Identity_t const *""'"); + } + arg4 = (blpapi_Identity_t *)(argp4); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ProviderSession_createTopics(arg1,arg2,arg3,(struct blpapi_Identity const *)arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_createTopicsAsync(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; + blpapi_TopicList_t *arg2 = (blpapi_TopicList_t *) 0 ; + int arg3 ; + blpapi_Identity_t *arg4 = (blpapi_Identity_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int val3 ; + int ecode3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_ProviderSession_createTopicsAsync",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_createTopicsAsync" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); + } + arg1 = (blpapi_ProviderSession_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_createTopicsAsync" "', argument " "2"" of type '" "blpapi_TopicList_t const *""'"); + } + arg2 = (blpapi_TopicList_t *)(argp2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_createTopicsAsync" "', argument " "3"" of type '" "int""'"); + } + arg3 = (int)(val3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_ProviderSession_createTopicsAsync" "', argument " "4"" of type '" "blpapi_Identity_t const *""'"); + } + arg4 = (blpapi_Identity_t *)(argp4); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ProviderSession_createTopicsAsync(arg1,(struct blpapi_TopicList const *)arg2,arg3,(struct blpapi_Identity const *)arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_getTopic(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; + blpapi_Message_t *arg2 = (blpapi_Message_t *) 0 ; + blpapi_Topic_t **arg3 = (blpapi_Topic_t **) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + blpapi_Topic_t *temp3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg3 = &temp3; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ProviderSession_getTopic",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_getTopic" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); + } + arg1 = (blpapi_ProviderSession_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_getTopic" "', argument " "2"" of type '" "blpapi_Message_t const *""'"); + } + arg2 = (blpapi_Message_t *)(argp2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ProviderSession_getTopic(arg1,(struct blpapi_Message const *)arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg3), SWIGTYPE_p_blpapi_Topic, 0)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_createTopic(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; + blpapi_Message_t *arg2 = (blpapi_Message_t *) 0 ; + blpapi_Topic_t **arg3 = (blpapi_Topic_t **) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + blpapi_Topic_t *temp3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg3 = &temp3; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ProviderSession_createTopic",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_createTopic" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); + } + arg1 = (blpapi_ProviderSession_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_createTopic" "', argument " "2"" of type '" "blpapi_Message_t const *""'"); + } + arg2 = (blpapi_Message_t *)(argp2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ProviderSession_createTopic(arg1,(struct blpapi_Message const *)arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg3), SWIGTYPE_p_blpapi_Topic, 0)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_createServiceStatusTopic(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; + blpapi_Service_t *arg2 = (blpapi_Service_t *) 0 ; + blpapi_Topic_t **arg3 = (blpapi_Topic_t **) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + blpapi_Topic_t *temp3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg3 = &temp3; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ProviderSession_createServiceStatusTopic",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_createServiceStatusTopic" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); + } + arg1 = (blpapi_ProviderSession_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_createServiceStatusTopic" "', argument " "2"" of type '" "blpapi_Service_t const *""'"); + } + arg2 = (blpapi_Service_t *)(argp2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ProviderSession_createServiceStatusTopic(arg1,(struct blpapi_Service const *)arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg3), SWIGTYPE_p_blpapi_Topic, 0)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_deleteTopics(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; + blpapi_Topic_t **arg2 = (blpapi_Topic_t **) 0 ; + size_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_ProviderSession_deleteTopics",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_deleteTopics" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); + } + arg1 = (blpapi_ProviderSession_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_p_blpapi_Topic, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_deleteTopics" "', argument " "2"" of type '" "blpapi_Topic_t const **""'"); + } + arg2 = (blpapi_Topic_t **)(argp2); + ecode3 = SWIG_AsVal_size_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_deleteTopics" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ProviderSession_deleteTopics(arg1,(struct blpapi_Topic const **)arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_terminateSubscriptionsOnTopics(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; + blpapi_Topic_t **arg2 = (blpapi_Topic_t **) 0 ; + size_t arg3 ; + char *arg4 = (char *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; + int res4 ; + char *buf4 = 0 ; + int alloc4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_ProviderSession_terminateSubscriptionsOnTopics",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_terminateSubscriptionsOnTopics" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); + } + arg1 = (blpapi_ProviderSession_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_p_blpapi_Topic, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_terminateSubscriptionsOnTopics" "', argument " "2"" of type '" "blpapi_Topic_t const **""'"); + } + arg2 = (blpapi_Topic_t **)(argp2); + ecode3 = SWIG_AsVal_size_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_terminateSubscriptionsOnTopics" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); + res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_ProviderSession_terminateSubscriptionsOnTopics" "', argument " "4"" of type '" "char const *""'"); + } + arg4 = (char *)(buf4); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ProviderSession_terminateSubscriptionsOnTopics(arg1,(struct blpapi_Topic const **)arg2,arg3,(char const *)arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); + return resultobj; +fail: + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_publish(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; + blpapi_Event_t *arg2 = (blpapi_Event_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ProviderSession_publish",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_publish" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); + } + arg1 = (blpapi_ProviderSession_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Event, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_publish" "', argument " "2"" of type '" "blpapi_Event_t *""'"); + } + arg2 = (blpapi_Event_t *)(argp2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ProviderSession_publish(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_sendResponse(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; + blpapi_Event_t *arg2 = (blpapi_Event_t *) 0 ; + int arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_ProviderSession_sendResponse",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_sendResponse" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); + } + arg1 = (blpapi_ProviderSession_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Event, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_sendResponse" "', argument " "2"" of type '" "blpapi_Event_t *""'"); + } + arg2 = (blpapi_Event_t *)(argp2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_sendResponse" "', argument " "3"" of type '" "int""'"); + } + arg3 = (int)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ProviderSession_sendResponse(arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_getAbstractSession(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_AbstractSession_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ProviderSession_getAbstractSession",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_getAbstractSession" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); + } + arg1 = (blpapi_ProviderSession_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_AbstractSession_t *)blpapi_ProviderSession_getAbstractSession(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_flushPublishedEvents(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; + int *arg2 = (int *) 0 ; + int arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + int temp2 ; + int res2 = SWIG_TMPOBJ ; + int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ProviderSession_flushPublishedEvents",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_flushPublishedEvents" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); + } + arg1 = (blpapi_ProviderSession_t *)(argp1); + ecode3 = SWIG_AsVal_int(obj1, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_flushPublishedEvents" "', argument " "3"" of type '" "int""'"); + } + arg3 = (int)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ProviderSession_flushPublishedEvents(arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (SWIG_IsTmpObj(res2)) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg2))); + } else { + int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_int, new_flags)); + } + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ServiceRegistrationOptions_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)":blpapi_ServiceRegistrationOptions_create")) SWIG_fail; + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_ServiceRegistrationOptions_t *)blpapi_ServiceRegistrationOptions_create(); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_duplicate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ServiceRegistrationOptions_t *arg1 = (blpapi_ServiceRegistrationOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_ServiceRegistrationOptions_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ServiceRegistrationOptions_duplicate",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_duplicate" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t const *""'"); + } + arg1 = (blpapi_ServiceRegistrationOptions_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_ServiceRegistrationOptions_t *)blpapi_ServiceRegistrationOptions_duplicate((struct blpapi_ServiceRegistrationOptions const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ServiceRegistrationOptions_t *arg1 = (blpapi_ServiceRegistrationOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ServiceRegistrationOptions_destroy",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_destroy" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); + } + arg1 = (blpapi_ServiceRegistrationOptions_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_ServiceRegistrationOptions_destroy(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_copy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ServiceRegistrationOptions_t *arg1 = (blpapi_ServiceRegistrationOptions_t *) 0 ; + blpapi_ServiceRegistrationOptions_t *arg2 = (blpapi_ServiceRegistrationOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ServiceRegistrationOptions_copy",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_copy" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); + } + arg1 = (blpapi_ServiceRegistrationOptions_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ServiceRegistrationOptions_copy" "', argument " "2"" of type '" "blpapi_ServiceRegistrationOptions_t const *""'"); + } + arg2 = (blpapi_ServiceRegistrationOptions_t *)(argp2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_ServiceRegistrationOptions_copy(arg1,(struct blpapi_ServiceRegistrationOptions const *)arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ServiceRegistrationOptions_t *arg1 = (blpapi_ServiceRegistrationOptions_t *) 0 ; + int arg2 ; + int arg3 ; + int arg4 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); + } + arg1 = (blpapi_ServiceRegistrationOptions_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange" "', argument " "3"" of type '" "int""'"); + } + arg3 = (int)(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange" "', argument " "4"" of type '" "int""'"); + } + arg4 = (int)(val4); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange(arg1,arg2,arg3,arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ServiceRegistrationOptions_t *arg1 = (blpapi_ServiceRegistrationOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); + } + arg1 = (blpapi_ServiceRegistrationOptions_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_setGroupId(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ServiceRegistrationOptions_t *arg1 = (blpapi_ServiceRegistrationOptions_t *) 0 ; + char *arg2 = (char *) 0 ; + unsigned int arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ServiceRegistrationOptions_setGroupId",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_setGroupId" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); + } + arg1 = (blpapi_ServiceRegistrationOptions_t *)(argp1); + { + arg2 = PyString_AsString(obj1); + arg3 = PyString_Size(obj1); + } + { + if (!arg2) { + SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + } + } + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_ServiceRegistrationOptions_setGroupId(arg1,(char const *)arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_setServicePriority(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ServiceRegistrationOptions_t *arg1 = (blpapi_ServiceRegistrationOptions_t *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ServiceRegistrationOptions_setServicePriority",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_setServicePriority" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); + } + arg1 = (blpapi_ServiceRegistrationOptions_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_ServiceRegistrationOptions_setServicePriority" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ServiceRegistrationOptions_setServicePriority(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_setPartsToRegister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ServiceRegistrationOptions_t *arg1 = (blpapi_ServiceRegistrationOptions_t *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ServiceRegistrationOptions_setPartsToRegister",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_setPartsToRegister" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); + } + arg1 = (blpapi_ServiceRegistrationOptions_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_ServiceRegistrationOptions_setPartsToRegister" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_ServiceRegistrationOptions_setPartsToRegister(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_getGroupId(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ServiceRegistrationOptions_t *arg1 = (blpapi_ServiceRegistrationOptions_t *) 0 ; + char *arg2 = (char *) 0 ; + int *arg3 = (int *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + char temp2[MAX_GROUP_ID_SIZE] ; + int len2 = MAX_GROUP_ID_SIZE ; + PyObject * obj0 = 0 ; + int result; + + arg2 = temp2; + arg3 = &len2; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ServiceRegistrationOptions_getGroupId",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_getGroupId" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); + } + arg1 = (blpapi_ServiceRegistrationOptions_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ServiceRegistrationOptions_getGroupId(arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtrAndSize(arg2, *arg3)); + } + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_getServicePriority(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ServiceRegistrationOptions_t *arg1 = (blpapi_ServiceRegistrationOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ServiceRegistrationOptions_getServicePriority",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_getServicePriority" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); + } + arg1 = (blpapi_ServiceRegistrationOptions_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ServiceRegistrationOptions_getServicePriority(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_getPartsToRegister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ServiceRegistrationOptions_t *arg1 = (blpapi_ServiceRegistrationOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ServiceRegistrationOptions_getPartsToRegister",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_getPartsToRegister" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); + } + arg1 = (blpapi_ServiceRegistrationOptions_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ServiceRegistrationOptions_getPartsToRegister(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ZfpUtil_getOptionsForLeasedLines(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + blpapi_TlsOptions_t *arg2 = (blpapi_TlsOptions_t *) 0 ; + int arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_ZfpUtil_getOptionsForLeasedLines",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ZfpUtil_getOptionsForLeasedLines" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ZfpUtil_getOptionsForLeasedLines" "', argument " "2"" of type '" "blpapi_TlsOptions_t const *""'"); + } + arg2 = (blpapi_TlsOptions_t *)(argp2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ZfpUtil_getOptionsForLeasedLines" "', argument " "3"" of type '" "int""'"); + } + arg3 = (int)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ZfpUtil_getOptionsForLeasedLines(arg1,(struct blpapi_TlsOptions const *)arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +static PyMethodDef SwigMethods[] = { + { (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL}, + { (char *)"setLoggerCallbackWrapper", _wrap_setLoggerCallbackWrapper, METH_VARARGS, NULL}, + { (char *)"blpapi_HighPrecisionDatetime_fromTimePoint_wrapper", _wrap_blpapi_HighPrecisionDatetime_fromTimePoint_wrapper, METH_VARARGS, NULL}, + { (char *)"blpapi_Logging_registerCallback", _wrap_blpapi_Logging_registerCallback, METH_VARARGS, NULL}, + { (char *)"blpapi_Logging_logTestMessage", _wrap_blpapi_Logging_logTestMessage, METH_VARARGS, NULL}, + { (char *)"blpapi_DiagnosticsUtil_memoryInfo_wrapper", _wrap_blpapi_DiagnosticsUtil_memoryInfo_wrapper, METH_VARARGS, NULL}, + { (char *)"blpapi_EventDispatcher_stop", _wrap_blpapi_EventDispatcher_stop, METH_VARARGS, NULL}, + { (char *)"blpapi_Service_printHelper", _wrap_blpapi_Service_printHelper, METH_VARARGS, NULL}, + { (char *)"blpapi_SchemaElementDefinition_printHelper", _wrap_blpapi_SchemaElementDefinition_printHelper, METH_VARARGS, NULL}, + { (char *)"blpapi_SchemaTypeDefinition_printHelper", _wrap_blpapi_SchemaTypeDefinition_printHelper, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_printHelper", _wrap_blpapi_SessionOptions_printHelper, METH_VARARGS, NULL}, + { (char *)"blpapi_SchemaTypeDefinition_hasElementDefinition", _wrap_blpapi_SchemaTypeDefinition_hasElementDefinition, METH_VARARGS, NULL}, + { (char *)"blpapi_ConstantList_hasConstant", _wrap_blpapi_ConstantList_hasConstant, METH_VARARGS, NULL}, + { (char *)"blpapi_Service_hasEventDefinition", _wrap_blpapi_Service_hasEventDefinition, METH_VARARGS, NULL}, + { (char *)"blpapi_Service_hasOperation", _wrap_blpapi_Service_hasOperation, METH_VARARGS, NULL}, + { (char *)"blpapi_SubscriptionList_addHelper", _wrap_blpapi_SubscriptionList_addHelper, METH_VARARGS, NULL}, + { (char *)"blpapi_Name_hasName", _wrap_blpapi_Name_hasName, METH_VARARGS, NULL}, + { (char *)"blpapi_TopicList_createFromResolutionList", _wrap_blpapi_TopicList_createFromResolutionList, METH_VARARGS, NULL}, + { (char *)"new_intArray", _wrap_new_intArray, METH_VARARGS, NULL}, + { (char *)"delete_intArray", _wrap_delete_intArray, METH_VARARGS, NULL}, + { (char *)"intArray___getitem__", _wrap_intArray___getitem__, METH_VARARGS, NULL}, + { (char *)"intArray___setitem__", _wrap_intArray___setitem__, METH_VARARGS, NULL}, + { (char *)"intArray_cast", _wrap_intArray_cast, METH_VARARGS, NULL}, + { (char *)"intArray_frompointer", _wrap_intArray_frompointer, METH_VARARGS, NULL}, + { (char *)"intArray_swigregister", intArray_swigregister, METH_VARARGS, NULL}, + { (char *)"new_topicPtrArray", _wrap_new_topicPtrArray, METH_VARARGS, NULL}, + { (char *)"delete_topicPtrArray", _wrap_delete_topicPtrArray, METH_VARARGS, NULL}, + { (char *)"topicPtrArray_getitem", _wrap_topicPtrArray_getitem, METH_VARARGS, NULL}, + { (char *)"topicPtrArray_setitem", _wrap_topicPtrArray_setitem, METH_VARARGS, NULL}, + { (char *)"CorrelationId_t_equals", _wrap_CorrelationId_t_equals, METH_VARARGS, NULL}, + { (char *)"CorrelationId_value_get", _wrap_CorrelationId_value_get, METH_VARARGS, NULL}, + { (char *)"new_CorrelationId", _wrap_new_CorrelationId, METH_VARARGS, (char *)"\n" + "A key used to identify individual subscriptions or requests.\n" + "\n" + "CorrelationId([value[, classId=0]]) constructs a CorrelationId object.\n" + "If 'value' is integer (either int or long) then created CorrelationId will have\n" + "type() == CorrelationId.INT_TYPE. Otherwise it will have\n" + "type() == CorrelationId.OBJECT_TYPE. If no arguments are specified\n" + "then it will have type() == CorrelationId.UNSET_TYPE.\n" + "\n" + "Two CorrelationIds are considered equal if they have the same\n" + "type() and:\n" + "\n" + "- holds the same (not just equal!) objects in case of\n" + " type() == CorrelationId.OBJECT_TYPE\n" + "- holds equal integers in case of\n" + " type() == CorrelationId.INT_TYPE or\n" + " type() == CorrelationId.AUTOGEN_TYPE\n" + "- True otherwise\n" + " (i.e. in case of type() == CorrelationId.UNSET_TYPE)\n" + "\n" + "It is possible that an user constructed CorrelationId and a\n" + "CorrelationId generated by the API could return the same\n" + "result for value(). However, they will not compare equal because\n" + "they have different type().\n" + "\n" + "CorrelationId objects are passed to many of the Session object\n" + "methods which initiate an asynchronous operations and are\n" + "obtained from Message objects which are delivered as a result\n" + "of those asynchronous operations.\n" + "\n" + "When subscribing or requesting information an application has\n" + "the choice of providing a CorrelationId they construct\n" + "themselves or allowing the session to construct one for\n" + "them. If the application supplies a CorrelationId it must not\n" + "re-use the value contained in it in another CorrelationId\n" + "whilst the original request or subscription is still active.\n" + "\n" + "Class attributes:\n" + " MAX_CLASS_ID:\n" + " The maximum value allowed for classId.\n" + " Possible return values for type() method:\n" + " UNSET_TYPE:\n" + " The CorrelationId is unset. That is, it was created by\n" + " the default CorrelationId constructor.\n" + " INT_TYPE:\n" + " The CorrelationId was created from an integer (or long)\n" + " supplied by the user.\n" + " OBJECT_TYPE:\n" + " The CorrelationId was created from an object supplied by\n" + " the user.\n" + " AUTOGEN_TYPE:\n" + " The CorrelationId was created internally by API.\n" + ""}, + { (char *)"delete_CorrelationId", _wrap_delete_CorrelationId, METH_VARARGS, NULL}, + { (char *)"CorrelationId_type", _wrap_CorrelationId_type, METH_VARARGS, (char *)"Return the type of this CorrelationId object (see xxx_TYPE class attributes)"}, + { (char *)"CorrelationId_classId", _wrap_CorrelationId_classId, METH_VARARGS, (char *)"Return the user defined classification of this CorrelationId object"}, + { (char *)"CorrelationId___asObject", _wrap_CorrelationId___asObject, METH_VARARGS, NULL}, + { (char *)"CorrelationId___asInteger", _wrap_CorrelationId___asInteger, METH_VARARGS, NULL}, + { (char *)"CorrelationId___toInteger", _wrap_CorrelationId___toInteger, METH_VARARGS, NULL}, + { (char *)"CorrelationId_swigregister", CorrelationId_swigregister, METH_VARARGS, NULL}, + { (char *)"new_blpapi_CorrelationId_t__value", _wrap_new_blpapi_CorrelationId_t__value, METH_VARARGS, NULL}, + { (char *)"delete_blpapi_CorrelationId_t__value", _wrap_delete_blpapi_CorrelationId_t__value, METH_VARARGS, NULL}, + { (char *)"blpapi_CorrelationId_t__value_swigregister", blpapi_CorrelationId_t__value_swigregister, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_setElementFloat", _wrap_blpapi_Element_setElementFloat, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_setValueFloat", _wrap_blpapi_Element_setValueFloat, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_printHelper", _wrap_blpapi_Element_printHelper, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_name", _wrap_blpapi_Element_name, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_nameString", _wrap_blpapi_Element_nameString, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_definition", _wrap_blpapi_Element_definition, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_datatype", _wrap_blpapi_Element_datatype, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_isComplexType", _wrap_blpapi_Element_isComplexType, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_isArray", _wrap_blpapi_Element_isArray, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_isReadOnly", _wrap_blpapi_Element_isReadOnly, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_numValues", _wrap_blpapi_Element_numValues, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_numElements", _wrap_blpapi_Element_numElements, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_isNullValue", _wrap_blpapi_Element_isNullValue, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_isNull", _wrap_blpapi_Element_isNull, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_getElementAt", _wrap_blpapi_Element_getElementAt, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_getElement", _wrap_blpapi_Element_getElement, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_hasElementEx", _wrap_blpapi_Element_hasElementEx, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_getValueAsBool", _wrap_blpapi_Element_getValueAsBool, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_getValueAsChar", _wrap_blpapi_Element_getValueAsChar, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_getValueAsInt32", _wrap_blpapi_Element_getValueAsInt32, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_getValueAsInt64", _wrap_blpapi_Element_getValueAsInt64, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_getValueAsFloat64", _wrap_blpapi_Element_getValueAsFloat64, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_getValueAsString", _wrap_blpapi_Element_getValueAsString, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_getValueAsDatetime", _wrap_blpapi_Element_getValueAsDatetime, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_getValueAsHighPrecisionDatetime", _wrap_blpapi_Element_getValueAsHighPrecisionDatetime, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_getValueAsElement", _wrap_blpapi_Element_getValueAsElement, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_getValueAsName", _wrap_blpapi_Element_getValueAsName, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_getChoice", _wrap_blpapi_Element_getChoice, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_setValueBool", _wrap_blpapi_Element_setValueBool, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_setValueInt32", _wrap_blpapi_Element_setValueInt32, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_setValueInt64", _wrap_blpapi_Element_setValueInt64, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_setValueString", _wrap_blpapi_Element_setValueString, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_setValueDatetime", _wrap_blpapi_Element_setValueDatetime, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_setValueFromName", _wrap_blpapi_Element_setValueFromName, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_setElementBool", _wrap_blpapi_Element_setElementBool, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_setElementInt32", _wrap_blpapi_Element_setElementInt32, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_setElementInt64", _wrap_blpapi_Element_setElementInt64, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_setElementString", _wrap_blpapi_Element_setElementString, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_setElementDatetime", _wrap_blpapi_Element_setElementDatetime, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_setElementFromName", _wrap_blpapi_Element_setElementFromName, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_appendElement", _wrap_blpapi_Element_appendElement, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_setChoice", _wrap_blpapi_Element_setChoice, METH_VARARGS, NULL}, + { (char *)"blpapi_EventFormatter_setValueFloat", _wrap_blpapi_EventFormatter_setValueFloat, METH_VARARGS, NULL}, + { (char *)"blpapi_EventFormatter_appendValueFloat", _wrap_blpapi_EventFormatter_appendValueFloat, METH_VARARGS, NULL}, + { (char *)"blpapi_EventFormatter_create", _wrap_blpapi_EventFormatter_create, METH_VARARGS, NULL}, + { (char *)"blpapi_EventFormatter_destroy", _wrap_blpapi_EventFormatter_destroy, METH_VARARGS, NULL}, + { (char *)"blpapi_EventFormatter_appendMessage", _wrap_blpapi_EventFormatter_appendMessage, METH_VARARGS, NULL}, + { (char *)"blpapi_EventFormatter_appendMessageSeq", _wrap_blpapi_EventFormatter_appendMessageSeq, METH_VARARGS, NULL}, + { (char *)"blpapi_EventFormatter_appendResponse", _wrap_blpapi_EventFormatter_appendResponse, METH_VARARGS, NULL}, + { (char *)"blpapi_EventFormatter_appendRecapMessage", _wrap_blpapi_EventFormatter_appendRecapMessage, METH_VARARGS, NULL}, + { (char *)"blpapi_EventFormatter_appendRecapMessageSeq", _wrap_blpapi_EventFormatter_appendRecapMessageSeq, METH_VARARGS, NULL}, + { (char *)"blpapi_EventFormatter_appendFragmentedRecapMessage", _wrap_blpapi_EventFormatter_appendFragmentedRecapMessage, METH_VARARGS, NULL}, + { (char *)"blpapi_EventFormatter_appendFragmentedRecapMessageSeq", _wrap_blpapi_EventFormatter_appendFragmentedRecapMessageSeq, METH_VARARGS, NULL}, + { (char *)"blpapi_EventFormatter_setValueBool", _wrap_blpapi_EventFormatter_setValueBool, METH_VARARGS, NULL}, + { (char *)"blpapi_EventFormatter_setValueChar", _wrap_blpapi_EventFormatter_setValueChar, METH_VARARGS, NULL}, + { (char *)"blpapi_EventFormatter_setValueInt32", _wrap_blpapi_EventFormatter_setValueInt32, METH_VARARGS, NULL}, + { (char *)"blpapi_EventFormatter_setValueInt64", _wrap_blpapi_EventFormatter_setValueInt64, METH_VARARGS, NULL}, + { (char *)"blpapi_EventFormatter_setValueDatetime", _wrap_blpapi_EventFormatter_setValueDatetime, METH_VARARGS, NULL}, + { (char *)"blpapi_EventFormatter_setValueString", _wrap_blpapi_EventFormatter_setValueString, METH_VARARGS, NULL}, + { (char *)"blpapi_EventFormatter_setValueFromName", _wrap_blpapi_EventFormatter_setValueFromName, METH_VARARGS, NULL}, + { (char *)"blpapi_EventFormatter_setValueNull", _wrap_blpapi_EventFormatter_setValueNull, METH_VARARGS, NULL}, + { (char *)"blpapi_EventFormatter_pushElement", _wrap_blpapi_EventFormatter_pushElement, METH_VARARGS, NULL}, + { (char *)"blpapi_EventFormatter_popElement", _wrap_blpapi_EventFormatter_popElement, METH_VARARGS, NULL}, + { (char *)"blpapi_EventFormatter_appendValueBool", _wrap_blpapi_EventFormatter_appendValueBool, METH_VARARGS, NULL}, + { (char *)"blpapi_EventFormatter_appendValueChar", _wrap_blpapi_EventFormatter_appendValueChar, METH_VARARGS, NULL}, + { (char *)"blpapi_EventFormatter_appendValueInt32", _wrap_blpapi_EventFormatter_appendValueInt32, METH_VARARGS, NULL}, + { (char *)"blpapi_EventFormatter_appendValueInt64", _wrap_blpapi_EventFormatter_appendValueInt64, METH_VARARGS, NULL}, + { (char *)"blpapi_EventFormatter_appendValueDatetime", _wrap_blpapi_EventFormatter_appendValueDatetime, METH_VARARGS, NULL}, + { (char *)"blpapi_EventFormatter_appendValueString", _wrap_blpapi_EventFormatter_appendValueString, METH_VARARGS, NULL}, + { (char *)"blpapi_EventFormatter_appendValueFromName", _wrap_blpapi_EventFormatter_appendValueFromName, METH_VARARGS, NULL}, + { (char *)"blpapi_EventFormatter_appendElement", _wrap_blpapi_EventFormatter_appendElement, METH_VARARGS, NULL}, + { (char *)"Session_createHelper", _wrap_Session_createHelper, METH_VARARGS, NULL}, + { (char *)"Session_destroyHelper", _wrap_Session_destroyHelper, METH_VARARGS, NULL}, + { (char *)"blpapi_EventDispatcher_create", _wrap_blpapi_EventDispatcher_create, METH_VARARGS, NULL}, + { (char *)"blpapi_EventDispatcher_destroy", _wrap_blpapi_EventDispatcher_destroy, METH_VARARGS, NULL}, + { (char *)"blpapi_EventDispatcher_start", _wrap_blpapi_EventDispatcher_start, METH_VARARGS, NULL}, + { (char *)"ProviderSession_createHelper", _wrap_ProviderSession_createHelper, METH_VARARGS, NULL}, + { (char *)"ProviderSession_destroyHelper", _wrap_ProviderSession_destroyHelper, METH_VARARGS, NULL}, + { (char *)"ProviderSession_terminateSubscriptionsOnTopic", _wrap_ProviderSession_terminateSubscriptionsOnTopic, METH_VARARGS, NULL}, + { (char *)"blpapi_getLastErrorDescription", _wrap_blpapi_getLastErrorDescription, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_create", _wrap_blpapi_SessionOptions_create, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_destroy", _wrap_blpapi_SessionOptions_destroy, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_setServerHost", _wrap_blpapi_SessionOptions_setServerHost, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_setServerPort", _wrap_blpapi_SessionOptions_setServerPort, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_setServerAddress", _wrap_blpapi_SessionOptions_setServerAddress, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_removeServerAddress", _wrap_blpapi_SessionOptions_removeServerAddress, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_setConnectTimeout", _wrap_blpapi_SessionOptions_setConnectTimeout, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_setDefaultServices", _wrap_blpapi_SessionOptions_setDefaultServices, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_setDefaultSubscriptionService", _wrap_blpapi_SessionOptions_setDefaultSubscriptionService, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_setDefaultTopicPrefix", _wrap_blpapi_SessionOptions_setDefaultTopicPrefix, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg", _wrap_blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_setClientMode", _wrap_blpapi_SessionOptions_setClientMode, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_setMaxPendingRequests", _wrap_blpapi_SessionOptions_setMaxPendingRequests, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_setAutoRestartOnDisconnection", _wrap_blpapi_SessionOptions_setAutoRestartOnDisconnection, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_setAuthenticationOptions", _wrap_blpapi_SessionOptions_setAuthenticationOptions, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_setNumStartAttempts", _wrap_blpapi_SessionOptions_setNumStartAttempts, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_setMaxEventQueueSize", _wrap_blpapi_SessionOptions_setMaxEventQueueSize, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark", _wrap_blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark", _wrap_blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_setDefaultKeepAliveInactivityTime", _wrap_blpapi_SessionOptions_setDefaultKeepAliveInactivityTime, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout", _wrap_blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_setKeepAliveEnabled", _wrap_blpapi_SessionOptions_setKeepAliveEnabled, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes", _wrap_blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_setServiceCheckTimeout", _wrap_blpapi_SessionOptions_setServiceCheckTimeout, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_setServiceDownloadTimeout", _wrap_blpapi_SessionOptions_setServiceDownloadTimeout, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_setTlsOptions", _wrap_blpapi_SessionOptions_setTlsOptions, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_setFlushPublishedEventsTimeout", _wrap_blpapi_SessionOptions_setFlushPublishedEventsTimeout, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_serverHost", _wrap_blpapi_SessionOptions_serverHost, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_serverPort", _wrap_blpapi_SessionOptions_serverPort, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_numServerAddresses", _wrap_blpapi_SessionOptions_numServerAddresses, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_getServerAddress", _wrap_blpapi_SessionOptions_getServerAddress, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_connectTimeout", _wrap_blpapi_SessionOptions_connectTimeout, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_defaultServices", _wrap_blpapi_SessionOptions_defaultServices, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_defaultSubscriptionService", _wrap_blpapi_SessionOptions_defaultSubscriptionService, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_defaultTopicPrefix", _wrap_blpapi_SessionOptions_defaultTopicPrefix, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg", _wrap_blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_clientMode", _wrap_blpapi_SessionOptions_clientMode, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_maxPendingRequests", _wrap_blpapi_SessionOptions_maxPendingRequests, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_autoRestartOnDisconnection", _wrap_blpapi_SessionOptions_autoRestartOnDisconnection, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_authenticationOptions", _wrap_blpapi_SessionOptions_authenticationOptions, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_numStartAttempts", _wrap_blpapi_SessionOptions_numStartAttempts, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_maxEventQueueSize", _wrap_blpapi_SessionOptions_maxEventQueueSize, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_slowConsumerWarningHiWaterMark", _wrap_blpapi_SessionOptions_slowConsumerWarningHiWaterMark, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_slowConsumerWarningLoWaterMark", _wrap_blpapi_SessionOptions_slowConsumerWarningLoWaterMark, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_defaultKeepAliveInactivityTime", _wrap_blpapi_SessionOptions_defaultKeepAliveInactivityTime, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_defaultKeepAliveResponseTimeout", _wrap_blpapi_SessionOptions_defaultKeepAliveResponseTimeout, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_keepAliveEnabled", _wrap_blpapi_SessionOptions_keepAliveEnabled, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_recordSubscriptionDataReceiveTimes", _wrap_blpapi_SessionOptions_recordSubscriptionDataReceiveTimes, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_serviceCheckTimeout", _wrap_blpapi_SessionOptions_serviceCheckTimeout, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_serviceDownloadTimeout", _wrap_blpapi_SessionOptions_serviceDownloadTimeout, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_flushPublishedEventsTimeout", _wrap_blpapi_SessionOptions_flushPublishedEventsTimeout, METH_VARARGS, NULL}, + { (char *)"blpapi_TlsOptions_destroy", _wrap_blpapi_TlsOptions_destroy, METH_VARARGS, NULL}, + { (char *)"blpapi_TlsOptions_createFromFiles", _wrap_blpapi_TlsOptions_createFromFiles, METH_VARARGS, NULL}, + { (char *)"blpapi_TlsOptions_createFromBlobs", _wrap_blpapi_TlsOptions_createFromBlobs, METH_VARARGS, NULL}, + { (char *)"blpapi_TlsOptions_setTlsHandshakeTimeoutMs", _wrap_blpapi_TlsOptions_setTlsHandshakeTimeoutMs, METH_VARARGS, NULL}, + { (char *)"blpapi_TlsOptions_setCrlFetchTimeoutMs", _wrap_blpapi_TlsOptions_setCrlFetchTimeoutMs, METH_VARARGS, NULL}, + { (char *)"blpapi_Name_create", _wrap_blpapi_Name_create, METH_VARARGS, NULL}, + { (char *)"blpapi_Name_destroy", _wrap_blpapi_Name_destroy, METH_VARARGS, NULL}, + { (char *)"blpapi_Name_equalsStr", _wrap_blpapi_Name_equalsStr, METH_VARARGS, NULL}, + { (char *)"blpapi_Name_string", _wrap_blpapi_Name_string, METH_VARARGS, NULL}, + { (char *)"blpapi_Name_length", _wrap_blpapi_Name_length, METH_VARARGS, NULL}, + { (char *)"blpapi_Name_findName", _wrap_blpapi_Name_findName, METH_VARARGS, NULL}, + { (char *)"blpapi_SubscriptionList_create", _wrap_blpapi_SubscriptionList_create, METH_VARARGS, NULL}, + { (char *)"blpapi_SubscriptionList_destroy", _wrap_blpapi_SubscriptionList_destroy, METH_VARARGS, NULL}, + { (char *)"blpapi_SubscriptionList_addResolved", _wrap_blpapi_SubscriptionList_addResolved, METH_VARARGS, NULL}, + { (char *)"blpapi_SubscriptionList_clear", _wrap_blpapi_SubscriptionList_clear, METH_VARARGS, NULL}, + { (char *)"blpapi_SubscriptionList_append", _wrap_blpapi_SubscriptionList_append, METH_VARARGS, NULL}, + { (char *)"blpapi_SubscriptionList_size", _wrap_blpapi_SubscriptionList_size, METH_VARARGS, NULL}, + { (char *)"blpapi_SubscriptionList_correlationIdAt", _wrap_blpapi_SubscriptionList_correlationIdAt, METH_VARARGS, NULL}, + { (char *)"blpapi_SubscriptionList_topicStringAt", _wrap_blpapi_SubscriptionList_topicStringAt, METH_VARARGS, NULL}, + { (char *)"blpapi_SubscriptionList_isResolvedAt", _wrap_blpapi_SubscriptionList_isResolvedAt, METH_VARARGS, NULL}, + { (char *)"blpapi_TimePoint_d_value_set", _wrap_blpapi_TimePoint_d_value_set, METH_VARARGS, NULL}, + { (char *)"blpapi_TimePoint_d_value_get", _wrap_blpapi_TimePoint_d_value_get, METH_VARARGS, NULL}, + { (char *)"new_blpapi_TimePoint", _wrap_new_blpapi_TimePoint, METH_VARARGS, NULL}, + { (char *)"delete_blpapi_TimePoint", _wrap_delete_blpapi_TimePoint, METH_VARARGS, NULL}, + { (char *)"blpapi_TimePoint_swigregister", blpapi_TimePoint_swigregister, METH_VARARGS, NULL}, + { (char *)"blpapi_TimePointUtil_nanosecondsBetween", _wrap_blpapi_TimePointUtil_nanosecondsBetween, METH_VARARGS, NULL}, + { (char *)"blpapi_Datetime_tag_parts_set", _wrap_blpapi_Datetime_tag_parts_set, METH_VARARGS, NULL}, + { (char *)"blpapi_Datetime_tag_parts_get", _wrap_blpapi_Datetime_tag_parts_get, METH_VARARGS, NULL}, + { (char *)"blpapi_Datetime_tag_hours_set", _wrap_blpapi_Datetime_tag_hours_set, METH_VARARGS, NULL}, + { (char *)"blpapi_Datetime_tag_hours_get", _wrap_blpapi_Datetime_tag_hours_get, METH_VARARGS, NULL}, + { (char *)"blpapi_Datetime_tag_minutes_set", _wrap_blpapi_Datetime_tag_minutes_set, METH_VARARGS, NULL}, + { (char *)"blpapi_Datetime_tag_minutes_get", _wrap_blpapi_Datetime_tag_minutes_get, METH_VARARGS, NULL}, + { (char *)"blpapi_Datetime_tag_seconds_set", _wrap_blpapi_Datetime_tag_seconds_set, METH_VARARGS, NULL}, + { (char *)"blpapi_Datetime_tag_seconds_get", _wrap_blpapi_Datetime_tag_seconds_get, METH_VARARGS, NULL}, + { (char *)"blpapi_Datetime_tag_milliSeconds_set", _wrap_blpapi_Datetime_tag_milliSeconds_set, METH_VARARGS, NULL}, + { (char *)"blpapi_Datetime_tag_milliSeconds_get", _wrap_blpapi_Datetime_tag_milliSeconds_get, METH_VARARGS, NULL}, + { (char *)"blpapi_Datetime_tag_month_set", _wrap_blpapi_Datetime_tag_month_set, METH_VARARGS, NULL}, + { (char *)"blpapi_Datetime_tag_month_get", _wrap_blpapi_Datetime_tag_month_get, METH_VARARGS, NULL}, + { (char *)"blpapi_Datetime_tag_day_set", _wrap_blpapi_Datetime_tag_day_set, METH_VARARGS, NULL}, + { (char *)"blpapi_Datetime_tag_day_get", _wrap_blpapi_Datetime_tag_day_get, METH_VARARGS, NULL}, + { (char *)"blpapi_Datetime_tag_year_set", _wrap_blpapi_Datetime_tag_year_set, METH_VARARGS, NULL}, + { (char *)"blpapi_Datetime_tag_year_get", _wrap_blpapi_Datetime_tag_year_get, METH_VARARGS, NULL}, + { (char *)"blpapi_Datetime_tag_offset_set", _wrap_blpapi_Datetime_tag_offset_set, METH_VARARGS, NULL}, + { (char *)"blpapi_Datetime_tag_offset_get", _wrap_blpapi_Datetime_tag_offset_get, METH_VARARGS, NULL}, + { (char *)"new_blpapi_Datetime_tag", _wrap_new_blpapi_Datetime_tag, METH_VARARGS, NULL}, + { (char *)"delete_blpapi_Datetime_tag", _wrap_delete_blpapi_Datetime_tag, METH_VARARGS, NULL}, + { (char *)"blpapi_Datetime_tag_swigregister", blpapi_Datetime_tag_swigregister, METH_VARARGS, NULL}, + { (char *)"blpapi_HighPrecisionDatetime_tag_datetime_set", _wrap_blpapi_HighPrecisionDatetime_tag_datetime_set, METH_VARARGS, NULL}, + { (char *)"blpapi_HighPrecisionDatetime_tag_datetime_get", _wrap_blpapi_HighPrecisionDatetime_tag_datetime_get, METH_VARARGS, NULL}, + { (char *)"blpapi_HighPrecisionDatetime_tag_picoseconds_set", _wrap_blpapi_HighPrecisionDatetime_tag_picoseconds_set, METH_VARARGS, NULL}, + { (char *)"blpapi_HighPrecisionDatetime_tag_picoseconds_get", _wrap_blpapi_HighPrecisionDatetime_tag_picoseconds_get, METH_VARARGS, NULL}, + { (char *)"new_blpapi_HighPrecisionDatetime_tag", _wrap_new_blpapi_HighPrecisionDatetime_tag, METH_VARARGS, NULL}, + { (char *)"delete_blpapi_HighPrecisionDatetime_tag", _wrap_delete_blpapi_HighPrecisionDatetime_tag, METH_VARARGS, NULL}, + { (char *)"blpapi_HighPrecisionDatetime_tag_swigregister", blpapi_HighPrecisionDatetime_tag_swigregister, METH_VARARGS, NULL}, + { (char *)"blpapi_HighPrecisionDatetime_compare", _wrap_blpapi_HighPrecisionDatetime_compare, METH_VARARGS, NULL}, + { (char *)"blpapi_HighPrecisionDatetime_print", _wrap_blpapi_HighPrecisionDatetime_print, METH_VARARGS, NULL}, + { (char *)"blpapi_HighPrecisionDatetime_fromTimePoint", _wrap_blpapi_HighPrecisionDatetime_fromTimePoint, METH_VARARGS, NULL}, + { (char *)"blpapi_Constant_name", _wrap_blpapi_Constant_name, METH_VARARGS, NULL}, + { (char *)"blpapi_Constant_description", _wrap_blpapi_Constant_description, METH_VARARGS, NULL}, + { (char *)"blpapi_Constant_status", _wrap_blpapi_Constant_status, METH_VARARGS, NULL}, + { (char *)"blpapi_Constant_datatype", _wrap_blpapi_Constant_datatype, METH_VARARGS, NULL}, + { (char *)"blpapi_Constant_getValueAsInt64", _wrap_blpapi_Constant_getValueAsInt64, METH_VARARGS, NULL}, + { (char *)"blpapi_Constant_getValueAsFloat64", _wrap_blpapi_Constant_getValueAsFloat64, METH_VARARGS, NULL}, + { (char *)"blpapi_Constant_getValueAsDatetime", _wrap_blpapi_Constant_getValueAsDatetime, METH_VARARGS, NULL}, + { (char *)"blpapi_Constant_getValueAsString", _wrap_blpapi_Constant_getValueAsString, METH_VARARGS, NULL}, + { (char *)"blpapi_ConstantList_name", _wrap_blpapi_ConstantList_name, METH_VARARGS, NULL}, + { (char *)"blpapi_ConstantList_description", _wrap_blpapi_ConstantList_description, METH_VARARGS, NULL}, + { (char *)"blpapi_ConstantList_numConstants", _wrap_blpapi_ConstantList_numConstants, METH_VARARGS, NULL}, + { (char *)"blpapi_ConstantList_datatype", _wrap_blpapi_ConstantList_datatype, METH_VARARGS, NULL}, + { (char *)"blpapi_ConstantList_status", _wrap_blpapi_ConstantList_status, METH_VARARGS, NULL}, + { (char *)"blpapi_ConstantList_getConstant", _wrap_blpapi_ConstantList_getConstant, METH_VARARGS, NULL}, + { (char *)"blpapi_ConstantList_getConstantAt", _wrap_blpapi_ConstantList_getConstantAt, METH_VARARGS, NULL}, + { (char *)"blpapi_SchemaElementDefinition_name", _wrap_blpapi_SchemaElementDefinition_name, METH_VARARGS, NULL}, + { (char *)"blpapi_SchemaElementDefinition_description", _wrap_blpapi_SchemaElementDefinition_description, METH_VARARGS, NULL}, + { (char *)"blpapi_SchemaElementDefinition_status", _wrap_blpapi_SchemaElementDefinition_status, METH_VARARGS, NULL}, + { (char *)"blpapi_SchemaElementDefinition_type", _wrap_blpapi_SchemaElementDefinition_type, METH_VARARGS, NULL}, + { (char *)"blpapi_SchemaElementDefinition_numAlternateNames", _wrap_blpapi_SchemaElementDefinition_numAlternateNames, METH_VARARGS, NULL}, + { (char *)"blpapi_SchemaElementDefinition_getAlternateName", _wrap_blpapi_SchemaElementDefinition_getAlternateName, METH_VARARGS, NULL}, + { (char *)"blpapi_SchemaElementDefinition_minValues", _wrap_blpapi_SchemaElementDefinition_minValues, METH_VARARGS, NULL}, + { (char *)"blpapi_SchemaElementDefinition_maxValues", _wrap_blpapi_SchemaElementDefinition_maxValues, METH_VARARGS, NULL}, + { (char *)"blpapi_SchemaTypeDefinition_name", _wrap_blpapi_SchemaTypeDefinition_name, METH_VARARGS, NULL}, + { (char *)"blpapi_SchemaTypeDefinition_description", _wrap_blpapi_SchemaTypeDefinition_description, METH_VARARGS, NULL}, + { (char *)"blpapi_SchemaTypeDefinition_status", _wrap_blpapi_SchemaTypeDefinition_status, METH_VARARGS, NULL}, + { (char *)"blpapi_SchemaTypeDefinition_datatype", _wrap_blpapi_SchemaTypeDefinition_datatype, METH_VARARGS, NULL}, + { (char *)"blpapi_SchemaTypeDefinition_isComplexType", _wrap_blpapi_SchemaTypeDefinition_isComplexType, METH_VARARGS, NULL}, + { (char *)"blpapi_SchemaTypeDefinition_isSimpleType", _wrap_blpapi_SchemaTypeDefinition_isSimpleType, METH_VARARGS, NULL}, + { (char *)"blpapi_SchemaTypeDefinition_isEnumerationType", _wrap_blpapi_SchemaTypeDefinition_isEnumerationType, METH_VARARGS, NULL}, + { (char *)"blpapi_SchemaTypeDefinition_numElementDefinitions", _wrap_blpapi_SchemaTypeDefinition_numElementDefinitions, METH_VARARGS, NULL}, + { (char *)"blpapi_SchemaTypeDefinition_getElementDefinition", _wrap_blpapi_SchemaTypeDefinition_getElementDefinition, METH_VARARGS, NULL}, + { (char *)"blpapi_SchemaTypeDefinition_getElementDefinitionAt", _wrap_blpapi_SchemaTypeDefinition_getElementDefinitionAt, METH_VARARGS, NULL}, + { (char *)"blpapi_SchemaTypeDefinition_enumeration", _wrap_blpapi_SchemaTypeDefinition_enumeration, METH_VARARGS, NULL}, + { (char *)"blpapi_Request_destroy", _wrap_blpapi_Request_destroy, METH_VARARGS, NULL}, + { (char *)"blpapi_Request_elements", _wrap_blpapi_Request_elements, METH_VARARGS, NULL}, + { (char *)"blpapi_Request_setPreferredRoute", _wrap_blpapi_Request_setPreferredRoute, METH_VARARGS, NULL}, + { (char *)"blpapi_RequestTemplate_release", _wrap_blpapi_RequestTemplate_release, METH_VARARGS, NULL}, + { (char *)"blpapi_Operation_name", _wrap_blpapi_Operation_name, METH_VARARGS, NULL}, + { (char *)"blpapi_Operation_description", _wrap_blpapi_Operation_description, METH_VARARGS, NULL}, + { (char *)"blpapi_Operation_requestDefinition", _wrap_blpapi_Operation_requestDefinition, METH_VARARGS, NULL}, + { (char *)"blpapi_Operation_numResponseDefinitions", _wrap_blpapi_Operation_numResponseDefinitions, METH_VARARGS, NULL}, + { (char *)"blpapi_Operation_responseDefinition", _wrap_blpapi_Operation_responseDefinition, METH_VARARGS, NULL}, + { (char *)"blpapi_Service_name", _wrap_blpapi_Service_name, METH_VARARGS, NULL}, + { (char *)"blpapi_Service_description", _wrap_blpapi_Service_description, METH_VARARGS, NULL}, + { (char *)"blpapi_Service_numOperations", _wrap_blpapi_Service_numOperations, METH_VARARGS, NULL}, + { (char *)"blpapi_Service_numEventDefinitions", _wrap_blpapi_Service_numEventDefinitions, METH_VARARGS, NULL}, + { (char *)"blpapi_Service_addRef", _wrap_blpapi_Service_addRef, METH_VARARGS, NULL}, + { (char *)"blpapi_Service_release", _wrap_blpapi_Service_release, METH_VARARGS, NULL}, + { (char *)"blpapi_Service_authorizationServiceName", _wrap_blpapi_Service_authorizationServiceName, METH_VARARGS, NULL}, + { (char *)"blpapi_Service_getOperation", _wrap_blpapi_Service_getOperation, METH_VARARGS, NULL}, + { (char *)"blpapi_Service_getOperationAt", _wrap_blpapi_Service_getOperationAt, METH_VARARGS, NULL}, + { (char *)"blpapi_Service_getEventDefinition", _wrap_blpapi_Service_getEventDefinition, METH_VARARGS, NULL}, + { (char *)"blpapi_Service_getEventDefinitionAt", _wrap_blpapi_Service_getEventDefinitionAt, METH_VARARGS, NULL}, + { (char *)"blpapi_Service_createRequest", _wrap_blpapi_Service_createRequest, METH_VARARGS, NULL}, + { (char *)"blpapi_Service_createAuthorizationRequest", _wrap_blpapi_Service_createAuthorizationRequest, METH_VARARGS, NULL}, + { (char *)"blpapi_Service_createPublishEvent", _wrap_blpapi_Service_createPublishEvent, METH_VARARGS, NULL}, + { (char *)"blpapi_Service_createAdminEvent", _wrap_blpapi_Service_createAdminEvent, METH_VARARGS, NULL}, + { (char *)"blpapi_Service_createResponseEvent", _wrap_blpapi_Service_createResponseEvent, METH_VARARGS, NULL}, + { (char *)"blpapi_Message_messageType", _wrap_blpapi_Message_messageType, METH_VARARGS, NULL}, + { (char *)"blpapi_Message_topicName", _wrap_blpapi_Message_topicName, METH_VARARGS, NULL}, + { (char *)"blpapi_Message_service", _wrap_blpapi_Message_service, METH_VARARGS, NULL}, + { (char *)"blpapi_Message_numCorrelationIds", _wrap_blpapi_Message_numCorrelationIds, METH_VARARGS, NULL}, + { (char *)"blpapi_Message_correlationId", _wrap_blpapi_Message_correlationId, METH_VARARGS, NULL}, + { (char *)"blpapi_Message_elements", _wrap_blpapi_Message_elements, METH_VARARGS, NULL}, + { (char *)"blpapi_Message_fragmentType", _wrap_blpapi_Message_fragmentType, METH_VARARGS, NULL}, + { (char *)"blpapi_Message_recapType", _wrap_blpapi_Message_recapType, METH_VARARGS, NULL}, + { (char *)"blpapi_Message_print", _wrap_blpapi_Message_print, METH_VARARGS, NULL}, + { (char *)"blpapi_Message_addRef", _wrap_blpapi_Message_addRef, METH_VARARGS, NULL}, + { (char *)"blpapi_Message_release", _wrap_blpapi_Message_release, METH_VARARGS, NULL}, + { (char *)"blpapi_Message_timeReceived", _wrap_blpapi_Message_timeReceived, METH_VARARGS, NULL}, + { (char *)"blpapi_Event_eventType", _wrap_blpapi_Event_eventType, METH_VARARGS, NULL}, + { (char *)"blpapi_Event_release", _wrap_blpapi_Event_release, METH_VARARGS, NULL}, + { (char *)"blpapi_EventQueue_create", _wrap_blpapi_EventQueue_create, METH_VARARGS, NULL}, + { (char *)"blpapi_EventQueue_destroy", _wrap_blpapi_EventQueue_destroy, METH_VARARGS, NULL}, + { (char *)"blpapi_EventQueue_nextEvent", _wrap_blpapi_EventQueue_nextEvent, METH_VARARGS, NULL}, + { (char *)"blpapi_EventQueue_purge", _wrap_blpapi_EventQueue_purge, METH_VARARGS, NULL}, + { (char *)"blpapi_EventQueue_tryNextEvent", _wrap_blpapi_EventQueue_tryNextEvent, METH_VARARGS, NULL}, + { (char *)"blpapi_MessageIterator_create", _wrap_blpapi_MessageIterator_create, METH_VARARGS, NULL}, + { (char *)"blpapi_MessageIterator_destroy", _wrap_blpapi_MessageIterator_destroy, METH_VARARGS, NULL}, + { (char *)"blpapi_MessageIterator_next", _wrap_blpapi_MessageIterator_next, METH_VARARGS, NULL}, + { (char *)"blpapi_Identity_release", _wrap_blpapi_Identity_release, METH_VARARGS, NULL}, + { (char *)"blpapi_Identity_addRef", _wrap_blpapi_Identity_addRef, METH_VARARGS, NULL}, + { (char *)"blpapi_Identity_hasEntitlements", _wrap_blpapi_Identity_hasEntitlements, METH_VARARGS, NULL}, + { (char *)"blpapi_Identity_isAuthorized", _wrap_blpapi_Identity_isAuthorized, METH_VARARGS, NULL}, + { (char *)"blpapi_Identity_getSeatType", _wrap_blpapi_Identity_getSeatType, METH_VARARGS, NULL}, + { (char *)"blpapi_HighResolutionClock_now", _wrap_blpapi_HighResolutionClock_now, METH_VARARGS, NULL}, + { (char *)"blpapi_AbstractSession_cancel", _wrap_blpapi_AbstractSession_cancel, METH_VARARGS, NULL}, + { (char *)"blpapi_AbstractSession_sendAuthorizationRequest", _wrap_blpapi_AbstractSession_sendAuthorizationRequest, METH_VARARGS, NULL}, + { (char *)"blpapi_AbstractSession_openService", _wrap_blpapi_AbstractSession_openService, METH_VARARGS, NULL}, + { (char *)"blpapi_AbstractSession_openServiceAsync", _wrap_blpapi_AbstractSession_openServiceAsync, METH_VARARGS, NULL}, + { (char *)"blpapi_AbstractSession_generateToken", _wrap_blpapi_AbstractSession_generateToken, METH_VARARGS, NULL}, + { (char *)"blpapi_AbstractSession_generateManualToken", _wrap_blpapi_AbstractSession_generateManualToken, METH_VARARGS, NULL}, + { (char *)"blpapi_AbstractSession_getService", _wrap_blpapi_AbstractSession_getService, METH_VARARGS, NULL}, + { (char *)"blpapi_AbstractSession_createIdentity", _wrap_blpapi_AbstractSession_createIdentity, METH_VARARGS, NULL}, + { (char *)"blpapi_Session_start", _wrap_blpapi_Session_start, METH_VARARGS, NULL}, + { (char *)"blpapi_Session_startAsync", _wrap_blpapi_Session_startAsync, METH_VARARGS, NULL}, + { (char *)"blpapi_Session_stop", _wrap_blpapi_Session_stop, METH_VARARGS, NULL}, + { (char *)"blpapi_Session_stopAsync", _wrap_blpapi_Session_stopAsync, METH_VARARGS, NULL}, + { (char *)"blpapi_Session_nextEvent", _wrap_blpapi_Session_nextEvent, METH_VARARGS, NULL}, + { (char *)"blpapi_Session_tryNextEvent", _wrap_blpapi_Session_tryNextEvent, METH_VARARGS, NULL}, + { (char *)"blpapi_Session_subscribe", _wrap_blpapi_Session_subscribe, METH_VARARGS, NULL}, + { (char *)"blpapi_Session_resubscribe", _wrap_blpapi_Session_resubscribe, METH_VARARGS, NULL}, + { (char *)"blpapi_Session_resubscribeWithId", _wrap_blpapi_Session_resubscribeWithId, METH_VARARGS, NULL}, + { (char *)"blpapi_Session_unsubscribe", _wrap_blpapi_Session_unsubscribe, METH_VARARGS, NULL}, + { (char *)"blpapi_Session_setStatusCorrelationId", _wrap_blpapi_Session_setStatusCorrelationId, METH_VARARGS, NULL}, + { (char *)"blpapi_Session_sendRequest", _wrap_blpapi_Session_sendRequest, METH_VARARGS, NULL}, + { (char *)"blpapi_Session_sendRequestTemplate", _wrap_blpapi_Session_sendRequestTemplate, METH_VARARGS, NULL}, + { (char *)"blpapi_Session_createSnapshotRequestTemplate", _wrap_blpapi_Session_createSnapshotRequestTemplate, METH_VARARGS, NULL}, + { (char *)"blpapi_Session_getAbstractSession", _wrap_blpapi_Session_getAbstractSession, METH_VARARGS, NULL}, + { (char *)"blpapi_ResolutionList_extractAttributeFromResolutionSuccess", _wrap_blpapi_ResolutionList_extractAttributeFromResolutionSuccess, METH_VARARGS, NULL}, + { (char *)"blpapi_ResolutionList_create", _wrap_blpapi_ResolutionList_create, METH_VARARGS, NULL}, + { (char *)"blpapi_ResolutionList_destroy", _wrap_blpapi_ResolutionList_destroy, METH_VARARGS, NULL}, + { (char *)"blpapi_ResolutionList_add", _wrap_blpapi_ResolutionList_add, METH_VARARGS, NULL}, + { (char *)"blpapi_ResolutionList_addFromMessage", _wrap_blpapi_ResolutionList_addFromMessage, METH_VARARGS, NULL}, + { (char *)"blpapi_ResolutionList_addAttribute", _wrap_blpapi_ResolutionList_addAttribute, METH_VARARGS, NULL}, + { (char *)"blpapi_ResolutionList_correlationIdAt", _wrap_blpapi_ResolutionList_correlationIdAt, METH_VARARGS, NULL}, + { (char *)"blpapi_ResolutionList_topicString", _wrap_blpapi_ResolutionList_topicString, METH_VARARGS, NULL}, + { (char *)"blpapi_ResolutionList_topicStringAt", _wrap_blpapi_ResolutionList_topicStringAt, METH_VARARGS, NULL}, + { (char *)"blpapi_ResolutionList_status", _wrap_blpapi_ResolutionList_status, METH_VARARGS, NULL}, + { (char *)"blpapi_ResolutionList_statusAt", _wrap_blpapi_ResolutionList_statusAt, METH_VARARGS, NULL}, + { (char *)"blpapi_ResolutionList_attribute", _wrap_blpapi_ResolutionList_attribute, METH_VARARGS, NULL}, + { (char *)"blpapi_ResolutionList_attributeAt", _wrap_blpapi_ResolutionList_attributeAt, METH_VARARGS, NULL}, + { (char *)"blpapi_ResolutionList_message", _wrap_blpapi_ResolutionList_message, METH_VARARGS, NULL}, + { (char *)"blpapi_ResolutionList_messageAt", _wrap_blpapi_ResolutionList_messageAt, METH_VARARGS, NULL}, + { (char *)"blpapi_ResolutionList_size", _wrap_blpapi_ResolutionList_size, METH_VARARGS, NULL}, + { (char *)"blpapi_Topic_create", _wrap_blpapi_Topic_create, METH_VARARGS, NULL}, + { (char *)"blpapi_Topic_destroy", _wrap_blpapi_Topic_destroy, METH_VARARGS, NULL}, + { (char *)"blpapi_Topic_compare", _wrap_blpapi_Topic_compare, METH_VARARGS, NULL}, + { (char *)"blpapi_Topic_service", _wrap_blpapi_Topic_service, METH_VARARGS, NULL}, + { (char *)"blpapi_Topic_isActive", _wrap_blpapi_Topic_isActive, METH_VARARGS, NULL}, + { (char *)"blpapi_TopicList_create", _wrap_blpapi_TopicList_create, METH_VARARGS, NULL}, + { (char *)"blpapi_TopicList_destroy", _wrap_blpapi_TopicList_destroy, METH_VARARGS, NULL}, + { (char *)"blpapi_TopicList_add", _wrap_blpapi_TopicList_add, METH_VARARGS, NULL}, + { (char *)"blpapi_TopicList_addFromMessage", _wrap_blpapi_TopicList_addFromMessage, METH_VARARGS, NULL}, + { (char *)"blpapi_TopicList_correlationIdAt", _wrap_blpapi_TopicList_correlationIdAt, METH_VARARGS, NULL}, + { (char *)"blpapi_TopicList_topicString", _wrap_blpapi_TopicList_topicString, METH_VARARGS, NULL}, + { (char *)"blpapi_TopicList_topicStringAt", _wrap_blpapi_TopicList_topicStringAt, METH_VARARGS, NULL}, + { (char *)"blpapi_TopicList_status", _wrap_blpapi_TopicList_status, METH_VARARGS, NULL}, + { (char *)"blpapi_TopicList_statusAt", _wrap_blpapi_TopicList_statusAt, METH_VARARGS, NULL}, + { (char *)"blpapi_TopicList_message", _wrap_blpapi_TopicList_message, METH_VARARGS, NULL}, + { (char *)"blpapi_TopicList_messageAt", _wrap_blpapi_TopicList_messageAt, METH_VARARGS, NULL}, + { (char *)"blpapi_TopicList_size", _wrap_blpapi_TopicList_size, METH_VARARGS, NULL}, + { (char *)"blpapi_ProviderSession_create", _wrap_blpapi_ProviderSession_create, METH_VARARGS, NULL}, + { (char *)"blpapi_ProviderSession_destroy", _wrap_blpapi_ProviderSession_destroy, METH_VARARGS, NULL}, + { (char *)"blpapi_ProviderSession_start", _wrap_blpapi_ProviderSession_start, METH_VARARGS, NULL}, + { (char *)"blpapi_ProviderSession_startAsync", _wrap_blpapi_ProviderSession_startAsync, METH_VARARGS, NULL}, + { (char *)"blpapi_ProviderSession_stop", _wrap_blpapi_ProviderSession_stop, METH_VARARGS, NULL}, + { (char *)"blpapi_ProviderSession_stopAsync", _wrap_blpapi_ProviderSession_stopAsync, METH_VARARGS, NULL}, + { (char *)"blpapi_ProviderSession_nextEvent", _wrap_blpapi_ProviderSession_nextEvent, METH_VARARGS, NULL}, + { (char *)"blpapi_ProviderSession_tryNextEvent", _wrap_blpapi_ProviderSession_tryNextEvent, METH_VARARGS, NULL}, + { (char *)"blpapi_ProviderSession_registerService", _wrap_blpapi_ProviderSession_registerService, METH_VARARGS, NULL}, + { (char *)"blpapi_ProviderSession_activateSubServiceCodeRange", _wrap_blpapi_ProviderSession_activateSubServiceCodeRange, METH_VARARGS, NULL}, + { (char *)"blpapi_ProviderSession_deactivateSubServiceCodeRange", _wrap_blpapi_ProviderSession_deactivateSubServiceCodeRange, METH_VARARGS, NULL}, + { (char *)"blpapi_ProviderSession_registerServiceAsync", _wrap_blpapi_ProviderSession_registerServiceAsync, METH_VARARGS, NULL}, + { (char *)"blpapi_ProviderSession_deregisterService", _wrap_blpapi_ProviderSession_deregisterService, METH_VARARGS, NULL}, + { (char *)"blpapi_ProviderSession_resolve", _wrap_blpapi_ProviderSession_resolve, METH_VARARGS, NULL}, + { (char *)"blpapi_ProviderSession_resolveAsync", _wrap_blpapi_ProviderSession_resolveAsync, METH_VARARGS, NULL}, + { (char *)"blpapi_ProviderSession_createTopics", _wrap_blpapi_ProviderSession_createTopics, METH_VARARGS, NULL}, + { (char *)"blpapi_ProviderSession_createTopicsAsync", _wrap_blpapi_ProviderSession_createTopicsAsync, METH_VARARGS, NULL}, + { (char *)"blpapi_ProviderSession_getTopic", _wrap_blpapi_ProviderSession_getTopic, METH_VARARGS, NULL}, + { (char *)"blpapi_ProviderSession_createTopic", _wrap_blpapi_ProviderSession_createTopic, METH_VARARGS, NULL}, + { (char *)"blpapi_ProviderSession_createServiceStatusTopic", _wrap_blpapi_ProviderSession_createServiceStatusTopic, METH_VARARGS, NULL}, + { (char *)"blpapi_ProviderSession_deleteTopics", _wrap_blpapi_ProviderSession_deleteTopics, METH_VARARGS, NULL}, + { (char *)"blpapi_ProviderSession_terminateSubscriptionsOnTopics", _wrap_blpapi_ProviderSession_terminateSubscriptionsOnTopics, METH_VARARGS, NULL}, + { (char *)"blpapi_ProviderSession_publish", _wrap_blpapi_ProviderSession_publish, METH_VARARGS, NULL}, + { (char *)"blpapi_ProviderSession_sendResponse", _wrap_blpapi_ProviderSession_sendResponse, METH_VARARGS, NULL}, + { (char *)"blpapi_ProviderSession_getAbstractSession", _wrap_blpapi_ProviderSession_getAbstractSession, METH_VARARGS, NULL}, + { (char *)"blpapi_ProviderSession_flushPublishedEvents", _wrap_blpapi_ProviderSession_flushPublishedEvents, METH_VARARGS, NULL}, + { (char *)"blpapi_ServiceRegistrationOptions_create", _wrap_blpapi_ServiceRegistrationOptions_create, METH_VARARGS, NULL}, + { (char *)"blpapi_ServiceRegistrationOptions_duplicate", _wrap_blpapi_ServiceRegistrationOptions_duplicate, METH_VARARGS, NULL}, + { (char *)"blpapi_ServiceRegistrationOptions_destroy", _wrap_blpapi_ServiceRegistrationOptions_destroy, METH_VARARGS, NULL}, + { (char *)"blpapi_ServiceRegistrationOptions_copy", _wrap_blpapi_ServiceRegistrationOptions_copy, METH_VARARGS, NULL}, + { (char *)"blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange", _wrap_blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange, METH_VARARGS, NULL}, + { (char *)"blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges", _wrap_blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges, METH_VARARGS, NULL}, + { (char *)"blpapi_ServiceRegistrationOptions_setGroupId", _wrap_blpapi_ServiceRegistrationOptions_setGroupId, METH_VARARGS, NULL}, + { (char *)"blpapi_ServiceRegistrationOptions_setServicePriority", _wrap_blpapi_ServiceRegistrationOptions_setServicePriority, METH_VARARGS, NULL}, + { (char *)"blpapi_ServiceRegistrationOptions_setPartsToRegister", _wrap_blpapi_ServiceRegistrationOptions_setPartsToRegister, METH_VARARGS, NULL}, + { (char *)"blpapi_ServiceRegistrationOptions_getGroupId", _wrap_blpapi_ServiceRegistrationOptions_getGroupId, METH_VARARGS, NULL}, + { (char *)"blpapi_ServiceRegistrationOptions_getServicePriority", _wrap_blpapi_ServiceRegistrationOptions_getServicePriority, METH_VARARGS, NULL}, + { (char *)"blpapi_ServiceRegistrationOptions_getPartsToRegister", _wrap_blpapi_ServiceRegistrationOptions_getPartsToRegister, METH_VARARGS, NULL}, + { (char *)"blpapi_ZfpUtil_getOptionsForLeasedLines", _wrap_blpapi_ZfpUtil_getOptionsForLeasedLines, METH_VARARGS, NULL}, + { NULL, NULL, 0, NULL } +}; + + +/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ + +static void *_p_intArrayTo_p_int(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((int *) ((intArray *) x)); +} +static swig_type_info _swigt__p_blpapi_AbstractSession = {"_p_blpapi_AbstractSession", "struct blpapi_AbstractSession *|blpapi_AbstractSession_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_Constant = {"_p_blpapi_Constant", "struct blpapi_Constant *|blpapi_Constant_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_ConstantList = {"_p_blpapi_ConstantList", "struct blpapi_ConstantList *|blpapi_ConstantList_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_CorrelationId_t_ = {"_p_blpapi_CorrelationId_t_", "struct blpapi_CorrelationId_t_ *|blpapi_CorrelationId_t_ *|blpapi_CorrelationId_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_CorrelationId_t__value = {"_p_blpapi_CorrelationId_t__value", "blpapi_CorrelationId_t__value *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_Datetime_tag = {"_p_blpapi_Datetime_tag", "blpapi_Datetime_t *|struct blpapi_Datetime_tag *|blpapi_Datetime_tag *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_Element = {"_p_blpapi_Element", "blpapi_Element_t *|struct blpapi_Element *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_Event = {"_p_blpapi_Event", "struct blpapi_Event *|blpapi_Event_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_EventDispatcher = {"_p_blpapi_EventDispatcher", "struct blpapi_EventDispatcher *|blpapi_EventDispatcher_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_EventFormatter = {"_p_blpapi_EventFormatter", "struct blpapi_EventFormatter *|blpapi_EventFormatter_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_EventQueue = {"_p_blpapi_EventQueue", "struct blpapi_EventQueue *|blpapi_EventQueue_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_HighPrecisionDatetime_tag = {"_p_blpapi_HighPrecisionDatetime_tag", "blpapi_HighPrecisionDatetime_t *|struct blpapi_HighPrecisionDatetime_tag *|blpapi_HighPrecisionDatetime_tag *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_Identity = {"_p_blpapi_Identity", "struct blpapi_Identity *|blpapi_UserHandle_t *|blpapi_UserHandle *|blpapi_Identity_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_Logging_Func_t = {"_p_blpapi_Logging_Func_t", "blpapi_Logging_Func_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_Logging_Severity_t = {"_p_blpapi_Logging_Severity_t", "enum blpapi_Logging_Severity_t *|blpapi_Logging_Severity_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_ManagedPtr_t_ = {"_p_blpapi_ManagedPtr_t_", "blpapi_ManagedPtr_t *|struct blpapi_ManagedPtr_t_ *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_Message = {"_p_blpapi_Message", "struct blpapi_Message *|blpapi_Message_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_MessageIterator = {"_p_blpapi_MessageIterator", "struct blpapi_MessageIterator *|blpapi_MessageIterator_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_Name = {"_p_blpapi_Name", "struct blpapi_Name *|blpapi_Name_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_Operation = {"_p_blpapi_Operation", "blpapi_Operation_t *|struct blpapi_Operation *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_ProviderSession = {"_p_blpapi_ProviderSession", "struct blpapi_ProviderSession *|blpapi_ProviderSession_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_Request = {"_p_blpapi_Request", "struct blpapi_Request *|blpapi_Request_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_RequestTemplate = {"_p_blpapi_RequestTemplate", "blpapi_RequestTemplate_t *|struct blpapi_RequestTemplate *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_ResolutionList = {"_p_blpapi_ResolutionList", "struct blpapi_ResolutionList *|blpapi_ResolutionList_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_Service = {"_p_blpapi_Service", "blpapi_Service_t *|struct blpapi_Service *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_ServiceRegistrationOptions = {"_p_blpapi_ServiceRegistrationOptions", "struct blpapi_ServiceRegistrationOptions *|blpapi_ServiceRegistrationOptions_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_Session = {"_p_blpapi_Session", "struct blpapi_Session *|blpapi_Session_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_SessionOptions = {"_p_blpapi_SessionOptions", "struct blpapi_SessionOptions *|blpapi_SessionOptions_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_StreamWriter_t = {"_p_blpapi_StreamWriter_t", "blpapi_StreamWriter_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_SubscriptionItrerator = {"_p_blpapi_SubscriptionItrerator", "struct blpapi_SubscriptionItrerator *|blpapi_SubscriptionIterator_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_SubscriptionList = {"_p_blpapi_SubscriptionList", "struct blpapi_SubscriptionList *|blpapi_SubscriptionList_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_TimePoint = {"_p_blpapi_TimePoint", "blpapi_TimePoint_t *|struct blpapi_TimePoint *|blpapi_TimePoint *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_TlsOptions = {"_p_blpapi_TlsOptions", "struct blpapi_TlsOptions *|blpapi_TlsOptions_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_Topic = {"_p_blpapi_Topic", "struct blpapi_Topic *|blpapi_Topic_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_TopicList = {"_p_blpapi_TopicList", "struct blpapi_TopicList *|blpapi_TopicList_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_char = {"_p_char", "char *|blpapi_Char_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_double = {"_p_double", "blpapi_Float64_t *|double *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_f_p_struct_blpapi_Event_p_struct_blpapi_ProviderSession_p_void__void = {"_p_f_p_struct_blpapi_Event_p_struct_blpapi_ProviderSession_p_void__void", "void (*)(struct blpapi_Event *,struct blpapi_ProviderSession *,void *)|blpapi_ProviderEventHandler_t", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_float = {"_p_float", "blpapi_Float32_t *|float *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_int = {"_p_int", "blpapi_Bool_t *|int *|blpapi_Int32_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_intArray = {"_p_intArray", "intArray *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_long_long = {"_p_long_long", "blpapi_Int64_t *|long long *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_p_blpapi_Element = {"_p_p_blpapi_Element", "struct blpapi_Element **|blpapi_Element_t **", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_p_blpapi_Event = {"_p_p_blpapi_Event", "struct blpapi_Event **|blpapi_Event_t **", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_p_blpapi_Message = {"_p_p_blpapi_Message", "blpapi_Message_t **|struct blpapi_Message **", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_p_blpapi_Name = {"_p_p_blpapi_Name", "struct blpapi_Name **|blpapi_Name_t **", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_p_blpapi_Operation = {"_p_p_blpapi_Operation", "struct blpapi_Operation **|blpapi_Operation_t **", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_p_blpapi_Request = {"_p_p_blpapi_Request", "blpapi_Request_t **|struct blpapi_Request **", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_p_blpapi_RequestTemplate = {"_p_p_blpapi_RequestTemplate", "struct blpapi_RequestTemplate **|blpapi_RequestTemplate_t **", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_p_blpapi_Service = {"_p_p_blpapi_Service", "blpapi_Service_t **|struct blpapi_Service **", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_p_blpapi_Topic = {"_p_p_blpapi_Topic", "struct blpapi_Topic **|blpapi_Topic_t **", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_p_p_void = {"_p_p_p_void", "blpapi_SchemaElementDefinition_t **|void ***", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_p_void = {"_p_p_void", "blpapi_SchemaElementDefinition_t *|blpapi_SchemaTypeDefinition_t *|void **", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_short = {"_p_short", "short *|blpapi_Int16_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "unsigned char *|blpapi_UChar_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_unsigned_int = {"_p_unsigned_int", "blpapi_UInt32_t *|unsigned int *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_unsigned_long_long = {"_p_unsigned_long_long", "blpapi_UInt64_t *|unsigned long long *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_unsigned_short = {"_p_unsigned_short", "unsigned short *|blpapi_UInt16_t *", 0, 0, (void*)0, 0}; + +static swig_type_info *swig_type_initial[] = { + &_swigt__p_blpapi_AbstractSession, + &_swigt__p_blpapi_Constant, + &_swigt__p_blpapi_ConstantList, + &_swigt__p_blpapi_CorrelationId_t_, + &_swigt__p_blpapi_CorrelationId_t__value, + &_swigt__p_blpapi_Datetime_tag, + &_swigt__p_blpapi_Element, + &_swigt__p_blpapi_Event, + &_swigt__p_blpapi_EventDispatcher, + &_swigt__p_blpapi_EventFormatter, + &_swigt__p_blpapi_EventQueue, + &_swigt__p_blpapi_HighPrecisionDatetime_tag, + &_swigt__p_blpapi_Identity, + &_swigt__p_blpapi_Logging_Func_t, + &_swigt__p_blpapi_Logging_Severity_t, + &_swigt__p_blpapi_ManagedPtr_t_, + &_swigt__p_blpapi_Message, + &_swigt__p_blpapi_MessageIterator, + &_swigt__p_blpapi_Name, + &_swigt__p_blpapi_Operation, + &_swigt__p_blpapi_ProviderSession, + &_swigt__p_blpapi_Request, + &_swigt__p_blpapi_RequestTemplate, + &_swigt__p_blpapi_ResolutionList, + &_swigt__p_blpapi_Service, + &_swigt__p_blpapi_ServiceRegistrationOptions, + &_swigt__p_blpapi_Session, + &_swigt__p_blpapi_SessionOptions, + &_swigt__p_blpapi_StreamWriter_t, + &_swigt__p_blpapi_SubscriptionItrerator, + &_swigt__p_blpapi_SubscriptionList, + &_swigt__p_blpapi_TimePoint, + &_swigt__p_blpapi_TlsOptions, + &_swigt__p_blpapi_Topic, + &_swigt__p_blpapi_TopicList, + &_swigt__p_char, + &_swigt__p_double, + &_swigt__p_f_p_struct_blpapi_Event_p_struct_blpapi_ProviderSession_p_void__void, + &_swigt__p_float, + &_swigt__p_int, + &_swigt__p_intArray, + &_swigt__p_long_long, + &_swigt__p_p_blpapi_Element, + &_swigt__p_p_blpapi_Event, + &_swigt__p_p_blpapi_Message, + &_swigt__p_p_blpapi_Name, + &_swigt__p_p_blpapi_Operation, + &_swigt__p_p_blpapi_Request, + &_swigt__p_p_blpapi_RequestTemplate, + &_swigt__p_p_blpapi_Service, + &_swigt__p_p_blpapi_Topic, + &_swigt__p_p_char, + &_swigt__p_p_p_void, + &_swigt__p_p_void, + &_swigt__p_short, + &_swigt__p_unsigned_char, + &_swigt__p_unsigned_int, + &_swigt__p_unsigned_long_long, + &_swigt__p_unsigned_short, +}; + +static swig_cast_info _swigc__p_blpapi_AbstractSession[] = { {&_swigt__p_blpapi_AbstractSession, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_Constant[] = { {&_swigt__p_blpapi_Constant, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_ConstantList[] = { {&_swigt__p_blpapi_ConstantList, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_CorrelationId_t_[] = { {&_swigt__p_blpapi_CorrelationId_t_, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_CorrelationId_t__value[] = { {&_swigt__p_blpapi_CorrelationId_t__value, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_Datetime_tag[] = { {&_swigt__p_blpapi_Datetime_tag, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_Element[] = { {&_swigt__p_blpapi_Element, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_Event[] = { {&_swigt__p_blpapi_Event, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_EventDispatcher[] = { {&_swigt__p_blpapi_EventDispatcher, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_EventFormatter[] = { {&_swigt__p_blpapi_EventFormatter, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_EventQueue[] = { {&_swigt__p_blpapi_EventQueue, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_HighPrecisionDatetime_tag[] = { {&_swigt__p_blpapi_HighPrecisionDatetime_tag, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_Identity[] = { {&_swigt__p_blpapi_Identity, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_Logging_Func_t[] = { {&_swigt__p_blpapi_Logging_Func_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_Logging_Severity_t[] = { {&_swigt__p_blpapi_Logging_Severity_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_ManagedPtr_t_[] = { {&_swigt__p_blpapi_ManagedPtr_t_, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_Message[] = { {&_swigt__p_blpapi_Message, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_MessageIterator[] = { {&_swigt__p_blpapi_MessageIterator, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_Name[] = { {&_swigt__p_blpapi_Name, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_Operation[] = { {&_swigt__p_blpapi_Operation, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_ProviderSession[] = { {&_swigt__p_blpapi_ProviderSession, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_Request[] = { {&_swigt__p_blpapi_Request, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_RequestTemplate[] = { {&_swigt__p_blpapi_RequestTemplate, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_ResolutionList[] = { {&_swigt__p_blpapi_ResolutionList, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_Service[] = { {&_swigt__p_blpapi_Service, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_ServiceRegistrationOptions[] = { {&_swigt__p_blpapi_ServiceRegistrationOptions, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_Session[] = { {&_swigt__p_blpapi_Session, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_SessionOptions[] = { {&_swigt__p_blpapi_SessionOptions, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_StreamWriter_t[] = { {&_swigt__p_blpapi_StreamWriter_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_SubscriptionItrerator[] = { {&_swigt__p_blpapi_SubscriptionItrerator, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_SubscriptionList[] = { {&_swigt__p_blpapi_SubscriptionList, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_TimePoint[] = { {&_swigt__p_blpapi_TimePoint, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_TlsOptions[] = { {&_swigt__p_blpapi_TlsOptions, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_Topic[] = { {&_swigt__p_blpapi_Topic, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_TopicList[] = { {&_swigt__p_blpapi_TopicList, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_double[] = { {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_f_p_struct_blpapi_Event_p_struct_blpapi_ProviderSession_p_void__void[] = { {&_swigt__p_f_p_struct_blpapi_Event_p_struct_blpapi_ProviderSession_p_void__void, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_float[] = { {&_swigt__p_float, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_int[] = { {&_swigt__p_intArray, _p_intArrayTo_p_int, 0, 0}, {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_intArray[] = { {&_swigt__p_intArray, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_long_long[] = { {&_swigt__p_long_long, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_p_blpapi_Element[] = { {&_swigt__p_p_blpapi_Element, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_p_blpapi_Event[] = { {&_swigt__p_p_blpapi_Event, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_p_blpapi_Message[] = { {&_swigt__p_p_blpapi_Message, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_p_blpapi_Name[] = { {&_swigt__p_p_blpapi_Name, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_p_blpapi_Operation[] = { {&_swigt__p_p_blpapi_Operation, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_p_blpapi_Request[] = { {&_swigt__p_p_blpapi_Request, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_p_blpapi_RequestTemplate[] = { {&_swigt__p_p_blpapi_RequestTemplate, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_p_blpapi_Service[] = { {&_swigt__p_p_blpapi_Service, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_p_blpapi_Topic[] = { {&_swigt__p_p_blpapi_Topic, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_p_char[] = { {&_swigt__p_p_char, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_p_p_void[] = { {&_swigt__p_p_p_void, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_p_void[] = { {&_swigt__p_p_void, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_short[] = { {&_swigt__p_short, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_unsigned_char[] = { {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_unsigned_int[] = { {&_swigt__p_unsigned_int, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_unsigned_long_long[] = { {&_swigt__p_unsigned_long_long, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_unsigned_short[] = { {&_swigt__p_unsigned_short, 0, 0, 0},{0, 0, 0, 0}}; + +static swig_cast_info *swig_cast_initial[] = { + _swigc__p_blpapi_AbstractSession, + _swigc__p_blpapi_Constant, + _swigc__p_blpapi_ConstantList, + _swigc__p_blpapi_CorrelationId_t_, + _swigc__p_blpapi_CorrelationId_t__value, + _swigc__p_blpapi_Datetime_tag, + _swigc__p_blpapi_Element, + _swigc__p_blpapi_Event, + _swigc__p_blpapi_EventDispatcher, + _swigc__p_blpapi_EventFormatter, + _swigc__p_blpapi_EventQueue, + _swigc__p_blpapi_HighPrecisionDatetime_tag, + _swigc__p_blpapi_Identity, + _swigc__p_blpapi_Logging_Func_t, + _swigc__p_blpapi_Logging_Severity_t, + _swigc__p_blpapi_ManagedPtr_t_, + _swigc__p_blpapi_Message, + _swigc__p_blpapi_MessageIterator, + _swigc__p_blpapi_Name, + _swigc__p_blpapi_Operation, + _swigc__p_blpapi_ProviderSession, + _swigc__p_blpapi_Request, + _swigc__p_blpapi_RequestTemplate, + _swigc__p_blpapi_ResolutionList, + _swigc__p_blpapi_Service, + _swigc__p_blpapi_ServiceRegistrationOptions, + _swigc__p_blpapi_Session, + _swigc__p_blpapi_SessionOptions, + _swigc__p_blpapi_StreamWriter_t, + _swigc__p_blpapi_SubscriptionItrerator, + _swigc__p_blpapi_SubscriptionList, + _swigc__p_blpapi_TimePoint, + _swigc__p_blpapi_TlsOptions, + _swigc__p_blpapi_Topic, + _swigc__p_blpapi_TopicList, + _swigc__p_char, + _swigc__p_double, + _swigc__p_f_p_struct_blpapi_Event_p_struct_blpapi_ProviderSession_p_void__void, + _swigc__p_float, + _swigc__p_int, + _swigc__p_intArray, + _swigc__p_long_long, + _swigc__p_p_blpapi_Element, + _swigc__p_p_blpapi_Event, + _swigc__p_p_blpapi_Message, + _swigc__p_p_blpapi_Name, + _swigc__p_p_blpapi_Operation, + _swigc__p_p_blpapi_Request, + _swigc__p_p_blpapi_RequestTemplate, + _swigc__p_p_blpapi_Service, + _swigc__p_p_blpapi_Topic, + _swigc__p_p_char, + _swigc__p_p_p_void, + _swigc__p_p_void, + _swigc__p_short, + _swigc__p_unsigned_char, + _swigc__p_unsigned_int, + _swigc__p_unsigned_long_long, + _swigc__p_unsigned_short, +}; + + +/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */ + +static swig_const_info swig_const_table[] = { +{0, 0, 0, 0.0, 0, 0}}; + +#ifdef __cplusplus +} +#endif +/* ----------------------------------------------------------------------------- + * Type initialization: + * This problem is tough by the requirement that no dynamic + * memory is used. Also, since swig_type_info structures store pointers to + * swig_cast_info structures and swig_cast_info structures store pointers back + * to swig_type_info structures, we need some lookup code at initialization. + * The idea is that swig generates all the structures that are needed. + * The runtime then collects these partially filled structures. + * The SWIG_InitializeModule function takes these initial arrays out of + * swig_module, and does all the lookup, filling in the swig_module.types + * array with the correct data and linking the correct swig_cast_info + * structures together. + * + * The generated swig_type_info structures are assigned statically to an initial + * array. We just loop through that array, and handle each type individually. + * First we lookup if this type has been already loaded, and if so, use the + * loaded structure instead of the generated one. Then we have to fill in the + * cast linked list. The cast data is initially stored in something like a + * two-dimensional array. Each row corresponds to a type (there are the same + * number of rows as there are in the swig_type_initial array). Each entry in + * a column is one of the swig_cast_info structures for that type. + * The cast_initial array is actually an array of arrays, because each row has + * a variable number of columns. So to actually build the cast linked list, + * we find the array of casts associated with the type, and loop through it + * adding the casts to the list. The one last trick we need to do is making + * sure the type pointer in the swig_cast_info struct is correct. + * + * First off, we lookup the cast->type name to see if it is already loaded. + * There are three cases to handle: + * 1) If the cast->type has already been loaded AND the type we are adding + * casting info to has not been loaded (it is in this module), THEN we + * replace the cast->type pointer with the type pointer that has already + * been loaded. + * 2) If BOTH types (the one we are adding casting info to, and the + * cast->type) are loaded, THEN the cast info has already been loaded by + * the previous module so we just ignore it. + * 3) Finally, if cast->type has not already been loaded, then we add that + * swig_cast_info to the linked list (because the cast->type) pointer will + * be correct. + * ----------------------------------------------------------------------------- */ + +#ifdef __cplusplus +extern "C" { +#if 0 +} /* c-mode */ +#endif +#endif + +#if 0 +#define SWIGRUNTIME_DEBUG +#endif + + +SWIGRUNTIME void +SWIG_InitializeModule(void *clientdata) { + size_t i; + swig_module_info *module_head, *iter; + int init; + + /* check to see if the circular list has been setup, if not, set it up */ + if (swig_module.next==0) { + /* Initialize the swig_module */ + swig_module.type_initial = swig_type_initial; + swig_module.cast_initial = swig_cast_initial; + swig_module.next = &swig_module; + init = 1; + } else { + init = 0; + } + + /* Try and load any already created modules */ + module_head = SWIG_GetModule(clientdata); + if (!module_head) { + /* This is the first module loaded for this interpreter */ + /* so set the swig module into the interpreter */ + SWIG_SetModule(clientdata, &swig_module); + } else { + /* the interpreter has loaded a SWIG module, but has it loaded this one? */ + iter=module_head; + do { + if (iter==&swig_module) { + /* Our module is already in the list, so there's nothing more to do. */ + return; + } + iter=iter->next; + } while (iter!= module_head); + + /* otherwise we must add our module into the list */ + swig_module.next = module_head->next; + module_head->next = &swig_module; + } + + /* When multiple interpreters are used, a module could have already been initialized in + a different interpreter, but not yet have a pointer in this interpreter. + In this case, we do not want to continue adding types... everything should be + set up already */ + if (init == 0) return; + + /* Now work on filling in swig_module.types */ +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: size %d\n", swig_module.size); +#endif + for (i = 0; i < swig_module.size; ++i) { + swig_type_info *type = 0; + swig_type_info *ret; + swig_cast_info *cast; + +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); +#endif + + /* if there is another module already loaded */ + if (swig_module.next != &swig_module) { + type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name); + } + if (type) { + /* Overwrite clientdata field */ +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: found type %s\n", type->name); +#endif + if (swig_module.type_initial[i]->clientdata) { + type->clientdata = swig_module.type_initial[i]->clientdata; +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name); +#endif + } + } else { + type = swig_module.type_initial[i]; + } + + /* Insert casting types */ + cast = swig_module.cast_initial[i]; + while (cast->type) { + /* Don't need to add information already in the list */ + ret = 0; +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: look cast %s\n", cast->type->name); +#endif + if (swig_module.next != &swig_module) { + ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name); +#ifdef SWIGRUNTIME_DEBUG + if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name); +#endif + } + if (ret) { + if (type == swig_module.type_initial[i]) { +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: skip old type %s\n", ret->name); +#endif + cast->type = ret; + ret = 0; + } else { + /* Check for casting already in the list */ + swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type); +#ifdef SWIGRUNTIME_DEBUG + if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name); +#endif + if (!ocast) ret = 0; + } + } + + if (!ret) { +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name); +#endif + if (type->cast) { + type->cast->prev = cast; + cast->next = type->cast; + } + type->cast = cast; + } + cast++; + } + /* Set entry in modules->types array equal to the type */ + swig_module.types[i] = type; + } + swig_module.types[i] = 0; + +#ifdef SWIGRUNTIME_DEBUG + printf("**** SWIG_InitializeModule: Cast List ******\n"); + for (i = 0; i < swig_module.size; ++i) { + int j = 0; + swig_cast_info *cast = swig_module.cast_initial[i]; + printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); + while (cast->type) { + printf("SWIG_InitializeModule: cast type %s\n", cast->type->name); + cast++; + ++j; + } + printf("---- Total casts: %d\n",j); + } + printf("**** SWIG_InitializeModule: Cast List ******\n"); +#endif +} + +/* This function will propagate the clientdata field of type to +* any new swig_type_info structures that have been added into the list +* of equivalent types. It is like calling +* SWIG_TypeClientData(type, clientdata) a second time. +*/ +SWIGRUNTIME void +SWIG_PropagateClientData(void) { + size_t i; + swig_cast_info *equiv; + static int init_run = 0; + + if (init_run) return; + init_run = 1; + + for (i = 0; i < swig_module.size; i++) { + if (swig_module.types[i]->clientdata) { + equiv = swig_module.types[i]->cast; + while (equiv) { + if (!equiv->converter) { + if (equiv->type && !equiv->type->clientdata) + SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata); + } + equiv = equiv->next; + } + } + } +} + +#ifdef __cplusplus +#if 0 +{ + /* c-mode */ +#endif +} +#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(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 int + swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { + char *tmp; + PyObject *str = swig_varlink_str(v); + fprintf(fp,"Swig global variables "); + fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str)); + SWIG_Python_str_DelForPy3(tmp); + Py_DECREF(str); + return 0; + } + + 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 + (char *)"swigvarlink", /* tp_name */ + sizeof(swig_varlinkobject), /* tp_basicsize */ + 0, /* tp_itemsize */ + (destructor) swig_varlink_dealloc, /* tp_dealloc */ + (printfunc) swig_varlink_print, /* 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 */ +#if PY_VERSION_HEX >= 0x02020000 + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */ +#endif +#if PY_VERSION_HEX >= 0x02030000 + 0, /* tp_del */ +#endif +#if PY_VERSION_HEX >= 0x02060000 + 0, /* tp_version_tag */ +#endif +#if PY_VERSION_HEX >= 0x03040000 + 0, /* tp_finalize */ +#endif +#ifdef COUNT_ALLOCS + 0, /* tp_allocs */ + 0, /* tp_frees */ + 0, /* tp_maxalloc */ +#if PY_VERSION_HEX >= 0x02050000 + 0, /* tp_prev */ +#endif + 0 /* tp_next */ +#endif + }; + varlink_type = tmp; + type_init = 1; +#if PY_VERSION_HEX < 0x02020000 + varlink_type.ob_type = &PyType_Type; +#else + if (PyType_Ready(&varlink_type) < 0) + return NULL; +#endif + } + 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, 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) { + strncpy(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 *_SWIG_globals = 0; + if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink(); + return _SWIG_globals; + } + + /* ----------------------------------------------------------------------------- + * constants/methods manipulation + * ----------------------------------------------------------------------------- */ + + /* Install Constants */ + SWIGINTERN void + SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) { + PyObject *obj = 0; + size_t i; + for (i = 0; constants[i].type; ++i) { + switch(constants[i].type) { + case SWIG_PY_POINTER: + obj = SWIG_InternalNewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0); + break; + case SWIG_PY_BINARY: + obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype)); + break; + default: + obj = 0; + break; + } + if (obj) { + PyDict_SetItemString(d, constants[i].name, obj); + Py_DECREF(obj); + } + } + } + + /* -----------------------------------------------------------------------------*/ + /* Fix SwigMethods to carry the callback ptrs when needed */ + /* -----------------------------------------------------------------------------*/ + + SWIGINTERN void + SWIG_Python_FixMethods(PyMethodDef *methods, + 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; + if (!c) continue; + c = strstr(c, "swig_ptr: "); + if (c) { + int j; + 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, + strlen(const_table[j].name)) == 0) { + ci = &(const_table[j]); + break; + } + } + if (ci) { + void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0; + if (ptr) { + size_t shift = (ci->ptype) - types; + swig_type_info *ty = types_initial[shift]; + size_t ldoc = (c - methods[i].ml_doc); + size_t lptr = strlen(ty->name)+2*sizeof(void*)+2; + char *ndoc = (char*)malloc(ldoc + lptr + 10); + if (ndoc) { + char *buff = ndoc; + strncpy(buff, methods[i].ml_doc, ldoc); + buff += ldoc; + strncpy(buff, "swig_ptr: ", 10); + buff += 10; + SWIG_PackVoidPtr(buff, ptr, ty->name, lptr); + methods[i].ml_doc = ndoc; + } + } + } + } + } + } + +#ifdef __cplusplus +} +#endif + +/* -----------------------------------------------------------------------------* + * Partial Init method + * -----------------------------------------------------------------------------*/ + +#ifdef __cplusplus +extern "C" +#endif + +SWIGEXPORT +#if PY_VERSION_HEX >= 0x03000000 +PyObject* +#else +void +#endif +SWIG_init(void) { + PyObject *m, *d, *md; +#if PY_VERSION_HEX >= 0x03000000 + static struct PyModuleDef SWIG_module = { +# if PY_VERSION_HEX >= 0x03020000 + PyModuleDef_HEAD_INIT, +# else + { + PyObject_HEAD_INIT(NULL) + NULL, /* m_init */ + 0, /* m_index */ + NULL, /* m_copy */ + }, +# endif + (char *) SWIG_name, + NULL, + -1, + SwigMethods, + NULL, + NULL, + NULL, + NULL + }; +#endif + +#if defined(SWIGPYTHON_BUILTIN) + static SwigPyClientData SwigPyObject_clientdata = { + 0, 0, 0, 0, 0, 0, 0 + }; + static PyGetSetDef this_getset_def = { + (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL + }; + static SwigPyGetSet thisown_getset_closure = { + (PyCFunction) SwigPyObject_own, + (PyCFunction) SwigPyObject_own + }; + static PyGetSetDef thisown_getset_def = { + (char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure + }; + PyTypeObject *builtin_pytype; + int builtin_base_count; + swig_type_info *builtin_basetype; + PyObject *tuple; + PyGetSetDescrObject *static_getset; + PyTypeObject *metatype; + PyTypeObject *swigpyobject; + SwigPyClientData *cd; + PyObject *public_interface, *public_symbol; + PyObject *this_descr; + PyObject *thisown_descr; + PyObject *self = 0; + int i; + + (void)builtin_pytype; + (void)builtin_base_count; + (void)builtin_basetype; + (void)tuple; + (void)static_getset; + (void)self; + + /* Metaclass is used to implement static member variables */ + metatype = SwigPyObjectType(); + assert(metatype); +#endif + + /* Fix SwigMethods to carry the callback ptrs when needed */ + SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial); + +#if PY_VERSION_HEX >= 0x03000000 + m = PyModule_Create(&SWIG_module); +#else + m = Py_InitModule((char *) SWIG_name, SwigMethods); +#endif + + md = d = PyModule_GetDict(m); + (void)md; + + SWIG_InitializeModule(0); + +#ifdef SWIGPYTHON_BUILTIN + swigpyobject = SwigPyObject_TypeOnce(); + + SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject"); + assert(SwigPyObject_stype); + cd = (SwigPyClientData*) SwigPyObject_stype->clientdata; + if (!cd) { + SwigPyObject_stype->clientdata = &SwigPyObject_clientdata; + SwigPyObject_clientdata.pytype = swigpyobject; + } else if (swigpyobject->tp_basicsize != cd->pytype->tp_basicsize) { + PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules."); +# if PY_VERSION_HEX >= 0x03000000 + return NULL; +# else + return; +# endif + } + + /* All objects have a 'this' attribute */ + this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def); + (void)this_descr; + + /* All objects have a 'thisown' attribute */ + thisown_descr = PyDescr_NewGetSet(SwigPyObject_type(), &thisown_getset_def); + (void)thisown_descr; + + public_interface = PyList_New(0); + public_symbol = 0; + (void)public_symbol; + + PyDict_SetItemString(md, "__all__", public_interface); + Py_DECREF(public_interface); + for (i = 0; SwigMethods[i].ml_name != NULL; ++i) + SwigPyBuiltin_AddPublicSymbol(public_interface, SwigMethods[i].ml_name); + for (i = 0; swig_const_table[i].name != 0; ++i) + SwigPyBuiltin_AddPublicSymbol(public_interface, swig_const_table[i].name); +#endif + + SWIG_InstallConstants(d,swig_const_table); + + SWIG_Python_SetConstant(d, "ELEMENTDEFINITION_UNBOUNDED",SWIG_From_unsigned_SS_int((unsigned int)(BLPAPI_ELEMENTDEFINITION_UNBOUNDED))); + SWIG_Python_SetConstant(d, "ELEMENT_INDEX_END",SWIG_From_size_t((size_t)(BLPAPI_ELEMENT_INDEX_END))); + SWIG_Python_SetConstant(d, "SERVICEREGISTRATIONOPTIONS_PRIORITY_MEDIUM",SWIG_From_int((int)(INT_MAX/2))); + SWIG_Python_SetConstant(d, "SERVICEREGISTRATIONOPTIONS_PRIORITY_HIGH",SWIG_From_int((int)(INT_MAX))); + SWIG_Python_SetConstant(d, "CORRELATION_TYPE_UNSET",SWIG_From_int((int)(0))); + SWIG_Python_SetConstant(d, "CORRELATION_TYPE_INT",SWIG_From_int((int)(1))); + SWIG_Python_SetConstant(d, "CORRELATION_TYPE_POINTER",SWIG_From_int((int)(2))); + SWIG_Python_SetConstant(d, "CORRELATION_TYPE_AUTOGEN",SWIG_From_int((int)(3))); + SWIG_Python_SetConstant(d, "CORRELATION_MAX_CLASS_ID",SWIG_From_int((int)(((1 << 16) -1)))); + SWIG_Python_SetConstant(d, "MANAGEDPTR_COPY",SWIG_From_int((int)(1))); + SWIG_Python_SetConstant(d, "MANAGEDPTR_DESTROY",SWIG_From_int((int)((-1)))); + SWIG_Python_SetConstant(d, "DATETIME_YEAR_PART",SWIG_From_int((int)(0x1))); + SWIG_Python_SetConstant(d, "DATETIME_MONTH_PART",SWIG_From_int((int)(0x2))); + SWIG_Python_SetConstant(d, "DATETIME_DAY_PART",SWIG_From_int((int)(0x4))); + SWIG_Python_SetConstant(d, "DATETIME_OFFSET_PART",SWIG_From_int((int)(0x8))); + SWIG_Python_SetConstant(d, "DATETIME_HOURS_PART",SWIG_From_int((int)(0x10))); + SWIG_Python_SetConstant(d, "DATETIME_MINUTES_PART",SWIG_From_int((int)(0x20))); + SWIG_Python_SetConstant(d, "DATETIME_SECONDS_PART",SWIG_From_int((int)(0x40))); + SWIG_Python_SetConstant(d, "DATETIME_MILLISECONDS_PART",SWIG_From_int((int)(0x80))); + SWIG_Python_SetConstant(d, "DATETIME_FRACSECONDS_PART",SWIG_From_int((int)(0x80))); + SWIG_Python_SetConstant(d, "DATETIME_DATE_PART",SWIG_From_int((int)((0x1|0x2|0x4)))); + SWIG_Python_SetConstant(d, "DATETIME_TIME_PART",SWIG_From_int((int)((0x10|0x20|0x40)))); + SWIG_Python_SetConstant(d, "DATETIME_TIMEMILLI_PART",SWIG_From_int((int)(((0x10|0x20|0x40)|0x80)))); + SWIG_Python_SetConstant(d, "DATETIME_TIMEFRACSECONDS_PART",SWIG_From_int((int)(((0x10|0x20|0x40)|0x80)))); + SWIG_Python_SetConstant(d, "EVENTTYPE_ADMIN",SWIG_From_int((int)(1))); + SWIG_Python_SetConstant(d, "EVENTTYPE_SESSION_STATUS",SWIG_From_int((int)(2))); + SWIG_Python_SetConstant(d, "EVENTTYPE_SUBSCRIPTION_STATUS",SWIG_From_int((int)(3))); + SWIG_Python_SetConstant(d, "EVENTTYPE_REQUEST_STATUS",SWIG_From_int((int)(4))); + SWIG_Python_SetConstant(d, "EVENTTYPE_RESPONSE",SWIG_From_int((int)(5))); + SWIG_Python_SetConstant(d, "EVENTTYPE_PARTIAL_RESPONSE",SWIG_From_int((int)(6))); + SWIG_Python_SetConstant(d, "EVENTTYPE_SUBSCRIPTION_DATA",SWIG_From_int((int)(8))); + SWIG_Python_SetConstant(d, "EVENTTYPE_SERVICE_STATUS",SWIG_From_int((int)(9))); + SWIG_Python_SetConstant(d, "EVENTTYPE_TIMEOUT",SWIG_From_int((int)(10))); + SWIG_Python_SetConstant(d, "EVENTTYPE_AUTHORIZATION_STATUS",SWIG_From_int((int)(11))); + SWIG_Python_SetConstant(d, "EVENTTYPE_RESOLUTION_STATUS",SWIG_From_int((int)(12))); + SWIG_Python_SetConstant(d, "EVENTTYPE_TOPIC_STATUS",SWIG_From_int((int)(13))); + SWIG_Python_SetConstant(d, "EVENTTYPE_TOKEN_STATUS",SWIG_From_int((int)(14))); + SWIG_Python_SetConstant(d, "EVENTTYPE_REQUEST",SWIG_From_int((int)(15))); + SWIG_Python_SetConstant(d, "STATUS_ACTIVE",SWIG_From_int((int)(0))); + SWIG_Python_SetConstant(d, "STATUS_DEPRECATED",SWIG_From_int((int)(1))); + SWIG_Python_SetConstant(d, "STATUS_INACTIVE",SWIG_From_int((int)(2))); + SWIG_Python_SetConstant(d, "STATUS_PENDING_DEPRECATION",SWIG_From_int((int)(3))); + SWIG_Python_SetConstant(d, "SUBSCRIPTIONSTATUS_UNSUBSCRIBED",SWIG_From_int((int)(0))); + SWIG_Python_SetConstant(d, "SUBSCRIPTIONSTATUS_SUBSCRIBING",SWIG_From_int((int)(1))); + SWIG_Python_SetConstant(d, "SUBSCRIPTIONSTATUS_SUBSCRIBED",SWIG_From_int((int)(2))); + SWIG_Python_SetConstant(d, "SUBSCRIPTIONSTATUS_CANCELLED",SWIG_From_int((int)(3))); + SWIG_Python_SetConstant(d, "SUBSCRIPTIONSTATUS_PENDING_CANCELLATION",SWIG_From_int((int)(4))); + SWIG_Python_SetConstant(d, "CLIENTMODE_AUTO",SWIG_From_int((int)(0))); + SWIG_Python_SetConstant(d, "CLIENTMODE_DAPI",SWIG_From_int((int)(1))); + SWIG_Python_SetConstant(d, "CLIENTMODE_SAPI",SWIG_From_int((int)(2))); + SWIG_Python_SetConstant(d, "CLIENTMODE_COMPAT_33X",SWIG_From_int((int)(16))); + SWIG_Python_SetConstant(d, "RESOLVEMODE_DONT_REGISTER_SERVICES",SWIG_From_int((int)(0))); + SWIG_Python_SetConstant(d, "RESOLVEMODE_AUTO_REGISTER_SERVICES",SWIG_From_int((int)(1))); + SWIG_Python_SetConstant(d, "SEATTYPE_INVALID_SEAT",SWIG_From_int((int)(-1))); + SWIG_Python_SetConstant(d, "SEATTYPE_BPS",SWIG_From_int((int)(0))); + SWIG_Python_SetConstant(d, "SEATTYPE_NONBPS",SWIG_From_int((int)(1))); + SWIG_Python_SetConstant(d, "SERVICEREGISTRATIONOPTIONS_PRIORITY_LOW",SWIG_From_int((int)(0))); + SWIG_Python_SetConstant(d, "REGISTRATIONPARTS_DEFAULT",SWIG_From_int((int)(0x1))); + SWIG_Python_SetConstant(d, "REGISTRATIONPARTS_PUBLISHING",SWIG_From_int((int)(0x2))); + SWIG_Python_SetConstant(d, "REGISTRATIONPARTS_OPERATIONS",SWIG_From_int((int)(0x4))); + SWIG_Python_SetConstant(d, "REGISTRATIONPARTS_SUBSCRIBER_RESOLUTION",SWIG_From_int((int)(0x8))); + SWIG_Python_SetConstant(d, "REGISTRATIONPARTS_PUBLISHER_RESOLUTION",SWIG_From_int((int)(0x10))); + SWIG_Python_SetConstant(d, "TOPICLIST_NOT_CREATED",SWIG_From_int((int)(0))); + SWIG_Python_SetConstant(d, "TOPICLIST_CREATED",SWIG_From_int((int)(1))); + SWIG_Python_SetConstant(d, "TOPICLIST_FAILURE",SWIG_From_int((int)(2))); + SWIG_Python_SetConstant(d, "RESOLUTIONLIST_UNRESOLVED",SWIG_From_int((int)(0))); + SWIG_Python_SetConstant(d, "RESOLUTIONLIST_RESOLVED",SWIG_From_int((int)(1))); + SWIG_Python_SetConstant(d, "RESOLUTIONLIST_RESOLUTION_FAILURE_BAD_SERVICE",SWIG_From_int((int)(2))); + SWIG_Python_SetConstant(d, "RESOLUTIONLIST_RESOLUTION_FAILURE_SERVICE_AUTHORIZATION_FAILED",SWIG_From_int((int)(3))); + SWIG_Python_SetConstant(d, "RESOLUTIONLIST_RESOLUTION_FAILURE_BAD_TOPIC",SWIG_From_int((int)(4))); + SWIG_Python_SetConstant(d, "RESOLUTIONLIST_RESOLUTION_FAILURE_TOPIC_AUTHORIZATION_FAILED",SWIG_From_int((int)(5))); + SWIG_Python_SetConstant(d, "MESSAGE_FRAGMENT_NONE",SWIG_From_int((int)(0))); + SWIG_Python_SetConstant(d, "MESSAGE_FRAGMENT_START",SWIG_From_int((int)(1))); + SWIG_Python_SetConstant(d, "MESSAGE_FRAGMENT_INTERMEDIATE",SWIG_From_int((int)(2))); + SWIG_Python_SetConstant(d, "MESSAGE_FRAGMENT_END",SWIG_From_int((int)(3))); + SWIG_Python_SetConstant(d, "MESSAGE_RECAPTYPE_NONE",SWIG_From_int((int)(0))); + SWIG_Python_SetConstant(d, "MESSAGE_RECAPTYPE_SOLICITED",SWIG_From_int((int)(1))); + SWIG_Python_SetConstant(d, "MESSAGE_RECAPTYPE_UNSOLICITED",SWIG_From_int((int)(2))); + SWIG_Python_SetConstant(d, "ZFPUTIL_REMOTE_8194",SWIG_From_int((int)(8194))); + SWIG_Python_SetConstant(d, "ZFPUTIL_REMOTE_8196",SWIG_From_int((int)(8196))); + SWIG_Python_SetConstant(d, "DATATYPE_BOOL",SWIG_From_int((int)(BLPAPI_DATATYPE_BOOL))); + SWIG_Python_SetConstant(d, "DATATYPE_CHAR",SWIG_From_int((int)(BLPAPI_DATATYPE_CHAR))); + SWIG_Python_SetConstant(d, "DATATYPE_BYTE",SWIG_From_int((int)(BLPAPI_DATATYPE_BYTE))); + SWIG_Python_SetConstant(d, "DATATYPE_INT32",SWIG_From_int((int)(BLPAPI_DATATYPE_INT32))); + SWIG_Python_SetConstant(d, "DATATYPE_INT64",SWIG_From_int((int)(BLPAPI_DATATYPE_INT64))); + SWIG_Python_SetConstant(d, "DATATYPE_FLOAT32",SWIG_From_int((int)(BLPAPI_DATATYPE_FLOAT32))); + SWIG_Python_SetConstant(d, "DATATYPE_FLOAT64",SWIG_From_int((int)(BLPAPI_DATATYPE_FLOAT64))); + SWIG_Python_SetConstant(d, "DATATYPE_STRING",SWIG_From_int((int)(BLPAPI_DATATYPE_STRING))); + SWIG_Python_SetConstant(d, "DATATYPE_BYTEARRAY",SWIG_From_int((int)(BLPAPI_DATATYPE_BYTEARRAY))); + SWIG_Python_SetConstant(d, "DATATYPE_DATE",SWIG_From_int((int)(BLPAPI_DATATYPE_DATE))); + SWIG_Python_SetConstant(d, "DATATYPE_TIME",SWIG_From_int((int)(BLPAPI_DATATYPE_TIME))); + SWIG_Python_SetConstant(d, "DATATYPE_DECIMAL",SWIG_From_int((int)(BLPAPI_DATATYPE_DECIMAL))); + SWIG_Python_SetConstant(d, "DATATYPE_DATETIME",SWIG_From_int((int)(BLPAPI_DATATYPE_DATETIME))); + SWIG_Python_SetConstant(d, "DATATYPE_ENUMERATION",SWIG_From_int((int)(BLPAPI_DATATYPE_ENUMERATION))); + SWIG_Python_SetConstant(d, "DATATYPE_SEQUENCE",SWIG_From_int((int)(BLPAPI_DATATYPE_SEQUENCE))); + SWIG_Python_SetConstant(d, "DATATYPE_CHOICE",SWIG_From_int((int)(BLPAPI_DATATYPE_CHOICE))); + SWIG_Python_SetConstant(d, "DATATYPE_CORRELATION_ID",SWIG_From_int((int)(BLPAPI_DATATYPE_CORRELATION_ID))); + SWIG_Python_SetConstant(d, "blpapi_Logging_SEVERITY_OFF",SWIG_From_int((int)(blpapi_Logging_SEVERITY_OFF))); + SWIG_Python_SetConstant(d, "blpapi_Logging_SEVERITY_FATAL",SWIG_From_int((int)(blpapi_Logging_SEVERITY_FATAL))); + SWIG_Python_SetConstant(d, "blpapi_Logging_SEVERITY_ERROR",SWIG_From_int((int)(blpapi_Logging_SEVERITY_ERROR))); + SWIG_Python_SetConstant(d, "blpapi_Logging_SEVERITY_WARN",SWIG_From_int((int)(blpapi_Logging_SEVERITY_WARN))); + SWIG_Python_SetConstant(d, "blpapi_Logging_SEVERITY_INFO",SWIG_From_int((int)(blpapi_Logging_SEVERITY_INFO))); + SWIG_Python_SetConstant(d, "blpapi_Logging_SEVERITY_DEBUG",SWIG_From_int((int)(blpapi_Logging_SEVERITY_DEBUG))); + SWIG_Python_SetConstant(d, "blpapi_Logging_SEVERITY_TRACE",SWIG_From_int((int)(blpapi_Logging_SEVERITY_TRACE))); + SWIG_Python_SetConstant(d, "UNKNOWN_CLASS",SWIG_From_int((int)(0x00000))); + SWIG_Python_SetConstant(d, "INVALIDSTATE_CLASS",SWIG_From_int((int)(0x10000))); + SWIG_Python_SetConstant(d, "INVALIDARG_CLASS",SWIG_From_int((int)(0x20000))); + SWIG_Python_SetConstant(d, "IOERROR_CLASS",SWIG_From_int((int)(0x30000))); + SWIG_Python_SetConstant(d, "CNVERROR_CLASS",SWIG_From_int((int)(0x40000))); + SWIG_Python_SetConstant(d, "BOUNDSERROR_CLASS",SWIG_From_int((int)(0x50000))); + SWIG_Python_SetConstant(d, "NOTFOUND_CLASS",SWIG_From_int((int)(0x60000))); + SWIG_Python_SetConstant(d, "FLDNOTFOUND_CLASS",SWIG_From_int((int)(0x70000))); + SWIG_Python_SetConstant(d, "UNSUPPORTED_CLASS",SWIG_From_int((int)(0x80000))); + SWIG_Python_SetConstant(d, "ERROR_UNKNOWN",SWIG_From_int((int)((0x00000|1)))); + SWIG_Python_SetConstant(d, "ERROR_ILLEGAL_ARG",SWIG_From_int((int)((0x20000|2)))); + SWIG_Python_SetConstant(d, "ERROR_ILLEGAL_ACCESS",SWIG_From_int((int)((0x00000|3)))); + SWIG_Python_SetConstant(d, "ERROR_INVALID_SESSION",SWIG_From_int((int)((0x20000|4)))); + SWIG_Python_SetConstant(d, "ERROR_DUPLICATE_CORRELATIONID",SWIG_From_int((int)((0x20000|5)))); + SWIG_Python_SetConstant(d, "ERROR_INTERNAL_ERROR",SWIG_From_int((int)((0x00000|6)))); + SWIG_Python_SetConstant(d, "ERROR_RESOLVE_FAILED",SWIG_From_int((int)((0x30000|7)))); + SWIG_Python_SetConstant(d, "ERROR_CONNECT_FAILED",SWIG_From_int((int)((0x30000|8)))); + SWIG_Python_SetConstant(d, "ERROR_ILLEGAL_STATE",SWIG_From_int((int)((0x10000|9)))); + SWIG_Python_SetConstant(d, "ERROR_CODEC_FAILURE",SWIG_From_int((int)((0x00000|10)))); + SWIG_Python_SetConstant(d, "ERROR_INDEX_OUT_OF_RANGE",SWIG_From_int((int)((0x50000|11)))); + SWIG_Python_SetConstant(d, "ERROR_INVALID_CONVERSION",SWIG_From_int((int)((0x40000|12)))); + SWIG_Python_SetConstant(d, "ERROR_ITEM_NOT_FOUND",SWIG_From_int((int)((0x60000|13)))); + SWIG_Python_SetConstant(d, "ERROR_IO_ERROR",SWIG_From_int((int)((0x30000|14)))); + SWIG_Python_SetConstant(d, "ERROR_CORRELATION_NOT_FOUND",SWIG_From_int((int)((0x60000|15)))); + SWIG_Python_SetConstant(d, "ERROR_SERVICE_NOT_FOUND",SWIG_From_int((int)((0x60000|16)))); + SWIG_Python_SetConstant(d, "ERROR_LOGON_LOOKUP_FAILED",SWIG_From_int((int)((0x00000|17)))); + SWIG_Python_SetConstant(d, "ERROR_DS_LOOKUP_FAILED",SWIG_From_int((int)((0x00000|18)))); + SWIG_Python_SetConstant(d, "ERROR_UNSUPPORTED_OPERATION",SWIG_From_int((int)((0x80000|19)))); + SWIG_Python_SetConstant(d, "ERROR_DS_PROPERTY_NOT_FOUND",SWIG_From_int((int)((0x60000|20)))); + + /* Initialize threading */ + SWIG_PYTHON_INITIALIZE_THREADS; +#if PY_VERSION_HEX >= 0x03000000 + return m; +#else + return; +#endif +} + diff --git a/blpapi/logging.py b/blpapi/logging.py index b7bddac..1bb9061 100644 --- a/blpapi/logging.py +++ b/blpapi/logging.py @@ -1,9 +1,9 @@ # coding: utf-8 -#@PURPOSE: Provide a C call to register a call back for logging -# -#@DESCRIPTION: This component provides a function that is used to -# register a callback for logging +"""@PURPOSE: Provide a C call to register a call back for logging + +@DESCRIPTION: This component provides a function that is used to + register a callback for logging""" from __future__ import absolute_import from datetime import datetime @@ -17,31 +17,37 @@ class Logger: logging configuration.""" # Different logging levels - SEVERITY_OFF = internals.blpapi_Logging_SEVERITY_OFF + SEVERITY_OFF = internals.blpapi_Logging_SEVERITY_OFF SEVERITY_FATAL = internals.blpapi_Logging_SEVERITY_FATAL SEVERITY_ERROR = internals.blpapi_Logging_SEVERITY_ERROR - SEVERITY_WARN = internals.blpapi_Logging_SEVERITY_WARN - SEVERITY_INFO = internals.blpapi_Logging_SEVERITY_INFO + SEVERITY_WARN = internals.blpapi_Logging_SEVERITY_WARN + SEVERITY_INFO = internals.blpapi_Logging_SEVERITY_INFO SEVERITY_DEBUG = internals.blpapi_Logging_SEVERITY_DEBUG SEVERITY_TRACE = internals.blpapi_Logging_SEVERITY_TRACE @staticmethod - def registerCallback(callback, thresholdSeverity=internals.blpapi_Logging_SEVERITY_INFO): + def registerCallback(callback, thresholdSeverity=Logger.SEVERITY_INFO): """Register the specified 'callback' that will be called for all log messages with severity greater than or equal to the specified 'thresholdSeverity'. The callback needs to be registered before the start of all sessions. If this function is called multiple times, only the last registered callback will take effect. An exception of type 'RuntimeError' will be thrown if 'callback' cannot be registered.""" - cb = callback def callbackWrapper(threadId, severity, ts, category, message): dt = datetime.fromtimestamp(ts) callback(threadId, severity, dt, category, message) - internals.setLoggerCallbackWrapper(callbackWrapper, thresholdSeverity) + err_code = internals.setLoggerCallbackWrapper( + callbackWrapper, thresholdSeverity) + + if err_code == -1: + raise ValueError("parameter must be a function") + elif err_code == -2: + raise RuntimeError("unable to register callback") @staticmethod def logTestMessage(severity): - """Log a test message at the specified 'severity'. Note that this function - is intended for testing of the logging configuration only.""" + """Log a test message at the specified 'severity'. + Note that this function is intended for testing + of the logging configuration only.""" internals.blpapi_Logging_logTestMessage(severity) diff --git a/blpapi/message.py b/blpapi/message.py index eb3add6..402f083 100644 --- a/blpapi/message.py +++ b/blpapi/message.py @@ -9,18 +9,19 @@ from __future__ import absolute_import +import sys +import weakref +from blpapi.datetime import _DatetimeUtil, UTC from .element import Element from .name import Name from . import internals from . import utils from .compat import with_metaclass -import datetime -import weakref -from blpapi.datetime import _DatetimeUtil, UTC + +# pylint: disable=useless-object-inheritance,protected-access # Handling a circular dependancy between modules: # service->event->message->service -import sys service = sys.modules.get('blpapi.service') if service is None: from . import service @@ -215,7 +216,13 @@ def timeReceived(self, tzinfo=UTC): will be represented using the specified 'tzinfo' value, and will be measured using a high-resolution clock internal to the SDK; see 'highresclock' for more information on this clock.""" - original = internals.blpapi_Message_timeReceived_wrapper(self.__handle) + err_code, time_point = internals.blpapi_Message_timeReceived( + self.__handle) + if err_code != 0: + raise ValueError("Message has no timestamp") + original = internals.blpapi_HighPrecisionDatetime_fromTimePoint_wrapper( + time_point) + native = _DatetimeUtil.convertToNative(original) return native.astimezone(tzinfo) diff --git a/blpapi/name.py b/blpapi/name.py index 381cb80..4d2d7cd 100644 --- a/blpapi/name.py +++ b/blpapi/name.py @@ -7,12 +7,11 @@ """ - - from . import internals -import sys from .compat import conv2str, tolong, isstr +from .utils import get_handle +# pylint: disable=useless-object-inheritance,broad-except class Name(object): """Name represents a string in a form which is efficient for comparison. @@ -61,7 +60,7 @@ def findName(nameString): def hasName(nameString): """Return True if a Name object representing 'nameString' exists. """ - return internals.blpapi_Name_hasName(nameString) + return bool(internals.blpapi_Name_hasName(nameString)) @staticmethod def _createInternally(handle): @@ -105,9 +104,8 @@ def __eq__(self, other): s = conv2str(other) if s is not None: p = internals.blpapi_Name_equalsStr(self.__handle, s) - return 0 != p - else: - return self.__handle == other.__handle + return p != 0 + return self.__handle == get_handle(other) except Exception: return NotImplemented @@ -133,12 +131,11 @@ def getNamePair(name): """ if isinstance(name, Name): - return (None, name._handle()) - elif isstr(name): + return (None, get_handle(name)) + if isstr(name): return (conv2str(name), None) - else: - raise TypeError( - "name should be an instance of a string or blpapi.Name") + raise TypeError( + "name should be an instance of a string or blpapi.Name") __copyright__ = """ Copyright 2012. Bloomberg Finance L.P. diff --git a/blpapi/providersession.py b/blpapi/providersession.py index 820f884..75fea8c 100644 --- a/blpapi/providersession.py +++ b/blpapi/providersession.py @@ -76,7 +76,8 @@ from .utils import get_handle from .compat import with_metaclass -# pylint: disable=line-too-long,bad-continuation +# pylint: disable=line-too-long,bad-continuation,useless-object-inheritance +# pylint: disable=protected-access,too-many-public-methods,bare-except,too-many-function-args @with_metaclass(utils.MetaClassForClassesWithEnums) class ServiceRegistrationOptions(object): @@ -366,7 +367,12 @@ def flushPublishedEvents(self, timeoutMsecs): a non-negative value. When 'timeoutMsecs' is 0, the method checks if all the published events have been sent and returns without waiting.""" - return internals.ProviderSession_flushPublishedEvents(self.__handle, timeoutMsecs) + + err_code, allFlushed = internals.blpapi_ProviderSession_flushPublishedEvents(self.__handle, timeoutMsecs) + if err_code != 0: + raise RuntimeError("Flush published events failed") + + return allFlushed != 0 def stop(self): """Stop operation of this session and wait until it stops. diff --git a/blpapi/request.py b/blpapi/request.py index 100f318..88c7b9e 100644 --- a/blpapi/request.py +++ b/blpapi/request.py @@ -7,12 +7,11 @@ """ - - +import weakref from .element import Element from . import internals -import weakref +# pylint: disable=useless-object-inheritance class Request(object): """A single request to a single service. diff --git a/blpapi/requesttemplate.py b/blpapi/requesttemplate.py index 5140680..3f40c9c 100644 --- a/blpapi/requesttemplate.py +++ b/blpapi/requesttemplate.py @@ -19,6 +19,8 @@ from . import internals +# pylint: disable=useless-object-inheritance + class RequestTemplate(object): """Request templates cache the necessary information to make a request and eliminate the need to create new requests for snapshot services. diff --git a/blpapi/resolutionlist.py b/blpapi/resolutionlist.py index ef6d5ad..94544e6 100644 --- a/blpapi/resolutionlist.py +++ b/blpapi/resolutionlist.py @@ -5,25 +5,25 @@ This component implements a list of topics that require resolution. """ - - from .element import Element from .exception import _ExceptionUtil from .message import Message from .name import Name from . import internals from . import utils +from .utils import get_handle from .internals import CorrelationId from .compat import with_metaclass +# pylint: disable=useless-object-inheritance @with_metaclass(utils.MetaClassForClassesWithEnums) class ResolutionList(object): """Contains a list of topics that require resolution. Created from topic strings or from SUBSCRIPTION_STARTED messages. This is - passed to a 'resolve()' call or 'resolveAsync()' call on a 'ProviderSession'. It - is updated and returned by the 'resolve()' call. + passed to a 'resolve()' call or 'resolveAsync()' call on a + 'ProviderSession'. It is updated and returned by the 'resolve()' call. """ UNRESOLVED = internals.RESOLUTIONLIST_UNRESOLVED @@ -45,14 +45,14 @@ def extractAttributeFromResolutionSuccess(message, attribute): Return the value of the value in the specified 'message' which represents the specified 'attribute'. The 'message' must be a message of type "RESOLUTION_SUCCESS". The 'attribute' should be an attribute - that was requested using 'addAttribute()' on the ResolutionList passed to - the 'resolve()' or 'resolveAsync()' that caused this RESOLUTION_SUCCESS - message. If the 'attribute' is not present an empty Element is - returned. + that was requested using 'addAttribute()' on the ResolutionList passed + to the 'resolve()' or 'resolveAsync()' that caused + this RESOLUTION_SUCCESS message. + If the 'attribute' is not present an empty Element is returned. """ i = internals # to fit next line in 79 chars res = i.blpapi_ResolutionList_extractAttributeFromResolutionSuccess( - message._handle(), attribute._handle()) + get_handle(message), get_handle(attribute)) return Element(res, message) def __init__(self): @@ -98,13 +98,12 @@ def add(self, topicOrMessage, correlationId=None): if isinstance(topicOrMessage, Message): return internals.blpapi_ResolutionList_addFromMessage( self.__handle, - topicOrMessage._handle(), - correlationId._handle()) - else: - return internals.blpapi_ResolutionList_add( - self.__handle, - topicOrMessage, - correlationId._handle()) + get_handle(topicOrMessage), + get_handle(correlationId)) + return internals.blpapi_ResolutionList_add( + self.__handle, + topicOrMessage, + get_handle(correlationId)) def addAttribute(self, attribute): """Add the specified 'attribute' to the list of attributes. @@ -115,7 +114,7 @@ def addAttribute(self, attribute): """ attribute = Name(attribute) return internals.blpapi_ResolutionList_addAttribute( - self.__handle, attribute._handle()) + self.__handle, get_handle(attribute)) def correlationIdAt(self, index): """Return the CorrelationId at the specified 'index'. @@ -138,7 +137,7 @@ def topicString(self, correlationId): """ errorCode, topic = internals.blpapi_ResolutionList_topicString( self.__handle, - correlationId._handle()) + get_handle(correlationId)) _ExceptionUtil.raiseOnError(errorCode) return topic @@ -168,7 +167,7 @@ def status(self, correlationId): """ errorCode, status = internals.blpapi_ResolutionList_status( self.__handle, - correlationId._handle()) + get_handle(correlationId)) _ExceptionUtil.raiseOnError(errorCode) return status @@ -202,8 +201,8 @@ def attribute(self, attribute, correlationId): attribute = Name(attribute) errorCode, element = internals.blpapi_ResolutionList_attribute( self.__handle, - attribute._handle(), - correlationId._handle()) + get_handle(attribute), + get_handle(correlationId)) _ExceptionUtil.raiseOnError(errorCode) @@ -221,7 +220,7 @@ def attributeAt(self, attribute, index): attribute = Name(attribute) errorCode, element = internals.blpapi_ResolutionList_attributeAt( self.__handle, - attribute._handle(), + get_handle(attribute), index) _ExceptionUtil.raiseOnError(errorCode) @@ -241,7 +240,7 @@ def message(self, correlationId): """ errorCode, message = internals.blpapi_ResolutionList_message( self.__handle, - correlationId._handle()) + get_handle(correlationId)) _ExceptionUtil.raiseOnError(errorCode) return Message(message, sessions=self.__sessions) diff --git a/blpapi/schema.py b/blpapi/schema.py index 6d06bbb..5e5eadb 100644 --- a/blpapi/schema.py +++ b/blpapi/schema.py @@ -18,8 +18,6 @@ """ - - from .exception import NotFoundException, IndexOutOfRangeException from .name import Name, getNamePair from .constant import ConstantList @@ -27,6 +25,7 @@ from . import internals from .compat import with_metaclass +# pylint: disable=useless-object-inheritance,protected-access,too-few-public-methods @with_metaclass(utils.MetaClassForClassesWithEnums) class SchemaStatus(object): @@ -34,24 +33,23 @@ class SchemaStatus(object): Class attributes: - ACTIVE This item is current and may appear in Messages - DEPRECATED This item is current and may appear in Messages but will - be removed in due course - INACTIVE This item is not current and will not appear in Messages - PENDING_DEPRECATION This item is expected to be deprecated in the - future; clients are advised to migrate away from use of - this item. - + ACTIVE: + This item is current and may appear in Messages + DEPRECATED: + This item is current and may appear in Messages + but will be removed in due course + INACTIVE: + This item is not current and will not appear in Messages + PENDING_DEPRECATION: + This item is expected to be deprecated in the + future; clients are advised to migrate away from use of + this item. """ ACTIVE = internals.STATUS_ACTIVE - """This item is current and may appear in Messages""" DEPRECATED = internals.STATUS_DEPRECATED - """This item is current and may appear in Messages but will be removed""" INACTIVE = internals.STATUS_INACTIVE - """This item is not current and will not appear in Messages""" PENDING_DEPRECATION = internals.STATUS_PENDING_DEPRECATION - """This item is expected to be deprecated in the future""" @with_metaclass(utils.MetaClassForClassesWithEnums) @@ -329,10 +327,10 @@ def hasElementDefinition(self, name): """ name = getNamePair(name) - return internals.blpapi_SchemaTypeDefinition_hasElementDefinition( + return bool(internals.blpapi_SchemaTypeDefinition_hasElementDefinition( self.__handle, name[0], - name[1]) + name[1])) def getElementDefinition(self, nameOrIndex): """Return the definition of a specified element. diff --git a/blpapi/service.py b/blpapi/service.py index 80f1bcc..ab597fd 100644 --- a/blpapi/service.py +++ b/blpapi/service.py @@ -8,17 +8,16 @@ """ - - - from .event import Event from .name import getNamePair from .request import Request from .schema import SchemaElementDefinition from .exception import _ExceptionUtil from . import utils +from .utils import get_handle from . import internals +# pylint: disable=useless-object-inheritance class Operation(object): """Defines an operation which can be performed by a Service. @@ -51,7 +50,7 @@ def requestDefinition(self): errCode, definition = internals.blpapi_Operation_requestDefinition( self.__handle) - return None if 0 != errCode else\ + return None if errCode != 0 else\ SchemaElementDefinition(definition, self.__sessions) def numResponseDefinitions(self): @@ -186,7 +185,7 @@ def createResponseEvent(self, correlationId): errCode, event = internals.blpapi_Service_createResponseEvent( self.__handle, - correlationId._handle()) + get_handle(correlationId)) _ExceptionUtil.raiseOnError(errCode) return Event(event, self.__sessions) @@ -207,9 +206,9 @@ def hasOperation(self, name): """ names = getNamePair(name) - return internals.blpapi_Service_hasOperation(self.__handle, - names[0], - names[1]) + return bool(internals.blpapi_Service_hasOperation(self.__handle, + names[0], + names[1])) def getOperation(self, nameOrIndex): """Return a specified operation. @@ -255,9 +254,9 @@ def hasEventDefinition(self, name): """ names = getNamePair(name) - return internals.blpapi_Service_hasEventDefinition(self.__handle, - names[0], - names[1]) + return bool(internals.blpapi_Service_hasEventDefinition(self.__handle, + names[0], + names[1])) def getEventDefinition(self, nameOrIndex): """Return the definition of a specified event. diff --git a/blpapi/session.py b/blpapi/session.py index 7ecca79..cbb2dc2 100644 --- a/blpapi/session.py +++ b/blpapi/session.py @@ -20,7 +20,9 @@ from .internals import CorrelationId from .sessionoptions import SessionOptions from .requesttemplate import RequestTemplate +from .utils import get_handle +# pylint: disable=too-many-arguments,protected-access,bare-except class Session(AbstractSession): """Consumer session for making requests for Bloomberg services. @@ -94,6 +96,7 @@ class Session(AbstractSession): @staticmethod def __dispatchEvent(sessionRef, eventHandle): + """ event dispatcher """ try: session = sessionRef() if session is not None: @@ -156,9 +159,9 @@ def __init__(self, options=None, eventHandler=None, eventDispatcher=None): self.__handlerProxy = functools.partial(Session.__dispatchEvent, weakref.ref(self)) self.__handle = internals.Session_createHelper( - options._handle(), + get_handle(options), self.__handlerProxy, - None if eventDispatcher is None else eventDispatcher._handle()) + get_handle(eventDispatcher)) AbstractSession.__init__( self, internals.blpapi_Session_getAbstractSession(self.__handle)) @@ -255,8 +258,7 @@ def tryNextEvent(self): retCode, event = internals.blpapi_Session_tryNextEvent(self.__handle) if retCode: return None - else: - return Event(event, self) + return Event(event, self) def subscribe(self, subscriptionList, identity=None, requestLabel=""): """Begin subscriptions for each entry in the specified list. @@ -273,8 +275,8 @@ def subscribe(self, subscriptionList, identity=None, requestLabel=""): """ _ExceptionUtil.raiseOnError(internals.blpapi_Session_subscribe( self.__handle, - subscriptionList._handle(), - None if identity is None else identity._handle(), + get_handle(subscriptionList), + get_handle(identity), requestLabel, len(requestLabel))) @@ -301,11 +303,15 @@ def unsubscribe(self, subscriptionList): """ _ExceptionUtil.raiseOnError(internals.blpapi_Session_unsubscribe( self.__handle, - subscriptionList._handle(), + get_handle(subscriptionList), None, 0)) - def resubscribe(self, subscriptionList, requestLabel="", resubscriptionId=None): + def resubscribe( + self, + subscriptionList, + requestLabel="", + resubscriptionId=None): """Modify subscriptions in 'subscriptionList'. Modify each subscription in the specified 'subscriptionList', which @@ -325,17 +331,17 @@ def resubscribe(self, subscriptionList, requestLabel="", resubscriptionId=None): error = None if resubscriptionId is None: error = internals.blpapi_Session_resubscribe( - self.__handle, - subscriptionList._handle(), - requestLabel, - len(requestLabel)) + self.__handle, + get_handle(subscriptionList), + requestLabel, + len(requestLabel)) else: error = internals.blpapi_Session_resubscribeWithId( - self.__handle, - subscriptionList._handle(), - resubscriptionId, - requestLabel, - len(requestLabel)) + self.__handle, + get_handle(subscriptionList), + resubscriptionId, + requestLabel, + len(requestLabel)) _ExceptionUtil.raiseOnError(error) @@ -349,9 +355,9 @@ def setStatusCorrelationId(self, service, correlationId, identity=None): _ExceptionUtil.raiseOnError( internals.blpapi_Session_setStatusCorrelationId( self.__handle, - service._handle(), - None if identity is None else identity._handle(), - correlationId._handle())) + get_handle(service), + get_handle(identity), + get_handle(correlationId))) def sendRequest(self, request, @@ -380,10 +386,10 @@ def sendRequest(self, correlationId = CorrelationId() res = internals.blpapi_Session_sendRequest( self.__handle, - request._handle(), - correlationId._handle(), - None if identity is None else identity._handle(), - None if eventQueue is None else eventQueue._handle(), + get_handle(request), + get_handle(correlationId), + get_handle(identity), + get_handle(eventQueue), requestLabel, len(requestLabel)) _ExceptionUtil.raiseOnError(res) @@ -396,7 +402,7 @@ def sendRequestTemplate(self, requestTemplate, correlationId=None): optionally specified 'correlationId' is supplied, use it otherwise create a new 'CorrelationId'. The actual 'CorrelationId' used is returned. - + A successful request will generate zero or more 'PARTIAL_RESPONSE' events followed by exactly one 'RESPONSE' event. Once the final 'RESPONSE' event has been received the 'CorrelationId' associated @@ -407,18 +413,19 @@ def sendRequestTemplate(self, requestTemplate, correlationId=None): if correlationId is None: correlationId = CorrelationId() res = internals.blpapi_Session_sendRequestTemplate( - self.__handle, - requestTemplate._handle(), - correlationId._handle()) + self.__handle, + get_handle(requestTemplate), + get_handle(correlationId)) _ExceptionUtil.raiseOnError(res) return correlationId - def createSnapshotRequestTemplate(self, - subscriptionString, - identity, - correlationId): + def createSnapshotRequestTemplate( + self, + subscriptionString, + identity, + correlationId): """Create a snapshot request template for getting subscription data - specified by the 'subscriptionString' using the specified 'identity' + specified by the 'subscriptionString' using the specified 'identity' if all the following conditions are met: the session is established, 'subscriptionString' is a valid subscription string and 'correlationId' is not used in this session. If one or more conditions @@ -479,10 +486,10 @@ def createSnapshotRequestTemplate(self, automatically when the last request gets a final response. """ rc, template = internals.blpapi_Session_createSnapshotRequestTemplate( - self.__handle, - subscriptionString, - identity._handle(), - correlationId._handle()) + self.__handle, + subscriptionString, + get_handle(identity), + get_handle(correlationId)) _ExceptionUtil.raiseOnError(rc) reqTemplate = RequestTemplate(template) return reqTemplate diff --git a/blpapi/sessionoptions.py b/blpapi/sessionoptions.py index a961f71..dbb8e4f 100644 --- a/blpapi/sessionoptions.py +++ b/blpapi/sessionoptions.py @@ -24,8 +24,10 @@ from .exception import _ExceptionUtil from . import internals from . import utils +from .utils import get_handle from .compat import with_metaclass +# pylint: disable=useless-object-inheritance,too-many-public-methods,line-too-long @with_metaclass(utils.MetaClassForClassesWithEnums) class SessionOptions(object): @@ -257,7 +259,7 @@ def setSlowConsumerWarningHiWaterMark(self, hiWaterMark): 'slowConsumerWarningLoWaterMark() * maxEventQueueSize()' < 'slowConsumerWarningHiWaterMark() * maxEventQueueSize()'.""" err = internals.blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark( - self.__handle, hiWaterMark) + self.__handle, hiWaterMark) _ExceptionUtil.raiseOnError(err) def setSlowConsumerWarningLoWaterMark(self, loWaterMark): @@ -271,7 +273,7 @@ def setSlowConsumerWarningLoWaterMark(self, loWaterMark): 'slowConsumerWarningLoWaterMark() * maxEventQueueSize()' < 'slowConsumerWarningHiWaterMark() * maxEventQueueSize()'.""" err = internals.blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark( - self.__handle, loWaterMark) + self.__handle, loWaterMark) _ExceptionUtil.raiseOnError(err) def setMaxEventQueueSize(self, eventQueueSize): @@ -280,8 +282,9 @@ def setMaxEventQueueSize(self, eventQueueSize): over the network will be dropped by the session if the number of outstanding undelivered events is 'eventQueueSize', the specified threshold. The default value is 10000.""" - internals.blpapi_SessionOptions_setMaxEventQueueSize(self.__handle, - eventQueueSize) + internals.blpapi_SessionOptions_setMaxEventQueueSize( + self.__handle, + eventQueueSize) def setKeepAliveEnabled(self, isEnabled): """If the specified 'isEnabled' is False, then disable all keep-alive @@ -293,7 +296,7 @@ def setKeepAliveEnabled(self, isEnabled): by the server configuration.""" keepAliveValue = 1 if isEnabled else 0 err = internals.blpapi_SessionOptions_setKeepAliveEnabled( - self.__handle, keepAliveValue) + self.__handle, keepAliveValue) _ExceptionUtil.raiseOnError(err) def setDefaultKeepAliveInactivityTime(self, inactivityMsecs): @@ -307,7 +310,7 @@ def setDefaultKeepAliveInactivityTime(self, inactivityMsecs): milliseconds. Note that not all back-end connections provide ping-based keep-alives; this option is ignored by such connections.""" err = internals.blpapi_SessionOptions_setDefaultKeepAliveInactivityTime( - self.__handle, inactivityMsecs) + self.__handle, inactivityMsecs) _ExceptionUtil.raiseOnError(err) def setDefaultKeepAliveResponseTimeout(self, timeoutMsecs): @@ -320,13 +323,13 @@ def setDefaultKeepAliveResponseTimeout(self, timeoutMsecs): Note that not all back-end connections provide support for ping-based keep-alives; this option is ignored by such connections.""" err = internals.blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout( - self.__handle, timeoutMsecs) + self.__handle, timeoutMsecs) _ExceptionUtil.raiseOnError(err) def setFlushPublishedEventsTimeout(self, timeoutMsecs): """Set the timeout, in milliseconds, for ProviderSession to flush published events before stopping. The behavior is not defined - unless the specified 'timeoutMsecs' is a positive value. The + unless the specified 'timeoutMsecs' is a positive value. The default value is 2000.""" internals.blpapi_SessionOptions_setFlushPublishedEventsTimeout( self.__handle, timeoutMsecs) @@ -337,15 +340,15 @@ def setRecordSubscriptionDataReceiveTimes(self, shouldRecord): messages. By default, the receipt time for these messages is not recorded.""" internals.blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes( - self.__handle, shouldRecord) + self.__handle, shouldRecord) def setServiceCheckTimeout(self, timeoutMsecs): - """Set the timeout, in milliseconds, when opening a service for checking - what version of the schema should be downloaded. The behavior is not - defined unless 'timeoutMsecs' is a positive value. The default timeout - is 60,000 milliseconds.""" + """Set the timeout, in milliseconds, when opening a service + for checking what version of the schema should be downloaded. + The behavior is not defined unless 'timeoutMsecs' is a positive value. + The default timeout is 60,000 milliseconds.""" err = internals.blpapi_SessionOptions_setServiceCheckTimeout( - self.__handle, timeoutMsecs) + self.__handle, timeoutMsecs) _ExceptionUtil.raiseOnError(err) def setServiceDownloadTimeout(self, timeoutMsecs): @@ -354,13 +357,14 @@ def setServiceDownloadTimeout(self, timeoutMsecs): specified 'timeoutMsecs' is a positive value. The default timeout is 120,000 milliseconds.""" err = internals.blpapi_SessionOptions_setServiceDownloadTimeout( - self.__handle, timeoutMsecs) + self.__handle, timeoutMsecs) _ExceptionUtil.raiseOnError(err) def setTlsOptions(self, tlsOptions): """Set the TLS options""" - internals.blpapi_SessionOptions_setTlsOptions(self.__handle, - tlsOptions._handle()) + internals.blpapi_SessionOptions_setTlsOptions( + self.__handle, + get_handle(tlsOptions)) def serverHost(self): """Return the server host option in this SessionOptions instance.""" @@ -382,8 +386,9 @@ def getServerAddress(self, index): """Return tuple of the server name and port indexed by 'index'.""" errorCode, host, port = \ - internals.blpapi_SessionOptions_getServerAddress(self.__handle, - index) + internals.blpapi_SessionOptions_getServerAddress( + self.__handle, + index) _ExceptionUtil.raiseOnError(errorCode) @@ -486,19 +491,19 @@ def recordSubscriptionDataReceiveTimes(self): 'blpapi.Message.timeReceived') should be recorded for subscription data messages.""" return internals.blpapi_SessionOptions_recordSubscriptionDataReceiveTimes( - self.__handle) + self.__handle) def slowConsumerWarningHiWaterMark(self): """Return the fraction of maxEventQueueSize at which "slow consumer" event will be generated.""" return internals.blpapi_SessionOptions_slowConsumerWarningHiWaterMark( - self.__handle) + self.__handle) def slowConsumerWarningLoWaterMark(self): """Return the fraction of maxEventQueueSize at which "slow consumer cleared" event will be generated.""" return internals.blpapi_SessionOptions_slowConsumerWarningLoWaterMark( - self.__handle) + self.__handle) def maxEventQueueSize(self): """Return the value of maximum outstanding undelivered events that the @@ -509,19 +514,19 @@ def defaultKeepAliveInactivityTime(self): """Return the interval (in milliseconds) a connection has to remain inactive (receive no data) before a keep alive probe will be sent.""" return internals.blpapi_SessionOptions_defaultKeepAliveInactivityTime( - self.__handle) + self.__handle) def defaultKeepAliveResponseTimeout(self): """Return the time (in milliseconds) the library will wait for response to a keep alive probe before declaring it lost.""" return internals.blpapi_SessionOptions_defaultKeepAliveResponseTimeout( - self.__handle) + self.__handle) def flushPublishedEventsTimeout(self): """Return the timeout, in milliseconds, for ProviderSession to flush published events before stopping. The default value is 2000.""" return internals.blpapi_SessionOptions_flushPublishedEventsTimeout( - self.__handle) + self.__handle) def keepAliveEnabled(self): """Return True if the keep-alive mechanism is enabled; otherwise @@ -531,12 +536,14 @@ def keepAliveEnabled(self): def serviceCheckTimeout(self): """Return the value of the service check timeout option in this SessionOptions instance in milliseconds.""" - return internals.blpapi_SessionOptions_serviceCheckTimeout(self.__handle) + return internals.blpapi_SessionOptions_serviceCheckTimeout( + self.__handle) def serviceDownloadTimeout(self): """Return the value of the service download timeout option in this SessionOptions instance in milliseconds.""" - return internals.blpapi_SessionOptions_serviceDownloadTimeout(self.__handle) + return internals.blpapi_SessionOptions_serviceDownloadTimeout( + self.__handle) def _handle(self): """Return the internal implementation.""" @@ -551,9 +558,10 @@ def toString(self, level=0, spacesPerLevel=4): 'spacesPerLevel' is negative, format the entire output on one line, suppressing all but the initial indentation (as governed by 'level'). """ - return internals.blpapi_SessionOptions_printHelper(self.__handle, - level, - spacesPerLevel) + return internals.blpapi_SessionOptions_printHelper( + self.__handle, + level, + spacesPerLevel) class TlsOptions(object): """SSL configuration options @@ -597,7 +605,8 @@ def setCrlFetchTimeoutMs(self, timeoutMs): """Set the CRL fetch timeout to the specified 'timeoutMs'. The default is 20,000 milliseconds. The TLS handshake timeout will be set to the default if the specified 'crlFetchTimeoutMs' is not positive.""" - internals.blpapi_TlsOptions_setCrlFetchTimeoutMs(self.__handle, timeoutMs) + internals.blpapi_TlsOptions_setCrlFetchTimeoutMs( + self.__handle, timeoutMs) @staticmethod def createFromFiles(clientCredentialsFilename, @@ -606,9 +615,10 @@ def createFromFiles(clientCredentialsFilename, """Creates a TlsOptions using a DER encoded client credentials in PKCS#12 format and DER encoded trust material in PKCS#7 format from the specified files""" - handle = internals.blpapi_TlsOptions_createFromFiles(clientCredentialsFilename, - clientCredentialsPassword, - trustedCertificatesFilename) + handle = internals.blpapi_TlsOptions_createFromFiles( + clientCredentialsFilename, + clientCredentialsPassword, + trustedCertificatesFilename) return TlsOptions(handle) @staticmethod @@ -624,9 +634,9 @@ def createFromBlobs(clientCredentials, credentials = bytearray(clientCredentials) certs = bytearray(trustedCertificates) handle = internals.blpapi_TlsOptions_createFromBlobs( - credentials, - clientCredentialsPassword, - certs) + credentials, + clientCredentialsPassword, + certs) return TlsOptions(handle) __copyright__ = """ diff --git a/blpapi/subscriptionlist.py b/blpapi/subscriptionlist.py index 0e16c0f..ea12428 100644 --- a/blpapi/subscriptionlist.py +++ b/blpapi/subscriptionlist.py @@ -15,7 +15,7 @@ subscription string, which has the following structure: "//blp/mktdata/ticker/IBM US Equity?fields=BID,ASK&interval=2" - \-----------/\------/\-----------/\------------------------/ + \\-----------/\\------/\\-----------/\\------------------------/ | | | | Service Prefix Instrument Suffix @@ -87,7 +87,9 @@ from . import internals from .internals import CorrelationId from .compat import conv2str, isstr +from .utils import get_handle +# pylint: disable=useless-object-inheritance class SubscriptionList(object): """A list of subscriptions. @@ -106,24 +108,25 @@ class SubscriptionList(object): : this subscription. The following table describes how various operations use the above - elements: - |--------------|--------------------------------------------------------| - | OPERATION | SUBSCRIPTION STRING | CORRELATION ID | - |--------------|-----------------------+--------------------------------| - | 'subscribe' |Used to specify the |Identifier for the subscription.| - | |topic to subscribe to. |If uninitialized correlationid | - | | |was specified an internally | - | | |generated correlationId will be | - | | |set for the subscription. | - |--------------+-----------------------+--------------------------------| - |'resubscribe' |Used to specify the new|Identifier of the subscription | - | |topic to which the |which needs to be modified. | - | |subscription should be | | - | |modified to. | | - |--------------+-----------------------+--------------------------------| - |'unsubscribe' | NOT USED |Identifier of the subscription | - | | |which needs to be canceled. | - |-----------------------------------------------------------------------| + elements:: + + |-------------|--------------------------------------------------------| + | OPERATION | SUBSCRIPTION STRING | CORRELATION ID | + |-------------|-----------------------+--------------------------------| + | 'subscribe' |Used to specify the |Identifier for the subscription.| + | |topic to subscribe to. |If uninitialized correlationid | + | | |was specified an internally | + | | |generated correlationId will be | + | | |set for the subscription. | + |-------------+-----------------------+--------------------------------| + |'resubscribe'|Used to specify the new|Identifier of the subscription | + | |topic to which the |which needs to be modified. | + | |subscription should be | | + | |modified to. | | + |-------------+-----------------------+--------------------------------| + |'unsubscribe'| NOT USED |Identifier of the subscription | + | | |which needs to be canceled. | + |----------------------------------------------------------------------| """ def __init__(self): """Create an empty SubscriptionList.""" @@ -165,20 +168,20 @@ def add(self, topic, fields=None, options=None, correlationId=None): else: fields = ",".join(fields) - if (options is not None): + if options is not None: if isstr(options): options = conv2str(options) elif isinstance(options, (list, tuple)): options = "&".join(options) elif isinstance(options, dict): options = "&".join([key if val is None - else "{0}={1}".format(key, val) + else "{0}={1}".format(key, val) for key, val in options.items()]) return internals.blpapi_SubscriptionList_addHelper( self.__handle, topic, - correlationId._handle(), + get_handle(correlationId), fields, options) @@ -186,7 +189,7 @@ def append(self, other): """Append a copy of the specified 'subscriptionList' to this list""" return internals.blpapi_SubscriptionList_append( self.__handle, - other.__handle) + get_handle(other)) def clear(self): """Remove all entries from this object.""" @@ -236,7 +239,7 @@ def addResolved(self, subscriptionString, correlationId=None): if correlationId is None: correlationId = internals.CorrelationId() return internals.blpapi_SubscriptionList_addResolved( - self.__handle, subscriptionString, correlationId._handle()) + self.__handle, subscriptionString, get_handle(correlationId)) def isResolvedTopicAt(self, index): """Return 'true' if the 'index'th entry in this 'SubscriptionList' @@ -244,7 +247,7 @@ def isResolvedTopicAt(self, index): it was created using 'SubscriptionList.add'. An exception is thrown if 'index >= size()'.""" err, res = internals.blpapi_SubscriptionList_isResolvedAt( - self.__handle, index) + self.__handle, index) _ExceptionUtil.raiseOnError(err) return res diff --git a/blpapi/testtools.py b/blpapi/testtools.py index 78a4b43..5d14cf6 100644 --- a/blpapi/testtools.py +++ b/blpapi/testtools.py @@ -1,41 +1,44 @@ -# This tool tries to register every blpapi_*** function call in a database. -# Resulting information can be used later to generate test coverage report. -# This module doesn't ment to be used directly. +"""This tool tries to register every blpapi_*** function call in a database. +Resulting information can be used later to generate test coverage report. +This module doesn't ment to be used directly.""" + +# pylint: disable=useless-import-alias,global-statement import sqlite3 -import blpapi.internals as internals from collections import defaultdict from threading import Lock import inspect +import blpapi.internals as internals + #import blpapi-py modules import blpapi __MODULES = [ - blpapi, - blpapi.abstractsession, - blpapi.constant, - blpapi.datatype, - blpapi.datetime, - blpapi.element, - blpapi.event, - blpapi.eventdispatcher, - blpapi.eventformatter, - #blpapi.exception, - blpapi.identity, - blpapi.message, - blpapi.name, - blpapi.providersession, - blpapi.request, - blpapi.resolutionlist, - blpapi.schema, - blpapi.service, - blpapi.session, - blpapi.sessionoptions, - blpapi.subscriptionlist, - blpapi.topic, - blpapi.topiclist, - blpapi.utils, + blpapi, + blpapi.abstractsession, + blpapi.constant, + blpapi.datatype, + blpapi.datetime, + blpapi.element, + blpapi.event, + blpapi.eventdispatcher, + blpapi.eventformatter, + #blpapi.exception, + blpapi.identity, + blpapi.message, + blpapi.name, + blpapi.providersession, + blpapi.request, + blpapi.resolutionlist, + blpapi.schema, + blpapi.service, + blpapi.session, + blpapi.sessionoptions, + blpapi.subscriptionlist, + blpapi.topic, + blpapi.topiclist, + blpapi.utils, ] @@ -49,6 +52,7 @@ ]) def __writeCallToDB(method_name, test_name, class_name=None): + """ writes to db """ global __cursor, __cursorLock with __cursorLock: query = """ @@ -69,7 +73,7 @@ def __writeCallToDB(method_name, test_name, class_name=None): table_name=table_name,)) else: print("No database connection, calling {method} from {test}".format( - method=full_method_name, test=test_name)) + method=full_method_name, test=test_name)) def logCallsToDB(method_name, test_name, obj, clsname=None): """Basic logging decorator""" @@ -199,7 +203,10 @@ def commit(): __connection.commit() class Coverage: - def __init__(self, cur, api_table_name='all_api_exists', calls_table_name='api_calls_by_test'): + """ coverage """ + def __init__(self, cur, + api_table_name='all_api_exists', + calls_table_name='api_calls_by_test'): self.__api_table_name = api_table_name self.__calls_table_name = calls_table_name self.__tests = defaultdict(list) @@ -208,15 +215,18 @@ def __init__(self, cur, api_table_name='all_api_exists', calls_table_name='api_c self.readDB() def readDB(self): + """ select from db """ query = """SELECT * from {0};""".format(self.__api_table_name) for name, in self.__cursor.execute(query): self.__allfn.append(name) - query = """SELECT test_name, method_name FROM {0};""".format(self.__calls_table_name) + query = """SELECT test_name, method_name FROM {0};""".format( + self.__calls_table_name) for test, method in self.__cursor.execute(query): self.__tests[test].append(method) def getTotalCoverage(self): + """ returns coverage """ from itertools import chain allexists = set(self.__allfn) alltested = set(chain(*self.__tests.values())) @@ -229,6 +239,7 @@ def getTotalCoverage(self): } def getCodeCoverage(): + """ returns coverage """ global __cursor blpapi_coverage = Coverage(__cursor) blpapipy_coverage = Coverage(__cursor, api_table_name="all_class_methods", @@ -241,4 +252,3 @@ def getCodeCoverage(): # Init everything on module load print("Initializing testtools, database name %s" % __DBNAME) init() - diff --git a/blpapi/topic.py b/blpapi/topic.py index e15dea2..9cdbfe0 100644 --- a/blpapi/topic.py +++ b/blpapi/topic.py @@ -5,21 +5,18 @@ This component provides a topic that is used for publishing data on. """ - - -from .exception import _ExceptionUtil -from .message import Message from . import internals -from .internals import CorrelationId from .service import Service +from .utils import get_handle +# pylint: disable=useless-object-inheritance class Topic(object): """Used to identify the stream on which a message is published. - Topic objects are obtained from 'createTopic()' on 'ProviderSession'. They are - used when adding a message to an Event for publishing using 'appendMessage()' - on 'EventFormatter'. + Topic objects are obtained from 'createTopic()' on 'ProviderSession'. + They are used when adding a message to an Event for publishing using + 'appendMessage()' on 'EventFormatter'. """ def __init__(self, handle=None, sessions=None): @@ -72,15 +69,19 @@ def service(self): def __cmp__(self, other): """3-way comparison of Topic objects.""" - return internals.blpapi_Topic_compare(self.__handle, other.__handle) + return internals.blpapi_Topic_compare( + self.__handle, + get_handle(other)) def __lt__(self, other): """2-way comparison of Topic objects.""" - return internals.blpapi_Topic_compare(self.__handle, other.__handle) < 0 + return internals.blpapi_Topic_compare( + self.__handle, get_handle(other)) < 0 def __eq__(self, other): """2-way comparison of Topic objects.""" - return internals.blpapi_Topic_compare(self.__handle, other.__handle) == 0 + return internals.blpapi_Topic_compare( + self.__handle, get_handle(other)) == 0 def _handle(self): """Return the internal implementation.""" diff --git a/blpapi/topiclist.py b/blpapi/topiclist.py index 4e3fba6..06f65de 100644 --- a/blpapi/topiclist.py +++ b/blpapi/topiclist.py @@ -5,16 +5,16 @@ This component implements a list of topics which require topic creation. """ - - from .exception import _ExceptionUtil from .message import Message from .resolutionlist import ResolutionList from . import internals from . import utils +from .utils import get_handle from .internals import CorrelationId from .compat import with_metaclass +# pylint: disable=useless-object-inheritance,protected-access @with_metaclass(utils.MetaClassForClassesWithEnums) class TopicList(object): @@ -41,7 +41,7 @@ def __init__(self, original=None): if isinstance(original, ResolutionList): self.__handle = \ internals.blpapi_TopicList_createFromResolutionList( - original._handle()) + get_handle(original)) self.__sessions = original._sessions() else: self.__handle = internals.blpapi_TopicList_create(None) @@ -81,13 +81,12 @@ def add(self, topicOrMessage, correlationId=None): if isinstance(topicOrMessage, Message): return internals.blpapi_TopicList_addFromMessage( self.__handle, - topicOrMessage._handle(), - correlationId._handle()) - else: - return internals.blpapi_TopicList_add( - self.__handle, - topicOrMessage, - correlationId._handle()) + get_handle(topicOrMessage), + get_handle(correlationId)) + return internals.blpapi_TopicList_add( + self.__handle, + topicOrMessage, + get_handle(correlationId)) def correlationIdAt(self, index): """Return the CorrelationId at the specified 'index'. @@ -110,7 +109,7 @@ def topicString(self, correlationId): """ errorCode, topic = internals.blpapi_TopicList_topicString( self.__handle, - correlationId._handle()) + get_handle(correlationId)) _ExceptionUtil.raiseOnError(errorCode) return topic @@ -136,7 +135,7 @@ def status(self, correlationId): """ errorCode, status = internals.blpapi_TopicList_status( self.__handle, - correlationId._handle()) + get_handle(correlationId)) _ExceptionUtil.raiseOnError(errorCode) return status @@ -166,7 +165,7 @@ def message(self, correlationId): """ errorCode, message = internals.blpapi_TopicList_message( self.__handle, - correlationId._handle()) + get_handle(correlationId)) _ExceptionUtil.raiseOnError(errorCode) return Message(message, sessions=self.__sessions) diff --git a/blpapi/version.py b/blpapi/version.py index 301b499..6219279 100644 --- a/blpapi/version.py +++ b/blpapi/version.py @@ -5,7 +5,7 @@ from __future__ import print_function from . import versionhelper -__version__ = "3.12.1" +__version__ = "3.13.0" def print_version(): "Print version information of BLPAPI python module and blpapi C++ SDK" diff --git a/blpapi/versionhelper.py b/blpapi/versionhelper.py index 24478bd..a1d736e 100644 --- a/blpapi/versionhelper.py +++ b/blpapi/versionhelper.py @@ -106,10 +106,6 @@ def blpapi_getVersionInfo(): def blpapi_getVersionIdentifier(): return _versionhelper.blpapi_getVersionIdentifier() blpapi_getVersionIdentifier = _versionhelper.blpapi_getVersionIdentifier - -def __lshift__(stream, rhs): - return _versionhelper.__lshift__(stream, rhs) -__lshift__ = _versionhelper.__lshift__ # This file is compatible with both classic and new-style classes. diff --git a/blpapi/versionhelper_wrap.c b/blpapi/versionhelper_wrap.c new file mode 100644 index 0000000..ff83a78 --- /dev/null +++ b/blpapi/versionhelper_wrap.c @@ -0,0 +1,3875 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 3.0.12 + * + * 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. + * ----------------------------------------------------------------------------- */ + + +#ifndef SWIGPYTHON +#define SWIGPYTHON +#endif + +#define SWIG_PYTHON_THREADS +#define SWIG_PYTHON_DIRECTOR_NO_VTABLE + +/* ----------------------------------------------------------------------------- + * This section contains generic SWIG labels for method/variable + * declarations/attributes, and other compiler dependent labels. + * ----------------------------------------------------------------------------- */ + +/* template workaround for compilers that cannot correctly implement the C++ standard */ +#ifndef SWIGTEMPLATEDISAMBIGUATOR +# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) +# define SWIGTEMPLATEDISAMBIGUATOR template +# elif defined(__HP_aCC) +/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ +/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ +# define SWIGTEMPLATEDISAMBIGUATOR template +# else +# define SWIGTEMPLATEDISAMBIGUATOR +# endif +#endif + +/* inline attribute */ +#ifndef SWIGINLINE +# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) +# define SWIGINLINE inline +# else +# define SWIGINLINE +# endif +#endif + +/* attribute recognised by some compilers to avoid 'unused' warnings */ +#ifndef SWIGUNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +# elif defined(__ICC) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +#endif + +#ifndef SWIG_MSC_UNSUPPRESS_4505 +# if defined(_MSC_VER) +# pragma warning(disable : 4505) /* unreferenced local function has been removed */ +# endif +#endif + +#ifndef SWIGUNUSEDPARM +# ifdef __cplusplus +# define SWIGUNUSEDPARM(p) +# else +# define SWIGUNUSEDPARM(p) p SWIGUNUSED +# endif +#endif + +/* internal SWIG method */ +#ifndef SWIGINTERN +# define SWIGINTERN static SWIGUNUSED +#endif + +/* internal inline SWIG method */ +#ifndef SWIGINTERNINLINE +# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE +#endif + +/* exporting methods */ +#if defined(__GNUC__) +# if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +# ifndef GCC_HASCLASSVISIBILITY +# define GCC_HASCLASSVISIBILITY +# endif +# endif +#endif + +#ifndef SWIGEXPORT +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# if defined(STATIC_LINKED) +# define SWIGEXPORT +# else +# define SWIGEXPORT __declspec(dllexport) +# endif +# else +# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) +# define SWIGEXPORT __attribute__ ((visibility("default"))) +# else +# define SWIGEXPORT +# endif +# endif +#endif + +/* calling conventions for Windows */ +#ifndef SWIGSTDCALL +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# define SWIGSTDCALL __stdcall +# else +# define SWIGSTDCALL +# endif +#endif + +/* Deal with Microsoft's attempt at deprecating C standard runtime functions */ +#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) +# define _CRT_SECURE_NO_DEPRECATE +#endif + +/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ +#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) +# define _SCL_SECURE_NO_DEPRECATE +#endif + +/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */ +#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES) +# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0 +#endif + +/* Intel's compiler complains if a variable which was never initialised is + * cast to void, which is a common idiom which we use to indicate that we + * are aware a variable isn't used. So we just silence that warning. + * See: https://github.com/swig/swig/issues/192 for more discussion. + */ +#ifdef __INTEL_COMPILER +# pragma warning disable 592 +#endif + + +#if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG) +/* Use debug wrappers with the Python release dll */ +# undef _DEBUG +# include +# define _DEBUG +#else +# include +#endif + +/* ----------------------------------------------------------------------------- + * swigrun.swg + * + * This file contains generic C API SWIG runtime support for pointer + * type checking. + * ----------------------------------------------------------------------------- */ + +/* This should only be incremented when either the layout of swig_type_info changes, + or for whatever reason, the runtime changes incompatibly */ +#define SWIG_RUNTIME_VERSION "4" + +/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ +#ifdef SWIG_TYPE_TABLE +# define SWIG_QUOTE_STRING(x) #x +# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x) +# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE) +#else +# define SWIG_TYPE_TABLE_NAME +#endif + +/* + You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for + creating a static or dynamic library from the SWIG runtime code. + In 99.9% of the cases, SWIG just needs to declare them as 'static'. + + But only do this if strictly necessary, ie, if you have problems + with your compiler or suchlike. +*/ + +#ifndef SWIGRUNTIME +# define SWIGRUNTIME SWIGINTERN +#endif + +#ifndef SWIGRUNTIMEINLINE +# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE +#endif + +/* Generic buffer size */ +#ifndef SWIG_BUFFER_SIZE +# define SWIG_BUFFER_SIZE 1024 +#endif + +/* Flags for pointer conversions */ +#define SWIG_POINTER_DISOWN 0x1 +#define SWIG_CAST_NEW_MEMORY 0x2 + +/* Flags for new pointer objects */ +#define SWIG_POINTER_OWN 0x1 + + +/* + Flags/methods for returning states. + + The SWIG conversion methods, as ConvertPtr, return an integer + that tells if the conversion was successful or not. And if not, + an error code can be returned (see swigerrors.swg for the codes). + + Use the following macros/flags to set or process the returning + states. + + In old versions of SWIG, code such as the following was usually written: + + if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { + // success code + } else { + //fail code + } + + Now you can be more explicit: + + int res = SWIG_ConvertPtr(obj,vptr,ty.flags); + if (SWIG_IsOK(res)) { + // success code + } else { + // fail code + } + + which is the same really, but now you can also do + + Type *ptr; + int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags); + if (SWIG_IsOK(res)) { + // success code + if (SWIG_IsNewObj(res) { + ... + delete *ptr; + } else { + ... + } + } else { + // fail code + } + + I.e., now SWIG_ConvertPtr can return new objects and you can + identify the case and take care of the deallocation. Of course that + also requires SWIG_ConvertPtr to return new result values, such as + + int SWIG_ConvertPtr(obj, ptr,...) { + if () { + if () { + *ptr = ; + return SWIG_NEWOBJ; + } else { + *ptr = ; + return SWIG_OLDOBJ; + } + } else { + return SWIG_BADOBJ; + } + } + + Of course, returning the plain '0(success)/-1(fail)' still works, but you can be + more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the + 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 + + int food(double) + int fooi(int); + + and you call + + food(1) // cast rank '1' (1 -> 1.0) + fooi(1) // cast rank '0' + + just use the SWIG_AddCast()/SWIG_CheckState() +*/ + +#define SWIG_OK (0) +#define SWIG_ERROR (-1) +#define SWIG_IsOK(r) (r >= 0) +#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError) + +/* The CastRankLimit says how many bits are used for the cast rank */ +#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 */ +#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 */ +#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)) +#define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r) +#define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r) +#define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK)) + +/* Cast-Rank Mode */ +#if defined(SWIG_CASTRANK_MODE) +# ifndef SWIG_TypeRank +# define SWIG_TypeRank unsigned long +# endif +# ifndef SWIG_MAXCASTRANK /* Default cast allowed */ +# define SWIG_MAXCASTRANK (2) +# endif +# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1) +# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK) +SWIGINTERNINLINE int SWIG_AddCast(int r) { + return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r; +} +SWIGINTERNINLINE int SWIG_CheckState(int r) { + return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; +} +#else /* no cast-rank mode */ +# define SWIG_AddCast(r) (r) +# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0) +#endif + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void *(*swig_converter_func)(void *, int *); +typedef struct swig_type_info *(*swig_dycast_func)(void **); + +/* Structure to store information on one type */ +typedef struct swig_type_info { + const char *name; /* mangled name of this type */ + const char *str; /* human readable name of this type */ + swig_dycast_func dcast; /* dynamic cast function down a hierarchy */ + struct swig_cast_info *cast; /* linked list of types that can cast into this type */ + void *clientdata; /* language specific type data */ + int owndata; /* flag if the structure owns the clientdata */ +} swig_type_info; + +/* Structure to store a type and conversion function used for casting */ +typedef struct swig_cast_info { + swig_type_info *type; /* pointer to type that is equivalent to this type */ + swig_converter_func converter; /* function to cast the void pointers */ + struct swig_cast_info *next; /* pointer to next cast in linked list */ + struct swig_cast_info *prev; /* pointer to the previous cast */ +} swig_cast_info; + +/* Structure used to store module information + * Each module generates one structure like this, and the runtime collects + * all of these structures and stores them in a circularly linked list.*/ +typedef struct swig_module_info { + swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */ + size_t size; /* Number of types in this module */ + struct swig_module_info *next; /* Pointer to next element in circularly linked list */ + swig_type_info **type_initial; /* Array of initially generated type structures */ + swig_cast_info **cast_initial; /* Array of initially generated casting structures */ + void *clientdata; /* Language specific module data */ +} swig_module_info; + +/* + Compare two type names skipping the space characters, therefore + "char*" == "char *" and "Class" == "Class", etc. + + Return 0 when the two name types are equivalent, as in + strncmp, but skipping ' '. +*/ +SWIGRUNTIME int +SWIG_TypeNameComp(const char *f1, const char *l1, + const char *f2, const char *l2) { + for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) { + while ((*f1 == ' ') && (f1 != l1)) ++f1; + while ((*f2 == ' ') && (f2 != l2)) ++f2; + if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1; + } + return (int)((l1 - f1) - (l2 - f2)); +} + +/* + Check type equivalence in a name list like ||... + Return 0 if equal, -1 if nb < tb, 1 if nb > tb +*/ +SWIGRUNTIME int +SWIG_TypeCmp(const char *nb, const char *tb) { + int equiv = 1; + const char* te = tb + strlen(tb); + const char* ne = nb; + while (equiv != 0 && *ne) { + for (nb = ne; *ne; ++ne) { + if (*ne == '|') break; + } + equiv = SWIG_TypeNameComp(nb, ne, tb, te); + if (*ne) ++ne; + } + return equiv; +} + +/* + Check type equivalence in a name list like ||... + Return 0 if not equal, 1 if equal +*/ +SWIGRUNTIME int +SWIG_TypeEquiv(const char *nb, const char *tb) { + return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0; +} + +/* + Check the typename +*/ +SWIGRUNTIME swig_cast_info * +SWIG_TypeCheck(const char *c, swig_type_info *ty) { + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (strcmp(iter->type->name, c) == 0) { + if (iter == ty->cast) + return iter; + /* Move iter to the top of the linked list */ + iter->prev->next = iter->next; + if (iter->next) + iter->next->prev = iter->prev; + iter->next = ty->cast; + iter->prev = 0; + if (ty->cast) ty->cast->prev = iter; + ty->cast = iter; + return iter; + } + iter = iter->next; + } + } + return 0; +} + +/* + 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) { + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (iter->type == from) { + if (iter == ty->cast) + return iter; + /* Move iter to the top of the linked list */ + iter->prev->next = iter->next; + if (iter->next) + iter->next->prev = iter->prev; + iter->next = ty->cast; + iter->prev = 0; + if (ty->cast) ty->cast->prev = iter; + ty->cast = iter; + return iter; + } + iter = iter->next; + } + } + return 0; +} + +/* + Cast a pointer up an inheritance hierarchy +*/ +SWIGRUNTIMEINLINE void * +SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) { + return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory); +} + +/* + Dynamic pointer casting. Down an inheritance hierarchy +*/ +SWIGRUNTIME swig_type_info * +SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) { + swig_type_info *lastty = ty; + if (!ty || !ty->dcast) return ty; + while (ty && (ty->dcast)) { + ty = (*ty->dcast)(ptr); + if (ty) lastty = ty; + } + return lastty; +} + +/* + Return the name associated with this type +*/ +SWIGRUNTIMEINLINE const char * +SWIG_TypeName(const swig_type_info *ty) { + return ty->name; +} + +/* + Return the pretty name associated with this type, + that is an unmangled type name in a form presentable to the user. +*/ +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. */ + if (!type) return NULL; + if (type->str != NULL) { + const char *last_name = type->str; + const char *s; + for (s = type->str; *s; s++) + if (*s == '|') last_name = s+1; + return last_name; + } + else + return type->name; +} + +/* + Set the clientdata field for a type +*/ +SWIGRUNTIME void +SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { + swig_cast_info *cast = ti->cast; + /* if (ti->clientdata == clientdata) return; */ + ti->clientdata = clientdata; + + while (cast) { + if (!cast->converter) { + swig_type_info *tc = cast->type; + if (!tc->clientdata) { + SWIG_TypeClientData(tc, clientdata); + } + } + cast = cast->next; + } +} +SWIGRUNTIME void +SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) { + SWIG_TypeClientData(ti, clientdata); + ti->owndata = 1; +} + +/* + Search for a swig_type_info structure only by mangled name + Search is a O(log #types) + + We start searching at module start, and finish searching when start == end. + Note: if start == end at the beginning of the function, we go all the way around + the circular list. +*/ +SWIGRUNTIME swig_type_info * +SWIG_MangledTypeQueryModule(swig_module_info *start, + swig_module_info *end, + const char *name) { + swig_module_info *iter = start; + do { + if (iter->size) { + size_t l = 0; + size_t r = iter->size - 1; + do { + /* since l+r >= 0, we can (>> 1) instead (/ 2) */ + size_t i = (l + r) >> 1; + const char *iname = iter->types[i]->name; + if (iname) { + int compare = strcmp(name, iname); + if (compare == 0) { + return iter->types[i]; + } else if (compare < 0) { + if (i) { + r = i - 1; + } else { + break; + } + } else if (compare > 0) { + l = i + 1; + } + } else { + break; /* should never happen */ + } + } while (l <= r); + } + iter = iter->next; + } while (iter != end); + return 0; +} + +/* + Search for a swig_type_info structure for either a mangled name or a human readable name. + It first searches the mangled names of the types, which is a O(log #types) + If a type is not found it then searches the human readable names, which is O(#types). + + We start searching at module start, and finish searching when start == end. + Note: if start == end at the beginning of the function, we go all the way around + the circular list. +*/ +SWIGRUNTIME swig_type_info * +SWIG_TypeQueryModule(swig_module_info *start, + swig_module_info *end, + const char *name) { + /* STEP 1: Search the name field using binary search */ + swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name); + if (ret) { + return ret; + } else { + /* STEP 2: If the type hasn't been found, do a complete search + of the str field (the human readable name) */ + swig_module_info *iter = start; + do { + size_t i = 0; + for (; i < iter->size; ++i) { + if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name))) + return iter->types[i]; + } + iter = iter->next; + } while (iter != end); + } + + /* neither found a match */ + return 0; +} + +/* + Pack binary data into a string +*/ +SWIGRUNTIME char * +SWIG_PackData(char *c, void *ptr, size_t sz) { + static const char hex[17] = "0123456789abcdef"; + const unsigned char *u = (unsigned char *) ptr; + const unsigned char *eu = u + sz; + for (; u != eu; ++u) { + unsigned char uu = *u; + *(c++) = hex[(uu & 0xf0) >> 4]; + *(c++) = hex[uu & 0xf]; + } + return c; +} + +/* + Unpack binary data from a string +*/ +SWIGRUNTIME const char * +SWIG_UnpackData(const char *c, void *ptr, size_t sz) { + unsigned char *u = (unsigned char *) ptr; + const unsigned char *eu = u + sz; + for (; u != eu; ++u) { + char d = *(c++); + unsigned char uu; + if ((d >= '0') && (d <= '9')) + uu = (unsigned char)((d - '0') << 4); + else if ((d >= 'a') && (d <= 'f')) + uu = (unsigned char)((d - ('a'-10)) << 4); + else + return (char *) 0; + d = *(c++); + if ((d >= '0') && (d <= '9')) + uu |= (unsigned char)(d - '0'); + else if ((d >= 'a') && (d <= 'f')) + uu |= (unsigned char)(d - ('a'-10)); + else + return (char *) 0; + *u = uu; + } + return c; +} + +/* + Pack 'void *' into a string buffer. +*/ +SWIGRUNTIME char * +SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) { + char *r = buff; + if ((2*sizeof(void *) + 2) > bsz) return 0; + *(r++) = '_'; + r = SWIG_PackData(r,&ptr,sizeof(void *)); + if (strlen(name) + 1 > (bsz - (r - buff))) return 0; + strcpy(r,name); + return buff; +} + +SWIGRUNTIME const char * +SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) { + if (*c != '_') { + if (strcmp(c,"NULL") == 0) { + *ptr = (void *) 0; + return name; + } else { + return 0; + } + } + return SWIG_UnpackData(++c,ptr,sizeof(void *)); +} + +SWIGRUNTIME char * +SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) { + char *r = buff; + size_t lname = (name ? strlen(name) : 0); + if ((2*sz + 2 + lname) > bsz) return 0; + *(r++) = '_'; + r = SWIG_PackData(r,ptr,sz); + if (lname) { + strncpy(r,name,lname+1); + } else { + *r = 0; + } + return buff; +} + +SWIGRUNTIME const char * +SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { + if (*c != '_') { + if (strcmp(c,"NULL") == 0) { + memset(ptr,0,sz); + return name; + } else { + return 0; + } + } + return SWIG_UnpackData(++c,ptr,sz); +} + +#ifdef __cplusplus +} +#endif + +/* Errors in SWIG */ +#define SWIG_UnknownError -1 +#define SWIG_IOError -2 +#define SWIG_RuntimeError -3 +#define SWIG_IndexError -4 +#define SWIG_TypeError -5 +#define SWIG_DivisionByZero -6 +#define SWIG_OverflowError -7 +#define SWIG_SyntaxError -8 +#define SWIG_ValueError -9 +#define SWIG_SystemError -10 +#define SWIG_AttributeError -11 +#define SWIG_MemoryError -12 +#define SWIG_NullReferenceError -13 + + + +/* Compatibility macros for Python 3 */ +#if PY_VERSION_HEX >= 0x03000000 + +#define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type) +#define PyInt_Check(x) PyLong_Check(x) +#define PyInt_AsLong(x) PyLong_AsLong(x) +#define PyInt_FromLong(x) PyLong_FromLong(x) +#define PyInt_FromSize_t(x) PyLong_FromSize_t(x) +#define PyString_Check(name) PyBytes_Check(name) +#define PyString_FromString(x) PyUnicode_FromString(x) +#define PyString_Format(fmt, args) PyUnicode_Format(fmt, args) +#define PyString_AsString(str) PyBytes_AsString(str) +#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 + +#ifndef Py_TYPE +# define Py_TYPE(op) ((op)->ob_type) +#endif + +/* SWIG APIs for compatibility of both Python 2 & 3 */ + +#if PY_VERSION_HEX >= 0x03000000 +# define SWIG_Python_str_FromFormat PyUnicode_FromFormat +#else +# define SWIG_Python_str_FromFormat PyString_FromFormat +#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 >= 0x03000000 + char *cstr; + char *newstr; + Py_ssize_t len; + str = PyUnicode_AsUTF8String(str); + PyBytes_AsStringAndSize(str, &cstr, &len); + newstr = (char *) malloc(len+1); + memcpy(newstr, cstr, len+1); + Py_XDECREF(str); + return newstr; +#else + return PyString_AsString(str); +#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) +{ +#if PY_VERSION_HEX >= 0x03000000 + return PyUnicode_FromString(c); +#else + return PyString_FromString(c); +#endif +} + +/* Add PyOS_snprintf for old Pythons */ +#if PY_VERSION_HEX < 0x02020000 +# if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM) +# define PyOS_snprintf _snprintf +# else +# define PyOS_snprintf snprintf +# endif +#endif + +/* A crude PyString_FromFormat implementation for old Pythons */ +#if PY_VERSION_HEX < 0x02020000 + +#ifndef SWIG_PYBUFFER_SIZE +# define SWIG_PYBUFFER_SIZE 1024 +#endif + +static PyObject * +PyString_FromFormat(const char *fmt, ...) { + va_list ap; + char buf[SWIG_PYBUFFER_SIZE * 2]; + int res; + va_start(ap, fmt); + res = vsnprintf(buf, sizeof(buf), fmt, ap); + va_end(ap); + return (res < 0 || res >= (int)sizeof(buf)) ? 0 : PyString_FromString(buf); +} +#endif + +#ifndef PyObject_DEL +# define PyObject_DEL PyObject_Del +#endif + +/* A crude PyExc_StopIteration exception for old Pythons */ +#if PY_VERSION_HEX < 0x02020000 +# ifndef PyExc_StopIteration +# define PyExc_StopIteration PyExc_RuntimeError +# endif +# ifndef PyObject_GenericGetAttr +# define PyObject_GenericGetAttr 0 +# endif +#endif + +/* Py_NotImplemented is defined in 2.1 and up. */ +#if PY_VERSION_HEX < 0x02010000 +# ifndef Py_NotImplemented +# define Py_NotImplemented PyExc_RuntimeError +# endif +#endif + +/* A crude PyString_AsStringAndSize implementation for old Pythons */ +#if PY_VERSION_HEX < 0x02010000 +# ifndef PyString_AsStringAndSize +# define PyString_AsStringAndSize(obj, s, len) {*s = PyString_AsString(obj); *len = *s ? strlen(*s) : 0;} +# endif +#endif + +/* PySequence_Size for old Pythons */ +#if PY_VERSION_HEX < 0x02000000 +# ifndef PySequence_Size +# define PySequence_Size PySequence_Length +# endif +#endif + +/* PyBool_FromLong for old Pythons */ +#if PY_VERSION_HEX < 0x02030000 +static +PyObject *PyBool_FromLong(long ok) +{ + PyObject *result = ok ? Py_True : Py_False; + Py_INCREF(result); + return result; +} +#endif + +/* Py_ssize_t for old Pythons */ +/* This code is as recommended by: */ +/* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */ +#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) +typedef int Py_ssize_t; +# define PY_SSIZE_T_MAX INT_MAX +# define PY_SSIZE_T_MIN INT_MIN +typedef inquiry lenfunc; +typedef intargfunc ssizeargfunc; +typedef intintargfunc ssizessizeargfunc; +typedef intobjargproc ssizeobjargproc; +typedef intintobjargproc ssizessizeobjargproc; +typedef getreadbufferproc readbufferproc; +typedef getwritebufferproc writebufferproc; +typedef getsegcountproc segcountproc; +typedef getcharbufferproc charbufferproc; +static long PyNumber_AsSsize_t (PyObject *x, void *SWIGUNUSEDPARM(exc)) +{ + long result = 0; + PyObject *i = PyNumber_Int(x); + if (i) { + result = PyInt_AsLong(i); + Py_DECREF(i); + } + return result; +} +#endif + +#if PY_VERSION_HEX < 0x02050000 +#define PyInt_FromSize_t(x) PyInt_FromLong((long)x) +#endif + +#if PY_VERSION_HEX < 0x02040000 +#define Py_VISIT(op) \ + do { \ + if (op) { \ + int vret = visit((op), arg); \ + if (vret) \ + return vret; \ + } \ + } while (0) +#endif + +#if PY_VERSION_HEX < 0x02030000 +typedef struct { + PyTypeObject type; + PyNumberMethods as_number; + PyMappingMethods as_mapping; + PySequenceMethods as_sequence; + PyBufferProcs as_buffer; + PyObject *name, *slots; +} PyHeapTypeObject; +#endif + +#if PY_VERSION_HEX < 0x02030000 +typedef destructor freefunc; +#endif + +#if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION > 6) || \ + (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION > 0) || \ + (PY_MAJOR_VERSION > 3)) +# define SWIGPY_USE_CAPSULE +# define SWIGPY_CAPSULE_NAME ((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME) +#endif + +#if PY_VERSION_HEX < 0x03020000 +#define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type) +#define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name) +#define Py_hash_t long +#endif + +/* ----------------------------------------------------------------------------- + * error manipulation + * ----------------------------------------------------------------------------- */ + +SWIGRUNTIME PyObject* +SWIG_Python_ErrorType(int code) { + PyObject* type = 0; + switch(code) { + case SWIG_MemoryError: + type = PyExc_MemoryError; + break; + case SWIG_IOError: + type = PyExc_IOError; + break; + case SWIG_RuntimeError: + type = PyExc_RuntimeError; + break; + case SWIG_IndexError: + type = PyExc_IndexError; + break; + case SWIG_TypeError: + type = PyExc_TypeError; + break; + case SWIG_DivisionByZero: + type = PyExc_ZeroDivisionError; + break; + case SWIG_OverflowError: + type = PyExc_OverflowError; + break; + case SWIG_SyntaxError: + type = PyExc_SyntaxError; + break; + case SWIG_ValueError: + type = PyExc_ValueError; + break; + case SWIG_SystemError: + type = PyExc_SystemError; + break; + case SWIG_AttributeError: + type = PyExc_AttributeError; + break; + default: + type = PyExc_RuntimeError; + } + return type; +} + + +SWIGRUNTIME void +SWIG_Python_AddErrorMsg(const char* mesg) +{ + PyObject *type = 0; + PyObject *value = 0; + PyObject *traceback = 0; + + if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback); + if (value) { + char *tmp; + PyObject *old_str = PyObject_Str(value); + PyErr_Clear(); + Py_XINCREF(type); + + PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); + SWIG_Python_str_DelForPy3(tmp); + Py_DECREF(old_str); + Py_DECREF(value); + } else { + PyErr_SetString(PyExc_RuntimeError, mesg); + } +} + +#if defined(SWIG_PYTHON_NO_THREADS) +# if defined(SWIG_PYTHON_THREADS) +# undef SWIG_PYTHON_THREADS +# endif +#endif +#if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */ +# if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL) +# if (PY_VERSION_HEX >= 0x02030000) /* For 2.3 or later, use the PyGILState calls */ +# define SWIG_PYTHON_USE_GIL +# endif +# endif +# if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */ +# ifndef SWIG_PYTHON_INITIALIZE_THREADS +# define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads() +# endif +# ifdef __cplusplus /* C++ code */ + class SWIG_Python_Thread_Block { + bool status; + PyGILState_STATE state; + public: + void end() { if (status) { PyGILState_Release(state); status = false;} } + SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {} + ~SWIG_Python_Thread_Block() { end(); } + }; + class SWIG_Python_Thread_Allow { + bool status; + PyThreadState *save; + public: + void end() { if (status) { PyEval_RestoreThread(save); status = false; }} + SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {} + ~SWIG_Python_Thread_Allow() { end(); } + }; +# define SWIG_PYTHON_THREAD_BEGIN_BLOCK SWIG_Python_Thread_Block _swig_thread_block +# define SWIG_PYTHON_THREAD_END_BLOCK _swig_thread_block.end() +# define SWIG_PYTHON_THREAD_BEGIN_ALLOW SWIG_Python_Thread_Allow _swig_thread_allow +# define SWIG_PYTHON_THREAD_END_ALLOW _swig_thread_allow.end() +# else /* C code */ +# define SWIG_PYTHON_THREAD_BEGIN_BLOCK PyGILState_STATE _swig_thread_block = PyGILState_Ensure() +# define SWIG_PYTHON_THREAD_END_BLOCK PyGILState_Release(_swig_thread_block) +# define SWIG_PYTHON_THREAD_BEGIN_ALLOW PyThreadState *_swig_thread_allow = PyEval_SaveThread() +# define SWIG_PYTHON_THREAD_END_ALLOW PyEval_RestoreThread(_swig_thread_allow) +# endif +# else /* Old thread way, not implemented, user must provide it */ +# if !defined(SWIG_PYTHON_INITIALIZE_THREADS) +# define SWIG_PYTHON_INITIALIZE_THREADS +# endif +# if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK) +# define SWIG_PYTHON_THREAD_BEGIN_BLOCK +# endif +# if !defined(SWIG_PYTHON_THREAD_END_BLOCK) +# define SWIG_PYTHON_THREAD_END_BLOCK +# endif +# if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW) +# define SWIG_PYTHON_THREAD_BEGIN_ALLOW +# endif +# if !defined(SWIG_PYTHON_THREAD_END_ALLOW) +# define SWIG_PYTHON_THREAD_END_ALLOW +# endif +# endif +#else /* No thread support */ +# define SWIG_PYTHON_INITIALIZE_THREADS +# define SWIG_PYTHON_THREAD_BEGIN_BLOCK +# define SWIG_PYTHON_THREAD_END_BLOCK +# define SWIG_PYTHON_THREAD_BEGIN_ALLOW +# define SWIG_PYTHON_THREAD_END_ALLOW +#endif + +/* ----------------------------------------------------------------------------- + * Python API portion that goes into the runtime + * ----------------------------------------------------------------------------- */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* ----------------------------------------------------------------------------- + * Constant declarations + * ----------------------------------------------------------------------------- */ + +/* Constant Types */ +#define SWIG_PY_POINTER 4 +#define SWIG_PY_BINARY 5 + +/* Constant information structure */ +typedef struct swig_const_info { + int type; + char *name; + long lvalue; + double dvalue; + void *pvalue; + swig_type_info **ptype; +} swig_const_info; + + +/* ----------------------------------------------------------------------------- + * Wrapper of PyInstanceMethod_New() used in Python 3 + * It is exported to the generated module, used for -fastproxy + * ----------------------------------------------------------------------------- */ +#if PY_VERSION_HEX >= 0x03000000 +SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) +{ + return PyInstanceMethod_New(func); +} +#else +SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *SWIGUNUSEDPARM(func)) +{ + return NULL; +} +#endif + +#ifdef __cplusplus +} +#endif + + +/* ----------------------------------------------------------------------------- + * pyrun.swg + * + * This file contains the runtime support for Python modules + * and includes code for managing global variables and pointer + * type checking. + * + * ----------------------------------------------------------------------------- */ + +/* Common SWIG API */ + +/* for raw pointers */ +#define SWIG_Python_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0) +#define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtr(obj, pptr, type, flags) +#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own) + +#ifdef SWIGPYTHON_BUILTIN +#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(self, ptr, type, flags) +#else +#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags) +#endif + +#define SWIG_InternalNewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags) + +#define SWIG_CheckImplicit(ty) SWIG_Python_CheckImplicit(ty) +#define SWIG_AcquirePtr(ptr, src) SWIG_Python_AcquirePtr(ptr, src) +#define swig_owntype int + +/* for raw packed data */ +#define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty) +#define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) + +/* for class or struct pointers */ +#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags) +#define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags) + +/* for C or C++ function pointers */ +#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_Python_ConvertFunctionPtr(obj, pptr, type) +#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Python_NewPointerObj(NULL, ptr, type, 0) + +/* for C++ member pointers, ie, member methods */ +#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty) +#define SWIG_NewMemberObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) + + +/* Runtime API */ + +#define SWIG_GetModule(clientdata) SWIG_Python_GetModule(clientdata) +#define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer) +#define SWIG_NewClientData(obj) SwigPyClientData_New(obj) + +#define SWIG_SetErrorObj SWIG_Python_SetErrorObj +#define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg +#define SWIG_ErrorType(code) SWIG_Python_ErrorType(code) +#define SWIG_Error(code, msg) SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg) +#define SWIG_fail goto fail + + +/* Runtime API implementation */ + +/* Error manipulation */ + +SWIGINTERN void +SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) { + SWIG_PYTHON_THREAD_BEGIN_BLOCK; + PyErr_SetObject(errtype, obj); + Py_DECREF(obj); + SWIG_PYTHON_THREAD_END_BLOCK; +} + +SWIGINTERN void +SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) { + SWIG_PYTHON_THREAD_BEGIN_BLOCK; + PyErr_SetString(errtype, msg); + SWIG_PYTHON_THREAD_END_BLOCK; +} + +#define SWIG_Python_Raise(obj, type, desc) SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj) + +/* Set a constant value */ + +#if defined(SWIGPYTHON_BUILTIN) + +SWIGINTERN void +SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) { + PyObject *s = PyString_InternFromString(key); + PyList_Append(seq, s); + Py_DECREF(s); +} + +SWIGINTERN void +SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) { +#if PY_VERSION_HEX < 0x02030000 + PyDict_SetItemString(d, (char *)name, obj); +#else + PyDict_SetItemString(d, name, obj); +#endif + Py_DECREF(obj); + if (public_interface) + SwigPyBuiltin_AddPublicSymbol(public_interface, name); +} + +#else + +SWIGINTERN void +SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) { +#if PY_VERSION_HEX < 0x02030000 + PyDict_SetItemString(d, (char *)name, obj); +#else + PyDict_SetItemString(d, name, obj); +#endif + Py_DECREF(obj); +} + +#endif + +/* Append a value to the result obj */ + +SWIGINTERN PyObject* +SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) { +#if !defined(SWIG_PYTHON_OUTPUT_TUPLE) + if (!result) { + result = obj; + } else if (result == Py_None) { + Py_DECREF(result); + result = obj; + } else { + if (!PyList_Check(result)) { + PyObject *o2 = result; + result = PyList_New(1); + PyList_SetItem(result, 0, o2); + } + PyList_Append(result,obj); + Py_DECREF(obj); + } + return result; +#else + PyObject* o2; + PyObject* o3; + if (!result) { + result = obj; + } else if (result == Py_None) { + Py_DECREF(result); + result = obj; + } else { + if (!PyTuple_Check(result)) { + o2 = result; + result = PyTuple_New(1); + PyTuple_SET_ITEM(result, 0, o2); + } + o3 = PyTuple_New(1); + PyTuple_SET_ITEM(o3, 0, obj); + o2 = result; + result = PySequence_Concat(o2, o3); + Py_DECREF(o2); + Py_DECREF(o3); + } + return result; +#endif +} + +/* Unpack the argument tuple */ + +SWIGINTERN Py_ssize_t +SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs) +{ + if (!args) { + if (!min && !max) { + return 1; + } else { + PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none", + name, (min == max ? "" : "at least "), (int)min); + return 0; + } + } + if (!PyTuple_Check(args)) { + if (min <= 1 && max >= 1) { + Py_ssize_t i; + objs[0] = args; + for (i = 1; i < max; ++i) { + objs[i] = 0; + } + return 2; + } + PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple"); + return 0; + } else { + Py_ssize_t l = PyTuple_GET_SIZE(args); + if (l < min) { + PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", + name, (min == max ? "" : "at least "), (int)min, (int)l); + return 0; + } else if (l > max) { + PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", + name, (min == max ? "" : "at most "), (int)max, (int)l); + return 0; + } else { + Py_ssize_t i; + for (i = 0; i < l; ++i) { + objs[i] = PyTuple_GET_ITEM(args, i); + } + for (; l < max; ++l) { + objs[l] = 0; + } + return i + 1; + } + } +} + +/* A functor is a function object with one single object argument */ +#if PY_VERSION_HEX >= 0x02020000 +#define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL); +#else +#define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunction(functor, "O", obj); +#endif + +/* + Helper for static pointer initialization for both C and C++ code, for example + static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...); +*/ +#ifdef __cplusplus +#define SWIG_STATIC_POINTER(var) var +#else +#define SWIG_STATIC_POINTER(var) var = 0; if (!var) var +#endif + +/* ----------------------------------------------------------------------------- + * Pointer declarations + * ----------------------------------------------------------------------------- */ + +/* Flags for new pointer objects */ +#define SWIG_POINTER_NOSHADOW (SWIG_POINTER_OWN << 1) +#define SWIG_POINTER_NEW (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN) + +#define SWIG_POINTER_IMPLICIT_CONV (SWIG_POINTER_DISOWN << 1) + +#define SWIG_BUILTIN_TP_INIT (SWIG_POINTER_OWN << 2) +#define SWIG_BUILTIN_INIT (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN) + +#ifdef __cplusplus +extern "C" { +#endif + +/* How to access Py_None */ +#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# ifndef SWIG_PYTHON_NO_BUILD_NONE +# ifndef SWIG_PYTHON_BUILD_NONE +# define SWIG_PYTHON_BUILD_NONE +# endif +# endif +#endif + +#ifdef SWIG_PYTHON_BUILD_NONE +# ifdef Py_None +# undef Py_None +# define Py_None SWIG_Py_None() +# endif +SWIGRUNTIMEINLINE PyObject * +_SWIG_Py_None(void) +{ + PyObject *none = Py_BuildValue((char*)""); + Py_DECREF(none); + return none; +} +SWIGRUNTIME PyObject * +SWIG_Py_None(void) +{ + static PyObject *SWIG_STATIC_POINTER(none) = _SWIG_Py_None(); + return none; +} +#endif + +/* The python void return value */ + +SWIGRUNTIMEINLINE PyObject * +SWIG_Py_Void(void) +{ + PyObject *none = Py_None; + Py_INCREF(none); + return none; +} + +/* SwigPyClientData */ + +typedef struct { + PyObject *klass; + PyObject *newraw; + PyObject *newargs; + PyObject *destroy; + int delargs; + int implicitconv; + PyTypeObject *pytype; +} SwigPyClientData; + +SWIGRUNTIMEINLINE int +SWIG_Python_CheckImplicit(swig_type_info *ty) +{ + SwigPyClientData *data = (SwigPyClientData *)ty->clientdata; + return data ? data->implicitconv : 0; +} + +SWIGRUNTIMEINLINE PyObject * +SWIG_Python_ExceptionType(swig_type_info *desc) { + SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0; + PyObject *klass = data ? data->klass : 0; + return (klass ? klass : PyExc_RuntimeError); +} + + +SWIGRUNTIME SwigPyClientData * +SwigPyClientData_New(PyObject* obj) +{ + if (!obj) { + return 0; + } else { + SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData)); + /* the klass element */ + data->klass = obj; + Py_INCREF(data->klass); + /* 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); + } else { +#if (PY_VERSION_HEX < 0x02020000) + data->newraw = 0; +#else + data->newraw = PyObject_GetAttrString(data->klass, (char *)"__new__"); +#endif + if (data->newraw) { + Py_INCREF(data->newraw); + data->newargs = PyTuple_New(1); + PyTuple_SetItem(data->newargs, 0, obj); + } else { + data->newargs = obj; + } + Py_INCREF(data->newargs); + } + /* the destroy method, aka as the C++ delete method */ + data->destroy = PyObject_GetAttrString(data->klass, (char *)"__swig_destroy__"); + if (PyErr_Occurred()) { + PyErr_Clear(); + data->destroy = 0; + } + if (data->destroy) { + int flags; + Py_INCREF(data->destroy); + flags = PyCFunction_GET_FLAGS(data->destroy); +#ifdef METH_O + data->delargs = !(flags & (METH_O)); +#else + data->delargs = 0; +#endif + } else { + data->delargs = 0; + } + data->implicitconv = 0; + data->pytype = 0; + return data; + } +} + +SWIGRUNTIME void +SwigPyClientData_Del(SwigPyClientData *data) { + Py_XDECREF(data->newraw); + Py_XDECREF(data->newargs); + Py_XDECREF(data->destroy); +} + +/* =============== SwigPyObject =====================*/ + +typedef struct { + PyObject_HEAD + void *ptr; + swig_type_info *ty; + int own; + PyObject *next; +#ifdef SWIGPYTHON_BUILTIN + PyObject *dict; +#endif +} SwigPyObject; + + +#ifdef SWIGPYTHON_BUILTIN + +SWIGRUNTIME PyObject * +SwigPyObject_get___dict__(PyObject *v, PyObject *SWIGUNUSEDPARM(args)) +{ + SwigPyObject *sobj = (SwigPyObject *)v; + + if (!sobj->dict) + sobj->dict = PyDict_New(); + + Py_INCREF(sobj->dict); + return sobj->dict; +} + +#endif + +SWIGRUNTIME PyObject * +SwigPyObject_long(SwigPyObject *v) +{ + return PyLong_FromVoidPtr(v->ptr); +} + +SWIGRUNTIME PyObject * +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); + if (ofmt) { +#if PY_VERSION_HEX >= 0x03000000 + res = PyUnicode_Format(ofmt,args); +#else + res = PyString_Format(ofmt,args); +#endif + Py_DECREF(ofmt); + } + Py_DECREF(args); + } + } + return res; +} + +SWIGRUNTIME PyObject * +SwigPyObject_oct(SwigPyObject *v) +{ + return SwigPyObject_format("%o",v); +} + +SWIGRUNTIME PyObject * +SwigPyObject_hex(SwigPyObject *v) +{ + return SwigPyObject_format("%x",v); +} + +SWIGRUNTIME PyObject * +#ifdef METH_NOARGS +SwigPyObject_repr(SwigPyObject *v) +#else +SwigPyObject_repr(SwigPyObject *v, PyObject *args) +#endif +{ + const char *name = SWIG_TypePrettyName(v->ty); + PyObject *repr = SWIG_Python_str_FromFormat("", (name ? name : "unknown"), (void *)v); + if (v->next) { +# ifdef METH_NOARGS + PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next); +# else + PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args); +# endif +# if PY_VERSION_HEX >= 0x03000000 + PyObject *joined = PyUnicode_Concat(repr, nrep); + Py_DecRef(repr); + Py_DecRef(nrep); + repr = joined; +# else + PyString_ConcatAndDel(&repr,nrep); +# endif + } + return repr; +} + +SWIGRUNTIME int +SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w) +{ + void *i = v->ptr; + void *j = w->ptr; + return (i < j) ? -1 : ((i > j) ? 1 : 0); +} + +/* Added for Python 3.x, would it also be useful for Python 2.x? */ +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; + } + res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0); + return res; +} + + +SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void); + +#ifdef SWIGPYTHON_BUILTIN +static swig_type_info *SwigPyObject_stype = 0; +SWIGRUNTIME PyTypeObject* +SwigPyObject_type(void) { + SwigPyClientData *cd; + assert(SwigPyObject_stype); + cd = (SwigPyClientData*) SwigPyObject_stype->clientdata; + assert(cd); + assert(cd->pytype); + return cd->pytype; +} +#else +SWIGRUNTIME PyTypeObject* +SwigPyObject_type(void) { + static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyObject_TypeOnce(); + return type; +} +#endif + +SWIGRUNTIMEINLINE int +SwigPyObject_Check(PyObject *op) { +#ifdef SWIGPYTHON_BUILTIN + PyTypeObject *target_tp = SwigPyObject_type(); + if (PyType_IsSubtype(op->ob_type, target_tp)) + return 1; + return (strcmp(op->ob_type->tp_name, "SwigPyObject") == 0); +#else + return (Py_TYPE(op) == SwigPyObject_type()) + || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0); +#endif +} + +SWIGRUNTIME PyObject * +SwigPyObject_New(void *ptr, swig_type_info *ty, int own); + +SWIGRUNTIME void +SwigPyObject_dealloc(PyObject *v) +{ + SwigPyObject *sobj = (SwigPyObject *) v; + PyObject *next = sobj->next; + if (sobj->own == SWIG_POINTER_OWN) { + swig_type_info *ty = sobj->ty; + SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; + PyObject *destroy = data ? data->destroy : 0; + if (destroy) { + /* destroy is always a VARARGS method */ + PyObject *res; + + /* PyObject_CallFunction() has the potential to silently drop + the active active exception. In cases of unnamed temporary + variable or where we just finished iterating over a generator + StopIteration will be active right now, and this needs to + remain true upon return from SwigPyObject_dealloc. So save + and restore. */ + + PyObject *val = NULL, *type = NULL, *tb = NULL; + PyErr_Fetch(&val, &type, &tb); + + 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); + } else { + PyCFunction meth = PyCFunction_GET_FUNCTION(destroy); + PyObject *mself = PyCFunction_GET_SELF(destroy); + res = ((*meth)(mself, v)); + } + if (!res) + PyErr_WriteUnraisable(destroy); + + PyErr_Restore(val, type, tb); + + Py_XDECREF(res); + } +#if !defined(SWIG_PYTHON_SILENT_MEMLEAK) + else { + const char *name = SWIG_TypePrettyName(ty); + printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown")); + } +#endif + } + Py_XDECREF(next); + PyObject_DEL(v); +} + +SWIGRUNTIME PyObject* +SwigPyObject_append(PyObject* v, PyObject* next) +{ + SwigPyObject *sobj = (SwigPyObject *) v; +#ifndef METH_O + PyObject *tmp = 0; + if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL; + next = tmp; +#endif + if (!SwigPyObject_Check(next)) { + PyErr_SetString(PyExc_TypeError, "Attempt to append a non SwigPyObject"); + return NULL; + } + sobj->next = next; + Py_INCREF(next); + return SWIG_Py_Void(); +} + +SWIGRUNTIME PyObject* +#ifdef METH_NOARGS +SwigPyObject_next(PyObject* v) +#else +SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) +#endif +{ + SwigPyObject *sobj = (SwigPyObject *) v; + if (sobj->next) { + Py_INCREF(sobj->next); + return sobj->next; + } else { + return SWIG_Py_Void(); + } +} + +SWIGINTERN PyObject* +#ifdef METH_NOARGS +SwigPyObject_disown(PyObject *v) +#else +SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) +#endif +{ + SwigPyObject *sobj = (SwigPyObject *)v; + sobj->own = 0; + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject* +#ifdef METH_NOARGS +SwigPyObject_acquire(PyObject *v) +#else +SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) +#endif +{ + SwigPyObject *sobj = (SwigPyObject *)v; + sobj->own = SWIG_POINTER_OWN; + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject* +SwigPyObject_own(PyObject *v, PyObject *args) +{ + PyObject *val = 0; +#if (PY_VERSION_HEX < 0x02020000) + if (!PyArg_ParseTuple(args,(char *)"|O:own",&val)) +#elif (PY_VERSION_HEX < 0x02050000) + if (!PyArg_UnpackTuple(args, (char *)"own", 0, 1, &val)) +#else + if (!PyArg_UnpackTuple(args, "own", 0, 1, &val)) +#endif + { + return NULL; + } + else + { + SwigPyObject *sobj = (SwigPyObject *)v; + PyObject *obj = PyBool_FromLong(sobj->own); + if (val) { +#ifdef METH_NOARGS + if (PyObject_IsTrue(val)) { + SwigPyObject_acquire(v); + } else { + SwigPyObject_disown(v); + } +#else + if (PyObject_IsTrue(val)) { + SwigPyObject_acquire(v,args); + } else { + SwigPyObject_disown(v,args); + } +#endif + } + return obj; + } +} + +#ifdef METH_O +static PyMethodDef +swigobject_methods[] = { + {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"}, + {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS, (char *)"acquires ownership of the pointer"}, + {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, + {(char *)"append", (PyCFunction)SwigPyObject_append, METH_O, (char *)"appends another 'this' object"}, + {(char *)"next", (PyCFunction)SwigPyObject_next, METH_NOARGS, (char *)"returns the next 'this' object"}, + {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_NOARGS, (char *)"returns object representation"}, + {0, 0, 0, 0} +}; +#else +static PyMethodDef +swigobject_methods[] = { + {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"}, + {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS, (char *)"acquires ownership of the pointer"}, + {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, + {(char *)"append", (PyCFunction)SwigPyObject_append, METH_VARARGS, (char *)"appends another 'this' object"}, + {(char *)"next", (PyCFunction)SwigPyObject_next, METH_VARARGS, (char *)"returns the next 'this' object"}, + {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_VARARGS, (char *)"returns object representation"}, + {0, 0, 0, 0} +}; +#endif + +#if PY_VERSION_HEX < 0x02020000 +SWIGINTERN PyObject * +SwigPyObject_getattr(SwigPyObject *sobj,char *name) +{ + return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name); +} +#endif + +SWIGRUNTIME PyTypeObject* +SwigPyObject_TypeOnce(void) { + static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer"; + + static PyNumberMethods SwigPyObject_as_number = { + (binaryfunc)0, /*nb_add*/ + (binaryfunc)0, /*nb_subtract*/ + (binaryfunc)0, /*nb_multiply*/ + /* nb_divide removed in Python 3 */ +#if PY_VERSION_HEX < 0x03000000 + (binaryfunc)0, /*nb_divide*/ +#endif + (binaryfunc)0, /*nb_remainder*/ + (binaryfunc)0, /*nb_divmod*/ + (ternaryfunc)0,/*nb_power*/ + (unaryfunc)0, /*nb_negative*/ + (unaryfunc)0, /*nb_positive*/ + (unaryfunc)0, /*nb_absolute*/ + (inquiry)0, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ +#if PY_VERSION_HEX < 0x03000000 + 0, /*nb_coerce*/ +#endif + (unaryfunc)SwigPyObject_long, /*nb_int*/ +#if PY_VERSION_HEX < 0x03000000 + (unaryfunc)SwigPyObject_long, /*nb_long*/ +#else + 0, /*nb_reserved*/ +#endif + (unaryfunc)0, /*nb_float*/ +#if PY_VERSION_HEX < 0x03000000 + (unaryfunc)SwigPyObject_oct, /*nb_oct*/ + (unaryfunc)SwigPyObject_hex, /*nb_hex*/ +#endif +#if PY_VERSION_HEX >= 0x03050000 /* 3.5 */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_matrix_multiply */ +#elif PY_VERSION_HEX >= 0x03000000 /* 3.0 */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */ +#elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */ +#elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */ +#elif PY_VERSION_HEX >= 0x02000000 /* 2.0.0 */ + 0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_or */ +#endif + }; + + static PyTypeObject swigpyobject_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 + (char *)"SwigPyObject", /* tp_name */ + sizeof(SwigPyObject), /* tp_basicsize */ + 0, /* tp_itemsize */ + (destructor)SwigPyObject_dealloc, /* tp_dealloc */ + 0, /* tp_print */ +#if PY_VERSION_HEX < 0x02020000 + (getattrfunc)SwigPyObject_getattr, /* tp_getattr */ +#else + (getattrfunc)0, /* tp_getattr */ +#endif + (setattrfunc)0, /* tp_setattr */ +#if PY_VERSION_HEX >= 0x03000000 + 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */ +#else + (cmpfunc)SwigPyObject_compare, /* tp_compare */ +#endif + (reprfunc)SwigPyObject_repr, /* tp_repr */ + &SwigPyObject_as_number, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + (hashfunc)0, /* tp_hash */ + (ternaryfunc)0, /* tp_call */ + 0, /* tp_str */ + PyObject_GenericGetAttr, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT, /* tp_flags */ + swigobject_doc, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + (richcmpfunc)SwigPyObject_richcompare,/* tp_richcompare */ + 0, /* tp_weaklistoffset */ +#if PY_VERSION_HEX >= 0x02020000 + 0, /* tp_iter */ + 0, /* tp_iternext */ + swigobject_methods, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + 0, /* tp_free */ + 0, /* tp_is_gc */ + 0, /* tp_bases */ + 0, /* tp_mro */ + 0, /* tp_cache */ + 0, /* tp_subclasses */ + 0, /* tp_weaklist */ +#endif +#if PY_VERSION_HEX >= 0x02030000 + 0, /* tp_del */ +#endif +#if PY_VERSION_HEX >= 0x02060000 + 0, /* tp_version_tag */ +#endif +#if PY_VERSION_HEX >= 0x03040000 + 0, /* tp_finalize */ +#endif +#ifdef COUNT_ALLOCS + 0, /* tp_allocs */ + 0, /* tp_frees */ + 0, /* tp_maxalloc */ +#if PY_VERSION_HEX >= 0x02050000 + 0, /* tp_prev */ +#endif + 0 /* tp_next */ +#endif + }; + swigpyobject_type = tmp; + type_init = 1; +#if PY_VERSION_HEX < 0x02020000 + swigpyobject_type.ob_type = &PyType_Type; +#else + if (PyType_Ready(&swigpyobject_type) < 0) + return NULL; +#endif + } + return &swigpyobject_type; +} + +SWIGRUNTIME PyObject * +SwigPyObject_New(void *ptr, swig_type_info *ty, int own) +{ + SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type()); + if (sobj) { + sobj->ptr = ptr; + sobj->ty = ty; + sobj->own = own; + sobj->next = 0; + } + return (PyObject *)sobj; +} + +/* ----------------------------------------------------------------------------- + * Implements a simple Swig Packed type, and use it instead of string + * ----------------------------------------------------------------------------- */ + +typedef struct { + PyObject_HEAD + void *pack; + swig_type_info *ty; + size_t size; +} SwigPyPacked; + +SWIGRUNTIME int +SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags)) +{ + char result[SWIG_BUFFER_SIZE]; + fputs("pack, v->size, 0, sizeof(result))) { + fputs("at ", fp); + fputs(result, fp); + } + fputs(v->ty->name,fp); + fputs(">", fp); + return 0; +} + +SWIGRUNTIME PyObject * +SwigPyPacked_repr(SwigPyPacked *v) +{ + char result[SWIG_BUFFER_SIZE]; + if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) { + return SWIG_Python_str_FromFormat("", result, v->ty->name); + } else { + return SWIG_Python_str_FromFormat("", v->ty->name); + } +} + +SWIGRUNTIME PyObject * +SwigPyPacked_str(SwigPyPacked *v) +{ + char result[SWIG_BUFFER_SIZE]; + if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){ + return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name); + } else { + return SWIG_Python_str_FromChar(v->ty->name); + } +} + +SWIGRUNTIME int +SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w) +{ + size_t i = v->size; + size_t j = w->size; + int s = (i < j) ? -1 : ((i > j) ? 1 : 0); + return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size); +} + +SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void); + +SWIGRUNTIME PyTypeObject* +SwigPyPacked_type(void) { + static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyPacked_TypeOnce(); + return type; +} + +SWIGRUNTIMEINLINE int +SwigPyPacked_Check(PyObject *op) { + return ((op)->ob_type == SwigPyPacked_TypeOnce()) + || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0); +} + +SWIGRUNTIME void +SwigPyPacked_dealloc(PyObject *v) +{ + if (SwigPyPacked_Check(v)) { + SwigPyPacked *sobj = (SwigPyPacked *) v; + free(sobj->pack); + } + PyObject_DEL(v); +} + +SWIGRUNTIME PyTypeObject* +SwigPyPacked_TypeOnce(void) { + static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer"; + static PyTypeObject swigpypacked_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 + (char *)"SwigPyPacked", /* tp_name */ + sizeof(SwigPyPacked), /* tp_basicsize */ + 0, /* tp_itemsize */ + (destructor)SwigPyPacked_dealloc, /* tp_dealloc */ + (printfunc)SwigPyPacked_print, /* tp_print */ + (getattrfunc)0, /* tp_getattr */ + (setattrfunc)0, /* tp_setattr */ +#if PY_VERSION_HEX>=0x03000000 + 0, /* tp_reserved in 3.0.1 */ +#else + (cmpfunc)SwigPyPacked_compare, /* tp_compare */ +#endif + (reprfunc)SwigPyPacked_repr, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + (hashfunc)0, /* tp_hash */ + (ternaryfunc)0, /* tp_call */ + (reprfunc)SwigPyPacked_str, /* tp_str */ + PyObject_GenericGetAttr, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT, /* tp_flags */ + swigpacked_doc, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ +#if PY_VERSION_HEX >= 0x02020000 + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + 0, /* tp_free */ + 0, /* tp_is_gc */ + 0, /* tp_bases */ + 0, /* tp_mro */ + 0, /* tp_cache */ + 0, /* tp_subclasses */ + 0, /* tp_weaklist */ +#endif +#if PY_VERSION_HEX >= 0x02030000 + 0, /* tp_del */ +#endif +#if PY_VERSION_HEX >= 0x02060000 + 0, /* tp_version_tag */ +#endif +#if PY_VERSION_HEX >= 0x03040000 + 0, /* tp_finalize */ +#endif +#ifdef COUNT_ALLOCS + 0, /* tp_allocs */ + 0, /* tp_frees */ + 0, /* tp_maxalloc */ +#if PY_VERSION_HEX >= 0x02050000 + 0, /* tp_prev */ +#endif + 0 /* tp_next */ +#endif + }; + swigpypacked_type = tmp; + type_init = 1; +#if PY_VERSION_HEX < 0x02020000 + swigpypacked_type.ob_type = &PyType_Type; +#else + if (PyType_Ready(&swigpypacked_type) < 0) + return NULL; +#endif + } + return &swigpypacked_type; +} + +SWIGRUNTIME PyObject * +SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty) +{ + SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type()); + if (sobj) { + void *pack = malloc(size); + if (pack) { + memcpy(pack, ptr, size); + sobj->pack = pack; + sobj->ty = ty; + sobj->size = size; + } else { + PyObject_DEL((PyObject *) sobj); + sobj = 0; + } + } + return (PyObject *) sobj; +} + +SWIGRUNTIME swig_type_info * +SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size) +{ + if (SwigPyPacked_Check(obj)) { + SwigPyPacked *sobj = (SwigPyPacked *)obj; + if (sobj->size != size) return 0; + memcpy(ptr, sobj->pack, size); + return sobj->ty; + } else { + return 0; + } +} + +/* ----------------------------------------------------------------------------- + * pointers/data manipulation + * ----------------------------------------------------------------------------- */ + +SWIGRUNTIMEINLINE PyObject * +_SWIG_This(void) +{ + return SWIG_Python_str_FromChar("this"); +} + +static PyObject *swig_this = NULL; + +SWIGRUNTIME PyObject * +SWIG_This(void) +{ + if (swig_this == NULL) + swig_this = _SWIG_This(); + return swig_this; +} + +/* #define SWIG_PYTHON_SLOW_GETSET_THIS */ + +/* TODO: I don't know how to implement the fast getset in Python 3 right now */ +#if PY_VERSION_HEX>=0x03000000 +#define SWIG_PYTHON_SLOW_GETSET_THIS +#endif + +SWIGRUNTIME SwigPyObject * +SWIG_Python_GetSwigThis(PyObject *pyobj) +{ + PyObject *obj; + + if (SwigPyObject_Check(pyobj)) + return (SwigPyObject *) pyobj; + +#ifdef SWIGPYTHON_BUILTIN + (void)obj; +# ifdef PyWeakref_CheckProxy + if (PyWeakref_CheckProxy(pyobj)) { + pyobj = PyWeakref_GET_OBJECT(pyobj); + if (pyobj && SwigPyObject_Check(pyobj)) + return (SwigPyObject*) pyobj; + } +# endif + return NULL; +#else + + obj = 0; + +#if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000)) + if (PyInstance_Check(pyobj)) { + obj = _PyInstance_Lookup(pyobj, SWIG_This()); + } else { + PyObject **dictptr = _PyObject_GetDictPtr(pyobj); + if (dictptr != NULL) { + PyObject *dict = *dictptr; + obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0; + } else { +#ifdef PyWeakref_CheckProxy + if (PyWeakref_CheckProxy(pyobj)) { + PyObject *wobj = PyWeakref_GET_OBJECT(pyobj); + return wobj ? SWIG_Python_GetSwigThis(wobj) : 0; + } +#endif + obj = PyObject_GetAttr(pyobj,SWIG_This()); + if (obj) { + Py_DECREF(obj); + } else { + if (PyErr_Occurred()) PyErr_Clear(); + return 0; + } + } + } +#else + obj = PyObject_GetAttr(pyobj,SWIG_This()); + if (obj) { + Py_DECREF(obj); + } else { + if (PyErr_Occurred()) PyErr_Clear(); + return 0; + } +#endif + if (obj && !SwigPyObject_Check(obj)) { + /* a PyObject is called 'this', try to get the 'real this' + SwigPyObject from it */ + return SWIG_Python_GetSwigThis(obj); + } + return (SwigPyObject *)obj; +#endif +} + +/* Acquire a pointer value */ + +SWIGRUNTIME int +SWIG_Python_AcquirePtr(PyObject *obj, int own) { + if (own == SWIG_POINTER_OWN) { + SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj); + if (sobj) { + int oldown = sobj->own; + sobj->own = own; + return oldown; + } + } + return 0; +} + +/* Convert a pointer value */ + +SWIGRUNTIME int +SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) { + int res; + SwigPyObject *sobj; + int implicit_conv = (flags & SWIG_POINTER_IMPLICIT_CONV) != 0; + + if (!obj) + return SWIG_ERROR; + if (obj == Py_None && !implicit_conv) { + if (ptr) + *ptr = 0; + return SWIG_OK; + } + + res = SWIG_ERROR; + + sobj = SWIG_Python_GetSwigThis(obj); + if (own) + *own = 0; + while (sobj) { + void *vptr = sobj->ptr; + if (ty) { + swig_type_info *to = sobj->ty; + if (to == ty) { + /* no type cast needed */ + if (ptr) *ptr = vptr; + break; + } else { + swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); + if (!tc) { + sobj = (SwigPyObject *)sobj->next; + } else { + if (ptr) { + int newmemory = 0; + *ptr = SWIG_TypeCast(tc,vptr,&newmemory); + if (newmemory == SWIG_CAST_NEW_MEMORY) { + assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */ + if (own) + *own = *own | SWIG_CAST_NEW_MEMORY; + } + } + break; + } + } + } else { + if (ptr) *ptr = vptr; + break; + } + } + if (sobj) { + if (own) + *own = *own | sobj->own; + if (flags & SWIG_POINTER_DISOWN) { + sobj->own = 0; + } + res = SWIG_OK; + } else { + if (implicit_conv) { + SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; + if (data && !data->implicitconv) { + PyObject *klass = data->klass; + if (klass) { + PyObject *impconv; + data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/ + impconv = SWIG_Python_CallFunctor(klass, obj); + data->implicitconv = 0; + if (PyErr_Occurred()) { + PyErr_Clear(); + impconv = 0; + } + if (impconv) { + SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv); + if (iobj) { + void *vptr; + res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0); + if (SWIG_IsOK(res)) { + if (ptr) { + *ptr = vptr; + /* transfer the ownership to 'ptr' */ + iobj->own = 0; + res = SWIG_AddCast(res); + res = SWIG_AddNewMask(res); + } else { + res = SWIG_AddCast(res); + } + } + } + Py_DECREF(impconv); + } + } + } + } + if (!SWIG_IsOK(res) && obj == Py_None) { + if (ptr) + *ptr = 0; + if (PyErr_Occurred()) + PyErr_Clear(); + res = SWIG_OK; + } + } + return res; +} + +/* Convert a function ptr value */ + +SWIGRUNTIME int +SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) { + if (!PyCFunction_Check(obj)) { + return SWIG_ConvertPtr(obj, ptr, ty, 0); + } else { + void *vptr = 0; + + /* here we get the method pointer for callbacks */ + const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); + const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0; + if (desc) + desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0; + if (!desc) + return SWIG_ERROR; + if (ty) { + swig_cast_info *tc = SWIG_TypeCheck(desc,ty); + if (tc) { + int newmemory = 0; + *ptr = SWIG_TypeCast(tc,vptr,&newmemory); + assert(!newmemory); /* newmemory handling not yet implemented */ + } else { + return SWIG_ERROR; + } + } else { + *ptr = vptr; + } + return SWIG_OK; + } +} + +/* Convert a packed value value */ + +SWIGRUNTIME int +SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) { + swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz); + if (!to) return SWIG_ERROR; + if (ty) { + if (to != ty) { + /* check type cast? */ + swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); + if (!tc) return SWIG_ERROR; + } + } + return SWIG_OK; +} + +/* ----------------------------------------------------------------------------- + * Create a new pointer object + * ----------------------------------------------------------------------------- */ + +/* + Create a new instance object, without calling __init__, and set the + 'this' attribute. +*/ + +SWIGRUNTIME PyObject* +SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) +{ +#if (PY_VERSION_HEX >= 0x02020000) + PyObject *inst = 0; + PyObject *newraw = data->newraw; + if (newraw) { + inst = PyObject_Call(newraw, data->newargs, NULL); + if (inst) { +#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); + } + } +#else + PyObject *key = SWIG_This(); + PyObject_SetAttr(inst, key, swig_this); +#endif + } + } else { +#if PY_VERSION_HEX >= 0x03000000 + inst = ((PyTypeObject*) data->newargs)->tp_new((PyTypeObject*) data->newargs, Py_None, Py_None); + if (inst) { + PyObject_SetAttr(inst, SWIG_This(), swig_this); + Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG; + } +#else + PyObject *dict = PyDict_New(); + if (dict) { + PyDict_SetItem(dict, SWIG_This(), swig_this); + inst = PyInstance_NewRaw(data->newargs, dict); + Py_DECREF(dict); + } +#endif + } + return inst; +#else +#if (PY_VERSION_HEX >= 0x02010000) + PyObject *inst = 0; + PyObject *dict = PyDict_New(); + if (dict) { + PyDict_SetItem(dict, SWIG_This(), swig_this); + inst = PyInstance_NewRaw(data->newargs, dict); + Py_DECREF(dict); + } + return (PyObject *) inst; +#else + PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type); + if (inst == NULL) { + return NULL; + } + inst->in_class = (PyClassObject *)data->newargs; + Py_INCREF(inst->in_class); + inst->in_dict = PyDict_New(); + if (inst->in_dict == NULL) { + Py_DECREF(inst); + return NULL; + } +#ifdef Py_TPFLAGS_HAVE_WEAKREFS + inst->in_weakreflist = NULL; +#endif +#ifdef Py_TPFLAGS_GC + PyObject_GC_Init(inst); +#endif + PyDict_SetItem(inst->in_dict, SWIG_This(), swig_this); + return (PyObject *) inst; +#endif +#endif +} + +SWIGRUNTIME void +SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this) +{ + PyObject *dict; +#if (PY_VERSION_HEX >= 0x02020000) && !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; + } +#endif + dict = PyObject_GetAttrString(inst, (char*)"__dict__"); + PyDict_SetItem(dict, SWIG_This(), swig_this); + Py_DECREF(dict); +} + + +SWIGINTERN PyObject * +SWIG_Python_InitShadowInstance(PyObject *args) { + PyObject *obj[2]; + if (!SWIG_Python_UnpackTuple(args, "swiginit", 2, 2, obj)) { + return NULL; + } else { + SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]); + if (sthis) { + SwigPyObject_append((PyObject*) sthis, obj[1]); + } else { + SWIG_Python_SetSwigThis(obj[0], obj[1]); + } + return SWIG_Py_Void(); + } +} + +/* Create a new pointer object */ + +SWIGRUNTIME PyObject * +SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags) { + SwigPyClientData *clientdata; + PyObject * robj; + int own; + + if (!ptr) + return SWIG_Py_Void(); + + clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0; + own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0; + if (clientdata && clientdata->pytype) { + SwigPyObject *newobj; + if (flags & SWIG_BUILTIN_TP_INIT) { + newobj = (SwigPyObject*) self; + if (newobj->ptr) { + PyObject *next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0); + while (newobj->next) + newobj = (SwigPyObject *) newobj->next; + newobj->next = next_self; + newobj = (SwigPyObject *)next_self; +#ifdef SWIGPYTHON_BUILTIN + newobj->dict = 0; +#endif + } + } else { + newobj = PyObject_New(SwigPyObject, clientdata->pytype); +#ifdef SWIGPYTHON_BUILTIN + newobj->dict = 0; +#endif + } + if (newobj) { + newobj->ptr = ptr; + newobj->ty = type; + newobj->own = own; + newobj->next = 0; + return (PyObject*) newobj; + } + return SWIG_Py_Void(); + } + + assert(!(flags & SWIG_BUILTIN_TP_INIT)); + + robj = SwigPyObject_New(ptr, type, own); + if (robj && clientdata && !(flags & SWIG_POINTER_NOSHADOW)) { + PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj); + Py_DECREF(robj); + robj = inst; + } + return robj; +} + +/* Create a new packed object */ + +SWIGRUNTIMEINLINE PyObject * +SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) { + return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void(); +} + +/* -----------------------------------------------------------------------------* + * Get type list + * -----------------------------------------------------------------------------*/ + +#ifdef SWIG_LINK_RUNTIME +void *SWIG_ReturnGlobalTypeList(void *); +#endif + +SWIGRUNTIME swig_module_info * +SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata)) { + 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 +# ifdef SWIGPY_USE_CAPSULE + type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0); +# else + type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, + (char*)"type_pointer" SWIG_TYPE_TABLE_NAME); +# endif + if (PyErr_Occurred()) { + PyErr_Clear(); + type_pointer = (void *)0; + } +#endif + } + return (swig_module_info *) type_pointer; +} + +#if PY_MAJOR_VERSION < 2 +/* PyModule_AddObject function was introduced in Python 2.0. The following function + is copied out of Python/modsupport.c in python version 2.3.4 */ +SWIGINTERN int +PyModule_AddObject(PyObject *m, char *name, PyObject *o) +{ + PyObject *dict; + if (!PyModule_Check(m)) { + PyErr_SetString(PyExc_TypeError, "PyModule_AddObject() needs module as first arg"); + return SWIG_ERROR; + } + if (!o) { + PyErr_SetString(PyExc_TypeError, "PyModule_AddObject() needs non-NULL value"); + return SWIG_ERROR; + } + + dict = PyModule_GetDict(m); + if (dict == NULL) { + /* Internal error -- modules must have a dict! */ + PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__", + PyModule_GetName(m)); + return SWIG_ERROR; + } + if (PyDict_SetItemString(dict, name, o)) + return SWIG_ERROR; + Py_DECREF(o); + return SWIG_OK; +} +#endif + +SWIGRUNTIME void +#ifdef SWIGPY_USE_CAPSULE +SWIG_Python_DestroyModule(PyObject *obj) +#else +SWIG_Python_DestroyModule(void *vptr) +#endif +{ +#ifdef SWIGPY_USE_CAPSULE + swig_module_info *swig_module = (swig_module_info *) PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME); +#else + swig_module_info *swig_module = (swig_module_info *) vptr; +#endif + swig_type_info **types = swig_module->types; + size_t i; + for (i =0; i < swig_module->size; ++i) { + swig_type_info *ty = types[i]; + if (ty->owndata) { + SwigPyClientData *data = (SwigPyClientData *) ty->clientdata; + if (data) SwigPyClientData_Del(data); + } + } + Py_DECREF(SWIG_This()); + swig_this = NULL; +} + +SWIGRUNTIME void +SWIG_Python_SetModule(swig_module_info *swig_module) { +#if PY_VERSION_HEX >= 0x03000000 + /* Add a dummy module object into sys.modules */ + PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION); +#else + static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} }; /* Sentinel */ + PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table); +#endif +#ifdef SWIGPY_USE_CAPSULE + PyObject *pointer = PyCapsule_New((void *) swig_module, SWIGPY_CAPSULE_NAME, SWIG_Python_DestroyModule); + if (pointer && module) { + PyModule_AddObject(module, (char*)"type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer); + } else { + Py_XDECREF(pointer); + } +#else + PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule); + if (pointer && module) { + PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer); + } else { + Py_XDECREF(pointer); + } +#endif +} + +/* 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) +{ + PyObject *cache = SWIG_Python_TypeCache(); + PyObject *key = SWIG_Python_str_FromChar(type); + PyObject *obj = PyDict_GetItem(cache, key); + swig_type_info *descriptor; + if (obj) { +#ifdef SWIGPY_USE_CAPSULE + descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, NULL); +#else + descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj); +#endif + } else { + swig_module_info *swig_module = SWIG_GetModule(0); + descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type); + if (descriptor) { +#ifdef SWIGPY_USE_CAPSULE + obj = PyCapsule_New((void*) descriptor, NULL, NULL); +#else + obj = PyCObject_FromVoidPtr(descriptor, NULL); +#endif + PyDict_SetItem(cache, key, obj); + Py_DECREF(obj); + } + } + Py_DECREF(key); + return descriptor; +} + +/* + For backward compatibility only +*/ +#define SWIG_POINTER_EXCEPTION 0 +#define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg) +#define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags) + +SWIGRUNTIME int +SWIG_Python_AddErrMesg(const char* mesg, int infront) +{ + if (PyErr_Occurred()) { + PyObject *type = 0; + PyObject *value = 0; + PyObject *traceback = 0; + PyErr_Fetch(&type, &value, &traceback); + if (value) { + char *tmp; + PyObject *old_str = PyObject_Str(value); + Py_XINCREF(type); + PyErr_Clear(); + if (infront) { + PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str)); + } else { + PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); + } + SWIG_Python_str_DelForPy3(tmp); + Py_DECREF(old_str); + } + return 1; + } else { + return 0; + } +} + +SWIGRUNTIME int +SWIG_Python_ArgFail(int argnum) +{ + if (PyErr_Occurred()) { + /* add information about failing argument */ + char mesg[256]; + PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum); + return SWIG_Python_AddErrMesg(mesg, 1); + } else { + return 0; + } +} + +SWIGRUNTIMEINLINE const char * +SwigPyObject_GetDesc(PyObject *self) +{ + SwigPyObject *v = (SwigPyObject *)self; + swig_type_info *ty = v ? v->ty : 0; + return ty ? ty->str : ""; +} + +SWIGRUNTIME void +SWIG_Python_TypeError(const char *type, PyObject *obj) +{ + if (type) { +#if defined(SWIG_COBJECT_TYPES) + if (obj && SwigPyObject_Check(obj)) { + const char *otype = (const char *) SwigPyObject_GetDesc(obj); + if (otype) { + PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received", + type, otype); + return; + } + } else +#endif + { + 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; + 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(str); + return; + } + } + PyErr_Format(PyExc_TypeError, "a '%s' is expected", type); + } else { + PyErr_Format(PyExc_TypeError, "unexpected type is received"); + } +} + + +/* Convert a pointer value, signal an exception on a type mismatch */ +SWIGRUNTIME void * +SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags) { + 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; +} + +#ifdef SWIGPYTHON_BUILTIN +SWIGRUNTIME int +SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { + PyTypeObject *tp = obj->ob_type; + PyObject *descr; + PyObject *encoded_name; + descrsetfunc f; + int res = -1; + +# ifdef Py_USING_UNICODE + if (PyString_Check(name)) { + name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL); + if (!name) + return -1; + } else if (!PyUnicode_Check(name)) +# else + if (!PyString_Check(name)) +# endif + { + PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name); + return -1; + } else { + Py_INCREF(name); + } + + if (!tp->tp_dict) { + if (PyType_Ready(tp) < 0) + goto done; + } + + descr = _PyType_Lookup(tp, name); + f = NULL; + if (descr != NULL) + f = descr->ob_type->tp_descr_set; + if (!f) { + if (PyString_Check(name)) { + encoded_name = name; + Py_INCREF(name); + } else { + encoded_name = PyUnicode_AsUTF8String(name); + } + PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name)); + Py_DECREF(encoded_name); + } else { + res = f(descr, obj, value); + } + + done: + Py_DECREF(name); + return res; +} +#endif + + +#ifdef __cplusplus +} +#endif + + + +#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 + + + +/* -------- TYPES TABLE (BEGIN) -------- */ + +#define SWIGTYPE_p_char swig_types[0] +#define SWIGTYPE_p_int swig_types[1] +static swig_type_info *swig_types[3]; +static swig_module_info swig_module = {swig_types, 2, 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) + +/* -------- TYPES TABLE (END) -------- */ + +#if (PY_VERSION_HEX <= 0x02000000) +# if !defined(SWIG_PYTHON_CLASSIC) +# error "This python version requires swig to be run with the '-classic' option" +# endif +#endif + +/*----------------------------------------------- + @(target):= _versionhelper.so + ------------------------------------------------*/ +#if PY_VERSION_HEX >= 0x03000000 +# define SWIG_init PyInit__versionhelper + +#else +# define SWIG_init init_versionhelper + +#endif +#define SWIG_name "_versionhelper" + +#define SWIGVERSION 0x030012 +#define SWIG_VERSION SWIGVERSION + + +#define SWIG_as_voidptr(a) (void *)((const void *)(a)) +#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a)) + + +#include "blpapi_versioninfo.h" + + +SWIGINTERNINLINE PyObject* + SWIG_From_int (int value) +{ + return PyInt_FromLong((long) value); +} + + +SWIGINTERN swig_type_info* +SWIG_pchar_descriptor(void) +{ + static int init = 0; + static swig_type_info* info = 0; + if (!init) { + info = SWIG_TypeQuery("_p_char"); + init = 1; + } + return info; +} + + +SWIGINTERNINLINE PyObject * +SWIG_FromCharPtrAndSize(const char* carray, size_t size) +{ + if (carray) { + if (size > INT_MAX) { + swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); + return pchar_descriptor ? + SWIG_InternalNewPointerObj((char *)(carray), pchar_descriptor, 0) : SWIG_Py_Void(); + } else { +#if PY_VERSION_HEX >= 0x03000000 +#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) + return PyBytes_FromStringAndSize(carray, (Py_ssize_t)(size)); +#else +#if PY_VERSION_HEX >= 0x03010000 + return PyUnicode_DecodeUTF8(carray, (Py_ssize_t)(size), "surrogateescape"); +#else + return PyUnicode_FromStringAndSize(carray, (Py_ssize_t)(size)); +#endif +#endif +#else + return PyString_FromStringAndSize(carray, (Py_ssize_t)(size)); +#endif + } + } else { + return SWIG_Py_Void(); + } +} + + +SWIGINTERNINLINE PyObject * +SWIG_FromCharPtr(const char *cptr) +{ + return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0)); +} + +#ifdef __cplusplus +extern "C" { +#endif +SWIGINTERN PyObject *_wrap_blpapi_getVersionInfo(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int *arg1 = (int *) 0 ; + int *arg2 = (int *) 0 ; + int *arg3 = (int *) 0 ; + int *arg4 = (int *) 0 ; + int temp1 ; + int res1 = SWIG_TMPOBJ ; + int temp2 ; + int res2 = SWIG_TMPOBJ ; + int temp3 ; + int res3 = SWIG_TMPOBJ ; + int temp4 ; + int res4 = SWIG_TMPOBJ ; + + arg1 = &temp1; + arg2 = &temp2; + arg3 = &temp3; + arg4 = &temp4; + if (!PyArg_ParseTuple(args,(char *)":blpapi_getVersionInfo")) SWIG_fail; + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_getVersionInfo(arg1,arg2,arg3,arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + if (SWIG_IsTmpObj(res1)) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg1))); + } else { + int new_flags = SWIG_IsNewObj(res1) ? (SWIG_POINTER_OWN | 0 ) : 0 ; + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg1), SWIGTYPE_p_int, new_flags)); + } + if (SWIG_IsTmpObj(res2)) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg2))); + } else { + int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_int, new_flags)); + } + if (SWIG_IsTmpObj(res3)) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg3))); + } else { + int new_flags = SWIG_IsNewObj(res3) ? (SWIG_POINTER_OWN | 0 ) : 0 ; + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg3), SWIGTYPE_p_int, new_flags)); + } + if (SWIG_IsTmpObj(res4)) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg4))); + } else { + int new_flags = SWIG_IsNewObj(res4) ? (SWIG_POINTER_OWN | 0 ) : 0 ; + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg4), SWIGTYPE_p_int, new_flags)); + } + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_getVersionIdentifier(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + char *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)":blpapi_getVersionIdentifier")) SWIG_fail; + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (char *)blpapi_getVersionIdentifier(); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; +fail: + return NULL; +} + + +static PyMethodDef SwigMethods[] = { + { (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL}, + { (char *)"blpapi_getVersionInfo", _wrap_blpapi_getVersionInfo, METH_VARARGS, NULL}, + { (char *)"blpapi_getVersionIdentifier", _wrap_blpapi_getVersionIdentifier, METH_VARARGS, NULL}, + { NULL, NULL, 0, NULL } +}; + + +/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ + +static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_int = {"_p_int", "int *", 0, 0, (void*)0, 0}; + +static swig_type_info *swig_type_initial[] = { + &_swigt__p_char, + &_swigt__p_int, +}; + +static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}}; + +static swig_cast_info *swig_cast_initial[] = { + _swigc__p_char, + _swigc__p_int, +}; + + +/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */ + +static swig_const_info swig_const_table[] = { +{0, 0, 0, 0.0, 0, 0}}; + +#ifdef __cplusplus +} +#endif +/* ----------------------------------------------------------------------------- + * Type initialization: + * This problem is tough by the requirement that no dynamic + * memory is used. Also, since swig_type_info structures store pointers to + * swig_cast_info structures and swig_cast_info structures store pointers back + * to swig_type_info structures, we need some lookup code at initialization. + * The idea is that swig generates all the structures that are needed. + * The runtime then collects these partially filled structures. + * The SWIG_InitializeModule function takes these initial arrays out of + * swig_module, and does all the lookup, filling in the swig_module.types + * array with the correct data and linking the correct swig_cast_info + * structures together. + * + * The generated swig_type_info structures are assigned statically to an initial + * array. We just loop through that array, and handle each type individually. + * First we lookup if this type has been already loaded, and if so, use the + * loaded structure instead of the generated one. Then we have to fill in the + * cast linked list. The cast data is initially stored in something like a + * two-dimensional array. Each row corresponds to a type (there are the same + * number of rows as there are in the swig_type_initial array). Each entry in + * a column is one of the swig_cast_info structures for that type. + * The cast_initial array is actually an array of arrays, because each row has + * a variable number of columns. So to actually build the cast linked list, + * we find the array of casts associated with the type, and loop through it + * adding the casts to the list. The one last trick we need to do is making + * sure the type pointer in the swig_cast_info struct is correct. + * + * First off, we lookup the cast->type name to see if it is already loaded. + * There are three cases to handle: + * 1) If the cast->type has already been loaded AND the type we are adding + * casting info to has not been loaded (it is in this module), THEN we + * replace the cast->type pointer with the type pointer that has already + * been loaded. + * 2) If BOTH types (the one we are adding casting info to, and the + * cast->type) are loaded, THEN the cast info has already been loaded by + * the previous module so we just ignore it. + * 3) Finally, if cast->type has not already been loaded, then we add that + * swig_cast_info to the linked list (because the cast->type) pointer will + * be correct. + * ----------------------------------------------------------------------------- */ + +#ifdef __cplusplus +extern "C" { +#if 0 +} /* c-mode */ +#endif +#endif + +#if 0 +#define SWIGRUNTIME_DEBUG +#endif + + +SWIGRUNTIME void +SWIG_InitializeModule(void *clientdata) { + size_t i; + swig_module_info *module_head, *iter; + int init; + + /* check to see if the circular list has been setup, if not, set it up */ + if (swig_module.next==0) { + /* Initialize the swig_module */ + swig_module.type_initial = swig_type_initial; + swig_module.cast_initial = swig_cast_initial; + swig_module.next = &swig_module; + init = 1; + } else { + init = 0; + } + + /* Try and load any already created modules */ + module_head = SWIG_GetModule(clientdata); + if (!module_head) { + /* This is the first module loaded for this interpreter */ + /* so set the swig module into the interpreter */ + SWIG_SetModule(clientdata, &swig_module); + } else { + /* the interpreter has loaded a SWIG module, but has it loaded this one? */ + iter=module_head; + do { + if (iter==&swig_module) { + /* Our module is already in the list, so there's nothing more to do. */ + return; + } + iter=iter->next; + } while (iter!= module_head); + + /* otherwise we must add our module into the list */ + swig_module.next = module_head->next; + module_head->next = &swig_module; + } + + /* When multiple interpreters are used, a module could have already been initialized in + a different interpreter, but not yet have a pointer in this interpreter. + In this case, we do not want to continue adding types... everything should be + set up already */ + if (init == 0) return; + + /* Now work on filling in swig_module.types */ +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: size %d\n", swig_module.size); +#endif + for (i = 0; i < swig_module.size; ++i) { + swig_type_info *type = 0; + swig_type_info *ret; + swig_cast_info *cast; + +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); +#endif + + /* if there is another module already loaded */ + if (swig_module.next != &swig_module) { + type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name); + } + if (type) { + /* Overwrite clientdata field */ +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: found type %s\n", type->name); +#endif + if (swig_module.type_initial[i]->clientdata) { + type->clientdata = swig_module.type_initial[i]->clientdata; +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name); +#endif + } + } else { + type = swig_module.type_initial[i]; + } + + /* Insert casting types */ + cast = swig_module.cast_initial[i]; + while (cast->type) { + /* Don't need to add information already in the list */ + ret = 0; +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: look cast %s\n", cast->type->name); +#endif + if (swig_module.next != &swig_module) { + ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name); +#ifdef SWIGRUNTIME_DEBUG + if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name); +#endif + } + if (ret) { + if (type == swig_module.type_initial[i]) { +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: skip old type %s\n", ret->name); +#endif + cast->type = ret; + ret = 0; + } else { + /* Check for casting already in the list */ + swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type); +#ifdef SWIGRUNTIME_DEBUG + if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name); +#endif + if (!ocast) ret = 0; + } + } + + if (!ret) { +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name); +#endif + if (type->cast) { + type->cast->prev = cast; + cast->next = type->cast; + } + type->cast = cast; + } + cast++; + } + /* Set entry in modules->types array equal to the type */ + swig_module.types[i] = type; + } + swig_module.types[i] = 0; + +#ifdef SWIGRUNTIME_DEBUG + printf("**** SWIG_InitializeModule: Cast List ******\n"); + for (i = 0; i < swig_module.size; ++i) { + int j = 0; + swig_cast_info *cast = swig_module.cast_initial[i]; + printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); + while (cast->type) { + printf("SWIG_InitializeModule: cast type %s\n", cast->type->name); + cast++; + ++j; + } + printf("---- Total casts: %d\n",j); + } + printf("**** SWIG_InitializeModule: Cast List ******\n"); +#endif +} + +/* This function will propagate the clientdata field of type to +* any new swig_type_info structures that have been added into the list +* of equivalent types. It is like calling +* SWIG_TypeClientData(type, clientdata) a second time. +*/ +SWIGRUNTIME void +SWIG_PropagateClientData(void) { + size_t i; + swig_cast_info *equiv; + static int init_run = 0; + + if (init_run) return; + init_run = 1; + + for (i = 0; i < swig_module.size; i++) { + if (swig_module.types[i]->clientdata) { + equiv = swig_module.types[i]->cast; + while (equiv) { + if (!equiv->converter) { + if (equiv->type && !equiv->type->clientdata) + SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata); + } + equiv = equiv->next; + } + } + } +} + +#ifdef __cplusplus +#if 0 +{ + /* c-mode */ +#endif +} +#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(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 int + swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { + char *tmp; + PyObject *str = swig_varlink_str(v); + fprintf(fp,"Swig global variables "); + fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str)); + SWIG_Python_str_DelForPy3(tmp); + Py_DECREF(str); + return 0; + } + + 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 + (char *)"swigvarlink", /* tp_name */ + sizeof(swig_varlinkobject), /* tp_basicsize */ + 0, /* tp_itemsize */ + (destructor) swig_varlink_dealloc, /* tp_dealloc */ + (printfunc) swig_varlink_print, /* 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 */ +#if PY_VERSION_HEX >= 0x02020000 + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */ +#endif +#if PY_VERSION_HEX >= 0x02030000 + 0, /* tp_del */ +#endif +#if PY_VERSION_HEX >= 0x02060000 + 0, /* tp_version_tag */ +#endif +#if PY_VERSION_HEX >= 0x03040000 + 0, /* tp_finalize */ +#endif +#ifdef COUNT_ALLOCS + 0, /* tp_allocs */ + 0, /* tp_frees */ + 0, /* tp_maxalloc */ +#if PY_VERSION_HEX >= 0x02050000 + 0, /* tp_prev */ +#endif + 0 /* tp_next */ +#endif + }; + varlink_type = tmp; + type_init = 1; +#if PY_VERSION_HEX < 0x02020000 + varlink_type.ob_type = &PyType_Type; +#else + if (PyType_Ready(&varlink_type) < 0) + return NULL; +#endif + } + 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, 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) { + strncpy(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 *_SWIG_globals = 0; + if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink(); + return _SWIG_globals; + } + + /* ----------------------------------------------------------------------------- + * constants/methods manipulation + * ----------------------------------------------------------------------------- */ + + /* Install Constants */ + SWIGINTERN void + SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) { + PyObject *obj = 0; + size_t i; + for (i = 0; constants[i].type; ++i) { + switch(constants[i].type) { + case SWIG_PY_POINTER: + obj = SWIG_InternalNewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0); + break; + case SWIG_PY_BINARY: + obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype)); + break; + default: + obj = 0; + break; + } + if (obj) { + PyDict_SetItemString(d, constants[i].name, obj); + Py_DECREF(obj); + } + } + } + + /* -----------------------------------------------------------------------------*/ + /* Fix SwigMethods to carry the callback ptrs when needed */ + /* -----------------------------------------------------------------------------*/ + + SWIGINTERN void + SWIG_Python_FixMethods(PyMethodDef *methods, + 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; + if (!c) continue; + c = strstr(c, "swig_ptr: "); + if (c) { + int j; + 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, + strlen(const_table[j].name)) == 0) { + ci = &(const_table[j]); + break; + } + } + if (ci) { + void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0; + if (ptr) { + size_t shift = (ci->ptype) - types; + swig_type_info *ty = types_initial[shift]; + size_t ldoc = (c - methods[i].ml_doc); + size_t lptr = strlen(ty->name)+2*sizeof(void*)+2; + char *ndoc = (char*)malloc(ldoc + lptr + 10); + if (ndoc) { + char *buff = ndoc; + strncpy(buff, methods[i].ml_doc, ldoc); + buff += ldoc; + strncpy(buff, "swig_ptr: ", 10); + buff += 10; + SWIG_PackVoidPtr(buff, ptr, ty->name, lptr); + methods[i].ml_doc = ndoc; + } + } + } + } + } + } + +#ifdef __cplusplus +} +#endif + +/* -----------------------------------------------------------------------------* + * Partial Init method + * -----------------------------------------------------------------------------*/ + +#ifdef __cplusplus +extern "C" +#endif + +SWIGEXPORT +#if PY_VERSION_HEX >= 0x03000000 +PyObject* +#else +void +#endif +SWIG_init(void) { + PyObject *m, *d, *md; +#if PY_VERSION_HEX >= 0x03000000 + static struct PyModuleDef SWIG_module = { +# if PY_VERSION_HEX >= 0x03020000 + PyModuleDef_HEAD_INIT, +# else + { + PyObject_HEAD_INIT(NULL) + NULL, /* m_init */ + 0, /* m_index */ + NULL, /* m_copy */ + }, +# endif + (char *) SWIG_name, + NULL, + -1, + SwigMethods, + NULL, + NULL, + NULL, + NULL + }; +#endif + +#if defined(SWIGPYTHON_BUILTIN) + static SwigPyClientData SwigPyObject_clientdata = { + 0, 0, 0, 0, 0, 0, 0 + }; + static PyGetSetDef this_getset_def = { + (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL + }; + static SwigPyGetSet thisown_getset_closure = { + (PyCFunction) SwigPyObject_own, + (PyCFunction) SwigPyObject_own + }; + static PyGetSetDef thisown_getset_def = { + (char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure + }; + PyTypeObject *builtin_pytype; + int builtin_base_count; + swig_type_info *builtin_basetype; + PyObject *tuple; + PyGetSetDescrObject *static_getset; + PyTypeObject *metatype; + PyTypeObject *swigpyobject; + SwigPyClientData *cd; + PyObject *public_interface, *public_symbol; + PyObject *this_descr; + PyObject *thisown_descr; + PyObject *self = 0; + int i; + + (void)builtin_pytype; + (void)builtin_base_count; + (void)builtin_basetype; + (void)tuple; + (void)static_getset; + (void)self; + + /* Metaclass is used to implement static member variables */ + metatype = SwigPyObjectType(); + assert(metatype); +#endif + + /* Fix SwigMethods to carry the callback ptrs when needed */ + SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial); + +#if PY_VERSION_HEX >= 0x03000000 + m = PyModule_Create(&SWIG_module); +#else + m = Py_InitModule((char *) SWIG_name, SwigMethods); +#endif + + md = d = PyModule_GetDict(m); + (void)md; + + SWIG_InitializeModule(0); + +#ifdef SWIGPYTHON_BUILTIN + swigpyobject = SwigPyObject_TypeOnce(); + + SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject"); + assert(SwigPyObject_stype); + cd = (SwigPyClientData*) SwigPyObject_stype->clientdata; + if (!cd) { + SwigPyObject_stype->clientdata = &SwigPyObject_clientdata; + SwigPyObject_clientdata.pytype = swigpyobject; + } else if (swigpyobject->tp_basicsize != cd->pytype->tp_basicsize) { + PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules."); +# if PY_VERSION_HEX >= 0x03000000 + return NULL; +# else + return; +# endif + } + + /* All objects have a 'this' attribute */ + this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def); + (void)this_descr; + + /* All objects have a 'thisown' attribute */ + thisown_descr = PyDescr_NewGetSet(SwigPyObject_type(), &thisown_getset_def); + (void)thisown_descr; + + public_interface = PyList_New(0); + public_symbol = 0; + (void)public_symbol; + + PyDict_SetItemString(md, "__all__", public_interface); + Py_DECREF(public_interface); + for (i = 0; SwigMethods[i].ml_name != NULL; ++i) + SwigPyBuiltin_AddPublicSymbol(public_interface, SwigMethods[i].ml_name); + for (i = 0; swig_const_table[i].name != 0; ++i) + SwigPyBuiltin_AddPublicSymbol(public_interface, swig_const_table[i].name); +#endif + + SWIG_InstallConstants(d,swig_const_table); + + + /* Initialize threading */ + SWIG_PYTHON_INITIALIZE_THREADS; +#if PY_VERSION_HEX >= 0x03000000 + return m; +#else + return; +#endif +} + diff --git a/blpapi/zfputil.py b/blpapi/zfputil.py new file mode 100644 index 0000000..846f2f6 --- /dev/null +++ b/blpapi/zfputil.py @@ -0,0 +1,78 @@ +# zfputil.py + +"""Provide utilities designed for the Zero Footprint solution clients that +leverage private leased lines to the Bloomberg network. + +This file defines a 'ZfpUtil' class which is used to prepare session options +for private leased lines. + +Usage +---- + +The following snippet shows how to use ZfpUtil to start a Session. + +tlsOptions = blpapi.TlsOptions.createFromFiles( ... ) +sessionOptions = blpapi.ZfpUtil.getZfpOptionsForLeasedLines( + blpapi.ZfpUtil.REMOTE_8194, + tlsOptions) + +sessionOptions.setAuthenticationOptions( ... ) + +session = blpapi.Session(sessionOptions) +session.start() +""" + +from . import utils +from . import internals +from .compat import with_metaclass +from .exception import _ExceptionUtil +from .sessionoptions import SessionOptions + +# pylint: disable=too-few-public-methods,useless-object-inheritance + +@with_metaclass(utils.MetaClassForClassesWithEnums) +class ZfpUtil(object): + """Wrapper for Zero Footprint utilities""" + + REMOTE_8194 = internals.ZFPUTIL_REMOTE_8194 + REMOTE_8196 = internals.ZFPUTIL_REMOTE_8196 + + @staticmethod + def getZfpOptionsForLeasedLines(remote, tlsOptions): + """Creates a SessionOptions object for applications that leverages + private leased lines to Bloomberg network. The SessionOptions + object is only valid for private leased line connectivity. On failure + (e.g. connectivity issues), an exception is raised. + + This is a costly operation that is preferably called once per + application. + """ + sessionOptions = SessionOptions() + err = internals.blpapi_ZfpUtil_getOptionsForLeasedLines( + utils.get_handle(sessionOptions), + utils.get_handle(tlsOptions), + remote) + _ExceptionUtil.raiseOnError(err) + + return sessionOptions + +__copyright__ = """ +Copyright 2019. Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above +copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/changelog.txt b/changelog.txt index a28ffea..d2570c8 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,25 @@ +Version 3.13.0: +=============== +- Automated network configuration for ZFP over leased lines + Allow customers that leverage leased lines/routers for Bloomberg services + (such as existing Bloomberg terminals) to use this infrastructure to + connect their applications to Zero Foot-Print (ZFP) instances. + + A new utility class, 'blpapi.ZfpUtil', can be used to create a + 'SessionOptions' object with the appropriate servers. Applications can + update the options, including authorization settings, but should not + change the servers. + + Added a new example ZfpOverLeasedLinesSessionExample.py to demonstrate + how to create a session over ZFP leased lines. + +- Stability and performance improvements + +Version 3.12.3: +=============== +- Improve error reporting on failure to load the blpapi package +- Remove dependency on the C++ runtime + Version 3.12.2: =============== - Stability and performance improvements diff --git a/examples/ContributionsMktdataExample.py b/examples/ContributionsMktdataExample.py index d4decc6..606e651 100644 --- a/examples/ContributionsMktdataExample.py +++ b/examples/ContributionsMktdataExample.py @@ -2,13 +2,13 @@ from __future__ import print_function from __future__ import absolute_import -import blpapi -# compatibility between python 2 and 3 -from blpapi.compat import with_metaclass import time from optparse import OptionParser, OptionValueError import datetime import threading +import blpapi +# compatibility between python 2 and 3 +from blpapi.compat import with_metaclass TOKEN_SUCCESS = blpapi.Name("TokenGenerationSuccess") TOKEN_FAILURE = blpapi.Name("TokenGenerationFailure") @@ -17,28 +17,28 @@ MARKET_DATA = blpapi.Name("MarketData") SESSION_TERMINATED = blpapi.Name("SessionTerminated") - g_running = True g_mutex = threading.Lock() - @with_metaclass(blpapi.utils.MetaClassForClassesWithEnums) -class AuthorizationStatus: +class AuthorizationStatus: # pylint: disable=too-few-public-methods WAITING = 1 AUTHORIZED = 2 FAILED = 3 - g_authorizationStatus = dict() +class MyStream(object): # pylint: disable=too-few-public-methods,useless-object-inheritance -class MyStream(object): def __init__(self, id=""): self.id = id +class MyEventHandler(object): # pylint: disable=too-few-public-methods,useless-object-inheritance + """Event handler for the session""" -class MyEventHandler(object): def processEvent(self, event, session): + """Process session event""" + global g_running for msg in event: @@ -59,8 +59,9 @@ def processEvent(self, event, session): g_authorizationStatus[cid] = \ AuthorizationStatus.FAILED - def authOptionCallback(option, opt, value, parser): + """Parse authorization options from user input""" + vals = value.split('=', 1) if value == "user": @@ -82,8 +83,9 @@ def authOptionCallback(option, opt, value, parser): else: raise OptionValueError("Invalid auth option '%s'" % value) - def parseCmdLine(): + """Parse command line arguments""" + parser = OptionParser(description="Market data contribution.") parser.add_option("-a", "--ip", @@ -122,7 +124,8 @@ def parseCmdLine(): # TLS Options parser.add_option("--tls-client-credentials", dest="tls_client_credentials", - help="name a PKCS#12 file to use as a source of client credentials", + help="name a PKCS#12 file to use as a source of " + "client credentials", metavar="option", type="string") parser.add_option("--tls-client-credentials-password", @@ -133,7 +136,8 @@ def parseCmdLine(): default="") parser.add_option("--tls-trust-material", dest="tls_trust_material", - help="name a PKCS#7 file to use as a source of trusted certificates", + help="name a PKCS#7 file to use as a source of " + "trusted certificates", metavar="option", type="string") parser.add_option("--read-certificate-files", @@ -142,16 +146,40 @@ def parseCmdLine(): metavar="option", action="store_true") + # ZFP Options + parser.add_option("--zfp-over-leased-line", + dest="zfpPort", + help="enable ZFP connections over leased lines on the" + " specified port (8194 or 8196)" + " (When this option is enabled, '-ip' and '-p' " + "arguments will be ignored.)", + metavar="port", + type="int") (options, args) = parser.parse_args() if not options.hosts: options.hosts = ["localhost"] - return options + options.tlsOptions = getTlsOptions(options) + options.remote = None + if options.zfpPort: + if not options.tlsOptions: + raise RuntimeError("ZFP connections require TLS parameters") + + if options.zfpPort == 8194: + options.remote = blpapi.ZfpUtil.REMOTE_8194 + elif options.zfpPort == 8196: + options.remote = blpapi.ZfpUtil.REMOTE_8196 + else: + raise RuntimeError("Invalid ZFP port: " + options.product) + + return options def authorize(authService, identity, session, cid): + """Authorize the identity""" + with g_mutex: g_authorizationStatus[cid] = AuthorizationStatus.WAITING @@ -198,12 +226,14 @@ def authorize(authService, identity, session, cid): time.sleep(1) def getTlsOptions(options): + """Parse TlsOptions from user input""" + if (options.tls_client_credentials is None or options.tls_trust_material is None): return None print("TlsOptions enabled") - if (options.read_certificate_files): + if options.read_certificate_files: credential_blob = None trust_blob = None with open(options.tls_client_credentials, 'rb') as credentialfile: @@ -212,32 +242,48 @@ def getTlsOptions(options): trust_blob = trustfile.read() return blpapi.TlsOptions.createFromBlobs( - credential_blob, - options.tls_client_credentials_password, - trust_blob) - else: - return blpapi.TlsOptions.createFromFiles( - options.tls_client_credentials, - options.tls_client_credentials_password, - options.tls_trust_material) + credential_blob, + options.tls_client_credentials_password, + trust_blob) + return blpapi.TlsOptions.createFromFiles( + options.tls_client_credentials, + options.tls_client_credentials_password, + options.tls_trust_material) +def prepareStandardSessionOptions(options): + """Prepare SessionOptions for a regular session""" -def main(): - options = parseCmdLine() - - # Fill SessionOptions sessionOptions = blpapi.SessionOptions() for idx, host in enumerate(options.hosts): sessionOptions.setServerAddress(host, options.port, idx) - sessionOptions.setAuthenticationOptions(options.auth) - sessionOptions.setAutoRestartOnDisconnection(True) sessionOptions.setNumStartAttempts(len(options.hosts)) - tlsOptions = getTlsOptions(options) - if tlsOptions is not None: - sessionOptions.setTlsOptions(tlsOptions) + if options.tlsOptions: + sessionOptions.setTlsOptions(options.tlsOptions) + + return sessionOptions +def prepareZfpSessionOptions(options): + """Prepare SessionOptions for a ZFP session""" + + print("Creating a ZFP connection for leased lines.") + sessionOptions = blpapi.ZfpUtil.getZfpOptionsForLeasedLines( + options.remote, + options.tlsOptions) + return sessionOptions + +def main(): + """Main function""" + + options = parseCmdLine() + + # Fill SessionOptions + sessionOptions = prepareZfpSessionOptions(options) \ + if options.remote \ + else prepareStandardSessionOptions(options) + sessionOptions.setAuthenticationOptions(options.auth) + sessionOptions.setAutoRestartOnDisconnection(True) myEventHandler = MyEventHandler() @@ -280,9 +326,8 @@ def main(): for i in range(topicList.size()): stream = topicList.correlationIdAt(i).value() status = topicList.statusAt(i) - topicString = topicList.topicStringAt(i) - if (status == blpapi.TopicList.CREATED): + if status == blpapi.TopicList.CREATED: stream.topic = session.getTopic(topicList.messageAt(i)) streams.append(stream) else: diff --git a/examples/ContributionsPageExample.py b/examples/ContributionsPageExample.py index 84ac8d1..c14e203 100644 --- a/examples/ContributionsPageExample.py +++ b/examples/ContributionsPageExample.py @@ -2,15 +2,13 @@ from __future__ import print_function from __future__ import absolute_import -import blpapi -# compatibility between python 2 and 3 -from blpapi.compat import with_metaclass -import time from optparse import OptionParser, OptionValueError import datetime import threading import time - +import blpapi +# compatibility between python 2 and 3 +from blpapi.compat import with_metaclass TOKEN_SUCCESS = blpapi.Name("TokenGenerationSuccess") TOKEN_FAILURE = blpapi.Name("TokenGenerationFailure") @@ -18,28 +16,28 @@ TOKEN = blpapi.Name("token") SESSION_TERMINATED = blpapi.Name("SessionTerminated") - g_running = True g_mutex = threading.Lock() - @with_metaclass(blpapi.utils.MetaClassForClassesWithEnums) -class AuthorizationStatus: +class AuthorizationStatus: # pylint: disable=too-few-public-methods WAITING = 1 AUTHORIZED = 2 FAILED = 3 - g_authorizationStatus = dict() +class MyStream(object): # pylint: disable=too-few-public-methods,useless-object-inheritance -class MyStream(object): def __init__(self, id=""): self.id = id +class MyEventHandler(object): # pylint: disable=too-few-public-methods,useless-object-inheritance + """Event handler for the session""" -class MyEventHandler(object): def processEvent(self, event, session): + """Process session event""" + global g_running for msg in event: @@ -60,26 +58,30 @@ def processEvent(self, event, session): g_authorizationStatus[cid] = \ AuthorizationStatus.FAILED - def authOptionCallback(option, opt, value, parser): + """Parse authorization options from user input""" + vals = value.split('=', 1) if value == "user": - parser.values.auth = { 'option' : "AuthenticationType=OS_LOGON" } + parser.values.auth = {'option' : "AuthenticationType=OS_LOGON"} elif value == "none": - parser.values.auth = { 'option' : None } + parser.values.auth = {'option' : None} elif vals[0] == "app" and len(vals) == 2: - parser.values.auth = { 'option' : "AuthenticationMode=APPLICATION_ONLY;"\ - "ApplicationAuthenticationType=APPNAME_AND_KEY;"\ - "ApplicationName=" + vals[1] } + parser.values.auth = { + 'option' : "AuthenticationMode=APPLICATION_ONLY;" + "ApplicationAuthenticationType=APPNAME_AND_KEY;" + "ApplicationName=" + vals[1]} elif vals[0] == "userapp" and len(vals) == 2: - parser.values.auth = { 'option' : "AuthenticationMode=USER_AND_APPLICATION;"\ - "AuthenticationType=OS_LOGON;"\ - "ApplicationAuthenticationType=APPNAME_AND_KEY;"\ - "ApplicationName=" + vals[1] } + parser.values.auth = { + 'option' : "AuthenticationMode=USER_AND_APPLICATION;" + "AuthenticationType=OS_LOGON;" + "ApplicationAuthenticationType=APPNAME_AND_KEY;" + "ApplicationName=" + vals[1]} elif vals[0] == "dir" and len(vals) == 2: - parser.values.auth = { 'option' : "AuthenticationType=DIRECTORY_SERVICE;"\ - "DirSvcPropertyName=" + vals[1] } + parser.values.auth = { + 'option' : "AuthenticationType=DIRECTORY_SERVICE;" + "DirSvcPropertyName=" + vals[1]} elif vals[0] == "manual": parts = [] if len(vals) == 2: @@ -94,14 +96,15 @@ def authOptionCallback(option, opt, value, parser): "ApplicationAuthenticationType=APPNAME_AND_KEY;" + \ "ApplicationName=" + parts[0] - parser.values.auth = { 'option' : option, - 'manual' : { 'ip' : parts[1], - 'user' : parts[2] } } + parser.values.auth = {'option' : option, + 'manual' : {'ip' : parts[1], + 'user' : parts[2]}} else: raise OptionValueError("Invalid auth option '%s'" % value) - def parseCmdLine(): + """Parse command line arguments""" + parser = OptionParser(description="Publish on a topic.") parser.add_option("-a", "--ip", @@ -135,18 +138,20 @@ def parseCmdLine(): parser.add_option("--auth", dest="auth", help="authentication option: " - "user|none|app=|userapp=|dir=|manual=" - " (default: %default)", + "user|none|app=|userapp=|dir=" + "|manual=" + " (default: %default)", metavar="option", action="callback", callback=authOptionCallback, type="string", - default={ "option" : None }) + default={"option" : None}) # TLS Options parser.add_option("--tls-client-credentials", dest="tls_client_credentials", - help="name a PKCS#12 file to use as a source of client credentials", + help="name a PKCS#12 file to use as a source " + "of client credentials", metavar="option", type="string") parser.add_option("--tls-client-credentials-password", @@ -157,7 +162,8 @@ def parseCmdLine(): default="") parser.add_option("--tls-trust-material", dest="tls_trust_material", - help="name a PKCS#7 file to use as a source of trusted certificates", + help="name a PKCS#7 file to use as a source of" + " trusted certificates", metavar="option", type="string") parser.add_option("--read-certificate-files", @@ -166,14 +172,40 @@ def parseCmdLine(): metavar="option", action="store_true") + # ZFP Options + parser.add_option("--zfp-over-leased-line", + dest="zfpPort", + help="enable ZFP connections over leased lines on the " + "specified port (8194 or 8196)" + " (When this option is enabled, '-ip' and '-p' " + "arguments will be ignored.)", + metavar="port", + type="int") + (options, args) = parser.parse_args() if not options.hosts: options.hosts = ["localhost"] + options.tlsOptions = getTlsOptions(options) + + options.remote = None + if options.zfpPort: + if not options.tlsOptions: + raise RuntimeError("ZFP connections require TLS parameters") + + if options.zfpPort == 8194: + options.remote = blpapi.ZfpUtil.REMOTE_8194 + elif options.zfpPort == 8196: + options.remote = blpapi.ZfpUtil.REMOTE_8196 + else: + raise RuntimeError("Invalid ZFP port: " + options.product) + return options -def authorize(authService, identity, session, cid, manual_options = None): +def authorize(authService, identity, session, cid, manual_options=None): + """Authorize the identity""" + with g_mutex: g_authorizationStatus[cid] = AuthorizationStatus.WAITING @@ -225,12 +257,14 @@ def authorize(authService, identity, session, cid, manual_options = None): time.sleep(1) def getTlsOptions(options): + """Parse TlsOptions from user input""" + if (options.tls_client_credentials is None or options.tls_trust_material is None): return None print("TlsOptions enabled") - if (options.read_certificate_files): + if options.read_certificate_files: credential_blob = None trust_blob = None with open(options.tls_client_credentials, 'rb') as credentialfile: @@ -239,29 +273,49 @@ def getTlsOptions(options): trust_blob = trustfile.read() return blpapi.TlsOptions.createFromBlobs( - credential_blob, - options.tls_client_credentials_password, - trust_blob) - else: - return blpapi.TlsOptions.createFromFiles( - options.tls_client_credentials, - options.tls_client_credentials_password, - options.tls_trust_material) + credential_blob, + options.tls_client_credentials_password, + trust_blob) -def main(): - options = parseCmdLine() + return blpapi.TlsOptions.createFromFiles( + options.tls_client_credentials, + options.tls_client_credentials_password, + options.tls_trust_material) + +def prepareStandardSessionOptions(options): + """Prepare SessionOptions for a regular session""" - # Fill SessionOptions sessionOptions = blpapi.SessionOptions() for idx, host in enumerate(options.hosts): sessionOptions.setServerAddress(host, options.port, idx) + sessionOptions.setNumStartAttempts(len(options.hosts)) + + if options.tlsOptions: + sessionOptions.setTlsOptions(options.tlsOptions) + + return sessionOptions + +def prepareZfpSessionOptions(options): + """Prepare SessionOptions for a ZFP session""" + + print("Creating a ZFP connection for leased lines.") + sessionOptions = blpapi.ZfpUtil.getZfpOptionsForLeasedLines( + options.remote, + options.tlsOptions) + return sessionOptions + +def main(): + """Main function""" + + options = parseCmdLine() + + # Fill SessionOptions + sessionOptions = prepareZfpSessionOptions(options) \ + if options.remote \ + else prepareStandardSessionOptions(options) sessionOptions.setAuthenticationOptions(options.auth['option']) sessionOptions.setAutoRestartOnDisconnection(True) - sessionOptions.setNumStartAttempts(len(options.hosts)) - tlsOptions = getTlsOptions(options) - if tlsOptions is not None: - sessionOptions.setTlsOptions(tlsOptions) myEventHandler = MyEventHandler() # Create a Session @@ -304,9 +358,8 @@ def main(): for i in range(topicList.size()): stream = topicList.correlationIdAt(i).value() status = topicList.statusAt(i) - topicString = topicList.topicStringAt(i) - if (status == blpapi.TopicList.CREATED): + if status == blpapi.TopicList.CREATED: stream.topic = session.getTopic(topicList.messageAt(i)) streams.append(stream) else: diff --git a/examples/LocalMktdataSubscriptionExample.py b/examples/LocalMktdataSubscriptionExample.py index 9142362..c301a73 100644 --- a/examples/LocalMktdataSubscriptionExample.py +++ b/examples/LocalMktdataSubscriptionExample.py @@ -2,9 +2,9 @@ from __future__ import print_function from __future__ import absolute_import -import blpapi import datetime from optparse import OptionParser, OptionValueError +import blpapi TOKEN_SUCCESS = blpapi.Name("TokenGenerationSuccess") TOKEN_FAILURE = blpapi.Name("TokenGenerationFailure") @@ -12,24 +12,29 @@ TOKEN = blpapi.Name("token") def authOptionCallback(option, opt, value, parser): + """Parse authorization options from user input""" + vals = value.split('=', 1) if value == "user": - parser.values.auth = { 'option' : "AuthenticationType=OS_LOGON" } + parser.values.auth = {'option' : "AuthenticationType=OS_LOGON"} elif value == "none": - parser.values.auth = { 'option' : None } + parser.values.auth = {'option' : None} elif vals[0] == "app" and len(vals) == 2: - parser.values.auth = { 'option' : "AuthenticationMode=APPLICATION_ONLY;"\ - "ApplicationAuthenticationType=APPNAME_AND_KEY;"\ - "ApplicationName=" + vals[1] } + parser.values.auth = { + 'option' : "AuthenticationMode=APPLICATION_ONLY;" + "ApplicationAuthenticationType=APPNAME_AND_KEY;" + "ApplicationName=" + vals[1]} elif vals[0] == "userapp" and len(vals) == 2: - parser.values.auth = { 'option' : "AuthenticationMode=USER_AND_APPLICATION;"\ - "AuthenticationType=OS_LOGON;"\ - "ApplicationAuthenticationType=APPNAME_AND_KEY;"\ - "ApplicationName=" + vals[1] } + parser.values.auth = { + 'option' : "AuthenticationMode=USER_AND_APPLICATION;" + "AuthenticationType=OS_LOGON;" + "ApplicationAuthenticationType=APPNAME_AND_KEY;" + "ApplicationName=" + vals[1]} elif vals[0] == "dir" and len(vals) == 2: - parser.values.auth = { 'option' : "AuthenticationType=DIRECTORY_SERVICE;"\ - "DirSvcPropertyName=" + vals[1] } + parser.values.auth = { + 'option' : "AuthenticationType=DIRECTORY_SERVICE;" + "DirSvcPropertyName=" + vals[1]} elif vals[0] == "manual": parts = [] if len(vals) == 2: @@ -44,13 +49,15 @@ def authOptionCallback(option, opt, value, parser): "ApplicationAuthenticationType=APPNAME_AND_KEY;" + \ "ApplicationName=" + parts[0] - parser.values.auth = { 'option' : option, - 'manual' : { 'ip' : parts[1], - 'user' : parts[2] } } + parser.values.auth = {'option' : option, + 'manual' : {'ip' : parts[1], + 'user' : parts[2]}} else: raise OptionValueError("Invalid auth option '%s'" % value) def parseCmdLine(): + """Parse command line arguments""" + parser = OptionParser(description="Retrieve realtime data.") parser.add_option("-a", "--ip", @@ -97,18 +104,20 @@ def parseCmdLine(): parser.add_option("--auth", dest="auth", help="authentication option: " - "user|none|app=|userapp=|dir=|manual=" - " (default: %default)", + "user|none|app=|userapp=|dir=" + "|manual=" + " (default: %default)", metavar="option", action="callback", callback=authOptionCallback, type="string", - default={ "option" : None }) + default={"option" : None}) # TLS Options parser.add_option("--tls-client-credentials", dest="tls_client_credentials", - help="name a PKCS#12 file to use as a source of client credentials", + help="name a PKCS#12 file to use as a source of " + "client credentials", metavar="option", type="string") parser.add_option("--tls-client-credentials-password", @@ -119,7 +128,8 @@ def parseCmdLine(): default="") parser.add_option("--tls-trust-material", dest="tls_trust_material", - help="name a PKCS#7 file to use as a source of trusted certificates", + help="name a PKCS#7 file to use as a source of " + "trusted certificates", metavar="option", type="string") parser.add_option("--read-certificate-files", @@ -128,6 +138,16 @@ def parseCmdLine(): metavar="option", action="store_true") + # ZFP Options + parser.add_option("--zfp-over-leased-line", + dest="zfpPort", + help="enable ZFP connections over leased lines on the " + "specified port (8194 or 8196)" + " (When this option is enabled, '-ip' and '-p'" + " arguments will be ignored.)", + metavar="port", + type="int") + (options, args) = parser.parse_args() if not options.hosts: @@ -136,10 +156,25 @@ def parseCmdLine(): if not options.topics: options.topics = ["/ticker/IBM Equity"] + options.tlsOptions = getTlsOptions(options) + + options.remote = None + if options.zfpPort: + if not options.tlsOptions: + raise RuntimeError("ZFP connections require TLS parameters") + + if options.zfpPort == 8194: + options.remote = blpapi.ZfpUtil.REMOTE_8194 + elif options.zfpPort == 8196: + options.remote = blpapi.ZfpUtil.REMOTE_8196 + else: + raise RuntimeError("Invalid ZFP port: " + options.zfpPort) + return options +def authorize(authService, identity, session, cid, manual_options=None): + """Authorize the identity""" -def authorize(authService, identity, session, cid, manual_options = None): tokenEventQueue = blpapi.EventQueue() if manual_options: @@ -192,12 +227,14 @@ def authorize(authService, identity, session, cid, manual_options = None): return False def getTlsOptions(options): + """Parse TlsOptions from user input""" + if (options.tls_client_credentials is None or options.tls_trust_material is None): return None print("TlsOptions enabled") - if (options.read_certificate_files): + if options.read_certificate_files: credential_blob = None trust_blob = None with open(options.tls_client_credentials, 'rb') as credentialfile: @@ -205,25 +242,21 @@ def getTlsOptions(options): with open(options.tls_trust_material, 'rb') as trustfile: trust_blob = trustfile.read() return blpapi.TlsOptions.createFromBlobs( - credential_blob, - options.tls_client_credentials_password, - trust_blob) - else: - return blpapi.TlsOptions.createFromFiles( - options.tls_client_credentials, - options.tls_client_credentials_password, - options.tls_trust_material) + credential_blob, + options.tls_client_credentials_password, + trust_blob) -def main(): - global options - options = parseCmdLine() + return blpapi.TlsOptions.createFromFiles( + options.tls_client_credentials, + options.tls_client_credentials_password, + options.tls_trust_material) + +def prepareStandardSessionOptions(options): + """Prepare SessionOptions for a regular session""" - # Fill SessionOptions sessionOptions = blpapi.SessionOptions() for idx, host in enumerate(options.hosts): sessionOptions.setServerAddress(host, options.port, idx) - sessionOptions.setAuthenticationOptions(options.auth['option']) - sessionOptions.setAutoRestartOnDisconnection(True) # NOTE: If running without a backup server, make many attempts to # connect/reconnect to give that host a chance to come back up (the @@ -232,14 +265,37 @@ def main(): # over). We don't have to do that in a redundant configuration - it's # expected at least one server is up and reachable at any given time, # so only try to connect to each server once. - sessionOptions.setNumStartAttempts(1 if len(options.hosts) > 1 else 1000) + sessionOptions.setNumStartAttempts(len(options.hosts) + if len(options.hosts) > 1 else 1000) print("Connecting to port %d on %s" % ( options.port, ", ".join(options.hosts))) - tlsOptions = getTlsOptions(options) - if tlsOptions is not None: - sessionOptions.setTlsOptions(tlsOptions) + if options.tlsOptions: + sessionOptions.setTlsOptions(options.tlsOptions) + + return sessionOptions + +def prepareZfpSessionOptions(options): + """Prepare SessionOptions for a ZFP session""" + + print("Creating a ZFP connection for leased lines.") + sessionOptions = blpapi.ZfpUtil.getZfpOptionsForLeasedLines( + options.remote, + options.tlsOptions) + return sessionOptions + +def main(): + """Main function""" + + options = parseCmdLine() + + # Fill SessionOptions + sessionOptions = prepareZfpSessionOptions(options) \ + if options.remote \ + else prepareStandardSessionOptions(options) + sessionOptions.setAuthenticationOptions(options.auth['option']) + sessionOptions.setAutoRestartOnDisconnection(True) session = blpapi.Session(sessionOptions) @@ -290,7 +346,6 @@ def main(): finally: session.stop() - if __name__ == "__main__": print("LocalMktdataSubscriptionExample") try: diff --git a/examples/SnapshotRequestTemplateExample.py b/examples/SnapshotRequestTemplateExample.py index 06add59..cb0169d 100644 --- a/examples/SnapshotRequestTemplateExample.py +++ b/examples/SnapshotRequestTemplateExample.py @@ -1,14 +1,11 @@ -# SnapshotRequestTemplateExample.py +"""SnapshotRequestTemplateExample.py""" from __future__ import print_function from __future__ import absolute_import -import blpapi import datetime -import time -import traceback -import weakref from optparse import OptionParser, OptionValueError -from blpapi import Event as EventType + +import blpapi TOKEN_SUCCESS = blpapi.Name("TokenGenerationSuccess") TOKEN_FAILURE = blpapi.Name("TokenGenerationFailure") @@ -16,7 +13,7 @@ TOKEN = blpapi.Name("token") -def authOptionCallback(option, opt, value, parser): +def authOptionCallback(_option, _opt, value, parser): vals = value.split('=', 1) if value == "user": @@ -40,6 +37,7 @@ def authOptionCallback(option, opt, value, parser): def parseCmdLine(): + """parse cli arguments""" parser = OptionParser(description="Retrieve realtime data.") parser.add_option("-a", "--ip", @@ -94,7 +92,7 @@ def parseCmdLine(): type="string", default="user") - (opts, args) = parser.parse_args() + (opts, _) = parser.parse_args() if not opts.hosts: opts.hosts = ["localhost"] @@ -106,6 +104,7 @@ def parseCmdLine(): def authorize(authService, identity, session, cid): + """authorize the session for identity via authService""" tokenEventQueue = blpapi.EventQueue() session.generateToken(eventQueue=tokenEventQueue) @@ -153,6 +152,7 @@ def authorize(authService, identity, session, cid): def main(): + """main entry point""" global options options = parseCmdLine() @@ -181,9 +181,9 @@ def main(): print("Failed to start session.") return - subscriptionIdentity = session.createIdentity() - + subscriptionIdentity = None if options.auth: + subscriptionIdentity = session.createIdentity() isAuthorized = False authServiceName = "//blp/apiauth" if session.openService(authServiceName): @@ -193,6 +193,8 @@ def main(): if not isAuthorized: print("No authorization") return + else: + print("Not using authorization") fieldStr = "?fields=" + ",".join(options.fields) @@ -201,9 +203,9 @@ def main(): for i, topic in enumerate(options.topics): subscriptionString = options.service + topic + fieldStr snapshots.append(session.createSnapshotRequestTemplate( - subscriptionString, - subscriptionIdentity, - blpapi.CorrelationId(i))) + subscriptionString, + subscriptionIdentity, + blpapi.CorrelationId(i))) nextCorrelationId += 1 requestTemplateAvailable = blpapi.Name('RequestTemplateAvailable') @@ -217,8 +219,9 @@ def main(): msg.messageType() == requestTemplateAvailable: for requestTemplate in snapshots: - session.sendRequestTemplate(requestTemplate, - blpapi.CorrelationId(nextCorrelationId)) + session.sendRequestTemplate( + requestTemplate, + blpapi.CorrelationId(nextCorrelationId)) nextCorrelationId += 1 elif event.eventType() == blpapi.Event.RESPONSE or \ @@ -235,8 +238,9 @@ def main(): break elif event.eventType() == blpapi.Event.TIMEOUT: for requestTemplate in snapshots: - session.sendRequestTemplate(requestTemplate, - blpapi.CorrelationId(nextCorrelationId)) + session.sendRequestTemplate( + requestTemplate, + blpapi.CorrelationId(nextCorrelationId)) nextCorrelationId += 1 finally: diff --git a/examples/ZfpOverLeasedLinesSessionExample.py b/examples/ZfpOverLeasedLinesSessionExample.py new file mode 100644 index 0000000..3475a34 --- /dev/null +++ b/examples/ZfpOverLeasedLinesSessionExample.py @@ -0,0 +1,220 @@ +# ZfpOverLeasedLinesSessionExample.py + +"""The example demonstrates how to establish a ZFP session that leverages +private leased line connectivity. To see how to use the resulting session +(authorizing a session, establishing subscriptions or making requests etc.), + please refer to the other examples. +""" + +from __future__ import absolute_import +from __future__ import print_function + +from argparse import ArgumentParser, Action +import blpapi + +class AuthOptionsAction(Action): # pylint: disable=too-few-public-methods + """Parse authorization args from user input""" + + def __call__(self, parser, args, values, option_string=None): + + value = values + vals = value.split("=", 1) + + auth = None + value = values + if value == "user": + auth = {"option" : "AuthenticationType=OS_LOGON"} + elif value == "none": + auth = {"option" : None} + elif vals[0] == "app" and len(vals) == 2: + auth = { + "option" : "AuthenticationMode=APPLICATION_ONLY;" + "ApplicationAuthenticationType=APPNAME_AND_KEY;" + "ApplicationName=" + vals[1]} + elif vals[0] == "userapp" and len(vals) == 2: + auth = { + "option" : "AuthenticationMode" + "=USER_AND_APPLICATION;AuthenticationType=OS_LOGON;" + "ApplicationAuthenticationType=APPNAME_AND_KEY;" + "ApplicationName=" + vals[1]} + elif vals[0] == "dir" and len(vals) == 2: + auth = { + "option" : "AuthenticationType=DIRECTORY_SERVICE;" + "DirSvcPropertyName=" + vals[1]} + elif vals[0] == "manual": + parts = [] + if len(vals) == 2: + parts = vals[1].split(",") + + if len(parts) != 3: + raise ValueError("Invalid auth option '%s'" % value) + + option = ("AuthenticationMode=USER_AND_APPLICATION;" + "AuthenticationType=MANUAL;" + "ApplicationAuthenticationType=APPNAME_AND_KEY;" + "ApplicationName=") + parts[0] + + auth = {"option" : option, + "manual" : {"ip" : parts[1], + "user" : parts[2]}} + else: + raise ValueError("Invalid auth option '%s'" % value) + + setattr(args, self.dest, auth) + +def parseCmdLine(): + """Parse command line arguments""" + + parser = ArgumentParser(description="Create a ZFP session.") + parser.add_argument("--zfp-over-leased-line", + dest="zfpPort", + help="enable ZFP connections over leased lines on the" + " specified port (8194 or 8196) " + "(default: %(default)s)", + type=int, + default=8194, + metavar="port") + + parser.add_argument("--auth", + dest="auth", + help="authentication option: " + "user|none|app=|userapp=|dir=|" + "manual=" + " (default: none)", + metavar="option", + action=AuthOptionsAction, + default={"option" : None}) + + # TLS Options + parser.add_argument("--tls-client-credentials", + dest="tls_client_credentials", + help="name a PKCS#12 file to use as a source of " + "client credentials", + metavar="option") + parser.add_argument("--tls-client-credentials-password", + dest="tls_client_credentials_password", + help="specify password for accessing" + " client credentials", + metavar="option", + default="") + parser.add_argument("--tls-trust-material", + dest="tls_trust_material", + help="name a PKCS#7 file to use as a source of trusted" + " certificates", + metavar="option") + parser.add_argument("--read-certificate-files", + dest="read_certificate_files", + help="(optional) read the TLS files and pass the blobs", + action="store_true") + + args = parser.parse_args() + + args.tlsOptions = getTlsOptions(args) + + if not args.tlsOptions: + raise RuntimeError("ZFP connections require TLS parameters") + + if args.zfpPort == 8194: + args.remote = blpapi.ZfpUtil.REMOTE_8194 + elif args.zfpPort == 8196: + args.remote = blpapi.ZfpUtil.REMOTE_8196 + else: + raise RuntimeError("Invalid ZFP port: " + args.zfpPort) + + return args + +def getTlsOptions(args): + """Create TlsOptions from user input""" + + if (args.tls_client_credentials is None or + args.tls_trust_material is None): + return None + + print("TlsOptions enabled") + if args.read_certificate_files: + credential_blob = None + trust_blob = None + with open(args.tls_client_credentials, 'rb') as credentialfile: + credential_blob = credentialfile.read() + with open(args.tls_trust_material, 'rb') as trustfile: + trust_blob = trustfile.read() + return blpapi.TlsOptions.createFromBlobs( + credential_blob, + args.tls_client_credentials_password, + trust_blob) + + return blpapi.TlsOptions.createFromFiles( + args.tls_client_credentials, + args.tls_client_credentials_password, + args.tls_trust_material) + +def prepareZfpSessionOptions(args): + """Prepare SessionOptions for ZFP session""" + + print("Creating a ZFP connection for leased lines.") + sessionOptions = blpapi.ZfpUtil.getZfpOptionsForLeasedLines( + args.remote, + args.tlsOptions) + return sessionOptions + +def main(): + """Main function""" + + args = parseCmdLine() + + # Fill SessionOptions + sessionOptions = prepareZfpSessionOptions(args) + sessionOptions.setAuthenticationOptions(args.auth['option']) + sessionOptions.setAutoRestartOnDisconnection(True) + + numHosts = sessionOptions.numServerAddresses() + for i in range(0, numHosts): + (host, port) = sessionOptions.getServerAddress(i) + print("Connecting to port %d on %s" % (port, host)) + + session = blpapi.Session(sessionOptions) + + if not session.start(): + print("Failed to start session.") + while True: + event = session.tryNextEvent() + if not event: + break + + for msg in event: + print(msg) + return + + print("Session started successfully.") + + # Note: ZFP solution requires authorization, which should be done here + # before any subscriptions or requests can be made. For examples of + # how to authorize or get data, please refer to the specific examples. + +if __name__ == "__main__": + print("ZfpOverLeasedLinesSessionExample") + try: + main() + except KeyboardInterrupt: + print("Ctrl+C pressed. Stopping...") + +__copyright__ = """ +Copyright 2019. Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above +copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/setup.py b/setup.py index 0fafedc..2dab434 100644 --- a/setup.py +++ b/setup.py @@ -4,19 +4,34 @@ setup.py file for Bloomberg Python SDK """ -from setuptools import setup, Extension import os import platform as plat +import re +import codecs + from sys import version +from setuptools import setup, Extension os.chdir(os.path.dirname(os.path.realpath(__file__))) platform = plat.system().lower() -versionString = '3.12.2' + +def find_version_number(): + """Load the version number from blpapi/version.py""" + version_path = os.path.abspath(os.path.join('blpapi', 'version.py')) + version_file = None + with codecs.open(version_path, 'r') as fp: + version_file = fp.read() + + version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", + version_file, re.M) + if version_match: + return version_match.group(1) + raise RuntimeError("Unable to find version string.") if version < '2.6': raise Exception( - "Python versions before 2.6 are not supported (current version is " + - version + ")") + "Python versions before 2.6 are not supported (current version is " + + version + ")") blpapiRoot = os.environ.get('BLPAPI_ROOT') blpapiIncludesVar = os.environ.get('BLPAPI_INCDIR') @@ -38,7 +53,7 @@ # Handle the very frequent case when user need to use Visual C++ 2010 # with Python that wants to use Visual C++ 2008. if plat.python_compiler().startswith('MSC v.1500'): - if (not ('VS90COMNTOOLS' in os.environ)) and \ + if (not 'VS90COMNTOOLS' in os.environ) and \ ('VS100COMNTOOLS' in os.environ): os.environ['VS90COMNTOOLS'] = os.environ['VS100COMNTOOLS'] elif platform == 'linux': @@ -55,7 +70,7 @@ blpapi_wrap = Extension( 'blpapi._internals', - sources=['blpapi/internals_wrap.cxx'], + sources=['blpapi/internals_wrap.c'], include_dirs=[blpapiIncludes], library_dirs=[blpapiLibraryPath], libraries=[blpapiLibraryName], @@ -64,7 +79,7 @@ versionhelper_wrap = Extension( 'blpapi._versionhelper', - sources=['blpapi/versionhelper_wrap.cxx'], + sources=['blpapi/versionhelper_wrap.c'], include_dirs=[blpapiIncludes], library_dirs=[blpapiLibraryPath], libraries=[blpapiLibraryName], @@ -73,7 +88,7 @@ setup( name='blpapi', - version=versionString, + version=find_version_number(), author='Bloomberg L.P.', author_email='open-tech@bloomberg.net', description='Python SDK for Bloomberg BLPAPI', From fa41c647ee807be9ef99f86c09e594d7b31737d9 Mon Sep 17 00:00:00 2001 From: Marland Sitt Date: Thu, 11 Jul 2019 16:56:56 -0700 Subject: [PATCH 03/23] Bump to v3.13.1. --- PKG-INFO | 2 +- blpapi/abstractsession.py | 292 ++++++++------ blpapi/constant.py | 185 ++++++--- blpapi/datatype.py | 22 +- blpapi/datetime.py | 36 +- blpapi/element.py | 605 +++++++++++++++++----------- blpapi/event.py | 135 ++++--- blpapi/eventdispatcher.py | 50 ++- blpapi/eventformatter.py | 254 +++++++----- blpapi/exception.py | 11 +- blpapi/identity.py | 90 +++-- blpapi/internals.py | 174 +++----- blpapi/internals_wrap.c | 304 +++++++------- blpapi/logging.py | 2 +- blpapi/message.py | 173 +++++--- blpapi/name.py | 90 +++-- blpapi/providersession.py | 750 ++++++++++++++++++++++------------- blpapi/request.py | 43 +- blpapi/resolutionlist.py | 257 +++++++----- blpapi/schema.py | 267 +++++++------ blpapi/service.py | 257 +++++++----- blpapi/session.py | 567 +++++++++++++++----------- blpapi/sessionoptions.py | 589 +++++++++++++++++---------- blpapi/subscriptionlist.py | 175 +++++--- blpapi/topic.py | 42 +- blpapi/topiclist.py | 169 +++++--- blpapi/version.py | 14 +- blpapi/zfputil.py | 43 +- changelog.txt | 12 +- examples/MktdataPublisher.py | 4 +- setup.py | 9 +- 31 files changed, 3419 insertions(+), 2204 deletions(-) diff --git a/PKG-INFO b/PKG-INFO index 164d013..1210ae8 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: blpapi -Version: 3.13.0 +Version: 3.13.1 Summary: Python SDK for Bloomberg BLPAPI Home-page: http://www.bloomberglabs.com/api/ Author: Bloomberg L.P. diff --git a/blpapi/abstractsession.py b/blpapi/abstractsession.py index e6aa0cf..b251a10 100644 --- a/blpapi/abstractsession.py +++ b/blpapi/abstractsession.py @@ -33,64 +33,68 @@ class AbstractSession(object): """A common interface shared between publish and consumer sessions. This class provides an abstract session which defines shared interface - between publish and consumer requests for Bloomberg + between publish and consumer requests for Bloomberg. - Sessions manage access to services either by requests and - responses or subscriptions. A Session can dispatch events and - replies in either a synchronous or asynchronous mode. The mode - of a Session is determined when it is constructed and cannot be - changed subsequently. + Sessions manage access to services either by requests and responses or + subscriptions. A Session can dispatch events and replies in either a + synchronous or asynchronous mode. The mode of a Session is determined when + it is constructed and cannot be changed subsequently. - A Session is asynchronous if an EventHandler object is - supplied when it is constructed. The nextEvent() method may not be called. - All incoming events are delivered to the EventHandler supplied on + A Session is asynchronous if an ``eventHandler`` argument is supplied when + it is constructed. The ``nextEvent()`` method may not be called. All + incoming events are delivered to the ``eventHandler`` supplied on construction. - If supplied, EventHandler is a callable object that takes two arguments: - received event and related session. - - A Session is synchronous if an EventHandler object is not - supplied when it is constructed. The nextEvent() method must be - called to read incoming events. - - Several methods in Session take a CorrelationId parameter. The - application may choose to supply its own CorrelationId values - or allow the Session to create values. If the application - supplies its own CorrelationId values it must manage their - lifetime such that the same value is not reused for more than - one operation at a time. The lifetime of a CorrelationId begins - when it is supplied in a method invoked on a Session and ends - either when it is explicitly cancelled using cancel() or - unsubscribe(), when a RESPONSE Event (not a PARTIAL_RESPONSE) - containing it is received or when a SUBSCRIPTION_STATUS Event - which indicates that the subscription it refers to has been - terminated is received. - - When using an asynchronous Session the application must be - aware that because the callbacks are generated from another - thread they may be processed before the call which generates - them has returned. For example, the SESSION_STATUS Event - generated by a startAsync() may be processed before - startAsync() has returned (even though startAsync() itself will - not block). + If supplied, ``eventHandler`` must be a callable object that takes two + arguments: received :class:`Event` and related session. + + A Session is synchronous if an ``eventHandler`` argument is not supplied + when it is constructed. The ``nextEvent()`` method must be called to read + incoming events. + + Several methods in Session take a :class:`CorrelationId` parameter. The + application may choose to supply its own :class:`CorrelationId` values or + allow the Session to create values. If the application supplies its own + :class:`CorrelationId` values it must manage their lifetime such that the + same value is not reused for more than one operation at a time. The + lifetime of a :class:`CorrelationId` begins when it is supplied in a method + invoked on a Session and ends either when it is explicitly cancelled using + :meth:`cancel()` or ``unsubscribe()``, when a :attr:`~Event.RESPONSE` + :class:`Event` (not a :attr:`~Event.PARTIAL_RESPONSE`) containing it is + received or when a :attr:`~Event.SUBSCRIPTION_STATUS` :class:`Event` which + indicates that the subscription it refers to has been terminated is + received. + + When using an asynchronous Session, the application must be aware that + because the callbacks are generated from another thread, they may be + processed before the call which generates them has returned. For example, + the :attr:`~Event.SESSION_STATUS` :class:`Event` generated by a + ``startAsync()`` may be processed before ``startAsync()`` has returned + (even though ``startAsync()`` itself will not block). This becomes more significant when Session generated - CorrelationIds are in use. For example, if a call to - subscribe() which returns a Session generated CorrelationId has - not completed before the first Events which contain that - CorrelationId arrive the application may not be able to - interpret those events correctly. For this reason, it is - preferable to use user generated CorrelationIds when using - asynchronous Sessions. This issue does not arise when using a - synchronous Session as long as the calls to subscribe() etc are - made on the same thread as the calls to nextEvent(). + :class:`CorrelationId`\ s are in use. For example, if a call to + ``subscribe()`` which returns a Session generated :class:`CorrelationId` + has not completed before the first :class:`Event`\ s which contain that + :class:`CorrelationId` arrive the application may not be able to interpret + those events correctly. For this reason, it is preferable to use user + generated :class:`CorrelationId`\ s when using asynchronous Sessions. This + issue does not arise when using a synchronous Session as long as the calls + to ``subscribe()`` etc are made on the same thread as the calls to + ``nextEvent()``. """ def __init__(self, handle=None): - """Instantiate an 'AbstractSession' with the specified handle. + """Instantiate an :class:`AbstractSession` with the specified handle. + + Args: + handle: Handle to the underlying session + + Raises: + NotImplementedError: If this class is instantiated directly This function is for internal use only. Clients should create sessions - using one of the concrete subclasses of 'AbstractSession'. + using one of the concrete subclasses of :class:`AbstractSession`. """ @@ -100,21 +104,26 @@ def __init__(self, handle=None): self.__handle = handle def openService(self, serviceName): - """Open the service identified by the specified 'serviceName'. + """Open the service identified by the specified ``serviceName``. + + Args: + serviceName (str): Name of the service + + Returns: + Service: service identified by the specified ``serviceName``. - Attempt to open the service identified by the specified - 'serviceName' and block until the service is either opened - successfully or has failed to be opened. Return 'True' if - the service is opened successfully and 'False' if the - service cannot be successfully opened. + Attempt to open the service identified by the specified ``serviceName`` + and block until the service is either opened successfully or has failed + to be opened. Return ``True`` if the service is opened successfully and + ``False`` if the service cannot be successfully opened. - The 'serviceName' must contain a fully qualified service name. That - is, it must be of the form "///". + The ``serviceName`` must contain a fully qualified service name. That + is, it must be of the form ``///``. - Before openService() returns a SERVICE_STATUS Event is - generated. If this is an asynchronous Session then this - Event may be processed by the registered EventHandler - before openService() has returned. + Before :meth:`openService()` returns a :attr:`~Event.SERVICE_STATUS` + :class:`Event` is generated. If this is an asynchronous Session then + this :class:`Event` may be processed by the registered ``eventHandler`` + before :meth:`openService()` has returned. """ return internals.blpapi_AbstractSession_openService( self.__handle, @@ -123,18 +132,25 @@ def openService(self, serviceName): def openServiceAsync(self, serviceName, correlationId=None): """Begin the process to open the service and return immediately. - Begin the process to open the service identified by the - specified 'serviceName' and return immediately. The optional - specified 'correlationId' is used to track Events generated - as a result of this call. The actual correlationId which - will identify Events generated as a result of this call is - returned. + Args: + serviceName (str): Name of the service + correlationId (CorrelationId): Correlation id to associate with + events generated as a result of this call - The 'serviceName' must contain a fully qualified service name. That - is, it must be of the form "///". + Returns: + CorrelationId: The correlation id used to identify the Events + generated as a result of this call - The application must monitor events for a SERVICE_STATUS - Event which will be generated once the service has been + Begin the process to open the service identified by the specified + ``serviceName`` and return immediately. The optional specified + ``correlationId`` is used to track :class:`Event`\ s generated as a + result of this call. + + The ``serviceName`` must contain a fully qualified service name. That + is, it must be of the form ``///``. + + The application must monitor events for a :attr:`~Event.SERVICE_STATUS` + :class:`Event` which will be generated once the service has been successfully opened or the opening has failed. """ if correlationId is None: @@ -151,32 +167,44 @@ def sendAuthorizationRequest(self, identity, correlationId=None, eventQueue=None): - """Send the specified 'authorizationRequest'. - - Send the specified 'authorizationRequest' and update the - specified 'identity' with the results. If the optionally - specified 'correlationId' is supplied, it is used; otherwise - create a CorrelationId. The actual CorrelationId used is - returned. If the optionally specified 'eventQueue' is - supplied all Events relating to this Request will arrive on - that EventQueue. + """Send the specified ``authorizationRequest``. + + Args: + request (Request): Authorization request to send + identity (Identity): Identity to update with the results + correlationId (CorrelationId): Correlation id to associate with the + request + eventQueue (EventQueue): Event queue on which the events related to + this request will arrive + + Returns: + CorrelationId: The correlation id used to identify the Events + generated as a result of this call + + Send the specified ``authorizationRequest`` and update the specified + ``identity`` with the results. If the optionally specified + ``correlationId`` is supplied, it is used; otherwise create a + :class:`CorrelationId`. The actual :class:`CorrelationId` used is + returned. If the optionally specified ``eventQueue`` is supplied all + :class:`Event`\ s relating to this :class:`Request` will arrive on that + :class:`EventQueue`. The underlying user information must remain valid until the Request has completed successfully or failed. A successful request will generate zero or more - PARTIAL_RESPONSE Messages followed by exactly one RESPONSE - Message. Once the final RESPONSE Message has been received - the specified 'identity' will have been updated to contain - the users entitlement information and the CorrelationId - associated with the request may be re-used. If the request - fails at any stage a REQUEST_STATUS will be generated, the - specified 'identity' will not be modified and the - CorrelationId may be re-used. - - The 'identity' supplied must have been returned from this - Session's createIdentity() method. - + :attr:`~Event.PARTIAL_RESPONSE` :class:`Message`\ s followed by + exactly one :attr:`~Event.RESPONSE` :class:`Message`. Once the final + :attr:`~Event.RESPONSE` :class:`Message` has been received the + specified ``identity`` will have been updated to contain the users + entitlement information and the :class:`CorrelationId` associated with + the request may be re-used. If the request fails at any stage a + :class:`~Event.REQUEST_STATUS` will be generated, the specified + ``identity`` will not be modified and the :class:`CorrelationId` may be + re-used. + + The ``identity`` supplied must have been returned from this Session's + :meth:`createIdentity()` method. """ if correlationId is None: @@ -195,27 +223,26 @@ def sendAuthorizationRequest(self, return correlationId def cancel(self, correlationId): - """Cancel 'correlationId' request. + """Cancel ``correlationId`` request. - If the specified 'correlationId' identifies a current - request then cancel that request. + Args: + correlationId (CorrelationId or [CorrelationId]): Correlation id + associated with the request to cancel - Once this call returns the specified 'correlationId' will - not be seen in any subsequent Message obtained from a - MessageIterator by calling next(). However, any Message - currently pointed to by a MessageIterator when - cancel() is called is not affected even if it has the - specified 'correlationId'. Also any Message where a - reference has been retained by the application may still - contain the 'correlationId'. For these reasons, although - technically an application is free to re-use - 'correlationId' as soon as this method returns it is - preferable not to aggressively re-use correlation IDs, - particularly with an asynchronous Session. - - 'correlationId' should be either a correlation Id or a list of - correlation Ids. + If the specified ``correlationId`` identifies a current + request then cancel that request. + Once this call returns the specified ``correlationId`` will not be seen + in any subsequent :class:`Message` obtained from a + ``MessageIterator`` by calling ``next()``. + However, any :class:`Message` currently pointed to by a + ``MessageIterator`` when :meth:`cancel()` is called is not + affected even if it has the specified ``correlationId``. Also any + :class:`Message` where a reference has been retained by the application + may still contain the ``correlationId``. For these reasons, although + technically an application is free to re-use ``correlationId`` as soon + as this method returns it is preferable not to aggressively re-use + correlation IDs, particularly with an asynchronous Session. """ _ExceptionUtil.raiseOnError(internals.blpapi_AbstractSession_cancel( @@ -229,11 +256,25 @@ def generateToken(self, correlationId=None, eventQueue=None, authId=None, ipAddress=None): """Generate a token to be used for authorization. - The 'authId' and 'ipAddress' must be provided together and can only be - provided if the authentication mode is 'MANUAL'. - - Raises 'InvalidArgumentException' if the authentication options in - 'SessionOptions' or the arguments to the function are invalid. + Args: + correlationId (CorrelationId): Correlation id to be associated with + the request + eventQueue (EventQueue): Event queue on which to receive Events + related to this request + authId (str): The id used for authentication + ipAddress (str): IP of the machine used for authentication + + Returns: + CorrelationId: The correlation id used to identify the Events + generated as a result of this call + + Raises: + InvalidArgumentException: If the authentication options in + :class:`SessionOptions` or the arguments to the function are + invalid. + + The ``authId`` and ``ipAddress`` must be provided together and can only + be provided if the authentication mode is ``MANUAL``. """ if correlationId is None: correlationId = CorrelationId() @@ -260,16 +301,20 @@ def generateToken(self, correlationId=None, return correlationId def getService(self, serviceName): - """Return a Service object representing the service. + """Return a :class:`Service` object representing the service. - Return a Service object representing the service identified by the - specified 'serviceName'. + Args: + serviceName (str): Name of the service to retrieve - The 'serviceName' must contain a fully qualified service name. That - is, it must be of the form "///". + Returns: + Service: Service identified by the service name - If the service identified by the specified 'serviceName' is not open - already then an InvalidStateException is raised. + Raises: + InvalidStateException: If the service identified by the specified + ``serviceName`` is not open already + + The ``serviceName`` must contain a fully qualified service name. That + is, it must be of the form ``///``. """ errorCode, service = internals.blpapi_AbstractSession_getService( self.__handle, @@ -278,7 +323,12 @@ def getService(self, serviceName): return Service(service, self) def createIdentity(self): - """Return a Identity which is valid but has not been authorized.""" + """Create an :class:`Identity` which is valid but has not been + authorized. + + Returns: + Identity: Identity which is valid but has not been authorized + """ return Identity( internals.blpapi_AbstractSession_createIdentity(self.__handle), self) diff --git a/blpapi/constant.py b/blpapi/constant.py index b32d154..9d67a16 100644 --- a/blpapi/constant.py +++ b/blpapi/constant.py @@ -25,49 +25,73 @@ class Constant: """Represents the value of a schema enumeration constant. - Constants can be any of the following DataTypes: BOOL, CHAR, BYTE, INT32, - INT64, FLOAT32, FLOAT64, STRING, DATE, TIME, DATETIME. This class provides - access not only to to the constant value, but also to the symbolic name, - the description, and the status of the constant. - - 'Constant' objects are read-only. - - Application clients never create 'Constant' object directly; applications - will typically work with 'Constant' objects returned by other 'blpapi' - components. + Constants can be any of the following :class:`DataType`\ s: + :attr:`~DataType.BOOL`, :attr:`~DataType.CHAR`, :attr:`~DataType.BYTE`, + :attr:`~DataType.INT32`, :attr:`~DataType.INT64`, + :attr:`~DataType.FLOAT32`, :attr:`~DataType.FLOAT64`, + :attr:`~DataType.STRING`, :attr:`~DataType.DATE`, :attr:`~DataType.TIME`, + :attr:`~DataType.DATETIME`. This class provides access not only to to the + constant value, but also to the symbolic name, the description, and the + status of the constant. + + :class:`Constant` objects are read-only. + + Application clients never create :class:`Constant` object directly; + applications will typically work with :class:`Constant` objects returned + by other ``blpapi`` components. """ def __init__(self, handle, sessions): + """ + Args: + handle: Handle to the internal implementation + sessions: Sessions to which this object is related to + """ self.__handle = handle self.__sessions = sessions def name(self): - """Return the symbolic name of this 'Constant'.""" + """ + Returns: + Name: The symbolic name of this :class:`Constant`. + """ return Name._createInternally( internals.blpapi_Constant_name(self.__handle)) def description(self): - """Return a human readable description of this 'Constant'.""" + """ + Returns: + str: Human readable description of this :class:`Constant`. + """ return internals.blpapi_Constant_description(self.__handle) def status(self): - """Return the status of this 'Constant'. + """ + Returns: + int: Status of this :class:`Constant`. - The possible return values are enumerated in 'SchemaStatus' class. + The possible return values are enumerated in :class:`SchemaStatus`. """ return internals.blpapi_Constant_status(self.__handle) def datatype(self): - """Return the data type used to represent the value of this 'Constant'. + """ + Returns: + int: Data type used to represent the value of this + :class:`Constant`. - The possible return values are enumerated in 'DataType' class. + The possible return values are enumerated in :class:`DataType`. """ return internals.blpapi_Constant_datatype(self.__handle) def getValueAsInteger(self): - """Return the value of this object as an integer. + """ + Returns: + int: Value of this object as an integer. - If the value cannot be converted to an integer an exception is raised. + Raises: + InvalidConversionException: If the value cannot be converted to an + integer. """ errCode, value = internals.blpapi_Constant_getValueAsInt64( self.__handle) @@ -75,9 +99,13 @@ def getValueAsInteger(self): return value def getValueAsFloat(self): - """Return the value of this object as a float. + """ + Returns: + float: Value of this object as a float. - If the value cannot be converted to a float an exception is raised. + Raises: + InvalidConversionException: If the value cannot be converted to a + float. """ errCode, value = internals.blpapi_Constant_getValueAsFloat64( self.__handle) @@ -85,13 +113,14 @@ def getValueAsFloat(self): return value def getValueAsDatetime(self): - """Return the value of this object as one of the datetime types. - - Possible result types are: datetime.time, datetime.date or - datetime.datetime. + """ + Returns: + datetime.time or datetime.date or datetime.datetime: Value of this + object as one of the datetime types. - If the value cannot be converted to one of these types an exception is - raised. + Raises: + InvalidConversionException: If the value cannot be converted to + one of the datetime types. """ errCode, value = internals.blpapi_Constant_getValueAsDatetime( self.__handle) @@ -99,9 +128,13 @@ def getValueAsDatetime(self): return _DatetimeUtil.convertToNative(value) def getValueAsString(self): - """Return the value of this object as a string. + """ + Returns: + str: Value of this object as a string. - If the value cannot be converted to a string an exception is raised. + Raises: + InvalidConversionException: If the value cannot be converted to a + string. """ errCode, value = internals.blpapi_Constant_getValueAsString( self.__handle) @@ -109,7 +142,10 @@ def getValueAsString(self): return value def getValue(self): - """Return the value of this object as it is stored in the object.""" + """ + Returns: + Value of this object as it is stored in the object. + """ datatype = self.datatype() valueGetter = _CONSTANT_VALUE_GETTER.get( datatype, @@ -124,66 +160,87 @@ def _sessions(self): class ConstantList: """Represents a list of schema enumeration constants. - As well as the list of 'Constant' objects, this class also provides access - to the symbolic name, description and status of the list as a whole. All - 'Constant' objects in a 'ConstantsList' are of the same DataType. + As well as the list of :class:`Constant` objects, this class also provides + access to the symbolic name, description and status of the list as a whole. + All :class:`Constant` objects in a :class:`ConstantList` are of the same + :class:`DataType`. - 'ConstantList' objects are read-only. + :class:`ConstantList` objects are read-only. - Application clients never create 'ConstantList' object directly; - applications will typically work with 'ConstantList' objects returned by - other 'blpapi' components. + Application clients never create :class:`ConstantList` object directly; + applications will typically work with :class:`ConstantList` objects + returned by other ``blpapi`` components. """ def __init__(self, handle, sessions): + """ + Args: + handle: Handle to the internal implementation + sessions: Sessions to which this object is related to + """ self.__handle = handle self.__sessions = sessions def __iter__(self): - """Return the iterator over constants contained in this ConstantsList. + """ + Returns: + Iterator over constants contained in this :class:`ConstantList` """ return utils.Iterator(self, ConstantList.numConstants, ConstantList.getConstantAt) def name(self): - """Return the symbolic name of this 'ConstantList'.""" + """ + Returns: + Name: Symbolic name of this :class:`ConstantList` + """ return Name._createInternally( internals.blpapi_ConstantList_name(self.__handle)) def description(self): - """Return a human readable description of this 'ConstantList'.""" + """ + Returns: + str: Human readable description of this :class:`ConstantList` + """ return internals.blpapi_ConstantList_description(self.__handle) def status(self): - """Return the status of this 'ConstantList'. + """ + Returns: + int: Status of this :class:`ConstantList` - The possible return values are enumerated in 'SchemaStatus' class. + The possible return values are enumerated in :class:`SchemaStatus` """ return internals.blpapi_ConstantList_status(self.__handle) def numConstants(self): - """Return the number of 'Constant' objects. - - Return the number of 'Constant' objects contained in this - 'ConstantsList'. + """ + Returns: + int: Number of :class:`Constant` objects in this list """ return internals.blpapi_ConstantList_numConstants(self.__handle) def datatype(self): - """Return the data type used to represent the value of this constant. + """ + Returns: + int: Data type used to represent the value of this constant - The possible return values are enumerated in 'DataType' class. + The possible return values are enumerated in :class:`DataType`. """ return internals.blpapi_ConstantList_datatype(self.__handle) def hasConstant(self, name): - """True if this 'ConstantList' contains an item with this 'name'. + """ + Args: + name (Name or str): Name of the constant - Return True if this 'ConstantList' contains an item with the specified - 'name', and False otherwise. + Returns: + bool: ``True`` if this :class:`ConstantList` contains an item with + this ``name``. - Exception is raised if 'name' is neither a Name nor a string. + Raises: + TypeError: If ``name`` is neither a :class:`Name` nor a string """ names = getNamePair(name) return bool(internals.blpapi_ConstantList_hasConstant(self.__handle, @@ -191,11 +248,16 @@ def hasConstant(self, name): names[1])) def getConstant(self, name): - """Return the 'Constant' with the specified 'name'. + """ + Args: + name (Name or str): Name of the constant + + Returns: + Constant: Constant with the specified ``name`` - Return the 'Constant' in this 'ConstantsList' identified by the - specified 'name'. If this 'ConstantsList' does not contain a 'Constant' - with the specified 'name' then an exception is raised. + Raises: + NotFoundException: If this :class:`ConstantList` does not contain a + :class:`Constant` with the specified ``name`` """ names = getNamePair(name) res = internals.blpapi_ConstantList_getConstant(self.__handle, @@ -209,11 +271,16 @@ def getConstant(self, name): return Constant(res, self.__sessions) def getConstantAt(self, position): - """Return the 'Constant' at the specified 'position'. + """ + Args: + position (int): Position of the requested constant in the list + + Returns: + Constant: Constant at the specified ``position``. - Return the 'Constant' at the specified 'position' in this - 'ConstantList'. If 'position' is not in the range from 0 to - 'numConstants() - 1' then an exception is raised. + Raises: + IndexOutOfRangeException: If ``position`` is not in the range from + ``0`` to ``numConstants() - 1``. """ res = internals.blpapi_ConstantList_getConstantAt(self.__handle, position) diff --git a/blpapi/datatype.py b/blpapi/datatype.py index 1d420bd..b58df81 100644 --- a/blpapi/datatype.py +++ b/blpapi/datatype.py @@ -14,26 +14,8 @@ @with_metaclass(utils.MetaClassForClassesWithEnums) class DataType(object): - """Contains the possible data types which can be represented in an Element. - - Class attributes: - BOOL Boolean - CHAR Char - BYTE Unsigned 8 bit value - INT32 32 bit Integer - INT64 64 bit Integer - FLOAT32 32 bit Floating point - FLOAT64 64 bit Floating point - STRING ASCIIZ string - BYTEARRAY Opaque binary data - DATE Date - TIME Timestamp - DECIMAL Currently Unsuppored - DATETIME Date and time - ENUMERATION An opaque enumeration - SEQUENCE Sequence type - CHOICE Choice type - CORRELATION_ID Used for some internal messages + """Contains the possible data types which can be represented in an + :class:`Element`. """ BOOL = internals.DATATYPE_BOOL diff --git a/blpapi/datetime.py b/blpapi/datetime.py index f554bf3..3d135ef 100644 --- a/blpapi/datetime.py +++ b/blpapi/datetime.py @@ -21,33 +21,37 @@ class FixedOffset(_dt.tzinfo): Represents time zone information to be used with Python standard library datetime classes. - FixedOffset(offsetInMinutes) creates an object that implements - datetime.tzinfo interface and represents a timezone with the specified - 'offsetInMinutes' from UTC. - - This class is intended to be used as 'tzinfo' for Python standard library - datetime.datetime and datetime.time classes. These classes are accepted by - the blpapi package to set DATE, TIME or DATETIME elements. For example, the - DATETIME element of a request could be set as: + This class is intended to be used as ``tzinfo`` for Python standard library + :class:`datetime.datetime` and :class:`datetime.time` classes. These + classes are accepted by the blpapi package to set :attr:`~DataType.DATE`, + :attr:`~DataType.TIME` or :attr:`~DataType.DATETIME` elements. For example, + the :attr:`~DataType.DATETIME` element of a request could be set as:: value = datetime.datetime(1941, 6, 22, 4, 0, tzinfo=FixedOffset(4*60)) request.getElement("last_trade").setValue(value) - The TIME element could be set in a similar way: + The :attr:`~DataType.TIME` element could be set in a similar way:: value = datetime.time(9, 0, 1, tzinfo=FixedOffset(-5*60)) request.getElement("session_open").setValue(value) - Note that you could use any other implementations of datetime.tzinfo with - BLPAPI-Py, for example the widely used 'pytz' package - (http://pypi.python.org/pypi/pytz/). + Note that you could use any other implementations of + :class:`datetime.tzinfo` with BLPAPI-Py, for example the widely used + ``pytz`` package (https://pypi.python.org/pypi/pytz/). For more details see datetime module documentation at - http://docs.python.org/library/datetime.html - + https://docs.python.org/library/datetime.html """ def __init__(self, offsetInMinutes=0): + """ + Args: + offsetInMinutes (int): Offset from UTC in minutes + + Creates an object that implements :class:`datetime.tzinfo` interface + and represents a timezone with the specified ``offsetInMinutes`` from + UTC. + """ self.__offset = _dt.timedelta(minutes=offsetInMinutes) def utcoffset(self, dt): @@ -63,6 +67,10 @@ def tzname(self, dt): return self.__offset def getOffsetInMinutes(self): + """ + Returns: + int: Offset from UTC in minutes + """ return self.__offset.days * 24 * 60 + self.__offset.seconds // 60 def __hash__(self): diff --git a/blpapi/element.py b/blpapi/element.py index c51b073..8b9387d 100644 --- a/blpapi/element.py +++ b/blpapi/element.py @@ -20,78 +20,84 @@ # pylint: disable=useless-object-inheritance,protected-access,too-many-return-statements,too-many-public-methods class Element(object): - """Element represents an item in a message. + """Represents an item in a message. - An Element can represent: a single value of any data type supported by the - Bloomberg API; an array of values; a sequence or a choice. + An :class:`Element` can represent: - The value(s) in an Element can be queried in a number of ways. For an - Element which represents a single value or an array of values use the - 'getValueAs()' functions or 'getValueAsBool()' etc. For an Element which - represents a sequence or choice use 'getElementAsBool()' etc. In addition, - for choices and sequences, 'hasElement()' and 'getElement()' are useful. + - A single value of any data type supported by the Bloomberg API + - An array of values + - A sequence or a choice - This example shows how to access the value of a scalar element 's' as a - floating point number: + The value(s) in an :class:`Element` can be queried in a number of ways. For + an :class:`Element` which represents a single value or an array of values + use the :meth:`getValueAsBool()` etc. functions. For an :class:`Element` + which represents a sequence or choice use :meth:`getElementAsBool()` etc. + functions. In addition, for choices and sequences, :meth:`hasElement()` and + :meth:`getElement()` are useful. - f = s.getValueAsFloat() + This example shows how to access the value of a scalar element ``s`` as a + floating point number:: + + f = s.getValueAsFloat() Similarly, this example shows how to retrieve the third value in an array - element 'a', as a floating point number: + element ``a``, as a floating point number:: - f = a.getValueAsFloat(2) + f = a.getValueAsFloat(2) - Use 'numValues()' to determine the number of values available. For single - values, it will return either 0 or 1. For arrays it will return the actual - number of values in the array. + Use :meth:`numValues()` to determine the number of values available. For + single values, it will return either ``0`` or ``1``. For arrays it will + return the actual number of values in the array. To retrieve values from a complex element types (sequences and choices) use - the 'getElementAs...()' family of methods. This example shows how to get the - value of the the element 'city' in the sequence element 'address': + the ``getElementAs...()`` family of methods. This example shows how to get + the value of the element ``city`` in the sequence element ``address``:: - city = address.getElementAsString("city") + city = address.getElementAsString("city") - Note that 'getElementAsXYZ(name)' method is a shortcut to - 'getElement(name).getValueAsXYZ()'. + Note: + ``getElementAsXYZ(name)`` method is a shortcut to + ``getElement(name).getValueAsXYZ()``. - The value(s) of an Element can be set in a number of ways. For an Element - which represents a single value or an array of values use the 'setValue()' - or 'appendValue()' functions. For an element which represents a sequence - or a choice use the 'setElement()' functions. + The value(s) of an :class:`Element` can be set in a number of ways. For an + :class:`Element` which represents a single value or an array of values use + the :meth:`setValue()` or :meth:`appendValue()` functions. For an element + which represents a sequence or a choice use the :meth:`setElement()` + functions. - This example shows how to set the value of an Element 's': + This example shows how to set the value of an :class:`Element` ``s``:: - value=5 - s.setValue(value) + value=5 + s.setValue(value) - This example shows how to append a value to an array element 'a': + This example shows how to append a value to an array element ``a``:: - value=5; - s.appendValue(value); + value=5 + a.appendValue(value) To set values in a complex element (a sequence or a choice) use the - 'setElement()' family of functions. This example shows how to set the value - of the element 'city' in the sequence element 'address' to a string. + :meth:`setElement()` family of functions. This example shows how to set the + value of the element ``city`` in the sequence element ``address`` to a + string:: - address.setElement("city", "New York") + address.setElement("city", "New York") - Methods which specify an Element name accept name in two forms: - 'blpapi.Name' or a string. Passing 'blpapi.Name' is more efficient. - However, it requires the Name to have been created in the - global name table. + Methods which specify an :class:`Element` name accept name in two forms: + :class:`Name` or a string. Passing :class:`Name` is more efficient. + However, it requires the :class:`Name` to have been created in the global + name table. The form which takes a string is less efficient but will not cause a new - Name to be created in the global Name table. Because all valid Element - names will have already been placed in the global name table by the API if - the supplied string cannot be found in the global name table the - appropriate error or exception can be returned. + :class:`Name` to be created in the global name table. Because all valid + :class:`Element` names will have already been placed in the global name + table by the API if the supplied string cannot be found in the global name + table the appropriate error or exception can be returned. The API will convert data types as long as there is no loss of precision involved. - Element objects are always created by the API, never directly by the - application. - + :class:`Element` objects are always created by the API, never directly by + the application. """ __boolTraits = ( @@ -186,14 +192,15 @@ def __str__(self): return self.toString() def name(self): - """Return the name of this Element. - - If this Element is part of a sequence or choice Element then return the - Name of this Element within the sequence or choice Element that owns - it. If this Element is not part of a sequence Element (that is it is an - entire Request or Message) then return the Name of the Request or - Message. - + """ + Returns: + Name: If this :class:`Element` is part of a sequence or choice + :class:`Element`, then return the :class:`Name` of this + :class:`Element` within the sequence or choice :class:`Element` + that owns it. If this :class:`Element` is not part of a sequence + :class:`Element` (that is it is an entire :class:`Request` or + :class:`Message`) then return the :class:`Name` of the + :class:`Request` or :class:`Message`. """ self.__assertIsValid() @@ -201,59 +208,68 @@ def name(self): internals.blpapi_Element_name(self.__handle)) def datatype(self): - """Return the basic data type of this Element. - - Return the basic data type used to represent a value in this Element. - - The possible return values are enumerated in DataType class. + """ + Returns: + int: Basic data type used to represent a value in this + :class:`Element`. + The possible types are enumerated in :class:`DataType`. """ self.__assertIsValid() return internals.blpapi_Element_datatype(self.__handle) def isComplexType(self): - """Return True is this Element is a SEQUENCE or CHOICE. - - Return True if 'datatype()==DataType.SEQUENCE' or - 'datatype()==DataType.CHOICE' and False otherwise. - + """ + Returns: + bool: ``True`` if ``datatype()==DataType.SEQUENCE`` or + ``datatype()==DataType.CHOICE`` and ``False`` otherwise. """ self.__assertIsValid() return bool(internals.blpapi_Element_isComplexType(self.__handle)) def isArray(self): - """Return True is this element is an array. - - Return True if 'elementDefinition().maxValues()>1' or if - 'elementDefinition().maxValues()==UNBOUNDED', and False otherwise. + """ + Returns: + bool: ``True`` if this element is an array. + This element is an array if ``elementDefinition().maxValues()>1`` or if + ``elementDefinition().maxValues()==UNBOUNDED``. """ self.__assertIsValid() return bool(internals.blpapi_Element_isArray(self.__handle)) def isValid(self): - """Return True if this Element is valid.""" + """ + Returns: + bool: ``True`` if this :class:`Element` is valid. + """ return self.__handle is not None def isNull(self): - """Return True if this Element has a null value.""" + """ + Returns: + bool: ``True`` if this :class:`Element` has a null value. + """ self.__assertIsValid() return bool(internals.blpapi_Element_isNull(self.__handle)) def isReadOnly(self): - """Return True if this element cannot be modified.""" + """ + Returns: + bool: ``True`` if this :class:`Element` cannot be modified. + """ self.__assertIsValid() return bool(internals.blpapi_Element_isReadOnly(self.__handle)) def elementDefinition(self): - """Return a read-only SchemaElementDefinition for this Element. - - Return a reference to the read-only element definition object that - defines the properties of this elements value. - + """ + Return: + SchemaElementDefinition: Reference to the read-only element + definition object that defines the properties of this elements + value. """ self.__assertIsValid() return SchemaElementDefinition( @@ -261,39 +277,46 @@ def elementDefinition(self): self._sessions()) def numValues(self): - """Return the number of values contained by this element. - - Return the number of values contained by this element. The number of - values is 0 if 'isNull()' returns True, and no greater than 1 if - 'isComplexType()' returns True. The value returned will always be in - the range defined by 'elementDefinition().minValues()' and - 'elementDefinition().maxValues()'. + """ + Returns: + int: Number of values contained by this element. + The number of values is ``0`` if :meth:`isNull()` returns ``True``, and + no greater than ``1`` if :meth:`isComplexType()` returns ``True``. The + value returned will always be in the range defined by + ``elementDefinition().minValues()`` and + ``elementDefinition().maxValues()``. """ self.__assertIsValid() return internals.blpapi_Element_numValues(self.__handle) def numElements(self): - """Return the number of elements in this Element. - - Return the number of elements contained by this element. The number - of elements is 0 if 'isComplex()' returns False, and no greater than - 1 if the Datatype is CHOICE; if the DataType is SEQUENCE this may - return any number (including 0). + """ + Returns: + int: Number of elements in this element. + The number of elements is ``0`` if :meth:`isComplexType()` returns + ``False``, and no greater than ``1`` if the :class:`DataType` is + :attr:`~DataType.CHOICE`; if the :class:`DataType` is + :attr:`~DataType.SEQUENCE` this may return any number (including + ``0``). """ self.__assertIsValid() return internals.blpapi_Element_numElements(self.__handle) def isNullValue(self, position=0): - """Return True if the value at the 'position' is a null value. + """ + Args: + position (int): Position of the sub-element - Return True if the value of the sub-element at the specified 'position' - in a sequence or choice element is a null value. An exception is raised - if 'position >= numElements()'. + Returns: + bool: ``True`` if the value of the sub-element at the ``position`` + is a null value. + Raises: + Exception: If ``position >= numElements()``. """ self.__assertIsValid() @@ -304,16 +327,20 @@ def isNullValue(self, position=0): return None # unreachable def toString(self, level=0, spacesPerLevel=4): - """Format this Element to the string. + """Format this :class:`Element` to the string at the specified + indentation level. - Format this Element to the string at the specified indentation level. + Args: + level (int): Indentation level + spacesPerLevel (int): Number of spaces per indentation level for + this and all nested objects - You could optionally specify 'spacesPerLevel' - the number of spaces - per indentation level for this and all of its nested objects. If - 'level' is negative, suppress indentation of the first line. If - 'spacesPerLevel' is negative, format the entire output on one line, - suppressing all but the initial indentation (as governed by 'level'). + Returns: + str: This element formatted as a string + If ``level`` is negative, suppress indentation of the first line. If + ``spacesPerLevel`` is negative, format the entire output on one line, + suppressing all but the initial indentation (as governed by ``level``). """ self.__assertIsValid() @@ -322,17 +349,18 @@ def toString(self, level=0, spacesPerLevel=4): spacesPerLevel) def getElement(self, nameOrIndex): - """Return a specified sub-element. - - Return a sub-element identified by the specified 'nameOrIndex', which - must be either a string, a Name, or an integer. If 'nameOrIndex' is a - string or a Name and 'hasElement(nameOrIndex) != True', or if - 'nameOrIndex' is an integer and 'nameOrIndex >= numElements()', then - an exception is raised. + """ + Args: + nameOrIndex (Name or str or int): Sub-element identifier - An exception is also raised if this Element is neither a sequence nor - a choice. + Returns: + Element: Sub-element identified by ``nameOrIndex`` + Raises: + Exception: If ``nameOrIndex`` is a string or a :class:`Name` and + ``hasElement(nameOrIndex) != True``, or if ``nameOrIndex`` is an + integer and ``nameOrIndex >= numElements()``. Also if this + :class:`Element` is neither a sequence nor a choice. """ if not isinstance(nameOrIndex, int): @@ -349,9 +377,13 @@ def getElement(self, nameOrIndex): return Element(res[1], self._getDataHolder()) def elements(self): - """Return an iterator over elements contained in this Element. + """ + Returns: + Iterator over elements contained in this :class:`Element`. - An exception is raised if this 'Element' is not a sequence. + Raises: + UnsupportedOperationException: If this :class:`Element` is not a + sequence. """ if self.datatype() != DataType.SEQUENCE: @@ -360,13 +392,18 @@ def elements(self): return utils.Iterator(self, Element.numElements, Element.getElement) def hasElement(self, name, excludeNullElements=False): - """Return True if this Element contains sub-element with this 'name'. - - Return True if this Element is a choice or sequence ('isComplexType() - == True') and it contains an Element with the specified 'name'. + """ + Args: + name (Name or str): Name of the element + excludeNullElements (bool): Whether to exclude null elements - Exception is raised if 'name' is neither a Name nor a string. + Returns: + bool: ``True`` if this :class:`Element` is a choice or sequence + (``isComplexType() == True``) and it contains an :class:`Element` + with the specified ``name``. + Raises: + Exception: If ``name`` is neither a :class:`Name` nor a string. """ self.__assertIsValid() @@ -380,11 +417,12 @@ def hasElement(self, name, excludeNullElements=False): return bool(res) def getChoice(self): - """Return the selection name of this element as Element. - - Return the selection name of this element if - 'datatype() == DataType.CHOICE'; otherwise, an exception is raised. + """ + Returns: + Element: The selection name of this element as :class:`Element`. + Raises: + Exception: If ``datatype() != DataType.CHOICE`` """ self.__assertIsValid() @@ -393,11 +431,17 @@ def getChoice(self): return Element(res[1], self._getDataHolder()) def getValueAsBool(self, index=0): - """Return the specified 'index'th entry in the Element as a boolean. + """ + Args: + index (int): Index of the value in the element - An exception is raised if the data type of this Element cannot be - converted to a boolean or if 'index >= numValues()'. + Returns: + bool: ``index``\ th entry in the :class:`Element` as a boolean. + Raises: + InvalidConversionException: If the data type of this + :class:`Element` cannot be converted to a boolean. + IndexOutOfRangeException: If ``index >= numValues()``. """ self.__assertIsValid() @@ -406,11 +450,17 @@ def getValueAsBool(self, index=0): return bool(res[1]) def getValueAsString(self, index=0): - """Return the specified 'index'th entry in the Element as a string. + """ + Args: + index (int): Index of the value in the element - An exception is raised if the data type of this Element cannot be - converted to a string or if 'index >= numValues()'. + Returns: + str: ``index``\ th entry in the :class:`Element` as a string. + Raises: + InvalidConversionException: If the data type of this + :class:`Element` cannot be converted to a string. + IndexOutOfRangeException: If ``index >= numValues()``. """ self.__assertIsValid() @@ -419,14 +469,18 @@ def getValueAsString(self, index=0): return res[1] def getValueAsDatetime(self, index=0): - """Return the specified 'index'th entry as one of the datetime types. - - The possible result types are 'datetime.time', 'datetime.date' or - 'datetime.datetime'. + """ + Args: + index (int): Index of the value in the element - An exception is raised if the data type of this Element cannot be - converted to one of these types or if 'index >= numValues()'. + Returns: + datetime.time or datetime.date or datetime.datetime: ``index``\ th + entry in the :class:`Element` as one of the datetime types. + Raises: + InvalidConversionException: If the data type of this + :class:`Element` cannot be converted to a datetime. + IndexOutOfRangeException: If ``index >= numValues()``. """ self.__assertIsValid() @@ -436,11 +490,17 @@ def getValueAsDatetime(self, index=0): return _DatetimeUtil.convertToNative(res[1]) def getValueAsInteger(self, index=0): - """Return the specified 'index'th entry in the Element as an integer. + """ + Args: + index (int): Index of the value in the element - An exception is raised if the data type of this Element cannot be - converted to an integer or if 'index >= numValues()'. + Returns: + int: ``index``\ th entry in the :class:`Element` as a integer + Raises: + InvalidConversionException: If the data type of this + :class:`Element` cannot be converted to an integer. + IndexOutOfRangeException: If ``index >= numValues()``. """ self.__assertIsValid() @@ -449,11 +509,17 @@ def getValueAsInteger(self, index=0): return res[1] def getValueAsFloat(self, index=0): - """Return the specified 'index'th entry in the Element as a float. + """ + Args: + index (int): Index of the value in the element - An exception is raised if the data type of this Element cannot be - converted to a float or if 'index >= numValues()'. + Returns: + float: ``index``\ th entry in the :class:`Element` as a float. + Raises: + InvalidConversionException: If the data type of this + :class:`Element` cannot be converted to an float. + IndexOutOfRangeException: If ``index >= numValues()``. """ self.__assertIsValid() @@ -462,11 +528,17 @@ def getValueAsFloat(self, index=0): return res[1] def getValueAsName(self, index=0): - """Return the specified 'index'th entry in the Element as a Name. + """ + Args: + index (int): Index of the value in the element - An exception is raised if the data type of this Element cannot be - converted to a Name or if 'index >= numValues()'. + Returns: + Name: ``index``\ th entry in the :class:`Element` as a Name. + Raises: + InvalidConversionException: If the data type of this + :class:`Element` cannot be converted to a :class:`Name`. + IndexOutOfRangeException: If ``index >= numValues()``. """ self.__assertIsValid() @@ -475,11 +547,17 @@ def getValueAsName(self, index=0): return Name._createInternally(res[1]) def getValueAsElement(self, index=0): - """Return the specified 'index'th entry in the Element as an Element. + """ + Args: + index (int): Index of the value in the element - An exception is raised if the data type of this Element cannot be - converted to an Element or if 'index >= numValues()'. + Returns: + Element: ``index``\ th entry in the :class:`Element` as a Element. + Raises: + InvalidConversionException: If the data type of this + :class:`Element` cannot be converted to an :class:`Element`. + IndexOutOfRangeException: If ``index >= numValues()``. """ self.__assertIsValid() @@ -488,14 +566,18 @@ def getValueAsElement(self, index=0): return Element(res[1], self._getDataHolder()) def getValue(self, index=0): - """Return the specified 'index'th entry in the Element. - - Return the specified 'index'th entry in the Element in the format - defined by this Element datatype. + """ + Args: + index (int): Index of the value in the element - An exception is raised if this Element either a sequence or a choice or - if 'index >= numValues()'. + Returns: + ``index``\ th entry in the :class:`Element` defined by this + element's datatype. + Raises: + InvalidConversionException: If the data type of this + :class:`Element` is either a sequence or a choice. + IndexOutOfRangeException: If ``index >= numValues()``. """ datatype = self.datatype() @@ -504,10 +586,12 @@ def getValue(self, index=0): return valueGetter(self, index) def values(self): - """Return an iterator over values contained in this Element. + """ + Returns: + Iterator over values contained in this :class:`Element`. - If 'isComplexType()' returns True for this Element, the empty iterator - is returned. + If :meth:`isComplexType()` returns ``True`` for this :class:`Element`, + the empty iterator is returned. """ if self.isComplexType(): @@ -518,89 +602,121 @@ def values(self): return utils.Iterator(self, Element.numValues, valueGetter) def getElementAsBool(self, name): - """Return this Element's sub-element with 'name' as a boolean. + """ + Args: + name (Name or str): Sub-element identifier - Exception is raised if 'name' is neither a Name nor a string, or if - this Element is neither a sequence nor a choice, or in case it has no - sub-element with the specified 'name', or in case the Element's value - can't be returned as a boolean. + Returns: + bool: This element's sub-element with ``name`` as a boolean + Raises: + Exception: If ``name`` is neither a :class:`Name` nor a string, or + if this :class:`Element` is neither a sequence nor a choice, or + in case it has no sub-element with the specified ``name``, or + in case the element's value can't be returned as a boolean. """ return self.getElement(name).getValueAsBool() def getElementAsString(self, name): - """Return this Element's sub-element with 'name' as a string. + """ + Args: + name (Name or str): Sub-element identifier - Exception is raised if 'name' is neither a Name nor a string, or if - this Element is neither a sequence nor a choice, or in case it has no - sub-element with the specified 'name', or in case the Element's value - can't be returned as a string. + Returns: + str: This element's sub-element with ``name`` as a string + Raises: + Exception: If ``name`` is neither a :class:`Name` nor a string, or + if this :class:`Element` is neither a sequence nor a choice, or + in case it has no sub-element with the specified ``name``, or + in case the element's value can't be returned as a string. """ return self.getElement(name).getValueAsString() def getElementAsDatetime(self, name): - """Return this Element's sub-element with 'name' as a datetime type. - - The possible result types are datetime.time, datetime.date or - datetime.datetime. + """ + Args: + name (Name or str): Sub-element identifier - Exception is raised if 'name' is neither a Name nor a string, or if - this Element is neither a sequence nor a choice, or in case it has no - sub-element with the specified 'name', or in case the Element's value - can't be returned as one of datetype types. + Returns: + datetime.time or datetime.date or datetime.datetime: This element's + sub-element with ``name`` as one of the datetime types + Raises: + Exception: If ``name`` is neither a :class:`Name` nor a string, or + if this :class:`Element` is neither a sequence nor a choice, or + in case it has no sub-element with the specified ``name``, or + in case the element's value can't be returned as a datetime. """ return self.getElement(name).getValueAsDatetime() def getElementAsInteger(self, name): - """Return this Element's sub-element with 'name' as an integer. + """ + Args: + name (Name or str): Sub-element identifier - Exception is raised if 'name' is neither a Name nor a string, or if - this Element is neither a sequence nor a choice, or in case it has no - sub-element with the specified 'name', or in case the Element's value - can't be returned as an integer. + Returns: + int: This element's sub-element with ``name`` as an integer + Raises: + Exception: If ``name`` is neither a :class:`Name` nor a string, or + if this :class:`Element` is neither a sequence nor a choice, or + in case it has no sub-element with the specified ``name``, or + in case the element's value can't be returned as an integer. """ return self.getElement(name).getValueAsInteger() def getElementAsFloat(self, name): - """Return this Element's sub-element with 'name' as a float. + """ + Args: + name (Name or str): Sub-element identifier - Exception is raised if 'name' is neither a Name nor a string, or if - this Element is neither a sequence nor a choice, or in case it has no - sub-element with the specified 'name', or in case the Element's value - can't be returned as a float. + Returns: + float: This element's sub-element with ``name`` as a float + Raises: + Exception: If ``name`` is neither a :class:`Name` nor a string, or + if this :class:`Element` is neither a sequence nor a choice, or + in case it has no sub-element with the specified ``name``, or + in case the element's value can't be returned as a float. """ return self.getElement(name).getValueAsFloat() def getElementAsName(self, name): - """Return this Element's sub-element with 'name' as a Name. + """ + Args: + name (Name or str): Sub-element identifier - Exception is raised if 'name' is neither a Name nor a string, or if - this Element is neither a sequence nor a choice, or in case it has no - sub-element with the specified 'name', or in case the Element's value - can't be returned as a Name. + Returns: + Name: This element's sub-element with ``name`` as a :class:`Name` + Raises: + Exception: If ``name`` is neither a :class:`Name` nor a string, or + if this :class:`Element` is neither a sequence nor a choice, or + in case it has no sub-element with the specified ``name``, or + in case the element's value can't be returned as a + :class:`Name`. """ return self.getElement(name).getValueAsName() def getElementValue(self, name): - """Return this Element's sub-element with 'name'. - - The value is returned in the format defined by this Element datatype. + """ + Args: + name (Name or str): Sub-element identifier - Exception is raised if 'name' is neither a Name nor a string, or if - this Element is neither a sequence nor a choice, or in case it has no - sub-element with the specified 'name'. + Returns: + This element's sub-element with ``name`` defined by its datatype + Raises: + Exception: If ``name`` is neither a :class:`Name` nor a string, or + if this :class:`Element` is neither a sequence nor a choice, or + in case it has no sub-element with the specified ``name``. """ return self.getElement(name).getValue() @@ -608,24 +724,29 @@ def getElementValue(self, name): def setElement(self, name, value): """Set this Element's sub-element with 'name' to the specified 'value'. - This method can process the following types of 'value' without + Args: + name (Name or str): Sub-element identifier + value: Value to set the sub-element to + + Raises: + Exception: If ``name`` is neither a :class:`Name` nor a string, or + if this element has no sub-element with the specified ``name``, + or if the :class:`Element` identified by the specified ``name`` + cannot be initialized from the type of the specified ``value``. + + This method can process the following types of ``value`` without conversion: - boolean - integers - float - string - - datetypes ('datetime.time', 'datetime.date' or 'datetime.datetime') - - Name - - Any other 'value' will be converted to a string with 'str' function and - then processed in the same way as string 'value'. - - An exception is raised if 'name' is neither a Name nor a string, or if - this element has no sub-element with the specified 'name', or if the - Element identified by the specified 'name' cannot be initialized from - the type of the specified 'value'. + - datetypes (``datetime.time``, ``datetime.date`` or + ``datetime.datetime``) + - :class:`Name` + Any other ``value`` will be converted to a string with ``str`` function + and then processed in the same way as string ``value``. """ self.__assertIsValid() @@ -638,24 +759,31 @@ def setElement(self, name, value): traits[0](self.__handle, name[0], name[1], value)) def setValue(self, value, index=0): - """Set the specified 'index'th entry in this Element to the 'value'. + """Set the specified ``index``\ th entry in this :class:`Element` to + the ``value``. + + Args: + index (int): Index of the sub-element + value: Value to set the sub-element to + + Raises: + Exception: If this :class:`Element`\ 's datatype can't be + initialized with the type of the specified ``value``, or if + ``index >= numValues()``. - This method can process the following types of 'value' without + This method can process the following types of ``value`` without conversion: - boolean - integers - float - string - - datetypes ('datetime.time', 'datetime.date' or 'datetime.datetime') - - Name - - Any other 'value' will be converted to a string with 'str' function and - then processed in the same way as string 'value'. - - An exception is raised if this Element's datatype can't be initialized - with the type of the specified 'value', or if 'index >= numValues()'. + - datetypes (``datetime.time``, ``datetime.date`` or + ``datetime.datetime``) + - :class:`Name` + Any other ``value`` will be converted to a string with ``str`` function + and then processed in the same way as string ``value``. """ self.__assertIsValid() @@ -665,35 +793,45 @@ def setValue(self, value, index=0): _ExceptionUtil.raiseOnError(traits[1](self.__handle, value, index)) def appendValue(self, value): - """Append the specified 'value' to this Element's entries at the end. + """Append the specified ``value`` to this :class:`Element`\ s entries + at the end. + + Args: + value: Value to append + + Raises: + Exception: If this :class:`Element`\ 's datatype can't be + initialized from the type of the specified ``value``, or if the + current size of this :class:`Element` (:meth:`numValues()`) is + equal to the maximum defined by + ``elementDefinition().maxValues()``. - This method can process the following types of 'value' without + This method can process the following types of ``value`` without conversion: - boolean - integers - float - string - - datetypes ('datetime.time', 'datetime.date' or 'datetime.datetime') - - Name - - Any other 'value' will be converted to a string with 'str' function and - then processed in the same way as string 'value'. - - An exception is raised if this Element's datatype can't be initialized - from the type of the specified 'value', or if the current size of this - Element ('numValues()') is equal to the maximum defined by - 'elementDefinition().maxValues()'. + - datetypes (``datetime.time``, ``datetime.date`` or + ``datetime.datetime``) + - :class:`Name` + Any other ``value`` will be converted to a string with ``str`` function + and then processed in the same way as string ``value``. """ self.setValue(value, internals.ELEMENT_INDEX_END) def appendElement(self): - """Append a new element to this array Element, return the new Element. + """Append a new element to this array :class:`Element`. - An exception is raised if this Element is not an array of sequence or - choice Elements. + Returns: + Element: The newly appended element + + Raises: + Exception: If this :class:`Element` is not an array of sequence or + choice :class:`Element`\ s. """ @@ -703,11 +841,18 @@ def appendElement(self): return Element(res[1], self._getDataHolder()) def setChoice(self, selectionName): - """Set this Element's active Element to 'selectionName'. + """Set this :class:`Element`\ 's active element to ``selectionName``. + + Args: + selectionName (Name or str): Name of the element to set the active + choice - Exception is raised if 'selectionName' is neither a Name nor a string, - or if this Element is not a choice. + Returns: + Element: The newly active element + Raises: + Exception: If ``selectionName`` is neither a :class:`Name` nor a + string, or if this :class:`Element` is not a choice. """ self.__assertIsValid() diff --git a/blpapi/event.py b/blpapi/event.py index ff5a887..56850c9 100644 --- a/blpapi/event.py +++ b/blpapi/event.py @@ -42,11 +42,11 @@ # pylint: disable=useless-object-inheritance class MessageIterator(object): - """An iterator over the 'Message' objects within an Event. + """An iterator over the :class:`Message` objects within an :class:`Event`. - Few clients will ever make direct use of 'MessageIterator' objects; Python - 'for' loops allow clients to operate directly in terms of 'Event' and - 'Message' objects'. (See the usage example above.) + Few clients will ever make direct use of :class:`MessageIterator` objects; + Python ``for`` loops allow clients to operate directly in terms of + :class:`Event` and :class:`Message` objects. """ def __init__(self, event): @@ -82,71 +82,55 @@ def __next__(self): class Event(object): """A single event resulting from a subscription or a request. - 'Event' objects are created by the API and passed to the application either - through a registered 'EventHandler' or 'EventQueue' or returned either from - the 'Session.nextEvent()' or 'Session.tryNextEvent()' methods. 'Event' - objects contain 'Message' objects which can be accessed using an iteration - over 'Event': + :class:`Event` objects are created by the API and passed to the application + either through a registered ``eventHandler`` or :class:`EventQueue` or + returned either from the ``nextEvent()`` or ``tryNextEvent()`` methods. + :class:`Event` objects contain :class:`Message` objects which can be + accessed using an iteration over :class:`Event`:: for message in event: ... - The 'Event' object is a handle to an event. The event is the basic unit of - work provided to applications. Each 'Event' object consists of an - 'EventType' attribute and zero or more 'Message' objects. + The :class:`Event` object is a handle to an event. The event is the basic + unit of work provided to applications. Each :class:`Event` object consists + of an ``eventType`` attribute and zero or more :class:`Message` objects. - Event objects are always created by the API, never directly by the + :class:`Event` objects are always created by the API, never directly by the application. - Class attributes: - The possible types of event: - ADMIN: - Admin event - SESSION_STATUS: - Status updates for a session - SUBSCRIPTION_STATUS: - Status updates for a subscription - REQUEST_STATUS: - Status updates for a request - RESPONSE: - The final (possibly only) response to a request - PARTIAL_RESPONSE: - A partial response to a request - SUBSCRIPTION_DATA: - Data updates resulting from a subscription - SERVICE_STATUS: - Status updates for a service - TIMEOUT: - An Event returned from nextEvent() if it timed out - AUTHORIZATION_STATUS: - Status updates for user authorization - RESOLUTION_STATUS: - Status updates for a resolution operation - TOPIC_STATUS: - Status updates about topics for service providers - ROKEN_STATUS: - Status updates for a generate token request - REQUEST: - Request event - UNKNOWN: - Unknown event + The class attributes represent the possible types of event. """ ADMIN = internals.EVENTTYPE_ADMIN + """Admin event""" SESSION_STATUS = internals.EVENTTYPE_SESSION_STATUS + """Status updates for a session""" SUBSCRIPTION_STATUS = internals.EVENTTYPE_SUBSCRIPTION_STATUS + """Status updates for a subscription""" REQUEST_STATUS = internals.EVENTTYPE_REQUEST_STATUS + """Status updates for a request""" RESPONSE = internals.EVENTTYPE_RESPONSE + """The final (possibly only) response to a request""" PARTIAL_RESPONSE = internals.EVENTTYPE_PARTIAL_RESPONSE + """A partial response to a request""" SUBSCRIPTION_DATA = internals.EVENTTYPE_SUBSCRIPTION_DATA + """Data updates resulting from a subscription""" SERVICE_STATUS = internals.EVENTTYPE_SERVICE_STATUS + """Status updates for a service""" TIMEOUT = internals.EVENTTYPE_TIMEOUT + """An Event returned from nextEvent() if it timed out""" AUTHORIZATION_STATUS = internals.EVENTTYPE_AUTHORIZATION_STATUS + """Status updates for user authorization""" RESOLUTION_STATUS = internals.EVENTTYPE_RESOLUTION_STATUS + """Status updates for a resolution operation""" TOPIC_STATUS = internals.EVENTTYPE_TOPIC_STATUS + """Status updates about topics for service providers""" TOKEN_STATUS = internals.EVENTTYPE_TOKEN_STATUS + """Status updates for a generate token request""" REQUEST = internals.EVENTTYPE_REQUEST + """Request event""" UNKNOWN = -1 + """Unknown event""" def __init__(self, handle, sessions): self.__handle = handle @@ -159,16 +143,23 @@ def __del__(self): pass def destroy(self): + """Destructor""" if self.__handle: internals.blpapi_Event_release(self.__handle) self.__handle = None def eventType(self): - """Return the type of messages contained by this 'Event'.""" + """ + Returns: + int: Type of messages contained by this :class:`Event`. + """ return internals.blpapi_Event_eventType(self.__handle) def __iter__(self): - """Return the iterator over messages contained in this 'Event'.""" + """ + Returns: + Iterator over messages contained in this :class:`Event`. + """ return MessageIterator(self) def _handle(self): @@ -188,15 +179,18 @@ def _sessions(self): class EventQueue(object): """A construct used to handle replies to request synchronously. - 'EventQueue()' construct an empty 'EventQueue' which can be passed to - 'Session.sendRequest()' and 'Session.sendAuthorizationRequest()' methods. - When a request is submitted an application can either handle the responses - asynchronously as they arrive or use an 'EventQueue' to handle all - responses for a given request or requests synchronously. The 'EventQueue' - will only deliver responses to the request(s) it is associated with. + asynchronously as they arrive or use an :class:`EventQueue` to handle all + responses for a given request or requests synchronously. The + :class:`EventQueue` will only deliver responses to the request(s) it is + associated with. """ def __init__(self): + """ + Construct an empty :class:`EventQueue` which can be passed to + :meth:`~Session.sendRequest()` and + :meth:`~Session.sendAuthorizationRequest()` methods. + """ self.__handle = internals.blpapi_EventQueue_create() self.__sessions = set() @@ -207,29 +201,33 @@ def __del__(self): pass def destroy(self): + """Destructor.""" if self.__handle: internals.blpapi_EventQueue_destroy(self.__handle) self.__handle = None def nextEvent(self, timeout=0): - """Return the next Event available from the 'EventQueue'. + """ + Args: + timeout (int): Timeout threshold in milliseconds. - If the specified 'timeout' is zero this method will wait forever for - the next event. If the specified 'timeout' is non zero then if no - 'Event' is available within the specified 'timeout' an 'Event' with - type of 'TIMEOUT' will be returned. + Returns: + Event: The next :class:`Event` available from the + :class:`EventQueue`. - The 'timeout' is specified in milliseconds. + If the specified ``timeout`` is zero this method will wait forever for + the next event. If the specified ``timeout`` is non zero then if no + :class:`Event` is available within the specified ``timeout`` an + :class:`Event` with type of :attr:`~Event.TIMEOUT` will be returned. """ res = internals.blpapi_EventQueue_nextEvent(self.__handle, timeout) return Event(res, self._getSessions()) def tryNextEvent(self): - """If the 'EventQueue' is non-empty, return the next Event available. - - If the 'EventQueue' is non-empty, return the next 'Event' available. If - the 'EventQueue' is empty, return None with no effect the state of - 'EventQueue'. + """ + Returns: + Event: If the :class:`EventQueue` is non-empty, the next + :class:`Event` available, otherwise ``None``. """ res = internals.blpapi_EventQueue_tryNextEvent(self.__handle) if res[0]: @@ -237,11 +235,12 @@ def tryNextEvent(self): return Event(res[1], self._getSessions()) def purge(self): - """Purge any 'Event' objects in this 'EventQueue'. + """Purge any :class:`Event` objects in this :class:`EventQueue`. - Purges any 'Event' objects in this 'EventQueue' which have not been - processed and cancel any pending requests linked to this 'EventQueue'. - The 'EventQueue' can subsequently be re-used for a subsequent request. + Purges any :class:`Event` objects in this :class:`EventQueue` which + have not been processed and cancel any pending requests linked to this + :class:`EventQueue`. The :class:`EventQueue` can subsequently be + re-used for a subsequent request. """ internals.blpapi_EventQueue_purge(self.__handle) self.__sessions.clear() diff --git a/blpapi/eventdispatcher.py b/blpapi/eventdispatcher.py index a22cad7..6fc8f76 100644 --- a/blpapi/eventdispatcher.py +++ b/blpapi/eventdispatcher.py @@ -14,24 +14,27 @@ class EventDispatcher(object): """Dispatches events from one or more Sessions through callbacks - EventDispatcher objects are optionally specified when Session objects are - created. A single EventDispatcher can be shared by multiple Session - objects. + :class:`EventDispatcher` objects are optionally specified when Session + objects are created. A single :class:`EventDispatcher` can be shared by + multiple Session objects. - The EventDispatcher provides an event-driven interface, generating + The :class:`EventDispatcher` provides an event-driven interface, generating callbacks from one or more internal threads for one or more sessions. """ __handle = None def __init__(self, numDispatcherThreads=1): - """Construct an EventDispatcher. + """Construct an :class:`EventDispatcher`. - If 'numDispatcherThreads' is 1 (the default) then a single internal - thread is created to dispatch events. If 'numDispatcherThreads' is - greater than 1 then an internal pool of 'numDispatcherThreads' threads - is created to dispatch events. The behavior is undefined if - 'numDispatcherThreads' is 0. + Args: + numDispatcherThreads (int): Number of dispatcher threads + + If ``numDispatcherThreads`` is ``1`` (the default) then a single + internal thread is created to dispatch events. If + ``numDispatcherThreads`` is greater than ``1`` then an internal pool of + ``numDispatcherThreads`` threads is created to dispatch events. The + behavior is undefined if ``numDispatcherThreads`` is ``0``. """ self.__handle = internals.blpapi_EventDispatcher_create( @@ -50,10 +53,8 @@ def destroy(self): self.__handle = None def start(self): - """Start generating callbacks. - - Start generating callbacks for events from sessions associated with - this EventDispatcher. + """Start generating callbacks for events from sessions associated with + this :class:`EventDispatcher`. """ return internals.blpapi_EventDispatcher_start(self.__handle) @@ -61,15 +62,20 @@ def start(self): def stop(self, async_=False, **kwargs): """Stop generating callbacks. + Args: + async\_ (bool): Whether to execute this method asynchronously + Stop generating callbacks for events from sessions associated with this - EventDispatcher. If the specified `async_` is False (the default) then - this method blocks until all current callbacks which were dispatched - through this EventDispatcher have completed. If `async_` is True, this - method returns immediately and no further callbacks will be dispatched. - - Note: If stop is called with `async_` of False from within a callback - dispatched by this EventDispatcher then the `async_` parameter is - overridden to True. + :class:`EventDispatcher`. If the specified ``async_`` is ``False`` (the + default) then this method blocks until all current callbacks which were + dispatched through this :class:`EventDispatcher` have completed. If + ``async_`` is ``True``, this method returns immediately and no further + callbacks will be dispatched. + + Note: + If stop is called with ``async_`` of ``False`` from within a + callback dispatched by this :class:`EventDispatcher` then the + ``async_`` parameter is overridden to ``True``. """ if 'async' in kwargs: diff --git a/blpapi/eventformatter.py b/blpapi/eventformatter.py index dd9937c..0dbb1ba 100644 --- a/blpapi/eventformatter.py +++ b/blpapi/eventformatter.py @@ -16,23 +16,26 @@ #pylint: disable=useless-object-inheritance class EventFormatter(object): - """EventFormatter is used to populate 'Event's for publishing. - - An EventFormatter is created from an Event obtained from - createPublishEvent() on Service. Once the Message or Messages have been - appended to the Event using the EventFormatter the Event can be published - using 'publish()' on the ProviderSession. - - EventFormatter objects cannot be copied or as to ensure there is no - ambiguity about what happens if two 'EventFormatter's are both formatting - the same 'Event'. - - The EventFormatter supportes appending message of the same type multiple - time in the same 'Event'. However the 'EventFormatter' supports write once - only to each field. It is an error to call 'setElement()' or 'pushElement()' - for the same name more than once at a particular level of the schema when - creating a message. - + """:class:`EventFormatter` is used to populate :class:`Event`\ s for + publishing. + + An :class:`EventFormatter` is created from an :class:`Event` obtained from + :class:`~Service.createPublishEvent()` on :class:`Service`. Once the + :class:`Message` or :class:`Message`\ s have been appended to the + :class:`Event` using the :class:`EventFormatter` the :class:`Event` can be + published using :meth:`~ProviderSession.publish()` on the + :class:`ProviderSession`. + + :class:`EventFormatter` objects cannot be copied to ensure that there is + no ambiguity about what happens if two :class:`EventFormatter`\ s are both + formatting the same :class:`Event`. + + The :class:`EventFormatter` supports appending message of the same type + multiple times in the same :class:`Event`. However the + :class:`EventFormatter` supports write once only to each field. It is an + error to call :meth:`setElement()` or :meth:`pushElement()` for the same + name more than once at a particular level of the schema when creating a + message. """ __boolTraits = ( @@ -98,12 +101,16 @@ def __getTraits(value): return EventFormatter.__defaultTraits def __init__(self, event): - """Create an EventFormatter to create Messages in the specified 'event' + """Create an :class:`EventFormatter` to create :class:`Message`\ s in + the specified ``event``. + + Args: + event (Event): Event to be formatted - Create an EventFormatter to create Messages in the specified 'event'. - An Event may only be reference by one EventFormatter at any time. - Attempting to create a second EventFormatter referencing the same - Event will result in an exception being raised. + An :class:`Event` may only be referenced by one :class:`EventFormatter` + at any time. Attempting to create a second :class:`EventFormatter` + referencing the same :class:`Event` will result in an exception being + raised. """ self.__handle = internals.blpapi_EventFormatter_create( @@ -116,23 +123,28 @@ def __del__(self): pass def destroy(self): - """Destroy this EventFormatter object.""" + """Destroy this :class:`EventFormatter` object.""" if self.__handle: internals.blpapi_EventFormatter_destroy(self.__handle) self.__handle = None def appendMessage(self, messageType, topic, sequenceNumber=None): - """Append an (empty) message of the specified 'messageType'. - - Append an (empty) message of the specified 'messageType' - that will be published under the specified 'topic' with the - specified 'sequenceNumber' to the Event referenced by this - EventFormatter. It is expected that 'sequenceNumber' is - greater (unless the value wrapped or None is specified) than the last - value used in any previous message on this 'topic', otherwise the - behavior is undefined. - After a message has been appended its elements - can be set using the various 'setElement()' methods. + """Append an (empty) message to the :class:`Event` referenced by this + :class:`EventFormatter` + + Args: + messageType (Name or str): Type of the message + topic (Topic): Topic to publish the message under + sequenceNumber (int): Sequence number of the message + + After a message has been appended its elements can be set using the + various :meth:`setElement()` methods. + + Note: + It is expected that ``sequenceNumber`` is greater (unless the value + wrapped or ``None`` is specified) than the last value used in any + previous message on this ``topic``, otherwise the behavior is + undefined. """ name = getNamePair(messageType) @@ -153,16 +165,29 @@ def appendMessage(self, messageType, topic, sequenceNumber=None): sequenceNumber, 0)) - def appendResponse(self, opType): - """Append an (empty) response message of the specified 'opType'. + def appendResponse(self, operationName): + """Append an (empty) response message for the specified + ``operationName``. - Append an (empty) response message of the specified 'opType' - that will be sent in response to previously received - operation request. After a message has been appended its - elements can be set using the various 'setElement()' methods. - Only one response can be appended. + Args: + operationName (Name or str): Name of the operation whose response + type to use + + Append an (empty) response message for the specified ``operationName`` + (e.g. ``ReferenceDataRequest``) that will be sent in response to the + previously received operation request. After a message for this + operation has been appended its elements can be set using the + :meth:`setElement()` method. Only one response can be appended. + + Note: + The behavior is undefined unless the :class:`Event` is currently + empty. + + Note: + For ``PermissionRequest`` messages, use the ``PermissionResponse`` + operation name. """ - name = getNamePair(opType) + name = getNamePair(operationName) _ExceptionUtil.raiseOnError( internals.blpapi_EventFormatter_appendResponse( self.__handle, @@ -172,24 +197,33 @@ def appendResponse(self, opType): def appendRecapMessage(self, topic, correlationId=None, sequenceNumber=None, fragmentType=Message.FRAGMENT_NONE): - """Append a (empty) recap message that will be published. - - Append a (empty) recap message that will be published under the - specified 'topic' with the specified 'sequenceNumber' to the Publish - Event referenced by this EventFormatter. Specify the optional - 'correlationId' if this recap message is added in - response to a TOPIC_RECAP message. It is expected that - 'sequenceNumber' is greater (unless the value wrapped or None is - specified) than the last value used in any previous message on this - 'topic', otherwise the behavior is undefined. - After a message has been appended its elements can be set using - the various 'setElement()' methods. It is an error to create append - a recap message to an Admin event. - - Single-tick recap messages should have - 'fragmentType'= Message.FRAGMENT_NONE. Multi-tick recaps can have - either Message.FRAGMENT_START, Message.FRAGMENT_INTERMEDIATE, or - Message.FRAGMENT_END as the 'fragmentType'. + """Append a (empty) recap message to the :class:`Event` referenced by + this :class:`EventFormatter`. + + Args: + topic (Topic): Topic to publish under + correlationId (CorrelationId): Specify if recap message + added in response to a ``TOPIC_RECAP`` message + sequenceNumber (int): Sequence number of the message + fragmentType (int): Type of the message fragment + + Specify the optional ``correlationId`` if this recap message is added + in response to a ``TOPIC_RECAP`` message. + + After a message has been appended its elements can be set using the + various :meth:`setElement()` methods. It is an error to create append a + recap message to an Admin event. + + Single-tick recap messages should have ``fragmentType`` set to + :attr:`Message.FRAGMENT_NONE`. Multi-tick recaps can have either + :attr:`Message.FRAGMENT_START`, :attr:`Message.FRAGMENT_INTERMEDIATE`, + or :attr:`Message.FRAGMENT_END` as the ``fragmentType``. + + Note: + It is expected that ``sequenceNumber`` is greater (unless the value + wrapped or ``None`` is specified) than the last value used in any + previous message on this ``topic``, otherwise the behavior is + undefined. """ # pylint: disable=line-too-long cIdHandle = None if correlationId is None else get_handle(correlationId) @@ -230,17 +264,23 @@ def appendRecapMessage(self, topic, correlationId=None, sequenceNumber)) def setElement(self, name, value): - """Set the element with the specified 'name' to the specified 'value'. - - Set the element with the specified 'name' to the specified 'value' in - the current message in the Event referenced by this EventFormatter. If - the 'name' is invalid for the current message, if 'appendMessage()' has - never been called or if the element identified by 'name' has already - been set an exception is raised. - - Clients wishing to format and publish null values (e.g. for the purpose - of cache management) should *not* use this function; use - 'setElementNull' instead. + """Set an element in the :class:`Event` referenced by this + :class:`EventFormatter`. + + Args: + name (Name or str): Name of the element to set + value (bool or str or int or float or ~datetime.datetime or Name): + Value to set the element to + + If the ``name`` is invalid for the current message, or if + :meth:`appendMessage()` has never been called, or if the element + identified by ``name`` has already been set, an exception will be + raised. + + Note: + Clients wishing to format and publish null values (e.g. for the + purpose of cache management) should *not* use this function; use + :meth:`setElementNull` instead. """ traits = EventFormatter.__getTraits(value) name = getNamePair(name) @@ -249,11 +289,15 @@ def setElement(self, name, value): traits[0](self.__handle, name[0], name[1], value)) def setElementNull(self, name): - """Create a null element with the specified 'name'. + """Create a null element with the specified ``name``. - Create a null element with the specified 'name'. Note that whether or - not fields containing null values are published to subscribers is - dependent upon details of the service and schema configuration. + Args: + name (Name or str): Name of the element + + Note: + Whether or not fields containing null values are published to + subscribers depends on the details of the service and schema + configuration. """ name = getNamePair(name) _ExceptionUtil.raiseOnError( @@ -263,22 +307,34 @@ def setElementNull(self, name): name[1])) def pushElement(self, name): - """Change the level at which this EventFormatter is operating. - - Change the level at which this EventFormatter is operating to the - specified element 'name'. The element 'name' must identify either a - choice, a sequence or an array at the current level of the schema or - the behavior is undefined. If the 'name' is invalid for the current - message, if 'appendMessage()' has never been called or if the element - identified by 'name' has already been set an exception is raised. After - this returns the context of the EventFormatter is set to the element - 'name' in the schema and any calls to 'setElement()' or 'pushElement()' - are applied at that level. If 'name' represents an array of scalars then - 'appendValue()' must be used to add values. - If 'name' represents an array of complex types then 'appendElement()' - creates the first entry and sets the context of the EventFormatter - to that element. Calling 'appendElement()' again will create - another entry. + """Change the level at which this :class:`EventFormatter` is operating. + + Args: + name (Name or str): Name of the element that is used to determine + the level + + After this returns the context of the :class:`EventFormatter` is set to + the element ``name`` in the schema and any calls to + :meth:`setElement()` or :meth:`pushElement()` are applied at that + level. + + If ``name`` represents an array of scalars then :meth:`appendValue()` + must be used to add values. + + If ``name`` represents an array of complex types then + :meth:`appendElement()` creates the first entry and sets the context of + the :class:`EventFormatter` to that element. + + Calling :meth:`appendElement()` again will create another entry. + + If the ``name`` is invalid for the current message, if + :meth:`appendMessage()` has never been called or if the element + identified by ``name`` has already been set an exception is raised. + + Note: + The element ``name`` must identify either a choice, a sequence or + an array at the current level of the schema or the behavior is + undefined. """ name = getNamePair(name) _ExceptionUtil.raiseOnError( @@ -288,18 +344,24 @@ def pushElement(self, name): name[1])) def popElement(self): - """Undo the most recent call to 'pushLevel()' on this EventFormatter. + """Undo the most recent call to :meth:`pushElement()` on this + :class:`EventFormatter`. - Undo the most recent call to 'pushLevel()' on this - EventFormatter and return the context of the - EventFormatter to where it was before the call to - 'pushElement()'. Once 'popElement()' has been called it is + Undo the most recent call to :meth:`pushElement()` on this + :class:`EventFormatter` and return the context of the + :class:`EventFormatter` to where it was before the call to + :meth:`pushElement()`. Once :meth:`popElement()` has been called it is invalid to attempt to re-visit the same context. """ _ExceptionUtil.raiseOnError( internals.blpapi_EventFormatter_popElement(self.__handle)) def appendValue(self, value): + """ + Args: + value (bool or str or int or float or ~datetime.datetime or Name): + Value to append + """ traits = EventFormatter.__getTraits(value) value = invoke_if_valid(traits[2], value) _ExceptionUtil.raiseOnError(traits[1](self.__handle, value)) diff --git a/blpapi/exception.py b/blpapi/exception.py index d666260..7cb9aac 100644 --- a/blpapi/exception.py +++ b/blpapi/exception.py @@ -21,6 +21,12 @@ class Exception(_StandardException): Objects of this class contain the error description for the exception. """ def __init__(self, description, errorCode): + """Create a blpapi exception + + Args: + description (str): Description of the error + errorCode (int): Code corresponding to the error + """ _StandardException.__init__(self, description, errorCode) def __str__(self): @@ -31,7 +37,7 @@ def __str__(self): class DuplicateCorrelationIdException(Exception): """Duplicate CorrelationId exception. - The class defines an exception for non unique 'blpapi.CorrelationId'. + The class defines an exception for non unique :class:`CorrelationId`. """ pass @@ -86,7 +92,8 @@ class FieldNotFoundException(Exception): This class defines an exception to capture the error when an invalid field is used for operation. - DEPRECATED + + **DEPRECATED** """ pass diff --git a/blpapi/identity.py b/blpapi/identity.py index bbfea45..743438c 100644 --- a/blpapi/identity.py +++ b/blpapi/identity.py @@ -19,20 +19,20 @@ class Identity(object): """Provides access to the entitlements for a specific user. - An unauthorized Identity is created using 'Session.createIdentity()'. Once - a Identity has been created it can be authorized using - 'Session.sendAuthorizationRequest()'. The authorized Identity can then be - queried or used in 'Session.subscribe()' or 'Session.sendRequest()' calls. + An unauthorized Identity is created using + :meth:`~Session.createIdentity()`. Once an :class:`Identity` has been + created it can be authorized using + :meth:`~Session.sendAuthorizationRequest()`. The authorized + :class:`Identity` can then be queried or used in + :meth:`~Session.subscribe()` or :meth:`~Session.sendRequest()` calls. - Once authorized a Identity has access to the entitlements of the user which - it was validated for. + Once authorized, an :class:`Identity` has access to the entitlements of the + user which it was validated for. + :class:`Identity` objects are always created by the API, never directly by + the application. - Seat types: - - INVALID_SEAT - Unknown seat type - BPS - Bloomberg Professional Service - NONBPS - Non-BPS + The class attributes represent the various seat types. """ INVALID_SEAT = internals.SEATTYPE_INVALID_SEAT @@ -43,7 +43,12 @@ class Identity(object): """Non-BPS""" def __init__(self, handle, sessions): - """Create an Identity associated with the 'sessions'""" + """Create an :class:`Identity` associated with the ``sessions`` + + Args: + handle: Handle to the internal implementation + sessions: Sessions associated with this object + """ self.__handle = handle self.__sessions = sessions internals.blpapi_Identity_addRef(self.__handle) @@ -55,9 +60,9 @@ def __del__(self): pass def destroy(self): - """Destuctor. + """Destructor. - Destroying the last Identity for a specific user cancels any + Destroying the last :class:`Identity` for a specific user cancels any authorizations associated with it. """ if self.__handle: @@ -65,12 +70,18 @@ def destroy(self): self.__handle = None def hasEntitlements(self, service, entitlements): - """Return True if authorized for the specified Service and EIDs. + """ + Args: + service (Service): Service to check authorization for + entitlements ([int] or Element): EIDs to check authorization for + + Returns: + bool: ``True`` if this :class:`Identity` is authorized for the + specified ``service`` and for each of the entitlement IDs contained + in the specified ``entitlements``. - Return True if this 'Identity' is authorized for the specified - 'service' and for each of the entitlement IDs contained in the - specified 'entitlements', which must be a list of integers, or - an 'Element' which is an array of integers. + If :class:`Element` is supplied for ``entitlements``, it must be an + array of integers. """ if isinstance(entitlements, Element): res = internals.blpapi_Identity_hasEntitlements( @@ -98,16 +109,21 @@ def hasEntitlements(self, service, entitlements): return True if res else False def getFailedEntitlements(self, service, entitlements): - """Return a tuple containing a boolean and a list of integers. - - Return a tuple containing a boolean and a list of integers, where - the returned boolean is True if this 'Identity' is authorized for the - specified 'service' and all of the specified 'entitlements', which must - be either a list of integers or an 'Element' which is an array of - integers, and the returned list is the subset of 'entitlements' for - which this identity is not authorized. The contents of the returned - list are not specified if this identity is not authorized for - 'service'. + """ + Args: + service (Service): Service to check authorization for + entitlements ([int] or Element): EIDs to check authorization for + + Returns: + (bool, [int]): Tuple where the boolean is True if this + :class:`Identity` is authorized for the specified ``service`` and + all of the specified ``entitlements``, and the list is a subset of + ``entitlements`` for which this :class:`Identity` is not + authorized. + + Note: + The contents of the returned list are not specified if this + identity is not authorized for ``service``. """ if isinstance(entitlements, Element): maxFailedEIDs = entitlements.numValues() @@ -146,10 +162,13 @@ def getFailedEntitlements(self, service, entitlements): return (True if res else False, result) def isAuthorized(self, service): - """Return True if the handle is authorized for the specified Service. + """ + Args: + service (Service): Service to check authorization for - Return True if this 'Identity' is authorized for the specified - 'service'; otherwise return False. + Returns: + bool: ``True`` if this :class:`Identity` is authorized for the + specified ``service``, ``False`` otherwise. """ res = internals.blpapi_Identity_isAuthorized( self.__handle, @@ -157,7 +176,12 @@ def isAuthorized(self, service): return True if res else False def getSeatType(self): - """Return the seat type of this identity.""" + """ + Returns: + int: Seat type of this identity. + + The class attributes of :class:`Identity` represent the seat types. + """ res = internals.blpapi_Identity_getSeatType(self.__handle) _ExceptionUtil.raiseOnError(res[0]) return res[1] diff --git a/blpapi/internals.py b/blpapi/internals.py index f6b6a33..f7c25f9 100644 --- a/blpapi/internals.py +++ b/blpapi/internals.py @@ -351,55 +351,34 @@ class CorrelationId(_object): """ A key used to identify individual subscriptions or requests. - CorrelationId([value[, classId=0]]) constructs a CorrelationId object. - If 'value' is integer (either int or long) then created CorrelationId will have - type() == CorrelationId.INT_TYPE. Otherwise it will have - type() == CorrelationId.OBJECT_TYPE. If no arguments are specified - then it will have type() == CorrelationId.UNSET_TYPE. - - Two CorrelationIds are considered equal if they have the same - type() and: - - - holds the same (not just equal!) objects in case of - type() == CorrelationId.OBJECT_TYPE - - holds equal integers in case of - type() == CorrelationId.INT_TYPE or - type() == CorrelationId.AUTOGEN_TYPE - - True otherwise - (i.e. in case of type() == CorrelationId.UNSET_TYPE) - - It is possible that an user constructed CorrelationId and a - CorrelationId generated by the API could return the same - result for value(). However, they will not compare equal because - they have different type(). - - CorrelationId objects are passed to many of the Session object - methods which initiate an asynchronous operations and are - obtained from Message objects which are delivered as a result - of those asynchronous operations. - - When subscribing or requesting information an application has - the choice of providing a CorrelationId they construct - themselves or allowing the session to construct one for - them. If the application supplies a CorrelationId it must not - re-use the value contained in it in another CorrelationId - whilst the original request or subscription is still active. - - Class attributes: - MAX_CLASS_ID: - The maximum value allowed for classId. - Possible return values for type() method: - UNSET_TYPE: - The CorrelationId is unset. That is, it was created by - the default CorrelationId constructor. - INT_TYPE: - The CorrelationId was created from an integer (or long) - supplied by the user. - OBJECT_TYPE: - The CorrelationId was created from an object supplied by - the user. - AUTOGEN_TYPE: - The CorrelationId was created internally by API. + Two :class:`CorrelationId` objects are considered equal if they have the same + :meth:`type()` and: + + - Hold the same (not just equal!) objects, if the type is :attr:`OBJECT_TYPE`. + - Hold equal integers, if the type is :attr:`INT_TYPE` or :attr:`AUTOGEN_TYPE`. + + If the type is :attr:`UNSET_TYPE`, then the two :class:`CorrelationId` objects + are always equal (as the value of both will necessarily be ``None``). + + It is possible that a user constructed :class:`CorrelationId` and a + :class:`CorrelationId` generated by the API could return the same result for + :meth:`value()`. However, they will not compare equal because they have a + different :meth:`type()`. + + :class:`CorrelationId` objects are passed to many of the :class:`Session` + object methods which initiate asynchronous operations and are obtained from + :class:`Message` objects which are delivered as a result of those asynchronous + operations. + + When subscribing or requesting information, an application has the choice of + providing a :class:`CorrelationId` they construct themselves or allowing the + session to construct one for them. If the application supplies a + :class:`CorrelationId`, it must not re-use the value contained in it in another + :class:`CorrelationId`, whilst the original request or subscription is still + active. + + The ``xxx_TYPE`` class attributes represent the possible types of + :class:`CorrelationId`. """ __swig_setmethods__ = {} @@ -412,14 +391,22 @@ class CorrelationId(_object): value = _swig_property(_internals.CorrelationId_value_get) UNSET_TYPE = _internals.CORRELATION_TYPE_UNSET + """The :class:`CorrelationId` is unset. That is, it was created by the + default :class:`CorrelationId` constructor.""" INT_TYPE = _internals.CORRELATION_TYPE_INT + """The :class:`CorrelationId` was created from an :class:`int` or + :class:`long` supplied by the user.""" OBJECT_TYPE = _internals.CORRELATION_TYPE_POINTER + """The :class:`CorrelationId` was created from an object supplied by + the user.""" AUTOGEN_TYPE = _internals.CORRELATION_TYPE_AUTOGEN + """The :class:`CorrelationId` was created internally by API.""" MAX_CLASS_ID = _internals.CORRELATION_MAX_CLASS_ID + """The maximum value allowed for ``classId``.""" __TYPE_NAMES = { _internals.CORRELATION_TYPE_UNSET: "UNSET", @@ -455,13 +442,17 @@ def __ne__(self, other): return NotImplemented if equal is NotImplemented else not equal def value(self): - """Return the value of this CorrelationId object. The return value - depends on this CorrelationId's value type and could be: + """ + Returns: + int or long or object: The value of this CorrelationId object. + + The return value depends on this :class:`CorrelationId`\ 's value + type and could be: - - integer (type() == CorrelationId.INT_TYPE - or type() == CorrelationId.AUTOGEN_TYPE) - - object (type() == CorrelationId.OBJECT_TYPE) - - None (type() == CorrelationId.UNSET_TYPE) + - Integer (``type() == CorrelationId.INT_TYPE`` + or ``type() == CorrelationId.AUTOGEN_TYPE``) + - Object (``type() == CorrelationId.OBJECT_TYPE``) + - ``None`` (``type() == CorrelationId.UNSET_TYPE``) """ valueType = self.type() if valueType == CorrelationId.INT_TYPE \ @@ -478,57 +469,16 @@ def _handle(self): def __init__(self, *args): """ - A key used to identify individual subscriptions or requests. - - CorrelationId([value[, classId=0]]) constructs a CorrelationId object. - If 'value' is integer (either int or long) then created CorrelationId will have - type() == CorrelationId.INT_TYPE. Otherwise it will have - type() == CorrelationId.OBJECT_TYPE. If no arguments are specified - then it will have type() == CorrelationId.UNSET_TYPE. - - Two CorrelationIds are considered equal if they have the same - type() and: - - - holds the same (not just equal!) objects in case of - type() == CorrelationId.OBJECT_TYPE - - holds equal integers in case of - type() == CorrelationId.INT_TYPE or - type() == CorrelationId.AUTOGEN_TYPE - - True otherwise - (i.e. in case of type() == CorrelationId.UNSET_TYPE) - - It is possible that an user constructed CorrelationId and a - CorrelationId generated by the API could return the same - result for value(). However, they will not compare equal because - they have different type(). - - CorrelationId objects are passed to many of the Session object - methods which initiate an asynchronous operations and are - obtained from Message objects which are delivered as a result - of those asynchronous operations. - - When subscribing or requesting information an application has - the choice of providing a CorrelationId they construct - themselves or allowing the session to construct one for - them. If the application supplies a CorrelationId it must not - re-use the value contained in it in another CorrelationId - whilst the original request or subscription is still active. - - Class attributes: - MAX_CLASS_ID: - The maximum value allowed for classId. - Possible return values for type() method: - UNSET_TYPE: - The CorrelationId is unset. That is, it was created by - the default CorrelationId constructor. - INT_TYPE: - The CorrelationId was created from an integer (or long) - supplied by the user. - OBJECT_TYPE: - The CorrelationId was created from an object supplied by - the user. - AUTOGEN_TYPE: - The CorrelationId was created internally by API. + ``CorrelationId([value[, classId=0]])`` constructs a :class:`CorrelationId` + object. + + If ``value`` is an integer (either :class:`int` or :class:`long`) then the + created :class:`CorrelationId` will have type :attr:`INT_TYPE`. Otherwise, it + will have type :attr:`OBJECT_TYPE`. + + If no arguments are specified, then the type will be :attr:`UNSET_TYPE`. + + The maximum allowed ``classId`` value is :attr:`MAX_CLASS_ID`. """ this = _internals.new_CorrelationId(*args) try: @@ -539,12 +489,20 @@ def __init__(self, *args): __del__ = lambda self: None def type(self): - """Return the type of this CorrelationId object (see xxx_TYPE class attributes)""" + """ + Returns: + int: The type of this CorrelationId object (see the ``xxx_TYPE`` class + attributes) + """ return _internals.CorrelationId_type(self) def classId(self): - """Return the user defined classification of this CorrelationId object""" + """ + Returns: + int: The user defined classification of this :class:`CorrelationId` + object + """ return _internals.CorrelationId_classId(self) diff --git a/blpapi/internals_wrap.c b/blpapi/internals_wrap.c index 46eb162..df0a829 100644 --- a/blpapi/internals_wrap.c +++ b/blpapi/internals_wrap.c @@ -3180,96 +3180,104 @@ SWIGINTERNINLINE PyObject* #include // for tm and mktime -#include // for PyObject #include // for malloc() and free() #include // for strncpy() -int cstr_StreamWriter(const char *data, int length, void *stream) +typedef struct StreamWriterData { + char *stream; + int size; +} StreamWriterData; + + +// this is the signature dictated by C layer +// we are going to hijack the length and populate .size in streamData +// to allow guiding python to array+size rather than 0-terminated option +int cstr_StreamWriter(const char *data, int length, void *streamData) { - char **targetStr = (char **) stream; - *targetStr = (char *) malloc(length + 1); - strncpy(*targetStr, data, length + 1); + StreamWriterData *stream = (StreamWriterData*) streamData; + char *dest = (char *) malloc(length); + if (dest == 0) { + return 1; + } + memcpy(dest, data, length); + stream->stream = dest; + stream->size = length; return 0; } -PyObject *blpapi_Service_printHelper( +// in all printHelper functions if C layer fails to produce a string +// we shall return a null-pointer and 0-size to SWIG layer, +// which is going to treat it correctly +void blpapi_Service_printHelper( blpapi_Service_t *service, int level, - int spacesPerLevel) + int spacesPerLevel, + char **output_allocated, + int *output_size) { - char *stream; - PyObject *elementStr; - + StreamWriterData stream = {0}; blpapi_Service_print( service, cstr_StreamWriter, &stream, level, spacesPerLevel); - - elementStr = PyString_FromString(stream); - free(stream); - return elementStr; + *output_allocated = stream.stream; + *output_size = stream.size; } -PyObject *blpapi_SchemaElementDefinition_printHelper( +void blpapi_SchemaElementDefinition_printHelper( blpapi_SchemaElementDefinition_t *item, int level, - int spacesPerLevel) + int spacesPerLevel, + char **output_allocated, + int *output_size) { - char *stream; - PyObject *elementStr; - + StreamWriterData stream = {0}; blpapi_SchemaElementDefinition_print( item, cstr_StreamWriter, &stream, level, spacesPerLevel); - - elementStr = PyString_FromString(stream); - free(stream); - return elementStr; + *output_allocated = stream.stream; + *output_size = stream.size; } -PyObject *blpapi_SchemaTypeDefinition_printHelper( +void blpapi_SchemaTypeDefinition_printHelper( blpapi_SchemaTypeDefinition_t *item, int level, - int spacesPerLevel) + int spacesPerLevel, + char **output_allocated, + int *output_size) { - char *stream; - PyObject *elementStr; - + StreamWriterData stream = {0}; blpapi_SchemaTypeDefinition_print( item, cstr_StreamWriter, &stream, level, spacesPerLevel); - - elementStr = PyString_FromString(stream); - free(stream); - return elementStr; + *output_allocated = stream.stream; + *output_size = stream.size; } -PyObject *blpapi_SessionOptions_printHelper( +void blpapi_SessionOptions_printHelper( blpapi_SessionOptions_t *sessionOptions, int level, - int spacesPerLevel) + int spacesPerLevel, + char **output_allocated, + int *output_size) { - char *stream; - PyObject *elementStr; - + StreamWriterData stream = {0}; blpapi_SessionOptions_print( sessionOptions, cstr_StreamWriter, &stream, level, spacesPerLevel); - - elementStr = PyString_FromString(stream); - free(stream); - return elementStr; + *output_allocated = stream.stream; + *output_size = stream.size; } int blpapi_SchemaTypeDefinition_hasElementDefinition( @@ -3427,7 +3435,7 @@ int setLoggerCallbackWrapper(PyObject *cb, int severity) /** Convert `blpapi_TimePoint_t` value to `blpapi_Datetime_t`. Function * always returns UTC time. */ -blpapi_Datetime_t blpapi_HighPrecisionDatetime_fromTimePoint_wrapper(blpapi_TimePoint_t original) +blpapi_Datetime_t blpapi_HighPrecisionDatetime_fromTimePoint_wrapper(blpapi_TimePoint_t original) { blpapi_HighPrecisionDatetime_t highPrecisionDatetime; blpapi_Datetime_t datetime; @@ -3598,6 +3606,35 @@ SWIG_pchar_descriptor(void) } +SWIGINTERNINLINE PyObject * +SWIG_FromCharPtrAndSize(const char* carray, size_t size) +{ + if (carray) { + if (size > INT_MAX) { + swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); + return pchar_descriptor ? + SWIG_InternalNewPointerObj((char *)(carray), pchar_descriptor, 0) : SWIG_Py_Void(); + } else { +#if PY_VERSION_HEX >= 0x03000000 +#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) + return PyBytes_FromStringAndSize(carray, (Py_ssize_t)(size)); +#else +#if PY_VERSION_HEX >= 0x03010000 + return PyUnicode_DecodeUTF8(carray, (Py_ssize_t)(size), "surrogateescape"); +#else + return PyUnicode_FromStringAndSize(carray, (Py_ssize_t)(size)); +#endif +#endif +#else + return PyString_FromStringAndSize(carray, (Py_ssize_t)(size)); +#endif + } + } else { + return SWIG_Py_Void(); + } +} + + SWIGINTERN int SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) { @@ -4199,57 +4236,27 @@ int blpapi_Element_setValueFloat( return ret; } -PyObject *blpapi_Element_printHelper( +void blpapi_Element_printHelper( blpapi_Element_t *element, int level, - int spacesPerLevel) + int spacesPerLevel, + char **output_allocated, + int *output_size) { - char *stream; - PyObject *elementStr; - + // StreamWriterData and cstr_StreamWriter are defined in internals.i + StreamWriterData stream = {0}; blpapi_Element_print( element, cstr_StreamWriter, &stream, level, spacesPerLevel); - - elementStr = PyString_FromString(stream); - free(stream); - return elementStr; + *output_allocated = stream.stream; + *output_size = stream.size; } -SWIGINTERNINLINE PyObject * -SWIG_FromCharPtrAndSize(const char* carray, size_t size) -{ - if (carray) { - if (size > INT_MAX) { - swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - return pchar_descriptor ? - SWIG_InternalNewPointerObj((char *)(carray), pchar_descriptor, 0) : SWIG_Py_Void(); - } else { -#if PY_VERSION_HEX >= 0x03000000 -#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) - return PyBytes_FromStringAndSize(carray, (Py_ssize_t)(size)); -#else -#if PY_VERSION_HEX >= 0x03010000 - return PyUnicode_DecodeUTF8(carray, (Py_ssize_t)(size), "surrogateescape"); -#else - return PyUnicode_FromStringAndSize(carray, (Py_ssize_t)(size)); -#endif -#endif -#else - return PyString_FromStringAndSize(carray, (Py_ssize_t)(size)); -#endif - } - } else { - return SWIG_Py_Void(); - } -} - - SWIGINTERNINLINE PyObject * SWIG_FromCharPtr(const char *cptr) { @@ -4780,17 +4787,21 @@ SWIGINTERN PyObject *_wrap_blpapi_Service_printHelper(PyObject *SWIGUNUSEDPARM(s blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; int arg2 ; int arg3 ; + char **arg4 = (char **) 0 ; + int *arg5 = (int *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; int val3 ; int ecode3 = 0 ; + char *temp4 = 0 ; + int tempn4 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; - PyObject *result = 0 ; + arg4 = &temp4; arg5 = &tempn4; if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Service_printHelper",&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res1)) { @@ -4809,10 +4820,14 @@ SWIGINTERN PyObject *_wrap_blpapi_Service_printHelper(PyObject *SWIGUNUSEDPARM(s arg3 = (int)(val3); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (PyObject *)blpapi_Service_printHelper(arg1,arg2,arg3); + blpapi_Service_printHelper(arg1,arg2,arg3,arg4,arg5); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = result; + resultobj = SWIG_Py_Void(); + if (*arg4) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtrAndSize(*arg4,*arg5)); + free(*arg4); + } return resultobj; fail: return NULL; @@ -4824,17 +4839,21 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_printHelper(PyObject * blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; int arg2 ; int arg3 ; + char **arg4 = (char **) 0 ; + int *arg5 = (int *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; int val3 ; int ecode3 = 0 ; + char *temp4 = 0 ; + int tempn4 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; - PyObject *result = 0 ; + arg4 = &temp4; arg5 = &tempn4; if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_SchemaElementDefinition_printHelper",&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); if (!SWIG_IsOK(res1)) { @@ -4853,10 +4872,14 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_printHelper(PyObject * arg3 = (int)(val3); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (PyObject *)blpapi_SchemaElementDefinition_printHelper(arg1,arg2,arg3); + blpapi_SchemaElementDefinition_printHelper(arg1,arg2,arg3,arg4,arg5); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = result; + resultobj = SWIG_Py_Void(); + if (*arg4) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtrAndSize(*arg4,*arg5)); + free(*arg4); + } return resultobj; fail: return NULL; @@ -4868,17 +4891,21 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_printHelper(PyObject *SWI blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; int arg2 ; int arg3 ; + char **arg4 = (char **) 0 ; + int *arg5 = (int *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; int val3 ; int ecode3 = 0 ; + char *temp4 = 0 ; + int tempn4 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; - PyObject *result = 0 ; + arg4 = &temp4; arg5 = &tempn4; if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_SchemaTypeDefinition_printHelper",&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); if (!SWIG_IsOK(res1)) { @@ -4897,10 +4924,14 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_printHelper(PyObject *SWI arg3 = (int)(val3); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (PyObject *)blpapi_SchemaTypeDefinition_printHelper(arg1,arg2,arg3); + blpapi_SchemaTypeDefinition_printHelper(arg1,arg2,arg3,arg4,arg5); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = result; + resultobj = SWIG_Py_Void(); + if (*arg4) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtrAndSize(*arg4,*arg5)); + free(*arg4); + } return resultobj; fail: return NULL; @@ -4912,17 +4943,21 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_printHelper(PyObject *SWIGUNUSE blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; int arg2 ; int arg3 ; + char **arg4 = (char **) 0 ; + int *arg5 = (int *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; int val3 ; int ecode3 = 0 ; + char *temp4 = 0 ; + int tempn4 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; - PyObject *result = 0 ; + arg4 = &temp4; arg5 = &tempn4; if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_SessionOptions_printHelper",&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { @@ -4941,10 +4976,14 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_printHelper(PyObject *SWIGUNUSE arg3 = (int)(val3); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (PyObject *)blpapi_SessionOptions_printHelper(arg1,arg2,arg3); + blpapi_SessionOptions_printHelper(arg1,arg2,arg3,arg4,arg5); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = result; + resultobj = SWIG_Py_Void(); + if (*arg4) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtrAndSize(*arg4,*arg5)); + free(*arg4); + } return resultobj; fail: return NULL; @@ -6069,17 +6108,21 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_printHelper(PyObject *SWIGUNUSEDPARM(s blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; int arg2 ; int arg3 ; + char **arg4 = (char **) 0 ; + int *arg5 = (int *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; int val3 ; int ecode3 = 0 ; + char *temp4 = 0 ; + int tempn4 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; - PyObject *result = 0 ; + arg4 = &temp4; arg5 = &tempn4; if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Element_printHelper",&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { @@ -6098,11 +6141,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_printHelper(PyObject *SWIGUNUSEDPARM(s arg3 = (int)(val3); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (PyObject *)blpapi_Element_printHelper(arg1,arg2,arg3); + blpapi_Element_printHelper(arg1,arg2,arg3,arg4,arg5); SWIG_PYTHON_THREAD_END_ALLOW; } - { - resultobj = result; + resultobj = SWIG_Py_Void(); + if (*arg4) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtrAndSize(*arg4,*arg5)); + free(*arg4); } return resultobj; fail: @@ -19181,61 +19226,28 @@ static PyMethodDef SwigMethods[] = { { (char *)"CorrelationId_t_equals", _wrap_CorrelationId_t_equals, METH_VARARGS, NULL}, { (char *)"CorrelationId_value_get", _wrap_CorrelationId_value_get, METH_VARARGS, NULL}, { (char *)"new_CorrelationId", _wrap_new_CorrelationId, METH_VARARGS, (char *)"\n" - "A key used to identify individual subscriptions or requests.\n" + "``CorrelationId([value[, classId=0]])`` constructs a :class:`CorrelationId`\n" + "object.\n" "\n" - "CorrelationId([value[, classId=0]]) constructs a CorrelationId object.\n" - "If 'value' is integer (either int or long) then created CorrelationId will have\n" - "type() == CorrelationId.INT_TYPE. Otherwise it will have\n" - "type() == CorrelationId.OBJECT_TYPE. If no arguments are specified\n" - "then it will have type() == CorrelationId.UNSET_TYPE.\n" + "If ``value`` is an integer (either :class:`int` or :class:`long`) then the\n" + "created :class:`CorrelationId` will have type :attr:`INT_TYPE`. Otherwise, it\n" + "will have type :attr:`OBJECT_TYPE`.\n" "\n" - "Two CorrelationIds are considered equal if they have the same\n" - "type() and:\n" + "If no arguments are specified, then the type will be :attr:`UNSET_TYPE`.\n" "\n" - "- holds the same (not just equal!) objects in case of\n" - " type() == CorrelationId.OBJECT_TYPE\n" - "- holds equal integers in case of\n" - " type() == CorrelationId.INT_TYPE or\n" - " type() == CorrelationId.AUTOGEN_TYPE\n" - "- True otherwise\n" - " (i.e. in case of type() == CorrelationId.UNSET_TYPE)\n" - "\n" - "It is possible that an user constructed CorrelationId and a\n" - "CorrelationId generated by the API could return the same\n" - "result for value(). However, they will not compare equal because\n" - "they have different type().\n" - "\n" - "CorrelationId objects are passed to many of the Session object\n" - "methods which initiate an asynchronous operations and are\n" - "obtained from Message objects which are delivered as a result\n" - "of those asynchronous operations.\n" - "\n" - "When subscribing or requesting information an application has\n" - "the choice of providing a CorrelationId they construct\n" - "themselves or allowing the session to construct one for\n" - "them. If the application supplies a CorrelationId it must not\n" - "re-use the value contained in it in another CorrelationId\n" - "whilst the original request or subscription is still active.\n" - "\n" - "Class attributes:\n" - " MAX_CLASS_ID:\n" - " The maximum value allowed for classId.\n" - " Possible return values for type() method:\n" - " UNSET_TYPE:\n" - " The CorrelationId is unset. That is, it was created by\n" - " the default CorrelationId constructor.\n" - " INT_TYPE:\n" - " The CorrelationId was created from an integer (or long)\n" - " supplied by the user.\n" - " OBJECT_TYPE:\n" - " The CorrelationId was created from an object supplied by\n" - " the user.\n" - " AUTOGEN_TYPE:\n" - " The CorrelationId was created internally by API.\n" + "The maximum allowed ``classId`` value is :attr:`MAX_CLASS_ID`.\n" ""}, { (char *)"delete_CorrelationId", _wrap_delete_CorrelationId, METH_VARARGS, NULL}, - { (char *)"CorrelationId_type", _wrap_CorrelationId_type, METH_VARARGS, (char *)"Return the type of this CorrelationId object (see xxx_TYPE class attributes)"}, - { (char *)"CorrelationId_classId", _wrap_CorrelationId_classId, METH_VARARGS, (char *)"Return the user defined classification of this CorrelationId object"}, + { (char *)"CorrelationId_type", _wrap_CorrelationId_type, METH_VARARGS, (char *)"\n" + "Returns:\n" + " int: The type of this CorrelationId object (see the ``xxx_TYPE`` class\n" + " attributes)\n" + ""}, + { (char *)"CorrelationId_classId", _wrap_CorrelationId_classId, METH_VARARGS, (char *)"\n" + "Returns:\n" + " int: The user defined classification of this :class:`CorrelationId`\n" + " object\n" + ""}, { (char *)"CorrelationId___asObject", _wrap_CorrelationId___asObject, METH_VARARGS, NULL}, { (char *)"CorrelationId___asInteger", _wrap_CorrelationId___asInteger, METH_VARARGS, NULL}, { (char *)"CorrelationId___toInteger", _wrap_CorrelationId___toInteger, METH_VARARGS, NULL}, diff --git a/blpapi/logging.py b/blpapi/logging.py index 1bb9061..ce19796 100644 --- a/blpapi/logging.py +++ b/blpapi/logging.py @@ -26,7 +26,7 @@ class Logger: SEVERITY_TRACE = internals.blpapi_Logging_SEVERITY_TRACE @staticmethod - def registerCallback(callback, thresholdSeverity=Logger.SEVERITY_INFO): + def registerCallback(callback, thresholdSeverity=SEVERITY_INFO): """Register the specified 'callback' that will be called for all log messages with severity greater than or equal to the specified 'thresholdSeverity'. The callback needs to be registered before the diff --git a/blpapi/message.py b/blpapi/message.py index 402f083..7b117f2 100644 --- a/blpapi/message.py +++ b/blpapi/message.py @@ -31,22 +31,27 @@ class Message(object): """A handle to a single message. - Message objects are obtained by iterating an Event. Each Message is - associated with a Service and with one or more CorrelationId values. The - Message contents are represented as an Element and all Elements accessors + :class:`Message` objects are obtained by iterating an :class:`Event`. Each + :class:`Message` is associated with a :class:`Service` and with one or more + :class:`CorrelationId` values. The :class:`Message` contents are + represented as an :class:`Element` and all :class:`Element`\ 's accessors could be used to access the data. - Class attributes: - The possible types of fragment types: - FRAGMENT_NONE Unfragmented message - FRAGMENT_START Start of a fragmented message - FRAGMENT_INTERMEDIATE Intermediate fragment - FRAGMENT_END Final part of a fragmented message - - The possible types of recap types: - RECAPTYPE_NONE Normal data tick - RECAPTTYPE_SOLICITED Generated on request by subscriber - RECAPTYPE_UNSOLICITED Generated by the service + The possible fragment types are: + + - :attr:`FRAGMENT_NONE` + - :attr:`FRAGMENT_START` + - :attr:`FRAGMENT_INTERMEDIATE` + - :attr:`FRAGMENT_END` + + The possible recap types are: + + - :attr:`RECAPTYPE_NONE` + - :attr:`RECAPTYPE_SOLICITED` + - :attr:`RECAPTYPE_UNSOLICITED` + + :class:`Message` objects are always created by the API, never directly by + the application. """ __handle = None @@ -68,6 +73,12 @@ class Message(object): """Generated by the service""" def __init__(self, handle, event=None, sessions=None): + """ + Args: + handle: Handle to the internal implementation + event: Event that this message belongs to + sessions: Sessions that this object is associated with + """ internals.blpapi_Message_addRef(handle) self.__handle = handle if event is None: @@ -102,56 +113,68 @@ def __str__(self): return self.toString() def messageType(self): - """Return the type of this message as a Name.""" + """ + Returns: + Name: Type of this message. + """ return Name._createInternally( internals.blpapi_Message_messageType(self.__handle)) def fragmentType(self): - """Return the frament type + """ + Returns: + int: Fragment type of this message. - The fragment type is one of MESSAGE_FRAGMENT_NONE, - MESSAGE_FRAGMENT_START, MESSAGE_FRAGMENT_INTERMEDIATE or - MESSAGE_FRAGMENT_END.""" + Fragment types are listed in the class docstring. + """ return internals.blpapi_Message_fragmentType(self.__handle) def recapType(self): - """Return the recap type + """ + Returns: + int: Recap type of this message. - The recap type is one of MESSAGE_RECAPTYPE_NONE, - MESSAGE_RECAPTYPE_SOLICITED or MESSAGE_RECAPTYPE_UNSOLICITED""" + Recap types are listed in the class docstring. + """ return internals.blpapi_Message_recapType(self.__handle) def topicName(self): - """Return a string containing the topic string of this message. - - If there iss no topic associated with this message then an empty string - is returned. - + """ + Returns: + str: Topic string of this message. If there is no topic associated + with the message, empty string is returned. """ return internals.blpapi_Message_topicName(self.__handle) def service(self): - """Return the Service that this Message is associated with.""" + """ + Returns: + Service: Service that this :class:`Message` is associated with. + """ serviceHandle = internals.blpapi_Message_service(self.__handle) return None if serviceHandle is None \ else service.Service(serviceHandle, self.__sessions) def correlationIds(self): - """Return the list of CorrelationIds associated with this message. - - Note: A Message will have exactly one CorrelationId unless - 'allowMultipleCorrelatorsPerMsg' option was enabled for the Session - this Message belongs to. When 'allowMultipleCorrelatorsPerMsg' is - disabled (the default) and more than one active subscription would - result in the same Message the Message is delivered multiple times - (without making physical copies). Each Message is accompanied by a - single CorrelationId. When 'allowMultipleCorrelatorsPerMsg' is enabled - and more than one active subscription would result in the same Message - the Message is delivered once with a list of corresponding - CorrelationId values. - + """ + Returns: + [CorrelationId]: Correlation ids associated with this message. + + Note: + A :class:`Message` will have exactly one :class:`CorrelationId` + unless ``allowMultipleCorrelatorsPerMsg`` option was enabled for + the :class:`Session` this :class:`Message` belongs to. When + ``allowMultipleCorrelatorsPerMsg`` is disabled (the default), and + more than one active subscription would result in the same + :class:`Message`, the :class:`Message` is delivered multiple times + (without making physical copies). Each :class:`Message` is + accompanied by a single :class:`CorrelationId`. When + ``allowMultipleCorrelatorsPerMsg`` is enabled and more than one + active subscription would result in the same :class:`Message` the + :class:`Message` is delivered once with a list of corresponding + :class:`CorrelationId` values. """ res = [] @@ -166,35 +189,46 @@ def hasElement(self, name, excludeNullElements=False): return self.asElement().hasElement(name, excludeNullElements) def numElements(self): - """Equivalent to asElement().numElements().""" + """Equivalent to :meth:`asElement().numElements() + `.""" return self.asElement().numElements() def getElement(self, name): - """Equivalent to asElement().getElement(name).""" + """Equivalent to :meth:`asElement().getElement(name) + `.""" return self.asElement().getElement(name) def getElementAsBool(self, name): - """Equivalent to asElement().getElementAsBool(name).""" + """Equivalent to :meth:`asElement().getElementAsBool(name) + `.""" return self.asElement().getElementAsBool(name) def getElementAsString(self, name): - """Equivalent to asElement().getElementAsString(name).""" + """Equivalent to :meth:`asElement().getElementAsString(name) + `.""" return self.asElement().getElementAsString(name) def getElementAsInteger(self, name): - """Equivalent to asElement().getElementAsInteger(name).""" + """Equivalent to :meth:`asElement().getElementAsInteger(name) + `.""" return self.asElement().getElementAsInteger(name) def getElementAsFloat(self, name): - """Equivalent to asElement().getElementAsFloat(name).""" + """Equivalent to :meth:`asElement().getElementAsFloat(name) + `.""" return self.asElement().getElementAsFloat(name) def getElementAsDatetime(self, name): - """Equivalent to asElement().getElementAsDatetime(name).""" + """Equivalent to :meth:`asElement().getElementAsDatetime(name) + `.""" return self.asElement().getElementAsDatetime(name) def asElement(self): - """Return the content of this Message as an Element.""" + """ + Returns: + Element: The content of this :class:`Message` as an + :class:`Element`. + """ el = None if self.__element: el = self.__element() @@ -205,17 +239,42 @@ def asElement(self): return el def toString(self, level=0, spacesPerLevel=4): - """Format this Element to the string.""" + """Format this :class:`Message` to the string at the specified + indentation level. + + Args: + level (int): Indentation level + spacesPerLevel (int): Number of spaces per indentation level for + this and all nested objects + + Returns: + str: This element formatted as a string + + If ``level`` is negative, suppress indentation of the first line. If + ``spacesPerLevel`` is negative, format the entire output on one line, + suppressing all but the initial indentation (as governed by ``level``). + """ return self.asElement().toString(level, spacesPerLevel) def timeReceived(self, tzinfo=UTC): - """Return the time when the message was received by the SDK. This - method will throw 'ValueError' if this information was not recorded for - this message; see 'SessionOptions.recordSubscriptionDataReceiveTimes' - for information on configuring this recording. The resulting datetime - will be represented using the specified 'tzinfo' value, and will be - measured using a high-resolution clock internal to the SDK; see - 'highresclock' for more information on this clock.""" + """Get the time when the message was received by the SDK. + + Args: + tzinfo (~datetime.tzinfo): Timezone info + + Returns: + datetime.datetime or datetime.date or datetime.time: Time when the + message was received by the SDK. + + Raises: + ValueError: If this information was not recorded for this message. + See :meth:`SessionOptions.recordSubscriptionDataReceiveTimes` + for information on configuring this recording. + + The resulting datetime will be represented using the specified + ``tzinfo`` value, and will be measured using a high-resolution clock + internal to the SDK. + """ err_code, time_point = internals.blpapi_Message_timeReceived( self.__handle) if err_code != 0: diff --git a/blpapi/name.py b/blpapi/name.py index 4d2d7cd..fa2e7f9 100644 --- a/blpapi/name.py +++ b/blpapi/name.py @@ -14,43 +14,50 @@ # pylint: disable=useless-object-inheritance,broad-except class Name(object): - """Name represents a string in a form which is efficient for comparison. - - Name(nameString) constructs a Name object. - - Name objects are used to identify and access the classes which define the - schema - SchemaTypeDefinition, SchemaElementDefinition, SchemaConstant, - SchemaConstantList. They are also used to access the values in Element - objects and Message objects. - - The Name class is an efficient substitute for a string when used as a key, - providing constant time comparison and ordering operations. Two Name - objects constructed from equal strings will always compare equally. - - Where possible, Name objects should be initialized once and then reused. - Creating a Name object involves a search in a container requiring multiple - string comparison operations. - - Note: Each Name instance refers to an entry in a global static table. Name - instances for identical strings will refer to the same data. There is no - provision for removing entries from the static table so Name objects should - only be used when the set of input strings is bounded. - - For example, creating a Name for every possible field name and type in a - data model is reasonable (in fact, the API will do this whenever it - receives schema information). However converting sequence numbers on - incoming messages to strings and creating a Name from each one of those - strings will cause the static table to grow in an unbounded manner. - + """:class:`Name` represents a string in a form which is efficient for + comparison. + + :class:`Name` objects are used to identify and access the classes which + define the schema - :class:`SchemaTypeDefinition`, + :class:`SchemaElementDefinition`, :class:`Constant`, :class:`ConstantList`. + They are also used to access the values in :class:`Element` objects and + :class:`Message` objects. + + The :class:`Name` class is an efficient substitute for a string when used + as a key, providing constant time comparison and ordering operations. Two + :class:`Name` objects constructed from equal strings will always compare + equally. + + Where possible, :class:`Name` objects should be initialized once and then + reused. Creating a :class:`Name` object involves a search in a container + requiring multiple string comparison operations. + + Note: + Each :class:`Name` instance refers to an entry in a global static + table. :class:`Name` instances for identical strings will refer to the + same data. There is no provision for removing entries from the static + table so :class:`Name` objects should only be used when the set of + input strings is bounded. + + For example, creating a :class:`Name` for every possible field name and + type in a data model is reasonable (in fact, the API will do this + whenever it receives schema information). However converting sequence + numbers on incoming messages to strings and creating a :class:`Name` + from each one of those strings will cause the static table to grow in + an unbounded manner. """ __handle = None @staticmethod def findName(nameString): - """Return an existing Name object representing 'nameString'. + """ + Args: + nameString (str): String represented by an existing :class:`Name` - If no such object exists, None is returned. + Returns: + Name: An existing :class:`Name` object representing ``nameString``. + If no such object exists, ``None`` is retured. """ nameHandle = internals.blpapi_Name_findName(nameString) return None if nameHandle is None \ @@ -58,7 +65,13 @@ def findName(nameString): @staticmethod def hasName(nameString): - """Return True if a Name object representing 'nameString' exists. + """ + Args: + nameString (str): String represented by an existing :class:`Name` + + Returns: + bool: ``True`` if a :class:`Name` object representing + ``nameString`` exists """ return bool(internals.blpapi_Name_hasName(nameString)) @@ -123,11 +136,20 @@ def _handle(self): def getNamePair(name): - """Create a tuple that contains nameString and blpapi_Name_t *. + """Create a tuple that contains a name string and blpapi_Name_t*. + + Args: + name (Name or str): A :class:`Name` or a string instance + + Returns: + ``(None, name._handle())`` if ``name`` is a :class:`Name` instance, or + ``(name, None)`` if ``name`` is a string. In other cases raise + TypeError exception. - Return (None, name._handle()) if 'name' is a Name instance or (name, None) - if name is a string. In other cases raise TypeError exception. + Raises: + TypeError: If ``name`` is neither a :class:`Name` nor a string + For internal use only. """ if isinstance(name, Name): diff --git a/blpapi/providersession.py b/blpapi/providersession.py index 75fea8c..57bbdad 100644 --- a/blpapi/providersession.py +++ b/blpapi/providersession.py @@ -76,16 +76,31 @@ from .utils import get_handle from .compat import with_metaclass -# pylint: disable=line-too-long,bad-continuation,useless-object-inheritance +# pylint: disable=line-too-long,bad-continuation,useless-object-inheritance,too-many-lines # pylint: disable=protected-access,too-many-public-methods,bare-except,too-many-function-args @with_metaclass(utils.MetaClassForClassesWithEnums) class ServiceRegistrationOptions(object): """Contains the options which can be specified when registering a service. - To use non-default options to registerService, create a - ServiceRegistrationOptions instance and set the required options and then - supply it when using the registerService interface. + To use non-default options to :meth:`~ProviderSession.registerService()`, + create a :class:`ServiceRegistrationOptions` instance and set the required + options and then supply it when using the + :meth:`~ProviderSession.registerService()` interface. + + The following attributes represent service registration priorities: + + - :attr:`PRIORITY_LOW` + - :attr:`PRIORITY_MEDIUM` + - :attr:`PRIORITY_HIGH` + + The following attributes represent the registration parts: + + - :attr:`PART_PUBLISHING` + - :attr:`PART_OPERATIONS` + - :attr:`PART_SUBSCRIBER_RESOLUTION` + - :attr:`PART_PUBLISHER_RESOLUTION` + - :attr:`PART_DEFAULT` """ PRIORITY_LOW = internals.SERVICEREGISTRATIONOPTIONS_PRIORITY_LOW @@ -96,29 +111,29 @@ class ServiceRegistrationOptions(object): # Constants for specifying which part(s) of a service should be registered: PART_PUBLISHING = internals.REGISTRATIONPARTS_PUBLISHING - # register to receive subscribe and unsubscribe messages + """Register to receive subscribe and unsubscribe messages""" PART_OPERATIONS = internals.REGISTRATIONPARTS_OPERATIONS - # register to receive the request types corresponding to each - # "operation" defined in the service metadata + """Register to receive the request types corresponding to each "operation" + defined in the service metadata""" PART_SUBSCRIBER_RESOLUTION \ = internals.REGISTRATIONPARTS_SUBSCRIBER_RESOLUTION - # register to receive resolution requests (with message type - # 'PermissionRequest') from subscribers + """Register to receive resolution requests (with message type + ``PermissionRequest``) from subscribers""" PART_PUBLISHER_RESOLUTION \ = internals.REGISTRATIONPARTS_PUBLISHER_RESOLUTION - # register to receive resolution requests (with message type - # 'PermissionRequest') from publishers (via - # 'ProviderSession.createTopics') + """Register to receive resolution requests (with message type + ``PermissionRequest``) from publishers (via + :meth:`ProviderSession.createTopics()`)""" PART_DEFAULT = internals.REGISTRATIONPARTS_DEFAULT - # register the parts of the service implied by options - # specified in the service metadata + """Register the parts of the service implied by options specified in the + service metadata""" def __init__(self): - """Create ServiceRegistrationOptions with default options.""" + """Create :class:`ServiceRegistrationOptions` with default options.""" self.__handle = internals.blpapi_ServiceRegistrationOptions_create() def __del__(self): @@ -128,7 +143,7 @@ def __del__(self): pass def destroy(self): - """Destroy this ServiceRegistrationOptions.""" + """Destroy this :class:`ServiceRegistrationOptions`.""" if self.__handle: internals.blpapi_ServiceRegistrationOptions_destroy(self.__handle) self.__handle = None @@ -136,10 +151,13 @@ def destroy(self): def setGroupId(self, groupId): """Set the Group ID for the service to be registered. + Args: + groupId (str): The group ID for the service to be registered + Set the Group ID for the service to be registered to the specified - 'groupId' string. If 'groupId' length is greater than - MAX_GROUP_ID_SIZE (=64) only the first MAX_GROUP_ID_SIZE chars are - considered as Group Id. + ``groupId`` string. If ``groupId`` length is greater than + ``MAX_GROUP_ID_SIZE`` (=64) only the first ``MAX_GROUP_ID_SIZE`` chars + are considered as Group Id. """ internals.blpapi_ServiceRegistrationOptions_setGroupId( self.__handle, groupId.encode('utf-8')) @@ -149,41 +167,59 @@ def setGroupId(self, groupId): def setServicePriority(self, priority): """Set the priority with which a service will be registered. + Args: + priority (int): The service priority + Set the priority with which a service will be registered to the - specified 'priority', where numerically greater values of 'priority' - indicate higher priorities. The behavior is undefined unless - 'priority' is non-negative. Note that while the values pre-defined in - ServiceRegistrationOptions are suitable for use here, any non-negative - 'priority' is acceptable. + specified ``priority``, where numerically greater values of + ``priority`` indicate higher priorities. The behavior is undefined + unless ``priority`` is non-negative. Note that while the values + pre-defined in ``ServiceRegistrationOptions`` are suitable for use + here, any non-negative ``priority`` is acceptable. By default, a service will be registered with priority - ServiceRegistrationOptions.PRIORITY_HIGH. + :attr:`PRIORITY_HIGH`. """ return internals.blpapi_ServiceRegistrationOptions_setServicePriority( self.__handle, priority) def getGroupId(self): - """Return the value of the service Group Id in this instance.""" + """ + Returns: + str: The value of the service Group Id in this instance. + """ _, groupId = \ internals.blpapi_ServiceRegistrationOptions_getGroupId( self.__handle) return groupId def getServicePriority(self): - """Return the value of the service priority in this instance.""" + """ + Returns: + int: The value of the service priority in this instance. + """ priority = \ internals.blpapi_ServiceRegistrationOptions_getServicePriority( self.__handle) return priority def addActiveSubServiceCodeRange(self, begin, end, priority): - """Advertise the service to be registered to receive, with the - specified 'priority', subscriptions that the resolver has mapped to a - service code between the specified 'begin' and the specified 'end' - values, inclusive. Numerically greater values of 'priority' indicate - higher priorities. The behavior of this function is undefined unless - '0 <= begin <= end < (1 << 24)', and 'priority' is non-negative. + """ + Args: + begin (int): Start of sub-service code range + end (int): End of sub-service code range + priority (int): Priority with which to receive subscriptions + + Advertise the service to be registered to receive, with the + specified ``priority``, subscriptions that the resolver has mapped to a + service code between the specified ``begin`` and the specified ``end`` + values, inclusive. Numerically greater values of ``priority`` indicate + higher priorities. + + Note: + The behavior of this function is undefined unless ``0 <= begin <= + end < (1 << 24)``, and ``priority`` is non-negative. """ err = internals.blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange( self.__handle, begin, end, priority) @@ -195,16 +231,26 @@ def removeAllActiveSubServiceCodeRanges(self): self.__handle) def setPartsToRegister(self, parts): - """Set the parts of the service to be registered to the specified - 'parts', which must be a bitwise-or of the options provided in - 'RegistrationParts', above. This option defaults to - 'RegistrationParts.PARTS_DEFAULT'.""" + """Set the parts of the service to be registered. + + Args: + int: Parts of the service to be registered. + + Set the parts of the service to be registered to the specified + ``parts``, which must be a bitwise-or of the options provided in + "registration parts" options (enumerated in the class docstring). This + option defaults to :attr:`PART_DEFAULT`. + """ internals.blpapi_ServiceRegistrationOptions_setPartsToRegister( self.__handle, parts) def getPartsToRegister(self): - """Return the parts of the service to be registered. See - 'RegistrationParts', above for additional details.""" + """ + Returns: + int: The parts of the service to be registered. + + Registration parts are enumerated in the class docstring. + """ return internals.blpapi_ServiceRegistrationOptions_getPartsToRegister( self.__handle) @@ -217,28 +263,28 @@ def _handle(self): class ProviderSession(AbstractSession): """This class provides a session that can be used for providing services. - It inherits from AbstractSession. In addition to the AbstractSession - functionality a ProviderSession provides the following functions to - applications. + It inherits from :class:`AbstractSession`. In addition to the + :class:`AbstractSession` functionality a :class:`ProviderSession` provides + the following functions to applications. A provider can register to provide services using - 'ProviderSession.registerService*'. Before registering to provide a + :meth:`registerService()`. Before registering to provide a service the provider must have established its identity. Then the provider can create topics and publish events on topics. It also can get requests from the event queue and send back responses. After users have registered a service they will start receiving - subscription requests ('TopicSubscribed' message in 'TOPIC_STATUS') for - topics which belong to the service. If the resolver has specified - 'subServiceCode' for topics in 'PermissionResponse', then only providers - who have activated the 'subServiceCode' will get the subscription request. - Where multiple providers have registered the same service and sub-service - code (if any), the provider that registered the highest priority for the - sub-service code will receive subscription requests; if multiple providers - have registered the same sub-service code with the same priority (or the - resolver did not set a sub-service code for the subscription), the - subscription request will be routed to one of the providers with the - highest service priority. + subscription requests (``TopicSubscribed`` message in + :attr:`~Event.TOPIC_STATUS`) for topics which belong to the service. If the + resolver has specified ``subServiceCode`` for topics in + ``PermissionResponse``, then only providers who have activated the + ``subServiceCode`` will get the subscription request. Where multiple + providers have registered the same service and sub-service code (if any), + the provider that registered the highest priority for the sub-service code + will receive subscription requests; if multiple providers have registered + the same sub-service code with the same priority (or the resolver did not + set a sub-service code for the subscription), the subscription request will + be routed to one of the providers with the highest service priority. """ AUTO_REGISTER_SERVICES = \ @@ -266,39 +312,48 @@ def __dispatchEvent(sessionRef, eventHandle): def __init__(self, options=None, eventHandler=None, eventDispatcher=None): """Constructor. + Args: + options (SessionOptions): Options used to construct the sessions + eventHandler (~collections.abc.Callable): Handler for the events + generated by this session + eventDispatcher (EventDispatcher): Dispatcher for the events + generated by this session + + Raises: + InvalidArgumentException: If ``eventHandler`` is ``None`` and the + ``eventDispatcher`` is not ``None`` + Construct a Session using the optionally specified 'options', the optionally specified 'eventHandler' and the optionally specified 'eventDispatcher'. - See the SessionOptions documentation for details on what can be - specified in the 'options'. + See :class:`SessionOptions` for details on what can be specified in + the ``options``. - If 'eventHandler' is not None then this Session will operate in + If ``eventHandler`` is not ``None`` then this Session will operate in asynchronous mode, otherwise the Session will operate in synchronous mode. - If supplied, 'eventHandler' is a callable object that takes two + If supplied, ``eventHandler`` is a callable object that takes two arguments: received event and related session. - If 'eventDispatcher' is None then the Session will create a default - EventDispatcher for this Session which will use a single thread for - dispatching events. For more control over event dispatching a specific - instance of EventDispatcher can be supplied. This can be used to share - a single EventDispatcher amongst multiple Session objects. - - If an 'eventDispatcher' is supplied which uses more than one thread the - Session will ensure that events which should be ordered are passed to - callbacks in a correct order. For example, partial response to - a request or updates to a single subscription. - - If 'eventHandler' is None and the 'eventDispatcher' is not None an - exception is raised. - - Each EventDispatcher uses its own thread or pool of threads so if you - want to ensure that a session which receives very large messages and - takes a long time to process them does not delay a session that + If ``eventDispatcher`` is ``None`` then the Session will create a + default :class:`EventDispatcher` for this Session which will use a + single thread for dispatching events. For more control over event + dispatching a specific instance of :class:`EventDispatcher` can be + supplied. This can be used to share a single :class:`EventDispatcher` + amongst multiple Session objects. + + If an ``eventDispatcher`` is supplied which uses more than one thread + the Session will ensure that events which should be ordered are passed + to callbacks in a correct order. For example, partial response to a + request or updates to a single subscription. + + Each :class:`EventDispatcher` uses its own thread or pool of threads so + if you want to ensure that a session which receives very large messages + and takes a long time to process them does not delay a session that receives small messages and processes each one very quickly then give - each one a separate EventDispatcher. + each one a separate :class:`EventDispatcher`. """ AbstractSession.__init__(self) if (eventHandler is None) and (eventDispatcher is not None): @@ -333,40 +388,53 @@ def destroy(self): self.__handle = None def start(self): - """Start this session in synchronous mode. + """Start this :class:`Session` in synchronous mode. - Attempt to start this Session and blocks until the Session has started - or failed to start. If the Session is started successfully iTrue is - returned, otherwise False is returned. Before start() returns a - SESSION_STATUS Event is generated. If this is an asynchronous Session - then the SESSION_STATUS may be processed by the registered EventHandler - before start() has returned. A Session may only be started once. + Returns: + bool: ``True`` if the :class:`Session` started successfully, + ``False`` otherwise. + + Attempt to start this :class:`Session` and block until the + :class:`Session` has started or failed to start. Before + :meth:`start()` returns a :attr:`~Event.SESSION_STATUS` :class:`Event` + is generated. A :class:`Session` may only be started once. """ return internals.blpapi_ProviderSession_start(self.__handle) == 0 def startAsync(self): - """Start this session in asynchronous mode. - - Attempt to begin the process to start this Session and return True if - successful, otherwise return False. The application must monitor events - for a SESSION_STATUS Event which will be generated once the Session has - started or if it fails to start. If this is an asynchronous Session - then the SESSION_STATUS Event may be processed by the registered - EventHandler before startAsync() has returned. A Session may only be - started once. + """Start this :class:`Session` in asynchronous mode. + + Returns: + bool: ``True`` if the process to start a :class:`Session` began + successfully, ``False`` otherwise. + + Attempt to begin the process to start this :class:`Session`. The + application must monitor events for a :attr:`~Event.SESSION_STATUS` + :class:`Event` which will be generated once the :class:`Session` has + started or if it fails to start. The :attr:`~Event.SESSION_STATUS` + :class:`Event` may be processed by the registered ``eventHandler`` + before :meth:`startAsync()` has returned. A :class:`Session` may only + be started once. """ return internals.blpapi_ProviderSession_startAsync(self.__handle) == 0 def flushPublishedEvents(self, timeoutMsecs): - """Wait at most 'timeoutMsecs' milliseconds for all the published - events to be sent through the underlying channel. The method returns - either as soon as all the published events have been sent out or - when it has waited 'timeoutMs' milliseconds. Return true if - all the published events have been sent; false otherwise. - The behavior is undefined unless the specified 'timeoutMsecs' is - a non-negative value. When 'timeoutMsecs' is 0, the method checks - if all the published events have been sent and returns without - waiting.""" + """Wait at most ``timeoutMsecs`` milliseconds for all the published + events to be sent through the underlying channel. + + Args: + timeoutMsecs (int): Timeout threshold in milliseconds + + Returns: + bool: ``True`` if all the published events have been sent, + ``False`` otherwise + + The method returns either as soon as all the published events have been + sent out or when it has waited ``timeoutMsecs`` milliseconds. The behavior + is undefined unless the specified ``timeoutMsecs`` is a non-negative + value. When ``timeoutMsecs`` is ``0``, the method checks if all the published + events have been sent and returns without waiting. + """ err_code, allFlushed = internals.blpapi_ProviderSession_flushPublishedEvents(self.__handle, timeoutMsecs) if err_code != 0: @@ -375,43 +443,59 @@ def flushPublishedEvents(self, timeoutMsecs): return allFlushed != 0 def stop(self): - """Stop operation of this session and wait until it stops. - - Stop operation of this session and block until all callbacks to - EventHandler objects relating to this Session which are currently in - progress have completed (including the callback to handle - the SESSION_STATUS Event this call generates). Once this returns no - further callbacks to EventHandlers will occur. If stop() is called from - within an EventHandler callback it is silently converted to - a stopAsync() in order to prevent deadlock. Once a Session has been - stopped it can only be destroyed. + """Stop operation of this :class:`Session` and wait until it stops. + + Returns: + bool: ``True`` if the :class:`Session` stopped successfully, + ``False`` otherwise. + + Stop operation of this :class:`Session` and block until all callbacks + to ``eventHandler`` objects relating to this :class:`Session` which are + currently in progress have completed (including the callback to handle + the :class:`~Event.SESSION_STATUS` :class:`Event` this call generates). + Once this returns no further callbacks to ``eventHandlers`` will occur. + If :meth:`stop()` is called from within an ``eventHandler`` callback it + is silently converted to a :meth:`stopAsync()` in order to prevent + deadlock. Once a :class:`Session` has been stopped it can only be + destroyed. """ return internals.blpapi_ProviderSession_stop(self.__handle) == 0 def stopAsync(self): """Begin the process to stop this Session and return immediately. - The application must monitor events for a - SESSION_STATUS Event which will be generated once the - Session has been stopped. After this SESSION_STATUS Event - no further callbacks to EventHandlers will occur(). Once a - Session has been stopped it can only be destroyed. + Returns: + bool: ``True`` if the process to stop a :class:`Session` began + successfully, ``False`` otherwise. + + The application must monitor events for a :attr:`~Event.SESSION_STATUS` + :class:`Event` which will be generated once the :class:`Session` has + been stopped. After this :attr:`~Event.SESSION_STATUS` :class:`Event` + no further callbacks to ``eventHandlers`` will occur. Once a + :class:`Session` has been stopped it can only be destroyed. """ - return internals.blpapi_ProviderSession_stop(self.__handle) == 0 + return internals.blpapi_ProviderSession_stopAsync(self.__handle) == 0 def nextEvent(self, timeout=0): - """Return the next available Event for this session. + """ + Args: + timeout (int): Timeout threshold in milliseconds - If there is no event available this will block for up to the specified - 'timeoutMillis' milliseconds for an Event to arrive. A value of 0 for - 'timeoutMillis' (the default) indicates nextEvent() should not timeout - and will not return until the next Event is available. + Returns: + Event: Next available event for this session - If nextEvent() returns due to a timeout it will return an event of type - 'EventType.TIMEOUT'. + Raises: + InvalidStateException: If invoked on a session created in + asynchronous mode - If this is invoked on a Session which was created in asynchronous mode - an InvalidStateException is raised. + If there is no :class:`Event` available this will block for up to the + specified ``timeout`` milliseconds for an :class:`Event` to arrive. A + value of ``0`` for ``timeout`` (the default) indicates + :meth:`nextEvent()` should not timeout and will not return until the + next :class:`Event` is available. + + If :meth:`nextEvent()` returns due to a timeout it will return an event + of type :attr:`~Event.TIMEOUT`. """ retCode, event = internals.blpapi_ProviderSession_nextEvent( self.__handle, @@ -422,11 +506,13 @@ def nextEvent(self, timeout=0): return Event(event, self) def tryNextEvent(self): - """Return the next Event for this session if it is available. + """ + Returns: + Event: Next available event for this session - If there are Events available for the session, return the next Event - If there is no event available for the session, return None. This - method never blocks. + If there are :class:`Event`\ s available for the session, return the + next :class:`Event` If there is no event available for the + :class:`Session`, return ``None``. This method never blocks. """ retCode, event = internals.blpapi_ProviderSession_tryNextEvent( self.__handle) @@ -437,23 +523,33 @@ def tryNextEvent(self): def registerService(self, uri, identity=None, options=None): """Attempt to register the service and block until it is done. - Attempt to register the service identified by the specified 'uri' and - block until the service is either registered successfully or has failed - to be registered. The optionally specified 'identity' is used to verify - permissions to provide the service being registered. The optionally - specified 'options' is used to specify the group ID and service - priority of the service being registered. Return 'True' if the service - is registered successfully and 'False' if the service cannot be - registered successfully. + Args: + uri (str): Name of the service + identity (Identity): Identity used to verify permissions to provide + the service being registered + options (ServiceRegistrationOptions): Options used to register the + service - The 'uri' must begin with a full qualified service name. That is it - must begin with "///[/]". Any portion of the - 'uri' after the service name is ignored. + Returns: + bool: ``True`` if the service registered successfully, ``False`` + otherwise - Before registerService() returns a SERVICE_STATUS Event is generated. - If this is an asynchronous ProviderSession then this Event may be - processed by the registered Event before registerService() has - returned. + Attempt to register the service identified by the specified ``uri`` and + block until the service is either registered successfully or has failed + to be registered. The optionally specified ``identity`` is used to verify + permissions to provide the service being registered. The optionally + specified ``options`` is used to specify the group ID and service + priority of the service being registered. + + The ``uri`` must begin with a full qualified service name. That is it + must begin with ``///[/]``. Any portion of the + ``uri`` after the service name is ignored. + + Before :meth:`registerService()` returns a + :attr:`~Event.SERVICE_STATUS` :class:`Event` is generated. If this is + an asynchronous :class:`ProviderSession` then this :class:`Event` may + be processed by the registered :class:`Event` before + :meth:`registerService()` has returned. """ if options is None: options = ServiceRegistrationOptions() @@ -468,21 +564,36 @@ def registerServiceAsync(self, uri, identity=None, correlationId=None, options=None): """Begin the process of registering the service immediately. + Args: + uri (str): Name of the service + identity (Identity): Identity used to verify permissions to provide + the service being registered + correlationId (CorrelationId): Correlation id to associate with + this operation + options (ServiceRegistrationOptions): Options used to register the + service + + Returns: + CorrelationId: Correlation id associated with events generated by + this operation + Begin the process of registering the service identified by the - specified 'uri' and return immediately. The optionally specified - 'identity' is used to verify permissions to provide the service being - registered. The optionally specified 'correlationId' is used to track - Events generated as a result of this call. The actual correlationId - that will identify Events generated as a result of this call is - returned. The optionally specified 'options' is used to specify the + specified ``uri`` and return immediately. The optionally specified + ``identity`` is used to verify permissions to provide the service being + registered. The optionally specified ``correlationId`` is used to track + :class:`Event`\ s generated as a result of this call. The actual ``correlationId`` + that will identify :class:`Event`\ s generated as a result of this call is + returned. The optionally specified ``options`` is used to specify the group ID and service priority of the service being registered. - The 'uri' must begin with a full qualified service name. That is it - must begin with "///[/]". Any portion of the + The ``uri`` must begin with a full qualified service name. That is it + must begin with ``///[/]``. Any portion of the + ``uri`` after the service name is ignored. - The application must monitor events for a SERVICE_STATUS Event which - will be generated once the service has been successfully registered or - registration has failed. + The application must monitor events for a + :class:`~Event.SERVICE_STATUS` :class:`Event` which will be generated + once the service has been successfully registered or registration has + failed. """ if correlationId is None: correlationId = CorrelationId() @@ -502,25 +613,34 @@ def registerServiceAsync(self, uri, identity=None, correlationId=None, def resolve(self, resolutionList, resolveMode=DONT_REGISTER_SERVICES, identity=None): - """Resolve the topics in the specified 'resolutionList'. - - Resolve the topics in the specified 'resolutionList', which must be an - object of type 'ResolutionList', and update the 'resolutionList' with - the results of the resolution process. If the specified 'resolveMode' - is DONT_REGISTER_SERVICES (the default) then all the services - referenced in the topics in the 'resolutionList' must already have been - registered using registerService(). If 'resolveMode' is - AUTO_REGISTER_SERVICES then the specified 'identity' should be supplied - and ProviderSession will automatically attempt to register any services - reference in the topics in the 'resolutionList' that have not already - been registered. Once resolve() returns each entry in the - 'resolutionList' will have been updated with a new status. - - Before resolve() returns one or more RESOLUTION_STATUS events and, if - 'resolveMode' is AUTO_REGISTER_SERVICES, zero or more SERVICE_STATUS - events are generated. If this is an asynchronous ProviderSession then - these Events may be processed by the registered EventHandler before - resolve() has returned. + """Resolve the topics in the specified ``resolutionList``. + + Args: + resolutionList (ResolutionList): List of topics to resolve + resolveMode (int): Mode to resolve in + identity (Identity): Identity used for authorization + + Resolve the topics in the specified ``resolutionList``, which must be + an object of type :class:`ResolutionList`, and update the + ``resolutionList`` with the results of the resolution process. If the + specified ``resolveMode`` is :attr:`DONT_REGISTER_SERVICES` (the + default) then all the services referenced in the topics in the + ``resolutionList`` must already have been registered using + :meth:`registerService()`. If ``resolveMode`` is + :attr:`AUTO_REGISTER_SERVICES` then the specified ``identity`` should + be supplied and :class:`ProviderSession` will automatically attempt to + register any services reference in the topics in the ``resolutionList`` + that have not already been registered. Once :meth:`resolve()` returns + each entry in the ``resolutionList`` will have been updated with a new + status. + + Before :meth:`resolve()` returns one or more + :attr:`~Event.RESOLUTION_STATUS` events and, if ``resolveMode`` is + :attr:`AUTO_REGISTER_SERVICES`, zero or more + :attr:`~Event.SERVICE_STATUS` events are generated. If this is an + asynchronous :class:`ProviderSession` then these :class:`Event`\ s may + be processed by the registered ``eventHandler`` before + :meth:`resolve()` has returned. """ resolutionList._addSession(self) _ExceptionUtil.raiseOnError( @@ -534,21 +654,28 @@ def resolveAsync(self, resolutionList, resolveMode=DONT_REGISTER_SERVICES, identity=None): """Begin the resolution of the topics in the specified list. - Begin the resolution of the topics in the specified 'resolutionList', - which must be an object of type 'ResolutionList'. If the specified - 'resolveMode' is DONT_REGISTER_SERVICES (the default) then all the - services referenced in the topics in the 'resolutionList' must already - have been registered using registerService(). If 'resolveMode' is - AUTO_REGISTER_SERVICES then the specified 'identity' should be supplied - and ProviderSession will automatically attempt to register any services - reference in the topics in the 'resolutionList' that have not already - been registered. - - One or more RESOLUTION_STATUS events will be delivered with the results - of the resolution. These events may be generated before or after - resolveAsync() returns. If AUTO_REGISTER_SERVICES is specified - SERVICE_STATUS events may also be generated before or after - resolveAsync() returns. + Args: + resolutionList (ResolutionList): List of topics to resolve + resolveMode (int): Mode to resolve in + identity (Identity): Identity used for authorization + + Begin the resolution of the topics in the specified ``resolutionList``, + which must be an object of type :class:`ResolutionList`. If the + specified ``resolveMode`` is :attr:`DONT_REGISTER_SERVICES` (the + default) then all the services referenced in the topics in the + ``resolutionList`` must already have been registered using + :meth:`registerService()`. If ``resolveMode`` is + :attr:`AUTO_REGISTER_SERVICES` then the specified ``identity`` should + be supplied and :class:`ProviderSession` will automatically attempt to + register any services reference in the topics in the ``resolutionList`` + that have not already been registered. + + One or more :attr:`~Event.RESOLUTION_STATUS` events will be delivered + with the results of the resolution. These events may be generated + before or after :meth:`resolveAsync()` returns. If + :attr:`AUTO_REGISTER_SERVICES` is specified :attr:`~Event.SERVICE_STATUS` + events may also be generated before or after :meth:`resolveAsync()` + returns. """ resolutionList._addSession(self) _ExceptionUtil.raiseOnError( @@ -559,14 +686,19 @@ def resolveAsync(self, resolutionList, resolveMode=DONT_REGISTER_SERVICES, get_handle(identity))) def getTopic(self, message): - """Find a previously created Topic object based on the 'message'. + """Find a previously created :class:`Topic` based on the ``message``. + + Args: + message (Message): Message to get the topic from - Find a previously created Topic object based on the specified - 'message'. The 'message' must be one of the following - types: TopicCreated, TopicActivated, TopicDeactivated, - TopicSubscribed, TopicUnsubscribed, TopicRecap. - If the 'message' is not valid then invoking isValid() on the - returned Topic will return False. + Returns: + Topic: The topic the message was published on + + The ``message`` must be one of the following types: ``TopicCreated``, + ``TopicActivated``, ``TopicDeactivated``, ``TopicSubscribed``, + ``TopicUnsubscribed``, ``TopicRecap``. If the ``message`` is not valid + then invoking :meth:`~Topic.isValid()` on the returned :class:`Topic` + will return ``False``. """ errorCode, topic = internals.blpapi_ProviderSession_getTopic( self.__handle, @@ -575,11 +707,17 @@ def getTopic(self, message): return Topic(topic, sessions=(self,)) def createServiceStatusTopic(self, service): - """Create a Service Status Topic. + """Create a :class:`Service` Status :class:`Topic` which is to be used + to provide service status. + + Args: + service (Service): Service for which to create the topic - Create a Service Status Topic which is to be used to provide - service status. On success invoking isValid() on the returned Topic - will return False. + Returns: + Topic: A service status topic + + On success invoking :meth:`~Topic.isValid()` on the returned + :class:`Topic` will return ``False``. """ errorCode, topic = \ internals.blpapi_ProviderSession_createServiceStatusTopic( @@ -589,14 +727,23 @@ def createServiceStatusTopic(self, service): return Topic(topic) def publish(self, event): - """Publish the specified 'event'.""" + """Publish the specified ``event``. + + Args: + event (Event): Event to publish + """ _ExceptionUtil.raiseOnError( internals.blpapi_ProviderSession_publish( self.__handle, get_handle(event))) def sendResponse(self, event, isPartialResponse=False): - """Send the response event for previously received request.""" + """Send the response event for previously received request. + + Args: + event (Event): Response event to send + isPartialResponse (bool): Whether the response is partial or not + """ _ExceptionUtil.raiseOnError( internals.blpapi_ProviderSession_sendResponse( self.__handle, @@ -606,19 +753,26 @@ def sendResponse(self, event, isPartialResponse=False): def createTopics(self, topicList, resolveMode=DONT_REGISTER_SERVICES, identity=None): - """Create the topics in the specified 'topicList'. + """Create the topics in the specified ``topicList``. - Create the topics in the specified 'topicList', which must be an object - of type 'TopicList', and update 'topicList' with the results of the - creation process. If service needs to be registered, 'identity' should - be supplied. Once a call to this function returns, each entry in the - 'topicList' will have been updated with a new topic creation status. + Args: + topicList (TopicList): List of topics to create + resolveMode (int): Mode to use for topic resolution + identity (Identity): Identity to use for authorization - Before createTopics() returns one or more RESOLUTION_STATUS events, - zero or more SERVICE_STATUS events and one or more TOPIC_STATUS events - are generated. If this is an asynchronous ProviderSession then these - Events may be processed by the registered EventHandler before - createTopics() has returned. + Create the topics in the specified ``topicList``, which must be an object + of type :class:`TopicList`, and update ``topicList`` with the results of the + creation process. If service needs to be registered, ``identity`` should + be supplied. Once a call to this function returns, each entry in the + ``topicList`` will have been updated with a new topic creation status. + + Before :meth:`createTopics()` returns one or more + :attr:`~Event.RESOLUTION_STATUS` events, zero or more + :attr:`~Event.SERVICE_STATUS` events and one or more + :attr:`~Event.TOPIC_STATUS` events are generated. If this is an + asynchronous :class:`ProviderSession` then these :class:`Event`\ s may + be processed by the registered ``eventHandler`` before + :meth:`createTopics()` has returned. """ topicList._addSession(self) _ExceptionUtil.raiseOnError( @@ -631,17 +785,26 @@ def createTopics(self, topicList, def createTopicsAsync(self, topicList, resolveMode=DONT_REGISTER_SERVICES, identity=None): - """Create the topics in the specified 'topicList'. + """Create the topics in the specified ``topicList``. - Create the topics in the specified 'topicList', which must be an object - of type 'TopicList', and update the 'topicList' with the results of the - creation process. If service needs to be registered, 'providerIdentity' - should be supplied. + Args: + topicList (TopicList): List of topics to create + resolveMode (int): Mode to use for topic resolution + identity (Identity): Identity to use for authorization - One or more RESOLUTION_STATUS events, zero or more SERVICE_STATUS - events and one or more TOPIC_STATUS events are generated. If this is - an asynchronous ProviderSession then these Events may be processed by - the registered EventHandler before createTopics() has returned. + Create the topics in the specified ``topicList``, which must be an object + of type :class:`TopicList`, and update ``topicList`` with the results of the + creation process. If service needs to be registered, ``identity`` should + be supplied. Once a call to this function returns, each entry in the + ``topicList`` will have been updated with a new topic creation status. + + Before :meth:`createTopics()` returns one or more + :attr:`~Event.RESOLUTION_STATUS` events, zero or more + :attr:`~Event.SERVICE_STATUS` events and one or more + :attr:`~Event.TOPIC_STATUS` events are generated. If this is an + asynchronous :class:`ProviderSession` then these :class:`Event`\ s may + be processed by the registered ``eventHandler`` before + :meth:`createTopics()` has returned. """ topicList._addSession(self) _ExceptionUtil.raiseOnError( @@ -652,54 +815,89 @@ def createTopicsAsync(self, topicList, get_handle(identity))) def activateSubServiceCodeRange(self, serviceName, begin, end, priority): - """Register to receive, with the specified 'priority', subscriptions - for the specified 'service' that the resolver has mapped to a service - code between the specified 'begin' and the specified 'end' values, - inclusive. Numerically greater values of 'priority' indicate higher - priorities. The behavior of this function is undefined unless 'service' - has already been successfully registered, '0 <= begin <= end < (1 << - 24)', and 'priority' is non-negative. + """ + Args: + serviceName (str): Name of the service + begin (int): Start of sub-service code range + end (int): End of sub-service code range + priority (int): Priority with which to receive subscriptions + + Register to receive, with the specified ``priority``, subscriptions for + the specified ``service`` that the resolver has mapped to a service + code between the specified ``begin`` and the specified ``end`` values, + inclusive. Numerically greater values of ``priority`` indicate higher + priorities. + + Note: + The behavior of this function is undefined unless ``service`` has + already been successfully registered, ``0 <= begin <= end < (1 << + 24)``, and ``priority`` is non-negative. """ err = internals.blpapi_ProviderSession_activateSubServiceCodeRange( self.__handle, serviceName, begin, end, priority) _ExceptionUtil.raiseOnError(err) def deactivateSubServiceCodeRange(self, serviceName, begin, end): - """De-register to receive subscriptions for the specified 'service' + """ + Args: + serviceName (str): Name of the service + begin (int): Start of sub-service code range + end (int): End of sub-service code range + + De-register to receive subscriptions for the specified ``service`` that the resolver has mapped to a service code between the specified - 'begin' and the specified 'end' values, inclusive. The behavior of this - function is undefined unless 'service' has already been successfully - registered and '0 <= begin <= end < (1 << 24)'.""" + ``begin`` and the specified ``end`` values, inclusive. + + Note: + The behavior of this function is undefined unless ``service`` has + already been successfully registered and ``0 <= begin <= end < (1 << + 24)``. + """ err = internals.blpapi_ProviderSession_deactivateSubServiceCodeRange( self.__handle, serviceName, begin, end) _ExceptionUtil.raiseOnError(err) def deregisterService(self, serviceName): - """Deregister the service, including all registered parts, identified - by the specified 'serviceName'. The identity in the service - registration is reused to verify permissions for deregistration. If the - service is not registered nor in pending registration, return false; - return true otherwise. If the service is in pending registration, - cancel the pending registration. If the service is registered, send a - deregistration request; generate TOPIC_STATUS events containing a - TopicUnsubscribed message for each subscribed topic, a TopicDeactivated - message for each active topic and a TopicDeleted for each created - topic; generate REQUEST_STATUS events containing a RequestFailure - message for each pending incoming request; and generate a - SERVICE_STATUS Event containing a ServiceDeregistered message. All - published events on topics created on this service will be ignored - after this method returns.""" + """De-register the service, including all registered parts. + + Args: + serviceName (str): Service to de-register + + Returns: + bool: ``False`` if the service is not registered nor in pending + registration, ``True`` otherwise. + + The identity in the service registration is reused to verify + permissions for deregistration. If the service is in pending + registration, cancel the pending registration. If the service is + registered, send a deregistration request; generate + :class:`~Event.TOPIC_STATUS` events containing a ``TopicUnsubscribed`` + message for each subscribed topic, a ``TopicDeactivated`` message for + each active topic and a ``TopicDeleted`` for each created topic; + generate ``~Event.REQUEST_STATUS`` events containing a + ``RequestFailure`` message for each pending incoming request; and + generate a :class:`~Event.SERVICE_STATUS` event containing a + ``ServiceDeregistered`` message. All published events on topics created + on this service will be ignored after this method returns. + """ res = internals.blpapi_ProviderSession_deregisterService( self.__handle, serviceName) return res == 0 def terminateSubscriptionsOnTopic(self, topic, message=None): - """Delete the specified 'topic' (See deleteTopic(topic) for - additional details). Furthermore, proactively terminate all current - subscriptions on 'topic'. The optionally specified 'message' can be - used to convey additional information to subscribers regarding the - termination. This message is contained in the 'description' of - 'reason' in a 'SubscriptionTerminated' message. + """Delete the specified ``topic`` (See :meth:`deleteTopic()` for + additional details). + + Args: + topic (Topic): Topic to delete + message (Message): Message to convey additional information to + subscribers regarding the termination + + Furthermore, proactively terminate all current subscriptions on + ``topic``. The optionally specified ``message`` can be used to convey + additional information to subscribers regarding the termination. This + message is contained in the ``description`` of ``reason`` in a + ``SubscriptionTerminated`` message. """ if not topic: return @@ -708,10 +906,14 @@ def terminateSubscriptionsOnTopic(self, topic, message=None): self.__handle, get_handle(topic), message)) def terminateSubscriptionsOnTopics(self, topics, message=None): - """Terminate subscriptions on the first 'numTopics' topics in the - specified 'topics'. + """Terminate subscriptions on the specified ``topics``. - See terminateSubscriptionsOnTopic(topic,message) for additional details. + Args: + topics ([Topic]): Topics to delete + message (Message): Message to convey additional information to + subscribers regarding the termination + + See :meth:`terminateSubscriptionsOnTopic()` for additional details. """ if not topics: return @@ -732,22 +934,32 @@ def terminateSubscriptionsOnTopics(self, topics, message=None): internals.delete_topicPtrArray(topicsCArray) def deleteTopic(self, topic): - """Remove one reference from the specified 'topic'. If this function - has been called the same number of times that 'topic' was created - by 'createTopics', then 'topic' is deleted: a 'TopicDeleted' - message is delivered, preceded by 'TopicUnsubscribed' and - 'TopicDeactivated' if 'topic' was subscribed. (See "Topic - Life Cycle", above, for additional details.) The behavior of this - function is undefined if 'topic' has already been deleted the same - number of times that it has been created. Further, the behavior is - undefined if a provider attempts to publish a message on a deleted - topic.""" + """Remove one reference from the specified 'topic'. + + Args: + topic (Topic): Topic to remove the reference from + + If this function has been called the same number of times that + ``topic`` was created by ``createTopics``, then ``topic`` is deleted: a + ``TopicDeleted`` message is delivered, preceded by + ``TopicUnsubscribed`` and ``TopicDeactivated`` if ``topic`` was + subscribed. + + Note: + The behavior of this function is undefined if ``topic`` has already + been deleted the same number of times that it has been created. + Further, the behavior is undefined if a provider attempts to + publish a message on a deleted topic. + """ self.deleteTopics((topic,)) def deleteTopics(self, topics): - """Delete each topic in the specified 'topics' container. + """Delete each topic in the specified ``topics`` container. + + Args: + deleteTopics([Topic]): Topics to delete - See 'deleteTopic(topic)' above for additional details.""" + See :meth:`deleteTopic()` above for additional details.""" if not topics: return topicsCArraySize = len(topics) diff --git a/blpapi/request.py b/blpapi/request.py index 88c7b9e..d6e4880 100644 --- a/blpapi/request.py +++ b/blpapi/request.py @@ -16,17 +16,19 @@ class Request(object): """A single request to a single service. - Request objects are created using Service.createRequest() or - Service.createAuthorizationRequest(). They are used with - Session.sendRequest() or Session.sendAuthorizationRequest(). - - The Request object contains the parameters for a single request to a single - service. Once a Request has been created its fields can be populated - directly using the functions provided by Element or using the Element - interface on the Element returned by asElement(). - - The schema for the Request can be queried using the Element interface. - + :class:`Request` objects are created using :meth:`Service.createRequest()` + or :meth:`Service.createAuthorizationRequest()`. They are used with + :meth:`Session.sendRequest()` or + :meth:`Session.sendAuthorizationRequest()`. + + The :class:`Request` object contains the parameters for a single request to + a single service. Once a :class:`Request` has been created its fields can + be populated directly using the functions provided by :class:`Element` or + using the :class:`Element` interface on the :class:`Element` returned by + :meth:`asElement()`. + + The schema for the :class:`Request` can be queried using the + :class:`Element` interface. """ def __init__(self, handle, sessions): @@ -41,6 +43,7 @@ def __del__(self): pass def destroy(self): + """Destructor.""" if self.__handle: internals.blpapi_Request_destroy(self.__handle) self.__handle = None @@ -56,15 +59,21 @@ def __str__(self): return self.toString() def set(self, name, value): - """Equivalent to asElement().setElement(name, value).""" + """Equivalent to :meth:`asElement().setElement(name, value) + `.""" self.asElement().setElement(name, value) def append(self, name, value): - """Equivalent to getElement(name).appendValue(value).""" + """Equivalent to :meth:`getElement(name).appendValue(value) + `.""" return self.getElement(name).appendValue(value) def asElement(self): - """Return the content of this Request as an Element.""" + """ + Returns: + Element: The content of this :class:`Request` as an + :class:`Element`. + """ el = None if self.__element: el = self.__element() @@ -75,11 +84,13 @@ def asElement(self): return el def getElement(self, name): - """Equivalent to asElement().getElement(name).""" + """Equivalent to :meth:`asElement().getElement(name) + `.""" return self.asElement().getElement(name) def toString(self, level=0, spacesPerLevel=4): - """Format this Element to the string.""" + """Equivalent to :meth:`asElement().toString(level, spacesPerLevel) + `.""" return self.asElement().toString(level, spacesPerLevel) def _handle(self): diff --git a/blpapi/resolutionlist.py b/blpapi/resolutionlist.py index 94544e6..133f86a 100644 --- a/blpapi/resolutionlist.py +++ b/blpapi/resolutionlist.py @@ -21,9 +21,13 @@ class ResolutionList(object): """Contains a list of topics that require resolution. - Created from topic strings or from SUBSCRIPTION_STARTED messages. This is - passed to a 'resolve()' call or 'resolveAsync()' call on a - 'ProviderSession'. It is updated and returned by the 'resolve()' call. + Created from topic strings or from ``SUBSCRIPTION_STARTED`` messages. This + is passed to a :meth:`~ProviderSession.resolve()` call or + :meth:`ProviderSession.resolveAsync()` call on a :class:`ProviderSession`. + It is updated and returned by the :meth:`~ProviderSession.resolve()` call. + + The class attributes represent the states in which entries of a + :class:`ResolutionList` can be. """ UNRESOLVED = internals.RESOLUTIONLIST_UNRESOLVED @@ -40,15 +44,23 @@ class ResolutionList(object): @staticmethod def extractAttributeFromResolutionSuccess(message, attribute): - """Return the value of the value in the specified 'message'. - - Return the value of the value in the specified 'message' which - represents the specified 'attribute'. The 'message' must be a message - of type "RESOLUTION_SUCCESS". The 'attribute' should be an attribute - that was requested using 'addAttribute()' on the ResolutionList passed - to the 'resolve()' or 'resolveAsync()' that caused - this RESOLUTION_SUCCESS message. - If the 'attribute' is not present an empty Element is returned. + """Return the value of the value in the specified ``message``. + + Args: + message (Message): Message to extract the attribute from + attribute (Name): Attribute to extract + + Returns: + Element: Value of the value in the specified ``message`` which + represents the specified ``attribute``. If the ``attribute`` is not + present an empty :class:`Element` is returned. + + The ``message`` must be a message of type ``RESOLUTION_SUCCESS``. The + ``attribute`` should be an attribute that was requested using + :meth:`addAttribute()` on the :class:`ResolutionList` passed to the + :meth:`~ProviderSession.resolve()` or + :meth:`~ProviderSession.resolveAsync()` that caused this + ``RESOLUTION_SUCCESS`` message. """ i = internals # to fit next line in 79 chars res = i.blpapi_ResolutionList_extractAttributeFromResolutionSuccess( @@ -56,15 +68,12 @@ def extractAttributeFromResolutionSuccess(message, attribute): return Element(res, message) def __init__(self): - """Create an empty ResolutionList. - - Create an empty ResolutionList. - """ + """Create an empty :class:`ResolutionList`.""" self.__handle = internals.blpapi_ResolutionList_create(None) self.__sessions = set() def __del__(self): - """Destroy this ResolutionList.""" + """Destroy this :class:`ResolutionList`.""" try: self.destroy() except (NameError, AttributeError): @@ -79,16 +88,27 @@ def destroy(self): def add(self, topicOrMessage, correlationId=None): """Add the specified topic or topic from message to this list. - If 'topicOrMessage' is of string type, add the specified - 'topicOrMessage' to this list, optionally specifying a 'correlationId'. - Return 0 on success or negative number on failure. After a successful - call to add() the status for this entry is UNRESOLVED_TOPIC. + Args: + topicOrMessage (str or Message): Topic or message to add + correlationId (CorrelationId): CorrelationId to associate with this + operation + + Returns: + int: ``0`` on success, negative number on failure + + Raises: + TypeError: If ``correlationId`` is not an instance of + :class:`CorrelationId` - If 'topicOrMessage' is of Message type, add the topic contained in the - specified 'topicOrMessage' to this list, optionally specifying a - 'correlationId'. Return 0 on success or a negative number on failure. - After a successful call to add() the status for this entry is - UNRESOLVED_TOPIC. + If ``topicOrMessage`` is of string type, add the specified + ``topicOrMessage`` to this list, optionally specifying a + ``correlationId``. After a successful call to :meth:`add()` the status + for this entry is ``UNRESOLVED_TOPIC``. + + If ``topicOrMessage`` is of :class:`Message` type, add the topic + contained in the specified ``topicOrMessage`` to this list, optionally + specifying a ``correlationId``. After a successful call to + :meth:`add()` the status for this entry is ``UNRESOLVED_TOPIC``. """ if correlationId is None: correlationId = CorrelationId() @@ -106,21 +126,28 @@ def add(self, topicOrMessage, correlationId=None): get_handle(correlationId)) def addAttribute(self, attribute): - """Add the specified 'attribute' to the list of attributes. + """Add the specified ``attribute`` to the list of attributes. + + Args: + attribute (str): Attribute to add - Add the specified 'attribute' to the list of attributes requested - during resolution for each topic in this ResolutionList. Return 0 on - success or a negative number on failure. + Returns: + int: ``0`` on success, negative number on failure. """ attribute = Name(attribute) return internals.blpapi_ResolutionList_addAttribute( self.__handle, get_handle(attribute)) def correlationIdAt(self, index): - """Return the CorrelationId at the specified 'index'. + """ + Args: + index (int): Index of the correlation id + + Returns: + CorrelationId: CorrelationId at the specified ``index``. - Return the CorrelationId of the specified 'index'th entry - in this ResolutionList. An exception is raised if 'index'>=size(). + Raises: + IndexOutOfRangeException: If ``index >= size()``. """ errorCode, cid = internals.blpapi_ResolutionList_correlationIdAt( self.__handle, @@ -129,11 +156,18 @@ def correlationIdAt(self, index): return cid def topicString(self, correlationId): - """Return the topic of the entry identified by 'correlationId'. + """Return the topic of the entry identified by ``correlationId``. - Return the topic of the entry identified by 'correlationId'. If the - 'correlationId' does not identify an entry in this ResolutionList then - an exception is raised. + Args: + correlationId (CorrelationId): Correlation id that identifies the + topic + + Returns: + str: Topic string of the entry identified by ``correlationId``. + + Raises: + Exception: If ``correlationId`` does not identify an entry in this + :class:`ResolutionList`. """ errorCode, topic = internals.blpapi_ResolutionList_topicString( self.__handle, @@ -142,10 +176,15 @@ def topicString(self, correlationId): return topic def topicStringAt(self, index): - """Return the full topic string at the specified 'index'. + """ + Args: + index (int): Index of the topic string + + Returns: + str: Topic string at the specified ``index``. - Return the full topic string of the specified 'index'th entry in this - ResolutionList. An exception is raised if 'index'>=size(). + Raises: + IndexOutOfRangeException: If ``index >= size()``. """ errorCode, topic = internals.blpapi_ResolutionList_topicStringAt( self.__handle, @@ -154,16 +193,20 @@ def topicStringAt(self, index): return topic def status(self, correlationId): - """Return the status of the entry in this ResolutionList. - - Return the status of the entry in this ResolutionList identified by the - specified 'correlationId'. This may be UNRESOLVED, RESOLVED, - RESOLUTION_FAILURE_BAD_SERVICE, - RESOLUTION_FAILURE_SERVICE_AUTHORIZATION_FAILED, - RESOLUTION_FAILURE_BAD_TOPIC, - RESOLUTION_FAILURE_TOPIC_AUTHORIZATION_FAILED. If the 'correlationId' - does not identify an entry in this ResolutionList then an exception is - raised. + """ + Args: + correlationId (CorrelationId): Correlation id that identifies the + entry + + Returns: + int: status of the entry in this :class:`ResolutionList`. + + Raises: + Exception: If the ``correlationId`` does not identify an entry in + this :class:`ResolutionList`. + + The possible statuses are represented by the class attributes of + :class:`ResolutionList`. """ errorCode, status = internals.blpapi_ResolutionList_status( self.__handle, @@ -172,15 +215,19 @@ def status(self, correlationId): return status def statusAt(self, index): - """Return the status of the specified 'index'th entry in this list. - - Return the status of the specified 'index'th entry in this - ResolutionList. This may be UNRESOLVED, RESOLVED, - RESOLUTION_FAILURE_BAD_SERVICE, - RESOLUTION_FAILURE_SERVICE_AUTHORIZATION_FAILED, - RESOLUTION_FAILURE_BAD_TOPIC, - RESOLUTION_FAILURE_TOPIC_AUTHORIZATION_FAILED. If 'index' > size() an - exception is raised. + """ + Args: + correlationId (CorrelationId): Correlation id that identifies the + entry + + Returns: + int: status of the entry in this :class:`ResolutionList`. + + Raises: + IndexOutOfRangeException: If ``index >= size()``. + + The possible statuses are represented by the class attributes of + :class:`ResolutionList`. """ errorCode, status = internals.blpapi_ResolutionList_statusAt( self.__handle, @@ -189,14 +236,22 @@ def statusAt(self, index): return status def attribute(self, attribute, correlationId): - """Return the value for the specified 'attribute' of this list entry. - - Return the value for the specified 'attribute' of the entry in this - ResolutionList identified by the specified 'correlationId'. The Element - returned may be empty if the resolution service cannot provide the - attribute. If 'correlationId' does not identify an entry in this - ResolutionList or if the status of the entry identified by - 'correlationId' is not RESOLVED an exception is raised. + """ + Args: + attribute (str): Attribute of the entry + correlationId (CorrelationId): Correlation id identifying an entry + in this list + + Returns: + Element: Value for the specified ``attribute`` of this list entry. + + Raises: + Exception: If ``correlationId`` does not identify an entry in this + :class:`ResolutionList` or if the status of the entry + identified by ``correlationId`` is not ``RESOLVED``. + + The :class:`Element` returned may be empty if the resolution service + cannot provide the attribute. """ attribute = Name(attribute) errorCode, element = internals.blpapi_ResolutionList_attribute( @@ -209,13 +264,18 @@ def attribute(self, attribute, correlationId): return Element(element, self) def attributeAt(self, attribute, index): - """Return the value for the specified 'attribute' of 'index'th entry. + """ + Args: + attribute (str): Attribute of the entry + index (int): Index of the entry - Return the value for the specified 'attribute' of the specified - 'index'th entry in this ResolutionList. The Element returned may be - empty if the resolution service cannot provide the attribute. If - 'index' >= size() or if the status of the 'index'th entry is not - RESOLVED an exception is raised. + Returns: + Element: Value for the specified ``attribute`` of this list entry. + + Raises: + Exception: If ``index >= size()`` or if the status of the + ``index``\ th entry identified by ``correlationId`` is not + ``RESOLVED``. """ attribute = Name(attribute) errorCode, element = internals.blpapi_ResolutionList_attributeAt( @@ -228,15 +288,24 @@ def attributeAt(self, attribute, index): return Element(element, self) def message(self, correlationId): - """Return the message identified by 'correlationId'. - - Return the value of the message received during resolution of the topic - identified by the specified 'correlationId'. If 'correlationId' does - not identify an entry in this ResolutionList or if the status of the - entry identify by 'correlationId' is not RESOLVED an exception is - raised. - - The message returned can be used when creating an instance of Topic. + """ + Args: + correlationId (CorrelationId): Correlation id that identifies an + entry in this list + + Returns: + Message: Message received during resolution of the topic + identified by the specified ``correlationId``. + + Raises: + Exception: If ``correlationId`` does not identify an entry in this + :class:`ResolutionList` or if the status of the entry identify + by ``correlationId`` is not ``RESOLVED`` an exception is + raised. + + Note: + The :class:`Message` returned can be used when creating an instance + of :class:`Topic`. """ errorCode, message = internals.blpapi_ResolutionList_message( self.__handle, @@ -245,14 +314,21 @@ def message(self, correlationId): return Message(message, sessions=self.__sessions) def messageAt(self, index): - """Return the message received during resolution of entry at 'index'. + """ + Args: + index (int): Index of an entry in this list + + Returns: + Message: Message received during resolution of the topic + specified ``index``\ th entry in this :class:`ResolutionList`. - Return the value of the message received during resolution of the - specified 'index'th entry in this ResolutionList. If 'index >= size()' - or if the status of the 'index'th entry is not RESOLVED an exception is - raised. + Raises: + Exception: If ``index >= size()`` or if the status of the + ``index``\ th entry is not ``RESOLVED`` an exception is raised. - The message returned can be used when creating an instance of Topic. + Note: + The :class:`Message` returned can be used when creating an instance + of :class:`Topic`. """ errorCode, message = internals.blpapi_ResolutionList_messageAt( self.__handle, @@ -261,7 +337,10 @@ def messageAt(self, index): return Message(message, sessions=self.__sessions) def size(self): - """Return the number of entries in this ResolutionList.""" + """ + Returns: + int: Number of entries in this :class:`ResolutionList`. + """ return internals.blpapi_ResolutionList_size(self.__handle) def _handle(self): diff --git a/blpapi/schema.py b/blpapi/schema.py index 5e5eadb..f40e5af 100644 --- a/blpapi/schema.py +++ b/blpapi/schema.py @@ -30,26 +30,18 @@ @with_metaclass(utils.MetaClassForClassesWithEnums) class SchemaStatus(object): """The possible deprecation statuses of a schema element or type. - - Class attributes: - - ACTIVE: - This item is current and may appear in Messages - DEPRECATED: - This item is current and may appear in Messages - but will be removed in due course - INACTIVE: - This item is not current and will not appear in Messages - PENDING_DEPRECATION: - This item is expected to be deprecated in the - future; clients are advised to migrate away from use of - this item. """ ACTIVE = internals.STATUS_ACTIVE + """This item is current and may appear in Messages""" DEPRECATED = internals.STATUS_DEPRECATED + """This item is current and may appear in Messages but will be removed in + due course""" INACTIVE = internals.STATUS_INACTIVE + """This item is not current and will not appear in Messages""" PENDING_DEPRECATION = internals.STATUS_PENDING_DEPRECATION + """This item is expected to be deprecated in the future; clients are + advised to migrate away from use of this item.""" @with_metaclass(utils.MetaClassForClassesWithEnums) @@ -62,35 +54,31 @@ class SchemaElementDefinition(object): addition, this class offers access to metadata providing a description and deprecation status for the field. - 'SchemaElementDefinition' objects are returned by 'Service' and 'Operation' - objects to define the content of requests, replies and events. The - 'SchemaTypeDefinition' returned by - 'SchemaElementDefinition.typeDefinition()' may itself provide access to - 'SchemaElementDefinition' objects when the schema contains nested elements. - (See the 'SchemaTypeDefinition' documentation for more information on - complex types.) + :class:`SchemaElementDefinition` objects are returned by :class:`Service` + and :class:`Operation` objects to define the content of requests, replies + and events. The :class:`SchemaTypeDefinition` returned by + :meth:`typeDefinition()` may itself provide access to + :class:`SchemaElementDefinition` objects when the schema contains nested + elements. (See the :class:`SchemaTypeDefinition` documentation for more + information on complex types.) - An optional element has 'minValues() == 0'. + An optional element has ``minValues() == 0``. - A mandatory element has 'minValues() >= 1'. + A mandatory element has ``minValues() >= 1``. An element that must constain a single value has - 'minValues() == maxValues() == 1'. + ``minValues() == maxValues() == 1``. - An element containing an array has 'maxValues() > 1'. + An element containing an array has ``maxValues() > 1``. An element with no upper limit on the number of values has - 'maxValues() == UNBOUNDED'. - - 'SchemaElementDefinition' objects are read-only. + ``maxValues() == UNBOUNDED``. - Application clients need never create 'SchemaElementDefinition' objects - directly; applications will typically work with objects returned by other - 'blpapi' components. + :class:`SchemaElementDefinition` objects are read-only. - Class attributes: - - UNBOUNDED - Indicates an array has an unbounded number of values. + Application clients need never create :class:`SchemaElementDefinition` + objects directly; applications will typically work with objects returned by + other blpapi components. """ UNBOUNDED = internals.ELEMENTDEFINITION_UNBOUNDED @@ -111,64 +99,71 @@ def __str__(self): return self.toString() def name(self): - """Return the name of this element. - - Return the name identifying this element within its containing - structure/type. - + """ + Returns: + Name: The name identifying this element within its containing + structure/type. """ return Name._createInternally( internals.blpapi_SchemaElementDefinition_name(self.__handle)) def description(self): - """Return a human readable description of this element.""" + """ + Returns: + str: Human readable description of this element. + """ return internals.blpapi_SchemaElementDefinition_description( self.__handle) def status(self): - """Return the deprecation status of this element. - - The possible return values are enumerated in 'SchemaStatus' class. + """ + Returns: + int: The deprecation status of this element. + The possible return values are enumerated in :class:`SchemaStatus`. """ return internals.blpapi_SchemaElementDefinition_status(self.__handle) def typeDefinition(self): - """Return the type of values contained in this element.""" + """ + Returns: + SchemaTypeDefinition: The type of values contained in this element. + """ return SchemaTypeDefinition( internals.blpapi_SchemaElementDefinition_type(self.__handle), self.__sessions) def minValues(self): - """Return the minimum number of occurences of this element. + """ + Returns: + int: The minimum number of occurences of this element. This value is always greater than or equal to zero. - """ return internals.blpapi_SchemaElementDefinition_minValues( self.__handle) def maxValues(self): - """Return the maximum number of occurences of this element. + """ + Returns: + int: The maximum number of occurences of this element. This value is always greater than or equal to one. - Return value is equal to 'SchemaElementDefinition.UNBOUNDED' if this - item is an unbounded array. - + Return value is equal to :attr:`UNBOUNDED` if this item is an unbounded + array. """ return internals.blpapi_SchemaElementDefinition_maxValues( self.__handle) def alternateNames(self): - """Return the list of alternate names for this element. - - The result is a list of Name objects. - + """ + Returns: + [Name]: The list of alternate names for this element. """ res = [] @@ -183,16 +178,18 @@ def alternateNames(self): return res def toString(self, level=0, spacesPerLevel=4): - """Format this 'SchemaElementDefinition' to the string. + """ + Args: + level (int): Indentation level + spacesPerLevel (int): Number of spaces per indentation level for + this and all nested objects - Format this 'SchemaElementDefinition' to the string at the (absolute - value of) optionally specified indentation 'level'. If 'level' is - specified, optionally specify 'spacesPerLevel', the number of spaces - per indentation level for this and all of its nested objects. If - 'level' is negative, suppress indentation of the first line. If - 'spacesPerLevel' is negative, format the entire output on one line, - suppressing all but the initial indentation (as governed by 'level'). + Returns: + str: This object formatted as a string + If ``level`` is negative, suppress indentation of the first line. If + ``spacesPerLevel`` is negative, format the entire output on one line, + suppressing all but the initial indentation (as governed by ``level``). """ return internals.blpapi_SchemaElementDefinition_printHelper( @@ -206,7 +203,6 @@ def _sessions(self): class SchemaTypeDefinition(object): - """Representation of a "type" that can be used within a schema. This class implements a representation of a "type" that can be used within @@ -217,16 +213,15 @@ class SchemaTypeDefinition(object): offers access to metadata providing a description and deprecation status for the type. - Each 'SchemaElementDefinition' object is associated with a single - 'SchemaTypeDefinition'; one 'SchemaTypeDefinition' may be used by zero, - one, or many 'SchemaElementDefinition' objects. - - 'SchemaTypeDefinition' objects are read-only. + Each :class:`SchemaElementDefinition` object is associated with a single + :class:`SchemaTypeDefinition`; one :class:`SchemaTypeDefinition` may be + used by zero, one, or many :class:`SchemaElementDefinition` objects. - Application clients need never create fresh 'SchemaTypeDefinition' objects - directly; applications will typically work with objects returned by other - 'blpapi' components. + :class:`SchemaTypeDefinition` objects are read-only. + Application clients need never create fresh :class:`SchemaTypeDefinition` + objects directly; applications will typically work with objects returned by + other blpapi components. """ def __init__(self, handle, sessions): @@ -244,86 +239,94 @@ def __str__(self): return self.toString() def datatype(self): - """Return the data type of this 'SchemaTypeDefinition'. - - The possible return values are enumerated in 'DataType' class. + """ + Returns: + int: The data type of this :class:`SchemaTypeDefinition`. + The possible return values are enumerated in :class:`DataType`. """ return internals.blpapi_SchemaTypeDefinition_datatype(self.__handle) def name(self): - """Return the name of this 'SchemaTypeDefinition'.""" + """ + Returns: + Name: The name of this :class:`SchemaTypeDefinition`. + """ return Name._createInternally( internals.blpapi_SchemaTypeDefinition_name(self.__handle)) def description(self): - """Return a human readable description of this 'SchemaTypeDefinition'. + """ + Returns: + str: Human readable description of this + :class:`SchemaTypeDefinition`. """ return internals.blpapi_SchemaTypeDefinition_description(self.__handle) def status(self): - """Return the deprecation status of this 'SchemaTypeDefinition'. - - The possible return values are enumerated in 'SchemaStatus' class. + """ + Returns: + int: The deprecation status of this :class:`SchemaTypeDefinition`. + The possible return values are enumerated in :class:`SchemaStatus`. """ return internals.blpapi_SchemaTypeDefinition_status(self.__handle) def numElementDefinitions(self): - """Return the number of 'SchemaElementDefinition' objects. - - Return the number of 'SchemaElementDefinition' objects contained by - this 'SchemaTypeDefinition'. If this 'SchemaTypeDefinition' is neither - a choice nor a sequence this will return 0. + """ + Returns: + int: The number of :class:`SchemaElementDefinition` objects. + If this :class:`SchemaTypeDefinition` is neither a choice nor a + sequence this will return ``0``. """ return internals.blpapi_SchemaTypeDefinition_numElementDefinitions( self.__handle) def isComplexType(self): - """Return True if this is a sequence or choice type. - - Return True if this 'SchemaTypeDefinition' represents a sequence or - choice type. - + """ + Returns: + bool: ``True`` if this :class:`SchemaTypeDefinition` represents a + sequence or choice type. """ return bool(internals.blpapi_SchemaTypeDefinition_isComplexType( self.__handle)) def isSimpleType(self): - """Return True if this is neither a sequence nor a choice type. - - Return True if this 'SchemaTypeDefinition' represents neither a - sequence nor a choice type. - + """ + Returns: + bool: True if this :class:`SchemaTypeDefinition` represents neither + a sequence nor a choice type. """ return bool(internals.blpapi_SchemaTypeDefinition_isSimpleType( self.__handle)) def isEnumerationType(self): - """Return True if this is an enmeration type. - - Return True if this 'SchemaTypeDefinition' represents an enmeration - type. - + """ + Returns: + bool: ``True`` if this :class:`SchemaTypeDefinition` represents an + enumeration type, ``False`` otherwise. """ return bool(internals.blpapi_SchemaTypeDefinition_isEnumerationType( self.__handle)) def hasElementDefinition(self, name): - """True if this object contains an item with the specified 'name'. - - Return True if this 'SchemaTypeDefinition' contains an item with the - specified 'name'; otherwise return False. + """ + Args: + name (Name or str): Item identifier - Exception is raised if 'name' is neither a Name nor a string. + Returns: + bool: ``True`` if this object contains an item with the + specified ``name``, ``False`` otherwise + Raises: + Exception: If ``name`` is neither a :class:`Name` nor a string. """ name = getNamePair(name) @@ -333,15 +336,18 @@ def hasElementDefinition(self, name): name[1])) def getElementDefinition(self, nameOrIndex): - """Return the definition of a specified element. + """ + Args: + nameOrIndex (Name or str or int): Name or index of the element - Return a 'SchemaElementDefinition' object describing the element - identified by the specified 'nameOrIndex', which must be either a - string or an integer. If 'nameOrIndex' is a string and - 'hasElement(nameOrIndex) != True', then a 'NotFoundException' is - raised; if 'nameOrIndex' is an integer and 'nameOrIndex >= - numElementDefinitions()' then an 'IndexOutOfRangeException' is raised. + Returns: + SchemaElementDefinition: The definition of a specified element. + Raises: + NotFoundException: If ``nameOrIndex`` is a string and + ``hasElement(nameOrIndex) != True``. + IndexOutOfRangeException: If ``nameOrIndex`` is an integer and + ``nameOrIndex >= numElementDefinitions()`` """ if not isinstance(nameOrIndex, int): @@ -367,11 +373,10 @@ def getElementDefinition(self, nameOrIndex): return SchemaElementDefinition(res, self.__sessions) def elementDefinitions(self): - """Return an iterator over 'SchemaElementDefinitions'. - - Return an iterator over 'SchemaElementDefinitions' defined by this - 'SchemaTypeDefinition'. - + """ + Returns: + Iterator over :class:`SchemaElementDefinition`\ s defined by this + :class:`SchemaTypeDefinition`. """ return utils.Iterator(self, @@ -379,29 +384,29 @@ def elementDefinitions(self): SchemaTypeDefinition.getElementDefinition) def enumeration(self): - """Return all possible values of the enumeration defined by this type. - - Return a 'ConstantList' containing all possible values of the - enumeration defined by this type. - - Return None in case this 'SchemaTypeDefinition' is not a enumeration. - + """ + Returns: + ConstantList: All possible values of the enumeration defined by + this type. ``None`` in case this :class:`SchemaTypeDefinition` is + not a enumeration. """ res = internals.blpapi_SchemaTypeDefinition_enumeration(self.__handle) return None if res is None else ConstantList(res, self.__sessions) def toString(self, level=0, spacesPerLevel=4): - """Format this 'SchemaTypeDefinition' to the string. + """ + Args: + level (int): Indentation level + spacesPerLevel (int): Number of spaces per indentation level for + this and all nested objects - Format this 'SchemaTypeDefinition' to the string at the (absolute value - of) optionally specified indentation 'level'. If 'level' is specified, - optionally specify 'spacesPerLevel', the number of spaces per - indentation level for this and all of its nested objects. If 'level' is - negative, suppress indentation of the first line. If 'spacesPerLevel' - is negative, format the entire output on one line, suppressing all but - the initial indentation (as governed by 'level'). + Returns: + str: This object formatted as a string + If ``level`` is negative, suppress indentation of the first line. If + ``spacesPerLevel`` is negative, format the entire output on one line, + suppressing all but the initial indentation (as governed by ``level``). """ return internals.blpapi_SchemaTypeDefinition_printHelper( diff --git a/blpapi/service.py b/blpapi/service.py index ab597fd..7ba4bed 100644 --- a/blpapi/service.py +++ b/blpapi/service.py @@ -20,12 +20,11 @@ # pylint: disable=useless-object-inheritance class Operation(object): - """Defines an operation which can be performed by a Service. + """Defines an operation which can be performed by a :class:`Service`. - Operation objects are obtained from a Service object. They provide + Operation objects are obtained from a :class:`Service` object. They provide read-only access to the schema of the Operations Request and the schema of the possible response. - """ def __init__(self, handle, sessions): @@ -33,19 +32,24 @@ def __init__(self, handle, sessions): self.__sessions = sessions def name(self): - """Return the name of this Operation.""" + """ + Returns: + str: The name of this :class:`Operation`. + """ return internals.blpapi_Operation_name(self.__handle) def description(self): - """Return a human readable description of this Operation.""" + """ + Returns: + str: a human readable description of this Operation. + """ return internals.blpapi_Operation_description(self.__handle) def requestDefinition(self): - """Return a SchemaElementDefinition for this Operation. - - Return a SchemaElementDefinition which defines the schema for this - Operation. - + """ + Returns: + SchemaElementDefinition: Object which defines the schema for this + :class:`Operation`. """ errCode, definition = internals.blpapi_Operation_requestDefinition( @@ -54,23 +58,26 @@ def requestDefinition(self): SchemaElementDefinition(definition, self.__sessions) def numResponseDefinitions(self): - """Return the number of the response types for this Operation. - - Return the number of the response types that can be returned by this - Operation. + """ + Returns: + int: The number of the response types that can be returned by this + :class:`Operation`. """ return internals.blpapi_Operation_numResponseDefinitions(self.__handle) def getResponseDefinitionAt(self, position): - """Return a SchemaElementDefinition for the response to this Operation. - - Return a SchemaElementDefinition which defines the schema for the - response that this Operation delivers. + """ + Args: + position (int): Index of the response type - If 'position' >= numResponseDefinitions() an exception is raised. + Returns: + SchemaElementDefinition: Object which defines the schema for the + response that this :class:`Operation` delivers. + Raises: + Exception: If ``position >= numResponseDefinitions()``. """ errCode, definition = internals.blpapi_Operation_responseDefinition( @@ -80,13 +87,12 @@ def getResponseDefinitionAt(self, position): return SchemaElementDefinition(definition, self.__sessions) def responseDefinitions(self): - """Return an iterator over response for this Operation. - - Return an iterator over response types that can be returned by this - Operation. - - Response type is defined by SchemaElementDefinition object. + """ + Returns: + Iterator over response types that can be returned by this + :class:`Operation`. + Response type is defined by :class:`SchemaElementDefinition`. """ return utils.Iterator(self, @@ -101,18 +107,19 @@ def _sessions(self): class Service(object): """Defines a service which provides access to API data. - A Service object is obtained from a Session and contains the Operations - (each of which contains its own schema) and the schema for Events which - this Service may produce. A Service object is also used to create Request - objects used with a Session to issue requests. + A :class:`Service` object is obtained from a :class:`Session` and contains + the :class:`Operation`\ s (each of which contains its own schema) and the + schema for :class:`Event`\ s which this :class:`Service` may produce. A + :class:`Service` object is also used to create :class:`Request` objects + used with a :class:`Session` to issue requests. Provider services are created to generate API data and must be registered before use. - The Service object is a handle to the underlying data which is owned by the - Session. Once a Service has been succesfully opened in a Session it remains - accessible until the Session is terminated. - + The :class:`Service` object is a handle to the underlying data which is + owned by the :class:`Session`. Once a :class:`Service` has been succesfully + opened in a :class:`Session` it remains accessible until the + :class:`Session` is terminated. """ def __init__(self, handle, sessions): @@ -136,16 +143,19 @@ def __str__(self): return self.toString() def toString(self, level=0, spacesPerLevel=4): - """Convert this Service schema to a string. + """Convert this :class:`Service` schema to a string. + + Args: + level (int): Indentation level + spacesPerLevel (int): Number of spaces per indentation level for + this and all nested objects - Convert this Service schema to a string at (absolute value specified - for) the optionally specified indentation 'level'. If 'level' is - specified, optionally specify 'spacesPerLevel', the number of spaces - per indentation level for this and all of its nested objects. If - 'level' is negative, suppress indentation of the first line. If - 'spacesPerLevel' is negative, format the entire output on one line, - suppressing all but the initial indentation (as governed by 'level'). + Returns: + str: This object formatted as a string + If ``level`` is negative, suppress indentation of the first line. If + ``spacesPerLevel`` is negative, format the entire output on one line, + suppressing all but the initial indentation (as governed by ``level``). """ return internals.blpapi_Service_printHelper(self.__handle, @@ -153,10 +163,13 @@ def toString(self, level=0, spacesPerLevel=4): spacesPerLevel) def createPublishEvent(self): - """Create an Event suitable for publishing to this Service. - - Use an EventFormatter to add Messages to the Event and set fields. + """ + Returns: + Event: :class:`Event` suitable for publishing to this + :class:`Service` + Use an :class:`EventFormatter` to add :class:`Message`\ s to the + :class:`Event` and set fields. """ errCode, event = internals.blpapi_Service_createPublishEvent( @@ -165,10 +178,13 @@ def createPublishEvent(self): return Event(event, self.__sessions) def createAdminEvent(self): - """Create an Admin Event suitable for publishing to this Service. - - Use an EventFormatter to add Messages to the Event and set fields. + """ + Returns: + Event: An :attr:`~Event.ADMIN` :class:`Event` suitable for + publishing to this :class:`Service` + Use an :class:`EventFormatter` to add :class:`Message`\ s to the + :class:`Event` and set fields. """ errCode, event = internals.blpapi_Service_createAdminEvent( @@ -177,10 +193,18 @@ def createAdminEvent(self): return Event(event, self.__sessions) def createResponseEvent(self, correlationId): - """Create a response Event to answer the request. + """Create a :attr:`~Event.RESPONSE` :class:`Event` to answer the + request. + + Args: + correlationId (CorrelationId): Correlation id to associate with the + created event - Use an EventFormatter to add a Message to the Event and set fields. + Returns: + Event: The created response event. + Use an :class:`EventFormatter` to add :class:`Message`\ s to the + :class:`Event` and set fields. """ errCode, event = internals.blpapi_Service_createResponseEvent( @@ -190,19 +214,24 @@ def createResponseEvent(self, correlationId): return Event(event, self.__sessions) def name(self): - """Return the name of this service.""" + """ + Returns: + str: Name of this service. + """ return internals.blpapi_Service_name(self.__handle) def description(self): - """Return a human-readable description of this service.""" + """ + Returns: + str: Human-readable description of this service. + """ return internals.blpapi_Service_description(self.__handle) def hasOperation(self, name): - """Return True if the specified 'name' is a valid Operation. - - Return True if the specified 'name' identifies a valid Operation in - this Service. - + """ + Returns: + bool: ``True`` if the specified ``name`` is a valid + :class:`Operation` in this :class:`Service`. """ names = getNamePair(name) @@ -211,14 +240,17 @@ def hasOperation(self, name): names[1])) def getOperation(self, nameOrIndex): - """Return a specified operation. + """ + Args: + nameOrIndex (Name or str or int): Name or index of the operation - Return an 'Operation' object identified by the specified - 'nameOrIndex', which must be either a string, a Name, or an integer. - If 'nameOrIndex' is a string or a Name and 'hasOperation(nameOrIndex) - != True', or if 'nameOrIndex' is an integer and 'nameOrIndex >= - numOperations()', then an exception is raised. + Returns: + Operation: The specified operation. + Raises: + Exception: If ``nameOrIndex`` is a string or a :class:`Name` and + ``hasOperation(nameOrIndex) != True``, or if ``nameOrIndex`` is + an integer and ``nameOrIndex >= numOperations()``. """ if not isinstance(nameOrIndex, int): @@ -234,23 +266,33 @@ def getOperation(self, nameOrIndex): return Operation(operation, self.__sessions) def numOperations(self): - """Return the number of Operations defined by this Service.""" + """ + Returns: + int: The number of :class:`Operation`\ s defined by this + :class:`Service`. + """ return internals.blpapi_Service_numOperations(self.__handle) def operations(self): - """Return an iterator over Operations defined by this Service""" + """ + Returns: + Iterator over :class:`Operation`\ s defined by this :class:`Service` + """ return utils.Iterator(self, Service.numOperations, Service.getOperation) def hasEventDefinition(self, name): - """Return True if the specified 'name' identifies a valid event. - - Return True if the specified 'name' identifies a valid event in this - Service, False otherwise. + """ + Args: + name (Name or str): Event identifier - Exception is raised if 'name' is neither a Name nor a string. + Returns: + bool: ``True`` if the specified ``name`` identifies a valid event + in this :class:`Service`, ``False`` otherwise. + Raises: + Exception: If ``name`` is neither a :class:`Name` nor a string. """ names = getNamePair(name) @@ -259,15 +301,20 @@ def hasEventDefinition(self, name): names[1])) def getEventDefinition(self, nameOrIndex): - """Return the definition of a specified event. + """Get the definition of a specified event. - Return a 'SchemaElementDefinition' object describing the element - identified by the specified 'nameOrIndex', which must be either a - string or an integer. If 'nameOrIndex' is a string and - 'hasEventDefinition(nameOrIndex) != True', then a 'NotFoundException' - is raised; if 'nameOrIndex' is an integer and 'nameOrIndex >= - numEventDefinitions()' then an 'IndexOutOfRangeException' is raised. + Args: + nameOrIndex (Name or str or int): Name or index of the event + Returns: + SchemaElementDefinition: Object describing the element + identified by the specified ``nameOrIndex``. + + Raises: + NotFoundException: If ``nameOrIndex`` is a string and + ``hasEventDefinition(nameOrIndex) != True`` + IndexOutOfRangeException: If ``nameOrIndex`` is an integer and + ``nameOrIndex >= numEventDefinitions()`` """ if not isinstance(nameOrIndex, int): @@ -285,11 +332,18 @@ def getEventDefinition(self, nameOrIndex): return SchemaElementDefinition(definition, self.__sessions) def numEventDefinitions(self): - """Return the number of unsolicited events defined by this Service.""" + """ + Returns: + int: The number of unsolicited events defined by this + :class:`Service`. + """ return internals.blpapi_Service_numEventDefinitions(self.__handle) def eventDefinitions(self): - """Return an iterator over unsolicited events defined by this Service. + """ + Returns: + An iterator over unsolicited events defined by this + :class:`Service`. """ return utils.Iterator(self, @@ -297,24 +351,33 @@ def eventDefinitions(self): Service.getEventDefinition) def authorizationServiceName(self): - """Return the authorization service name. + """Get the authorization service name. + + Returns: + str: The name of the :class:`Service` which must be used in order + to authorize access to restricted operations on this + :class:`Service`. If no authorization is required to access + operations on this service an empty string is returned. - Return the name of the Service which must be used in order to authorize - access to restricted operations on this Service. If no authorization is - required to access operations on this service an empty string is - returned. Authorization services never require authorization to use. + Authorization services never require authorization to use. """ return internals.blpapi_Service_authorizationServiceName(self.__handle) def createRequest(self, operation): - """Return a empty Request object for the specified 'operation'. + """Create an empty Request object for the specified ``operation``. - If 'operation' does not identify a valid operation in the Service then - an exception is raised. + Args: + operation: A valid operation on this service - An application must populate the Request before issuing it using - Session.sendRequest(). + Returns: + Request: An empty request for the specified ``operation``. + Raises: + Exception: If ``operation`` does not identify a valid operation in + the :class:`Service` + + An application must populate the :class:`Request` before issuing it + using :meth:`Session.sendRequest()`. """ errCode, request = internals.blpapi_Service_createRequest( @@ -324,14 +387,22 @@ def createRequest(self, operation): return Request(request, self.__sessions) def createAuthorizationRequest(self, authorizationOperation=None): - """Return an empty Request object for 'authorizationOperation'. + """Create an empty :class:`Request` object for + ``authorizationOperation``. + + Args: + authorizationOperation: A valid operation on this service - If the 'authorizationOperation' does not identify a valid operation for - this Service then an exception is raised. + Returns: + Request: An empty request for the specified + ``authorizationOperation``. - An application must populate the Request before issuing it using - Session.sendAuthorizationRequest(). + Raises: + Exception: If ``authorizationOperation`` does not identify a valid + operation in the :class:`Service` + An application must populate the :class:`Request` before issuing it + using :meth:`Session.sendAuthorizationRequest()`. """ errCode, request = internals.blpapi_Service_createAuthorizationRequest( diff --git a/blpapi/session.py b/blpapi/session.py index cbb2dc2..65b2290 100644 --- a/blpapi/session.py +++ b/blpapi/session.py @@ -28,55 +28,58 @@ class Session(AbstractSession): """Consumer session for making requests for Bloomberg services. This class provides a consumer session for making requests for Bloomberg - services. + services. For information on generic session operations, see the parent + class: :class:`AbstractSession`. Sessions manage access to services either by requests and responses or - subscriptions. A Session can dispatch events and replies in either - a synchronous or asynchronous mode. The mode of a Session is determined - when it is constructed and cannot be changed subsequently. - - A Session is asynchronous if an eventHandler argument is supplied when it - is constructed. The nextEvent() method may not be called. All incoming - events are delivered to the event handler supplied on construction. - - A Session is synchronous if an eventHandler argument is not supplied when - it is constructed. The nextEvent() method must be called to read incoming - events. - - Several methods in Session take a CorrelationId parameter. The application - may choose to supply its own CorrelationId values or allow the Session to - create values. If the application supplys its own CorrelationId values it - must manage their lifetime such that the same value is not reused for more - than one operation at a time. The lifetime of a CorrelationId begins when - it is supplied in a method invoked on a Session and ends either when it is - explicitly cancelled using cancel() or unsubscribe(), when a RESPONSE Event - (not a PARTIAL_RESPONSE) containing it is received or when a - SUBSCRIPTION_STATUS Event which indicates that the subscription it refers - to has been terminated is received. - - When using an asynchronous Session the application must be aware that - because the callbacks are generated from another thread they may be + subscriptions. A Session can dispatch events and replies in either a + synchronous or asynchronous mode. The mode of a Session is determined when + it is constructed and cannot be changed subsequently. + + A Session is asynchronous if an ``eventHandler`` argument is supplied when + it is constructed. The ``nextEvent()`` method may not be called. All + incoming events are delivered to the ``eventHandler`` supplied on + construction. + + If supplied, ``eventHandler`` must be a callable object that takes two + arguments: received :class:`Event` and related session. + + A Session is synchronous if an ``eventHandler`` argument is not supplied + when it is constructed. The :meth:`nextEvent()` method must be called to + read incoming events. + + Several methods in Session take a :class:`CorrelationId` parameter. The + application may choose to supply its own :class:`CorrelationId` values or + allow the Session to create values. If the application supplies its own + :class:`CorrelationId` values it must manage their lifetime such that the + same value is not reused for more than one operation at a time. The + lifetime of a :class:`CorrelationId` begins when it is supplied in a method + invoked on a Session and ends either when it is explicitly cancelled using + :meth:`cancel()` or :meth:`unsubscribe()`, when a :attr:`~Event.RESPONSE` + :class:`Event` (not a :attr:`~Event.PARTIAL_RESPONSE`) containing it is + received or when a :attr:`~Event.SUBSCRIPTION_STATUS` :class:`Event` which + indicates that the subscription it refers to has been terminated is + received. + + When using an asynchronous Session, the application must be aware that + because the callbacks are generated from another thread, they may be processed before the call which generates them has returned. For example, - the SESSION_STATUS Event generated by a startAsync() may be processed - before startAsync() has returned (even though startAsync() itself will not - block). - - This becomes more significant when Session generated CorrelationIds are in - use. For example, if a call to subscribe() which returns a Session - generated CorrelationId has not completed before the first Events which - contain that CorrelationId arrive the application may not be able to - interpret those events correctly. For this reason, it is preferable to use - user generated CorrelationIds when using asynchronous Sessions. This issue - does not arise when using a synchronous Session as long as the calls to - subscribe() etc are made on the same thread as the calls to nextEvent(). - - The possible statuses a subscription may be in. - - UNSUBSCRIBED No longer active, terminated by API. - SUBSCRIBING Initiated but no updates received. - SUBSCRIBED Updates are flowing. - CANCELLED No longer active, terminated by Application. - PENDING_CANCELLATION Pending cancellation. + the :attr:`~Event.SESSION_STATUS` :class:`Event` generated by a + :meth:`startAsync()` may be processed before :meth:`startAsync()` has + returned (even though :meth:`startAsync()` itself will not block). + + This becomes more significant when Session generated + :class:`CorrelationId`\ s are in use. For example, if a call to + :meth:`subscribe()` which returns a Session generated + :class:`CorrelationId` has not completed before the first :class:`Event`\ s + which contain that :class:`CorrelationId` arrive the application may not be + able to interpret those events correctly. For this reason, it is preferable + to use user generated :class:`CorrelationId`\ s when using asynchronous + Sessions. This issue does not arise when using a synchronous Session as + long as the calls to :meth:`subscribe()` etc. are made on the same thread + as the calls to :meth:`nextEvent()`. + + The class attributes represent the states in which a subscription can be. """ UNSUBSCRIBED = internals.SUBSCRIPTIONSTATUS_UNSUBSCRIBED @@ -108,46 +111,44 @@ def __dispatchEvent(sessionRef, eventHandle): os._exit(1) def __init__(self, options=None, eventHandler=None, eventDispatcher=None): - """Constructor. - - Session([options, [eventHandler, [eventDispatcher]]]) constructs a - Session object using the optionally specified 'options', the - optionally specified 'eventHandler' and the optionally specified - 'eventDispatcher'. - - See the SessionOptions documentation for details on what can be - specified in the 'options'. - - 'eventHandler' can be None or a callable object that takes two - arguments: received event and related session. - - Note that in case of unhandled exception in 'eventHandler', the - exception traceback will be printed to sys.stderr and application - will be terminated with nonzero exit code. - - If 'eventHandler' is not None then this Session will operate in - asynchronous mode, otherwise the Session will operate in synchronous - mode. - - If 'eventDispatcher' is None then the Session will create a default - EventDispatcher for this Session which will use a single thread for - dispatching events. For more control over event dispatching a specific - instance of EventDispatcher can be supplied. This can be used to share - a single EventDispatcher amongst multiple Session objects. - - If an 'eventDispatcher' is supplied which uses more than one thread the - Session will ensure that events which should be ordered are passed to - callbacks in a correct order. For example, partial response to - a request or updates to a single subscription. - - If 'eventHandler' is None and and the 'eventDispatcher' is not None - an exception is raised. - - Each 'eventDispatcher' uses it's own thread or pool of threads so if + """Create a consumer :class:`Session`. + + Args: + options (SessionOptions): Options to construct the session with + eventHandler (~collections.abc.Callable): Handler for events + generated by the session. Takes two arguments - received event + and related session + + Raises: + InvalidArgumentException: If ``eventHandler`` is ``None`` and and + the ``eventDispatcher`` is not ``None`` + + If ``eventHandler`` is not ``None`` then this :class:`Session` will + operate in asynchronous mode, otherwise the :class:`Session` will + operate in synchronous mode. + + If ``eventDispatcher`` is ``None`` then the :class:`Session` will + create a default :class:`EventDispatcher` for this :class:`Session` + which will use a single thread for dispatching events. For more control + over event dispatching a specific instance of :class:`EventDispatcher` + can be supplied. This can be used to share a single + :class:`EventDispatcher` amongst multiple :class:`Session` objects. + + If an ``eventDispatcher`` is supplied which uses more than one thread + the :class:`Session` will ensure that events which should be ordered + are passed to callbacks in a correct order. For example, partial + response to a request or updates to a single subscription. + + Each ``eventDispatcher`` uses it's own thread or pool of threads so if you want to ensure that a session which receives very large messages and takes a long time to process them does not delay a session that receives small messages and processes each one very quickly then give - each one a separate 'eventDispatcher'. + each one a separate ``eventDispatcher``. + + Note: + In case of unhandled exception in ``eventHandler``, the exception + traceback will be printed to ``sys.stderr`` and application will be + terminated with nonzero exit code. """ if (eventHandler is None) and (eventDispatcher is not None): raise exception.InvalidArgumentException( @@ -178,68 +179,90 @@ def destroy(self): self.__handle = None def start(self): - """Start this session in synchronous mode. - - Attempt to start this Session and blocks until the Session has started - or failed to start. If the Session is started successfully iTrue is - returned, otherwise False is returned. Before start() returns a - SESSION_STATUS Event is generated. If this is an asynchronous Session - then the SESSION_STATUS may be processed by the registered EventHandler - before start() has returned. A Session may only be started once. + """Start this :class:`Session` in synchronous mode. + + Returns: + bool: ``True`` if the :class:`Session` started successfully, + ``False`` otherwise. + + Attempt to start this :class:`Session` and block until the + :class:`Session` has started or failed to start. Before + :meth:`start()` returns a :attr:`~Event.SESSION_STATUS` :class:`Event` + is generated. A :class:`Session` may only be started once. """ return internals.blpapi_Session_start(self.__handle) == 0 def startAsync(self): - """Start this session in asynchronous mode. - - Attempt to begin the process to start this Session and return True if - successful, otherwise return False. The application must monitor events - for a SESSION_STATUS Event which will be generated once the Session has - started or if it fails to start. If this is an asynchronous Session - then the SESSION_STATUS Event may be processed by the registered - EventHandler before startAsync() has returned. A Session may only be - started once. + """Start this :class:`Session` in asynchronous mode. + + Returns: + bool: ``True`` if the process to start a :class:`Session` began + successfully, ``False`` otherwise. + + Attempt to begin the process to start this :class:`Session`. The + application must monitor events for a :attr:`~Event.SESSION_STATUS` + :class:`Event` which will be generated once the :class:`Session` has + started or if it fails to start. The :attr:`~Event.SESSION_STATUS` + :class:`Event` may be processed by the registered ``eventHandler`` + before :meth:`startAsync()` has returned. A :class:`Session` may only + be started once. """ return internals.blpapi_Session_startAsync(self.__handle) == 0 def stop(self): - """Stop operation of this session and wait until it stops. - - Stop operation of this session and block until all callbacks to - EventHandler objects relating to this Session which are currently in - progress have completed (including the callback to handle - the SESSION_STATUS Event this call generates). Once this returns no - further callbacks to EventHandlers will occur. If stop() is called from - within an EventHandler callback it is silently converted to - a stopAsync() in order to prevent deadlock. Once a Session has been - stopped it can only be destroyed. + """Stop operation of this :class:`Session` and wait until it stops. + + Returns: + bool: ``True`` if the :class:`Session` stopped successfully, + ``False`` otherwise. + + Stop operation of this :class:`Session` and block until all callbacks + to ``eventHandler`` objects relating to this :class:`Session` which are + currently in progress have completed (including the callback to handle + the :class:`~Event.SESSION_STATUS` :class:`Event` this call generates). + Once this returns no further callbacks to ``eventHandlers`` will occur. + If :meth:`stop()` is called from within an ``eventHandler`` callback it + is silently converted to a :meth:`stopAsync()` in order to prevent + deadlock. Once a :class:`Session` has been stopped it can only be + destroyed. """ return internals.blpapi_Session_stop(self.__handle) == 0 def stopAsync(self): """Begin the process to stop this Session and return immediately. - The application must monitor events for a - SESSION_STATUS Event which will be generated once the - Session has been stopped. After this SESSION_STATUS Event - no further callbacks to EventHandlers will occur(). Once a - Session has been stopped it can only be destroyed. + Returns: + bool: ``True`` if the process to stop a :class:`Session` began + successfully, ``False`` otherwise. + + The application must monitor events for a :attr:`~Event.SESSION_STATUS` + :class:`Event` which will be generated once the :class:`Session` has + been stopped. After this :attr:`~Event.SESSION_STATUS` :class:`Event` + no further callbacks to ``eventHandlers`` will occur. Once a + :class:`Session` has been stopped it can only be destroyed. """ - return internals.blpapi_Session_stop(self.__handle) == 0 + return internals.blpapi_Session_stopAsync(self.__handle) == 0 def nextEvent(self, timeout=0): - """Return the next available Event for this session. + """ + Args: + timeout (int): Timeout threshold in milliseconds + + Returns: + Event: Next available event for this session - If there is no event available this will block for up to the specified - 'timeoutMillis' milliseconds for an Event to arrive. A value of 0 for - 'timeoutMillis' (the default) indicates nextEvent() should not timeout - and will not return until the next Event is available. + Raises: + InvalidStateException: If invoked on a session created in + asynchronous mode - If nextEvent() returns due to a timeout it will return an event of type - 'EventType.TIMEOUT'. + If there is no :class:`Event` available this will block for up to the + specified ``timeout`` milliseconds for an :class:`Event` to arrive. A + value of ``0`` for ``timeout`` (the default) indicates + :meth:`nextEvent()` should not timeout and will not return until the + next :class:`Event` is available. - If this is invoked on a Session which was created in asynchronous mode - an InvalidStateException is raised. + If :meth:`nextEvent()` returns due to a timeout it will return an event + of type :attr:`~Event.TIMEOUT`. """ retCode, event = internals.blpapi_Session_nextEvent(self.__handle, timeout) @@ -249,11 +272,13 @@ def nextEvent(self, timeout=0): return Event(event, self) def tryNextEvent(self): - """Return the next Event for this session if it is available. + """ + Returns: + Event: Next available event for this session - If there are Events available for the session, return the next Event - If there is no event available for the session, return None. This - method never blocks. + If there are :class:`Event`\ s available for the session, return the + next :class:`Event` If there is no event available for the + :class:`Session`, return ``None``. This method never blocks. """ retCode, event = internals.blpapi_Session_tryNextEvent(self.__handle) if retCode: @@ -263,15 +288,22 @@ def tryNextEvent(self): def subscribe(self, subscriptionList, identity=None, requestLabel=""): """Begin subscriptions for each entry in the specified list. - Begin subscriptions for each entry in the specified 'subscriptionList', - which must be an object of type 'SubscriptionList', optionally using - the specified 'identity' for authorization. If no 'identity' is - specified, the default authorization information is used. If the - optional 'requestLabel' is provided it defines a string which will be - recorded along with any diagnostics for this operation. - - A SUBSCRIPTION_STATUS Event will be generated for each - entry in the 'subscriptionList'. + Args: + subscriptionList (SubscriptionList): List of subscriptions to begin + identity (Identity): Identity used for authorization + requestLabel (str): String which will be recorded along with any + diagnostics for this operation + + Begin subscriptions for each entry in the specified + ``subscriptionList``, which must be an object of type + :class:`SubscriptionList`, optionally using the specified ``identity`` + for authorization. If no ``identity`` is specified, the default + authorization information is used. If the optional ``requestLabel`` is + provided it defines a string which will be recorded along with any + diagnostics for this operation. + + A :attr:`~Event.SUBSCRIPTION_STATUS` :class:`Event` will be generated + for each entry in the ``subscriptionList``. """ _ExceptionUtil.raiseOnError(internals.blpapi_Session_subscribe( self.__handle, @@ -281,25 +313,30 @@ def subscribe(self, subscriptionList, identity=None, requestLabel=""): len(requestLabel))) def unsubscribe(self, subscriptionList): - """Cancel subscriptions from the specified 'subscriptionList'. + """Cancel subscriptions from the specified ``subscriptionList``. + + Args: + subscriptionList (SubscriptionList): List of subscriptions to cancel Cancel each of the current subscriptions identified by the specified - 'subscriptionList', which must be an object of type 'SubscriptionList'. - If the correlation ID of any entry in the 'subscriptionList' does not - identify a current subscription then that entry is ignored. All entries - which have valid correlation IDs will be cancelled. - - Once this call returns the correlation ids in the 'subscriptionList' - will not be seen in any subsequent Message obtained from - a MessageIterator by calling next(). However, any Message currently - pointed to by a MessageIterator when unsubscribe() is called is not - affected even if it has one of the correlation IDs in the - 'subscriptionList'. Also any Message where a reference has been - retained by the application may still contain a correlation ID from - the 'subscriptionList'. For these reasons, although technically - an application is free to re-use the correlation IDs as soon as this - method returns it is preferable not to aggressively re-use correlation - IDs, particularly with an asynchronous Session. + ``subscriptionList``, which must be an object of type + :class:`SubscriptionList`. If the correlation ID of any entry in the + ``subscriptionList`` does not identify a current subscription then that + entry is ignored. All entries which have valid correlation IDs will be + cancelled. + + Once this call returns the correlation ids in the ``subscriptionList`` + will not be seen in any subsequent :class:`Message` obtained from a + ``MessageIterator`` by calling ``next()`` However, any :class:`Message` + currently pointed to by a ``MessageIterator`` when + :meth:`unsubscribe()` is called is not affected even if it has one of + the correlation IDs in the ``subscriptionList``. Also any + :class:`Message` where a reference has been retained by the application + may still contain a correlation ID from the ``subscriptionList``. For + these reasons, although technically an application is free to re-use + the correlation IDs as soon as this method returns it is preferable not + to aggressively re-use correlation IDs, particularly with an + asynchronous :class:`Session`. """ _ExceptionUtil.raiseOnError(internals.blpapi_Session_unsubscribe( self.__handle, @@ -312,21 +349,29 @@ def resubscribe( subscriptionList, requestLabel="", resubscriptionId=None): - """Modify subscriptions in 'subscriptionList'. - - Modify each subscription in the specified 'subscriptionList', which - must be an object of type 'SubscriptionList', to reflect the modified - options specified for it. If the optional 'requestLabel' is provided it - defines a string which will be recorded along with any diagnostics for - this operation. - - For each entry in the 'subscriptionList' which has a correlation ID + """Modify subscriptions in ``subscriptionList``. + + Args: + subscriptionList (SubscriptionList): List of subscriptions to modify + requestLabel (str): String which will be recorded along with any + diagnostics for this operation + resubscriptionId (int): An id that will be included in the event + generated from this operation + + Modify each subscription in the specified ``subscriptionList``, which + must be an object of type :class:`SubscriptionList`, to reflect the + modified options specified for it. If the optional ``requestLabel`` is + provided it defines a string which will be recorded along with any + diagnostics for this operation. + + For each entry in the ``subscriptionList`` which has a correlation ID which identifies a current subscription the modified options replace - the current options for the subscription and a SUBSCRIPTION_STATUS - event will be generated in the event stream before the first update - based on the new options. If the correlation ID of an entry in the - 'subscriptionList' does not identify a current subscription then that - entry is ignored. + the current options for the subscription and a + :attr:`~Event.SUBSCRIPTION_STATUS` :class:`Event` (containing the + ``resubscriptionId`` if specified) will be generated in the event + stream before the first update based on the new options. If the + correlation ID of an entry in the ``subscriptionList`` does not + identify a current subscription then that entry is ignored. """ error = None if resubscriptionId is None: @@ -346,11 +391,18 @@ def resubscribe( _ExceptionUtil.raiseOnError(error) def setStatusCorrelationId(self, service, correlationId, identity=None): - """Set the CorrelationID on which service status messages. - - Set the CorrelationID on which service status messages will be + """Set the Correlation id on which service status messages will be received. - Note: No service status messages are received prior to this call + + Args: + service (Service): The service which from which the status messages + are received + correlationId (CorrelationId): Correlation id to associate with the + service status messages + identity (Identity): Identity used for authorization + + Note: + No service status messages are received prior to this call """ _ExceptionUtil.raiseOnError( internals.blpapi_Session_setStatusCorrelationId( @@ -365,22 +417,39 @@ def sendRequest(self, correlationId=None, eventQueue=None, requestLabel=""): - """Send the specified 'request'. - - Send the specified 'request' using the specified 'identity' for - authorization. If the optionally specified 'correlationId' is supplied - use it, otherwise create a CorrelationId. The actual CorrelationId used - is returned. If the optionally specified 'eventQueue' is supplied all - events relating to this Request will arrive on that EventQueue. If - the optional 'requestLabel' is provided it defines a string which will - be recorded along with any diagnostics for this operation. - - A successful request will generate zero or more PARTIAL_RESPONSE - Messages followed by exactly one RESPONSE Message. Once the final - RESPONSE Message has been received the CorrelationId associated with - this request may be re-used. If the request fails at any stage - a REQUEST_STATUS will be generated after which the CorrelationId - associated with the request may be re-used. + """Send the specified ``request``. + + Args: + request (Request): Request to send + identity (Identity): Identity used for authorization + correlationId (CorrelationId): Correlation id to associate with the + request + eventQueue (EventQueue): Event queue on which the events related to + this operation will arrive + requestLabel (str): String which will be recorded along with any + diagnostics for this operation + + Returns: + CorrelationId: The actual correlation id associated with the + request + + Send the specified ``request`` using the specified ``identity`` for + authorization. If the optionally specified ``correlationId`` is + supplied use it, otherwise create a :class:`CorrelationId`. The actual + :class:`CorrelationId` used is returned. If the optionally specified + ``eventQueue`` is supplied all events relating to this :class:`Request` + will arrive on that :class:`EventQueue`. If the optional + ``requestLabel`` is provided it defines a string which will be recorded + along with any diagnostics for this operation. + + A successful request will generate zero or more + :class:`~Event.PARTIAL_RESPONSE` :class:`Message`\ s followed by + exactly one :class:`~Event.RESPONSE` :class:`Message`. Once the final + :class:`~Event.RESPONSE` :class:`Message` has been received the + :class:`CorrelationId` associated with this request may be re-used. If + the request fails at any stage a :class:`~Event.REQUEST_STATUS` will be + generated after which the :class:`CorrelationId` associated with the + request may be re-used. """ if correlationId is None: correlationId = CorrelationId() @@ -398,17 +467,29 @@ def sendRequest(self, return correlationId def sendRequestTemplate(self, requestTemplate, correlationId=None): - """Send a request defined by the specified 'requestTemplate'. If the - optionally specified 'correlationId' is supplied, use it otherwise - create a new 'CorrelationId'. The actual 'CorrelationId' used is - returned. - - A successful request will generate zero or more 'PARTIAL_RESPONSE' - events followed by exactly one 'RESPONSE' event. Once the final - 'RESPONSE' event has been received the 'CorrelationId' associated - with this request may be re-used. If the request fails at any stage - a 'REQUEST_STATUS' will be generated after which the 'CorrelationId' - associated with the request may be re-used. + """Send a request defined by the specified ``requestTemplate``. + + Args: + requestTemplate (RequestTemplate): Template that defines the + request + correlationId (CorrelationId): Correlation id to associate with the + request + + Returns: + CorrelationId: The actual correlation id used for the request is + returned. + + If the optionally specified ``correlationId`` is supplied, use it + otherwise create a new :class:`CorrelationId`. The actual + :class:`CorrelationId` used is returned. + + A successful request will generate zero or more + :attr:`~Event.PARTIAL_RESPONSE` events followed by exactly one + :attr:`~Event.RESPONSE` event. Once the final :attr:`~Event.RESPONSE` + event has been received the ``CorrelationId`` associated with this + request may be re-used. If the request fails at any stage a + :attr:`~Event.REQUEST_STATUS` will be generated after which the + ``CorrelationId`` associated with the request may be re-used. """ if correlationId is None: correlationId = CorrelationId() @@ -425,62 +506,76 @@ def createSnapshotRequestTemplate( identity, correlationId): """Create a snapshot request template for getting subscription data - specified by the 'subscriptionString' using the specified 'identity' - if all the following conditions are met: the session is - established, 'subscriptionString' is a valid subscription string and - 'correlationId' is not used in this session. If one or more conditions - are not met, an exception is thrown. The provided 'correlationId' will - be used for status updates about the created request template state - and an implied subscription associated with it delivered by - 'SUBSCRIPTION_STATUS' events. + specified by the ``subscriptionString`` using the specified + ``identity``. + + Args: + subscriptionString (str): String that specifies the subscription + identity (Identity): Identity used for authorization + correlationId (CorrelationId): Correlation id to associate with + events generated by this operation + + Returns: + RequestTemplate: Created request template + + Raises: + Exception: If one or more of the following conditions is not met: + the session is established, ``subscriptionString`` is a valid + subscription string and ``correlationId`` is not used in this + session. + + The provided ``correlationId`` will be used for status updates about + the created request template state and an implied subscription + associated with it delivered by :attr:`~Event.SUBSCRIPTION_STATUS` + events. The benefit of the snapshot request templates is that these requests may be serviced from a cache and the user may expect to see significantly lower response time. There are 3 possible states for a created request template: - 'Pending', 'Available', and 'Terminated'. Right after creation a - request template is in the 'Pending' state. + ``Pending``, ``Available``, and ``Terminated``. Right after creation a + request template is in the ``Pending`` state. - If a state is 'Pending', the user may send a request using this + If a state is ``Pending``, the user may send a request using this template but there are no guarantees about response time since cache - is not available yet. Request template may transition into 'Pending' - state only from the 'Available' state. In this case the - 'RequestTemplatePending' message is generated. + is not available yet. Request template may transition into ``Pending`` + state only from the ``Available`` state. In this case the + ``RequestTemplatePending`` message is generated. - If state is 'Available', all requests will be serviced from a cache + If state is ``Available``, all requests will be serviced from a cache and the user may expect to see significantly reduced latency. Note, that a snapshot request template can transition out of the - 'Available' state concurrently with requests being sent, so no + ``Available`` state concurrently with requests being sent, so no guarantee of service from the cache can be provided. Request - template may transition into 'Available' state only from the - 'Pending' state. In this case the 'RequestTemplateAvailable' message + template may transition into ``Available`` state only from the + ``Pending`` state. In this case the ``RequestTemplateAvailable`` message is generated. This message will also contain information about - currently used connection in the 'boundTo' field. Note that it is - possible to get the 'RequestTemplateAvailable' message with a new + currently used connection in the ``boundTo`` field. Note that it is + possible to get the ``RequestTemplateAvailable`` message with a new connection information, even if a request template is already in the - 'Available' state. - - If state is 'Terminated', sending request will always result in a - failure response. Request template may transition into this state - from any other state. This is a final state and it is guaranteed - that the last message associated with the provided 'correlationId' will - be the 'RequestTemplateTerminated' message which is generated when a - request template transitions into this state. If a request template - transitions into this state, all outstanding requests will be failed - and appropriate messages will be generated for each request. After - receiving the 'RequestTemplateTerminated' message, 'correlationId' may - be reused. + ``Available`` state. + + If state is ``Terminated``, sending request will always result in a + failure response. Request template may transition into this state from + any other state. This is a final state and it is guaranteed that the + last message associated with the provided ``correlationId`` will be the + ``RequestTemplateTerminated`` message which is generated when a request + template transitions into this state. If a request template transitions + into this state, all outstanding requests will be failed and + appropriate messages will be generated for each request. After + receiving the ``RequestTemplateTerminated`` message, ``correlationId`` + may be reused. Note that resources used by a snapshot request template are released - only when request template transitions into the 'Terminated' state + only when request template transitions into the ``Terminated`` state or when session is destroyed. In order to release resources when request template is not needed anymore, user should call the - 'Session::cancel(correlationId)' unless the 'RequestTemplateTerminated' + :meth:`cancel()` method unless the ``RequestTemplateTerminated`` message was already received due to some problems. When the last - copy of a 'RequestTemplate' object goes out of scope and there are + copy of a ``RequestTemplate`` object goes out of scope and there are no outstanding requests left, the snapshot request template will be - destroyed automatically. If the last copy of a 'RequestTemplate' + destroyed automatically. If the last copy of a ``RequestTemplate`` object goes out of scope while there are still some outstanding requests left, snapshot service request template will be destroyed automatically when the last request gets a final response. diff --git a/blpapi/sessionoptions.py b/blpapi/sessionoptions.py index dbb8e4f..9fa69e2 100644 --- a/blpapi/sessionoptions.py +++ b/blpapi/sessionoptions.py @@ -33,15 +33,12 @@ class SessionOptions(object): """Options which the user can specify when creating a session. - To use non-default options on a Session, create a SessionOptions instance - and set the required options and then supply it when creating a Session. - - The possible options for how to connect to the API: - - AUTO - Automatic (desktop if available otherwise server) - DAPI - Always connect to the desktop API - SAPI - Always connect to the server API + To use non-default options on a :class:`Session`, create a + :class:`SessionOptions` instance and set the required options and then + supply it when creating a :class:`Session`. + The class attributes represent the possible options for how to connect to + the API. """ AUTO = internals.CLIENTMODE_AUTO @@ -52,7 +49,8 @@ class SessionOptions(object): """Always connect to the server API""" def __init__(self): - """Create a SessionOptions with all options set to the defaults""" + """Create a :class:`SessionOptions` with all options set to the + defaults""" self.__handle = internals.blpapi_SessionOptions_create() def __del__(self): @@ -72,7 +70,7 @@ def __str__(self): return self.toString() def destroy(self): - """Destroy this SessionOptions.""" + """Destroy this :class:`SessionOptions`.""" if self.__handle: internals.blpapi_SessionOptions_destroy(self.__handle) self.__handle = None @@ -80,10 +78,12 @@ def destroy(self): def setServerHost(self, serverHost): """Set the API server host to connect to when using the server API. - Set the API server host to connect to when using the server API to the - specified 'host'. A hostname or an IPv4 address (that is, a.b.c.d). - The default is "127.0.0.1". + Args: + serverHost (str): Server host + Set the API server host to connect to when using the server API to the + specified ``serverHost``. The server host is either a hostname or an + IPv4 address (that is, ``a.b.c.d``). The default is ``127.0.0.1``. """ _ExceptionUtil.raiseOnError( @@ -93,9 +93,11 @@ def setServerHost(self, serverHost): def setServerPort(self, serverPort): """Set the port to connect to when using the server API. - Set the port to connect to when using the server API to the specified - 'port'. The default is "8194". + Args: + serverPort (int): Server port + Set the port to connect to when using the server API to the specified + ``serverPort``. The default is ``8194``. """ _ExceptionUtil.raiseOnError( @@ -103,10 +105,15 @@ def setServerPort(self, serverPort): serverPort)) def setServerAddress(self, serverHost, serverPort, index): - """Set the server address at the specified 'index'. + """Set the server address at the specified ``index``. - Set the server address at the specified 'index' using the specified - 'serverHost' and 'serverPort'. + Args: + serverHost (str): Server host + serverPort (int): Server port + index (int): Index to set the address at + + Set the server address at the specified ``index`` using the specified + ``serverHost`` and ``serverPort``. """ _ExceptionUtil.raiseOnError( @@ -116,7 +123,11 @@ def setServerAddress(self, serverHost, serverPort, index): index)) def removeServerAddress(self, index): - """Remove the server address at the specified 'index'.""" + """Remove the server address at the specified ``index``. + + Args: + index (int): Index to remove the address at + """ _ExceptionUtil.raiseOnError( internals.blpapi_SessionOptions_removeServerAddress(self.__handle, @@ -125,11 +136,13 @@ def removeServerAddress(self, index): def setConnectTimeout(self, timeoutMilliSeconds): """Set the connection timeout in milliseconds. + Args: + timeoutMilliSeconds (int): Timeout threshold in milliseconds + Set the connection timeout in milliseconds when connecting to the API. - The default is 5000 milliseconds. Behavior is not defined unless the - specified 'timeoutMilliSeconds' is in range of [1 .. 120000] + The default is ``5000`` milliseconds. Behavior is not defined unless + the specified ``timeoutMilliSeconds`` is in range of ``[1 .. 120000]`` milliseconds. - """ _ExceptionUtil.raiseOnError( @@ -140,10 +153,13 @@ def setConnectTimeout(self, timeoutMilliSeconds): def setDefaultServices(self, defaultServices): """Set the default service for the session. - DEPRECATED - Set the default service for the session. This function is deprecated; - see 'setDefaultSubscriptionService'. + Args: + defaultServices ([str]): The default services + **DEPRECATED** + + Set the default service for the session. This function is deprecated; + see :meth:`setDefaultSubscriptionService()`. """ _ExceptionUtil.raiseOnError( @@ -154,13 +170,15 @@ def setDefaultServices(self, defaultServices): def setDefaultSubscriptionService(self, defaultSubscriptionService): """Set the default service for subscriptions. - Set the default service for subscriptions which do not specify a - subscription server to the specified 'defaultSubscriptionService'. The - behavior is undefined unless 'defaultSubscriptionService' matches the - regular expression '^//[-_.a-zA-Z0-9]+/[-_.a-zA-Z0-9]+$'. The default - is "//blp/mktdata". For more information on when this will be used see - 'QUALIFYING SUBSCRIPTION STRINGS' section in 'blpapi_subscriptionlist'. + Args: + defaultSubscriptionService (str): Identifier for the service to be + used as default + Set the default service for subscriptions which do not specify a + subscription server to the specified ``defaultSubscriptionService``. + The behavior is undefined unless ``defaultSubscriptionService`` matches + the regular expression ``^//[-_.a-zA-Z0-9]+/[-_.a-zA-Z0-9]+$``. The + default is ``//blp/mktdata``. """ _ExceptionUtil.raiseOnError( @@ -171,11 +189,12 @@ def setDefaultSubscriptionService(self, defaultSubscriptionService): def setDefaultTopicPrefix(self, prefix): """Set the default topic prefix. - Set the default topic prefix to be used when a subscription does not - specify a prefix to the specified 'prefix'. The default is "/ticker/". - For more information on when this will be used see 'QUALIFYING - SUBSCRIPTION STRINGS' section in 'blpapi_subscriptionlist'. + Args: + prefix (str): The topic prefix to set + Set the default topic prefix to be used when a subscription does not + specify a prefix to the specified ``prefix``. The default is + ``/ticker/``. """ internals.blpapi_SessionOptions_setDefaultTopicPrefix( @@ -184,17 +203,21 @@ def setDefaultTopicPrefix(self, prefix): def setAllowMultipleCorrelatorsPerMsg(self, allowMultipleCorrelatorsPerMsg): - """Associate more than one CorrelationId with a Message. - - Set whether the Session is allowed to associate more than one - CorrelationId with a Message to the specified - 'allowMultipleCorrelatorsPerMsg'. The default is False. This means that - if you have multiple subscriptions which overlap (that is a particular - Message is relevant to all of them) you will be presented with the same - message multiple times when you use the MessageIterator, each time with - a different CorrelationId. If you specify True for this then a Message - may be presented with multiple CorrelationId's. - + """Associate more than one :class:`CorrelationId` with a + :class:`Message`. + + Args: + allowMultipleCorrelatorsPerMsg (bool): Value to set the option to + + Set whether the :class:`Session` is allowed to associate more than one + :class:`CorrelationId` with a :class:`Message` to the specified + ``allowMultipleCorrelatorsPerMsg``. The default is ``False``. This + means that if you have multiple subscriptions which overlap (that is a + particular :class:`Message` is relevant to all of them) you will be + presented with the same message multiple times when you use the + ``MessageIterator``, each time with a different :class:`CorrelationId`. + If you specify ``True`` for this then a :class:`Message` may be + presented with multiple :class:`CorrelationId`\ 's. """ internals.blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg( @@ -202,14 +225,16 @@ def setAllowMultipleCorrelatorsPerMsg(self, allowMultipleCorrelatorsPerMsg) def setClientMode(self, clientMode): - """Set how to connect to the API. The default is AUTO. + """Set how to connect to the API. The default is :attr:`AUTO`. - Set how to connect to the API. The default is AUTO which will try to - connect to the desktop API but fall back to the server API if the - desktop is not available. DAPI always connects to the desktop API and - will fail if it is not available. SAPI always connects to the server - API and will fail if it is not available. + Args: + clientMode (int): The client mode + Set how to connect to the API. The default is :attr:`AUTO` which will + try to connect to the desktop API but fall back to the server API if + the desktop is not available. :attr:`DAPI` always connects to the + desktop API and will fail if it is not available. :attr:`SAPI` always + connects to the server API and will fail if it is not available. """ internals.blpapi_SessionOptions_setClientMode(self.__handle, @@ -218,9 +243,11 @@ def setClientMode(self, clientMode): def setMaxPendingRequests(self, maxPendingRequests): """Set the maximum number of requests which can be pending. - Set the maximum number of requests which can be pending to - the specified 'maxPendingRequests'. The default is 1024. + Args: + maxPendingRequests (int): Maximum number of pending requests + Set the maximum number of requests which can be pending to the + specified ``maxPendingRequests``. The default is ``1024``. """ internals.blpapi_SessionOptions_setMaxPendingRequests( @@ -228,7 +255,7 @@ def setMaxPendingRequests(self, maxPendingRequests): maxPendingRequests) def setAuthenticationOptions(self, authOptions): - """Set the specified 'authOptions' as authentication option.""" + """Set the specified ``authOptions`` as authentication option.""" internals.blpapi_SessionOptions_setAuthenticationOptions( self.__handle, authOptions) @@ -243,147 +270,237 @@ def setNumStartAttempts(self, numStartAttempts): numStartAttempts) def setAutoRestartOnDisconnection(self, autoRestart): - """Set whether automatically restarting connection if disconnected.""" + """Set whether automatically restarting connection if disconnected. + + Args: + autoRestart (bool): Whether to automatically restart if + disconnected + """ internals.blpapi_SessionOptions_setAutoRestartOnDisconnection( self.__handle, autoRestart) def setSlowConsumerWarningHiWaterMark(self, hiWaterMark): - """Set the point at which "slow consumer" events will be generated, - using the specified 'highWaterMark' as a fraction of - 'maxEventQueueSize'; the default value is 0.75. A warning event will - be generated when the number of outstanding undelivered events passes - above 'hiWaterMark * maxEventQueueSize'. The behavior of the function - is undefined unless '0.0 < hiWaterMark <= 1.0'. Further, at the time - that 'Session.start()' is called, it must be the case that - 'slowConsumerWarningLoWaterMark() * maxEventQueueSize()' < - 'slowConsumerWarningHiWaterMark() * maxEventQueueSize()'.""" + """Set the point at which "slow consumer" events will be generated. + + Args: + hiWaterMark (float): Fraction of :meth:`maxEventQueueSize()` + + Set the point at which "slow consumer" events will be generated, using + the specified ``hiWaterMark`` as a fraction of + :meth:`maxEventQueueSize()`; the default value is ``0.75``. A warning + event will be generated when the number of outstanding undelivered + events passes above ``hiWaterMark * maxEventQueueSize()``. The + behavior of the function is undefined unless ``0.0 < hiWaterMark <= + 1.0``. Further, at the time that :meth:`Session.start()` is called, it + must be the case that ``slowConsumerWarningLoWaterMark() * + maxEventQueueSize()`` < ``slowConsumerWarningHiWaterMark() * + maxEventQueueSize()``. + """ err = internals.blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark( self.__handle, hiWaterMark) _ExceptionUtil.raiseOnError(err) def setSlowConsumerWarningLoWaterMark(self, loWaterMark): """Set the point at which "slow consumer cleared" events will be - generated, using the specified 'loWaterMark' as a fraction of - 'maxEventQueueSize'; the default value is 0.5. A warning cleared event - will be generated when the number of outstanding undelivered events - drops below 'loWaterMark * maxEventQueueSize'. The behavior of the - function is undefined unless '0.0 <= loWaterMark < 1.0'. Further, at - the time that 'Session.start()' is called, it must be the case that - 'slowConsumerWarningLoWaterMark() * maxEventQueueSize()' < - 'slowConsumerWarningHiWaterMark() * maxEventQueueSize()'.""" + generated + + Args: + loWaterMark (float): Fraction of :meth:`maxEventQueueSize()` + + Set the point at which "slow consumer cleared" events will be + generated, using the specified ``loWaterMark`` as a fraction of + :meth:`maxEventQueueSize()`; the default value is ``0.5``. A warning + cleared event will be generated when the number of outstanding + undelivered events drops below ``loWaterMark * maxEventQueueSize``. + The behavior of the function is undefined unless ``0.0 <= loWaterMark < + 1.0``. Further, at the time that :meth:`Session.start()` is called, it + must be the case that ``slowConsumerWarningLoWaterMark() * + maxEventQueueSize()`` < ``slowConsumerWarningHiWaterMark() * + maxEventQueueSize()``. + """ err = internals.blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark( self.__handle, loWaterMark) _ExceptionUtil.raiseOnError(err) def setMaxEventQueueSize(self, eventQueueSize): - """Set the maximum number of outstanding undelivered events per session - to the specified 'eventQueueSize'. All subsequent events delivered - over the network will be dropped by the session if the number of - outstanding undelivered events is 'eventQueueSize', the specified - threshold. The default value is 10000.""" + """Set the maximum number of outstanding undelivered events per + session. + + Args: + eventQueueSize (int): Maximum number of outstanding undelivered + events + + Set the maximum number of outstanding undelivered events per session to + the specified ``eventQueueSize``. All subsequent events delivered over + the network will be dropped by the session if the number of outstanding + undelivered events is ``eventQueueSize``, the specified threshold. The + default value is ``10000``. + """ internals.blpapi_SessionOptions_setMaxEventQueueSize( self.__handle, eventQueueSize) def setKeepAliveEnabled(self, isEnabled): - """If the specified 'isEnabled' is False, then disable all keep-alive - mechanisms, both from the client to the server and from the server to - the client; otherwise enable keep-alive pings both from the client to - the server (as configured by 'setDefaultKeepAliveInactivityTime' and - 'setDefaultKeepAliveResponseTimeout' if the connection supports + """Set whether to enable keep-alive pings. + + Args: + isEnabled (bool): Whether to enable keep-alive pings + + If the specified ``isEnabled`` is ``False``, then disable all + keep-alive mechanisms, both from the client to the server and from the + server to the client; otherwise enable keep-alive pings both from the + client to the server (as configured by + :meth:`setDefaultKeepAliveInactivityTime()` and + :meth:`setDefaultKeepAliveResponseTimeout()` if the connection supports ping-based keep-alives), and from the server to the client as specified - by the server configuration.""" + by the server configuration. + """ keepAliveValue = 1 if isEnabled else 0 err = internals.blpapi_SessionOptions_setKeepAliveEnabled( self.__handle, keepAliveValue) _ExceptionUtil.raiseOnError(err) def setDefaultKeepAliveInactivityTime(self, inactivityMsecs): - """ Set to the specified 'inactivityMsecs' the amount of time that no + """Set the amount of time that no traffic can be received before the + keep-alive mechanism is triggered. + + Args: + inactivityMsecs (int): Amount of time in milliseconds + + Set to the specified ``inactivityMsecs`` the amount of time that no traffic can be received on a connection before the ping-based keep-alive mechanism is triggered; if no traffic is received for this duration then a keep-alive ping is sent to the remote end to solicit a - response. If 'inactivityMsecs == 0', then no keep-alive pings will be - sent. The behavior of this function is undefined unless - 'inactivityMsecs' is a non-negative value. The default value is 20,000 - milliseconds. Note that not all back-end connections provide - ping-based keep-alives; this option is ignored by such connections.""" + response. If ``inactivityMsecs == 0``, then no keep-alive pings will + be sent. The behavior of this function is undefined unless + ``inactivityMsecs`` is a non-negative value. The default value is + ``20,000`` milliseconds. + + Note: + Not all back-end connections provide ping-based keep-alives; + this option is ignored by such connections. + """ err = internals.blpapi_SessionOptions_setDefaultKeepAliveInactivityTime( self.__handle, inactivityMsecs) _ExceptionUtil.raiseOnError(err) def setDefaultKeepAliveResponseTimeout(self, timeoutMsecs): - """ When a keep-alive ping is sent, wait for the specified - 'timeoutMsecs' to receive traffic (of any kind) before terminating the - connection due to inactivity. If 'timeoutMsecs == 0', then connections - are never terminated due to the absence of traffic after a keep-alive - ping. The behavior of this function is undefined unless 'timeoutMsecs' - is a non-negative value. The default value is 5,000 milliseconds. - Note that not all back-end connections provide support for ping-based - keep-alives; this option is ignored by such connections.""" + """Set the timeout for terminating the connection due to inactivity. + + Args: + timeoutMsecs (int): Timeout threshold in milliseconds + + When a keep-alive ping is sent, wait for the specified ``timeoutMsecs`` + to receive traffic (of any kind) before terminating the connection due + to inactivity. If ``timeoutMsecs == 0``, then connections are never + terminated due to the absence of traffic after a keep-alive ping. The + behavior of this function is undefined unless ``timeoutMsecs`` is a + non-negative value. The default value is ``5,000`` milliseconds. + + Note: + that not all back-end connections provide support for ping-based + keep-alives; this option is ignored by such connections. + """ err = internals.blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout( self.__handle, timeoutMsecs) _ExceptionUtil.raiseOnError(err) def setFlushPublishedEventsTimeout(self, timeoutMsecs): - """Set the timeout, in milliseconds, for ProviderSession to flush - published events before stopping. The behavior is not defined - unless the specified 'timeoutMsecs' is a positive value. The - default value is 2000.""" + """ + Args: + timeoutMsecs (int): Timeout threshold in milliseconds + + Set the timeout, in milliseconds, for :class:`ProviderSession` to flush + published events before stopping. The behavior is not defined unless + the specified ``timeoutMsecs`` is a positive value. The default value + is ``2000``. + """ internals.blpapi_SessionOptions_setFlushPublishedEventsTimeout( self.__handle, timeoutMsecs) def setRecordSubscriptionDataReceiveTimes(self, shouldRecord): - """Set whether the receipt time (accessed via - 'blpapi.Message.timeReceived') should be recorded for subscription data - messages. By default, the receipt time for these messages is not - recorded.""" + """ + Args: + shouldRecord (bool): Whether to record the receipt time + + Set whether the receipt time (accessed via + :meth:`.Message.timeReceived()`) should be recorded for subscription + data messages. By default, the receipt time for these messages is not + recorded. + """ internals.blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes( self.__handle, shouldRecord) def setServiceCheckTimeout(self, timeoutMsecs): - """Set the timeout, in milliseconds, when opening a service - for checking what version of the schema should be downloaded. - The behavior is not defined unless 'timeoutMsecs' is a positive value. - The default timeout is 60,000 milliseconds.""" + """ + Args: + timeoutMsecs (int): Timeout threshold in milliseconds + + Set the timeout, in milliseconds, when opening a service for checking + what version of the schema should be downloaded. The behavior is not + defined unless ``timeoutMsecs`` is a positive value. The default + timeout is ``60,000`` milliseconds. + """ err = internals.blpapi_SessionOptions_setServiceCheckTimeout( self.__handle, timeoutMsecs) _ExceptionUtil.raiseOnError(err) def setServiceDownloadTimeout(self, timeoutMsecs): - """Set the timeout, in milliseconds, when opening a service for + """ + Args: + timeoutMsecs (int): Timeout threshold in milliseconds + + Set the timeout, in milliseconds, when opening a service for downloading the service schema. The behavior is not defined unless the - specified 'timeoutMsecs' is a positive value. The default timeout - is 120,000 milliseconds.""" + specified ``timeoutMsecs`` is a positive value. The default timeout is + ``120,000`` milliseconds. + """ err = internals.blpapi_SessionOptions_setServiceDownloadTimeout( self.__handle, timeoutMsecs) _ExceptionUtil.raiseOnError(err) def setTlsOptions(self, tlsOptions): - """Set the TLS options""" + """Set the TLS options + + Args: + tlsOptions (TlsOptions): The TLS options + """ internals.blpapi_SessionOptions_setTlsOptions( self.__handle, get_handle(tlsOptions)) def serverHost(self): - """Return the server host option in this SessionOptions instance.""" + """ + Returns: + str: The server host option in this :class:`SessionOptions` + instance. + """ return internals.blpapi_SessionOptions_serverHost(self.__handle) def serverPort(self): - """Return the server port that this session connects to.""" + """ + Returns: + int: The server port that this session connects to. + """ return internals.blpapi_SessionOptions_serverPort(self.__handle) def numServerAddresses(self): - """Return the number of server addresses.""" + """ + Returns: + int: The number of server addresses. + """ return internals.blpapi_SessionOptions_numServerAddresses( self.__handle) def getServerAddress(self, index): - """Return tuple of the server name and port indexed by 'index'.""" + """ + Returns: + (str, int): Server name and port indexed by ``index``. + """ errorCode, host, port = \ internals.blpapi_SessionOptions_getServerAddress( @@ -395,7 +512,9 @@ def getServerAddress(self, index): return host, port def serverAddresses(self): - """Return an iterator over server addresses for this SessionOptions. + """ + Returns: + Iterator over server addresses for this :class:`SessionOptions`. """ return utils.Iterator(self, @@ -403,145 +522,175 @@ def serverAddresses(self): SessionOptions.getServerAddress) def connectTimeout(self): - """Return the value of the connection timeout option. - - Return the value of the connection timeout option in this - SessionOptions instance in milliseconds. - + """ + Returns: + int: The value of the connection timeout option. """ return internals.blpapi_SessionOptions_connectTimeout(self.__handle) def defaultServices(self): - """Return all default services in one string.""" + """ + Returns: + str: All default services in one string. + """ return internals.blpapi_SessionOptions_defaultServices(self.__handle) def defaultSubscriptionService(self): - """Return the default subscription service. - - Return the value of the default subscription service option in this - SessionOptions instance. - + """ + Returns: + str: The default subscription service. """ return internals.blpapi_SessionOptions_defaultSubscriptionService( self.__handle) def defaultTopicPrefix(self): - """Return the default topic prefix. - - Return the value of the default topic prefix option in this - SessionOptions instance. - + """ + Returns: + str: The default topic prefix. """ return internals.blpapi_SessionOptions_defaultTopicPrefix( self.__handle) def allowMultipleCorrelatorsPerMsg(self): - """Return the value of the allow multiple correlators per message. - - Return the value of the allow multiple correlators per message option - in this SessionOptions instance. - + """ + Returns: + bool: The value of the allow multiple correlators per message + option. """ return internals.blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg( self.__handle) != 0 def clientMode(self): - """Return the value of the client mode option. - - Return the value of the client mode option in this SessionOptions - instance. - + """ + Returns: + int: The value of the client mode option. """ return internals.blpapi_SessionOptions_clientMode(self.__handle) def maxPendingRequests(self): - """Return the value of the maximum pending request option. - - Return the value of the maximum pending request option in this - SessionOptions instance. - + """ + Returns: + int: The value of the maximum pending request option. """ return internals.blpapi_SessionOptions_maxPendingRequests( self.__handle) def autoRestartOnDisconnection(self): - """Return whether automatically restart connection if disconnected.""" + """ + Returns: + bool: Whether automatically restart connection if disconnected. + """ return internals.blpapi_SessionOptions_autoRestartOnDisconnection( self.__handle) != 0 def authenticationOptions(self): - """Return authentication options in a string.""" + """ + Returns: + str: Authentication options in a string. + """ return internals.blpapi_SessionOptions_authenticationOptions( self.__handle) def numStartAttempts(self): - """Return the maximum number of attempts to start a session. Return - the maximum number of attempts to start a session by connecting a - server. """ + """ + Returns: + int: The maximum number of attempts to start a session. + """ return internals.blpapi_SessionOptions_numStartAttempts(self.__handle) def recordSubscriptionDataReceiveTimes(self): - """Return whether the receipt time (accessed via - 'blpapi.Message.timeReceived') should be recorded for subscription data - messages.""" + """ + Returns: + bool: Whether the receipt time (accessed via + :meth:`Message.timeReceived()`) should be recorded for subscription + data messages. + """ return internals.blpapi_SessionOptions_recordSubscriptionDataReceiveTimes( self.__handle) def slowConsumerWarningHiWaterMark(self): - """Return the fraction of maxEventQueueSize at which "slow consumer" - event will be generated.""" + """ + Returns: + float: The fraction of :meth:`maxEventQueueSize()` at which "slow + consumer" event will be generated. + """ return internals.blpapi_SessionOptions_slowConsumerWarningHiWaterMark( self.__handle) def slowConsumerWarningLoWaterMark(self): - """Return the fraction of maxEventQueueSize at which "slow consumer - cleared" event will be generated.""" + """ + Returns: + float: The fraction of :meth:`maxEventQueueSize()` at which "slow + consumer cleared" event will be generated. + """ return internals.blpapi_SessionOptions_slowConsumerWarningLoWaterMark( self.__handle) def maxEventQueueSize(self): - """Return the value of maximum outstanding undelivered events that the - session is configured with.""" + """ + Returns: + int: The value of maximum outstanding undelivered events that the + session is configured with. + """ return internals.blpapi_SessionOptions_maxEventQueueSize(self.__handle) def defaultKeepAliveInactivityTime(self): - """Return the interval (in milliseconds) a connection has to remain - inactive (receive no data) before a keep alive probe will be sent.""" + """ + Returns: + int: The interval (in milliseconds) a connection has to remain + inactive (receive no data) before a keep alive probe will be sent. + """ return internals.blpapi_SessionOptions_defaultKeepAliveInactivityTime( self.__handle) def defaultKeepAliveResponseTimeout(self): - """Return the time (in milliseconds) the library will wait for response - to a keep alive probe before declaring it lost.""" + """ + Returns: + int: The time (in milliseconds) the library will wait for response + to a keep alive probe before declaring it lost. + """ return internals.blpapi_SessionOptions_defaultKeepAliveResponseTimeout( self.__handle) def flushPublishedEventsTimeout(self): - """Return the timeout, in milliseconds, for ProviderSession to flush - published events before stopping. The default value is 2000.""" + """ + Returns: + int: The timeout, in milliseconds, for :class:`ProviderSession` to + flush published events before stopping. The default value is + ``2000``. + """ return internals.blpapi_SessionOptions_flushPublishedEventsTimeout( self.__handle) def keepAliveEnabled(self): - """Return True if the keep-alive mechanism is enabled; otherwise - return False.""" + """ + Returns: + bool: ``True`` if the keep-alive mechanism is enabled; otherwise + return ``False``. + """ return internals.blpapi_SessionOptions_keepAliveEnabled(self.__handle) def serviceCheckTimeout(self): - """Return the value of the service check timeout option in this - SessionOptions instance in milliseconds.""" + """ + Returns: + int: The value of the service check timeout option in this + :class:`SessionOptions` instance in milliseconds. + """ return internals.blpapi_SessionOptions_serviceCheckTimeout( self.__handle) def serviceDownloadTimeout(self): - """Return the value of the service download timeout option in this - SessionOptions instance in milliseconds.""" + """ + Returns: + int: The value of the service download timeout option in this + :class:`SessionOptions` instance in milliseconds. + """ return internals.blpapi_SessionOptions_serviceDownloadTimeout( self.__handle) @@ -550,13 +699,19 @@ def _handle(self): return self.__handle def toString(self, level=0, spacesPerLevel=4): - """Format this SessionOptions to the string. + """Format this :class:`SessionOptions` to the string. + + Args: + level (int): Indentation level + spacesPerLevel (int): Number of spaces per indentation level for + this and all nested objects - You could optionally specify 'spacesPerLevel' - the number of spaces - per indentation level for this and all of its nested objects. If - 'level' is negative, suppress indentation of the first line. If - 'spacesPerLevel' is negative, format the entire output on one line, - suppressing all but the initial indentation (as governed by 'level'). + Returns: + str: This object formatted as a string + + If ``level`` is negative, suppress indentation of the first line. If + ``spacesPerLevel`` is negative, format the entire output on one line, + suppressing all but the initial indentation (as governed by ``level``). """ return internals.blpapi_SessionOptions_printHelper( self.__handle, @@ -566,16 +721,17 @@ def toString(self, level=0, spacesPerLevel=4): class TlsOptions(object): """SSL configuration options - TlsOptions instances maintain client credentials and trust material used - by a session to establish secure mutually authenticated connections to - endpoints. + :class:`TlsOptions` instances maintain client credentials and trust + material used by a session to establish secure mutually authenticated + connections to endpoints. The client credentials comprise an encrypted private key with a client certificate. The trust material comprises one or more certificates. - TlsOptions objects are created using 'createFromFiles' or 'createFromBlobs' - accepting the DER encoded client credentials in PKCS#12 format and the DER - encoded trusted material in PKCS#7 format.""" + :class:`TlsOptions` objects are created using :meth:`createFromFiles()` or + :meth:`createFromBlobs()` accepting the DER encoded client credentials in + PKCS#12 format and the DER encoded trusted material in PKCS#7 format. + """ def __init__(self, handle): self.__handle = handle @@ -587,6 +743,7 @@ def __del__(self): pass def destroy(self): + """Destructor.""" if self.__handle: internals.blpapi_TlsOptions_destroy(self.__handle) self.__handle = None @@ -595,16 +752,25 @@ def _handle(self): return self.__handle def setTlsHandshakeTimeoutMs(self, timeoutMs): - """Set the TLS handshake timeout to the specified - 'tlsHandshakeTimeoutMs'. The default is 10,000 milliseconds. - The TLS handshake timeout will be set to the default if - the specified 'tlsHandshakeTimeoutMs' is not positive.""" + """ + Args: + timeoutMs (int): Timeout threshold in milliseconds + + Set the TLS handshake timeout to the specified ``timeoutMs``. The + default is ``10,000`` milliseconds. The TLS handshake timeout will be + set to the default if the specified ``timeoutMs`` is not positive. + """ internals.blpapi_TlsOptions_setTlsHandshakeTimeoutMs(self.__handle, timeoutMs) def setCrlFetchTimeoutMs(self, timeoutMs): - """Set the CRL fetch timeout to the specified 'timeoutMs'. The default - is 20,000 milliseconds. The TLS handshake timeout will be set to the - default if the specified 'crlFetchTimeoutMs' is not positive.""" + """ + Args: + timeoutMs (int): Timeout threshold in milliseconds + + Set the CRL fetch timeout to the specified ``timeoutMs``. The default + is ``20,000`` milliseconds. The TLS handshake timeout will be set to + the default if the specified ``timeoutMs`` is not positive. + """ internals.blpapi_TlsOptions_setCrlFetchTimeoutMs( self.__handle, timeoutMs) @@ -612,9 +778,18 @@ def setCrlFetchTimeoutMs(self, timeoutMs): def createFromFiles(clientCredentialsFilename, clientCredentialsPassword, trustedCertificatesFilename): - """Creates a TlsOptions using a DER encoded client credentials in - PKCS#12 format and DER encoded trust material in PKCS#7 format from - the specified files""" + """ + Args: + clientCredentialsFilename (str): Path to the file with the client + credentials + clientCredentialsPassword (str): Password for the credentials + trustedCertificatesFilename (str): Path to the file with the + trusted certificates + + Creates a :class:`TlsOptions` using a DER encoded client credentials in + PKCS#12 format and DER encoded trust material in PKCS#7 format from the + specified files. + """ handle = internals.blpapi_TlsOptions_createFromFiles( clientCredentialsFilename, clientCredentialsPassword, @@ -625,12 +800,18 @@ def createFromFiles(clientCredentialsFilename, def createFromBlobs(clientCredentials, clientCredentialsPassword, trustedCertificates): - """Creates a TlsOptions using a DER encoded client credentials in - PKCS#12 format and DER encoded trust material in PKCS#7 format from - the given raw data. - The type of clientCredentials and trustedCertificates should be - either 'bytes' or 'bytearray'. - clientCredentialsPassword is a regular string.""" + """ + Args: + clientCredentials (bytes or bytearray): Blob with the client + credentials + clientCredentialsPassword (str): Password for the credentials + trustedCertificates (bytes or bytearray): Blob with the trusted + certificates + + Creates a :class:`TlsOptions` using a DER encoded client credentials in + PKCS#12 format and DER encoded trust material in PKCS#7 format from the + given raw data. + """ credentials = bytearray(clientCredentials) certs = bytearray(trustedCertificates) handle = internals.blpapi_TlsOptions_createFromBlobs( diff --git a/blpapi/subscriptionlist.py b/blpapi/subscriptionlist.py index ea12428..dd68f95 100644 --- a/blpapi/subscriptionlist.py +++ b/blpapi/subscriptionlist.py @@ -96,40 +96,45 @@ class SubscriptionList(object): Contains a list of subscriptions used when subscribing and unsubscribing. - A SubscriptionList is used when calling Session.subscribe(), - Session.resubscribe() and Session.unsubscribe(). The entries can be - constructed in a variety of ways. + A :class:`SubscriptionList` is used when calling + :meth:`Session.subscribe()`, :meth:`Session.resubscribe()` and + :meth:`Session.unsubscribe()`. The entries can be constructed in a variety + of ways. - The two important elements when creating a subscription are - : Subscription String: A subscription string represents a topic whose - : updates user is interested in. A subscription string follows a - : structure as specified below. - : CorrelationId: the unique identifier to tag all data associated with - : this subscription. + The two important elements when creating a subscription are: + + - Subscription string: A subscription string represents a topic whose + updates user is interested in. + - CorrelationId: the unique identifier to tag all data associated with this + subscription. The following table describes how various operations use the above - elements:: - - |-------------|--------------------------------------------------------| - | OPERATION | SUBSCRIPTION STRING | CORRELATION ID | - |-------------|-----------------------+--------------------------------| - | 'subscribe' |Used to specify the |Identifier for the subscription.| - | |topic to subscribe to. |If uninitialized correlationid | - | | |was specified an internally | - | | |generated correlationId will be | - | | |set for the subscription. | - |-------------+-----------------------+--------------------------------| - |'resubscribe'|Used to specify the new|Identifier of the subscription | - | |topic to which the |which needs to be modified. | - | |subscription should be | | - | |modified to. | | - |-------------+-----------------------+--------------------------------| - |'unsubscribe'| NOT USED |Identifier of the subscription | - | | |which needs to be canceled. | - |----------------------------------------------------------------------| + elements: + + +-------------+--------------------------+----------------------------+ + | OPERATION | SUBSCRIPTION STRING | CORRELATION ID | + +=============+==========================+============================+ + | subscribe | | Used to specify the | | Identifier for the | + | | | topic to subscribe to. | | subscription. If | + | | | | uninitialized | + | | | | correlationid was | + | | | | specified an internally | + | | | | generated correlationId | + | | | | will be set for the | + | | | | subscription. | + +-------------+--------------------------+----------------------------+ + | resubscribe | | Used to specify the new| | Identifier of the | + | | | topic to which the | | subscription which | + | | | subscription should be | | needs to be modified. | + | | | modified to. | | + +-------------+--------------------------+----------------------------+ + | unsubscribe | NOT USED | | Identifier of the | + | | | | subscription which | + | | | | needs to be canceled. | + +-------------+--------------------------+----------------------------+ """ def __init__(self): - """Create an empty SubscriptionList.""" + """Create an empty :class:`SubscriptionList`.""" self.__handle = internals.blpapi_SubscriptionList_create() def __del__(self): @@ -139,23 +144,31 @@ def __del__(self): pass def destroy(self): - """Destroy this SubscriptionList.""" + """Destroy this :class:`SubscriptionList`.""" if self.__handle: internals.blpapi_SubscriptionList_destroy(self.__handle) self.__handle = None def add(self, topic, fields=None, options=None, correlationId=None): - """Add the specified 'topic' to this SubscriptionList. - - Add the specified 'topic', with the optionally specified 'fields' and - the 'options' to this SubscriptionList, associating the optionally - specified 'correlationId' with it. The 'fields' must be represented as - a comma separated string or a list of strings, 'options' - as an - ampersand separated string or list of strings or a name=>value - dictionary. - - Note that in case of unsubscribe, you can pass empty string or None for - 'topic' + """Add the specified ``topic`` to this :class:`SubscriptionList`. + + Args: + topic (str): The topic to subscribe to + fields (str or [str]): List of fields to subscribe to + options (str or [str] or dict): List of options + correlationId (CorrelationId): Correlation id to associate with the + subscription + + Add the specified ``topic``, with the optionally specified ``fields`` + and the ``options`` to this :class:`SubscriptionList`, associating the + optionally specified ``correlationId`` with it. The ``fields`` must be + represented as a comma separated string or a list of strings, + ``options`` - as an ampersand separated string or list of strings or a + ``name -> value`` dictionary. + + Note: + In case of unsubscribe, you can pass empty string or ``None`` for + ``topic``. """ if correlationId is None: correlationId = CorrelationId() @@ -186,7 +199,12 @@ def add(self, topic, fields=None, options=None, correlationId=None): options) def append(self, other): - """Append a copy of the specified 'subscriptionList' to this list""" + """Append a copy of the specified :class:`SubscriptionList` to this + list. + + Args: + other (SubscriptionList): List to append to this one + """ return internals.blpapi_SubscriptionList_append( self.__handle, get_handle(other)) @@ -196,15 +214,22 @@ def clear(self): return internals.blpapi_SubscriptionList_clear(self.__handle) def size(self): - """Return the number of subscriptions in this object.""" + """ + Returns: + int: The number of subscriptions in this object. + """ return internals.blpapi_SubscriptionList_size(self.__handle) def correlationIdAt(self, index): - """Return the CorrelationId at the specified 'index'. + """ + Args: + index (int): Index of the entry in the list - Return the CorrelationId of the specified 'index'th entry - in this 'SubscriptionList' object. An exception is raised if - 'index >= size()'. + Returns: + CorrelationId: Correlation id of the ``index``\ th entry. + + Raises: + Exception: If ``index >= size()``. """ errorCode, cid = internals.blpapi_SubscriptionList_correlationIdAt( self.__handle, @@ -213,11 +238,15 @@ def correlationIdAt(self, index): return cid def topicStringAt(self, index): - """Return the full topic string at the specified 'index'. + """ + Args: + index (int): Index of the entry in the list - Return the full topic string (including any field and option portions) - of the specified 'index'th entry in this SubscriptionList. An exception - is raised if 'index >= size()'. + Returns: + str: The full topic string at the specified ``index``. + + Raises: + Exception: If ``index >= size()``. """ errorCode, topic = internals.blpapi_SubscriptionList_topicStringAt( self.__handle, @@ -226,26 +255,42 @@ def topicStringAt(self, index): return topic def addResolved(self, subscriptionString, correlationId=None): - """Add the specified 'subscriptionString' to this 'SubscriptionList' - object, associating the specified 'correlationId' with it. The - subscription string may include options. The behavior of this - function, and of functions operating on this 'SubscriptionList' object, - is undefined unless 'subscriptionString' is a fully-resolved - subscription string; clients that cannot provide fully-resolved - subscription strings should use 'SubscriptionList.add' instead. Note - that it is at the discretion of each function operating on a - 'SubscriptionList' whether to perform resolution on this - subscription.""" + """ + Args: + subscriptionString (str): Fully-resolved subscription string + correlationId (CorrelationId): Correlation id to associate with the + subscription + + Add the specified ``subscriptionString`` to this + :class:`SubscriptionList` object, associating the specified + ``correlationId`` with it. The subscription string may include + options. The behavior of this function, and of functions operating on + this :class:`SubscriptionList` object, is undefined unless + ``subscriptionString`` is a fully-resolved subscription string; clients + that cannot provide fully-resolved subscription strings should use + :meth:`add()` instead. + + Note: + It is at the discretion of each function operating on a + :class:`SubscriptionList` whether to perform resolution on this + subscription. + """ if correlationId is None: correlationId = internals.CorrelationId() return internals.blpapi_SubscriptionList_addResolved( self.__handle, subscriptionString, get_handle(correlationId)) def isResolvedTopicAt(self, index): - """Return 'true' if the 'index'th entry in this 'SubscriptionList' - object was created using 'SubscriptionList.addResolved' and 'false' if - it was created using 'SubscriptionList.add'. An exception is thrown - if 'index >= size()'.""" + """ + Args: + index (int): Index of the entry in the list + + Returns: + bool: ``True`` if the ``index``\ th entry in this + ``SubscriptionList`` object was created using :meth:`addResolved()` + and ``False`` if it was created using :meth:`add()`. An exception + is thrown if ``index >= size()``. + """ err, res = internals.blpapi_SubscriptionList_isResolvedAt( self.__handle, index) _ExceptionUtil.raiseOnError(err) diff --git a/blpapi/topic.py b/blpapi/topic.py index 9cdbfe0..4ae1901 100644 --- a/blpapi/topic.py +++ b/blpapi/topic.py @@ -14,17 +14,21 @@ class Topic(object): """Used to identify the stream on which a message is published. - Topic objects are obtained from 'createTopic()' on 'ProviderSession'. - They are used when adding a message to an Event for publishing using - 'appendMessage()' on 'EventFormatter'. + Topic objects are obtained from :meth:`~ProviderSession.createTopics()` on + :class:`ProviderSession`. They are used when adding a message to an Event + for publishing using :meth:`~EventFormatter.appendMessage()` on + :class:`EventFormatter`. """ def __init__(self, handle=None, sessions=None): - """Create a Topic object. + """Create a :class:`Topic` object. - Create a Topic object. A Topic created with 'handle' set to None is not - a valid topic and must be assigned to from a valid topic before it can - be used. + Args: + handle: Handle to the internal implementation + sessions: Sessions associated with this object + + A :class:`Topic` created with ``handle`` set to ``None`` is not a valid + topic and must be assigned to from a valid topic before it can be used. """ self.__handle = handle if handle is not None: @@ -38,31 +42,31 @@ def __del__(self): pass def destroy(self): - """Destroy this Topic object.""" + """Destroy this :class:`Topic` object.""" if self.__handle: internals.blpapi_Topic_destroy(self.__handle) self.__handle = None def isValid(self): - """Return True if this Topic is valid. - - Return True if this Topic is valid and can be used to publish - a message on. + """ + Returns: + bool: ``True`` if this :class:`Topic` is valid and can be used to + publish a message on. """ return self.__handle is not None def isActive(self): - """Return True if this topic is the primary publisher. - - Return True if this topic was elected by the platform to become the - primary publisher. + """ + Returns: + bool: ``True`` if this topic was elected by the platform to become + the primary publisher. """ return bool(internals.blpapi_Topic_isActive(self.__handle)) def service(self): - """Return the service for which this topic was created. - - Return the service for which this topic was created. + """ + Returns: + Service: The service for which this topic was created. """ return Service(internals.blpapi_Topic_service(self.__handle), self.__sessions) diff --git a/blpapi/topiclist.py b/blpapi/topiclist.py index 06f65de..0e2ed8c 100644 --- a/blpapi/topiclist.py +++ b/blpapi/topiclist.py @@ -22,10 +22,12 @@ class TopicList(object): Contains a list of topics which require creation. - Created from topic strings or from TOPIC_SUBSCRIBED or RESOLUTION_SUCCESS - messages. - This is passed to a 'createTopics()' call or 'createTopicsAsync()' call on a - ProviderSession. It is updated and returned by the 'createTopics()' call. + Created from topic strings or from ``TOPIC_SUBSCRIBED`` or + ``RESOLUTION_SUCCESS`` messages. This is passed to a + :meth:`~ProviderSession.createTopics()` call or + :meth:`~ProviderSession.createTopicsAsync()` call on a + :class:`ProviderSession`. It is updated and returned by the + :meth:`~ProviderSession.createTopics()` call. """ NOT_CREATED = internals.TOPICLIST_NOT_CREATED @@ -33,10 +35,14 @@ class TopicList(object): FAILURE = internals.TOPICLIST_FAILURE def __init__(self, original=None): - """Create an empty TopicList or TopicList based on 'original'. + """Create an empty :class:`TopicList`, or a :class:`TopicList` based on + ``original``. - If 'original' is None - create empty TopicList. Otherwise create a - TopicList from 'original'. + Args: + original (TopicList): Original topiclist to copy off of + + If ``original`` is ``None`` - create empty :class:`TopicList`. + Otherwise create a :class:`TopicList` from ``original``. """ if isinstance(original, ResolutionList): self.__handle = \ @@ -54,24 +60,37 @@ def __del__(self): pass def destroy(self): - """Destroy this TopicList.""" + """Destroy this :class:`TopicList`.""" if self.__handle: internals.blpapi_TopicList_destroy(self.__handle) self.__handle = None def add(self, topicOrMessage, correlationId=None): - """Add the specified topic or topic from message to this TopicList. - - If topic is passed as 'topicOrMessage', add the topic to this list, - optionally specifying a 'correlationId'. Return 0 on success or - negative number on failure. After a successful call to 'add()' the - status for this entry is NOT_CREATED. - - If Message is passed as 'topicOrMessage', add the topic contained in - the specified 'topicSubscribedMessage' or 'resolutionSuccessMessage' to - this list, optionally specifying a 'correlationId'. Return 0 on - success or a negative number on failure. After a successful call to - 'add()' the status for this entry is NOT_CREATED. + """Add the specified topic or topic from message to this + :class:`TopicList`. + + Args: + topicOrMessage (str or Message): Topic string or message to create + a topic from + correlationId (CorrelationId): CorrelationId to associate with the + topic + + Returns: + int: ``0`` on success or negative number on failure. + + Raises: + TypeError: If ``correlationId`` is not an instance of + :class:`CorrelationId`. + + If topic is passed as ``topicOrMessage``, add the topic to this list, + optionally specifying a ``correlationId``. After a successful call to + :meth:`add()` the status for this entry is ``NOT_CREATED``. + + If :class:`Message` is passed as ``topicOrMessage``, add the topic + contained in the specified ``topicSubscribedMessage`` or + ``resolutionSuccessMessage`` to this list, optionally specifying a + ``correlationId``. After a successful call to :meth:`add()` the status + for this entry is ``NOT_CREATED``. """ if correlationId is None: correlationId = CorrelationId() @@ -89,10 +108,15 @@ def add(self, topicOrMessage, correlationId=None): get_handle(correlationId)) def correlationIdAt(self, index): - """Return the CorrelationId at the specified 'index'. + """ + Args: + index (int): Index of the entry in the list + + Returns: + CorrelationId: Correlation id of the ``index``\ th entry. - Return the CorrelationId of the specified 'index'th entry - in this TopicList. An exception is raised if 'index'>=size(). + Raises: + Exception: If ``index >= size()``. """ errorCode, cid = internals.blpapi_TopicList_correlationIdAt( self.__handle, @@ -101,11 +125,17 @@ def correlationIdAt(self, index): return cid def topicString(self, correlationId): - """Return the topic of the entry identified by 'correlationId'. + """ + Args: + correlationId (CorrelationId): Correlation id associated with the + topic. + + Returns: + str: Topic of the entry identified by 'correlationId'. - Return the topic of the entry identified by 'correlationId'. If the - 'correlationId' does not identify an entry in this TopicList then an - exception is raised. + Raises: + Exception: If the ``correlationId`` does not identify an entry in + this list. """ errorCode, topic = internals.blpapi_TopicList_topicString( self.__handle, @@ -114,10 +144,16 @@ def topicString(self, correlationId): return topic def topicStringAt(self, index): - """Return the full topic string at the specified 'index'. + """ + Args: + index (int): Index of the entry + + Returns: + str: The full topic string of the ``index``\ th entry in this + list. - Return the full topic string of the specified 'index'th entry in this - TopicList. An exception is raised if 'index'>=size(). + Raises: + Exception: If ``index >= size()``. """ errorCode, topic = internals.blpapi_TopicList_topicStringAt( self.__handle, @@ -126,12 +162,19 @@ def topicStringAt(self, index): return topic def status(self, correlationId): - """Return the status of the entry identified by 'correlationId'. - - Return the status of the entry in this TopicList identified by the - specified 'correlationId'. This may be NOT_CREATED, CREATED and - FAILURE. If the 'correlationId' does not identify an entry in this - TopicList then an exception is raised. + """ + Args: + correlationId (CorrelationId): Correlation id associated with the + entry + + Returns: + int: Status of the entry in this list identified by the + specified ``correlationId``. This may be :attr:`NOT_CREATED`, + :attr:`CREATED` and :attr:`FAILURE`. + + Raises: + Exception: If the ``correlationId`` does not identify an entry in + this list. """ errorCode, status = internals.blpapi_TopicList_status( self.__handle, @@ -140,11 +183,16 @@ def status(self, correlationId): return status def statusAt(self, index): - """Return the status at the specified 'index'. + """ + Args: + index (int): Index of the entry + + Returns: + int: Status of the ``index``\ th entry in this list. This may be + :attr:`NOT_CREATED`, :attr:`CREATED` and :attr:`FAILURE`. - Return the status of the specified 'index'th entry in this TopicList. - This may be NOT_CREATED, CREATED and FAILURE. - An exception is raised if 'index'>=size(). + Raises: + Exception: If ``index >= size()``. """ errorCode, status = internals.blpapi_TopicList_statusAt( self.__handle, @@ -153,15 +201,22 @@ def statusAt(self, index): return status def message(self, correlationId): - """Return the message identified by 'correlationId'. + """ + Args: + correlationId (CorrelationId): Correlation id associated with the + message + + Returns: + Message: Message received during creation of the topic identified + by the specified ``correlationId``. - Return the value of the message received during creation of the - topic identified by the specified 'correlationId'. If 'correlationId' - does not identify an entry in this TopicList or if the status of the - entry identify by 'correlationId' is not CREATED an exception is - raised. + Raises: + Exception: If ``correlationId`` does not identify an entry in this + :class:`TopicList` or if the status of the entry identified by + ``correlationId`` is not :attr:`CREATED`. - The message returned can be used when creating an instance of Topic. + The message returned can be used when creating an instance of + :class:`Topic`. """ errorCode, message = internals.blpapi_TopicList_message( self.__handle, @@ -170,14 +225,20 @@ def message(self, correlationId): return Message(message, sessions=self.__sessions) def messageAt(self, index): - """Return the message received during creation of entry at 'index'. + """ + Args: + index (int): Index of the entry + + Returns: + Message: Message received during creation of the entry at + ``index``. - Return the value of the message received during creation of the - specified 'index'th entry in this TopicList. If 'index' >= size() or if - the status of the 'index'th entry is not CREATED an exception is - raised. + Raises: + Exception: If ``index >= size()`` or if the status of the entry + identify by ``correlationId`` is not :attr:`CREATED`. - The message returned can be used when creating an instance of Topic. + The message returned can be used when creating an instance of + :class:`Topic`. """ errorCode, message = internals.blpapi_TopicList_messageAt( self.__handle, @@ -186,7 +247,7 @@ def messageAt(self, index): return Message(message, sessions=self.__sessions) def size(self): - """Return the number of entries in this TopicList.""" + """Return the number of entries in this :class:`TopicList`.""" return internals.blpapi_TopicList_size(self.__handle) def _handle(self): diff --git a/blpapi/version.py b/blpapi/version.py index 6219279..58a91cb 100644 --- a/blpapi/version.py +++ b/blpapi/version.py @@ -5,19 +5,25 @@ from __future__ import print_function from . import versionhelper -__version__ = "3.13.0" +__version__ = "3.13.1" def print_version(): - "Print version information of BLPAPI python module and blpapi C++ SDK" + """Print version information of BLPAPI python module and blpapi C++ SDK""" print("Python BLPAPI SDK version: ", version()) print("C++ BLPAPI SDK version: ", cpp_sdk_version()) def version(): - "Return BLPAPI Python module version" + """ + Returns: + str: BLPAPI Python module version + """ return __version__ def cpp_sdk_version(): - "Return BLPAPI C++ SDK dependency version" + """ + Returns: + str: BLPAPI C++ SDK dependency version + """ version_string = ".".join(map(str, versionhelper.blpapi_getVersionInfo())) commit_id = versionhelper.blpapi_getVersionIdentifier() diff --git a/blpapi/zfputil.py b/blpapi/zfputil.py index 846f2f6..4bd1e44 100644 --- a/blpapi/zfputil.py +++ b/blpapi/zfputil.py @@ -32,20 +32,49 @@ @with_metaclass(utils.MetaClassForClassesWithEnums) class ZfpUtil(object): - """Wrapper for Zero Footprint utilities""" + """Utility used to prepare :class:`SessionOptions` for private leased + lines. + + The following snippet shows how to use :class:`ZfpUtil` to start a + ``Session``:: + + tlsOptions = blpapi.TlsOptions.createFromFiles( ... ) + sessionOptions = blpapi.ZfpUtil.getZfpOptionsForLeasedLines( + blpapi.ZfpUtil.REMOTE_8194, + tlsOptions) + + sessionOptions.setAuthenticationOptions( ... ) + + session = blpapi.Session(sessionOptions) + session.start() + """ REMOTE_8194 = internals.ZFPUTIL_REMOTE_8194 REMOTE_8196 = internals.ZFPUTIL_REMOTE_8196 @staticmethod def getZfpOptionsForLeasedLines(remote, tlsOptions): - """Creates a SessionOptions object for applications that leverages - private leased lines to Bloomberg network. The SessionOptions - object is only valid for private leased line connectivity. On failure - (e.g. connectivity issues), an exception is raised. + """Creates a :class:`SessionOptions` object for applications that + leverage private leased lines to the Bloomberg network. + + Args: + remote (int): Type of the remote to connect to + tlsOptions (TlsOptions): Tls options to use when connecting + + Returns: + SessionOptions: :class:`SessionOptions` object for applications + that leverage private leased lines to the Bloomberg network. + + Raises: + Exception: If failed to obtain the session options + + Note: + The :class:`SessionOptions` object is only valid for private leased + line connectivity. - This is a costly operation that is preferably called once per - application. + Note: + This is a costly operation that is preferably called once per + application. """ sessionOptions = SessionOptions() err = internals.blpapi_ZfpUtil_getOptionsForLeasedLines( diff --git a/changelog.txt b/changelog.txt index d2570c8..fcabf23 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,13 @@ +Version 3.13.1: +=============== +- Conversions to string using print helpers ignore null-terminators + Previously, when converting an e.g., Element to string explicitly, + or when printing it, null-terminators embedded in strings + would cause the resulting string to be truncated to the first one. + +- Format docstrings to be rendered by the Sphinx documentation generator +- Stability and performance improvements + Version 3.13.0: =============== - Automated network configuration for ZFP over leased lines @@ -45,7 +55,7 @@ Version 3.11.0: Version 3.10.0: =============== - Documentation change - Clarify the meaning of integer priorities in 'ProviderSession'. Greater + Clarify the meaning of integer priorities in 'ProviderSession'. Greater values indicate higher priorities. - Add support for 3.10 features diff --git a/examples/MktdataPublisher.py b/examples/MktdataPublisher.py index 180c76e..4afe535 100644 --- a/examples/MktdataPublisher.py +++ b/examples/MktdataPublisher.py @@ -77,7 +77,7 @@ def fillDataNull(self, eventFormatter, elementDef): # Publishing NULL value eventFormatter.setElementNull(f) - def __next__(self): + def next(self): self.lastValue += 1 def isAvailable(self): @@ -593,7 +593,7 @@ def main(): stream.fillDataNull(eventFormatter, elementDef) else: eventCount += 1 - next(stream) + stream.next() stream.fillData(eventFormatter, elementDef) for msg in event: diff --git a/setup.py b/setup.py index 2dab434..1ded0a4 100644 --- a/setup.py +++ b/setup.py @@ -46,6 +46,7 @@ def find_version_number(): else: blpapiLibraryName = 'blpapi3_32' +extraLinkArgs = [] if platform == 'windows': blpapiLibraryPath = os.path.join(blpapiRoot, 'lib') extraLinkArgs = ['/MANIFEST'] @@ -58,10 +59,14 @@ def find_version_number(): os.environ['VS90COMNTOOLS'] = os.environ['VS100COMNTOOLS'] elif platform == 'linux': blpapiLibraryPath = os.path.join(blpapiRoot, 'Linux') - extraLinkArgs = [] +elif platform == 'sunos': + lib = "lib64" if is64bit else "lib" + blpapiLibraryPath = os.path.join(blpapiRoot, lib) +elif platform == 'aix': + lib = "lib64" if is64bit else "lib" + blpapiLibraryPath = os.path.join(blpapiRoot, lib) elif platform == 'darwin': blpapiLibraryPath = os.path.join(blpapiRoot, 'Darwin') - extraLinkArgs = [] else: raise Exception("Platform '" + platform + "' isn't supported") From 8242b2ee8e30f537a79bc5829968199b04873a72 Mon Sep 17 00:00:00 2001 From: Marland Sitt Date: Mon, 25 May 2020 07:59:51 -0700 Subject: [PATCH 04/23] Bump to v3.14.0 --- PKG-INFO | 2 +- blpapi/internals.py | 8 +++++ blpapi/internals_wrap.c | 67 +++++++++++++++++++++++++++++++++++++ blpapi/sessionoptions.py | 19 +++++++++++ blpapi/version.py | 2 +- blpapi/versionhelper_wrap.c | 4 +++ changelog.txt | 9 +++++ 7 files changed, 109 insertions(+), 2 deletions(-) diff --git a/PKG-INFO b/PKG-INFO index 1210ae8..3e49769 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: blpapi -Version: 3.13.1 +Version: 3.14.0 Summary: Python SDK for Bloomberg BLPAPI Home-page: http://www.bloomberglabs.com/api/ Author: Bloomberg L.P. diff --git a/blpapi/internals.py b/blpapi/internals.py index f7c25f9..1060cc8 100644 --- a/blpapi/internals.py +++ b/blpapi/internals.py @@ -993,6 +993,10 @@ def blpapi_SessionOptions_setFlushPublishedEventsTimeout(paramaters, timeoutMsec return _internals.blpapi_SessionOptions_setFlushPublishedEventsTimeout(paramaters, timeoutMsecs) blpapi_SessionOptions_setFlushPublishedEventsTimeout = _internals.blpapi_SessionOptions_setFlushPublishedEventsTimeout +def blpapi_SessionOptions_setBandwidthSaveModeDisabled(parameters, disableBandwidthSaveMode): + return _internals.blpapi_SessionOptions_setBandwidthSaveModeDisabled(parameters, disableBandwidthSaveMode) +blpapi_SessionOptions_setBandwidthSaveModeDisabled = _internals.blpapi_SessionOptions_setBandwidthSaveModeDisabled + def blpapi_SessionOptions_serverHost(parameters): return _internals.blpapi_SessionOptions_serverHost(parameters) blpapi_SessionOptions_serverHost = _internals.blpapi_SessionOptions_serverHost @@ -1089,6 +1093,10 @@ def blpapi_SessionOptions_flushPublishedEventsTimeout(parameters): return _internals.blpapi_SessionOptions_flushPublishedEventsTimeout(parameters) blpapi_SessionOptions_flushPublishedEventsTimeout = _internals.blpapi_SessionOptions_flushPublishedEventsTimeout +def blpapi_SessionOptions_bandwidthSaveModeDisabled(parameters): + return _internals.blpapi_SessionOptions_bandwidthSaveModeDisabled(parameters) +blpapi_SessionOptions_bandwidthSaveModeDisabled = _internals.blpapi_SessionOptions_bandwidthSaveModeDisabled + def blpapi_TlsOptions_destroy(parameters): return _internals.blpapi_TlsOptions_destroy(parameters) blpapi_TlsOptions_destroy = _internals.blpapi_TlsOptions_destroy diff --git a/blpapi/internals_wrap.c b/blpapi/internals_wrap.c index df0a829..675b57e 100644 --- a/blpapi/internals_wrap.c +++ b/blpapi/internals_wrap.c @@ -419,6 +419,7 @@ SWIG_TypeCheck(const char *c, swig_type_info *ty) { swig_cast_info *iter = ty->cast; while (iter) { if (strcmp(iter->type->name, c) == 0) { +#if 0 if (iter == ty->cast) return iter; /* Move iter to the top of the linked list */ @@ -429,6 +430,7 @@ SWIG_TypeCheck(const char *c, swig_type_info *ty) { iter->prev = 0; if (ty->cast) ty->cast->prev = iter; ty->cast = iter; +#endif return iter; } iter = iter->next; @@ -446,6 +448,7 @@ SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) { swig_cast_info *iter = ty->cast; while (iter) { if (iter->type == from) { +#if 0 if (iter == ty->cast) return iter; /* Move iter to the top of the linked list */ @@ -456,6 +459,7 @@ SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) { iter->prev = 0; if (ty->cast) ty->cast->prev = iter; ty->cast = iter; +#endif return iter; } iter = iter->next; @@ -10335,6 +10339,41 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setFlushPublishedEventsTimeout( } +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setBandwidthSaveModeDisabled(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setBandwidthSaveModeDisabled",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setBandwidthSaveModeDisabled" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setBandwidthSaveModeDisabled" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_setBandwidthSaveModeDisabled(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_serverHost(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; @@ -10978,6 +11017,32 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_flushPublishedEventsTimeout(PyO } +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_bandwidthSaveModeDisabled(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_bandwidthSaveModeDisabled",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_bandwidthSaveModeDisabled" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_bandwidthSaveModeDisabled(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_TlsOptions_t *arg1 = (blpapi_TlsOptions_t *) 0 ; @@ -19362,6 +19427,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"blpapi_SessionOptions_setServiceDownloadTimeout", _wrap_blpapi_SessionOptions_setServiceDownloadTimeout, METH_VARARGS, NULL}, { (char *)"blpapi_SessionOptions_setTlsOptions", _wrap_blpapi_SessionOptions_setTlsOptions, METH_VARARGS, NULL}, { (char *)"blpapi_SessionOptions_setFlushPublishedEventsTimeout", _wrap_blpapi_SessionOptions_setFlushPublishedEventsTimeout, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_setBandwidthSaveModeDisabled", _wrap_blpapi_SessionOptions_setBandwidthSaveModeDisabled, METH_VARARGS, NULL}, { (char *)"blpapi_SessionOptions_serverHost", _wrap_blpapi_SessionOptions_serverHost, METH_VARARGS, NULL}, { (char *)"blpapi_SessionOptions_serverPort", _wrap_blpapi_SessionOptions_serverPort, METH_VARARGS, NULL}, { (char *)"blpapi_SessionOptions_numServerAddresses", _wrap_blpapi_SessionOptions_numServerAddresses, METH_VARARGS, NULL}, @@ -19386,6 +19452,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"blpapi_SessionOptions_serviceCheckTimeout", _wrap_blpapi_SessionOptions_serviceCheckTimeout, METH_VARARGS, NULL}, { (char *)"blpapi_SessionOptions_serviceDownloadTimeout", _wrap_blpapi_SessionOptions_serviceDownloadTimeout, METH_VARARGS, NULL}, { (char *)"blpapi_SessionOptions_flushPublishedEventsTimeout", _wrap_blpapi_SessionOptions_flushPublishedEventsTimeout, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_bandwidthSaveModeDisabled", _wrap_blpapi_SessionOptions_bandwidthSaveModeDisabled, METH_VARARGS, NULL}, { (char *)"blpapi_TlsOptions_destroy", _wrap_blpapi_TlsOptions_destroy, METH_VARARGS, NULL}, { (char *)"blpapi_TlsOptions_createFromFiles", _wrap_blpapi_TlsOptions_createFromFiles, METH_VARARGS, NULL}, { (char *)"blpapi_TlsOptions_createFromBlobs", _wrap_blpapi_TlsOptions_createFromBlobs, METH_VARARGS, NULL}, diff --git a/blpapi/sessionoptions.py b/blpapi/sessionoptions.py index 9fa69e2..c7b668e 100644 --- a/blpapi/sessionoptions.py +++ b/blpapi/sessionoptions.py @@ -470,6 +470,17 @@ def setTlsOptions(self, tlsOptions): self.__handle, get_handle(tlsOptions)) + def setBandwidthSaveModeDisabled(self, isDisabled): + """Specify whether to disable bandwidth saving measures. + + Args: + isDisabled (bool): Whether to disable bandwidth saving measures. + """ + _ExceptionUtil.raiseOnError( + internals.blpapi_SessionOptions_setBandwidthSaveModeDisabled( + self.__handle, + isDisabled)) + def serverHost(self): """ Returns: @@ -694,6 +705,14 @@ def serviceDownloadTimeout(self): return internals.blpapi_SessionOptions_serviceDownloadTimeout( self.__handle) + def bandwidthSaveModeDisabled(self): + """ + Returns: + bool: Whether bandwidth saving measures are disabled. + """ + return bool(internals.blpapi_SessionOptions_bandwidthSaveModeDisabled( + self.__handle)) + def _handle(self): """Return the internal implementation.""" return self.__handle diff --git a/blpapi/version.py b/blpapi/version.py index 58a91cb..8410ddd 100644 --- a/blpapi/version.py +++ b/blpapi/version.py @@ -5,7 +5,7 @@ from __future__ import print_function from . import versionhelper -__version__ = "3.13.1" +__version__ = "3.14.0" def print_version(): """Print version information of BLPAPI python module and blpapi C++ SDK""" diff --git a/blpapi/versionhelper_wrap.c b/blpapi/versionhelper_wrap.c index ff83a78..ce020cf 100644 --- a/blpapi/versionhelper_wrap.c +++ b/blpapi/versionhelper_wrap.c @@ -419,6 +419,7 @@ SWIG_TypeCheck(const char *c, swig_type_info *ty) { swig_cast_info *iter = ty->cast; while (iter) { if (strcmp(iter->type->name, c) == 0) { +#if 0 if (iter == ty->cast) return iter; /* Move iter to the top of the linked list */ @@ -429,6 +430,7 @@ SWIG_TypeCheck(const char *c, swig_type_info *ty) { iter->prev = 0; if (ty->cast) ty->cast->prev = iter; ty->cast = iter; +#endif return iter; } iter = iter->next; @@ -446,6 +448,7 @@ SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) { swig_cast_info *iter = ty->cast; while (iter) { if (iter->type == from) { +#if 0 if (iter == ty->cast) return iter; /* Move iter to the top of the linked list */ @@ -456,6 +459,7 @@ SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) { iter->prev = 0; if (ty->cast) ty->cast->prev = iter; ty->cast = iter; +#endif return iter; } iter = iter->next; diff --git a/changelog.txt b/changelog.txt index fcabf23..08cbea4 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,12 @@ +Version 3.14.0: +=============== +- Improved usage of network bandwidth for snapshot requests + Optimized the network bandwidth usage between endpoints and Bloomberg data + centers for snapshot requests. Customers can request to disable the + optimization by setting the 'bandwidthSaveModeDisabled' session option. + +- Stability and performance improvements + Version 3.13.1: =============== - Conversions to string using print helpers ignore null-terminators From 5ac3d27a9ccb887d2a8d6918d41287fb7248a07d Mon Sep 17 00:00:00 2001 From: Marland Sitt Date: Wed, 9 Dec 2020 08:17:10 -0800 Subject: [PATCH 05/23] Bump to v3.15.2 --- PKG-INFO | 2 +- blpapi/__init__.py | 1 + blpapi/abstractsession.py | 66 +- blpapi/auth.py | 236 + blpapi/datetime.py | 40 +- blpapi/debug.py | 13 +- blpapi/debug_environment.py | 35 +- blpapi/element.py | 4 +- blpapi/eventformatter.py | 4 +- blpapi/internals.py | 152 +- blpapi/internals_wrap.c | 1388 +- blpapi/internals_wrap.cxx | 26590 ------------------------- blpapi/message.py | 20 + blpapi/providersession.py | 30 +- blpapi/service.py | 9 +- blpapi/session.py | 27 +- blpapi/sessionoptions.py | 56 +- blpapi/version.py | 2 +- blpapi/versionhelper_wrap.cxx | 4024 ---- changelog.txt | 42 + examples/ConnectionAndAuthExample.py | 243 + examples/SessionIdentityExample.py | 144 + setup.py | 32 +- 23 files changed, 2196 insertions(+), 30964 deletions(-) create mode 100644 blpapi/auth.py delete mode 100644 blpapi/internals_wrap.cxx delete mode 100644 blpapi/versionhelper_wrap.cxx create mode 100644 examples/ConnectionAndAuthExample.py create mode 100644 examples/SessionIdentityExample.py diff --git a/PKG-INFO b/PKG-INFO index 3e49769..fe60dc0 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: blpapi -Version: 3.14.0 +Version: 3.15.2 Summary: Python SDK for Bloomberg BLPAPI Home-page: http://www.bloomberglabs.com/api/ Author: Bloomberg L.P. diff --git a/blpapi/__init__.py b/blpapi/__init__.py index 93c25df..fd6d681 100644 --- a/blpapi/__init__.py +++ b/blpapi/__init__.py @@ -11,6 +11,7 @@ raise debug_load_error(error) from .abstractsession import AbstractSession +from .auth import AuthOptions, AuthUser from .constant import Constant, ConstantList from .datatype import DataType from .datetime import FixedOffset diff --git a/blpapi/abstractsession.py b/blpapi/abstractsession.py index b251a10..801eb5f 100644 --- a/blpapi/abstractsession.py +++ b/blpapi/abstractsession.py @@ -204,7 +204,7 @@ def sendAuthorizationRequest(self, re-used. The ``identity`` supplied must have been returned from this Session's - :meth:`createIdentity()` method. + :meth:`createIdentity()` method and must not be the session identity. """ if correlationId is None: @@ -333,11 +333,73 @@ def createIdentity(self): internals.blpapi_AbstractSession_createIdentity(self.__handle), self) + def generateAuthorizedIdentity(self, + authOptions, + correlationId=None): + """Generates an authorized :class:`Identity` with the specified + ``authOptions`` and ``correlationId``. + + Args: + authOptions (AuthOptions): Used to generate the :class:`Identity`. + correlationId (CorrelationId): Optional. Will identify the messages + associated with the generated :class:`Identity`. + Returns: + CorrelationId: Identifies the aforementioned events and the + generated :class:`Identity`. + + If this is an asynchronous session then an :class:`Event` may be + delivered to the registered ``EventHandler`` before + :meth:`generateAuthorizedIdentity()` has returned. + + One or more :attr:`Event.AUTHORIZATION_STATUS` events, zero or more + :attr:`Event.TOKEN_STATUS` events, and zero or more + :attr:`Event.SERVICE_STATUS` events are generated. + + The behavior is undefined if either ``authOptions`` or + ``correlationId`` is ``None``. + """ + if correlationId is None: + correlationId = CorrelationId() + retcode = internals \ + .blpapi_AbstractSession_generateAuthorizedIdentityAsync( + self.__handle, + get_handle(authOptions), + get_handle(correlationId)) + _ExceptionUtil.raiseOnError(retcode) + return correlationId + + def getAuthorizedIdentity(self, correlationId=None): + """Returns the authorized :class:`Identity` associated with + ``correlationId``. If ``correlationId`` is not given, returns the + session identity. + + Args: + correlationId (CorrelationId): Optional. Associated with an + :class:`Identity`. + + Returns: + Identity: the :class:`Identity` associated with ``correlationId``. + + Raises: + NotFoundException: If there is no :class:`Identity` associated + with ``correlationId``, if the associated :class:`Identity` is + not authorized, or if ``correlationId`` is not given and the + session identity is not authorized. + """ + if correlationId is None: + correlationId = CorrelationId() + retcode, identity_handle = internals \ + .blpapi_AbstractSession_getAuthorizedIdentity( + self.__handle, + get_handle(correlationId)) + _ExceptionUtil.raiseOnError(retcode) + return Identity(identity_handle, self) + # Protect enumeration constant(s) defined in this class and in classes # derived from this class from changes: __copyright__ = """ -Copyright 2012. Bloomberg Finance L.P. +Copyright 2019. Bloomberg Finance L.P. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/blpapi/auth.py b/blpapi/auth.py new file mode 100644 index 0000000..a52c23d --- /dev/null +++ b/blpapi/auth.py @@ -0,0 +1,236 @@ +# auth.py + +"""Provide a configuration to specify the settings used for authorization.""" + +from blpapi import internals +from blpapi.utils import get_handle +from blpapi.exception import _ExceptionUtil + + +class AuthOptions: + """Defines the authorization options which the user can set on + :class:`SessionOptions` as the authorization options for the session + identity or use to authorize other identities. + """ + + def __init__(self, handle, **kwargs): + """For internal use only.""" + self.__handle = handle + self.__app_handle = kwargs.get("app_handle") + self.__token_handle = kwargs.get("token_handle") + + @classmethod + def createWithUser(cls, user): + """Creates an :class:`AuthOptions` instance for User Mode with the + Operating System Login (Domain/User), Active Directory, or Email. + + Args: + user (AuthUser): user-specific authorization option. + Returns: + AuthOptions: Specifies User Mode with the Operating System Login + (Domain/User), Active Directory, or Email. + + The behavior is undefined when ``user`` was created with + :meth:`AuthUser.createWithManualOptions` or is ``None``. + """ + retcode, authOptions_handle = internals \ + .blpapi_AuthOptions_create_forUserMode(get_handle(user)) + _ExceptionUtil.raiseOnError(retcode) + return cls(authOptions_handle) + + @classmethod + def createWithApp(cls, appName): + """Create an :class:`AuthOptions` instance for Application Mode. + + Args: + appName (str): app name used for Application Mode. + + Returns: + AuthOptions: Specifies Application Mode. + + The behavior is undefined when ``appName`` is ``None`` or ``""``. + """ + app_handle = AuthOptions._create_app_handle(appName) + retcode, authOptions_handle = internals \ + .blpapi_AuthOptions_create_forAppMode(app_handle) + _ExceptionUtil.raiseOnError(retcode) + return cls(authOptions_handle, app_handle=app_handle) + + @classmethod + def createWithToken(cls, token): + """Create an :class:`AuthOptions` instance for Manual Token Mode. + + Args: + token (str): token to use for Manual Token Mode. + + Returns: + AuthOptions: Specifies Manual Token Mode. + + The behavior is undefined when ``token`` is ``None`` or ``""``. + """ + token_handle = AuthOptions._create_token_handle(token) + retcode, authOptions_handle = internals \ + .blpapi_AuthOptions_create_forToken(token_handle) + _ExceptionUtil.raiseOnError(retcode) + return cls(authOptions_handle, token_handle=token_handle) + + @classmethod + def createWithUserAndApp(cls, user, appName): + """Create an :class:`AuthOptions` instance for User and Application + Mode. + + Args: + user (AuthUser): user-specific authorization option. + appName (str): app name used for Application Mode. + + Returns: + AuthOptions: an :class:`AuthOptions` that contains the + authorization option for the User+Application authorization + mode. + + The behavior is undefined when ``appName`` is ``None`` or ``""``. + """ + app_handle = AuthOptions._create_app_handle(appName) + retcode, authOptions_handle = internals \ + .blpapi_AuthOptions_create_forUserAndAppMode(get_handle(user), + app_handle) + _ExceptionUtil.raiseOnError(retcode) + return cls(authOptions_handle, app_handle=app_handle) + + def __del__(self): + try: + self.destroy() + except (NameError, AttributeError): + pass + + def destroy(self): + """Destroy this :class:`AuthOptions`.""" + if self.__handle: + internals.blpapi_AuthOptions_destroy(self.__handle) + self.__handle = None + if self.__app_handle: + internals.blpapi_AuthApplication_destroy(self.__app_handle) + self.__app_handle = None + if self.__token_handle: + internals.blpapi_AuthToken_destroy(self.__token_handle) + self.__token_handle = None + + def _handle(self): + """For internal use only.""" + return self.__handle + + @staticmethod + def _create_app_handle(appName): + """For internal use only.""" + retcode, app_handle = internals \ + .blpapi_AuthApplication_create(appName) + _ExceptionUtil.raiseOnError(retcode) + return app_handle + + @staticmethod + def _create_token_handle(token): + """For internal use only.""" + retcode, token_handle = internals \ + .blpapi_AuthToken_create(token) + _ExceptionUtil.raiseOnError(retcode) + return token_handle + + +class AuthUser: + """Contains user-specific authorization options.""" + + def __init__(self, handle): + """For internal use only.""" + self.__handle = handle + + def __del__(self): + try: + self.destroy() + except (NameError, AttributeError): + pass + + def destroy(self): + """Destroy this :class:`AuthUser`.""" + if self.__handle: + internals.blpapi_AuthUser_destroy(self.__handle) + self.__handle = None + + @classmethod + def createWithLogonName(cls): + """Creates an :class:`AuthUser` instance configured for Operating + System Login (Domain/User) authorization mode (OS_LOGON). + + Returns: + AuthUser: Configured for Operating System Login (Domain/User) mode. + """ + retcode, handle = internals \ + .blpapi_AuthUser_createWithLogonName() + _ExceptionUtil.raiseOnError(retcode) + return cls(handle) + + @classmethod + def createWithActiveDirectoryProperty(cls, propertyName): + """Creates an :class:`AuthUser` instance configured for Active + Directory authorization mode (DIRECTORY_SERVICE). + + Args: + propertyName (str): Active Directory property. + + Returns: + AuthUser: Configured for Active Directory (DIRECTORY_SERVICE) + authorization mode. + + The behavior is undefined when ``propertyName`` is ``""`` or + ``None``. + """ + retcode, handle = internals \ + .blpapi_AuthUser_createWithActiveDirectoryProperty( + propertyName) + _ExceptionUtil.raiseOnError(retcode) + return cls(handle) + + @classmethod + def createWithManualOptions(cls, userId, ipAddress): + """Creates an :class:`AuthUser` instance configured for manual + authorization. + + Args: + userId (str): user id. + ipAddress (str): IP address. + + Returns: + AuthUser: Configured for manual authorization. + + The behavior is undefined when either ``userId`` or ``ipAddress`` is + ``""`` or ``None``. + """ + retcode, handle = internals \ + .blpapi_AuthUser_createWithManualOptions(userId, ipAddress) + _ExceptionUtil.raiseOnError(retcode) + return cls(handle) + + def _handle(self): + """For internal use only.""" + return self.__handle + + +__copyright__ = """ +Copyright 2020. Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above +copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/blpapi/datetime.py b/blpapi/datetime.py index 3d135ef..f65380c 100644 --- a/blpapi/datetime.py +++ b/blpapi/datetime.py @@ -111,24 +111,19 @@ def convertToNative(blpapiDatetimeObj): blpapiDatetimeObj, internals.blpapi_HighPrecisionDatetime_tag) - if isHighPrecision: - # used for (get/set)Element, (get/set/append)Value methods - blpapiDatetime = blpapiDatetimeObj.datetime - else: - # used by: - # * blpapi_Constant_getValue - # * blpapi_HighResolutionClock_now_wrapper - blpapiDatetime = blpapiDatetimeObj + if not isHighPrecision: + raise ValueError( + "Datetime object is not high precision", + blpapiDatetimeObj) + blpapiDatetime = blpapiDatetimeObj.datetime parts = blpapiDatetime.parts hasDate = parts & internals.DATETIME_DATE_PART == \ internals.DATETIME_DATE_PART - hasTime = parts & internals.DATETIME_TIME_PART == \ - internals.DATETIME_TIME_PART - microsecs = blpapiDatetime.milliSeconds * 1000 if parts & \ - internals.DATETIME_MILLISECONDS_PART else 0 - if isHighPrecision and parts & internals.DATETIME_FRACSECONDS_PART: - microsecs += blpapiDatetimeObj.picoseconds // 1000 // 1000 + hasTime = parts & internals.DATETIME_TIMEFRACSECONDS_PART != 0 + microsecs = (blpapiDatetime.milliSeconds * 1000 + + blpapiDatetimeObj.picoseconds // 1000 // 1000) \ + if parts & internals.DATETIME_FRACSECONDS_PART else 0 tzinfo = FixedOffset(blpapiDatetime.offset) if parts & \ internals.DATETIME_OFFSET_PART else None if hasDate: @@ -165,7 +160,8 @@ def isDatetime(dtime): @staticmethod def convertToBlpapi(dtime): "Convert a Python date/time object to a BLPAPI Datetime object.""" - res = internals.blpapi_Datetime_tag() + highPrecDatetime = internals.blpapi_HighPrecisionDatetime_tag() + res = highPrecDatetime.datetime offset = None if isinstance(dtime, _dt.datetime): offset = dtime.utcoffset() @@ -175,9 +171,11 @@ def convertToBlpapi(dtime): res.hours = dtime.hour res.minutes = dtime.minute res.seconds = dtime.second - res.milliSeconds = dtime.microsecond // 1000 + (res.milliSeconds, highPrecDatetime.picoseconds) = \ + divmod(dtime.microsecond, 1000) + highPrecDatetime.picoseconds *= 1000 * 1000 res.parts = internals.DATETIME_DATE_PART | \ - internals.DATETIME_TIMEMILLI_PART + internals.DATETIME_TIMEFRACSECONDS_PART elif isinstance(dtime, _dt.date): res.year = dtime.year res.month = dtime.month @@ -188,15 +186,17 @@ def convertToBlpapi(dtime): res.hours = dtime.hour res.minutes = dtime.minute res.seconds = dtime.second - res.milliSeconds = dtime.microsecond // 1000 - res.parts = internals.DATETIME_TIMEMILLI_PART + (res.milliSeconds, highPrecDatetime.picoseconds) = \ + divmod(dtime.microsecond, 1000) + highPrecDatetime.picoseconds *= 1000 * 1000 + res.parts = internals.DATETIME_TIMEFRACSECONDS_PART else: raise TypeError("Datetime could be created only from \ datetime.datetime, datetime.date or datetime.time") if offset is not None: res.offset = offset.seconds // 60 res.parts |= internals.DATETIME_OFFSET_PART - return res + return highPrecDatetime __copyright__ = """ Copyright 2012. Bloomberg Finance L.P. diff --git a/blpapi/debug.py b/blpapi/debug.py index c7c370a..735a74c 100644 --- a/blpapi/debug.py +++ b/blpapi/debug.py @@ -76,11 +76,22 @@ def _version_load_error(error): Download and install the latest C++ SDK from: http://www.bloomberg.com/professional/api-library +""" % str(error) + if 'add_dll_directory' in dir(os): + msg += """ +If the C++ SDK is already installed, Python 3.8+ on Windows requires that the +path to the library is added to 'add_dll_directory', i.e.: + + with os.add_dll_directory(''): + import blpapi +""" + else: + msg += """ If the C++ SDK is already installed, please ensure that the path to the library was added to %s before entering the interpreter. -""" % (str(error), _linker_env()) +""" % _linker_env() return msg diff --git a/blpapi/debug_environment.py b/blpapi/debug_environment.py index d861803..e107b78 100644 --- a/blpapi/debug_environment.py +++ b/blpapi/debug_environment.py @@ -18,6 +18,23 @@ except ImportError: from io import StringIO +def _path_diagnostics(print_to_str): + # Information for PATH related issues + print_to_str("blpapi 64-bit will be loaded from: \"%s\"" + % util.find_library("blpapi3_64")) + print_to_str("blpapi 32-bit will be loaded from: \"%s\"" + % util.find_library("blpapi3_32")) + print_to_str("System PATH: (* marks locations where blpapi was found)") + for p in os.environ["PATH"].split(os.pathsep): + if p: # Skip empty entries + dll_32 = os.path.join(p, "blpapi3_32.dll") + dll_64 = os.path.join(p, "blpapi3_64.dll") + found_blpapi_dll = os.path.isfile(dll_32) or os.path.isfile(dll_64) + print_to_str(" %s \"%s\"" % ("*" if found_blpapi_dll else " ", p)) + print_to_str() + +def _add_dll_directory_diagnostics(print_to_str): + print_to_str("This Python version does not use PATH to find dlls") def get_env_diagnostics(): """ @@ -35,20 +52,10 @@ def get_env_diagnostics(): print_to_str("Python implementation:", platform.python_implementation()) print_to_str() - # Information for PATH related issues - print_to_str("blpapi 64-bit will be loaded from: \"%s\"" - % util.find_library("blpapi3_64")) - print_to_str("blpapi 32-bit will be loaded from: \"%s\"" - % util.find_library("blpapi3_32")) - print_to_str("System PATH: (* marks locations where blpapi was found)") - for p in os.environ["PATH"].split(os.pathsep): - if p: # Skip empty entries - dll_32 = os.path.join(p, "blpapi3_32.dll") - dll_64 = os.path.join(p, "blpapi3_64.dll") - found_blpapi_dll = os.path.isfile(dll_32) or os.path.isfile(dll_64) - print_to_str(" %s \"%s\"" % ("*" if found_blpapi_dll else " ", p)) - print_to_str() - + if not 'add_dll_directory' in dir(os): + _path_diagnostics(print_to_str) + else: + _add_dll_directory_diagnostics(print_to_str) # Check if the blpapi package has been installed. If not, # include information about the current python environment blpapi_package_found = False diff --git a/blpapi/element.py b/blpapi/element.py index 8b9387d..348985c 100644 --- a/blpapi/element.py +++ b/blpapi/element.py @@ -106,8 +106,8 @@ class Element(object): None) __datetimeTraits = ( - internals.blpapi_Element_setElementDatetime, - internals.blpapi_Element_setValueDatetime, + internals.blpapi_Element_setElementHighPrecisionDatetime, + internals.blpapi_Element_setValueHighPrecisionDatetime, _DatetimeUtil.convertToBlpapi) __int32Traits = ( diff --git a/blpapi/eventformatter.py b/blpapi/eventformatter.py index 0dbb1ba..9233aed 100644 --- a/blpapi/eventformatter.py +++ b/blpapi/eventformatter.py @@ -44,8 +44,8 @@ class EventFormatter(object): None) __datetimeTraits = ( - internals.blpapi_EventFormatter_setValueDatetime, - internals.blpapi_EventFormatter_appendValueDatetime, + internals.blpapi_EventFormatter_setValueHighPrecisionDatetime, + internals.blpapi_EventFormatter_appendValueHighPrecisionDatetime, _DatetimeUtil.convertToBlpapi) __int32Traits = ( diff --git a/blpapi/internals.py b/blpapi/internals.py index 1060cc8..8057f9a 100644 --- a/blpapi/internals.py +++ b/blpapi/internals.py @@ -200,6 +200,9 @@ class _object: MESSAGE_RECAPTYPE_UNSOLICITED = _internals.MESSAGE_RECAPTYPE_UNSOLICITED ZFPUTIL_REMOTE_8194 = _internals.ZFPUTIL_REMOTE_8194 ZFPUTIL_REMOTE_8196 = _internals.ZFPUTIL_REMOTE_8196 +IDENTITYUTIL_USERTYPE_UNKNOWN = _internals.IDENTITYUTIL_USERTYPE_UNKNOWN +IDENTITYUTIL_USERTYPE_APP_PORTAL = _internals.IDENTITYUTIL_USERTYPE_APP_PORTAL +IDENTITYUTIL_USERTYPE_SANDBOX_EXCEL = _internals.IDENTITYUTIL_USERTYPE_SANDBOX_EXCEL DATATYPE_BOOL = _internals.DATATYPE_BOOL DATATYPE_CHAR = _internals.DATATYPE_CHAR DATATYPE_BYTE = _internals.DATATYPE_BYTE @@ -664,9 +667,9 @@ def blpapi_Element_setValueString(element, value, index): return _internals.blpapi_Element_setValueString(element, value, index) blpapi_Element_setValueString = _internals.blpapi_Element_setValueString -def blpapi_Element_setValueDatetime(element, value, index): - return _internals.blpapi_Element_setValueDatetime(element, value, index) -blpapi_Element_setValueDatetime = _internals.blpapi_Element_setValueDatetime +def blpapi_Element_setValueHighPrecisionDatetime(element, value, index): + return _internals.blpapi_Element_setValueHighPrecisionDatetime(element, value, index) +blpapi_Element_setValueHighPrecisionDatetime = _internals.blpapi_Element_setValueHighPrecisionDatetime def blpapi_Element_setValueFromName(element, value, index): return _internals.blpapi_Element_setValueFromName(element, value, index) @@ -688,9 +691,9 @@ def blpapi_Element_setElementString(element, nameString, name, value): return _internals.blpapi_Element_setElementString(element, nameString, name, value) blpapi_Element_setElementString = _internals.blpapi_Element_setElementString -def blpapi_Element_setElementDatetime(element, nameString, name, value): - return _internals.blpapi_Element_setElementDatetime(element, nameString, name, value) -blpapi_Element_setElementDatetime = _internals.blpapi_Element_setElementDatetime +def blpapi_Element_setElementHighPrecisionDatetime(element, nameString, name, value): + return _internals.blpapi_Element_setElementHighPrecisionDatetime(element, nameString, name, value) +blpapi_Element_setElementHighPrecisionDatetime = _internals.blpapi_Element_setElementHighPrecisionDatetime def blpapi_Element_setElementFromName(element, elementName, name, buffer): return _internals.blpapi_Element_setElementFromName(element, elementName, name, buffer) @@ -764,9 +767,9 @@ def blpapi_EventFormatter_setValueInt64(formatter, typeString, typeName, value): return _internals.blpapi_EventFormatter_setValueInt64(formatter, typeString, typeName, value) blpapi_EventFormatter_setValueInt64 = _internals.blpapi_EventFormatter_setValueInt64 -def blpapi_EventFormatter_setValueDatetime(formatter, typeString, typeName, value): - return _internals.blpapi_EventFormatter_setValueDatetime(formatter, typeString, typeName, value) -blpapi_EventFormatter_setValueDatetime = _internals.blpapi_EventFormatter_setValueDatetime +def blpapi_EventFormatter_setValueHighPrecisionDatetime(formatter, typeString, typeName, value): + return _internals.blpapi_EventFormatter_setValueHighPrecisionDatetime(formatter, typeString, typeName, value) +blpapi_EventFormatter_setValueHighPrecisionDatetime = _internals.blpapi_EventFormatter_setValueHighPrecisionDatetime def blpapi_EventFormatter_setValueString(formatter, typeString, typeName, value): return _internals.blpapi_EventFormatter_setValueString(formatter, typeString, typeName, value) @@ -804,9 +807,9 @@ def blpapi_EventFormatter_appendValueInt64(formatter, value): return _internals.blpapi_EventFormatter_appendValueInt64(formatter, value) blpapi_EventFormatter_appendValueInt64 = _internals.blpapi_EventFormatter_appendValueInt64 -def blpapi_EventFormatter_appendValueDatetime(formatter, value): - return _internals.blpapi_EventFormatter_appendValueDatetime(formatter, value) -blpapi_EventFormatter_appendValueDatetime = _internals.blpapi_EventFormatter_appendValueDatetime +def blpapi_EventFormatter_appendValueHighPrecisionDatetime(formatter, value): + return _internals.blpapi_EventFormatter_appendValueHighPrecisionDatetime(formatter, value) +blpapi_EventFormatter_appendValueHighPrecisionDatetime = _internals.blpapi_EventFormatter_appendValueHighPrecisionDatetime def blpapi_EventFormatter_appendValueString(formatter, value): return _internals.blpapi_EventFormatter_appendValueString(formatter, value) @@ -851,6 +854,94 @@ def ProviderSession_destroyHelper(sessionHandle, eventHandlerFunc): def ProviderSession_terminateSubscriptionsOnTopic(sessionHandle, topic, message): return _internals.ProviderSession_terminateSubscriptionsOnTopic(sessionHandle, topic, message) ProviderSession_terminateSubscriptionsOnTopic = _internals.ProviderSession_terminateSubscriptionsOnTopic + +def blpapi_AuthOptions_create_default(): + return _internals.blpapi_AuthOptions_create_default() +blpapi_AuthOptions_create_default = _internals.blpapi_AuthOptions_create_default + +def blpapi_AuthOptions_create_forUserMode(user): + return _internals.blpapi_AuthOptions_create_forUserMode(user) +blpapi_AuthOptions_create_forUserMode = _internals.blpapi_AuthOptions_create_forUserMode + +def blpapi_AuthOptions_create_forAppMode(app): + return _internals.blpapi_AuthOptions_create_forAppMode(app) +blpapi_AuthOptions_create_forAppMode = _internals.blpapi_AuthOptions_create_forAppMode + +def blpapi_AuthOptions_create_forUserAndAppMode(user, app): + return _internals.blpapi_AuthOptions_create_forUserAndAppMode(user, app) +blpapi_AuthOptions_create_forUserAndAppMode = _internals.blpapi_AuthOptions_create_forUserAndAppMode + +def blpapi_AuthOptions_create_forToken(token): + return _internals.blpapi_AuthOptions_create_forToken(token) +blpapi_AuthOptions_create_forToken = _internals.blpapi_AuthOptions_create_forToken + +def blpapi_AuthOptions_duplicate(dup): + return _internals.blpapi_AuthOptions_duplicate(dup) +blpapi_AuthOptions_duplicate = _internals.blpapi_AuthOptions_duplicate + +def blpapi_AuthOptions_copy(lhs, rhs): + return _internals.blpapi_AuthOptions_copy(lhs, rhs) +blpapi_AuthOptions_copy = _internals.blpapi_AuthOptions_copy + +def blpapi_AuthOptions_destroy(options): + return _internals.blpapi_AuthOptions_destroy(options) +blpapi_AuthOptions_destroy = _internals.blpapi_AuthOptions_destroy + +def blpapi_AuthUser_createWithLogonName(): + return _internals.blpapi_AuthUser_createWithLogonName() +blpapi_AuthUser_createWithLogonName = _internals.blpapi_AuthUser_createWithLogonName + +def blpapi_AuthUser_createWithActiveDirectoryProperty(propertyName): + return _internals.blpapi_AuthUser_createWithActiveDirectoryProperty(propertyName) +blpapi_AuthUser_createWithActiveDirectoryProperty = _internals.blpapi_AuthUser_createWithActiveDirectoryProperty + +def blpapi_AuthUser_createWithManualOptions(userId, ipAddress): + return _internals.blpapi_AuthUser_createWithManualOptions(userId, ipAddress) +blpapi_AuthUser_createWithManualOptions = _internals.blpapi_AuthUser_createWithManualOptions + +def blpapi_AuthUser_duplicate(dup): + return _internals.blpapi_AuthUser_duplicate(dup) +blpapi_AuthUser_duplicate = _internals.blpapi_AuthUser_duplicate + +def blpapi_AuthUser_copy(lhs, rhs): + return _internals.blpapi_AuthUser_copy(lhs, rhs) +blpapi_AuthUser_copy = _internals.blpapi_AuthUser_copy + +def blpapi_AuthUser_destroy(user): + return _internals.blpapi_AuthUser_destroy(user) +blpapi_AuthUser_destroy = _internals.blpapi_AuthUser_destroy + +def blpapi_AuthApplication_create(appName): + return _internals.blpapi_AuthApplication_create(appName) +blpapi_AuthApplication_create = _internals.blpapi_AuthApplication_create + +def blpapi_AuthApplication_duplicate(dup): + return _internals.blpapi_AuthApplication_duplicate(dup) +blpapi_AuthApplication_duplicate = _internals.blpapi_AuthApplication_duplicate + +def blpapi_AuthApplication_copy(lhs, rhs): + return _internals.blpapi_AuthApplication_copy(lhs, rhs) +blpapi_AuthApplication_copy = _internals.blpapi_AuthApplication_copy + +def blpapi_AuthApplication_destroy(app): + return _internals.blpapi_AuthApplication_destroy(app) +blpapi_AuthApplication_destroy = _internals.blpapi_AuthApplication_destroy + +def blpapi_AuthToken_create(tokenStr): + return _internals.blpapi_AuthToken_create(tokenStr) +blpapi_AuthToken_create = _internals.blpapi_AuthToken_create + +def blpapi_AuthToken_duplicate(dup): + return _internals.blpapi_AuthToken_duplicate(dup) +blpapi_AuthToken_duplicate = _internals.blpapi_AuthToken_duplicate + +def blpapi_AuthToken_copy(lhs, rhs): + return _internals.blpapi_AuthToken_copy(lhs, rhs) +blpapi_AuthToken_copy = _internals.blpapi_AuthToken_copy + +def blpapi_AuthToken_destroy(token): + return _internals.blpapi_AuthToken_destroy(token) +blpapi_AuthToken_destroy = _internals.blpapi_AuthToken_destroy UNKNOWN_CLASS = _internals.UNKNOWN_CLASS INVALIDSTATE_CLASS = _internals.INVALIDSTATE_CLASS INVALIDARG_CLASS = _internals.INVALIDARG_CLASS @@ -880,6 +971,7 @@ def ProviderSession_terminateSubscriptionsOnTopic(sessionHandle, topic, message) ERROR_DS_LOOKUP_FAILED = _internals.ERROR_DS_LOOKUP_FAILED ERROR_UNSUPPORTED_OPERATION = _internals.ERROR_UNSUPPORTED_OPERATION ERROR_DS_PROPERTY_NOT_FOUND = _internals.ERROR_DS_PROPERTY_NOT_FOUND +ERROR_MSG_TOO_LARGE = _internals.ERROR_MSG_TOO_LARGE def blpapi_getLastErrorDescription(resultCode): return _internals.blpapi_getLastErrorDescription(resultCode) @@ -941,6 +1033,10 @@ def blpapi_SessionOptions_setAutoRestartOnDisconnection(parameters, autoRestart) return _internals.blpapi_SessionOptions_setAutoRestartOnDisconnection(parameters, autoRestart) blpapi_SessionOptions_setAutoRestartOnDisconnection = _internals.blpapi_SessionOptions_setAutoRestartOnDisconnection +def blpapi_SessionOptions_setSessionIdentityOptions(parameters, authOptions, cid): + return _internals.blpapi_SessionOptions_setSessionIdentityOptions(parameters, authOptions, cid) +blpapi_SessionOptions_setSessionIdentityOptions = _internals.blpapi_SessionOptions_setSessionIdentityOptions + def blpapi_SessionOptions_setAuthenticationOptions(parameters, authOptions): return _internals.blpapi_SessionOptions_setAuthenticationOptions(parameters, authOptions) blpapi_SessionOptions_setAuthenticationOptions = _internals.blpapi_SessionOptions_setAuthenticationOptions @@ -1447,26 +1543,30 @@ def blpapi_RequestTemplate_release(requestTemplate): return _internals.blpapi_RequestTemplate_release(requestTemplate) blpapi_RequestTemplate_release = _internals.blpapi_RequestTemplate_release -def blpapi_Operation_name(service): - return _internals.blpapi_Operation_name(service) +def blpapi_Operation_name(operation): + return _internals.blpapi_Operation_name(operation) blpapi_Operation_name = _internals.blpapi_Operation_name -def blpapi_Operation_description(service): - return _internals.blpapi_Operation_description(service) +def blpapi_Operation_description(operation): + return _internals.blpapi_Operation_description(operation) blpapi_Operation_description = _internals.blpapi_Operation_description -def blpapi_Operation_requestDefinition(service): - return _internals.blpapi_Operation_requestDefinition(service) +def blpapi_Operation_requestDefinition(operation): + return _internals.blpapi_Operation_requestDefinition(operation) blpapi_Operation_requestDefinition = _internals.blpapi_Operation_requestDefinition -def blpapi_Operation_numResponseDefinitions(service): - return _internals.blpapi_Operation_numResponseDefinitions(service) +def blpapi_Operation_numResponseDefinitions(operation): + return _internals.blpapi_Operation_numResponseDefinitions(operation) blpapi_Operation_numResponseDefinitions = _internals.blpapi_Operation_numResponseDefinitions -def blpapi_Operation_responseDefinition(service, index): - return _internals.blpapi_Operation_responseDefinition(service, index) +def blpapi_Operation_responseDefinition(operation, index): + return _internals.blpapi_Operation_responseDefinition(operation, index) blpapi_Operation_responseDefinition = _internals.blpapi_Operation_responseDefinition +def blpapi_Operation_responseDefinitionFromName(operation, name): + return _internals.blpapi_Operation_responseDefinitionFromName(operation, name) +blpapi_Operation_responseDefinitionFromName = _internals.blpapi_Operation_responseDefinitionFromName + def blpapi_Service_name(service): return _internals.blpapi_Service_name(service) blpapi_Service_name = _internals.blpapi_Service_name @@ -1675,6 +1775,14 @@ def blpapi_AbstractSession_createIdentity(session): return _internals.blpapi_AbstractSession_createIdentity(session) blpapi_AbstractSession_createIdentity = _internals.blpapi_AbstractSession_createIdentity +def blpapi_AbstractSession_generateAuthorizedIdentityAsync(session, authOptions, cid): + return _internals.blpapi_AbstractSession_generateAuthorizedIdentityAsync(session, authOptions, cid) +blpapi_AbstractSession_generateAuthorizedIdentityAsync = _internals.blpapi_AbstractSession_generateAuthorizedIdentityAsync + +def blpapi_AbstractSession_getAuthorizedIdentity(session, cid): + return _internals.blpapi_AbstractSession_getAuthorizedIdentity(session, cid) +blpapi_AbstractSession_getAuthorizedIdentity = _internals.blpapi_AbstractSession_getAuthorizedIdentity + def blpapi_Session_start(session): return _internals.blpapi_Session_start(session) blpapi_Session_start = _internals.blpapi_Session_start diff --git a/blpapi/internals_wrap.c b/blpapi/internals_wrap.c index 675b57e..a569067 100644 --- a/blpapi/internals_wrap.c +++ b/blpapi/internals_wrap.c @@ -2988,66 +2988,78 @@ SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { /* -------- TYPES TABLE (BEGIN) -------- */ #define SWIGTYPE_p_blpapi_AbstractSession swig_types[0] -#define SWIGTYPE_p_blpapi_Constant swig_types[1] -#define SWIGTYPE_p_blpapi_ConstantList swig_types[2] -#define SWIGTYPE_p_blpapi_CorrelationId_t_ swig_types[3] -#define SWIGTYPE_p_blpapi_CorrelationId_t__value swig_types[4] -#define SWIGTYPE_p_blpapi_Datetime_tag swig_types[5] -#define SWIGTYPE_p_blpapi_Element swig_types[6] -#define SWIGTYPE_p_blpapi_Event swig_types[7] -#define SWIGTYPE_p_blpapi_EventDispatcher swig_types[8] -#define SWIGTYPE_p_blpapi_EventFormatter swig_types[9] -#define SWIGTYPE_p_blpapi_EventQueue swig_types[10] -#define SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag swig_types[11] -#define SWIGTYPE_p_blpapi_Identity swig_types[12] -#define SWIGTYPE_p_blpapi_Logging_Func_t swig_types[13] -#define SWIGTYPE_p_blpapi_Logging_Severity_t swig_types[14] -#define SWIGTYPE_p_blpapi_ManagedPtr_t_ swig_types[15] -#define SWIGTYPE_p_blpapi_Message swig_types[16] -#define SWIGTYPE_p_blpapi_MessageIterator swig_types[17] -#define SWIGTYPE_p_blpapi_Name swig_types[18] -#define SWIGTYPE_p_blpapi_Operation swig_types[19] -#define SWIGTYPE_p_blpapi_ProviderSession swig_types[20] -#define SWIGTYPE_p_blpapi_Request swig_types[21] -#define SWIGTYPE_p_blpapi_RequestTemplate swig_types[22] -#define SWIGTYPE_p_blpapi_ResolutionList swig_types[23] -#define SWIGTYPE_p_blpapi_Service swig_types[24] -#define SWIGTYPE_p_blpapi_ServiceRegistrationOptions swig_types[25] -#define SWIGTYPE_p_blpapi_Session swig_types[26] -#define SWIGTYPE_p_blpapi_SessionOptions swig_types[27] -#define SWIGTYPE_p_blpapi_StreamWriter_t swig_types[28] -#define SWIGTYPE_p_blpapi_SubscriptionItrerator swig_types[29] -#define SWIGTYPE_p_blpapi_SubscriptionList swig_types[30] -#define SWIGTYPE_p_blpapi_TimePoint swig_types[31] -#define SWIGTYPE_p_blpapi_TlsOptions swig_types[32] -#define SWIGTYPE_p_blpapi_Topic swig_types[33] -#define SWIGTYPE_p_blpapi_TopicList swig_types[34] -#define SWIGTYPE_p_char swig_types[35] -#define SWIGTYPE_p_double swig_types[36] -#define SWIGTYPE_p_f_p_struct_blpapi_Event_p_struct_blpapi_ProviderSession_p_void__void swig_types[37] -#define SWIGTYPE_p_float swig_types[38] -#define SWIGTYPE_p_int swig_types[39] -#define SWIGTYPE_p_intArray swig_types[40] -#define SWIGTYPE_p_long_long swig_types[41] -#define SWIGTYPE_p_p_blpapi_Element swig_types[42] -#define SWIGTYPE_p_p_blpapi_Event swig_types[43] -#define SWIGTYPE_p_p_blpapi_Message swig_types[44] -#define SWIGTYPE_p_p_blpapi_Name swig_types[45] -#define SWIGTYPE_p_p_blpapi_Operation swig_types[46] -#define SWIGTYPE_p_p_blpapi_Request swig_types[47] -#define SWIGTYPE_p_p_blpapi_RequestTemplate swig_types[48] -#define SWIGTYPE_p_p_blpapi_Service swig_types[49] -#define SWIGTYPE_p_p_blpapi_Topic swig_types[50] -#define SWIGTYPE_p_p_char swig_types[51] -#define SWIGTYPE_p_p_p_void swig_types[52] -#define SWIGTYPE_p_p_void swig_types[53] -#define SWIGTYPE_p_short swig_types[54] -#define SWIGTYPE_p_unsigned_char swig_types[55] -#define SWIGTYPE_p_unsigned_int swig_types[56] -#define SWIGTYPE_p_unsigned_long_long swig_types[57] -#define SWIGTYPE_p_unsigned_short swig_types[58] -static swig_type_info *swig_types[60]; -static swig_module_info swig_module = {swig_types, 59, 0, 0, 0, 0}; +#define SWIGTYPE_p_blpapi_AuthApplication swig_types[1] +#define SWIGTYPE_p_blpapi_AuthOptions swig_types[2] +#define SWIGTYPE_p_blpapi_AuthToken swig_types[3] +#define SWIGTYPE_p_blpapi_AuthUser swig_types[4] +#define SWIGTYPE_p_blpapi_Constant swig_types[5] +#define SWIGTYPE_p_blpapi_ConstantList swig_types[6] +#define SWIGTYPE_p_blpapi_CorrelationId_t_ swig_types[7] +#define SWIGTYPE_p_blpapi_CorrelationId_t__value swig_types[8] +#define SWIGTYPE_p_blpapi_Datetime_tag swig_types[9] +#define SWIGTYPE_p_blpapi_Element swig_types[10] +#define SWIGTYPE_p_blpapi_Event swig_types[11] +#define SWIGTYPE_p_blpapi_EventDispatcher swig_types[12] +#define SWIGTYPE_p_blpapi_EventFormatter swig_types[13] +#define SWIGTYPE_p_blpapi_EventQueue swig_types[14] +#define SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag swig_types[15] +#define SWIGTYPE_p_blpapi_Identity swig_types[16] +#define SWIGTYPE_p_blpapi_Logging_Func_t swig_types[17] +#define SWIGTYPE_p_blpapi_Logging_Severity_t swig_types[18] +#define SWIGTYPE_p_blpapi_ManagedPtr_t_ swig_types[19] +#define SWIGTYPE_p_blpapi_Message swig_types[20] +#define SWIGTYPE_p_blpapi_MessageFormatter swig_types[21] +#define SWIGTYPE_p_blpapi_MessageIterator swig_types[22] +#define SWIGTYPE_p_blpapi_MessageProperties swig_types[23] +#define SWIGTYPE_p_blpapi_Name swig_types[24] +#define SWIGTYPE_p_blpapi_Operation swig_types[25] +#define SWIGTYPE_p_blpapi_ProviderSession swig_types[26] +#define SWIGTYPE_p_blpapi_Request swig_types[27] +#define SWIGTYPE_p_blpapi_RequestTemplate swig_types[28] +#define SWIGTYPE_p_blpapi_ResolutionList swig_types[29] +#define SWIGTYPE_p_blpapi_SchemaElementDefinition swig_types[30] +#define SWIGTYPE_p_blpapi_Service swig_types[31] +#define SWIGTYPE_p_blpapi_ServiceRegistrationOptions swig_types[32] +#define SWIGTYPE_p_blpapi_Session swig_types[33] +#define SWIGTYPE_p_blpapi_SessionOptions swig_types[34] +#define SWIGTYPE_p_blpapi_StreamWriter_t swig_types[35] +#define SWIGTYPE_p_blpapi_SubscriptionItrerator swig_types[36] +#define SWIGTYPE_p_blpapi_SubscriptionList swig_types[37] +#define SWIGTYPE_p_blpapi_TimePoint swig_types[38] +#define SWIGTYPE_p_blpapi_TlsOptions swig_types[39] +#define SWIGTYPE_p_blpapi_Topic swig_types[40] +#define SWIGTYPE_p_blpapi_TopicList swig_types[41] +#define SWIGTYPE_p_char swig_types[42] +#define SWIGTYPE_p_double swig_types[43] +#define SWIGTYPE_p_f_p_struct_blpapi_Event_p_struct_blpapi_ProviderSession_p_void__void swig_types[44] +#define SWIGTYPE_p_float swig_types[45] +#define SWIGTYPE_p_int swig_types[46] +#define SWIGTYPE_p_intArray swig_types[47] +#define SWIGTYPE_p_long_long swig_types[48] +#define SWIGTYPE_p_p_blpapi_AuthApplication swig_types[49] +#define SWIGTYPE_p_p_blpapi_AuthOptions swig_types[50] +#define SWIGTYPE_p_p_blpapi_AuthToken swig_types[51] +#define SWIGTYPE_p_p_blpapi_AuthUser swig_types[52] +#define SWIGTYPE_p_p_blpapi_Element swig_types[53] +#define SWIGTYPE_p_p_blpapi_Event swig_types[54] +#define SWIGTYPE_p_p_blpapi_Identity swig_types[55] +#define SWIGTYPE_p_p_blpapi_Message swig_types[56] +#define SWIGTYPE_p_p_blpapi_Name swig_types[57] +#define SWIGTYPE_p_p_blpapi_Operation swig_types[58] +#define SWIGTYPE_p_p_blpapi_Request swig_types[59] +#define SWIGTYPE_p_p_blpapi_RequestTemplate swig_types[60] +#define SWIGTYPE_p_p_blpapi_SchemaElementDefinition swig_types[61] +#define SWIGTYPE_p_p_blpapi_Service swig_types[62] +#define SWIGTYPE_p_p_blpapi_Topic swig_types[63] +#define SWIGTYPE_p_p_char swig_types[64] +#define SWIGTYPE_p_p_void swig_types[65] +#define SWIGTYPE_p_short swig_types[66] +#define SWIGTYPE_p_unsigned_char swig_types[67] +#define SWIGTYPE_p_unsigned_int swig_types[68] +#define SWIGTYPE_p_unsigned_long_long swig_types[69] +#define SWIGTYPE_p_unsigned_short swig_types[70] +static swig_type_info *swig_types[72]; +static swig_module_info swig_module = {swig_types, 71, 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) @@ -3149,6 +3161,7 @@ SWIGINTERNINLINE PyObject* } +#include "blpapi_authoptions.h" #include "blpapi_constant.h" #include "blpapi_datetime.h" #include "blpapi_diagnosticsutil.h" @@ -3177,6 +3190,7 @@ SWIGINTERNINLINE PyObject* #include "blpapi_topic.h" #include "blpapi_topiclist.h" + #ifndef MAX_GROUP_ID_SIZE // MAX_GROUP_ID_SIZE is not defined in BLPAPI, but docs say its value is 64 #define MAX_GROUP_ID_SIZE 64 @@ -3373,12 +3387,6 @@ PyObject *blpapi_DiagnosticsUtil_memoryInfo_wrapper() return diagnostics_str; } -typedef void (*blpapi_Logging_Func_t)(blpapi_UInt64_t threadId, - int severity, - blpapi_Datetime_t timestamp, - const char *category, - const char *message); - // Shared global object guarded by GIL PyObject* loggerCallback = 0; @@ -3436,10 +3444,10 @@ int setLoggerCallbackWrapper(PyObject *cb, int severity) return 0; } -/** Convert `blpapi_TimePoint_t` value to `blpapi_Datetime_t`. Function +/** Convert `blpapi_TimePoint_t` value to `blpapi_HighPrecisionDatetime_t`. Function * always returns UTC time. */ -blpapi_Datetime_t blpapi_HighPrecisionDatetime_fromTimePoint_wrapper(blpapi_TimePoint_t original) +blpapi_HighPrecisionDatetime_t blpapi_HighPrecisionDatetime_fromTimePoint_wrapper(blpapi_TimePoint_t original) { blpapi_HighPrecisionDatetime_t highPrecisionDatetime; blpapi_Datetime_t datetime; @@ -3449,13 +3457,10 @@ blpapi_Datetime_t blpapi_HighPrecisionDatetime_fromTimePoint_wrapper(blpapi_Time &original, 0); - datetime = highPrecisionDatetime.datetime; - - return datetime; + return highPrecisionDatetime; } - SWIGINTERN int SWIG_AsVal_double (PyObject *obj, double *val) { @@ -4642,7 +4647,7 @@ SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_fromTimePoint_wrapper(Py void *argp1 ; int res1 = 0 ; PyObject * obj0 = 0 ; - blpapi_Datetime_t result; + blpapi_HighPrecisionDatetime_t result; if (!PyArg_ParseTuple(args,(char *)"O:blpapi_HighPrecisionDatetime_fromTimePoint_wrapper",&obj0)) SWIG_fail; { @@ -4661,7 +4666,7 @@ SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_fromTimePoint_wrapper(Py result = blpapi_HighPrecisionDatetime_fromTimePoint_wrapper(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_NewPointerObj((blpapi_Datetime_t *)memcpy((blpapi_Datetime_t *)calloc(1,sizeof(blpapi_Datetime_t)),&result,sizeof(blpapi_Datetime_t)), SWIGTYPE_p_blpapi_Datetime_tag, SWIG_POINTER_OWN | 0 ); + resultobj = SWIG_NewPointerObj((blpapi_HighPrecisionDatetime_t *)memcpy((blpapi_HighPrecisionDatetime_t *)calloc(1,sizeof(blpapi_HighPrecisionDatetime_t)),&result,sizeof(blpapi_HighPrecisionDatetime_t)), SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, SWIG_POINTER_OWN | 0 ); return resultobj; fail: return NULL; @@ -4859,7 +4864,7 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_printHelper(PyObject * arg4 = &temp4; arg5 = &tempn4; if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_SchemaElementDefinition_printHelper",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_printHelper" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t *""'"); } @@ -6230,7 +6235,7 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_definition(PyObject *SWIGUNUSEDPARM(se result = (blpapi_SchemaElementDefinition_t *)blpapi_Element_definition((struct blpapi_Element const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_void, 0 | 0 ); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); return resultobj; fail: return NULL; @@ -6616,8 +6621,7 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsBool(PyObject *SWIGUNUSEDPAR size_t arg3 ; void *argp1 = 0 ; int res1 = 0 ; - blpapi_Bool_t temp2 ; - int res2 = SWIG_TMPOBJ ; + int temp2 ; size_t val3 ; int ecode3 = 0 ; PyObject * obj0 = 0 ; @@ -6642,12 +6646,7 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsBool(PyObject *SWIGUNUSEDPAR SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - if (SWIG_IsTmpObj(res2)) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg2))); - } else { - int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_int, new_flags)); - } + resultobj = SWIG_Python_AppendOutput(resultobj, PyInt_FromLong(*arg2)); return resultobj; fail: return NULL; @@ -7247,10 +7246,10 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_setValueString(PyObject *SWIGUNUSEDPAR } -SWIGINTERN PyObject *_wrap_blpapi_Element_setValueDatetime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Element_setValueHighPrecisionDatetime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - blpapi_Datetime_t *arg2 = (blpapi_Datetime_t *) 0 ; + blpapi_HighPrecisionDatetime_t *arg2 = (blpapi_HighPrecisionDatetime_t *) 0 ; size_t arg3 ; void *argp1 = 0 ; int res1 = 0 ; @@ -7263,25 +7262,25 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_setValueDatetime(PyObject *SWIGUNUSEDP PyObject * obj2 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Element_setValueDatetime",&obj0,&obj1,&obj2)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Element_setValueHighPrecisionDatetime",&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setValueDatetime" "', argument " "1"" of type '" "blpapi_Element_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setValueHighPrecisionDatetime" "', argument " "1"" of type '" "blpapi_Element_t *""'"); } arg1 = (blpapi_Element_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setValueDatetime" "', argument " "2"" of type '" "blpapi_Datetime_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setValueHighPrecisionDatetime" "', argument " "2"" of type '" "blpapi_HighPrecisionDatetime_t const *""'"); } - arg2 = (blpapi_Datetime_t *)(argp2); + arg2 = (blpapi_HighPrecisionDatetime_t *)(argp2); ecode3 = SWIG_AsVal_size_t(obj2, &val3); if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_setValueDatetime" "', argument " "3"" of type '" "size_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_setValueHighPrecisionDatetime" "', argument " "3"" of type '" "size_t""'"); } arg3 = (size_t)(val3); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_setValueDatetime(arg1,(struct blpapi_Datetime_tag const *)arg2,arg3); + result = (int)blpapi_Element_setValueHighPrecisionDatetime(arg1,(struct blpapi_HighPrecisionDatetime_tag const *)arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); @@ -7562,12 +7561,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_setElementString(PyObject *SWIGUNUSEDP } -SWIGINTERN PyObject *_wrap_blpapi_Element_setElementDatetime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Element_setElementHighPrecisionDatetime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; char *arg2 = (char *) 0 ; blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - blpapi_Datetime_t *arg4 = (blpapi_Datetime_t *) 0 ; + blpapi_HighPrecisionDatetime_t *arg4 = (blpapi_HighPrecisionDatetime_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 ; @@ -7583,30 +7582,30 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_setElementDatetime(PyObject *SWIGUNUSE PyObject * obj3 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Element_setElementDatetime",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Element_setElementHighPrecisionDatetime",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setElementDatetime" "', argument " "1"" of type '" "blpapi_Element_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setElementHighPrecisionDatetime" "', argument " "1"" of type '" "blpapi_Element_t *""'"); } arg1 = (blpapi_Element_t *)(argp1); res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setElementDatetime" "', argument " "2"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setElementHighPrecisionDatetime" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_setElementDatetime" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_setElementHighPrecisionDatetime" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); } arg3 = (blpapi_Name_t *)(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Element_setElementDatetime" "', argument " "4"" of type '" "blpapi_Datetime_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Element_setElementHighPrecisionDatetime" "', argument " "4"" of type '" "blpapi_HighPrecisionDatetime_t const *""'"); } - arg4 = (blpapi_Datetime_t *)(argp4); + arg4 = (blpapi_HighPrecisionDatetime_t *)(argp4); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_setElementDatetime(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3,(struct blpapi_Datetime_tag const *)arg4); + result = (int)blpapi_Element_setElementHighPrecisionDatetime(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3,(struct blpapi_HighPrecisionDatetime_tag const *)arg4); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); @@ -8561,12 +8560,12 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueInt64(PyObject *SWIGUNU } -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueDatetime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueHighPrecisionDatetime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; char *arg2 = (char *) 0 ; blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - blpapi_Datetime_t *arg4 = (blpapi_Datetime_t *) 0 ; + blpapi_HighPrecisionDatetime_t *arg4 = (blpapi_HighPrecisionDatetime_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 ; @@ -8582,30 +8581,30 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueDatetime(PyObject *SWIG PyObject * obj3 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_EventFormatter_setValueDatetime",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_EventFormatter_setValueHighPrecisionDatetime",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_setValueDatetime" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_setValueHighPrecisionDatetime" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); } arg1 = (blpapi_EventFormatter_t *)(argp1); res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_setValueDatetime" "', argument " "2"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_setValueHighPrecisionDatetime" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_setValueDatetime" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_setValueHighPrecisionDatetime" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); } arg3 = (blpapi_Name_t *)(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_EventFormatter_setValueDatetime" "', argument " "4"" of type '" "blpapi_Datetime_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_EventFormatter_setValueHighPrecisionDatetime" "', argument " "4"" of type '" "blpapi_HighPrecisionDatetime_t const *""'"); } - arg4 = (blpapi_Datetime_t *)(argp4); + arg4 = (blpapi_HighPrecisionDatetime_t *)(argp4); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_setValueDatetime(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3,(struct blpapi_Datetime_tag const *)arg4); + result = (int)blpapi_EventFormatter_setValueHighPrecisionDatetime(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3,(struct blpapi_HighPrecisionDatetime_tag const *)arg4); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); @@ -8992,10 +8991,10 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueInt64(PyObject *SWIG } -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueDatetime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueHighPrecisionDatetime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - blpapi_Datetime_t *arg2 = (blpapi_Datetime_t *) 0 ; + blpapi_HighPrecisionDatetime_t *arg2 = (blpapi_HighPrecisionDatetime_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; @@ -9004,20 +9003,20 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueDatetime(PyObject *S PyObject * obj1 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_EventFormatter_appendValueDatetime",&obj0,&obj1)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_EventFormatter_appendValueHighPrecisionDatetime",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendValueDatetime" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendValueHighPrecisionDatetime" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); } arg1 = (blpapi_EventFormatter_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendValueDatetime" "', argument " "2"" of type '" "blpapi_Datetime_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendValueHighPrecisionDatetime" "', argument " "2"" of type '" "blpapi_HighPrecisionDatetime_t const *""'"); } - arg2 = (blpapi_Datetime_t *)(argp2); + arg2 = (blpapi_HighPrecisionDatetime_t *)(argp2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_appendValueDatetime(arg1,(struct blpapi_Datetime_tag const *)arg2); + result = (int)blpapi_EventFormatter_appendValueHighPrecisionDatetime(arg1,(struct blpapi_HighPrecisionDatetime_tag const *)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); @@ -9275,97 +9274,772 @@ SWIGINTERN PyObject *_wrap_ProviderSession_createHelper(PyObject *SWIGUNUSEDPARM void *argp3 = 0 ; int res3 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - blpapi_ProviderSession_t *result = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + blpapi_ProviderSession_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:ProviderSession_createHelper",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProviderSession_createHelper" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + { + arg2 = obj1; + } + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_EventDispatcher, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProviderSession_createHelper" "', argument " "3"" of type '" "blpapi_EventDispatcher_t *""'"); + } + arg3 = (blpapi_EventDispatcher_t *)(argp3); + result = (blpapi_ProviderSession_t *)ProviderSession_createHelper(arg1,arg2,arg3); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_ProviderSession_destroyHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:ProviderSession_destroyHelper",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProviderSession_destroyHelper" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); + } + arg1 = (blpapi_ProviderSession_t *)(argp1); + { + arg2 = obj1; + } + ProviderSession_destroyHelper(arg1,arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_ProviderSession_terminateSubscriptionsOnTopic(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; + blpapi_Topic_t *arg2 = (blpapi_Topic_t *) 0 ; + char *arg3 = (char *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOO:ProviderSession_terminateSubscriptionsOnTopic",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProviderSession_terminateSubscriptionsOnTopic" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); + } + arg1 = (blpapi_ProviderSession_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProviderSession_terminateSubscriptionsOnTopic" "', argument " "2"" of type '" "blpapi_Topic_t const *""'"); + } + arg2 = (blpapi_Topic_t *)(argp2); + res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProviderSession_terminateSubscriptionsOnTopic" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = (char *)(buf3); + result = (int)ProviderSession_terminateSubscriptionsOnTopic(arg1,(struct blpapi_Topic const *)arg2,(char const *)arg3); + resultobj = SWIG_From_int((int)(result)); + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + return resultobj; +fail: + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_AuthOptions_create_default(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_AuthOptions_t **arg1 = (blpapi_AuthOptions_t **) 0 ; + blpapi_AuthOptions_t *temp1 = 0 ; + int result; + + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)":blpapi_AuthOptions_create_default")) SWIG_fail; + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_AuthOptions_create_default(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthOptions, 0)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_AuthOptions_create_forUserMode(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_AuthOptions_t **arg1 = (blpapi_AuthOptions_t **) 0 ; + blpapi_AuthUser_t *arg2 = (blpapi_AuthUser_t *) 0 ; + blpapi_AuthOptions_t *temp1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + int result; + + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthOptions_create_forUserMode",&obj0)) SWIG_fail; + res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_AuthUser, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthOptions_create_forUserMode" "', argument " "2"" of type '" "blpapi_AuthUser_t const *""'"); + } + arg2 = (blpapi_AuthUser_t *)(argp2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_AuthOptions_create_forUserMode(arg1,(struct blpapi_AuthUser const *)arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthOptions, 0)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_AuthOptions_create_forAppMode(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_AuthOptions_t **arg1 = (blpapi_AuthOptions_t **) 0 ; + blpapi_AuthApplication_t *arg2 = (blpapi_AuthApplication_t *) 0 ; + blpapi_AuthOptions_t *temp1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + int result; + + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthOptions_create_forAppMode",&obj0)) SWIG_fail; + res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_AuthApplication, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthOptions_create_forAppMode" "', argument " "2"" of type '" "blpapi_AuthApplication_t const *""'"); + } + arg2 = (blpapi_AuthApplication_t *)(argp2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_AuthOptions_create_forAppMode(arg1,(struct blpapi_AuthApplication const *)arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthOptions, 0)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_AuthOptions_create_forUserAndAppMode(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_AuthOptions_t **arg1 = (blpapi_AuthOptions_t **) 0 ; + blpapi_AuthUser_t *arg2 = (blpapi_AuthUser_t *) 0 ; + blpapi_AuthApplication_t *arg3 = (blpapi_AuthApplication_t *) 0 ; + blpapi_AuthOptions_t *temp1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_AuthOptions_create_forUserAndAppMode",&obj0,&obj1)) SWIG_fail; + res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_AuthUser, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthOptions_create_forUserAndAppMode" "', argument " "2"" of type '" "blpapi_AuthUser_t const *""'"); + } + arg2 = (blpapi_AuthUser_t *)(argp2); + res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_AuthApplication, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AuthOptions_create_forUserAndAppMode" "', argument " "3"" of type '" "blpapi_AuthApplication_t const *""'"); + } + arg3 = (blpapi_AuthApplication_t *)(argp3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_AuthOptions_create_forUserAndAppMode(arg1,(struct blpapi_AuthUser const *)arg2,(struct blpapi_AuthApplication const *)arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthOptions, 0)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_AuthOptions_create_forToken(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_AuthOptions_t **arg1 = (blpapi_AuthOptions_t **) 0 ; + blpapi_AuthToken_t *arg2 = (blpapi_AuthToken_t *) 0 ; + blpapi_AuthOptions_t *temp1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + int result; + + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthOptions_create_forToken",&obj0)) SWIG_fail; + res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_AuthToken, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthOptions_create_forToken" "', argument " "2"" of type '" "blpapi_AuthToken_t const *""'"); + } + arg2 = (blpapi_AuthToken_t *)(argp2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_AuthOptions_create_forToken(arg1,(struct blpapi_AuthToken const *)arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthOptions, 0)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_AuthOptions_duplicate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_AuthOptions_t **arg1 = (blpapi_AuthOptions_t **) 0 ; + blpapi_AuthOptions_t *arg2 = (blpapi_AuthOptions_t *) 0 ; + blpapi_AuthOptions_t *temp1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + int result; + + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthOptions_duplicate",&obj0)) SWIG_fail; + res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_AuthOptions, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthOptions_duplicate" "', argument " "2"" of type '" "blpapi_AuthOptions_t const *""'"); + } + arg2 = (blpapi_AuthOptions_t *)(argp2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_AuthOptions_duplicate(arg1,(struct blpapi_AuthOptions const *)arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthOptions, 0)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_AuthOptions_copy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_AuthOptions_t *arg1 = (blpapi_AuthOptions_t *) 0 ; + blpapi_AuthOptions_t *arg2 = (blpapi_AuthOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_AuthOptions_copy",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AuthOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AuthOptions_copy" "', argument " "1"" of type '" "blpapi_AuthOptions_t *""'"); + } + arg1 = (blpapi_AuthOptions_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_AuthOptions, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthOptions_copy" "', argument " "2"" of type '" "blpapi_AuthOptions_t const *""'"); + } + arg2 = (blpapi_AuthOptions_t *)(argp2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_AuthOptions_copy(arg1,(struct blpapi_AuthOptions const *)arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_AuthOptions_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_AuthOptions_t *arg1 = (blpapi_AuthOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthOptions_destroy",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AuthOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AuthOptions_destroy" "', argument " "1"" of type '" "blpapi_AuthOptions_t *""'"); + } + arg1 = (blpapi_AuthOptions_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_AuthOptions_destroy(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_AuthUser_createWithLogonName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_AuthUser_t **arg1 = (blpapi_AuthUser_t **) 0 ; + blpapi_AuthUser_t *temp1 = 0 ; + int result; + + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)":blpapi_AuthUser_createWithLogonName")) SWIG_fail; + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_AuthUser_createWithLogonName(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthUser, 0)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_AuthUser_createWithActiveDirectoryProperty(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_AuthUser_t **arg1 = (blpapi_AuthUser_t **) 0 ; + char *arg2 = (char *) 0 ; + blpapi_AuthUser_t *temp1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject * obj0 = 0 ; + int result; + + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthUser_createWithActiveDirectoryProperty",&obj0)) SWIG_fail; + res2 = SWIG_AsCharPtrAndSize(obj0, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthUser_createWithActiveDirectoryProperty" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_AuthUser_createWithActiveDirectoryProperty(arg1,(char const *)arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthUser, 0)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_AuthUser_createWithManualOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_AuthUser_t **arg1 = (blpapi_AuthUser_t **) 0 ; + char *arg2 = (char *) 0 ; + char *arg3 = (char *) 0 ; + blpapi_AuthUser_t *temp1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_AuthUser_createWithManualOptions",&obj0,&obj1)) SWIG_fail; + res2 = SWIG_AsCharPtrAndSize(obj0, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthUser_createWithManualOptions" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AuthUser_createWithManualOptions" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = (char *)(buf3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_AuthUser_createWithManualOptions(arg1,(char const *)arg2,(char const *)arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthUser, 0)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_AuthUser_duplicate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_AuthUser_t **arg1 = (blpapi_AuthUser_t **) 0 ; + blpapi_AuthUser_t *arg2 = (blpapi_AuthUser_t *) 0 ; + blpapi_AuthUser_t *temp1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + int result; + + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthUser_duplicate",&obj0)) SWIG_fail; + res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_AuthUser, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthUser_duplicate" "', argument " "2"" of type '" "blpapi_AuthUser_t const *""'"); + } + arg2 = (blpapi_AuthUser_t *)(argp2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_AuthUser_duplicate(arg1,(struct blpapi_AuthUser const *)arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthUser, 0)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_AuthUser_copy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_AuthUser_t *arg1 = (blpapi_AuthUser_t *) 0 ; + blpapi_AuthUser_t *arg2 = (blpapi_AuthUser_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_AuthUser_copy",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AuthUser, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AuthUser_copy" "', argument " "1"" of type '" "blpapi_AuthUser_t *""'"); + } + arg1 = (blpapi_AuthUser_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_AuthUser, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthUser_copy" "', argument " "2"" of type '" "blpapi_AuthUser_t const *""'"); + } + arg2 = (blpapi_AuthUser_t *)(argp2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_AuthUser_copy(arg1,(struct blpapi_AuthUser const *)arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_AuthUser_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_AuthUser_t *arg1 = (blpapi_AuthUser_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthUser_destroy",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AuthUser, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AuthUser_destroy" "', argument " "1"" of type '" "blpapi_AuthUser_t *""'"); + } + arg1 = (blpapi_AuthUser_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_AuthUser_destroy(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_AuthApplication_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_AuthApplication_t **arg1 = (blpapi_AuthApplication_t **) 0 ; + char *arg2 = (char *) 0 ; + blpapi_AuthApplication_t *temp1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject * obj0 = 0 ; + int result; + + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthApplication_create",&obj0)) SWIG_fail; + res2 = SWIG_AsCharPtrAndSize(obj0, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthApplication_create" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_AuthApplication_create(arg1,(char const *)arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthApplication, 0)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_AuthApplication_duplicate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_AuthApplication_t **arg1 = (blpapi_AuthApplication_t **) 0 ; + blpapi_AuthApplication_t *arg2 = (blpapi_AuthApplication_t *) 0 ; + blpapi_AuthApplication_t *temp1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + int result; + + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthApplication_duplicate",&obj0)) SWIG_fail; + res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_AuthApplication, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthApplication_duplicate" "', argument " "2"" of type '" "blpapi_AuthApplication_t const *""'"); + } + arg2 = (blpapi_AuthApplication_t *)(argp2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_AuthApplication_duplicate(arg1,(struct blpapi_AuthApplication const *)arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthApplication, 0)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_AuthApplication_copy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_AuthApplication_t *arg1 = (blpapi_AuthApplication_t *) 0 ; + blpapi_AuthApplication_t *arg2 = (blpapi_AuthApplication_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_AuthApplication_copy",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AuthApplication, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AuthApplication_copy" "', argument " "1"" of type '" "blpapi_AuthApplication_t *""'"); + } + arg1 = (blpapi_AuthApplication_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_AuthApplication, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthApplication_copy" "', argument " "2"" of type '" "blpapi_AuthApplication_t const *""'"); + } + arg2 = (blpapi_AuthApplication_t *)(argp2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_AuthApplication_copy(arg1,(struct blpapi_AuthApplication const *)arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_AuthApplication_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_AuthApplication_t *arg1 = (blpapi_AuthApplication_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthApplication_destroy",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AuthApplication, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AuthApplication_destroy" "', argument " "1"" of type '" "blpapi_AuthApplication_t *""'"); + } + arg1 = (blpapi_AuthApplication_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_AuthApplication_destroy(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_AuthToken_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_AuthToken_t **arg1 = (blpapi_AuthToken_t **) 0 ; + char *arg2 = (char *) 0 ; + blpapi_AuthToken_t *temp1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject * obj0 = 0 ; + int result; + + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthToken_create",&obj0)) SWIG_fail; + res2 = SWIG_AsCharPtrAndSize(obj0, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthToken_create" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_AuthToken_create(arg1,(char const *)arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthToken, 0)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_AuthToken_duplicate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_AuthToken_t **arg1 = (blpapi_AuthToken_t **) 0 ; + blpapi_AuthToken_t *arg2 = (blpapi_AuthToken_t *) 0 ; + blpapi_AuthToken_t *temp1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:ProviderSession_createHelper",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProviderSession_createHelper" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthToken_duplicate",&obj0)) SWIG_fail; + res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_AuthToken, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthToken_duplicate" "', argument " "2"" of type '" "blpapi_AuthToken_t const *""'"); } - arg1 = (blpapi_SessionOptions_t *)(argp1); + arg2 = (blpapi_AuthToken_t *)(argp2); { - arg2 = obj1; - } - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_EventDispatcher, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProviderSession_createHelper" "', argument " "3"" of type '" "blpapi_EventDispatcher_t *""'"); + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_AuthToken_duplicate(arg1,(struct blpapi_AuthToken const *)arg2); + SWIG_PYTHON_THREAD_END_ALLOW; } - arg3 = (blpapi_EventDispatcher_t *)(argp3); - result = (blpapi_ProviderSession_t *)ProviderSession_createHelper(arg1,arg2,arg3); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthToken, 0)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_ProviderSession_destroyHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_AuthToken_copy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - PyObject *arg2 = (PyObject *) 0 ; + blpapi_AuthToken_t *arg1 = (blpapi_AuthToken_t *) 0 ; + blpapi_AuthToken_t *arg2 = (blpapi_AuthToken_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"OO:ProviderSession_destroyHelper",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_AuthToken_copy",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AuthToken, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProviderSession_destroyHelper" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AuthToken_copy" "', argument " "1"" of type '" "blpapi_AuthToken_t *""'"); } - arg1 = (blpapi_ProviderSession_t *)(argp1); + arg1 = (blpapi_AuthToken_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_AuthToken, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthToken_copy" "', argument " "2"" of type '" "blpapi_AuthToken_t const *""'"); + } + arg2 = (blpapi_AuthToken_t *)(argp2); { - arg2 = obj1; + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_AuthToken_copy(arg1,(struct blpapi_AuthToken const *)arg2); + SWIG_PYTHON_THREAD_END_ALLOW; } - ProviderSession_destroyHelper(arg1,arg2); - resultobj = SWIG_Py_Void(); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_ProviderSession_terminateSubscriptionsOnTopic(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_AuthToken_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - blpapi_Topic_t *arg2 = (blpapi_Topic_t *) 0 ; - char *arg3 = (char *) 0 ; + blpapi_AuthToken_t *arg1 = (blpapi_AuthToken_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:ProviderSession_terminateSubscriptionsOnTopic",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthToken_destroy",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AuthToken, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProviderSession_terminateSubscriptionsOnTopic" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = (blpapi_ProviderSession_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProviderSession_terminateSubscriptionsOnTopic" "', argument " "2"" of type '" "blpapi_Topic_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AuthToken_destroy" "', argument " "1"" of type '" "blpapi_AuthToken_t *""'"); } - arg2 = (blpapi_Topic_t *)(argp2); - res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProviderSession_terminateSubscriptionsOnTopic" "', argument " "3"" of type '" "char const *""'"); + arg1 = (blpapi_AuthToken_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_AuthToken_destroy(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; } - arg3 = (char *)(buf3); - result = (int)ProviderSession_terminateSubscriptionsOnTopic(arg1,(struct blpapi_Topic const *)arg2,(char const *)arg3); - resultobj = SWIG_From_int((int)(result)); - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + resultobj = SWIG_Py_Void(); return resultobj; fail: - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return NULL; } @@ -9886,6 +10560,50 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setAutoRestartOnDisconnection(P } +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setSessionIdentityOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + blpapi_AuthOptions_t *arg2 = (blpapi_AuthOptions_t *) 0 ; + blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_SessionOptions_setSessionIdentityOptions",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setSessionIdentityOptions" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_AuthOptions, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setSessionIdentityOptions" "', argument " "2"" of type '" "blpapi_AuthOptions_t const *""'"); + } + arg2 = (blpapi_AuthOptions_t *)(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_SessionOptions_setSessionIdentityOptions" "', argument " "3"" of type '" "blpapi_CorrelationId_t *""'"); + } + arg3 = (blpapi_CorrelationId_t *)(argp3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_setSessionIdentityOptions(arg1,(struct blpapi_AuthOptions const *)arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setAuthenticationOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; @@ -11687,7 +12405,6 @@ SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_isResolvedAt(PyObject *SWIGUN void *argp1 = 0 ; int res1 = 0 ; int temp2 ; - int res2 = SWIG_TMPOBJ ; size_t val3 ; int ecode3 = 0 ; PyObject * obj0 = 0 ; @@ -11712,12 +12429,7 @@ SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_isResolvedAt(PyObject *SWIGUN SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - if (SWIG_IsTmpObj(res2)) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg2))); - } else { - int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_int, new_flags)); - } + resultobj = SWIG_Python_AppendOutput(resultobj, PyInt_FromLong(*arg2)); return resultobj; fail: return NULL; @@ -13231,14 +13943,14 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_name(PyObject *SWIGUNU blpapi_Name_t *result = 0 ; if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaElementDefinition_name",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_name" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); } arg1 = (blpapi_SchemaElementDefinition_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Name_t *)blpapi_SchemaElementDefinition_name((void *const *)arg1); + result = (blpapi_Name_t *)blpapi_SchemaElementDefinition_name((struct blpapi_SchemaElementDefinition const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); @@ -13257,14 +13969,14 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_description(PyObject * char *result = 0 ; if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaElementDefinition_description",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_description" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); } arg1 = (blpapi_SchemaElementDefinition_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_SchemaElementDefinition_description((void *const *)arg1); + result = (char *)blpapi_SchemaElementDefinition_description((struct blpapi_SchemaElementDefinition const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_FromCharPtr((const char *)result); @@ -13283,14 +13995,14 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_status(PyObject *SWIGU int result; if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaElementDefinition_status",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_status" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); } arg1 = (blpapi_SchemaElementDefinition_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SchemaElementDefinition_status((void *const *)arg1); + result = (int)blpapi_SchemaElementDefinition_status((struct blpapi_SchemaElementDefinition const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); @@ -13309,14 +14021,14 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_type(PyObject *SWIGUNU blpapi_SchemaTypeDefinition_t *result = 0 ; if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaElementDefinition_type",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_type" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); } arg1 = (blpapi_SchemaElementDefinition_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_SchemaTypeDefinition_t *)blpapi_SchemaElementDefinition_type((void *const *)arg1); + result = (blpapi_SchemaTypeDefinition_t *)blpapi_SchemaElementDefinition_type((struct blpapi_SchemaElementDefinition const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_void, 0 | 0 ); @@ -13335,14 +14047,14 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_numAlternateNames(PyOb size_t result; if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaElementDefinition_numAlternateNames",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_numAlternateNames" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); } arg1 = (blpapi_SchemaElementDefinition_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = blpapi_SchemaElementDefinition_numAlternateNames((void *const *)arg1); + result = blpapi_SchemaElementDefinition_numAlternateNames((struct blpapi_SchemaElementDefinition const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_size_t((size_t)(result)); @@ -13365,7 +14077,7 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_getAlternateName(PyObj blpapi_Name_t *result = 0 ; if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SchemaElementDefinition_getAlternateName",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_getAlternateName" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); } @@ -13377,7 +14089,7 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_getAlternateName(PyObj arg2 = (size_t)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Name_t *)blpapi_SchemaElementDefinition_getAlternateName((void *const *)arg1,arg2); + result = (blpapi_Name_t *)blpapi_SchemaElementDefinition_getAlternateName((struct blpapi_SchemaElementDefinition const *)arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); @@ -13396,14 +14108,14 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_minValues(PyObject *SW size_t result; if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaElementDefinition_minValues",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_minValues" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); } arg1 = (blpapi_SchemaElementDefinition_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = blpapi_SchemaElementDefinition_minValues((void *const *)arg1); + result = blpapi_SchemaElementDefinition_minValues((struct blpapi_SchemaElementDefinition const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_size_t((size_t)(result)); @@ -13422,14 +14134,14 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_maxValues(PyObject *SW size_t result; if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaElementDefinition_maxValues",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_maxValues" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); } arg1 = (blpapi_SchemaElementDefinition_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = blpapi_SchemaElementDefinition_maxValues((void *const *)arg1); + result = blpapi_SchemaElementDefinition_maxValues((struct blpapi_SchemaElementDefinition const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_size_t((size_t)(result)); @@ -13685,7 +14397,7 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_getElementDefinition(PyOb result = (blpapi_SchemaElementDefinition_t *)blpapi_SchemaTypeDefinition_getElementDefinition((void *const *)arg1,(char const *)arg2,(struct blpapi_Name const *)arg3); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_void, 0 | 0 ); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: @@ -13722,7 +14434,7 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_getElementDefinitionAt(Py result = (blpapi_SchemaElementDefinition_t *)blpapi_SchemaTypeDefinition_getElementDefinitionAt((void *const *)arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_void, 0 | 0 ); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); return resultobj; fail: return NULL; @@ -13941,7 +14653,7 @@ SWIGINTERN PyObject *_wrap_blpapi_Operation_requestDefinition(PyObject *SWIGUNUS SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_p_void, 0)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_SchemaElementDefinition, 0)); return resultobj; fail: return NULL; @@ -14006,7 +14718,46 @@ SWIGINTERN PyObject *_wrap_blpapi_Operation_responseDefinition(PyObject *SWIGUNU SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_p_void, 0)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_SchemaElementDefinition, 0)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Operation_responseDefinitionFromName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Operation_t *arg1 = (blpapi_Operation_t *) 0 ; + blpapi_SchemaElementDefinition_t **arg2 = (blpapi_SchemaElementDefinition_t **) 0 ; + blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_SchemaElementDefinition_t *temp2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Operation_responseDefinitionFromName",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Operation, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Operation_responseDefinitionFromName" "', argument " "1"" of type '" "blpapi_Operation_t *""'"); + } + arg1 = (blpapi_Operation_t *)(argp1); + res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Operation_responseDefinitionFromName" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); + } + arg3 = (blpapi_Name_t *)(argp3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Operation_responseDefinitionFromName(arg1,arg2,(struct blpapi_Name const *)arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_SchemaElementDefinition, 0)); return resultobj; fail: return NULL; @@ -14326,7 +15077,7 @@ SWIGINTERN PyObject *_wrap_blpapi_Service_getEventDefinition(PyObject *SWIGUNUSE SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_p_void, 0)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_SchemaElementDefinition, 0)); if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return resultobj; fail: @@ -14367,7 +15118,7 @@ SWIGINTERN PyObject *_wrap_blpapi_Service_getEventDefinitionAt(PyObject *SWIGUNU SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_p_void, 0)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_SchemaElementDefinition, 0)); return resultobj; fail: return NULL; @@ -15368,7 +16119,6 @@ SWIGINTERN PyObject *_wrap_blpapi_Identity_getSeatType(PyObject *SWIGUNUSEDPARM( void *argp1 = 0 ; int res1 = 0 ; int temp2 ; - int res2 = SWIG_TMPOBJ ; PyObject * obj0 = 0 ; int result; @@ -15385,12 +16135,7 @@ SWIGINTERN PyObject *_wrap_blpapi_Identity_getSeatType(PyObject *SWIGUNUSEDPARM( SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - if (SWIG_IsTmpObj(res2)) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg2))); - } else { - int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_int, new_flags)); - } + resultobj = SWIG_Python_AppendOutput(resultobj, PyInt_FromLong(*arg2)); return resultobj; fail: return NULL; @@ -15835,6 +16580,89 @@ SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_createIdentity(PyObject *SWIGU } +SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_generateAuthorizedIdentityAsync(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; + blpapi_AuthOptions_t *arg2 = (blpapi_AuthOptions_t *) 0 ; + blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_AbstractSession_generateAuthorizedIdentityAsync",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_generateAuthorizedIdentityAsync" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); + } + arg1 = (blpapi_AbstractSession_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_AuthOptions, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_generateAuthorizedIdentityAsync" "', argument " "2"" of type '" "blpapi_AuthOptions_t const *""'"); + } + arg2 = (blpapi_AuthOptions_t *)(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AbstractSession_generateAuthorizedIdentityAsync" "', argument " "3"" of type '" "blpapi_CorrelationId_t *""'"); + } + arg3 = (blpapi_CorrelationId_t *)(argp3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_AbstractSession_generateAuthorizedIdentityAsync(arg1,(struct blpapi_AuthOptions const *)arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_getAuthorizedIdentity(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; + blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; + blpapi_Identity_t **arg3 = (blpapi_Identity_t **) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + blpapi_Identity_t *temp3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg3 = &temp3; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_AbstractSession_getAuthorizedIdentity",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_getAuthorizedIdentity" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); + } + arg1 = (blpapi_AbstractSession_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_getAuthorizedIdentity" "', argument " "2"" of type '" "blpapi_CorrelationId_t const *""'"); + } + arg2 = (blpapi_CorrelationId_t *)(argp2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_AbstractSession_getAuthorizedIdentity(arg1,(struct blpapi_CorrelationId_t_ const *)arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg3), SWIGTYPE_p_blpapi_Identity, 0)); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_blpapi_Session_start(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; @@ -16857,7 +17685,6 @@ SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_status(PyObject *SWIGUNUSEDPARM void *argp1 = 0 ; int res1 = 0 ; int temp2 ; - int res2 = SWIG_TMPOBJ ; void *argp3 = 0 ; int res3 = 0 ; PyObject * obj0 = 0 ; @@ -16882,12 +17709,7 @@ SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_status(PyObject *SWIGUNUSEDPARM SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - if (SWIG_IsTmpObj(res2)) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg2))); - } else { - int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_int, new_flags)); - } + resultobj = SWIG_Python_AppendOutput(resultobj, PyInt_FromLong(*arg2)); return resultobj; fail: return NULL; @@ -16902,7 +17724,6 @@ SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_statusAt(PyObject *SWIGUNUSEDPA void *argp1 = 0 ; int res1 = 0 ; int temp2 ; - int res2 = SWIG_TMPOBJ ; size_t val3 ; int ecode3 = 0 ; PyObject * obj0 = 0 ; @@ -16927,12 +17748,7 @@ SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_statusAt(PyObject *SWIGUNUSEDPA SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - if (SWIG_IsTmpObj(res2)) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg2))); - } else { - int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_int, new_flags)); - } + resultobj = SWIG_Python_AppendOutput(resultobj, PyInt_FromLong(*arg2)); return resultobj; fail: return NULL; @@ -17548,7 +18364,6 @@ SWIGINTERN PyObject *_wrap_blpapi_TopicList_status(PyObject *SWIGUNUSEDPARM(self void *argp1 = 0 ; int res1 = 0 ; int temp2 ; - int res2 = SWIG_TMPOBJ ; void *argp3 = 0 ; int res3 = 0 ; PyObject * obj0 = 0 ; @@ -17573,12 +18388,7 @@ SWIGINTERN PyObject *_wrap_blpapi_TopicList_status(PyObject *SWIGUNUSEDPARM(self SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - if (SWIG_IsTmpObj(res2)) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg2))); - } else { - int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_int, new_flags)); - } + resultobj = SWIG_Python_AppendOutput(resultobj, PyInt_FromLong(*arg2)); return resultobj; fail: return NULL; @@ -17593,7 +18403,6 @@ SWIGINTERN PyObject *_wrap_blpapi_TopicList_statusAt(PyObject *SWIGUNUSEDPARM(se void *argp1 = 0 ; int res1 = 0 ; int temp2 ; - int res2 = SWIG_TMPOBJ ; size_t val3 ; int ecode3 = 0 ; PyObject * obj0 = 0 ; @@ -17618,12 +18427,7 @@ SWIGINTERN PyObject *_wrap_blpapi_TopicList_statusAt(PyObject *SWIGUNUSEDPARM(se SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - if (SWIG_IsTmpObj(res2)) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg2))); - } else { - int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_int, new_flags)); - } + resultobj = SWIG_Python_AppendOutput(resultobj, PyInt_FromLong(*arg2)); return resultobj; fail: return NULL; @@ -18804,7 +19608,6 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_flushPublishedEvents(PyObject void *argp1 = 0 ; int res1 = 0 ; int temp2 ; - int res2 = SWIG_TMPOBJ ; int val3 ; int ecode3 = 0 ; PyObject * obj0 = 0 ; @@ -18829,12 +19632,7 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_flushPublishedEvents(PyObject SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - if (SWIG_IsTmpObj(res2)) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg2))); - } else { - int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_int, new_flags)); - } + resultobj = SWIG_Python_AppendOutput(resultobj, PyInt_FromLong(*arg2)); return resultobj; fail: return NULL; @@ -19352,13 +20150,13 @@ static PyMethodDef SwigMethods[] = { { (char *)"blpapi_Element_setValueInt32", _wrap_blpapi_Element_setValueInt32, METH_VARARGS, NULL}, { (char *)"blpapi_Element_setValueInt64", _wrap_blpapi_Element_setValueInt64, METH_VARARGS, NULL}, { (char *)"blpapi_Element_setValueString", _wrap_blpapi_Element_setValueString, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_setValueDatetime", _wrap_blpapi_Element_setValueDatetime, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_setValueHighPrecisionDatetime", _wrap_blpapi_Element_setValueHighPrecisionDatetime, METH_VARARGS, NULL}, { (char *)"blpapi_Element_setValueFromName", _wrap_blpapi_Element_setValueFromName, METH_VARARGS, NULL}, { (char *)"blpapi_Element_setElementBool", _wrap_blpapi_Element_setElementBool, METH_VARARGS, NULL}, { (char *)"blpapi_Element_setElementInt32", _wrap_blpapi_Element_setElementInt32, METH_VARARGS, NULL}, { (char *)"blpapi_Element_setElementInt64", _wrap_blpapi_Element_setElementInt64, METH_VARARGS, NULL}, { (char *)"blpapi_Element_setElementString", _wrap_blpapi_Element_setElementString, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_setElementDatetime", _wrap_blpapi_Element_setElementDatetime, METH_VARARGS, NULL}, + { (char *)"blpapi_Element_setElementHighPrecisionDatetime", _wrap_blpapi_Element_setElementHighPrecisionDatetime, METH_VARARGS, NULL}, { (char *)"blpapi_Element_setElementFromName", _wrap_blpapi_Element_setElementFromName, METH_VARARGS, NULL}, { (char *)"blpapi_Element_appendElement", _wrap_blpapi_Element_appendElement, METH_VARARGS, NULL}, { (char *)"blpapi_Element_setChoice", _wrap_blpapi_Element_setChoice, METH_VARARGS, NULL}, @@ -19377,7 +20175,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"blpapi_EventFormatter_setValueChar", _wrap_blpapi_EventFormatter_setValueChar, METH_VARARGS, NULL}, { (char *)"blpapi_EventFormatter_setValueInt32", _wrap_blpapi_EventFormatter_setValueInt32, METH_VARARGS, NULL}, { (char *)"blpapi_EventFormatter_setValueInt64", _wrap_blpapi_EventFormatter_setValueInt64, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_setValueDatetime", _wrap_blpapi_EventFormatter_setValueDatetime, METH_VARARGS, NULL}, + { (char *)"blpapi_EventFormatter_setValueHighPrecisionDatetime", _wrap_blpapi_EventFormatter_setValueHighPrecisionDatetime, METH_VARARGS, NULL}, { (char *)"blpapi_EventFormatter_setValueString", _wrap_blpapi_EventFormatter_setValueString, METH_VARARGS, NULL}, { (char *)"blpapi_EventFormatter_setValueFromName", _wrap_blpapi_EventFormatter_setValueFromName, METH_VARARGS, NULL}, { (char *)"blpapi_EventFormatter_setValueNull", _wrap_blpapi_EventFormatter_setValueNull, METH_VARARGS, NULL}, @@ -19387,7 +20185,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"blpapi_EventFormatter_appendValueChar", _wrap_blpapi_EventFormatter_appendValueChar, METH_VARARGS, NULL}, { (char *)"blpapi_EventFormatter_appendValueInt32", _wrap_blpapi_EventFormatter_appendValueInt32, METH_VARARGS, NULL}, { (char *)"blpapi_EventFormatter_appendValueInt64", _wrap_blpapi_EventFormatter_appendValueInt64, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_appendValueDatetime", _wrap_blpapi_EventFormatter_appendValueDatetime, METH_VARARGS, NULL}, + { (char *)"blpapi_EventFormatter_appendValueHighPrecisionDatetime", _wrap_blpapi_EventFormatter_appendValueHighPrecisionDatetime, METH_VARARGS, NULL}, { (char *)"blpapi_EventFormatter_appendValueString", _wrap_blpapi_EventFormatter_appendValueString, METH_VARARGS, NULL}, { (char *)"blpapi_EventFormatter_appendValueFromName", _wrap_blpapi_EventFormatter_appendValueFromName, METH_VARARGS, NULL}, { (char *)"blpapi_EventFormatter_appendElement", _wrap_blpapi_EventFormatter_appendElement, METH_VARARGS, NULL}, @@ -19399,6 +20197,28 @@ static PyMethodDef SwigMethods[] = { { (char *)"ProviderSession_createHelper", _wrap_ProviderSession_createHelper, METH_VARARGS, NULL}, { (char *)"ProviderSession_destroyHelper", _wrap_ProviderSession_destroyHelper, METH_VARARGS, NULL}, { (char *)"ProviderSession_terminateSubscriptionsOnTopic", _wrap_ProviderSession_terminateSubscriptionsOnTopic, METH_VARARGS, NULL}, + { (char *)"blpapi_AuthOptions_create_default", _wrap_blpapi_AuthOptions_create_default, METH_VARARGS, NULL}, + { (char *)"blpapi_AuthOptions_create_forUserMode", _wrap_blpapi_AuthOptions_create_forUserMode, METH_VARARGS, NULL}, + { (char *)"blpapi_AuthOptions_create_forAppMode", _wrap_blpapi_AuthOptions_create_forAppMode, METH_VARARGS, NULL}, + { (char *)"blpapi_AuthOptions_create_forUserAndAppMode", _wrap_blpapi_AuthOptions_create_forUserAndAppMode, METH_VARARGS, NULL}, + { (char *)"blpapi_AuthOptions_create_forToken", _wrap_blpapi_AuthOptions_create_forToken, METH_VARARGS, NULL}, + { (char *)"blpapi_AuthOptions_duplicate", _wrap_blpapi_AuthOptions_duplicate, METH_VARARGS, NULL}, + { (char *)"blpapi_AuthOptions_copy", _wrap_blpapi_AuthOptions_copy, METH_VARARGS, NULL}, + { (char *)"blpapi_AuthOptions_destroy", _wrap_blpapi_AuthOptions_destroy, METH_VARARGS, NULL}, + { (char *)"blpapi_AuthUser_createWithLogonName", _wrap_blpapi_AuthUser_createWithLogonName, METH_VARARGS, NULL}, + { (char *)"blpapi_AuthUser_createWithActiveDirectoryProperty", _wrap_blpapi_AuthUser_createWithActiveDirectoryProperty, METH_VARARGS, NULL}, + { (char *)"blpapi_AuthUser_createWithManualOptions", _wrap_blpapi_AuthUser_createWithManualOptions, METH_VARARGS, NULL}, + { (char *)"blpapi_AuthUser_duplicate", _wrap_blpapi_AuthUser_duplicate, METH_VARARGS, NULL}, + { (char *)"blpapi_AuthUser_copy", _wrap_blpapi_AuthUser_copy, METH_VARARGS, NULL}, + { (char *)"blpapi_AuthUser_destroy", _wrap_blpapi_AuthUser_destroy, METH_VARARGS, NULL}, + { (char *)"blpapi_AuthApplication_create", _wrap_blpapi_AuthApplication_create, METH_VARARGS, NULL}, + { (char *)"blpapi_AuthApplication_duplicate", _wrap_blpapi_AuthApplication_duplicate, METH_VARARGS, NULL}, + { (char *)"blpapi_AuthApplication_copy", _wrap_blpapi_AuthApplication_copy, METH_VARARGS, NULL}, + { (char *)"blpapi_AuthApplication_destroy", _wrap_blpapi_AuthApplication_destroy, METH_VARARGS, NULL}, + { (char *)"blpapi_AuthToken_create", _wrap_blpapi_AuthToken_create, METH_VARARGS, NULL}, + { (char *)"blpapi_AuthToken_duplicate", _wrap_blpapi_AuthToken_duplicate, METH_VARARGS, NULL}, + { (char *)"blpapi_AuthToken_copy", _wrap_blpapi_AuthToken_copy, METH_VARARGS, NULL}, + { (char *)"blpapi_AuthToken_destroy", _wrap_blpapi_AuthToken_destroy, METH_VARARGS, NULL}, { (char *)"blpapi_getLastErrorDescription", _wrap_blpapi_getLastErrorDescription, METH_VARARGS, NULL}, { (char *)"blpapi_SessionOptions_create", _wrap_blpapi_SessionOptions_create, METH_VARARGS, NULL}, { (char *)"blpapi_SessionOptions_destroy", _wrap_blpapi_SessionOptions_destroy, METH_VARARGS, NULL}, @@ -19414,6 +20234,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"blpapi_SessionOptions_setClientMode", _wrap_blpapi_SessionOptions_setClientMode, METH_VARARGS, NULL}, { (char *)"blpapi_SessionOptions_setMaxPendingRequests", _wrap_blpapi_SessionOptions_setMaxPendingRequests, METH_VARARGS, NULL}, { (char *)"blpapi_SessionOptions_setAutoRestartOnDisconnection", _wrap_blpapi_SessionOptions_setAutoRestartOnDisconnection, METH_VARARGS, NULL}, + { (char *)"blpapi_SessionOptions_setSessionIdentityOptions", _wrap_blpapi_SessionOptions_setSessionIdentityOptions, METH_VARARGS, NULL}, { (char *)"blpapi_SessionOptions_setAuthenticationOptions", _wrap_blpapi_SessionOptions_setAuthenticationOptions, METH_VARARGS, NULL}, { (char *)"blpapi_SessionOptions_setNumStartAttempts", _wrap_blpapi_SessionOptions_setNumStartAttempts, METH_VARARGS, NULL}, { (char *)"blpapi_SessionOptions_setMaxEventQueueSize", _wrap_blpapi_SessionOptions_setMaxEventQueueSize, METH_VARARGS, NULL}, @@ -19553,6 +20374,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"blpapi_Operation_requestDefinition", _wrap_blpapi_Operation_requestDefinition, METH_VARARGS, NULL}, { (char *)"blpapi_Operation_numResponseDefinitions", _wrap_blpapi_Operation_numResponseDefinitions, METH_VARARGS, NULL}, { (char *)"blpapi_Operation_responseDefinition", _wrap_blpapi_Operation_responseDefinition, METH_VARARGS, NULL}, + { (char *)"blpapi_Operation_responseDefinitionFromName", _wrap_blpapi_Operation_responseDefinitionFromName, METH_VARARGS, NULL}, { (char *)"blpapi_Service_name", _wrap_blpapi_Service_name, METH_VARARGS, NULL}, { (char *)"blpapi_Service_description", _wrap_blpapi_Service_description, METH_VARARGS, NULL}, { (char *)"blpapi_Service_numOperations", _wrap_blpapi_Service_numOperations, METH_VARARGS, NULL}, @@ -19605,6 +20427,8 @@ static PyMethodDef SwigMethods[] = { { (char *)"blpapi_AbstractSession_generateManualToken", _wrap_blpapi_AbstractSession_generateManualToken, METH_VARARGS, NULL}, { (char *)"blpapi_AbstractSession_getService", _wrap_blpapi_AbstractSession_getService, METH_VARARGS, NULL}, { (char *)"blpapi_AbstractSession_createIdentity", _wrap_blpapi_AbstractSession_createIdentity, METH_VARARGS, NULL}, + { (char *)"blpapi_AbstractSession_generateAuthorizedIdentityAsync", _wrap_blpapi_AbstractSession_generateAuthorizedIdentityAsync, METH_VARARGS, NULL}, + { (char *)"blpapi_AbstractSession_getAuthorizedIdentity", _wrap_blpapi_AbstractSession_getAuthorizedIdentity, METH_VARARGS, NULL}, { (char *)"blpapi_Session_start", _wrap_blpapi_Session_start, METH_VARARGS, NULL}, { (char *)"blpapi_Session_startAsync", _wrap_blpapi_Session_startAsync, METH_VARARGS, NULL}, { (char *)"blpapi_Session_stop", _wrap_blpapi_Session_stop, METH_VARARGS, NULL}, @@ -19702,6 +20526,10 @@ static void *_p_intArrayTo_p_int(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((int *) ((intArray *) x)); } static swig_type_info _swigt__p_blpapi_AbstractSession = {"_p_blpapi_AbstractSession", "struct blpapi_AbstractSession *|blpapi_AbstractSession_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_AuthApplication = {"_p_blpapi_AuthApplication", "blpapi_AuthApplication_t *|struct blpapi_AuthApplication *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_AuthOptions = {"_p_blpapi_AuthOptions", "struct blpapi_AuthOptions *|blpapi_AuthOptions_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_AuthToken = {"_p_blpapi_AuthToken", "blpapi_AuthToken_t *|struct blpapi_AuthToken *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_AuthUser = {"_p_blpapi_AuthUser", "struct blpapi_AuthUser *|blpapi_AuthUser_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_blpapi_Constant = {"_p_blpapi_Constant", "struct blpapi_Constant *|blpapi_Constant_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_blpapi_ConstantList = {"_p_blpapi_ConstantList", "struct blpapi_ConstantList *|blpapi_ConstantList_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_blpapi_CorrelationId_t_ = {"_p_blpapi_CorrelationId_t_", "struct blpapi_CorrelationId_t_ *|blpapi_CorrelationId_t_ *|blpapi_CorrelationId_t *", 0, 0, (void*)0, 0}; @@ -19718,13 +20546,16 @@ static swig_type_info _swigt__p_blpapi_Logging_Func_t = {"_p_blpapi_Logging_Func static swig_type_info _swigt__p_blpapi_Logging_Severity_t = {"_p_blpapi_Logging_Severity_t", "enum blpapi_Logging_Severity_t *|blpapi_Logging_Severity_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_blpapi_ManagedPtr_t_ = {"_p_blpapi_ManagedPtr_t_", "blpapi_ManagedPtr_t *|struct blpapi_ManagedPtr_t_ *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_blpapi_Message = {"_p_blpapi_Message", "struct blpapi_Message *|blpapi_Message_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_MessageFormatter = {"_p_blpapi_MessageFormatter", "struct blpapi_MessageFormatter *|blpapi_MessageFormatter_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_blpapi_MessageIterator = {"_p_blpapi_MessageIterator", "struct blpapi_MessageIterator *|blpapi_MessageIterator_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_MessageProperties = {"_p_blpapi_MessageProperties", "blpapi_MessageProperties_t *|struct blpapi_MessageProperties *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_blpapi_Name = {"_p_blpapi_Name", "struct blpapi_Name *|blpapi_Name_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_blpapi_Operation = {"_p_blpapi_Operation", "blpapi_Operation_t *|struct blpapi_Operation *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_blpapi_ProviderSession = {"_p_blpapi_ProviderSession", "struct blpapi_ProviderSession *|blpapi_ProviderSession_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_blpapi_Request = {"_p_blpapi_Request", "struct blpapi_Request *|blpapi_Request_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_blpapi_RequestTemplate = {"_p_blpapi_RequestTemplate", "blpapi_RequestTemplate_t *|struct blpapi_RequestTemplate *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_blpapi_ResolutionList = {"_p_blpapi_ResolutionList", "struct blpapi_ResolutionList *|blpapi_ResolutionList_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_SchemaElementDefinition = {"_p_blpapi_SchemaElementDefinition", "blpapi_SchemaElementDefinition_t *|struct blpapi_SchemaElementDefinition *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_blpapi_Service = {"_p_blpapi_Service", "blpapi_Service_t *|struct blpapi_Service *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_blpapi_ServiceRegistrationOptions = {"_p_blpapi_ServiceRegistrationOptions", "struct blpapi_ServiceRegistrationOptions *|blpapi_ServiceRegistrationOptions_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_blpapi_Session = {"_p_blpapi_Session", "struct blpapi_Session *|blpapi_Session_t *", 0, 0, (void*)0, 0}; @@ -19743,18 +20574,23 @@ static swig_type_info _swigt__p_float = {"_p_float", "blpapi_Float32_t *|float * static swig_type_info _swigt__p_int = {"_p_int", "blpapi_Bool_t *|int *|blpapi_Int32_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_intArray = {"_p_intArray", "intArray *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_long_long = {"_p_long_long", "blpapi_Int64_t *|long long *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_p_blpapi_AuthApplication = {"_p_p_blpapi_AuthApplication", "struct blpapi_AuthApplication **|blpapi_AuthApplication_t **", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_p_blpapi_AuthOptions = {"_p_p_blpapi_AuthOptions", "blpapi_AuthOptions_t **|struct blpapi_AuthOptions **", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_p_blpapi_AuthToken = {"_p_p_blpapi_AuthToken", "blpapi_AuthToken_t **|struct blpapi_AuthToken **", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_p_blpapi_AuthUser = {"_p_p_blpapi_AuthUser", "blpapi_AuthUser_t **|struct blpapi_AuthUser **", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_p_blpapi_Element = {"_p_p_blpapi_Element", "struct blpapi_Element **|blpapi_Element_t **", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_p_blpapi_Event = {"_p_p_blpapi_Event", "struct blpapi_Event **|blpapi_Event_t **", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_p_blpapi_Identity = {"_p_p_blpapi_Identity", "blpapi_Identity_t **|struct blpapi_Identity **", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_p_blpapi_Message = {"_p_p_blpapi_Message", "blpapi_Message_t **|struct blpapi_Message **", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_p_blpapi_Name = {"_p_p_blpapi_Name", "struct blpapi_Name **|blpapi_Name_t **", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_p_blpapi_Operation = {"_p_p_blpapi_Operation", "struct blpapi_Operation **|blpapi_Operation_t **", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_p_blpapi_Request = {"_p_p_blpapi_Request", "blpapi_Request_t **|struct blpapi_Request **", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_p_blpapi_RequestTemplate = {"_p_p_blpapi_RequestTemplate", "struct blpapi_RequestTemplate **|blpapi_RequestTemplate_t **", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_p_blpapi_SchemaElementDefinition = {"_p_p_blpapi_SchemaElementDefinition", "struct blpapi_SchemaElementDefinition **|blpapi_SchemaElementDefinition_t **", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_p_blpapi_Service = {"_p_p_blpapi_Service", "blpapi_Service_t **|struct blpapi_Service **", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_p_blpapi_Topic = {"_p_p_blpapi_Topic", "struct blpapi_Topic **|blpapi_Topic_t **", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_p_void = {"_p_p_p_void", "blpapi_SchemaElementDefinition_t **|void ***", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_void = {"_p_p_void", "blpapi_SchemaElementDefinition_t *|blpapi_SchemaTypeDefinition_t *|void **", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_p_void = {"_p_p_void", "blpapi_SchemaTypeDefinition_t *|void **", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_short = {"_p_short", "short *|blpapi_Int16_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "unsigned char *|blpapi_UChar_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_unsigned_int = {"_p_unsigned_int", "blpapi_UInt32_t *|unsigned int *", 0, 0, (void*)0, 0}; @@ -19763,6 +20599,10 @@ static swig_type_info _swigt__p_unsigned_short = {"_p_unsigned_short", "unsigned static swig_type_info *swig_type_initial[] = { &_swigt__p_blpapi_AbstractSession, + &_swigt__p_blpapi_AuthApplication, + &_swigt__p_blpapi_AuthOptions, + &_swigt__p_blpapi_AuthToken, + &_swigt__p_blpapi_AuthUser, &_swigt__p_blpapi_Constant, &_swigt__p_blpapi_ConstantList, &_swigt__p_blpapi_CorrelationId_t_, @@ -19779,13 +20619,16 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_blpapi_Logging_Severity_t, &_swigt__p_blpapi_ManagedPtr_t_, &_swigt__p_blpapi_Message, + &_swigt__p_blpapi_MessageFormatter, &_swigt__p_blpapi_MessageIterator, + &_swigt__p_blpapi_MessageProperties, &_swigt__p_blpapi_Name, &_swigt__p_blpapi_Operation, &_swigt__p_blpapi_ProviderSession, &_swigt__p_blpapi_Request, &_swigt__p_blpapi_RequestTemplate, &_swigt__p_blpapi_ResolutionList, + &_swigt__p_blpapi_SchemaElementDefinition, &_swigt__p_blpapi_Service, &_swigt__p_blpapi_ServiceRegistrationOptions, &_swigt__p_blpapi_Session, @@ -19804,17 +20647,22 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_int, &_swigt__p_intArray, &_swigt__p_long_long, + &_swigt__p_p_blpapi_AuthApplication, + &_swigt__p_p_blpapi_AuthOptions, + &_swigt__p_p_blpapi_AuthToken, + &_swigt__p_p_blpapi_AuthUser, &_swigt__p_p_blpapi_Element, &_swigt__p_p_blpapi_Event, + &_swigt__p_p_blpapi_Identity, &_swigt__p_p_blpapi_Message, &_swigt__p_p_blpapi_Name, &_swigt__p_p_blpapi_Operation, &_swigt__p_p_blpapi_Request, &_swigt__p_p_blpapi_RequestTemplate, + &_swigt__p_p_blpapi_SchemaElementDefinition, &_swigt__p_p_blpapi_Service, &_swigt__p_p_blpapi_Topic, &_swigt__p_p_char, - &_swigt__p_p_p_void, &_swigt__p_p_void, &_swigt__p_short, &_swigt__p_unsigned_char, @@ -19824,6 +20672,10 @@ static swig_type_info *swig_type_initial[] = { }; static swig_cast_info _swigc__p_blpapi_AbstractSession[] = { {&_swigt__p_blpapi_AbstractSession, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_AuthApplication[] = { {&_swigt__p_blpapi_AuthApplication, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_AuthOptions[] = { {&_swigt__p_blpapi_AuthOptions, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_AuthToken[] = { {&_swigt__p_blpapi_AuthToken, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_AuthUser[] = { {&_swigt__p_blpapi_AuthUser, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_blpapi_Constant[] = { {&_swigt__p_blpapi_Constant, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_blpapi_ConstantList[] = { {&_swigt__p_blpapi_ConstantList, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_blpapi_CorrelationId_t_[] = { {&_swigt__p_blpapi_CorrelationId_t_, 0, 0, 0},{0, 0, 0, 0}}; @@ -19840,13 +20692,16 @@ static swig_cast_info _swigc__p_blpapi_Logging_Func_t[] = { {&_swigt__p_blpapi_ static swig_cast_info _swigc__p_blpapi_Logging_Severity_t[] = { {&_swigt__p_blpapi_Logging_Severity_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_blpapi_ManagedPtr_t_[] = { {&_swigt__p_blpapi_ManagedPtr_t_, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_blpapi_Message[] = { {&_swigt__p_blpapi_Message, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_MessageFormatter[] = { {&_swigt__p_blpapi_MessageFormatter, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_blpapi_MessageIterator[] = { {&_swigt__p_blpapi_MessageIterator, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_MessageProperties[] = { {&_swigt__p_blpapi_MessageProperties, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_blpapi_Name[] = { {&_swigt__p_blpapi_Name, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_blpapi_Operation[] = { {&_swigt__p_blpapi_Operation, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_blpapi_ProviderSession[] = { {&_swigt__p_blpapi_ProviderSession, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_blpapi_Request[] = { {&_swigt__p_blpapi_Request, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_blpapi_RequestTemplate[] = { {&_swigt__p_blpapi_RequestTemplate, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_blpapi_ResolutionList[] = { {&_swigt__p_blpapi_ResolutionList, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_SchemaElementDefinition[] = { {&_swigt__p_blpapi_SchemaElementDefinition, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_blpapi_Service[] = { {&_swigt__p_blpapi_Service, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_blpapi_ServiceRegistrationOptions[] = { {&_swigt__p_blpapi_ServiceRegistrationOptions, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_blpapi_Session[] = { {&_swigt__p_blpapi_Session, 0, 0, 0},{0, 0, 0, 0}}; @@ -19865,17 +20720,22 @@ static swig_cast_info _swigc__p_float[] = { {&_swigt__p_float, 0, 0, 0},{0, 0, static swig_cast_info _swigc__p_int[] = { {&_swigt__p_intArray, _p_intArrayTo_p_int, 0, 0}, {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_intArray[] = { {&_swigt__p_intArray, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_long_long[] = { {&_swigt__p_long_long, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_p_blpapi_AuthApplication[] = { {&_swigt__p_p_blpapi_AuthApplication, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_p_blpapi_AuthOptions[] = { {&_swigt__p_p_blpapi_AuthOptions, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_p_blpapi_AuthToken[] = { {&_swigt__p_p_blpapi_AuthToken, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_p_blpapi_AuthUser[] = { {&_swigt__p_p_blpapi_AuthUser, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_p_blpapi_Element[] = { {&_swigt__p_p_blpapi_Element, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_p_blpapi_Event[] = { {&_swigt__p_p_blpapi_Event, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_p_blpapi_Identity[] = { {&_swigt__p_p_blpapi_Identity, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_p_blpapi_Message[] = { {&_swigt__p_p_blpapi_Message, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_p_blpapi_Name[] = { {&_swigt__p_p_blpapi_Name, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_p_blpapi_Operation[] = { {&_swigt__p_p_blpapi_Operation, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_p_blpapi_Request[] = { {&_swigt__p_p_blpapi_Request, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_p_blpapi_RequestTemplate[] = { {&_swigt__p_p_blpapi_RequestTemplate, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_p_blpapi_SchemaElementDefinition[] = { {&_swigt__p_p_blpapi_SchemaElementDefinition, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_p_blpapi_Service[] = { {&_swigt__p_p_blpapi_Service, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_p_blpapi_Topic[] = { {&_swigt__p_p_blpapi_Topic, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_p_char[] = { {&_swigt__p_p_char, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_p_void[] = { {&_swigt__p_p_p_void, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_p_void[] = { {&_swigt__p_p_void, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_short[] = { {&_swigt__p_short, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_unsigned_char[] = { {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}}; @@ -19885,6 +20745,10 @@ static swig_cast_info _swigc__p_unsigned_short[] = { {&_swigt__p_unsigned_short static swig_cast_info *swig_cast_initial[] = { _swigc__p_blpapi_AbstractSession, + _swigc__p_blpapi_AuthApplication, + _swigc__p_blpapi_AuthOptions, + _swigc__p_blpapi_AuthToken, + _swigc__p_blpapi_AuthUser, _swigc__p_blpapi_Constant, _swigc__p_blpapi_ConstantList, _swigc__p_blpapi_CorrelationId_t_, @@ -19901,13 +20765,16 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_blpapi_Logging_Severity_t, _swigc__p_blpapi_ManagedPtr_t_, _swigc__p_blpapi_Message, + _swigc__p_blpapi_MessageFormatter, _swigc__p_blpapi_MessageIterator, + _swigc__p_blpapi_MessageProperties, _swigc__p_blpapi_Name, _swigc__p_blpapi_Operation, _swigc__p_blpapi_ProviderSession, _swigc__p_blpapi_Request, _swigc__p_blpapi_RequestTemplate, _swigc__p_blpapi_ResolutionList, + _swigc__p_blpapi_SchemaElementDefinition, _swigc__p_blpapi_Service, _swigc__p_blpapi_ServiceRegistrationOptions, _swigc__p_blpapi_Session, @@ -19926,17 +20793,22 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_int, _swigc__p_intArray, _swigc__p_long_long, + _swigc__p_p_blpapi_AuthApplication, + _swigc__p_p_blpapi_AuthOptions, + _swigc__p_p_blpapi_AuthToken, + _swigc__p_p_blpapi_AuthUser, _swigc__p_p_blpapi_Element, _swigc__p_p_blpapi_Event, + _swigc__p_p_blpapi_Identity, _swigc__p_p_blpapi_Message, _swigc__p_p_blpapi_Name, _swigc__p_p_blpapi_Operation, _swigc__p_p_blpapi_Request, _swigc__p_p_blpapi_RequestTemplate, + _swigc__p_p_blpapi_SchemaElementDefinition, _swigc__p_p_blpapi_Service, _swigc__p_p_blpapi_Topic, _swigc__p_p_char, - _swigc__p_p_p_void, _swigc__p_p_void, _swigc__p_short, _swigc__p_unsigned_char, @@ -20713,6 +21585,9 @@ SWIG_init(void) { SWIG_Python_SetConstant(d, "MESSAGE_RECAPTYPE_UNSOLICITED",SWIG_From_int((int)(2))); SWIG_Python_SetConstant(d, "ZFPUTIL_REMOTE_8194",SWIG_From_int((int)(8194))); SWIG_Python_SetConstant(d, "ZFPUTIL_REMOTE_8196",SWIG_From_int((int)(8196))); + SWIG_Python_SetConstant(d, "IDENTITYUTIL_USERTYPE_UNKNOWN",SWIG_From_int((int)((-2)))); + SWIG_Python_SetConstant(d, "IDENTITYUTIL_USERTYPE_APP_PORTAL",SWIG_From_int((int)(8))); + SWIG_Python_SetConstant(d, "IDENTITYUTIL_USERTYPE_SANDBOX_EXCEL",SWIG_From_int((int)(9))); SWIG_Python_SetConstant(d, "DATATYPE_BOOL",SWIG_From_int((int)(BLPAPI_DATATYPE_BOOL))); SWIG_Python_SetConstant(d, "DATATYPE_CHAR",SWIG_From_int((int)(BLPAPI_DATATYPE_CHAR))); SWIG_Python_SetConstant(d, "DATATYPE_BYTE",SWIG_From_int((int)(BLPAPI_DATATYPE_BYTE))); @@ -20766,6 +21641,7 @@ SWIG_init(void) { SWIG_Python_SetConstant(d, "ERROR_DS_LOOKUP_FAILED",SWIG_From_int((int)((0x00000|18)))); SWIG_Python_SetConstant(d, "ERROR_UNSUPPORTED_OPERATION",SWIG_From_int((int)((0x80000|19)))); SWIG_Python_SetConstant(d, "ERROR_DS_PROPERTY_NOT_FOUND",SWIG_From_int((int)((0x60000|20)))); + SWIG_Python_SetConstant(d, "ERROR_MSG_TOO_LARGE",SWIG_From_int((int)((0x20000|21)))); /* Initialize threading */ SWIG_PYTHON_INITIALIZE_THREADS; diff --git a/blpapi/internals_wrap.cxx b/blpapi/internals_wrap.cxx deleted file mode 100644 index 01583fe..0000000 --- a/blpapi/internals_wrap.cxx +++ /dev/null @@ -1,26590 +0,0 @@ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 3.0.12 - * - * 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. - * ----------------------------------------------------------------------------- */ - - -#ifndef SWIGPYTHON -#define SWIGPYTHON -#endif - -#define SWIG_PYTHON_THREADS -#define SWIG_PYTHON_DIRECTOR_NO_VTABLE - - -#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. - * ----------------------------------------------------------------------------- */ - -/* template workaround for compilers that cannot correctly implement the C++ standard */ -#ifndef SWIGTEMPLATEDISAMBIGUATOR -# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) -# define SWIGTEMPLATEDISAMBIGUATOR template -# elif defined(__HP_aCC) -/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ -/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ -# define SWIGTEMPLATEDISAMBIGUATOR template -# else -# define SWIGTEMPLATEDISAMBIGUATOR -# endif -#endif - -/* inline attribute */ -#ifndef SWIGINLINE -# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) -# define SWIGINLINE inline -# else -# define SWIGINLINE -# endif -#endif - -/* attribute recognised by some compilers to avoid 'unused' warnings */ -#ifndef SWIGUNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define SWIGUNUSED __attribute__ ((__unused__)) -# else -# define SWIGUNUSED -# endif -# elif defined(__ICC) -# define SWIGUNUSED __attribute__ ((__unused__)) -# else -# define SWIGUNUSED -# endif -#endif - -#ifndef SWIG_MSC_UNSUPPRESS_4505 -# if defined(_MSC_VER) -# pragma warning(disable : 4505) /* unreferenced local function has been removed */ -# endif -#endif - -#ifndef SWIGUNUSEDPARM -# ifdef __cplusplus -# define SWIGUNUSEDPARM(p) -# else -# define SWIGUNUSEDPARM(p) p SWIGUNUSED -# endif -#endif - -/* internal SWIG method */ -#ifndef SWIGINTERN -# define SWIGINTERN static SWIGUNUSED -#endif - -/* internal inline SWIG method */ -#ifndef SWIGINTERNINLINE -# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE -#endif - -/* exporting methods */ -#if defined(__GNUC__) -# if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) -# ifndef GCC_HASCLASSVISIBILITY -# define GCC_HASCLASSVISIBILITY -# endif -# endif -#endif - -#ifndef SWIGEXPORT -# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) -# if defined(STATIC_LINKED) -# define SWIGEXPORT -# else -# define SWIGEXPORT __declspec(dllexport) -# endif -# else -# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) -# define SWIGEXPORT __attribute__ ((visibility("default"))) -# else -# define SWIGEXPORT -# endif -# endif -#endif - -/* calling conventions for Windows */ -#ifndef SWIGSTDCALL -# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) -# define SWIGSTDCALL __stdcall -# else -# define SWIGSTDCALL -# endif -#endif - -/* Deal with Microsoft's attempt at deprecating C standard runtime functions */ -#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) -# define _CRT_SECURE_NO_DEPRECATE -#endif - -/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ -#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) -# define _SCL_SECURE_NO_DEPRECATE -#endif - -/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */ -#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES) -# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0 -#endif - -/* Intel's compiler complains if a variable which was never initialised is - * cast to void, which is a common idiom which we use to indicate that we - * are aware a variable isn't used. So we just silence that warning. - * See: https://github.com/swig/swig/issues/192 for more discussion. - */ -#ifdef __INTEL_COMPILER -# pragma warning disable 592 -#endif - - -#if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG) -/* Use debug wrappers with the Python release dll */ -# undef _DEBUG -# include -# define _DEBUG -#else -# include -#endif - -/* ----------------------------------------------------------------------------- - * swigrun.swg - * - * This file contains generic C API SWIG runtime support for pointer - * type checking. - * ----------------------------------------------------------------------------- */ - -/* This should only be incremented when either the layout of swig_type_info changes, - or for whatever reason, the runtime changes incompatibly */ -#define SWIG_RUNTIME_VERSION "4" - -/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ -#ifdef SWIG_TYPE_TABLE -# define SWIG_QUOTE_STRING(x) #x -# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x) -# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE) -#else -# define SWIG_TYPE_TABLE_NAME -#endif - -/* - You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for - creating a static or dynamic library from the SWIG runtime code. - In 99.9% of the cases, SWIG just needs to declare them as 'static'. - - But only do this if strictly necessary, ie, if you have problems - with your compiler or suchlike. -*/ - -#ifndef SWIGRUNTIME -# define SWIGRUNTIME SWIGINTERN -#endif - -#ifndef SWIGRUNTIMEINLINE -# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE -#endif - -/* Generic buffer size */ -#ifndef SWIG_BUFFER_SIZE -# define SWIG_BUFFER_SIZE 1024 -#endif - -/* Flags for pointer conversions */ -#define SWIG_POINTER_DISOWN 0x1 -#define SWIG_CAST_NEW_MEMORY 0x2 - -/* Flags for new pointer objects */ -#define SWIG_POINTER_OWN 0x1 - - -/* - Flags/methods for returning states. - - The SWIG conversion methods, as ConvertPtr, return an integer - that tells if the conversion was successful or not. And if not, - an error code can be returned (see swigerrors.swg for the codes). - - Use the following macros/flags to set or process the returning - states. - - In old versions of SWIG, code such as the following was usually written: - - if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { - // success code - } else { - //fail code - } - - Now you can be more explicit: - - int res = SWIG_ConvertPtr(obj,vptr,ty.flags); - if (SWIG_IsOK(res)) { - // success code - } else { - // fail code - } - - which is the same really, but now you can also do - - Type *ptr; - int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags); - if (SWIG_IsOK(res)) { - // success code - if (SWIG_IsNewObj(res) { - ... - delete *ptr; - } else { - ... - } - } else { - // fail code - } - - I.e., now SWIG_ConvertPtr can return new objects and you can - identify the case and take care of the deallocation. Of course that - also requires SWIG_ConvertPtr to return new result values, such as - - int SWIG_ConvertPtr(obj, ptr,...) { - if () { - if () { - *ptr = ; - return SWIG_NEWOBJ; - } else { - *ptr = ; - return SWIG_OLDOBJ; - } - } else { - return SWIG_BADOBJ; - } - } - - Of course, returning the plain '0(success)/-1(fail)' still works, but you can be - more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the - 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 - - int food(double) - int fooi(int); - - and you call - - food(1) // cast rank '1' (1 -> 1.0) - fooi(1) // cast rank '0' - - just use the SWIG_AddCast()/SWIG_CheckState() -*/ - -#define SWIG_OK (0) -#define SWIG_ERROR (-1) -#define SWIG_IsOK(r) (r >= 0) -#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError) - -/* The CastRankLimit says how many bits are used for the cast rank */ -#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 */ -#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 */ -#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)) -#define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r) -#define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r) -#define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK)) - -/* Cast-Rank Mode */ -#if defined(SWIG_CASTRANK_MODE) -# ifndef SWIG_TypeRank -# define SWIG_TypeRank unsigned long -# endif -# ifndef SWIG_MAXCASTRANK /* Default cast allowed */ -# define SWIG_MAXCASTRANK (2) -# endif -# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1) -# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK) -SWIGINTERNINLINE int SWIG_AddCast(int r) { - return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r; -} -SWIGINTERNINLINE int SWIG_CheckState(int r) { - return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; -} -#else /* no cast-rank mode */ -# define SWIG_AddCast(r) (r) -# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0) -#endif - - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void *(*swig_converter_func)(void *, int *); -typedef struct swig_type_info *(*swig_dycast_func)(void **); - -/* Structure to store information on one type */ -typedef struct swig_type_info { - const char *name; /* mangled name of this type */ - const char *str; /* human readable name of this type */ - swig_dycast_func dcast; /* dynamic cast function down a hierarchy */ - struct swig_cast_info *cast; /* linked list of types that can cast into this type */ - void *clientdata; /* language specific type data */ - int owndata; /* flag if the structure owns the clientdata */ -} swig_type_info; - -/* Structure to store a type and conversion function used for casting */ -typedef struct swig_cast_info { - swig_type_info *type; /* pointer to type that is equivalent to this type */ - swig_converter_func converter; /* function to cast the void pointers */ - struct swig_cast_info *next; /* pointer to next cast in linked list */ - struct swig_cast_info *prev; /* pointer to the previous cast */ -} swig_cast_info; - -/* Structure used to store module information - * Each module generates one structure like this, and the runtime collects - * all of these structures and stores them in a circularly linked list.*/ -typedef struct swig_module_info { - swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */ - size_t size; /* Number of types in this module */ - struct swig_module_info *next; /* Pointer to next element in circularly linked list */ - swig_type_info **type_initial; /* Array of initially generated type structures */ - swig_cast_info **cast_initial; /* Array of initially generated casting structures */ - void *clientdata; /* Language specific module data */ -} swig_module_info; - -/* - Compare two type names skipping the space characters, therefore - "char*" == "char *" and "Class" == "Class", etc. - - Return 0 when the two name types are equivalent, as in - strncmp, but skipping ' '. -*/ -SWIGRUNTIME int -SWIG_TypeNameComp(const char *f1, const char *l1, - const char *f2, const char *l2) { - for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) { - while ((*f1 == ' ') && (f1 != l1)) ++f1; - while ((*f2 == ' ') && (f2 != l2)) ++f2; - if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1; - } - return (int)((l1 - f1) - (l2 - f2)); -} - -/* - Check type equivalence in a name list like ||... - Return 0 if equal, -1 if nb < tb, 1 if nb > tb -*/ -SWIGRUNTIME int -SWIG_TypeCmp(const char *nb, const char *tb) { - int equiv = 1; - const char* te = tb + strlen(tb); - const char* ne = nb; - while (equiv != 0 && *ne) { - for (nb = ne; *ne; ++ne) { - if (*ne == '|') break; - } - equiv = SWIG_TypeNameComp(nb, ne, tb, te); - if (*ne) ++ne; - } - return equiv; -} - -/* - Check type equivalence in a name list like ||... - Return 0 if not equal, 1 if equal -*/ -SWIGRUNTIME int -SWIG_TypeEquiv(const char *nb, const char *tb) { - return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0; -} - -/* - Check the typename -*/ -SWIGRUNTIME swig_cast_info * -SWIG_TypeCheck(const char *c, swig_type_info *ty) { - if (ty) { - swig_cast_info *iter = ty->cast; - while (iter) { - if (strcmp(iter->type->name, c) == 0) { - if (iter == ty->cast) - return iter; - /* Move iter to the top of the linked list */ - iter->prev->next = iter->next; - if (iter->next) - iter->next->prev = iter->prev; - iter->next = ty->cast; - iter->prev = 0; - if (ty->cast) ty->cast->prev = iter; - ty->cast = iter; - return iter; - } - iter = iter->next; - } - } - return 0; -} - -/* - 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) { - if (ty) { - swig_cast_info *iter = ty->cast; - while (iter) { - if (iter->type == from) { - if (iter == ty->cast) - return iter; - /* Move iter to the top of the linked list */ - iter->prev->next = iter->next; - if (iter->next) - iter->next->prev = iter->prev; - iter->next = ty->cast; - iter->prev = 0; - if (ty->cast) ty->cast->prev = iter; - ty->cast = iter; - return iter; - } - iter = iter->next; - } - } - return 0; -} - -/* - Cast a pointer up an inheritance hierarchy -*/ -SWIGRUNTIMEINLINE void * -SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) { - return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory); -} - -/* - Dynamic pointer casting. Down an inheritance hierarchy -*/ -SWIGRUNTIME swig_type_info * -SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) { - swig_type_info *lastty = ty; - if (!ty || !ty->dcast) return ty; - while (ty && (ty->dcast)) { - ty = (*ty->dcast)(ptr); - if (ty) lastty = ty; - } - return lastty; -} - -/* - Return the name associated with this type -*/ -SWIGRUNTIMEINLINE const char * -SWIG_TypeName(const swig_type_info *ty) { - return ty->name; -} - -/* - Return the pretty name associated with this type, - that is an unmangled type name in a form presentable to the user. -*/ -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. */ - if (!type) return NULL; - if (type->str != NULL) { - const char *last_name = type->str; - const char *s; - for (s = type->str; *s; s++) - if (*s == '|') last_name = s+1; - return last_name; - } - else - return type->name; -} - -/* - Set the clientdata field for a type -*/ -SWIGRUNTIME void -SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { - swig_cast_info *cast = ti->cast; - /* if (ti->clientdata == clientdata) return; */ - ti->clientdata = clientdata; - - while (cast) { - if (!cast->converter) { - swig_type_info *tc = cast->type; - if (!tc->clientdata) { - SWIG_TypeClientData(tc, clientdata); - } - } - cast = cast->next; - } -} -SWIGRUNTIME void -SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) { - SWIG_TypeClientData(ti, clientdata); - ti->owndata = 1; -} - -/* - Search for a swig_type_info structure only by mangled name - Search is a O(log #types) - - We start searching at module start, and finish searching when start == end. - Note: if start == end at the beginning of the function, we go all the way around - the circular list. -*/ -SWIGRUNTIME swig_type_info * -SWIG_MangledTypeQueryModule(swig_module_info *start, - swig_module_info *end, - const char *name) { - swig_module_info *iter = start; - do { - if (iter->size) { - size_t l = 0; - size_t r = iter->size - 1; - do { - /* since l+r >= 0, we can (>> 1) instead (/ 2) */ - size_t i = (l + r) >> 1; - const char *iname = iter->types[i]->name; - if (iname) { - int compare = strcmp(name, iname); - if (compare == 0) { - return iter->types[i]; - } else if (compare < 0) { - if (i) { - r = i - 1; - } else { - break; - } - } else if (compare > 0) { - l = i + 1; - } - } else { - break; /* should never happen */ - } - } while (l <= r); - } - iter = iter->next; - } while (iter != end); - return 0; -} - -/* - Search for a swig_type_info structure for either a mangled name or a human readable name. - It first searches the mangled names of the types, which is a O(log #types) - If a type is not found it then searches the human readable names, which is O(#types). - - We start searching at module start, and finish searching when start == end. - Note: if start == end at the beginning of the function, we go all the way around - the circular list. -*/ -SWIGRUNTIME swig_type_info * -SWIG_TypeQueryModule(swig_module_info *start, - swig_module_info *end, - const char *name) { - /* STEP 1: Search the name field using binary search */ - swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name); - if (ret) { - return ret; - } else { - /* STEP 2: If the type hasn't been found, do a complete search - of the str field (the human readable name) */ - swig_module_info *iter = start; - do { - size_t i = 0; - for (; i < iter->size; ++i) { - if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name))) - return iter->types[i]; - } - iter = iter->next; - } while (iter != end); - } - - /* neither found a match */ - return 0; -} - -/* - Pack binary data into a string -*/ -SWIGRUNTIME char * -SWIG_PackData(char *c, void *ptr, size_t sz) { - static const char hex[17] = "0123456789abcdef"; - const unsigned char *u = (unsigned char *) ptr; - const unsigned char *eu = u + sz; - for (; u != eu; ++u) { - unsigned char uu = *u; - *(c++) = hex[(uu & 0xf0) >> 4]; - *(c++) = hex[uu & 0xf]; - } - return c; -} - -/* - Unpack binary data from a string -*/ -SWIGRUNTIME const char * -SWIG_UnpackData(const char *c, void *ptr, size_t sz) { - unsigned char *u = (unsigned char *) ptr; - const unsigned char *eu = u + sz; - for (; u != eu; ++u) { - char d = *(c++); - unsigned char uu; - if ((d >= '0') && (d <= '9')) - uu = (unsigned char)((d - '0') << 4); - else if ((d >= 'a') && (d <= 'f')) - uu = (unsigned char)((d - ('a'-10)) << 4); - else - return (char *) 0; - d = *(c++); - if ((d >= '0') && (d <= '9')) - uu |= (unsigned char)(d - '0'); - else if ((d >= 'a') && (d <= 'f')) - uu |= (unsigned char)(d - ('a'-10)); - else - return (char *) 0; - *u = uu; - } - return c; -} - -/* - Pack 'void *' into a string buffer. -*/ -SWIGRUNTIME char * -SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) { - char *r = buff; - if ((2*sizeof(void *) + 2) > bsz) return 0; - *(r++) = '_'; - r = SWIG_PackData(r,&ptr,sizeof(void *)); - if (strlen(name) + 1 > (bsz - (r - buff))) return 0; - strcpy(r,name); - return buff; -} - -SWIGRUNTIME const char * -SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) { - if (*c != '_') { - if (strcmp(c,"NULL") == 0) { - *ptr = (void *) 0; - return name; - } else { - return 0; - } - } - return SWIG_UnpackData(++c,ptr,sizeof(void *)); -} - -SWIGRUNTIME char * -SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) { - char *r = buff; - size_t lname = (name ? strlen(name) : 0); - if ((2*sz + 2 + lname) > bsz) return 0; - *(r++) = '_'; - r = SWIG_PackData(r,ptr,sz); - if (lname) { - strncpy(r,name,lname+1); - } else { - *r = 0; - } - return buff; -} - -SWIGRUNTIME const char * -SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { - if (*c != '_') { - if (strcmp(c,"NULL") == 0) { - memset(ptr,0,sz); - return name; - } else { - return 0; - } - } - return SWIG_UnpackData(++c,ptr,sz); -} - -#ifdef __cplusplus -} -#endif - -/* Errors in SWIG */ -#define SWIG_UnknownError -1 -#define SWIG_IOError -2 -#define SWIG_RuntimeError -3 -#define SWIG_IndexError -4 -#define SWIG_TypeError -5 -#define SWIG_DivisionByZero -6 -#define SWIG_OverflowError -7 -#define SWIG_SyntaxError -8 -#define SWIG_ValueError -9 -#define SWIG_SystemError -10 -#define SWIG_AttributeError -11 -#define SWIG_MemoryError -12 -#define SWIG_NullReferenceError -13 - - - -/* Compatibility macros for Python 3 */ -#if PY_VERSION_HEX >= 0x03000000 - -#define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type) -#define PyInt_Check(x) PyLong_Check(x) -#define PyInt_AsLong(x) PyLong_AsLong(x) -#define PyInt_FromLong(x) PyLong_FromLong(x) -#define PyInt_FromSize_t(x) PyLong_FromSize_t(x) -#define PyString_Check(name) PyBytes_Check(name) -#define PyString_FromString(x) PyUnicode_FromString(x) -#define PyString_Format(fmt, args) PyUnicode_Format(fmt, args) -#define PyString_AsString(str) PyBytes_AsString(str) -#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 - -#ifndef Py_TYPE -# define Py_TYPE(op) ((op)->ob_type) -#endif - -/* SWIG APIs for compatibility of both Python 2 & 3 */ - -#if PY_VERSION_HEX >= 0x03000000 -# define SWIG_Python_str_FromFormat PyUnicode_FromFormat -#else -# define SWIG_Python_str_FromFormat PyString_FromFormat -#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 >= 0x03000000 - char *cstr; - char *newstr; - Py_ssize_t len; - str = PyUnicode_AsUTF8String(str); - PyBytes_AsStringAndSize(str, &cstr, &len); - newstr = (char *) malloc(len+1); - memcpy(newstr, cstr, len+1); - Py_XDECREF(str); - return newstr; -#else - return PyString_AsString(str); -#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) -{ -#if PY_VERSION_HEX >= 0x03000000 - return PyUnicode_FromString(c); -#else - return PyString_FromString(c); -#endif -} - -/* Add PyOS_snprintf for old Pythons */ -#if PY_VERSION_HEX < 0x02020000 -# if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM) -# define PyOS_snprintf _snprintf -# else -# define PyOS_snprintf snprintf -# endif -#endif - -/* A crude PyString_FromFormat implementation for old Pythons */ -#if PY_VERSION_HEX < 0x02020000 - -#ifndef SWIG_PYBUFFER_SIZE -# define SWIG_PYBUFFER_SIZE 1024 -#endif - -static PyObject * -PyString_FromFormat(const char *fmt, ...) { - va_list ap; - char buf[SWIG_PYBUFFER_SIZE * 2]; - int res; - va_start(ap, fmt); - res = vsnprintf(buf, sizeof(buf), fmt, ap); - va_end(ap); - return (res < 0 || res >= (int)sizeof(buf)) ? 0 : PyString_FromString(buf); -} -#endif - -#ifndef PyObject_DEL -# define PyObject_DEL PyObject_Del -#endif - -/* A crude PyExc_StopIteration exception for old Pythons */ -#if PY_VERSION_HEX < 0x02020000 -# ifndef PyExc_StopIteration -# define PyExc_StopIteration PyExc_RuntimeError -# endif -# ifndef PyObject_GenericGetAttr -# define PyObject_GenericGetAttr 0 -# endif -#endif - -/* Py_NotImplemented is defined in 2.1 and up. */ -#if PY_VERSION_HEX < 0x02010000 -# ifndef Py_NotImplemented -# define Py_NotImplemented PyExc_RuntimeError -# endif -#endif - -/* A crude PyString_AsStringAndSize implementation for old Pythons */ -#if PY_VERSION_HEX < 0x02010000 -# ifndef PyString_AsStringAndSize -# define PyString_AsStringAndSize(obj, s, len) {*s = PyString_AsString(obj); *len = *s ? strlen(*s) : 0;} -# endif -#endif - -/* PySequence_Size for old Pythons */ -#if PY_VERSION_HEX < 0x02000000 -# ifndef PySequence_Size -# define PySequence_Size PySequence_Length -# endif -#endif - -/* PyBool_FromLong for old Pythons */ -#if PY_VERSION_HEX < 0x02030000 -static -PyObject *PyBool_FromLong(long ok) -{ - PyObject *result = ok ? Py_True : Py_False; - Py_INCREF(result); - return result; -} -#endif - -/* Py_ssize_t for old Pythons */ -/* This code is as recommended by: */ -/* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */ -#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) -typedef int Py_ssize_t; -# define PY_SSIZE_T_MAX INT_MAX -# define PY_SSIZE_T_MIN INT_MIN -typedef inquiry lenfunc; -typedef intargfunc ssizeargfunc; -typedef intintargfunc ssizessizeargfunc; -typedef intobjargproc ssizeobjargproc; -typedef intintobjargproc ssizessizeobjargproc; -typedef getreadbufferproc readbufferproc; -typedef getwritebufferproc writebufferproc; -typedef getsegcountproc segcountproc; -typedef getcharbufferproc charbufferproc; -static long PyNumber_AsSsize_t (PyObject *x, void *SWIGUNUSEDPARM(exc)) -{ - long result = 0; - PyObject *i = PyNumber_Int(x); - if (i) { - result = PyInt_AsLong(i); - Py_DECREF(i); - } - return result; -} -#endif - -#if PY_VERSION_HEX < 0x02050000 -#define PyInt_FromSize_t(x) PyInt_FromLong((long)x) -#endif - -#if PY_VERSION_HEX < 0x02040000 -#define Py_VISIT(op) \ - do { \ - if (op) { \ - int vret = visit((op), arg); \ - if (vret) \ - return vret; \ - } \ - } while (0) -#endif - -#if PY_VERSION_HEX < 0x02030000 -typedef struct { - PyTypeObject type; - PyNumberMethods as_number; - PyMappingMethods as_mapping; - PySequenceMethods as_sequence; - PyBufferProcs as_buffer; - PyObject *name, *slots; -} PyHeapTypeObject; -#endif - -#if PY_VERSION_HEX < 0x02030000 -typedef destructor freefunc; -#endif - -#if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION > 6) || \ - (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION > 0) || \ - (PY_MAJOR_VERSION > 3)) -# define SWIGPY_USE_CAPSULE -# define SWIGPY_CAPSULE_NAME ((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME) -#endif - -#if PY_VERSION_HEX < 0x03020000 -#define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type) -#define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name) -#define Py_hash_t long -#endif - -/* ----------------------------------------------------------------------------- - * error manipulation - * ----------------------------------------------------------------------------- */ - -SWIGRUNTIME PyObject* -SWIG_Python_ErrorType(int code) { - PyObject* type = 0; - switch(code) { - case SWIG_MemoryError: - type = PyExc_MemoryError; - break; - case SWIG_IOError: - type = PyExc_IOError; - break; - case SWIG_RuntimeError: - type = PyExc_RuntimeError; - break; - case SWIG_IndexError: - type = PyExc_IndexError; - break; - case SWIG_TypeError: - type = PyExc_TypeError; - break; - case SWIG_DivisionByZero: - type = PyExc_ZeroDivisionError; - break; - case SWIG_OverflowError: - type = PyExc_OverflowError; - break; - case SWIG_SyntaxError: - type = PyExc_SyntaxError; - break; - case SWIG_ValueError: - type = PyExc_ValueError; - break; - case SWIG_SystemError: - type = PyExc_SystemError; - break; - case SWIG_AttributeError: - type = PyExc_AttributeError; - break; - default: - type = PyExc_RuntimeError; - } - return type; -} - - -SWIGRUNTIME void -SWIG_Python_AddErrorMsg(const char* mesg) -{ - PyObject *type = 0; - PyObject *value = 0; - PyObject *traceback = 0; - - if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback); - if (value) { - char *tmp; - PyObject *old_str = PyObject_Str(value); - PyErr_Clear(); - Py_XINCREF(type); - - PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); - SWIG_Python_str_DelForPy3(tmp); - Py_DECREF(old_str); - Py_DECREF(value); - } else { - PyErr_SetString(PyExc_RuntimeError, mesg); - } -} - -#if defined(SWIG_PYTHON_NO_THREADS) -# if defined(SWIG_PYTHON_THREADS) -# undef SWIG_PYTHON_THREADS -# endif -#endif -#if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */ -# if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL) -# if (PY_VERSION_HEX >= 0x02030000) /* For 2.3 or later, use the PyGILState calls */ -# define SWIG_PYTHON_USE_GIL -# endif -# endif -# if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */ -# ifndef SWIG_PYTHON_INITIALIZE_THREADS -# define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads() -# endif -# ifdef __cplusplus /* C++ code */ - class SWIG_Python_Thread_Block { - bool status; - PyGILState_STATE state; - public: - void end() { if (status) { PyGILState_Release(state); status = false;} } - SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {} - ~SWIG_Python_Thread_Block() { end(); } - }; - class SWIG_Python_Thread_Allow { - bool status; - PyThreadState *save; - public: - void end() { if (status) { PyEval_RestoreThread(save); status = false; }} - SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {} - ~SWIG_Python_Thread_Allow() { end(); } - }; -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK SWIG_Python_Thread_Block _swig_thread_block -# define SWIG_PYTHON_THREAD_END_BLOCK _swig_thread_block.end() -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW SWIG_Python_Thread_Allow _swig_thread_allow -# define SWIG_PYTHON_THREAD_END_ALLOW _swig_thread_allow.end() -# else /* C code */ -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK PyGILState_STATE _swig_thread_block = PyGILState_Ensure() -# define SWIG_PYTHON_THREAD_END_BLOCK PyGILState_Release(_swig_thread_block) -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW PyThreadState *_swig_thread_allow = PyEval_SaveThread() -# define SWIG_PYTHON_THREAD_END_ALLOW PyEval_RestoreThread(_swig_thread_allow) -# endif -# else /* Old thread way, not implemented, user must provide it */ -# if !defined(SWIG_PYTHON_INITIALIZE_THREADS) -# define SWIG_PYTHON_INITIALIZE_THREADS -# endif -# if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK) -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK -# endif -# if !defined(SWIG_PYTHON_THREAD_END_BLOCK) -# define SWIG_PYTHON_THREAD_END_BLOCK -# endif -# if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW) -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW -# endif -# if !defined(SWIG_PYTHON_THREAD_END_ALLOW) -# define SWIG_PYTHON_THREAD_END_ALLOW -# endif -# endif -#else /* No thread support */ -# define SWIG_PYTHON_INITIALIZE_THREADS -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK -# define SWIG_PYTHON_THREAD_END_BLOCK -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW -# define SWIG_PYTHON_THREAD_END_ALLOW -#endif - -/* ----------------------------------------------------------------------------- - * Python API portion that goes into the runtime - * ----------------------------------------------------------------------------- */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* ----------------------------------------------------------------------------- - * Constant declarations - * ----------------------------------------------------------------------------- */ - -/* Constant Types */ -#define SWIG_PY_POINTER 4 -#define SWIG_PY_BINARY 5 - -/* Constant information structure */ -typedef struct swig_const_info { - int type; - char *name; - long lvalue; - double dvalue; - void *pvalue; - swig_type_info **ptype; -} swig_const_info; - - -/* ----------------------------------------------------------------------------- - * Wrapper of PyInstanceMethod_New() used in Python 3 - * It is exported to the generated module, used for -fastproxy - * ----------------------------------------------------------------------------- */ -#if PY_VERSION_HEX >= 0x03000000 -SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) -{ - return PyInstanceMethod_New(func); -} -#else -SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *SWIGUNUSEDPARM(func)) -{ - return NULL; -} -#endif - -#ifdef __cplusplus -} -#endif - - -/* ----------------------------------------------------------------------------- - * pyrun.swg - * - * This file contains the runtime support for Python modules - * and includes code for managing global variables and pointer - * type checking. - * - * ----------------------------------------------------------------------------- */ - -/* Common SWIG API */ - -/* for raw pointers */ -#define SWIG_Python_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0) -#define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtr(obj, pptr, type, flags) -#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own) - -#ifdef SWIGPYTHON_BUILTIN -#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(self, ptr, type, flags) -#else -#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags) -#endif - -#define SWIG_InternalNewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags) - -#define SWIG_CheckImplicit(ty) SWIG_Python_CheckImplicit(ty) -#define SWIG_AcquirePtr(ptr, src) SWIG_Python_AcquirePtr(ptr, src) -#define swig_owntype int - -/* for raw packed data */ -#define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) - -/* for class or struct pointers */ -#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags) -#define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags) - -/* for C or C++ function pointers */ -#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_Python_ConvertFunctionPtr(obj, pptr, type) -#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Python_NewPointerObj(NULL, ptr, type, 0) - -/* for C++ member pointers, ie, member methods */ -#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewMemberObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) - - -/* Runtime API */ - -#define SWIG_GetModule(clientdata) SWIG_Python_GetModule(clientdata) -#define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer) -#define SWIG_NewClientData(obj) SwigPyClientData_New(obj) - -#define SWIG_SetErrorObj SWIG_Python_SetErrorObj -#define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg -#define SWIG_ErrorType(code) SWIG_Python_ErrorType(code) -#define SWIG_Error(code, msg) SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg) -#define SWIG_fail goto fail - - -/* Runtime API implementation */ - -/* Error manipulation */ - -SWIGINTERN void -SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - PyErr_SetObject(errtype, obj); - Py_DECREF(obj); - SWIG_PYTHON_THREAD_END_BLOCK; -} - -SWIGINTERN void -SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - PyErr_SetString(errtype, msg); - SWIG_PYTHON_THREAD_END_BLOCK; -} - -#define SWIG_Python_Raise(obj, type, desc) SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj) - -/* Set a constant value */ - -#if defined(SWIGPYTHON_BUILTIN) - -SWIGINTERN void -SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) { - PyObject *s = PyString_InternFromString(key); - PyList_Append(seq, s); - Py_DECREF(s); -} - -SWIGINTERN void -SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) { -#if PY_VERSION_HEX < 0x02030000 - PyDict_SetItemString(d, (char *)name, obj); -#else - PyDict_SetItemString(d, name, obj); -#endif - Py_DECREF(obj); - if (public_interface) - SwigPyBuiltin_AddPublicSymbol(public_interface, name); -} - -#else - -SWIGINTERN void -SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) { -#if PY_VERSION_HEX < 0x02030000 - PyDict_SetItemString(d, (char *)name, obj); -#else - PyDict_SetItemString(d, name, obj); -#endif - Py_DECREF(obj); -} - -#endif - -/* Append a value to the result obj */ - -SWIGINTERN PyObject* -SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) { -#if !defined(SWIG_PYTHON_OUTPUT_TUPLE) - if (!result) { - result = obj; - } else if (result == Py_None) { - Py_DECREF(result); - result = obj; - } else { - if (!PyList_Check(result)) { - PyObject *o2 = result; - result = PyList_New(1); - PyList_SetItem(result, 0, o2); - } - PyList_Append(result,obj); - Py_DECREF(obj); - } - return result; -#else - PyObject* o2; - PyObject* o3; - if (!result) { - result = obj; - } else if (result == Py_None) { - Py_DECREF(result); - result = obj; - } else { - if (!PyTuple_Check(result)) { - o2 = result; - result = PyTuple_New(1); - PyTuple_SET_ITEM(result, 0, o2); - } - o3 = PyTuple_New(1); - PyTuple_SET_ITEM(o3, 0, obj); - o2 = result; - result = PySequence_Concat(o2, o3); - Py_DECREF(o2); - Py_DECREF(o3); - } - return result; -#endif -} - -/* Unpack the argument tuple */ - -SWIGINTERN Py_ssize_t -SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs) -{ - if (!args) { - if (!min && !max) { - return 1; - } else { - PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none", - name, (min == max ? "" : "at least "), (int)min); - return 0; - } - } - if (!PyTuple_Check(args)) { - if (min <= 1 && max >= 1) { - Py_ssize_t i; - objs[0] = args; - for (i = 1; i < max; ++i) { - objs[i] = 0; - } - return 2; - } - PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple"); - return 0; - } else { - Py_ssize_t l = PyTuple_GET_SIZE(args); - if (l < min) { - PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", - name, (min == max ? "" : "at least "), (int)min, (int)l); - return 0; - } else if (l > max) { - PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", - name, (min == max ? "" : "at most "), (int)max, (int)l); - return 0; - } else { - Py_ssize_t i; - for (i = 0; i < l; ++i) { - objs[i] = PyTuple_GET_ITEM(args, i); - } - for (; l < max; ++l) { - objs[l] = 0; - } - return i + 1; - } - } -} - -/* A functor is a function object with one single object argument */ -#if PY_VERSION_HEX >= 0x02020000 -#define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL); -#else -#define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunction(functor, "O", obj); -#endif - -/* - Helper for static pointer initialization for both C and C++ code, for example - static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...); -*/ -#ifdef __cplusplus -#define SWIG_STATIC_POINTER(var) var -#else -#define SWIG_STATIC_POINTER(var) var = 0; if (!var) var -#endif - -/* ----------------------------------------------------------------------------- - * Pointer declarations - * ----------------------------------------------------------------------------- */ - -/* Flags for new pointer objects */ -#define SWIG_POINTER_NOSHADOW (SWIG_POINTER_OWN << 1) -#define SWIG_POINTER_NEW (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN) - -#define SWIG_POINTER_IMPLICIT_CONV (SWIG_POINTER_DISOWN << 1) - -#define SWIG_BUILTIN_TP_INIT (SWIG_POINTER_OWN << 2) -#define SWIG_BUILTIN_INIT (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN) - -#ifdef __cplusplus -extern "C" { -#endif - -/* How to access Py_None */ -#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) -# ifndef SWIG_PYTHON_NO_BUILD_NONE -# ifndef SWIG_PYTHON_BUILD_NONE -# define SWIG_PYTHON_BUILD_NONE -# endif -# endif -#endif - -#ifdef SWIG_PYTHON_BUILD_NONE -# ifdef Py_None -# undef Py_None -# define Py_None SWIG_Py_None() -# endif -SWIGRUNTIMEINLINE PyObject * -_SWIG_Py_None(void) -{ - PyObject *none = Py_BuildValue((char*)""); - Py_DECREF(none); - return none; -} -SWIGRUNTIME PyObject * -SWIG_Py_None(void) -{ - static PyObject *SWIG_STATIC_POINTER(none) = _SWIG_Py_None(); - return none; -} -#endif - -/* The python void return value */ - -SWIGRUNTIMEINLINE PyObject * -SWIG_Py_Void(void) -{ - PyObject *none = Py_None; - Py_INCREF(none); - return none; -} - -/* SwigPyClientData */ - -typedef struct { - PyObject *klass; - PyObject *newraw; - PyObject *newargs; - PyObject *destroy; - int delargs; - int implicitconv; - PyTypeObject *pytype; -} SwigPyClientData; - -SWIGRUNTIMEINLINE int -SWIG_Python_CheckImplicit(swig_type_info *ty) -{ - SwigPyClientData *data = (SwigPyClientData *)ty->clientdata; - return data ? data->implicitconv : 0; -} - -SWIGRUNTIMEINLINE PyObject * -SWIG_Python_ExceptionType(swig_type_info *desc) { - SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0; - PyObject *klass = data ? data->klass : 0; - return (klass ? klass : PyExc_RuntimeError); -} - - -SWIGRUNTIME SwigPyClientData * -SwigPyClientData_New(PyObject* obj) -{ - if (!obj) { - return 0; - } else { - SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData)); - /* the klass element */ - data->klass = obj; - Py_INCREF(data->klass); - /* 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); - } else { -#if (PY_VERSION_HEX < 0x02020000) - data->newraw = 0; -#else - data->newraw = PyObject_GetAttrString(data->klass, (char *)"__new__"); -#endif - if (data->newraw) { - Py_INCREF(data->newraw); - data->newargs = PyTuple_New(1); - PyTuple_SetItem(data->newargs, 0, obj); - } else { - data->newargs = obj; - } - Py_INCREF(data->newargs); - } - /* the destroy method, aka as the C++ delete method */ - data->destroy = PyObject_GetAttrString(data->klass, (char *)"__swig_destroy__"); - if (PyErr_Occurred()) { - PyErr_Clear(); - data->destroy = 0; - } - if (data->destroy) { - int flags; - Py_INCREF(data->destroy); - flags = PyCFunction_GET_FLAGS(data->destroy); -#ifdef METH_O - data->delargs = !(flags & (METH_O)); -#else - data->delargs = 0; -#endif - } else { - data->delargs = 0; - } - data->implicitconv = 0; - data->pytype = 0; - return data; - } -} - -SWIGRUNTIME void -SwigPyClientData_Del(SwigPyClientData *data) { - Py_XDECREF(data->newraw); - Py_XDECREF(data->newargs); - Py_XDECREF(data->destroy); -} - -/* =============== SwigPyObject =====================*/ - -typedef struct { - PyObject_HEAD - void *ptr; - swig_type_info *ty; - int own; - PyObject *next; -#ifdef SWIGPYTHON_BUILTIN - PyObject *dict; -#endif -} SwigPyObject; - - -#ifdef SWIGPYTHON_BUILTIN - -SWIGRUNTIME PyObject * -SwigPyObject_get___dict__(PyObject *v, PyObject *SWIGUNUSEDPARM(args)) -{ - SwigPyObject *sobj = (SwigPyObject *)v; - - if (!sobj->dict) - sobj->dict = PyDict_New(); - - Py_INCREF(sobj->dict); - return sobj->dict; -} - -#endif - -SWIGRUNTIME PyObject * -SwigPyObject_long(SwigPyObject *v) -{ - return PyLong_FromVoidPtr(v->ptr); -} - -SWIGRUNTIME PyObject * -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); - if (ofmt) { -#if PY_VERSION_HEX >= 0x03000000 - res = PyUnicode_Format(ofmt,args); -#else - res = PyString_Format(ofmt,args); -#endif - Py_DECREF(ofmt); - } - Py_DECREF(args); - } - } - return res; -} - -SWIGRUNTIME PyObject * -SwigPyObject_oct(SwigPyObject *v) -{ - return SwigPyObject_format("%o",v); -} - -SWIGRUNTIME PyObject * -SwigPyObject_hex(SwigPyObject *v) -{ - return SwigPyObject_format("%x",v); -} - -SWIGRUNTIME PyObject * -#ifdef METH_NOARGS -SwigPyObject_repr(SwigPyObject *v) -#else -SwigPyObject_repr(SwigPyObject *v, PyObject *args) -#endif -{ - const char *name = SWIG_TypePrettyName(v->ty); - PyObject *repr = SWIG_Python_str_FromFormat("", (name ? name : "unknown"), (void *)v); - if (v->next) { -# ifdef METH_NOARGS - PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next); -# else - PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args); -# endif -# if PY_VERSION_HEX >= 0x03000000 - PyObject *joined = PyUnicode_Concat(repr, nrep); - Py_DecRef(repr); - Py_DecRef(nrep); - repr = joined; -# else - PyString_ConcatAndDel(&repr,nrep); -# endif - } - return repr; -} - -SWIGRUNTIME int -SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w) -{ - void *i = v->ptr; - void *j = w->ptr; - return (i < j) ? -1 : ((i > j) ? 1 : 0); -} - -/* Added for Python 3.x, would it also be useful for Python 2.x? */ -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; - } - res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0); - return res; -} - - -SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void); - -#ifdef SWIGPYTHON_BUILTIN -static swig_type_info *SwigPyObject_stype = 0; -SWIGRUNTIME PyTypeObject* -SwigPyObject_type(void) { - SwigPyClientData *cd; - assert(SwigPyObject_stype); - cd = (SwigPyClientData*) SwigPyObject_stype->clientdata; - assert(cd); - assert(cd->pytype); - return cd->pytype; -} -#else -SWIGRUNTIME PyTypeObject* -SwigPyObject_type(void) { - static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyObject_TypeOnce(); - return type; -} -#endif - -SWIGRUNTIMEINLINE int -SwigPyObject_Check(PyObject *op) { -#ifdef SWIGPYTHON_BUILTIN - PyTypeObject *target_tp = SwigPyObject_type(); - if (PyType_IsSubtype(op->ob_type, target_tp)) - return 1; - return (strcmp(op->ob_type->tp_name, "SwigPyObject") == 0); -#else - return (Py_TYPE(op) == SwigPyObject_type()) - || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0); -#endif -} - -SWIGRUNTIME PyObject * -SwigPyObject_New(void *ptr, swig_type_info *ty, int own); - -SWIGRUNTIME void -SwigPyObject_dealloc(PyObject *v) -{ - SwigPyObject *sobj = (SwigPyObject *) v; - PyObject *next = sobj->next; - if (sobj->own == SWIG_POINTER_OWN) { - swig_type_info *ty = sobj->ty; - SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; - PyObject *destroy = data ? data->destroy : 0; - if (destroy) { - /* destroy is always a VARARGS method */ - PyObject *res; - - /* PyObject_CallFunction() has the potential to silently drop - the active active exception. In cases of unnamed temporary - variable or where we just finished iterating over a generator - StopIteration will be active right now, and this needs to - remain true upon return from SwigPyObject_dealloc. So save - and restore. */ - - PyObject *val = NULL, *type = NULL, *tb = NULL; - PyErr_Fetch(&val, &type, &tb); - - 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); - } else { - PyCFunction meth = PyCFunction_GET_FUNCTION(destroy); - PyObject *mself = PyCFunction_GET_SELF(destroy); - res = ((*meth)(mself, v)); - } - if (!res) - PyErr_WriteUnraisable(destroy); - - PyErr_Restore(val, type, tb); - - Py_XDECREF(res); - } -#if !defined(SWIG_PYTHON_SILENT_MEMLEAK) - else { - const char *name = SWIG_TypePrettyName(ty); - printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown")); - } -#endif - } - Py_XDECREF(next); - PyObject_DEL(v); -} - -SWIGRUNTIME PyObject* -SwigPyObject_append(PyObject* v, PyObject* next) -{ - SwigPyObject *sobj = (SwigPyObject *) v; -#ifndef METH_O - PyObject *tmp = 0; - if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL; - next = tmp; -#endif - if (!SwigPyObject_Check(next)) { - PyErr_SetString(PyExc_TypeError, "Attempt to append a non SwigPyObject"); - return NULL; - } - sobj->next = next; - Py_INCREF(next); - return SWIG_Py_Void(); -} - -SWIGRUNTIME PyObject* -#ifdef METH_NOARGS -SwigPyObject_next(PyObject* v) -#else -SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) -#endif -{ - SwigPyObject *sobj = (SwigPyObject *) v; - if (sobj->next) { - Py_INCREF(sobj->next); - return sobj->next; - } else { - return SWIG_Py_Void(); - } -} - -SWIGINTERN PyObject* -#ifdef METH_NOARGS -SwigPyObject_disown(PyObject *v) -#else -SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) -#endif -{ - SwigPyObject *sobj = (SwigPyObject *)v; - sobj->own = 0; - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject* -#ifdef METH_NOARGS -SwigPyObject_acquire(PyObject *v) -#else -SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) -#endif -{ - SwigPyObject *sobj = (SwigPyObject *)v; - sobj->own = SWIG_POINTER_OWN; - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject* -SwigPyObject_own(PyObject *v, PyObject *args) -{ - PyObject *val = 0; -#if (PY_VERSION_HEX < 0x02020000) - if (!PyArg_ParseTuple(args,(char *)"|O:own",&val)) -#elif (PY_VERSION_HEX < 0x02050000) - if (!PyArg_UnpackTuple(args, (char *)"own", 0, 1, &val)) -#else - if (!PyArg_UnpackTuple(args, "own", 0, 1, &val)) -#endif - { - return NULL; - } - else - { - SwigPyObject *sobj = (SwigPyObject *)v; - PyObject *obj = PyBool_FromLong(sobj->own); - if (val) { -#ifdef METH_NOARGS - if (PyObject_IsTrue(val)) { - SwigPyObject_acquire(v); - } else { - SwigPyObject_disown(v); - } -#else - if (PyObject_IsTrue(val)) { - SwigPyObject_acquire(v,args); - } else { - SwigPyObject_disown(v,args); - } -#endif - } - return obj; - } -} - -#ifdef METH_O -static PyMethodDef -swigobject_methods[] = { - {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"}, - {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS, (char *)"acquires ownership of the pointer"}, - {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, - {(char *)"append", (PyCFunction)SwigPyObject_append, METH_O, (char *)"appends another 'this' object"}, - {(char *)"next", (PyCFunction)SwigPyObject_next, METH_NOARGS, (char *)"returns the next 'this' object"}, - {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_NOARGS, (char *)"returns object representation"}, - {0, 0, 0, 0} -}; -#else -static PyMethodDef -swigobject_methods[] = { - {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"}, - {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS, (char *)"acquires ownership of the pointer"}, - {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, - {(char *)"append", (PyCFunction)SwigPyObject_append, METH_VARARGS, (char *)"appends another 'this' object"}, - {(char *)"next", (PyCFunction)SwigPyObject_next, METH_VARARGS, (char *)"returns the next 'this' object"}, - {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_VARARGS, (char *)"returns object representation"}, - {0, 0, 0, 0} -}; -#endif - -#if PY_VERSION_HEX < 0x02020000 -SWIGINTERN PyObject * -SwigPyObject_getattr(SwigPyObject *sobj,char *name) -{ - return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name); -} -#endif - -SWIGRUNTIME PyTypeObject* -SwigPyObject_TypeOnce(void) { - static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer"; - - static PyNumberMethods SwigPyObject_as_number = { - (binaryfunc)0, /*nb_add*/ - (binaryfunc)0, /*nb_subtract*/ - (binaryfunc)0, /*nb_multiply*/ - /* nb_divide removed in Python 3 */ -#if PY_VERSION_HEX < 0x03000000 - (binaryfunc)0, /*nb_divide*/ -#endif - (binaryfunc)0, /*nb_remainder*/ - (binaryfunc)0, /*nb_divmod*/ - (ternaryfunc)0,/*nb_power*/ - (unaryfunc)0, /*nb_negative*/ - (unaryfunc)0, /*nb_positive*/ - (unaryfunc)0, /*nb_absolute*/ - (inquiry)0, /*nb_nonzero*/ - 0, /*nb_invert*/ - 0, /*nb_lshift*/ - 0, /*nb_rshift*/ - 0, /*nb_and*/ - 0, /*nb_xor*/ - 0, /*nb_or*/ -#if PY_VERSION_HEX < 0x03000000 - 0, /*nb_coerce*/ -#endif - (unaryfunc)SwigPyObject_long, /*nb_int*/ -#if PY_VERSION_HEX < 0x03000000 - (unaryfunc)SwigPyObject_long, /*nb_long*/ -#else - 0, /*nb_reserved*/ -#endif - (unaryfunc)0, /*nb_float*/ -#if PY_VERSION_HEX < 0x03000000 - (unaryfunc)SwigPyObject_oct, /*nb_oct*/ - (unaryfunc)SwigPyObject_hex, /*nb_hex*/ -#endif -#if PY_VERSION_HEX >= 0x03050000 /* 3.5 */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_matrix_multiply */ -#elif PY_VERSION_HEX >= 0x03000000 /* 3.0 */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */ -#elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */ -#elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */ -#elif PY_VERSION_HEX >= 0x02000000 /* 2.0.0 */ - 0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_or */ -#endif - }; - - static PyTypeObject swigpyobject_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 - (char *)"SwigPyObject", /* tp_name */ - sizeof(SwigPyObject), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)SwigPyObject_dealloc, /* tp_dealloc */ - 0, /* tp_print */ -#if PY_VERSION_HEX < 0x02020000 - (getattrfunc)SwigPyObject_getattr, /* tp_getattr */ -#else - (getattrfunc)0, /* tp_getattr */ -#endif - (setattrfunc)0, /* tp_setattr */ -#if PY_VERSION_HEX >= 0x03000000 - 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */ -#else - (cmpfunc)SwigPyObject_compare, /* tp_compare */ -#endif - (reprfunc)SwigPyObject_repr, /* tp_repr */ - &SwigPyObject_as_number, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)0, /* tp_hash */ - (ternaryfunc)0, /* tp_call */ - 0, /* tp_str */ - PyObject_GenericGetAttr, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - swigobject_doc, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)SwigPyObject_richcompare,/* tp_richcompare */ - 0, /* tp_weaklistoffset */ -#if PY_VERSION_HEX >= 0x02020000 - 0, /* tp_iter */ - 0, /* tp_iternext */ - swigobject_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - 0, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - 0, /* tp_free */ - 0, /* tp_is_gc */ - 0, /* tp_bases */ - 0, /* tp_mro */ - 0, /* tp_cache */ - 0, /* tp_subclasses */ - 0, /* tp_weaklist */ -#endif -#if PY_VERSION_HEX >= 0x02030000 - 0, /* tp_del */ -#endif -#if PY_VERSION_HEX >= 0x02060000 - 0, /* tp_version_tag */ -#endif -#if PY_VERSION_HEX >= 0x03040000 - 0, /* tp_finalize */ -#endif -#ifdef COUNT_ALLOCS - 0, /* tp_allocs */ - 0, /* tp_frees */ - 0, /* tp_maxalloc */ -#if PY_VERSION_HEX >= 0x02050000 - 0, /* tp_prev */ -#endif - 0 /* tp_next */ -#endif - }; - swigpyobject_type = tmp; - type_init = 1; -#if PY_VERSION_HEX < 0x02020000 - swigpyobject_type.ob_type = &PyType_Type; -#else - if (PyType_Ready(&swigpyobject_type) < 0) - return NULL; -#endif - } - return &swigpyobject_type; -} - -SWIGRUNTIME PyObject * -SwigPyObject_New(void *ptr, swig_type_info *ty, int own) -{ - SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type()); - if (sobj) { - sobj->ptr = ptr; - sobj->ty = ty; - sobj->own = own; - sobj->next = 0; - } - return (PyObject *)sobj; -} - -/* ----------------------------------------------------------------------------- - * Implements a simple Swig Packed type, and use it instead of string - * ----------------------------------------------------------------------------- */ - -typedef struct { - PyObject_HEAD - void *pack; - swig_type_info *ty; - size_t size; -} SwigPyPacked; - -SWIGRUNTIME int -SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags)) -{ - char result[SWIG_BUFFER_SIZE]; - fputs("pack, v->size, 0, sizeof(result))) { - fputs("at ", fp); - fputs(result, fp); - } - fputs(v->ty->name,fp); - fputs(">", fp); - return 0; -} - -SWIGRUNTIME PyObject * -SwigPyPacked_repr(SwigPyPacked *v) -{ - char result[SWIG_BUFFER_SIZE]; - if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) { - return SWIG_Python_str_FromFormat("", result, v->ty->name); - } else { - return SWIG_Python_str_FromFormat("", v->ty->name); - } -} - -SWIGRUNTIME PyObject * -SwigPyPacked_str(SwigPyPacked *v) -{ - char result[SWIG_BUFFER_SIZE]; - if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){ - return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name); - } else { - return SWIG_Python_str_FromChar(v->ty->name); - } -} - -SWIGRUNTIME int -SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w) -{ - size_t i = v->size; - size_t j = w->size; - int s = (i < j) ? -1 : ((i > j) ? 1 : 0); - return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size); -} - -SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void); - -SWIGRUNTIME PyTypeObject* -SwigPyPacked_type(void) { - static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyPacked_TypeOnce(); - return type; -} - -SWIGRUNTIMEINLINE int -SwigPyPacked_Check(PyObject *op) { - return ((op)->ob_type == SwigPyPacked_TypeOnce()) - || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0); -} - -SWIGRUNTIME void -SwigPyPacked_dealloc(PyObject *v) -{ - if (SwigPyPacked_Check(v)) { - SwigPyPacked *sobj = (SwigPyPacked *) v; - free(sobj->pack); - } - PyObject_DEL(v); -} - -SWIGRUNTIME PyTypeObject* -SwigPyPacked_TypeOnce(void) { - static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer"; - static PyTypeObject swigpypacked_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 - (char *)"SwigPyPacked", /* tp_name */ - sizeof(SwigPyPacked), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)SwigPyPacked_dealloc, /* tp_dealloc */ - (printfunc)SwigPyPacked_print, /* tp_print */ - (getattrfunc)0, /* tp_getattr */ - (setattrfunc)0, /* tp_setattr */ -#if PY_VERSION_HEX>=0x03000000 - 0, /* tp_reserved in 3.0.1 */ -#else - (cmpfunc)SwigPyPacked_compare, /* tp_compare */ -#endif - (reprfunc)SwigPyPacked_repr, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)0, /* tp_hash */ - (ternaryfunc)0, /* tp_call */ - (reprfunc)SwigPyPacked_str, /* tp_str */ - PyObject_GenericGetAttr, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - swigpacked_doc, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ -#if PY_VERSION_HEX >= 0x02020000 - 0, /* tp_iter */ - 0, /* tp_iternext */ - 0, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - 0, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - 0, /* tp_free */ - 0, /* tp_is_gc */ - 0, /* tp_bases */ - 0, /* tp_mro */ - 0, /* tp_cache */ - 0, /* tp_subclasses */ - 0, /* tp_weaklist */ -#endif -#if PY_VERSION_HEX >= 0x02030000 - 0, /* tp_del */ -#endif -#if PY_VERSION_HEX >= 0x02060000 - 0, /* tp_version_tag */ -#endif -#if PY_VERSION_HEX >= 0x03040000 - 0, /* tp_finalize */ -#endif -#ifdef COUNT_ALLOCS - 0, /* tp_allocs */ - 0, /* tp_frees */ - 0, /* tp_maxalloc */ -#if PY_VERSION_HEX >= 0x02050000 - 0, /* tp_prev */ -#endif - 0 /* tp_next */ -#endif - }; - swigpypacked_type = tmp; - type_init = 1; -#if PY_VERSION_HEX < 0x02020000 - swigpypacked_type.ob_type = &PyType_Type; -#else - if (PyType_Ready(&swigpypacked_type) < 0) - return NULL; -#endif - } - return &swigpypacked_type; -} - -SWIGRUNTIME PyObject * -SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty) -{ - SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type()); - if (sobj) { - void *pack = malloc(size); - if (pack) { - memcpy(pack, ptr, size); - sobj->pack = pack; - sobj->ty = ty; - sobj->size = size; - } else { - PyObject_DEL((PyObject *) sobj); - sobj = 0; - } - } - return (PyObject *) sobj; -} - -SWIGRUNTIME swig_type_info * -SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size) -{ - if (SwigPyPacked_Check(obj)) { - SwigPyPacked *sobj = (SwigPyPacked *)obj; - if (sobj->size != size) return 0; - memcpy(ptr, sobj->pack, size); - return sobj->ty; - } else { - return 0; - } -} - -/* ----------------------------------------------------------------------------- - * pointers/data manipulation - * ----------------------------------------------------------------------------- */ - -SWIGRUNTIMEINLINE PyObject * -_SWIG_This(void) -{ - return SWIG_Python_str_FromChar("this"); -} - -static PyObject *swig_this = NULL; - -SWIGRUNTIME PyObject * -SWIG_This(void) -{ - if (swig_this == NULL) - swig_this = _SWIG_This(); - return swig_this; -} - -/* #define SWIG_PYTHON_SLOW_GETSET_THIS */ - -/* TODO: I don't know how to implement the fast getset in Python 3 right now */ -#if PY_VERSION_HEX>=0x03000000 -#define SWIG_PYTHON_SLOW_GETSET_THIS -#endif - -SWIGRUNTIME SwigPyObject * -SWIG_Python_GetSwigThis(PyObject *pyobj) -{ - PyObject *obj; - - if (SwigPyObject_Check(pyobj)) - return (SwigPyObject *) pyobj; - -#ifdef SWIGPYTHON_BUILTIN - (void)obj; -# ifdef PyWeakref_CheckProxy - if (PyWeakref_CheckProxy(pyobj)) { - pyobj = PyWeakref_GET_OBJECT(pyobj); - if (pyobj && SwigPyObject_Check(pyobj)) - return (SwigPyObject*) pyobj; - } -# endif - return NULL; -#else - - obj = 0; - -#if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000)) - if (PyInstance_Check(pyobj)) { - obj = _PyInstance_Lookup(pyobj, SWIG_This()); - } else { - PyObject **dictptr = _PyObject_GetDictPtr(pyobj); - if (dictptr != NULL) { - PyObject *dict = *dictptr; - obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0; - } else { -#ifdef PyWeakref_CheckProxy - if (PyWeakref_CheckProxy(pyobj)) { - PyObject *wobj = PyWeakref_GET_OBJECT(pyobj); - return wobj ? SWIG_Python_GetSwigThis(wobj) : 0; - } -#endif - obj = PyObject_GetAttr(pyobj,SWIG_This()); - if (obj) { - Py_DECREF(obj); - } else { - if (PyErr_Occurred()) PyErr_Clear(); - return 0; - } - } - } -#else - obj = PyObject_GetAttr(pyobj,SWIG_This()); - if (obj) { - Py_DECREF(obj); - } else { - if (PyErr_Occurred()) PyErr_Clear(); - return 0; - } -#endif - if (obj && !SwigPyObject_Check(obj)) { - /* a PyObject is called 'this', try to get the 'real this' - SwigPyObject from it */ - return SWIG_Python_GetSwigThis(obj); - } - return (SwigPyObject *)obj; -#endif -} - -/* Acquire a pointer value */ - -SWIGRUNTIME int -SWIG_Python_AcquirePtr(PyObject *obj, int own) { - if (own == SWIG_POINTER_OWN) { - SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj); - if (sobj) { - int oldown = sobj->own; - sobj->own = own; - return oldown; - } - } - return 0; -} - -/* Convert a pointer value */ - -SWIGRUNTIME int -SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) { - int res; - SwigPyObject *sobj; - int implicit_conv = (flags & SWIG_POINTER_IMPLICIT_CONV) != 0; - - if (!obj) - return SWIG_ERROR; - if (obj == Py_None && !implicit_conv) { - if (ptr) - *ptr = 0; - return SWIG_OK; - } - - res = SWIG_ERROR; - - sobj = SWIG_Python_GetSwigThis(obj); - if (own) - *own = 0; - while (sobj) { - void *vptr = sobj->ptr; - if (ty) { - swig_type_info *to = sobj->ty; - if (to == ty) { - /* no type cast needed */ - if (ptr) *ptr = vptr; - break; - } else { - swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); - if (!tc) { - sobj = (SwigPyObject *)sobj->next; - } else { - if (ptr) { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc,vptr,&newmemory); - if (newmemory == SWIG_CAST_NEW_MEMORY) { - assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */ - if (own) - *own = *own | SWIG_CAST_NEW_MEMORY; - } - } - break; - } - } - } else { - if (ptr) *ptr = vptr; - break; - } - } - if (sobj) { - if (own) - *own = *own | sobj->own; - if (flags & SWIG_POINTER_DISOWN) { - sobj->own = 0; - } - res = SWIG_OK; - } else { - if (implicit_conv) { - SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; - if (data && !data->implicitconv) { - PyObject *klass = data->klass; - if (klass) { - PyObject *impconv; - data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/ - impconv = SWIG_Python_CallFunctor(klass, obj); - data->implicitconv = 0; - if (PyErr_Occurred()) { - PyErr_Clear(); - impconv = 0; - } - if (impconv) { - SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv); - if (iobj) { - void *vptr; - res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0); - if (SWIG_IsOK(res)) { - if (ptr) { - *ptr = vptr; - /* transfer the ownership to 'ptr' */ - iobj->own = 0; - res = SWIG_AddCast(res); - res = SWIG_AddNewMask(res); - } else { - res = SWIG_AddCast(res); - } - } - } - Py_DECREF(impconv); - } - } - } - } - if (!SWIG_IsOK(res) && obj == Py_None) { - if (ptr) - *ptr = 0; - if (PyErr_Occurred()) - PyErr_Clear(); - res = SWIG_OK; - } - } - return res; -} - -/* Convert a function ptr value */ - -SWIGRUNTIME int -SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) { - if (!PyCFunction_Check(obj)) { - return SWIG_ConvertPtr(obj, ptr, ty, 0); - } else { - void *vptr = 0; - - /* here we get the method pointer for callbacks */ - const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); - const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0; - if (desc) - desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0; - if (!desc) - return SWIG_ERROR; - if (ty) { - swig_cast_info *tc = SWIG_TypeCheck(desc,ty); - if (tc) { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc,vptr,&newmemory); - assert(!newmemory); /* newmemory handling not yet implemented */ - } else { - return SWIG_ERROR; - } - } else { - *ptr = vptr; - } - return SWIG_OK; - } -} - -/* Convert a packed value value */ - -SWIGRUNTIME int -SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) { - swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz); - if (!to) return SWIG_ERROR; - if (ty) { - if (to != ty) { - /* check type cast? */ - swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); - if (!tc) return SWIG_ERROR; - } - } - return SWIG_OK; -} - -/* ----------------------------------------------------------------------------- - * Create a new pointer object - * ----------------------------------------------------------------------------- */ - -/* - Create a new instance object, without calling __init__, and set the - 'this' attribute. -*/ - -SWIGRUNTIME PyObject* -SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) -{ -#if (PY_VERSION_HEX >= 0x02020000) - PyObject *inst = 0; - PyObject *newraw = data->newraw; - if (newraw) { - inst = PyObject_Call(newraw, data->newargs, NULL); - if (inst) { -#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); - } - } -#else - PyObject *key = SWIG_This(); - PyObject_SetAttr(inst, key, swig_this); -#endif - } - } else { -#if PY_VERSION_HEX >= 0x03000000 - inst = ((PyTypeObject*) data->newargs)->tp_new((PyTypeObject*) data->newargs, Py_None, Py_None); - if (inst) { - PyObject_SetAttr(inst, SWIG_This(), swig_this); - Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG; - } -#else - PyObject *dict = PyDict_New(); - if (dict) { - PyDict_SetItem(dict, SWIG_This(), swig_this); - inst = PyInstance_NewRaw(data->newargs, dict); - Py_DECREF(dict); - } -#endif - } - return inst; -#else -#if (PY_VERSION_HEX >= 0x02010000) - PyObject *inst = 0; - PyObject *dict = PyDict_New(); - if (dict) { - PyDict_SetItem(dict, SWIG_This(), swig_this); - inst = PyInstance_NewRaw(data->newargs, dict); - Py_DECREF(dict); - } - return (PyObject *) inst; -#else - PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type); - if (inst == NULL) { - return NULL; - } - inst->in_class = (PyClassObject *)data->newargs; - Py_INCREF(inst->in_class); - inst->in_dict = PyDict_New(); - if (inst->in_dict == NULL) { - Py_DECREF(inst); - return NULL; - } -#ifdef Py_TPFLAGS_HAVE_WEAKREFS - inst->in_weakreflist = NULL; -#endif -#ifdef Py_TPFLAGS_GC - PyObject_GC_Init(inst); -#endif - PyDict_SetItem(inst->in_dict, SWIG_This(), swig_this); - return (PyObject *) inst; -#endif -#endif -} - -SWIGRUNTIME void -SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this) -{ - PyObject *dict; -#if (PY_VERSION_HEX >= 0x02020000) && !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; - } -#endif - dict = PyObject_GetAttrString(inst, (char*)"__dict__"); - PyDict_SetItem(dict, SWIG_This(), swig_this); - Py_DECREF(dict); -} - - -SWIGINTERN PyObject * -SWIG_Python_InitShadowInstance(PyObject *args) { - PyObject *obj[2]; - if (!SWIG_Python_UnpackTuple(args, "swiginit", 2, 2, obj)) { - return NULL; - } else { - SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]); - if (sthis) { - SwigPyObject_append((PyObject*) sthis, obj[1]); - } else { - SWIG_Python_SetSwigThis(obj[0], obj[1]); - } - return SWIG_Py_Void(); - } -} - -/* Create a new pointer object */ - -SWIGRUNTIME PyObject * -SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags) { - SwigPyClientData *clientdata; - PyObject * robj; - int own; - - if (!ptr) - return SWIG_Py_Void(); - - clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0; - own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0; - if (clientdata && clientdata->pytype) { - SwigPyObject *newobj; - if (flags & SWIG_BUILTIN_TP_INIT) { - newobj = (SwigPyObject*) self; - if (newobj->ptr) { - PyObject *next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0); - while (newobj->next) - newobj = (SwigPyObject *) newobj->next; - newobj->next = next_self; - newobj = (SwigPyObject *)next_self; -#ifdef SWIGPYTHON_BUILTIN - newobj->dict = 0; -#endif - } - } else { - newobj = PyObject_New(SwigPyObject, clientdata->pytype); -#ifdef SWIGPYTHON_BUILTIN - newobj->dict = 0; -#endif - } - if (newobj) { - newobj->ptr = ptr; - newobj->ty = type; - newobj->own = own; - newobj->next = 0; - return (PyObject*) newobj; - } - return SWIG_Py_Void(); - } - - assert(!(flags & SWIG_BUILTIN_TP_INIT)); - - robj = SwigPyObject_New(ptr, type, own); - if (robj && clientdata && !(flags & SWIG_POINTER_NOSHADOW)) { - PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj); - Py_DECREF(robj); - robj = inst; - } - return robj; -} - -/* Create a new packed object */ - -SWIGRUNTIMEINLINE PyObject * -SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) { - return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void(); -} - -/* -----------------------------------------------------------------------------* - * Get type list - * -----------------------------------------------------------------------------*/ - -#ifdef SWIG_LINK_RUNTIME -void *SWIG_ReturnGlobalTypeList(void *); -#endif - -SWIGRUNTIME swig_module_info * -SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata)) { - 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 -# ifdef SWIGPY_USE_CAPSULE - type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0); -# else - type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, - (char*)"type_pointer" SWIG_TYPE_TABLE_NAME); -# endif - if (PyErr_Occurred()) { - PyErr_Clear(); - type_pointer = (void *)0; - } -#endif - } - return (swig_module_info *) type_pointer; -} - -#if PY_MAJOR_VERSION < 2 -/* PyModule_AddObject function was introduced in Python 2.0. The following function - is copied out of Python/modsupport.c in python version 2.3.4 */ -SWIGINTERN int -PyModule_AddObject(PyObject *m, char *name, PyObject *o) -{ - PyObject *dict; - if (!PyModule_Check(m)) { - PyErr_SetString(PyExc_TypeError, "PyModule_AddObject() needs module as first arg"); - return SWIG_ERROR; - } - if (!o) { - PyErr_SetString(PyExc_TypeError, "PyModule_AddObject() needs non-NULL value"); - return SWIG_ERROR; - } - - dict = PyModule_GetDict(m); - if (dict == NULL) { - /* Internal error -- modules must have a dict! */ - PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__", - PyModule_GetName(m)); - return SWIG_ERROR; - } - if (PyDict_SetItemString(dict, name, o)) - return SWIG_ERROR; - Py_DECREF(o); - return SWIG_OK; -} -#endif - -SWIGRUNTIME void -#ifdef SWIGPY_USE_CAPSULE -SWIG_Python_DestroyModule(PyObject *obj) -#else -SWIG_Python_DestroyModule(void *vptr) -#endif -{ -#ifdef SWIGPY_USE_CAPSULE - swig_module_info *swig_module = (swig_module_info *) PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME); -#else - swig_module_info *swig_module = (swig_module_info *) vptr; -#endif - swig_type_info **types = swig_module->types; - size_t i; - for (i =0; i < swig_module->size; ++i) { - swig_type_info *ty = types[i]; - if (ty->owndata) { - SwigPyClientData *data = (SwigPyClientData *) ty->clientdata; - if (data) SwigPyClientData_Del(data); - } - } - Py_DECREF(SWIG_This()); - swig_this = NULL; -} - -SWIGRUNTIME void -SWIG_Python_SetModule(swig_module_info *swig_module) { -#if PY_VERSION_HEX >= 0x03000000 - /* Add a dummy module object into sys.modules */ - PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION); -#else - static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} }; /* Sentinel */ - PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table); -#endif -#ifdef SWIGPY_USE_CAPSULE - PyObject *pointer = PyCapsule_New((void *) swig_module, SWIGPY_CAPSULE_NAME, SWIG_Python_DestroyModule); - if (pointer && module) { - PyModule_AddObject(module, (char*)"type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer); - } else { - Py_XDECREF(pointer); - } -#else - PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule); - if (pointer && module) { - PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer); - } else { - Py_XDECREF(pointer); - } -#endif -} - -/* 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) -{ - PyObject *cache = SWIG_Python_TypeCache(); - PyObject *key = SWIG_Python_str_FromChar(type); - PyObject *obj = PyDict_GetItem(cache, key); - swig_type_info *descriptor; - if (obj) { -#ifdef SWIGPY_USE_CAPSULE - descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, NULL); -#else - descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj); -#endif - } else { - swig_module_info *swig_module = SWIG_GetModule(0); - descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type); - if (descriptor) { -#ifdef SWIGPY_USE_CAPSULE - obj = PyCapsule_New((void*) descriptor, NULL, NULL); -#else - obj = PyCObject_FromVoidPtr(descriptor, NULL); -#endif - PyDict_SetItem(cache, key, obj); - Py_DECREF(obj); - } - } - Py_DECREF(key); - return descriptor; -} - -/* - For backward compatibility only -*/ -#define SWIG_POINTER_EXCEPTION 0 -#define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg) -#define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags) - -SWIGRUNTIME int -SWIG_Python_AddErrMesg(const char* mesg, int infront) -{ - if (PyErr_Occurred()) { - PyObject *type = 0; - PyObject *value = 0; - PyObject *traceback = 0; - PyErr_Fetch(&type, &value, &traceback); - if (value) { - char *tmp; - PyObject *old_str = PyObject_Str(value); - Py_XINCREF(type); - PyErr_Clear(); - if (infront) { - PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str)); - } else { - PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); - } - SWIG_Python_str_DelForPy3(tmp); - Py_DECREF(old_str); - } - return 1; - } else { - return 0; - } -} - -SWIGRUNTIME int -SWIG_Python_ArgFail(int argnum) -{ - if (PyErr_Occurred()) { - /* add information about failing argument */ - char mesg[256]; - PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum); - return SWIG_Python_AddErrMesg(mesg, 1); - } else { - return 0; - } -} - -SWIGRUNTIMEINLINE const char * -SwigPyObject_GetDesc(PyObject *self) -{ - SwigPyObject *v = (SwigPyObject *)self; - swig_type_info *ty = v ? v->ty : 0; - return ty ? ty->str : ""; -} - -SWIGRUNTIME void -SWIG_Python_TypeError(const char *type, PyObject *obj) -{ - if (type) { -#if defined(SWIG_COBJECT_TYPES) - if (obj && SwigPyObject_Check(obj)) { - const char *otype = (const char *) SwigPyObject_GetDesc(obj); - if (otype) { - PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received", - type, otype); - return; - } - } else -#endif - { - 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; - 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(str); - return; - } - } - PyErr_Format(PyExc_TypeError, "a '%s' is expected", type); - } else { - PyErr_Format(PyExc_TypeError, "unexpected type is received"); - } -} - - -/* Convert a pointer value, signal an exception on a type mismatch */ -SWIGRUNTIME void * -SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags) { - 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; -} - -#ifdef SWIGPYTHON_BUILTIN -SWIGRUNTIME int -SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { - PyTypeObject *tp = obj->ob_type; - PyObject *descr; - PyObject *encoded_name; - descrsetfunc f; - int res = -1; - -# ifdef Py_USING_UNICODE - if (PyString_Check(name)) { - name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL); - if (!name) - return -1; - } else if (!PyUnicode_Check(name)) -# else - if (!PyString_Check(name)) -# endif - { - PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name); - return -1; - } else { - Py_INCREF(name); - } - - if (!tp->tp_dict) { - if (PyType_Ready(tp) < 0) - goto done; - } - - descr = _PyType_Lookup(tp, name); - f = NULL; - if (descr != NULL) - f = descr->ob_type->tp_descr_set; - if (!f) { - if (PyString_Check(name)) { - encoded_name = name; - Py_INCREF(name); - } else { - encoded_name = PyUnicode_AsUTF8String(name); - } - PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name)); - Py_DECREF(encoded_name); - } else { - res = f(descr, obj, value); - } - - done: - Py_DECREF(name); - return res; -} -#endif - - -#ifdef __cplusplus -} -#endif - - - -#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 - - - - #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0) - - -/* -------- TYPES TABLE (BEGIN) -------- */ - -#define SWIGTYPE_p_BloombergLP__blpapi__AbstractSession swig_types[0] -#define SWIGTYPE_p_BloombergLP__blpapi__ProviderSession swig_types[1] -#define SWIGTYPE_p_BloombergLP__blpapi__Session swig_types[2] -#define SWIGTYPE_p_blpapi_AbstractSession swig_types[3] -#define SWIGTYPE_p_blpapi_Constant swig_types[4] -#define SWIGTYPE_p_blpapi_ConstantList swig_types[5] -#define SWIGTYPE_p_blpapi_CorrelationId_t_ swig_types[6] -#define SWIGTYPE_p_blpapi_Datetime_tag swig_types[7] -#define SWIGTYPE_p_blpapi_Element swig_types[8] -#define SWIGTYPE_p_blpapi_Event swig_types[9] -#define SWIGTYPE_p_blpapi_EventDispatcher swig_types[10] -#define SWIGTYPE_p_blpapi_EventFormatter swig_types[11] -#define SWIGTYPE_p_blpapi_EventQueue swig_types[12] -#define SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag swig_types[13] -#define SWIGTYPE_p_blpapi_Identity swig_types[14] -#define SWIGTYPE_p_blpapi_Logging_Func_t swig_types[15] -#define SWIGTYPE_p_blpapi_Logging_Severity_t swig_types[16] -#define SWIGTYPE_p_blpapi_ManagedPtr_t_ swig_types[17] -#define SWIGTYPE_p_blpapi_Message swig_types[18] -#define SWIGTYPE_p_blpapi_MessageIterator swig_types[19] -#define SWIGTYPE_p_blpapi_Name swig_types[20] -#define SWIGTYPE_p_blpapi_Operation swig_types[21] -#define SWIGTYPE_p_blpapi_ProviderSession swig_types[22] -#define SWIGTYPE_p_blpapi_Request swig_types[23] -#define SWIGTYPE_p_blpapi_RequestTemplate swig_types[24] -#define SWIGTYPE_p_blpapi_ResolutionList swig_types[25] -#define SWIGTYPE_p_blpapi_Service swig_types[26] -#define SWIGTYPE_p_blpapi_ServiceRegistrationOptions swig_types[27] -#define SWIGTYPE_p_blpapi_Session swig_types[28] -#define SWIGTYPE_p_blpapi_SessionOptions swig_types[29] -#define SWIGTYPE_p_blpapi_StreamWriter_t swig_types[30] -#define SWIGTYPE_p_blpapi_SubscriptionItrerator swig_types[31] -#define SWIGTYPE_p_blpapi_SubscriptionList swig_types[32] -#define SWIGTYPE_p_blpapi_TimePoint_t swig_types[33] -#define SWIGTYPE_p_blpapi_TlsOptions swig_types[34] -#define SWIGTYPE_p_blpapi_Topic swig_types[35] -#define SWIGTYPE_p_blpapi_TopicList swig_types[36] -#define SWIGTYPE_p_char swig_types[37] -#define SWIGTYPE_p_double swig_types[38] -#define SWIGTYPE_p_f_p_blpapi_Event_p_blpapi_ProviderSession_p_void__void swig_types[39] -#define SWIGTYPE_p_float swig_types[40] -#define SWIGTYPE_p_int swig_types[41] -#define SWIGTYPE_p_intArray swig_types[42] -#define SWIGTYPE_p_long_long swig_types[43] -#define SWIGTYPE_p_p_blpapi_Element swig_types[44] -#define SWIGTYPE_p_p_blpapi_Event swig_types[45] -#define SWIGTYPE_p_p_blpapi_Message swig_types[46] -#define SWIGTYPE_p_p_blpapi_Name swig_types[47] -#define SWIGTYPE_p_p_blpapi_Operation swig_types[48] -#define SWIGTYPE_p_p_blpapi_Request swig_types[49] -#define SWIGTYPE_p_p_blpapi_RequestTemplate swig_types[50] -#define SWIGTYPE_p_p_blpapi_Service swig_types[51] -#define SWIGTYPE_p_p_blpapi_Topic swig_types[52] -#define SWIGTYPE_p_p_char swig_types[53] -#define SWIGTYPE_p_p_p_void swig_types[54] -#define SWIGTYPE_p_p_void swig_types[55] -#define SWIGTYPE_p_short swig_types[56] -#define SWIGTYPE_p_unsigned_char swig_types[57] -#define SWIGTYPE_p_unsigned_int swig_types[58] -#define SWIGTYPE_p_unsigned_long_long swig_types[59] -#define SWIGTYPE_p_unsigned_short swig_types[60] -static swig_type_info *swig_types[62]; -static swig_module_info swig_module = {swig_types, 61, 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) - -/* -------- TYPES TABLE (END) -------- */ - -#if (PY_VERSION_HEX <= 0x02000000) -# if !defined(SWIG_PYTHON_CLASSIC) -# error "This python version requires swig to be run with the '-classic' option" -# endif -#endif - -/*----------------------------------------------- - @(target):= _internals.so - ------------------------------------------------*/ -#if PY_VERSION_HEX >= 0x03000000 -# define SWIG_init PyInit__internals - -#else -# define SWIG_init init_internals - -#endif -#define SWIG_name "_internals" - -#define SWIGVERSION 0x030012 -#define SWIG_VERSION SWIGVERSION - - -#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a)) -#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a)) - - -#include - - -namespace swig { - class SwigPtr_PyObject { - protected: - PyObject *_obj; - - public: - SwigPtr_PyObject() :_obj(0) - { - } - - SwigPtr_PyObject(const SwigPtr_PyObject& item) : _obj(item._obj) - { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - Py_XINCREF(_obj); - SWIG_PYTHON_THREAD_END_BLOCK; - } - - SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj) - { - if (initial_ref) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - Py_XINCREF(_obj); - SWIG_PYTHON_THREAD_END_BLOCK; - } - } - - SwigPtr_PyObject & operator=(const SwigPtr_PyObject& item) - { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - Py_XINCREF(item._obj); - Py_XDECREF(_obj); - _obj = item._obj; - SWIG_PYTHON_THREAD_END_BLOCK; - return *this; - } - - ~SwigPtr_PyObject() - { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - Py_XDECREF(_obj); - SWIG_PYTHON_THREAD_END_BLOCK; - } - - operator PyObject *() const - { - return _obj; - } - - PyObject *operator->() const - { - return _obj; - } - }; -} - - -namespace swig { - struct SwigVar_PyObject : SwigPtr_PyObject { - SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) { } - - SwigVar_PyObject & operator = (PyObject* obj) - { - Py_XDECREF(_obj); - _obj = obj; - return *this; - } - }; -} - - -SWIGINTERNINLINE PyObject* - SWIG_From_int (int value) -{ - return PyInt_FromLong((long) value); -} - - -#define SWIG_FILE_WITH_INIT -#include "blpapi_types.h" - - -#include - - -SWIGINTERNINLINE PyObject* - SWIG_From_unsigned_SS_int (unsigned int value) -{ - return PyInt_FromSize_t((size_t) value); -} - - - #define SWIG_From_long PyInt_FromLong - - -SWIGINTERNINLINE PyObject* -SWIG_From_unsigned_SS_long (unsigned long value) -{ - return (value > LONG_MAX) ? - PyLong_FromUnsignedLong(value) : PyInt_FromLong(static_cast< long >(value)); -} - - -#include -#if !defined(SWIG_NO_LLONG_MAX) -# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__) -# define LLONG_MAX __LONG_LONG_MAX__ -# define LLONG_MIN (-LLONG_MAX - 1LL) -# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL) -# endif -#endif - - -#if defined(LLONG_MAX) && !defined(SWIG_LONG_LONG_AVAILABLE) -# define SWIG_LONG_LONG_AVAILABLE -#endif - - -#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE PyObject* -SWIG_From_unsigned_SS_long_SS_long (unsigned long long value) -{ - return (value > LONG_MAX) ? - PyLong_FromUnsignedLongLong(value) : PyInt_FromLong(static_cast< long >(value)); -} -#endif - - -SWIGINTERNINLINE PyObject * -SWIG_From_size_t (size_t value) -{ -#ifdef SWIG_LONG_LONG_AVAILABLE - if (sizeof(size_t) <= sizeof(unsigned long)) { -#endif - return SWIG_From_unsigned_SS_long (static_cast< unsigned long >(value)); -#ifdef SWIG_LONG_LONG_AVAILABLE - } else { - /* assume sizeof(size_t) <= sizeof(unsigned long long) */ - return SWIG_From_unsigned_SS_long_SS_long (static_cast< unsigned long long >(value)); - } -#endif -} - - -#include "blpapi_constant.h" -#include "blpapi_datetime.h" -#include "blpapi_diagnosticsutil.h" -#include "blpapi_element.h" -#include "blpapi_error.h" -#include "blpapi_event.h" -#include "blpapi_eventdispatcher.h" -#include "blpapi_highresolutionclock.h" -#include "blpapi_identity.h" -#include "blpapi_logging.h" -#include "blpapi_message.h" -#include "blpapi_name.h" -#include "blpapi_request.h" -#include "blpapi_schema.h" -#include "blpapi_service.h" -#include "blpapi_session.h" -#include "blpapi_sessionoptions.h" -#include "blpapi_streamproxy.h" -#include "blpapi_subscriptionlist.h" -#include "blpapi_timepoint.h" - -// publishing support -#include "blpapi_eventformatter.h" -#include "blpapi_providersession.h" -#include "blpapi_resolutionlist.h" -#include "blpapi_topic.h" -#include "blpapi_topiclist.h" - -#ifndef MAX_GROUP_ID_SIZE -// MAX_GROUP_ID_SIZE is not defined in BLPAPI, but docs say its value is 64 -#define MAX_GROUP_ID_SIZE 64 -#endif - -#include // for std::ostringstream -#include // for std::runtime_error -#include // for tm and mktime - - -std::string blpapi_Service_printHelper( - blpapi_Service_t *service, - int level, - int spacesPerLevel) -{ - std::ostringstream stream; - - blpapi_Service_print( - service, - BloombergLP::blpapi::OstreamWriter, - &stream, - level, - spacesPerLevel); - - return stream.str(); -} - -std::string blpapi_SchemaElementDefinition_printHelper( - blpapi_SchemaElementDefinition_t *item, - int level, - int spacesPerLevel) -{ - std::ostringstream stream; - - blpapi_SchemaElementDefinition_print( - item, - BloombergLP::blpapi::OstreamWriter, - &stream, - level, - spacesPerLevel); - - return stream.str(); -} - -std::string blpapi_SchemaTypeDefinition_printHelper( - blpapi_SchemaTypeDefinition_t *item, - int level, - int spacesPerLevel) -{ - std::ostringstream stream; - - blpapi_SchemaTypeDefinition_print( - item, - BloombergLP::blpapi::OstreamWriter, - &stream, - level, - spacesPerLevel); - - return stream.str(); -} - -std::string blpapi_SessionOptions_printHelper( - blpapi_SessionOptions_t *sessionOptions, - int level, - int spacesPerLevel) -{ - std::ostringstream stream; - - blpapi_SessionOptions_print( - sessionOptions, - BloombergLP::blpapi::OstreamWriter, - &stream, - level, - spacesPerLevel); - - return stream.str(); -} - -bool blpapi_SchemaTypeDefinition_hasElementDefinition( - const blpapi_SchemaTypeDefinition_t *type, - const char *nameString, - const blpapi_Name_t *name) -{ - return 0 != blpapi_SchemaTypeDefinition_getElementDefinition( - type, nameString, name); -} - -bool blpapi_ConstantList_hasConstant( - const blpapi_ConstantList_t *list, - const char *nameString, - const blpapi_Name_t *name) -{ - return 0 != blpapi_ConstantList_getConstant(list, nameString, name); -} - -bool blpapi_Service_hasEventDefinition( - blpapi_Service_t *service, - const char* nameString, - const blpapi_Name_t *name) -{ - blpapi_SchemaElementDefinition_t *eventDefinition; - - return 0 == blpapi_Service_getEventDefinition( - service, &eventDefinition, nameString, name); -} - -bool blpapi_Service_hasOperation( - blpapi_Service_t *service, - const char* nameString, - const blpapi_Name_t *name) -{ - blpapi_Operation_t *operation; - - return 0 == blpapi_Service_getOperation( - service, &operation, nameString, name); -} - -int blpapi_SubscriptionList_addHelper( - blpapi_SubscriptionList_t *list, - const char *topic, - const blpapi_CorrelationId_t *correlationId, - const char *fields, - const char *options) -{ - return blpapi_SubscriptionList_add( - list, - topic, - correlationId, - &fields, - &options, - fields ? 1 : 0, - options ? 1: 0); -} - -bool blpapi_Name_hasName(const char *nameString) -{ - return blpapi_Name_findName(nameString) ? true : false; -} - -blpapi_TopicList_t* blpapi_TopicList_createFromResolutionList( - blpapi_ResolutionList_t* from) -{ - return blpapi_TopicList_create(reinterpret_cast(from)); -} - -std::string blpapi_DiagnosticsUtil_memoryInfo_wrapper() -{ - // Get the length of the buffer first - int len = blpapi_DiagnosticsUtil_memoryInfo(0, 0); - if (len < 0) { - throw std::runtime_error("blpapi_DiagnosticsUtil_memoryInfo error"); - } - - // Allocate buffer and call the function - std::string buffer; - buffer.resize(len+1); - blpapi_DiagnosticsUtil_memoryInfo(&buffer[0], len+1); - return buffer; -} - -typedef void (*blpapi_Logging_Func_t)(blpapi_UInt64_t threadId, - int severity, - blpapi_Datetime_t timestamp, - const char *category, - const char *message); - -// Shared global object guarded by GIL -PyObject* loggerCallback = 0; - -static time_t blpapi_Datetime_to_unix(blpapi_Datetime_t const& original) { - time_t rawtime = time(NULL); - struct tm *ts = localtime(&rawtime); - if (original.parts & BLPAPI_DATETIME_DATE_PART) { - ts->tm_year = original.year - 1900; // tm_year should contain number of years since 1900 - ts->tm_mon = original.month - 1; // tm_mon is zero based - ts->tm_mday = original.day; - if (original.parts & BLPAPI_DATETIME_TIME_PART) { - ts->tm_hour = original.hours; - ts->tm_min = original.minutes; - ts->tm_sec = original.seconds; - } - } - time_t result = mktime(ts); - return result; -} - -void loggerCallbackWrapper(blpapi_UInt64_t threadId, - int severity, - blpapi_Datetime_t original, - const char *category, - const char *message) -{ - time_t ts = blpapi_Datetime_to_unix(original); - - PyGILState_STATE gilstate = PyGILState_Ensure(); - PyObject* result = PyObject_CallFunction(loggerCallback, "KiIss", - threadId, severity, ts, - category, message); - PyGILState_Release(gilstate); - Py_XDECREF(result); -} - -void setLoggerCallbackWrapper(PyObject *cb, int severity) -{ - if (!PyCallable_Check(cb)) { - throw std::invalid_argument("parameter must be a function"); - } - Py_XINCREF(cb); - Py_XDECREF(loggerCallback); - loggerCallback = cb; - // Set actual callback - int err = blpapi_Logging_registerCallback(&loggerCallbackWrapper, (blpapi_Logging_Severity_t)severity); - if (err != 0) { - throw std::runtime_error("unable to register callback"); - } -} - -/** Convert `blpapi_TimePoint_t` value to `blpapi_Datetime_t`. Function - * always returns UTC time. - */ -blpapi_Datetime_t fromTimePoint(blpapi_TimePoint_t original) -{ - blpapi_HighPrecisionDatetime_t highPrecisionDatetime; - blpapi_HighPrecisionDatetime_fromTimePoint( - &highPrecisionDatetime, - &original, - 0); - - blpapi_Datetime_t datetime = highPrecisionDatetime.datetime; - - return datetime; -} - -/** Get the timestmap associated with message or throw an exception. - */ -blpapi_Datetime_t blpapi_Message_timeReceived_wrapper( - const blpapi_Message_t *message) -{ - blpapi_TimePoint_t value; - int retval = blpapi_Message_timeReceived(message, &value); - if (retval != 0) { - throw std::invalid_argument("Message has no timestamp"); - } - return fromTimePoint(value); -} - -/** Call blpapi_HighResolutionClock_now and convert result to blpapi_Datetime_t. - */ -blpapi_Datetime_t blpapi_HighResolutionClock_now_wrapper() -{ - blpapi_TimePoint_t timepoint; - int res = blpapi_HighResolutionClock_now(&timepoint); - if (res != 0) { - throw std::runtime_error("High resolution clock error"); - } - return fromTimePoint(timepoint); -} - - -SWIGINTERN int -SWIG_AsVal_double (PyObject *obj, double *val) -{ - int res = SWIG_TypeError; - if (PyFloat_Check(obj)) { - if (val) *val = PyFloat_AsDouble(obj); - return SWIG_OK; -#if PY_VERSION_HEX < 0x03000000 - } else if (PyInt_Check(obj)) { - if (val) *val = (double) PyInt_AsLong(obj); - return SWIG_OK; -#endif - } else if (PyLong_Check(obj)) { - double v = PyLong_AsDouble(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_OK; - } else { - PyErr_Clear(); - } - } -#ifdef SWIG_PYTHON_CAST_MODE - { - int dispatch = 0; - double d = PyFloat_AsDouble(obj); - if (!PyErr_Occurred()) { - if (val) *val = d; - return SWIG_AddCast(SWIG_OK); - } else { - PyErr_Clear(); - } - if (!dispatch) { - long v = PyLong_AsLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_AddCast(SWIG_AddCast(SWIG_OK)); - } else { - PyErr_Clear(); - } - } - } -#endif - return res; -} - - -#include - - -#include - - -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 */ - if ((errno == EDOM) || (errno == ERANGE)) { - errno = 0; - } else { - double summ, reps, diff; - if (rd < x) { - diff = x - rd; - } else if (rd > x) { - diff = rd - x; - } else { - return 1; - } - summ = rd + x; - reps = diff/summ; - if (reps < 8*DBL_EPSILON) { - *d = rd; - return 1; - } - } - } - return 0; -} - - -SWIGINTERN int -SWIG_AsVal_long (PyObject *obj, long* val) -{ -#if PY_VERSION_HEX < 0x03000000 - if (PyInt_Check(obj)) { - if (val) *val = PyInt_AsLong(obj); - return SWIG_OK; - } else -#endif - if (PyLong_Check(obj)) { - long v = PyLong_AsLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_OK; - } else { - PyErr_Clear(); - return SWIG_OverflowError; - } - } -#ifdef SWIG_PYTHON_CAST_MODE - { - int dispatch = 0; - long v = PyInt_AsLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_AddCast(SWIG_OK); - } else { - PyErr_Clear(); - } - if (!dispatch) { - double d; - int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d)); - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) { - if (val) *val = (long)(d); - return res; - } - } - } -#endif - return SWIG_TypeError; -} - - -SWIGINTERN int -SWIG_AsVal_int (PyObject * obj, int *val) -{ - long v; - int res = SWIG_AsVal_long (obj, &v); - if (SWIG_IsOK(res)) { - if ((v < INT_MIN || v > INT_MAX)) { - return SWIG_OverflowError; - } else { - if (val) *val = static_cast< int >(v); - } - } - return res; -} - - -SWIGINTERN swig_type_info* -SWIG_pchar_descriptor(void) -{ - static int init = 0; - static swig_type_info* info = 0; - if (!init) { - info = SWIG_TypeQuery("_p_char"); - init = 1; - } - return info; -} - - -SWIGINTERNINLINE PyObject * -SWIG_FromCharPtrAndSize(const char* carray, size_t size) -{ - if (carray) { - if (size > INT_MAX) { - swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - return pchar_descriptor ? - SWIG_InternalNewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : SWIG_Py_Void(); - } else { -#if PY_VERSION_HEX >= 0x03000000 -#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) - return PyBytes_FromStringAndSize(carray, static_cast< Py_ssize_t >(size)); -#else -#if PY_VERSION_HEX >= 0x03010000 - return PyUnicode_DecodeUTF8(carray, static_cast< Py_ssize_t >(size), "surrogateescape"); -#else - return PyUnicode_FromStringAndSize(carray, static_cast< Py_ssize_t >(size)); -#endif -#endif -#else - return PyString_FromStringAndSize(carray, static_cast< Py_ssize_t >(size)); -#endif - } - } else { - return SWIG_Py_Void(); - } -} - - -SWIGINTERNINLINE PyObject * -SWIG_From_std_string (const std::string& s) -{ - return SWIG_FromCharPtrAndSize(s.data(), s.size()); -} - - -SWIGINTERN int -SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) -{ -#if PY_VERSION_HEX>=0x03000000 -#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) - if (PyBytes_Check(obj)) -#else - if (PyUnicode_Check(obj)) -#endif -#else - if (PyString_Check(obj)) -#endif - { - char *cstr; Py_ssize_t len; -#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(alloc) *alloc = SWIG_NEWOBJ; -#endif - PyBytes_AsStringAndSize(obj, &cstr, &len); -#else - PyString_AsStringAndSize(obj, &cstr, &len); -#endif - if (cptr) { - if (alloc) { - /* - In python the user should not be able to modify the inner - string representation. To warranty that, if you define - SWIG_PYTHON_SAFE_CSTRINGS, a new/copy of the python string - buffer is always returned. - - The default behavior is just to return the pointer value, - so, be careful. - */ -#if defined(SWIG_PYTHON_SAFE_CSTRINGS) - if (*alloc != SWIG_OLDOBJ) -#else - if (*alloc == SWIG_NEWOBJ) -#endif - { - *cptr = reinterpret_cast< char* >(memcpy(new char[len + 1], cstr, sizeof(char)*(len + 1))); - *alloc = SWIG_NEWOBJ; - } else { - *cptr = cstr; - *alloc = SWIG_OLDOBJ; - } - } 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); -#endif - } - } - if (psize) *psize = len + 1; -#if PY_VERSION_HEX>=0x03000000 && !defined(SWIG_PYTHON_STRICT_BYTE_CHAR) - Py_XDECREF(obj); -#endif - return SWIG_OK; - } else { -#if defined(SWIG_PYTHON_2_UNICODE) -#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) -#error "Cannot use both SWIG_PYTHON_2_UNICODE and SWIG_PYTHON_STRICT_BYTE_CHAR at once" -#endif -#if PY_VERSION_HEX<0x03000000 - if (PyUnicode_Check(obj)) { - char *cstr; Py_ssize_t len; - if (!alloc && cptr) { - return SWIG_RuntimeError; - } - obj = PyUnicode_AsUTF8String(obj); - if (PyString_AsStringAndSize(obj, &cstr, &len) != -1) { - if (cptr) { - if (alloc) *alloc = SWIG_NEWOBJ; - *cptr = reinterpret_cast< char* >(memcpy(new char[len + 1], cstr, sizeof(char)*(len + 1))); - } - if (psize) *psize = len + 1; - - Py_XDECREF(obj); - return SWIG_OK; - } else { - Py_XDECREF(obj); - } - } -#endif -#endif - - swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - if (pchar_descriptor) { - void* vptr = 0; - if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) { - if (cptr) *cptr = (char *) vptr; - if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0; - if (alloc) *alloc = SWIG_OLDOBJ; - return SWIG_OK; - } - } - } - return SWIG_TypeError; -} - - - - - -SWIGINTERNINLINE PyObject* - SWIG_From_bool (bool value) -{ - return PyBool_FromLong(value ? 1 : 0); -} - - -typedef int intArray; - - -SWIGINTERN int -SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val) -{ -#if PY_VERSION_HEX < 0x03000000 - if (PyInt_Check(obj)) { - long v = PyInt_AsLong(obj); - if (v >= 0) { - if (val) *val = v; - return SWIG_OK; - } else { - return SWIG_OverflowError; - } - } else -#endif - if (PyLong_Check(obj)) { - unsigned long v = PyLong_AsUnsignedLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_OK; - } else { - PyErr_Clear(); - return SWIG_OverflowError; - } - } -#ifdef SWIG_PYTHON_CAST_MODE - { - int dispatch = 0; - unsigned long v = PyLong_AsUnsignedLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_AddCast(SWIG_OK); - } else { - PyErr_Clear(); - } - if (!dispatch) { - double d; - int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d)); - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) { - if (val) *val = (unsigned long)(d); - return res; - } - } - } -#endif - return SWIG_TypeError; -} - - -#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERN int -SWIG_AsVal_unsigned_SS_long_SS_long (PyObject *obj, unsigned long long *val) -{ - int res = SWIG_TypeError; - if (PyLong_Check(obj)) { - unsigned long long v = PyLong_AsUnsignedLongLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_OK; - } else { - PyErr_Clear(); - res = SWIG_OverflowError; - } - } else { - unsigned long v; - res = SWIG_AsVal_unsigned_SS_long (obj,&v); - if (SWIG_IsOK(res)) { - if (val) *val = v; - return res; - } - } -#ifdef SWIG_PYTHON_CAST_MODE - { - const double mant_max = 1LL << DBL_MANT_DIG; - double d; - res = SWIG_AsVal_double (obj,&d); - if (SWIG_IsOK(res) && !SWIG_CanCastAsInteger(&d, 0, mant_max)) - return SWIG_OverflowError; - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, mant_max)) { - if (val) *val = (unsigned long long)(d); - return SWIG_AddCast(res); - } - res = SWIG_TypeError; - } -#endif - return res; -} -#endif - - -SWIGINTERNINLINE int -SWIG_AsVal_size_t (PyObject * obj, size_t *val) -{ - int res = SWIG_TypeError; -#ifdef SWIG_LONG_LONG_AVAILABLE - if (sizeof(size_t) <= sizeof(unsigned long)) { -#endif - unsigned long v; - res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0); - if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v); -#ifdef SWIG_LONG_LONG_AVAILABLE - } else if (sizeof(size_t) <= sizeof(unsigned long long)) { - unsigned long long v; - res = SWIG_AsVal_unsigned_SS_long_SS_long (obj, val ? &v : 0); - if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v); - } -#endif - return res; -} - -SWIGINTERN intArray *new_intArray(size_t nelements){ - return (new int[nelements]()); - } -SWIGINTERN void delete_intArray(intArray *self){ - delete[] self; - } -SWIGINTERN int intArray___getitem__(intArray *self,size_t index){ - return self[index]; - } -SWIGINTERN void intArray___setitem__(intArray *self,size_t index,int value){ - self[index] = value; - } -SWIGINTERN int *intArray_cast(intArray *self){ - return self; - } -SWIGINTERN intArray *intArray_frompointer(int *t){ - return static_cast< intArray * >(t); - } - - static blpapi_Topic_t* *new_topicPtrArray(size_t nelements) { - return (new blpapi_Topic_t*[nelements]()); - } - - static void delete_topicPtrArray(blpapi_Topic_t* *ary) { - delete[] ary; - } - - static blpapi_Topic_t* topicPtrArray_getitem(blpapi_Topic_t* *ary, size_t index) { - return ary[index]; - } - static void topicPtrArray_setitem(blpapi_Topic_t* *ary, size_t index, blpapi_Topic_t* value) { - ary[index] = value; - } - - - -#include "blpapi_correlationid.h" - -int pyObjectManagerFunc( - blpapi_ManagedPtr_t *managedPtr, - const blpapi_ManagedPtr_t *srcPtr, - int operation) -{ - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - if (operation == BLPAPI_MANAGEDPTR_COPY) { - managedPtr->pointer = srcPtr->pointer; - managedPtr->manager = srcPtr->manager; - Py_INCREF(reinterpret_cast(managedPtr->pointer)); - } - else if (operation == BLPAPI_MANAGEDPTR_DESTROY) { - Py_DECREF(reinterpret_cast(managedPtr->pointer)); - } - SWIG_PYTHON_THREAD_END_BLOCK; - - return 0; -} - -blpapi_CorrelationId_t *CorrelationId_t_createEmpty() -{ - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_CorrelationId_t *cid = new blpapi_CorrelationId_t; - std::memset(cid, 0, sizeof(blpapi_CorrelationId_t)); - SWIG_PYTHON_THREAD_END_ALLOW; - - return cid; -} - -blpapi_CorrelationId_t *CorrelationId_t_createFromInteger(long long value, unsigned short classId) -{ - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_CorrelationId_t *cid = new blpapi_CorrelationId_t; - std::memset(cid, 0, sizeof(blpapi_CorrelationId_t)); - - cid->size = sizeof(blpapi_CorrelationId_t); - cid->valueType = BLPAPI_CORRELATION_TYPE_INT; - cid->classId = classId; - cid->value.intValue = value; - SWIG_PYTHON_THREAD_END_ALLOW; - - return cid; -} - -blpapi_CorrelationId_t *CorrelationId_t_createFromObject(PyObject *value, unsigned short classId) -{ - if (!value) { - value = Py_None; - } - - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_CorrelationId_t *cid = new blpapi_CorrelationId_t; - std::memset(cid, 0, sizeof(blpapi_CorrelationId_t)); - - cid->size = sizeof(blpapi_CorrelationId_t); - cid->valueType = BLPAPI_CORRELATION_TYPE_POINTER; - cid->classId = classId; - - cid->value.ptrValue.manager = &pyObjectManagerFunc; - cid->value.ptrValue.pointer = value; - SWIG_PYTHON_THREAD_END_ALLOW; - - Py_INCREF(value); - - return cid; -} - -blpapi_CorrelationId_t *CorrelationId_t_clone(const blpapi_CorrelationId_t& original) -{ - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_CorrelationId_t *cid = new blpapi_CorrelationId_t(original); - SWIG_PYTHON_THREAD_END_ALLOW; - - if (BLPAPI_CORRELATION_TYPE_POINTER == cid->valueType) { - blpapi_ManagedPtr_ManagerFunction_t& manager = - cid->value.ptrValue.manager; - if (manager) { - manager(&cid->value.ptrValue, &original.value.ptrValue, - BLPAPI_MANAGEDPTR_COPY); - } - } - - return cid; -} - -void CorrelationId_t_cleanup(blpapi_CorrelationId_t& cid) -{ - if (BLPAPI_CORRELATION_TYPE_POINTER == cid.valueType) { - blpapi_ManagedPtr_ManagerFunction_t &manager = - cid.value.ptrValue.manager; - if (manager) { - manager(&cid.value.ptrValue, 0, BLPAPI_MANAGEDPTR_DESTROY); - } - } -} - -void CorrelationId_t_delete(blpapi_CorrelationId_t *cid) -{ - if (!cid) { - return; - } - - CorrelationId_t_cleanup(*cid); - - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - delete cid; - SWIG_PYTHON_THREAD_END_ALLOW; -} - -bool CorrelationId_t_equals( - const blpapi_CorrelationId_t& cid1, - const blpapi_CorrelationId_t& cid2) -{ - if (cid1.valueType != cid2.valueType) { - return false; - } - - if (cid1.classId != cid2.classId) { - return false; - } - - if (cid1.valueType == BLPAPI_CORRELATION_TYPE_POINTER) { - return cid1.value.ptrValue.pointer == cid2.value.ptrValue.pointer; - } else { - return cid1.value.intValue == cid2.value.intValue; - } -} - -long long CorrelationId_t_toInteger(const blpapi_CorrelationId_t& cid) -{ - if (cid.valueType == BLPAPI_CORRELATION_TYPE_POINTER) - return reinterpret_cast(cid.value.ptrValue.pointer); - return cid.value.intValue; -} - -PyObject *CorrelationId_t_getObject(const blpapi_CorrelationId_t& cid) { - PyObject *res; - - if (BLPAPI_CORRELATION_TYPE_POINTER == cid.valueType - && &pyObjectManagerFunc == cid.value.ptrValue.manager) - { - res = reinterpret_cast(cid.value.ptrValue.pointer); - } - else { - res = Py_None; - } - - Py_INCREF(res); - return res; -} - - -SWIGINTERN blpapi_CorrelationId_t_ *new_blpapi_CorrelationId_t___SWIG_0(){ - return CorrelationId_t_createEmpty(); - } - -#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERN int -SWIG_AsVal_long_SS_long (PyObject *obj, long long *val) -{ - int res = SWIG_TypeError; - if (PyLong_Check(obj)) { - long long v = PyLong_AsLongLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_OK; - } else { - PyErr_Clear(); - res = SWIG_OverflowError; - } - } else { - long v; - res = SWIG_AsVal_long (obj,&v); - if (SWIG_IsOK(res)) { - if (val) *val = v; - return res; - } - } -#ifdef SWIG_PYTHON_CAST_MODE - { - const double mant_max = 1LL << DBL_MANT_DIG; - const double mant_min = -mant_max; - double d; - res = SWIG_AsVal_double (obj,&d); - if (SWIG_IsOK(res) && !SWIG_CanCastAsInteger(&d, mant_min, mant_max)) - return SWIG_OverflowError; - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, mant_min, mant_max)) { - if (val) *val = (long long)(d); - return SWIG_AddCast(res); - } - res = SWIG_TypeError; - } -#endif - return res; -} -#endif - - -SWIGINTERN int -SWIG_AsVal_unsigned_SS_short (PyObject * obj, unsigned short *val) -{ - unsigned long v; - int res = SWIG_AsVal_unsigned_SS_long (obj, &v); - if (SWIG_IsOK(res)) { - if ((v > USHRT_MAX)) { - return SWIG_OverflowError; - } else { - if (val) *val = static_cast< unsigned short >(v); - } - } - return res; -} - -SWIGINTERN blpapi_CorrelationId_t_ *new_blpapi_CorrelationId_t___SWIG_1(long long value,unsigned short classId=0){ - return CorrelationId_t_createFromInteger(value, classId); - } -SWIGINTERN blpapi_CorrelationId_t_ *new_blpapi_CorrelationId_t___SWIG_3(PyObject *value,unsigned short classId=0){ - return CorrelationId_t_createFromObject(value, classId); - } -SWIGINTERN void delete_blpapi_CorrelationId_t_(blpapi_CorrelationId_t_ *self){ - CorrelationId_t_delete((self)); - } -SWIGINTERN unsigned short blpapi_CorrelationId_t__type(blpapi_CorrelationId_t_ const *self){ - return self->valueType; - } - -SWIGINTERNINLINE PyObject * -SWIG_From_unsigned_SS_short (unsigned short value) -{ - return SWIG_From_unsigned_SS_long (value); -} - -SWIGINTERN unsigned short blpapi_CorrelationId_t__classId(blpapi_CorrelationId_t_ const *self){ - return self->classId; - } -SWIGINTERN PyObject *blpapi_CorrelationId_t____asObject(blpapi_CorrelationId_t_ const *self){ - return CorrelationId_t_getObject(*self); - } -SWIGINTERN long long blpapi_CorrelationId_t____asInteger(blpapi_CorrelationId_t_ const *self){ - return self->value.intValue; - } - -#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE PyObject* -SWIG_From_long_SS_long (long long value) -{ - return ((value < LONG_MIN) || (value > LONG_MAX)) ? - PyLong_FromLongLong(value) : PyInt_FromLong(static_cast< long >(value)); -} -#endif - -SWIGINTERN long long blpapi_CorrelationId_t____toInteger(blpapi_CorrelationId_t_ const *self){ - return CorrelationId_t_toInteger(*self); - } - - -#include "blpapi_element.h" -#include // for std::ostringstream - -int blpapi_Element_setElementFloat( - blpapi_Element_t *element, - const char* nameString, - const blpapi_Name_t* name, - blpapi_Float64_t value) -{ - // The C interface will not silently discard precision to store a 64-bit - // float in a field whose schema type is 32-bit, however all Python floats - // are 64-bit, so we explicitly allow narrowing to 32 bits if necessary. - - blpapi_Element_t *fldt; - int ret = blpapi_Element_getElement(element, &fldt, nameString, name); - if (ret == 0) { - // Able to get field, consider its datatype - if (blpapi_Element_datatype(fldt) == BLPAPI_DATATYPE_FLOAT32) { - ret = blpapi_Element_setElementFloat32(element, - nameString, name, value); - } else { - ret = blpapi_Element_setElementFloat64(element, - nameString, name, value); - } - return ret; - } - - // Unable to get field. Try to set element anyway - ret = blpapi_Element_setElementFloat64(element, - nameString, name, value); - - if (ret) { - ret = blpapi_Element_setElementFloat32(element, - nameString, name, value); - } - - return ret; -} - -int blpapi_Element_setValueFloat( - blpapi_Element_t *element, - blpapi_Float64_t value, - size_t index) -{ - // The C interface will not silently discard precision to store a 64-bit - // float in a field whose schema type is 32-bit, however all Python floats - // are 64-bit, so we explicitly allow narrowing to 32 bits if necessary. - - int ret; - - // Consider field datatype - if (blpapi_Element_datatype(element) == BLPAPI_DATATYPE_FLOAT32) { - ret = blpapi_Element_setValueFloat32(element, value, index); - } else { - ret = blpapi_Element_setValueFloat64(element, value, index); - } - - return ret; -} - -std::string blpapi_Element_printHelper( - blpapi_Element_t *element, - int level, - int spacesPerLevel) -{ - std::ostringstream stream; - - blpapi_Element_print( - element, - BloombergLP::blpapi::OstreamWriter, - &stream, - level, - spacesPerLevel); - - return stream.str(); -} - - - -SWIGINTERNINLINE PyObject * -SWIG_FromCharPtr(const char *cptr) -{ - return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0)); -} - - - #define SWIG_From_double PyFloat_FromDouble - - - -#include "blpapi_eventformatter.h" - -int blpapi_EventFormatter_setValueFloat( - blpapi_EventFormatter_t* formatter, - char const* typeString, - const blpapi_Name_t* typeName, - blpapi_Float64_t value) -{ - // The C interface will not silently discard precision to store a 64-bit - // float in a field whose schema type is 32-bit, however all Python floats - // are 64-bit, so we explicitly allow narrowing to 32 bits if necessary. - - int ret = blpapi_EventFormatter_setValueFloat64(formatter, typeString, - typeName, value); - if (ret) { - ret = blpapi_EventFormatter_setValueFloat32(formatter, typeString, - typeName, value); - } - - return ret; -} - -int blpapi_EventFormatter_appendValueFloat( - blpapi_EventFormatter_t* formatter, - blpapi_Float64_t value) -{ - // The C interface will not silently discard precision to store a 64-bit - // float in a field whose schema type is 32-bit, however all Python floats - // are 64-bit, so we explicitly allow narrowing to 32 bits if necessary. - - int ret = blpapi_EventFormatter_appendValueFloat64(formatter, value); - - if (ret) { - ret = blpapi_EventFormatter_appendValueFloat32(formatter, value); - } - - return ret; -} - - - -SWIGINTERN int -SWIG_AsVal_unsigned_SS_int (PyObject * obj, unsigned int *val) -{ - unsigned long v; - int res = SWIG_AsVal_unsigned_SS_long (obj, &v); - if (SWIG_IsOK(res)) { - if ((v > UINT_MAX)) { - return SWIG_OverflowError; - } else { - if (val) *val = static_cast< unsigned int >(v); - } - } - return res; -} - - -SWIGINTERN int -SWIG_AsCharArray(PyObject * obj, char *val, size_t size) -{ - char* cptr = 0; size_t csize = 0; int alloc = SWIG_OLDOBJ; - int res = SWIG_AsCharPtrAndSize(obj, &cptr, &csize, &alloc); - if (SWIG_IsOK(res)) { - /* special case of single char conversion when we don't need space for NUL */ - if (size == 1 && csize == 2 && cptr && !cptr[1]) --csize; - if (csize <= size) { - if (val) { - if (csize) memcpy(val, cptr, csize*sizeof(char)); - if (csize < size) memset(val + csize, 0, (size - csize)*sizeof(char)); - } - if (alloc == SWIG_NEWOBJ) { - delete[] cptr; - res = SWIG_DelNewMask(res); - } - return res; - } - if (alloc == SWIG_NEWOBJ) delete[] cptr; - } - return SWIG_TypeError; -} - - -SWIGINTERN int -SWIG_AsVal_char (PyObject * obj, char *val) -{ - int res = SWIG_AsCharArray(obj, val, 1); - if (!SWIG_IsOK(res)) { - long v; - res = SWIG_AddCast(SWIG_AsVal_long (obj, &v)); - if (SWIG_IsOK(res)) { - if ((CHAR_MIN <= v) && (v <= CHAR_MAX)) { - if (val) *val = static_cast< char >(v); - } else { - res = SWIG_OverflowError; - } - } - } - return res; -} - - -#include "blpapi_session.h" - -void dispatchEventProxy(blpapi_Event_t *event, blpapi_Session_t *, void *userData) -{ - PyObject *eventDispatcherFunc = reinterpret_cast(userData); - - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - - PyObject *arglist = PyTuple_New(1); - PyTuple_SET_ITEM(arglist, 0, - SWIG_NewPointerObj(SWIG_as_voidptr(event), SWIGTYPE_p_blpapi_Event, 0)); - - PyObject *result = PyEval_CallObject(eventDispatcherFunc, arglist); - - Py_DECREF(arglist); - Py_XDECREF(result); - - SWIG_PYTHON_THREAD_END_BLOCK; -} - -blpapi_Session_t *Session_createHelper(blpapi_SessionOptions_t *parameters, - PyObject *eventHandlerFunc, - blpapi_EventDispatcher_t *dispatcher) -{ - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - const bool hasHandler = - eventHandlerFunc != 0 && eventHandlerFunc != Py_None; - - blpapi_Session_t *const res = blpapi_Session_create( - parameters, - hasHandler ? &dispatchEventProxy : 0, - dispatcher, - hasHandler ? eventHandlerFunc : 0); - - if (!res) { - return 0; - } - SWIG_PYTHON_THREAD_END_ALLOW; - - Py_XINCREF(eventHandlerFunc); - - return res; -} - -void Session_destroyHelper(blpapi_Session_t *sessionHandle, PyObject *eventHandlerFunc) -{ - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_Session_destroy(sessionHandle); - SWIG_PYTHON_THREAD_END_ALLOW; - - Py_XDECREF(eventHandlerFunc); -} - - - -#include "blpapi_providersession.h" - -void dispatchProviderEventProxy(blpapi_Event_t *event, blpapi_ProviderSession_t *, void *userData) -{ - PyObject *eventDispatcherFunc = reinterpret_cast(userData); - - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - - PyObject *arglist = PyTuple_New(1); - PyTuple_SET_ITEM(arglist, 0, - SWIG_NewPointerObj(SWIG_as_voidptr(event), SWIGTYPE_p_blpapi_Event, 0)); - - PyObject *result = PyEval_CallObject(eventDispatcherFunc, arglist); - - Py_DECREF(arglist); - Py_XDECREF(result); - - SWIG_PYTHON_THREAD_END_BLOCK; -} - -blpapi_ProviderSession_t *ProviderSession_createHelper(blpapi_SessionOptions_t *parameters, - PyObject *eventHandlerFunc, - blpapi_EventDispatcher_t *dispatcher) -{ - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - const bool hasHandler = - eventHandlerFunc != 0 && eventHandlerFunc != Py_None; - - blpapi_ProviderSession_t *const res = blpapi_ProviderSession_create( - parameters, - hasHandler ? &dispatchProviderEventProxy : 0, - dispatcher, - hasHandler ? eventHandlerFunc : 0); - - if (!res) { - return 0; - } - SWIG_PYTHON_THREAD_END_ALLOW; - - Py_XINCREF(eventHandlerFunc); - - return res; -} - -void ProviderSession_destroyHelper(blpapi_ProviderSession_t *sessionHandle, - PyObject *eventHandlerFunc) -{ - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_ProviderSession_destroy(sessionHandle); - SWIG_PYTHON_THREAD_END_ALLOW; - - Py_XDECREF(eventHandlerFunc); -} - -int ProviderSession_terminateSubscriptionsOnTopic(blpapi_ProviderSession_t *sessionHandle, - const blpapi_Topic_t *topic, - const char *message=0) -{ - int res; - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - res = blpapi_ProviderSession_terminateSubscriptionsOnTopics(sessionHandle, &topic, 1, message); - SWIG_PYTHON_THREAD_END_ALLOW; - return res; -} - -bool ProviderSession_flushPublishedEvents(blpapi_ProviderSession_t *handle, int timeoutMsecs) -{ - int allFlushed = -1; - int rc = blpapi_ProviderSession_flushPublishedEvents( - handle, - &allFlushed, - timeoutMsecs); - if (rc != 0) { - throw std::runtime_error("Flush published events failed"); - } - return static_cast(allFlushed); -} - - - -/* Getting isfinite working pre C99 across multiple platforms is non-trivial. Users can provide SWIG_isfinite on older platforms. */ -#ifndef SWIG_isfinite -/* isfinite() is a macro for C99 */ -# if defined(isfinite) -# define SWIG_isfinite(X) (isfinite(X)) -# elif defined __cplusplus && __cplusplus >= 201103L -/* Use a template so that this works whether isfinite() is std::isfinite() or - * in the global namespace. The reality seems to vary between compiler - * versions. - * - * Make sure namespace std exists to avoid compiler warnings. - * - * extern "C++" is required as this fragment can end up inside an extern "C" { } block - */ -namespace std { } -extern "C++" template -inline int SWIG_isfinite_func(T x) { - using namespace std; - return isfinite(x); -} -# define SWIG_isfinite(X) (SWIG_isfinite_func(X)) -# elif defined(_MSC_VER) -# define SWIG_isfinite(X) (_finite(X)) -# elif defined(__sun) && defined(__SVR4) -# include -# define SWIG_isfinite(X) (finite(X)) -# endif -#endif - - -/* Accept infinite as a valid float value unless we are unable to check if a value is finite */ -#ifdef SWIG_isfinite -# define SWIG_Float_Overflow_Check(X) ((X < -FLT_MAX || X > FLT_MAX) && SWIG_isfinite(X)) -#else -# define SWIG_Float_Overflow_Check(X) ((X < -FLT_MAX || X > FLT_MAX)) -#endif - - -SWIGINTERN int -SWIG_AsVal_float (PyObject * obj, float *val) -{ - double v; - int res = SWIG_AsVal_double (obj, &v); - if (SWIG_IsOK(res)) { - if (SWIG_Float_Overflow_Check(v)) { - return SWIG_OverflowError; - } else { - if (val) *val = static_cast< float >(v); - } - } - return res; -} - - -SWIGINTERNINLINE PyObject * -SWIG_From_float (float value) -{ - return SWIG_From_double (value); -} - - -SWIGINTERN int -SWIG_AsVal_unsigned_SS_char (PyObject * obj, unsigned char *val) -{ - unsigned long v; - int res = SWIG_AsVal_unsigned_SS_long (obj, &v); - if (SWIG_IsOK(res)) { - if ((v > UCHAR_MAX)) { - return SWIG_OverflowError; - } else { - if (val) *val = static_cast< unsigned char >(v); - } - } - return res; -} - - -SWIGINTERNINLINE PyObject * -SWIG_From_unsigned_SS_char (unsigned char value) -{ - return SWIG_From_unsigned_SS_long (value); -} - - -SWIGINTERN int -SWIG_AsVal_short (PyObject * obj, short *val) -{ - long v; - int res = SWIG_AsVal_long (obj, &v); - if (SWIG_IsOK(res)) { - if ((v < SHRT_MIN || v > SHRT_MAX)) { - return SWIG_OverflowError; - } else { - if (val) *val = static_cast< short >(v); - } - } - return res; -} - - -SWIGINTERNINLINE PyObject * -SWIG_From_short (short value) -{ - return SWIG_From_long (value); -} - -#ifdef __cplusplus -extern "C" { -#endif -SWIGINTERN PyObject *_wrap_setLoggerCallbackWrapper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - PyObject *arg1 = (PyObject *) 0 ; - int arg2 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:setLoggerCallbackWrapper",&obj0,&obj1)) SWIG_fail; - arg1 = obj0; - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "setLoggerCallbackWrapper" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - setLoggerCallbackWrapper(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Logging_registerCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Logging_Func_t arg1 ; - blpapi_Logging_Severity_t arg2 ; - void *argp1 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Logging_registerCallback",&obj0,&obj1)) SWIG_fail; - { - res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_blpapi_Logging_Func_t, 0 | 0); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Logging_registerCallback" "', argument " "1"" of type '" "blpapi_Logging_Func_t""'"); - } - if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "blpapi_Logging_registerCallback" "', argument " "1"" of type '" "blpapi_Logging_Func_t""'"); - } else { - blpapi_Logging_Func_t * temp = reinterpret_cast< blpapi_Logging_Func_t * >(argp1); - arg1 = *temp; - if (SWIG_IsNewObj(res1)) delete temp; - } - } - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Logging_registerCallback" "', argument " "2"" of type '" "blpapi_Logging_Severity_t""'"); - } - arg2 = static_cast< blpapi_Logging_Severity_t >(val2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Logging_registerCallback(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Logging_logTestMessage(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Logging_Severity_t arg1 ; - int val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Logging_logTestMessage",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "blpapi_Logging_logTestMessage" "', argument " "1"" of type '" "blpapi_Logging_Severity_t""'"); - } - arg1 = static_cast< blpapi_Logging_Severity_t >(val1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_Logging_logTestMessage(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_DiagnosticsUtil_memoryInfo_wrapper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::string result; - - if (!PyArg_ParseTuple(args,(char *)":blpapi_DiagnosticsUtil_memoryInfo_wrapper")) SWIG_fail; - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = blpapi_DiagnosticsUtil_memoryInfo_wrapper(); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_std_string(static_cast< std::string >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Message_timeReceived_wrapper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - blpapi_Datetime_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_timeReceived_wrapper",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_timeReceived_wrapper" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Message_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = blpapi_Message_timeReceived_wrapper((blpapi_Message const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj((new blpapi_Datetime_t(static_cast< const blpapi_Datetime_t& >(result))), SWIGTYPE_p_blpapi_Datetime_tag, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_HighResolutionClock_now_wrapper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Datetime_t result; - - if (!PyArg_ParseTuple(args,(char *)":blpapi_HighResolutionClock_now_wrapper")) SWIG_fail; - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = blpapi_HighResolutionClock_now_wrapper(); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj((new blpapi_Datetime_t(static_cast< const blpapi_Datetime_t& >(result))), SWIGTYPE_p_blpapi_Datetime_tag, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventDispatcher_stop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventDispatcher_t *arg1 = (blpapi_EventDispatcher_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_EventDispatcher_stop",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventDispatcher, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventDispatcher_stop" "', argument " "1"" of type '" "blpapi_EventDispatcher_t *""'"); - } - arg1 = reinterpret_cast< blpapi_EventDispatcher_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_EventDispatcher_stop" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventDispatcher_stop(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Service_printHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - int arg2 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - std::string result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Service_printHelper",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_printHelper" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Service_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Service_printHelper" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Service_printHelper" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = blpapi_Service_printHelper(arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_std_string(static_cast< std::string >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_printHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; - int arg2 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - std::string result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_SchemaElementDefinition_printHelper",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_printHelper" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SchemaElementDefinition_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SchemaElementDefinition_printHelper" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_SchemaElementDefinition_printHelper" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = blpapi_SchemaElementDefinition_printHelper(arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_std_string(static_cast< std::string >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_printHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; - int arg2 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - std::string result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_SchemaTypeDefinition_printHelper",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_printHelper" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SchemaTypeDefinition_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SchemaTypeDefinition_printHelper" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_SchemaTypeDefinition_printHelper" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = blpapi_SchemaTypeDefinition_printHelper(arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_std_string(static_cast< std::string >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_printHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - int arg2 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - std::string result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_SessionOptions_printHelper",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_printHelper" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_printHelper" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_SessionOptions_printHelper" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = blpapi_SessionOptions_printHelper(arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_std_string(static_cast< std::string >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_hasElementDefinition(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_SchemaTypeDefinition_hasElementDefinition",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_hasElementDefinition" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_SchemaTypeDefinition_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SchemaTypeDefinition_hasElementDefinition" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_SchemaTypeDefinition_hasElementDefinition" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_Name_t * >(argp3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (bool)blpapi_SchemaTypeDefinition_hasElementDefinition((void *const *)arg1,(char const *)arg2,(blpapi_Name const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_bool(static_cast< bool >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ConstantList_hasConstant(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ConstantList_t *arg1 = (blpapi_ConstantList_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_ConstantList_hasConstant",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_hasConstant" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_ConstantList_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ConstantList_hasConstant" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ConstantList_hasConstant" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_Name_t * >(argp3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (bool)blpapi_ConstantList_hasConstant((blpapi_ConstantList const *)arg1,(char const *)arg2,(blpapi_Name const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_bool(static_cast< bool >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Service_hasEventDefinition(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Service_hasEventDefinition",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_hasEventDefinition" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Service_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Service_hasEventDefinition" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Service_hasEventDefinition" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_Name_t * >(argp3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (bool)blpapi_Service_hasEventDefinition(arg1,(char const *)arg2,(blpapi_Name const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_bool(static_cast< bool >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Service_hasOperation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Service_hasOperation",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_hasOperation" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Service_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Service_hasOperation" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Service_hasOperation" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_Name_t * >(argp3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (bool)blpapi_Service_hasOperation(arg1,(char const *)arg2,(blpapi_Name const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_bool(static_cast< bool >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_addHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; - char *arg4 = (char *) 0 ; - char *arg5 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - int res4 ; - char *buf4 = 0 ; - int alloc4 = 0 ; - int res5 ; - char *buf5 = 0 ; - int alloc5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:blpapi_SubscriptionList_addHelper",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_addHelper" "', argument " "1"" of type '" "blpapi_SubscriptionList_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SubscriptionList_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SubscriptionList_addHelper" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_SubscriptionList_addHelper" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_CorrelationId_t * >(argp3); - res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_SubscriptionList_addHelper" "', argument " "4"" of type '" "char const *""'"); - } - arg4 = reinterpret_cast< char * >(buf4); - res5 = SWIG_AsCharPtrAndSize(obj4, &buf5, NULL, &alloc5); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "blpapi_SubscriptionList_addHelper" "', argument " "5"" of type '" "char const *""'"); - } - arg5 = reinterpret_cast< char * >(buf5); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SubscriptionList_addHelper(arg1,(char const *)arg2,(blpapi_CorrelationId_t_ const *)arg3,(char const *)arg4,(char const *)arg5); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - if (alloc4 == SWIG_NEWOBJ) delete[] buf4; - if (alloc5 == SWIG_NEWOBJ) delete[] buf5; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - if (alloc4 == SWIG_NEWOBJ) delete[] buf4; - if (alloc5 == SWIG_NEWOBJ) delete[] buf5; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Name_hasName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Name_hasName",&obj0)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Name_hasName" "', argument " "1"" of type '" "char const *""'"); - } - arg1 = reinterpret_cast< char * >(buf1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (bool)blpapi_Name_hasName((char const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_bool(static_cast< bool >(result)); - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - return resultobj; -fail: - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TopicList_createFromResolutionList(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - blpapi_TopicList_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_TopicList_createFromResolutionList",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_createFromResolutionList" "', argument " "1"" of type '" "blpapi_ResolutionList_t *""'"); - } - arg1 = reinterpret_cast< blpapi_ResolutionList_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_TopicList_t *)blpapi_TopicList_createFromResolutionList(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_intArray(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - size_t val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - intArray *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_intArray",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_intArray" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (intArray *)new_intArray(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_intArray, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_intArray(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - intArray *arg1 = (intArray *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_intArray",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_intArray, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_intArray" "', argument " "1"" of type '" "intArray *""'"); - } - arg1 = reinterpret_cast< intArray * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - delete_intArray(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_intArray___getitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - intArray *arg1 = (intArray *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:intArray___getitem__",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_intArray, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "intArray___getitem__" "', argument " "1"" of type '" "intArray *""'"); - } - arg1 = reinterpret_cast< intArray * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "intArray___getitem__" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)intArray___getitem__(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_intArray___setitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - intArray *arg1 = (intArray *) 0 ; - size_t arg2 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:intArray___setitem__",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_intArray, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "intArray___setitem__" "', argument " "1"" of type '" "intArray *""'"); - } - arg1 = reinterpret_cast< intArray * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "intArray___setitem__" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "intArray___setitem__" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - intArray___setitem__(arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_intArray_cast(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - intArray *arg1 = (intArray *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:intArray_cast",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_intArray, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "intArray_cast" "', argument " "1"" of type '" "intArray *""'"); - } - arg1 = reinterpret_cast< intArray * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int *)intArray_cast(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_intArray_frompointer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int *arg1 = (int *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - intArray *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:intArray_frompointer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "intArray_frompointer" "', argument " "1"" of type '" "int *""'"); - } - arg1 = reinterpret_cast< int * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (intArray *)intArray_frompointer(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_intArray, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *intArray_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_intArray, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_topicPtrArray(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - size_t val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - blpapi_Topic_t **result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_topicPtrArray",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_topicPtrArray" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Topic_t **)new_topicPtrArray(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_blpapi_Topic, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_topicPtrArray(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Topic_t **arg1 = (blpapi_Topic_t **) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_topicPtrArray",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_blpapi_Topic, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_topicPtrArray" "', argument " "1"" of type '" "blpapi_Topic_t **""'"); - } - arg1 = reinterpret_cast< blpapi_Topic_t ** >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - delete_topicPtrArray(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_topicPtrArray_getitem(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Topic_t **arg1 = (blpapi_Topic_t **) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - blpapi_Topic_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:topicPtrArray_getitem",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_blpapi_Topic, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "topicPtrArray_getitem" "', argument " "1"" of type '" "blpapi_Topic_t **""'"); - } - arg1 = reinterpret_cast< blpapi_Topic_t ** >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "topicPtrArray_getitem" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Topic_t *)topicPtrArray_getitem(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Topic, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_topicPtrArray_setitem(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Topic_t **arg1 = (blpapi_Topic_t **) 0 ; - size_t arg2 ; - blpapi_Topic_t *arg3 = (blpapi_Topic_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:topicPtrArray_setitem",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_blpapi_Topic, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "topicPtrArray_setitem" "', argument " "1"" of type '" "blpapi_Topic_t **""'"); - } - arg1 = reinterpret_cast< blpapi_Topic_t ** >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "topicPtrArray_setitem" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "topicPtrArray_setitem" "', argument " "3"" of type '" "blpapi_Topic_t *""'"); - } - arg3 = reinterpret_cast< blpapi_Topic_t * >(argp3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - topicPtrArray_setitem(arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_CorrelationId_t_equals(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_CorrelationId_t *arg1 = 0 ; - blpapi_CorrelationId_t *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"OO:CorrelationId_t_equals",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CorrelationId_t_equals" "', argument " "1"" of type '" "blpapi_CorrelationId_t const &""'"); - } - if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CorrelationId_t_equals" "', argument " "1"" of type '" "blpapi_CorrelationId_t const &""'"); - } - arg1 = reinterpret_cast< blpapi_CorrelationId_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CorrelationId_t_equals" "', argument " "2"" of type '" "blpapi_CorrelationId_t const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CorrelationId_t_equals" "', argument " "2"" of type '" "blpapi_CorrelationId_t const &""'"); - } - arg2 = reinterpret_cast< blpapi_CorrelationId_t * >(argp2); - - try { - result = (bool)CorrelationId_t_equals((blpapi_CorrelationId_t_ const &)*arg1,(blpapi_CorrelationId_t_ const &)*arg2); - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_CorrelationId__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_CorrelationId_t_ *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_CorrelationId")) SWIG_fail; - - try { - result = (blpapi_CorrelationId_t_ *)new_blpapi_CorrelationId_t___SWIG_0(); - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_CorrelationId_t_, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_CorrelationId__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - long long arg1 ; - unsigned short arg2 ; - long long val1 ; - int ecode1 = 0 ; - unsigned short val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - blpapi_CorrelationId_t_ *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_CorrelationId",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_long_SS_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_CorrelationId" "', argument " "1"" of type '" "long long""'"); - } - arg1 = static_cast< long long >(val1); - ecode2 = SWIG_AsVal_unsigned_SS_short(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CorrelationId" "', argument " "2"" of type '" "unsigned short""'"); - } - arg2 = static_cast< unsigned short >(val2); - - try { - result = (blpapi_CorrelationId_t_ *)new_blpapi_CorrelationId_t___SWIG_1(arg1,arg2); - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_CorrelationId_t_, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_CorrelationId__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - long long arg1 ; - long long val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - blpapi_CorrelationId_t_ *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_CorrelationId",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_long_SS_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_CorrelationId" "', argument " "1"" of type '" "long long""'"); - } - arg1 = static_cast< long long >(val1); - - try { - result = (blpapi_CorrelationId_t_ *)new_blpapi_CorrelationId_t___SWIG_1(arg1); - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_CorrelationId_t_, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_CorrelationId__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - PyObject *arg1 = (PyObject *) 0 ; - unsigned short arg2 ; - unsigned short val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - blpapi_CorrelationId_t_ *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_CorrelationId",&obj0,&obj1)) SWIG_fail; - { - arg1 = obj0; - } - ecode2 = SWIG_AsVal_unsigned_SS_short(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CorrelationId" "', argument " "2"" of type '" "unsigned short""'"); - } - arg2 = static_cast< unsigned short >(val2); - - try { - result = (blpapi_CorrelationId_t_ *)new_blpapi_CorrelationId_t___SWIG_3(arg1,arg2); - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_CorrelationId_t_, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_CorrelationId__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - PyObject *arg1 = (PyObject *) 0 ; - PyObject * obj0 = 0 ; - blpapi_CorrelationId_t_ *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_CorrelationId",&obj0)) SWIG_fail; - { - arg1 = obj0; - } - - try { - result = (blpapi_CorrelationId_t_ *)new_blpapi_CorrelationId_t___SWIG_3(arg1); - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_CorrelationId_t_, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_CorrelationId(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_CorrelationId__SWIG_0(self, args); - } - if (argc == 1) { - int _v; - { - int res = SWIG_AsVal_long_SS_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_CorrelationId__SWIG_2(self, args); - } - } - if (argc == 1) { - int _v; - _v = (argv[0] != 0); - if (_v) { - return _wrap_new_CorrelationId__SWIG_4(self, args); - } - } - if (argc == 2) { - int _v; - { - int res = SWIG_AsVal_long_SS_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_unsigned_SS_short(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_CorrelationId__SWIG_1(self, args); - } - } - } - if (argc == 2) { - int _v; - _v = (argv[0] != 0); - if (_v) { - { - int res = SWIG_AsVal_unsigned_SS_short(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_CorrelationId__SWIG_3(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_CorrelationId'.\n" - " Possible C/C++ prototypes are:\n" - " blpapi_CorrelationId_t_::blpapi_CorrelationId_t_()\n" - " blpapi_CorrelationId_t_::blpapi_CorrelationId_t_(long long,unsigned short)\n" - " blpapi_CorrelationId_t_::blpapi_CorrelationId_t_(long long)\n" - " blpapi_CorrelationId_t_::blpapi_CorrelationId_t_(PyObject *,unsigned short)\n" - " blpapi_CorrelationId_t_::blpapi_CorrelationId_t_(PyObject *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_CorrelationId(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_CorrelationId_t_ *arg1 = (blpapi_CorrelationId_t_ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_CorrelationId",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_CorrelationId_t_, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CorrelationId" "', argument " "1"" of type '" "blpapi_CorrelationId_t_ *""'"); - } - arg1 = reinterpret_cast< blpapi_CorrelationId_t_ * >(argp1); - - try { - delete_blpapi_CorrelationId_t_(arg1); - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_CorrelationId_type(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_CorrelationId_t_ *arg1 = (blpapi_CorrelationId_t_ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - unsigned short result; - - if (!PyArg_ParseTuple(args,(char *)"O:CorrelationId_type",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CorrelationId_type" "', argument " "1"" of type '" "blpapi_CorrelationId_t_ const *""'"); - } - arg1 = reinterpret_cast< blpapi_CorrelationId_t_ * >(argp1); - - try { - result = (unsigned short)blpapi_CorrelationId_t__type((blpapi_CorrelationId_t_ const *)arg1); - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_unsigned_SS_short(static_cast< unsigned short >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_CorrelationId_classId(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_CorrelationId_t_ *arg1 = (blpapi_CorrelationId_t_ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - unsigned short result; - - if (!PyArg_ParseTuple(args,(char *)"O:CorrelationId_classId",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CorrelationId_classId" "', argument " "1"" of type '" "blpapi_CorrelationId_t_ const *""'"); - } - arg1 = reinterpret_cast< blpapi_CorrelationId_t_ * >(argp1); - - try { - result = (unsigned short)blpapi_CorrelationId_t__classId((blpapi_CorrelationId_t_ const *)arg1); - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_unsigned_SS_short(static_cast< unsigned short >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_CorrelationId___asObject(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_CorrelationId_t_ *arg1 = (blpapi_CorrelationId_t_ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:CorrelationId___asObject",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CorrelationId___asObject" "', argument " "1"" of type '" "blpapi_CorrelationId_t_ const *""'"); - } - arg1 = reinterpret_cast< blpapi_CorrelationId_t_ * >(argp1); - - try { - result = (PyObject *)blpapi_CorrelationId_t____asObject((blpapi_CorrelationId_t_ const *)arg1); - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - { - resultobj = result; - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_CorrelationId___asInteger(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_CorrelationId_t_ *arg1 = (blpapi_CorrelationId_t_ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - long long result; - - if (!PyArg_ParseTuple(args,(char *)"O:CorrelationId___asInteger",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CorrelationId___asInteger" "', argument " "1"" of type '" "blpapi_CorrelationId_t_ const *""'"); - } - arg1 = reinterpret_cast< blpapi_CorrelationId_t_ * >(argp1); - - try { - result = (long long)blpapi_CorrelationId_t____asInteger((blpapi_CorrelationId_t_ const *)arg1); - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_long_SS_long(static_cast< long long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_CorrelationId___toInteger(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_CorrelationId_t_ *arg1 = (blpapi_CorrelationId_t_ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - long long result; - - if (!PyArg_ParseTuple(args,(char *)"O:CorrelationId___toInteger",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CorrelationId___toInteger" "', argument " "1"" of type '" "blpapi_CorrelationId_t_ const *""'"); - } - arg1 = reinterpret_cast< blpapi_CorrelationId_t_ * >(argp1); - - try { - result = (long long)blpapi_CorrelationId_t____toInteger((blpapi_CorrelationId_t_ const *)arg1); - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_long_SS_long(static_cast< long long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *CorrelationId_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_blpapi_CorrelationId_t_, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_blpapi_Element_setElementFloat(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - blpapi_Float64_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - double val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Element_setElementFloat",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setElementFloat" "', argument " "1"" of type '" "blpapi_Element_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setElementFloat" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_setElementFloat" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_Name_t * >(argp3); - ecode4 = SWIG_AsVal_double(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_Element_setElementFloat" "', argument " "4"" of type '" "blpapi_Float64_t""'"); - } - arg4 = static_cast< blpapi_Float64_t >(val4); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_setElementFloat(arg1,(char const *)arg2,(blpapi_Name const *)arg3,arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_setValueFloat(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - blpapi_Float64_t arg2 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Element_setValueFloat",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setValueFloat" "', argument " "1"" of type '" "blpapi_Element_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - ecode2 = SWIG_AsVal_double(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Element_setValueFloat" "', argument " "2"" of type '" "blpapi_Float64_t""'"); - } - arg2 = static_cast< blpapi_Float64_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_setValueFloat" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_setValueFloat(arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_printHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - int arg2 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - std::string result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Element_printHelper",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_printHelper" "', argument " "1"" of type '" "blpapi_Element_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Element_printHelper" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_printHelper" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = blpapi_Element_printHelper(arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_std_string(static_cast< std::string >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - blpapi_Name_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Element_name",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_name" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Name_t *)blpapi_Element_name((blpapi_Element const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_nameString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - char *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Element_nameString",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_nameString" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_Element_nameString((blpapi_Element const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_definition(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - blpapi_SchemaElementDefinition_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Element_definition",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_definition" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_SchemaElementDefinition_t *)blpapi_Element_definition((blpapi_Element const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_void, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_datatype(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Element_datatype",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_datatype" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_datatype((blpapi_Element const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_isComplexType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Element_isComplexType",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_isComplexType" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_isComplexType((blpapi_Element const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_isArray(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Element_isArray",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_isArray" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_isArray((blpapi_Element const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_isReadOnly(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Element_isReadOnly",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_isReadOnly" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_isReadOnly((blpapi_Element const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_numValues(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Element_numValues",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_numValues" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = blpapi_Element_numValues((blpapi_Element const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_numElements(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Element_numElements",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_numElements" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = blpapi_Element_numElements((blpapi_Element const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_isNullValue(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Element_isNullValue",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_isNullValue" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Element_isNullValue" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_isNullValue((blpapi_Element const *)arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_isNull(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Element_isNull",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_isNull" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_isNull((blpapi_Element const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_getElementAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - blpapi_Element_t **arg2 = (blpapi_Element_t **) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Element_t *temp2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Element_getElementAt",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getElementAt" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getElementAt" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_getElementAt((blpapi_Element const *)arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Element, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_getElement(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - blpapi_Element_t **arg2 = (blpapi_Element_t **) 0 ; - char *arg3 = (char *) 0 ; - blpapi_Name_t *arg4 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Element_t *temp2 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Element_getElement",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getElement" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_getElement" "', argument " "3"" of type '" "char const *""'"); - } - arg3 = reinterpret_cast< char * >(buf3); - res4 = SWIG_ConvertPtr(obj2, &argp4,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Element_getElement" "', argument " "4"" of type '" "blpapi_Name_t const *""'"); - } - arg4 = reinterpret_cast< blpapi_Name_t * >(argp4); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_getElement((blpapi_Element const *)arg1,arg2,(char const *)arg3,(blpapi_Name const *)arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Element, 0)); - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; - return resultobj; -fail: - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_hasElementEx(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - int arg4 ; - int arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - int val4 ; - int ecode4 = 0 ; - int val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:blpapi_Element_hasElementEx",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_hasElementEx" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_hasElementEx" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_hasElementEx" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_Name_t * >(argp3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_Element_hasElementEx" "', argument " "4"" of type '" "int""'"); - } - arg4 = static_cast< int >(val4); - ecode5 = SWIG_AsVal_int(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_Element_hasElementEx" "', argument " "5"" of type '" "int""'"); - } - arg5 = static_cast< int >(val5); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_hasElementEx((blpapi_Element const *)arg1,(char const *)arg2,(blpapi_Name const *)arg3,arg4,arg5); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsBool(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - blpapi_Bool_t *arg2 = (blpapi_Bool_t *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Bool_t temp2 ; - int res2 = SWIG_TMPOBJ ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Element_getValueAsBool",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsBool" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getValueAsBool" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_getValueAsBool((blpapi_Element const *)arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (SWIG_IsTmpObj(res2)) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg2))); - } else { - int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_int, new_flags)); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsChar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - blpapi_Char_t *arg2 = (blpapi_Char_t *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Element_getValueAsChar",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsChar" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_getValueAsChar" "', argument " "2"" of type '" "blpapi_Char_t *""'"); - } - arg2 = reinterpret_cast< blpapi_Char_t * >(buf2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getValueAsChar" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_getValueAsChar((blpapi_Element const *)arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsInt32(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - blpapi_Int32_t *arg2 = (blpapi_Int32_t *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Element_getValueAsInt32",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsInt32" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_getValueAsInt32" "', argument " "2"" of type '" "blpapi_Int32_t *""'"); - } - arg2 = reinterpret_cast< blpapi_Int32_t * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getValueAsInt32" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_getValueAsInt32((blpapi_Element const *)arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsInt64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - blpapi_Int64_t *arg2 = (blpapi_Int64_t *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Int64_t temp2 ; - int res2 = SWIG_TMPOBJ ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Element_getValueAsInt64",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsInt64" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getValueAsInt64" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_getValueAsInt64((blpapi_Element const *)arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (SWIG_IsTmpObj(res2)) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_long_SS_long((*arg2))); - } else { - int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_long_long, new_flags)); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsFloat64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - blpapi_Float64_t *arg2 = (blpapi_Float64_t *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Float64_t temp2 ; - int res2 = SWIG_TMPOBJ ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Element_getValueAsFloat64",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsFloat64" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getValueAsFloat64" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_getValueAsFloat64((blpapi_Element const *)arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (SWIG_IsTmpObj(res2)) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_double((*arg2))); - } else { - int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_double, new_flags)); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - char **arg2 = (char **) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - char *temp2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Element_getValueAsString",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsString" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getValueAsString" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_getValueAsString((blpapi_Element const *)arg1,(char const **)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsDatetime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - blpapi_Datetime_t *arg2 = (blpapi_Datetime_t *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - arg2 = new blpapi_Datetime_t; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Element_getValueAsDatetime",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsDatetime" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getValueAsDatetime" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_getValueAsDatetime((blpapi_Element const *)arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((arg2), SWIGTYPE_p_blpapi_Datetime_tag, SWIG_POINTER_OWN)); - arg2 = 0; - if(arg2) delete arg2; - return resultobj; -fail: - if(arg2) delete arg2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsHighPrecisionDatetime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - blpapi_HighPrecisionDatetime_t *arg2 = (blpapi_HighPrecisionDatetime_t *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - arg2 = new blpapi_HighPrecisionDatetime_t; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Element_getValueAsHighPrecisionDatetime",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsHighPrecisionDatetime" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getValueAsHighPrecisionDatetime" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_getValueAsHighPrecisionDatetime((blpapi_Element const *)arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((arg2), SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, SWIG_POINTER_OWN)); - arg2 = 0; - if(arg2) delete arg2; - return resultobj; -fail: - if(arg2) delete arg2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsElement(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - blpapi_Element_t **arg2 = (blpapi_Element_t **) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Element_t *temp2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Element_getValueAsElement",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsElement" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getValueAsElement" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_getValueAsElement((blpapi_Element const *)arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Element, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - blpapi_Name_t **arg2 = (blpapi_Name_t **) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Name_t *temp2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Element_getValueAsName",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsName" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getValueAsName" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_getValueAsName((blpapi_Element const *)arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Name, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_getChoice(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - blpapi_Element_t **arg2 = (blpapi_Element_t **) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Element_t *temp2 = 0 ; - PyObject * obj0 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Element_getChoice",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getChoice" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_getChoice((blpapi_Element const *)arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Element, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_setValueBool(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - blpapi_Bool_t arg2 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Element_setValueBool",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setValueBool" "', argument " "1"" of type '" "blpapi_Element_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Element_setValueBool" "', argument " "2"" of type '" "blpapi_Bool_t""'"); - } - arg2 = static_cast< blpapi_Bool_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_setValueBool" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_setValueBool(arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_setValueInt32(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - blpapi_Int32_t arg2 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Element_setValueInt32",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setValueInt32" "', argument " "1"" of type '" "blpapi_Element_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Element_setValueInt32" "', argument " "2"" of type '" "blpapi_Int32_t""'"); - } - arg2 = static_cast< blpapi_Int32_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_setValueInt32" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_setValueInt32(arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_setValueInt64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - blpapi_Int64_t arg2 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - long long val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Element_setValueInt64",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setValueInt64" "', argument " "1"" of type '" "blpapi_Element_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - ecode2 = SWIG_AsVal_long_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Element_setValueInt64" "', argument " "2"" of type '" "blpapi_Int64_t""'"); - } - arg2 = static_cast< blpapi_Int64_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_setValueInt64" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_setValueInt64(arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_setValueString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - char *arg2 = (char *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Element_setValueString",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setValueString" "', argument " "1"" of type '" "blpapi_Element_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setValueString" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_setValueString" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_setValueString(arg1,(char const *)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_setValueDatetime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - blpapi_Datetime_t *arg2 = (blpapi_Datetime_t *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Element_setValueDatetime",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setValueDatetime" "', argument " "1"" of type '" "blpapi_Element_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setValueDatetime" "', argument " "2"" of type '" "blpapi_Datetime_t const *""'"); - } - arg2 = reinterpret_cast< blpapi_Datetime_t * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_setValueDatetime" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_setValueDatetime(arg1,(blpapi_Datetime_tag const *)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_setValueFromName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Element_setValueFromName",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setValueFromName" "', argument " "1"" of type '" "blpapi_Element_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setValueFromName" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); - } - arg2 = reinterpret_cast< blpapi_Name_t * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_setValueFromName" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_setValueFromName(arg1,(blpapi_Name const *)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_setElementBool(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - blpapi_Bool_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - int val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Element_setElementBool",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setElementBool" "', argument " "1"" of type '" "blpapi_Element_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setElementBool" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_setElementBool" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_Name_t * >(argp3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_Element_setElementBool" "', argument " "4"" of type '" "blpapi_Bool_t""'"); - } - arg4 = static_cast< blpapi_Bool_t >(val4); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_setElementBool(arg1,(char const *)arg2,(blpapi_Name const *)arg3,arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_setElementInt32(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - blpapi_Int32_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - int val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Element_setElementInt32",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setElementInt32" "', argument " "1"" of type '" "blpapi_Element_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setElementInt32" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_setElementInt32" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_Name_t * >(argp3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_Element_setElementInt32" "', argument " "4"" of type '" "blpapi_Int32_t""'"); - } - arg4 = static_cast< blpapi_Int32_t >(val4); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_setElementInt32(arg1,(char const *)arg2,(blpapi_Name const *)arg3,arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_setElementInt64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - blpapi_Int64_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long long val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Element_setElementInt64",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setElementInt64" "', argument " "1"" of type '" "blpapi_Element_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setElementInt64" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_setElementInt64" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_Name_t * >(argp3); - ecode4 = SWIG_AsVal_long_SS_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_Element_setElementInt64" "', argument " "4"" of type '" "blpapi_Int64_t""'"); - } - arg4 = static_cast< blpapi_Int64_t >(val4); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_setElementInt64(arg1,(char const *)arg2,(blpapi_Name const *)arg3,arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_setElementString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - char *arg4 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - int res4 ; - char *buf4 = 0 ; - int alloc4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Element_setElementString",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setElementString" "', argument " "1"" of type '" "blpapi_Element_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setElementString" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_setElementString" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_Name_t * >(argp3); - res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Element_setElementString" "', argument " "4"" of type '" "char const *""'"); - } - arg4 = reinterpret_cast< char * >(buf4); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_setElementString(arg1,(char const *)arg2,(blpapi_Name const *)arg3,(char const *)arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - if (alloc4 == SWIG_NEWOBJ) delete[] buf4; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - if (alloc4 == SWIG_NEWOBJ) delete[] buf4; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_setElementDatetime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - blpapi_Datetime_t *arg4 = (blpapi_Datetime_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Element_setElementDatetime",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setElementDatetime" "', argument " "1"" of type '" "blpapi_Element_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setElementDatetime" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_setElementDatetime" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_Name_t * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Element_setElementDatetime" "', argument " "4"" of type '" "blpapi_Datetime_t const *""'"); - } - arg4 = reinterpret_cast< blpapi_Datetime_t * >(argp4); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_setElementDatetime(arg1,(char const *)arg2,(blpapi_Name const *)arg3,(blpapi_Datetime_tag const *)arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_setElementFromName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - blpapi_Name_t *arg4 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Element_setElementFromName",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setElementFromName" "', argument " "1"" of type '" "blpapi_Element_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setElementFromName" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_setElementFromName" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_Name_t * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Element_setElementFromName" "', argument " "4"" of type '" "blpapi_Name_t const *""'"); - } - arg4 = reinterpret_cast< blpapi_Name_t * >(argp4); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_setElementFromName(arg1,(char const *)arg2,(blpapi_Name const *)arg3,(blpapi_Name const *)arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_appendElement(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - blpapi_Element_t **arg2 = (blpapi_Element_t **) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Element_t *temp2 = 0 ; - PyObject * obj0 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Element_appendElement",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_appendElement" "', argument " "1"" of type '" "blpapi_Element_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_appendElement(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Element, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_setChoice(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - blpapi_Element_t **arg2 = (blpapi_Element_t **) 0 ; - char *arg3 = (char *) 0 ; - blpapi_Name_t *arg4 = (blpapi_Name_t *) 0 ; - size_t arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Element_t *temp2 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Element_setChoice",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setChoice" "', argument " "1"" of type '" "blpapi_Element_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Element_t * >(argp1); - res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_setChoice" "', argument " "3"" of type '" "char const *""'"); - } - arg3 = reinterpret_cast< char * >(buf3); - res4 = SWIG_ConvertPtr(obj2, &argp4,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Element_setChoice" "', argument " "4"" of type '" "blpapi_Name_t const *""'"); - } - arg4 = reinterpret_cast< blpapi_Name_t * >(argp4); - ecode5 = SWIG_AsVal_size_t(obj3, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_Element_setChoice" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_setChoice(arg1,arg2,(char const *)arg3,(blpapi_Name const *)arg4,arg5); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Element, 0)); - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; - return resultobj; -fail: - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueFloat(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - blpapi_Float64_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - double val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_EventFormatter_setValueFloat",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_setValueFloat" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = reinterpret_cast< blpapi_EventFormatter_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_setValueFloat" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_setValueFloat" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_Name_t * >(argp3); - ecode4 = SWIG_AsVal_double(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_EventFormatter_setValueFloat" "', argument " "4"" of type '" "blpapi_Float64_t""'"); - } - arg4 = static_cast< blpapi_Float64_t >(val4); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_setValueFloat(arg1,(char const *)arg2,(blpapi_Name const *)arg3,arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueFloat(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - blpapi_Float64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_EventFormatter_appendValueFloat",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendValueFloat" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = reinterpret_cast< blpapi_EventFormatter_t * >(argp1); - ecode2 = SWIG_AsVal_double(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_EventFormatter_appendValueFloat" "', argument " "2"" of type '" "blpapi_Float64_t""'"); - } - arg2 = static_cast< blpapi_Float64_t >(val2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_appendValueFloat(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Event_t *arg1 = (blpapi_Event_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - blpapi_EventFormatter_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_EventFormatter_create",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Event, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_create" "', argument " "1"" of type '" "blpapi_Event_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Event_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_EventFormatter_t *)blpapi_EventFormatter_create(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_EventFormatter_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_destroy" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = reinterpret_cast< blpapi_EventFormatter_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_EventFormatter_destroy(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendMessage(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - blpapi_Topic_t *arg4 = (blpapi_Topic_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_EventFormatter_appendMessage",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendMessage" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = reinterpret_cast< blpapi_EventFormatter_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendMessage" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_appendMessage" "', argument " "3"" of type '" "blpapi_Name_t *""'"); - } - arg3 = reinterpret_cast< blpapi_Name_t * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_EventFormatter_appendMessage" "', argument " "4"" of type '" "blpapi_Topic_t const *""'"); - } - arg4 = reinterpret_cast< blpapi_Topic_t * >(argp4); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_appendMessage(arg1,(char const *)arg2,arg3,(blpapi_Topic const *)arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendMessageSeq(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - blpapi_Topic_t *arg4 = (blpapi_Topic_t *) 0 ; - unsigned int arg5 ; - unsigned int arg6 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - unsigned int val5 ; - int ecode5 = 0 ; - unsigned int val6 ; - int ecode6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:blpapi_EventFormatter_appendMessageSeq",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendMessageSeq" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = reinterpret_cast< blpapi_EventFormatter_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendMessageSeq" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_appendMessageSeq" "', argument " "3"" of type '" "blpapi_Name_t *""'"); - } - arg3 = reinterpret_cast< blpapi_Name_t * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_EventFormatter_appendMessageSeq" "', argument " "4"" of type '" "blpapi_Topic_t const *""'"); - } - arg4 = reinterpret_cast< blpapi_Topic_t * >(argp4); - ecode5 = SWIG_AsVal_unsigned_SS_int(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_EventFormatter_appendMessageSeq" "', argument " "5"" of type '" "unsigned int""'"); - } - arg5 = static_cast< unsigned int >(val5); - ecode6 = SWIG_AsVal_unsigned_SS_int(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "blpapi_EventFormatter_appendMessageSeq" "', argument " "6"" of type '" "unsigned int""'"); - } - arg6 = static_cast< unsigned int >(val6); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_appendMessageSeq(arg1,(char const *)arg2,arg3,(blpapi_Topic const *)arg4,arg5,arg6); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendResponse(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_EventFormatter_appendResponse",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendResponse" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = reinterpret_cast< blpapi_EventFormatter_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendResponse" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_appendResponse" "', argument " "3"" of type '" "blpapi_Name_t *""'"); - } - arg3 = reinterpret_cast< blpapi_Name_t * >(argp3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_appendResponse(arg1,(char const *)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendRecapMessage(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - blpapi_Topic_t *arg2 = (blpapi_Topic_t *) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_EventFormatter_appendRecapMessage",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendRecapMessage" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = reinterpret_cast< blpapi_EventFormatter_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendRecapMessage" "', argument " "2"" of type '" "blpapi_Topic_t const *""'"); - } - arg2 = reinterpret_cast< blpapi_Topic_t * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_appendRecapMessage" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_CorrelationId_t * >(argp3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_appendRecapMessage(arg1,(blpapi_Topic const *)arg2,(blpapi_CorrelationId_t_ const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendRecapMessageSeq(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - blpapi_Topic_t *arg2 = (blpapi_Topic_t *) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; - unsigned int arg4 ; - unsigned int arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - unsigned int val4 ; - int ecode4 = 0 ; - unsigned int val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:blpapi_EventFormatter_appendRecapMessageSeq",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendRecapMessageSeq" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = reinterpret_cast< blpapi_EventFormatter_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendRecapMessageSeq" "', argument " "2"" of type '" "blpapi_Topic_t const *""'"); - } - arg2 = reinterpret_cast< blpapi_Topic_t * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_appendRecapMessageSeq" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_CorrelationId_t * >(argp3); - ecode4 = SWIG_AsVal_unsigned_SS_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_EventFormatter_appendRecapMessageSeq" "', argument " "4"" of type '" "unsigned int""'"); - } - arg4 = static_cast< unsigned int >(val4); - ecode5 = SWIG_AsVal_unsigned_SS_int(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_EventFormatter_appendRecapMessageSeq" "', argument " "5"" of type '" "unsigned int""'"); - } - arg5 = static_cast< unsigned int >(val5); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_appendRecapMessageSeq(arg1,(blpapi_Topic const *)arg2,(blpapi_CorrelationId_t_ const *)arg3,arg4,arg5); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendFragmentedRecapMessage(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - blpapi_Topic_t *arg4 = (blpapi_Topic_t *) 0 ; - blpapi_CorrelationId_t *arg5 = (blpapi_CorrelationId_t *) 0 ; - int arg6 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - int val6 ; - int ecode6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:blpapi_EventFormatter_appendFragmentedRecapMessage",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessage" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = reinterpret_cast< blpapi_EventFormatter_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessage" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessage" "', argument " "3"" of type '" "blpapi_Name_t *""'"); - } - arg3 = reinterpret_cast< blpapi_Name_t * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessage" "', argument " "4"" of type '" "blpapi_Topic_t const *""'"); - } - arg4 = reinterpret_cast< blpapi_Topic_t * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessage" "', argument " "5"" of type '" "blpapi_CorrelationId_t const *""'"); - } - arg5 = reinterpret_cast< blpapi_CorrelationId_t * >(argp5); - ecode6 = SWIG_AsVal_int(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessage" "', argument " "6"" of type '" "int""'"); - } - arg6 = static_cast< int >(val6); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_appendFragmentedRecapMessage(arg1,(char const *)arg2,arg3,(blpapi_Topic const *)arg4,(blpapi_CorrelationId_t_ const *)arg5,arg6); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendFragmentedRecapMessageSeq(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - blpapi_Topic_t *arg4 = (blpapi_Topic_t *) 0 ; - int arg5 ; - unsigned int arg6 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - int val5 ; - int ecode5 = 0 ; - unsigned int val6 ; - int ecode6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:blpapi_EventFormatter_appendFragmentedRecapMessageSeq",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessageSeq" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = reinterpret_cast< blpapi_EventFormatter_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessageSeq" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessageSeq" "', argument " "3"" of type '" "blpapi_Name_t *""'"); - } - arg3 = reinterpret_cast< blpapi_Name_t * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessageSeq" "', argument " "4"" of type '" "blpapi_Topic_t const *""'"); - } - arg4 = reinterpret_cast< blpapi_Topic_t * >(argp4); - ecode5 = SWIG_AsVal_int(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessageSeq" "', argument " "5"" of type '" "int""'"); - } - arg5 = static_cast< int >(val5); - ecode6 = SWIG_AsVal_unsigned_SS_int(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessageSeq" "', argument " "6"" of type '" "unsigned int""'"); - } - arg6 = static_cast< unsigned int >(val6); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_appendFragmentedRecapMessageSeq(arg1,(char const *)arg2,arg3,(blpapi_Topic const *)arg4,arg5,arg6); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueBool(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - blpapi_Bool_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - int val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_EventFormatter_setValueBool",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_setValueBool" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = reinterpret_cast< blpapi_EventFormatter_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_setValueBool" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_setValueBool" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_Name_t * >(argp3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_EventFormatter_setValueBool" "', argument " "4"" of type '" "blpapi_Bool_t""'"); - } - arg4 = static_cast< blpapi_Bool_t >(val4); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_setValueBool(arg1,(char const *)arg2,(blpapi_Name const *)arg3,arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueChar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - char arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - char val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_EventFormatter_setValueChar",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_setValueChar" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = reinterpret_cast< blpapi_EventFormatter_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_setValueChar" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_setValueChar" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_Name_t * >(argp3); - ecode4 = SWIG_AsVal_char(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_EventFormatter_setValueChar" "', argument " "4"" of type '" "char""'"); - } - arg4 = static_cast< char >(val4); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_setValueChar(arg1,(char const *)arg2,(blpapi_Name const *)arg3,arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueInt32(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - blpapi_Int32_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - int val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_EventFormatter_setValueInt32",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_setValueInt32" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = reinterpret_cast< blpapi_EventFormatter_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_setValueInt32" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_setValueInt32" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_Name_t * >(argp3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_EventFormatter_setValueInt32" "', argument " "4"" of type '" "blpapi_Int32_t""'"); - } - arg4 = static_cast< blpapi_Int32_t >(val4); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_setValueInt32(arg1,(char const *)arg2,(blpapi_Name const *)arg3,arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueInt64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - blpapi_Int64_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long long val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_EventFormatter_setValueInt64",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_setValueInt64" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = reinterpret_cast< blpapi_EventFormatter_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_setValueInt64" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_setValueInt64" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_Name_t * >(argp3); - ecode4 = SWIG_AsVal_long_SS_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_EventFormatter_setValueInt64" "', argument " "4"" of type '" "blpapi_Int64_t""'"); - } - arg4 = static_cast< blpapi_Int64_t >(val4); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_setValueInt64(arg1,(char const *)arg2,(blpapi_Name const *)arg3,arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueDatetime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - blpapi_Datetime_t *arg4 = (blpapi_Datetime_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_EventFormatter_setValueDatetime",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_setValueDatetime" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = reinterpret_cast< blpapi_EventFormatter_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_setValueDatetime" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_setValueDatetime" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_Name_t * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_EventFormatter_setValueDatetime" "', argument " "4"" of type '" "blpapi_Datetime_t const *""'"); - } - arg4 = reinterpret_cast< blpapi_Datetime_t * >(argp4); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_setValueDatetime(arg1,(char const *)arg2,(blpapi_Name const *)arg3,(blpapi_Datetime_tag const *)arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - char *arg4 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - int res4 ; - char *buf4 = 0 ; - int alloc4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_EventFormatter_setValueString",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_setValueString" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = reinterpret_cast< blpapi_EventFormatter_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_setValueString" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_setValueString" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_Name_t * >(argp3); - res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_EventFormatter_setValueString" "', argument " "4"" of type '" "char const *""'"); - } - arg4 = reinterpret_cast< char * >(buf4); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_setValueString(arg1,(char const *)arg2,(blpapi_Name const *)arg3,(char const *)arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - if (alloc4 == SWIG_NEWOBJ) delete[] buf4; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - if (alloc4 == SWIG_NEWOBJ) delete[] buf4; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueFromName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - blpapi_Name_t *arg4 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_EventFormatter_setValueFromName",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_setValueFromName" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = reinterpret_cast< blpapi_EventFormatter_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_setValueFromName" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_setValueFromName" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_Name_t * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_EventFormatter_setValueFromName" "', argument " "4"" of type '" "blpapi_Name_t const *""'"); - } - arg4 = reinterpret_cast< blpapi_Name_t * >(argp4); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_setValueFromName(arg1,(char const *)arg2,(blpapi_Name const *)arg3,(blpapi_Name const *)arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueNull(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_EventFormatter_setValueNull",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_setValueNull" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = reinterpret_cast< blpapi_EventFormatter_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_setValueNull" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_setValueNull" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_Name_t * >(argp3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_setValueNull(arg1,(char const *)arg2,(blpapi_Name const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_pushElement(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_EventFormatter_pushElement",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_pushElement" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = reinterpret_cast< blpapi_EventFormatter_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_pushElement" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_pushElement" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_Name_t * >(argp3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_pushElement(arg1,(char const *)arg2,(blpapi_Name const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_popElement(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_EventFormatter_popElement",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_popElement" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = reinterpret_cast< blpapi_EventFormatter_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_popElement(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueBool(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - blpapi_Bool_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_EventFormatter_appendValueBool",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendValueBool" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = reinterpret_cast< blpapi_EventFormatter_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_EventFormatter_appendValueBool" "', argument " "2"" of type '" "blpapi_Bool_t""'"); - } - arg2 = static_cast< blpapi_Bool_t >(val2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_appendValueBool(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueChar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - char arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - char val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_EventFormatter_appendValueChar",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendValueChar" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = reinterpret_cast< blpapi_EventFormatter_t * >(argp1); - ecode2 = SWIG_AsVal_char(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_EventFormatter_appendValueChar" "', argument " "2"" of type '" "char""'"); - } - arg2 = static_cast< char >(val2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_appendValueChar(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueInt32(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - blpapi_Int32_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_EventFormatter_appendValueInt32",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendValueInt32" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = reinterpret_cast< blpapi_EventFormatter_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_EventFormatter_appendValueInt32" "', argument " "2"" of type '" "blpapi_Int32_t""'"); - } - arg2 = static_cast< blpapi_Int32_t >(val2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_appendValueInt32(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueInt64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - blpapi_Int64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_EventFormatter_appendValueInt64",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendValueInt64" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = reinterpret_cast< blpapi_EventFormatter_t * >(argp1); - ecode2 = SWIG_AsVal_long_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_EventFormatter_appendValueInt64" "', argument " "2"" of type '" "blpapi_Int64_t""'"); - } - arg2 = static_cast< blpapi_Int64_t >(val2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_appendValueInt64(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueDatetime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - blpapi_Datetime_t *arg2 = (blpapi_Datetime_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_EventFormatter_appendValueDatetime",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendValueDatetime" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = reinterpret_cast< blpapi_EventFormatter_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendValueDatetime" "', argument " "2"" of type '" "blpapi_Datetime_t const *""'"); - } - arg2 = reinterpret_cast< blpapi_Datetime_t * >(argp2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_appendValueDatetime(arg1,(blpapi_Datetime_tag const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_EventFormatter_appendValueString",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendValueString" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = reinterpret_cast< blpapi_EventFormatter_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendValueString" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_appendValueString(arg1,(char const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueFromName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_EventFormatter_appendValueFromName",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendValueFromName" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = reinterpret_cast< blpapi_EventFormatter_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendValueFromName" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); - } - arg2 = reinterpret_cast< blpapi_Name_t * >(argp2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_appendValueFromName(arg1,(blpapi_Name const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendElement(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_EventFormatter_appendElement",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendElement" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = reinterpret_cast< blpapi_EventFormatter_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_appendElement(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Session_createHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - PyObject *arg2 = (PyObject *) 0 ; - blpapi_EventDispatcher_t *arg3 = (blpapi_EventDispatcher_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - blpapi_Session_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:Session_createHelper",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_createHelper" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - { - arg2 = obj1; - } - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_EventDispatcher, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Session_createHelper" "', argument " "3"" of type '" "blpapi_EventDispatcher_t *""'"); - } - arg3 = reinterpret_cast< blpapi_EventDispatcher_t * >(argp3); - - try { - result = (blpapi_Session_t *)Session_createHelper(arg1,arg2,arg3); - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Session, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Session_destroyHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - PyObject *arg2 = (PyObject *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Session_destroyHelper",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_destroyHelper" "', argument " "1"" of type '" "blpapi_Session_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Session_t * >(argp1); - { - arg2 = obj1; - } - - try { - Session_destroyHelper(arg1,arg2); - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventDispatcher_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - size_t val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - blpapi_EventDispatcher_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_EventDispatcher_create",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "blpapi_EventDispatcher_create" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_EventDispatcher_t *)blpapi_EventDispatcher_create(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_EventDispatcher, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventDispatcher_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventDispatcher_t *arg1 = (blpapi_EventDispatcher_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_EventDispatcher_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventDispatcher, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventDispatcher_destroy" "', argument " "1"" of type '" "blpapi_EventDispatcher_t *""'"); - } - arg1 = reinterpret_cast< blpapi_EventDispatcher_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_EventDispatcher_destroy(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventDispatcher_start(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventDispatcher_t *arg1 = (blpapi_EventDispatcher_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_EventDispatcher_start",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventDispatcher, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventDispatcher_start" "', argument " "1"" of type '" "blpapi_EventDispatcher_t *""'"); - } - arg1 = reinterpret_cast< blpapi_EventDispatcher_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventDispatcher_start(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProviderSession_createHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - PyObject *arg2 = (PyObject *) 0 ; - blpapi_EventDispatcher_t *arg3 = (blpapi_EventDispatcher_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - blpapi_ProviderSession_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:ProviderSession_createHelper",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProviderSession_createHelper" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - { - arg2 = obj1; - } - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_EventDispatcher, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProviderSession_createHelper" "', argument " "3"" of type '" "blpapi_EventDispatcher_t *""'"); - } - arg3 = reinterpret_cast< blpapi_EventDispatcher_t * >(argp3); - - try { - result = (blpapi_ProviderSession_t *)ProviderSession_createHelper(arg1,arg2,arg3); - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProviderSession_destroyHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - PyObject *arg2 = (PyObject *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ProviderSession_destroyHelper",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProviderSession_destroyHelper" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = reinterpret_cast< blpapi_ProviderSession_t * >(argp1); - { - arg2 = obj1; - } - - try { - ProviderSession_destroyHelper(arg1,arg2); - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProviderSession_terminateSubscriptionsOnTopic(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - blpapi_Topic_t *arg2 = (blpapi_Topic_t *) 0 ; - char *arg3 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:ProviderSession_terminateSubscriptionsOnTopic",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProviderSession_terminateSubscriptionsOnTopic" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = reinterpret_cast< blpapi_ProviderSession_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProviderSession_terminateSubscriptionsOnTopic" "', argument " "2"" of type '" "blpapi_Topic_t const *""'"); - } - arg2 = reinterpret_cast< blpapi_Topic_t * >(argp2); - res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProviderSession_terminateSubscriptionsOnTopic" "', argument " "3"" of type '" "char const *""'"); - } - arg3 = reinterpret_cast< char * >(buf3); - - try { - result = (int)ProviderSession_terminateSubscriptionsOnTopic(arg1,(blpapi_Topic const *)arg2,(char const *)arg3); - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; - return resultobj; -fail: - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProviderSession_flushPublishedEvents(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"OO:ProviderSession_flushPublishedEvents",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProviderSession_flushPublishedEvents" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = reinterpret_cast< blpapi_ProviderSession_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProviderSession_flushPublishedEvents" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (bool)ProviderSession_flushPublishedEvents(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_getLastErrorDescription(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - char *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_getLastErrorDescription",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "blpapi_getLastErrorDescription" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_getLastErrorDescription(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":blpapi_SessionOptions_create")) SWIG_fail; - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_SessionOptions_t *)blpapi_SessionOptions_create(); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_destroy" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_SessionOptions_destroy(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setServerHost(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setServerHost",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setServerHost" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setServerHost" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setServerHost(arg1,(char const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setServerPort(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - unsigned short arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned short val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setServerPort",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setServerPort" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_short(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setServerPort" "', argument " "2"" of type '" "unsigned short""'"); - } - arg2 = static_cast< unsigned short >(val2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setServerPort(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setServerAddress(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - char *arg2 = (char *) 0 ; - unsigned short arg3 ; - size_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - unsigned short val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_SessionOptions_setServerAddress",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setServerAddress" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setServerAddress" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_SessionOptions_setServerAddress" "', argument " "3"" of type '" "unsigned short""'"); - } - arg3 = static_cast< unsigned short >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_SessionOptions_setServerAddress" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setServerAddress(arg1,(char const *)arg2,arg3,arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_removeServerAddress(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_removeServerAddress",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_removeServerAddress" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_removeServerAddress" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_removeServerAddress(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setConnectTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - unsigned int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setConnectTimeout",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setConnectTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setConnectTimeout" "', argument " "2"" of type '" "unsigned int""'"); - } - arg2 = static_cast< unsigned int >(val2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setConnectTimeout(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setDefaultServices(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setDefaultServices",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setDefaultServices" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setDefaultServices" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setDefaultServices(arg1,(char const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setDefaultSubscriptionService(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setDefaultSubscriptionService",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setDefaultSubscriptionService" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setDefaultSubscriptionService" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setDefaultSubscriptionService(arg1,(char const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setDefaultTopicPrefix(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setDefaultTopicPrefix",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setDefaultTopicPrefix" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setDefaultTopicPrefix" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_SessionOptions_setDefaultTopicPrefix(arg1,(char const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_Py_Void(); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setClientMode(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setClientMode",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setClientMode" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setClientMode" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_SessionOptions_setClientMode(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setMaxPendingRequests(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setMaxPendingRequests",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setMaxPendingRequests" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setMaxPendingRequests" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_SessionOptions_setMaxPendingRequests(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setAutoRestartOnDisconnection(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setAutoRestartOnDisconnection",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setAutoRestartOnDisconnection" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setAutoRestartOnDisconnection" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_SessionOptions_setAutoRestartOnDisconnection(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setAuthenticationOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setAuthenticationOptions",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setAuthenticationOptions" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setAuthenticationOptions" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_SessionOptions_setAuthenticationOptions(arg1,(char const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_Py_Void(); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setNumStartAttempts(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setNumStartAttempts",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setNumStartAttempts" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setNumStartAttempts" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_SessionOptions_setNumStartAttempts(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setMaxEventQueueSize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setMaxEventQueueSize",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setMaxEventQueueSize" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setMaxEventQueueSize" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_SessionOptions_setMaxEventQueueSize(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - float arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - float val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - ecode2 = SWIG_AsVal_float(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark" "', argument " "2"" of type '" "float""'"); - } - arg2 = static_cast< float >(val2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - float arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - float val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - ecode2 = SWIG_AsVal_float(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark" "', argument " "2"" of type '" "float""'"); - } - arg2 = static_cast< float >(val2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setDefaultKeepAliveInactivityTime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setDefaultKeepAliveInactivityTime",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setDefaultKeepAliveInactivityTime" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setDefaultKeepAliveInactivityTime" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setDefaultKeepAliveInactivityTime(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setKeepAliveEnabled(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setKeepAliveEnabled",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setKeepAliveEnabled" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setKeepAliveEnabled" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setKeepAliveEnabled(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setServiceCheckTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setServiceCheckTimeout",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setServiceCheckTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setServiceCheckTimeout" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setServiceCheckTimeout(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setServiceDownloadTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setServiceDownloadTimeout",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setServiceDownloadTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setServiceDownloadTimeout" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setServiceDownloadTimeout(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setTlsOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - blpapi_TlsOptions_t *arg2 = (blpapi_TlsOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setTlsOptions",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setTlsOptions" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setTlsOptions" "', argument " "2"" of type '" "blpapi_TlsOptions_t const *""'"); - } - arg2 = reinterpret_cast< blpapi_TlsOptions_t * >(argp2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_SessionOptions_setTlsOptions(arg1,(blpapi_TlsOptions const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setFlushPublishedEventsTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setFlushPublishedEventsTimeout",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setFlushPublishedEventsTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setFlushPublishedEventsTimeout" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setFlushPublishedEventsTimeout(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_serverHost(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - char *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_serverHost",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_serverHost" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_SessionOptions_serverHost(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_serverPort(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - unsigned int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_serverPort",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_serverPort" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (unsigned int)blpapi_SessionOptions_serverPort(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_numServerAddresses(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_numServerAddresses",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_numServerAddresses" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_numServerAddresses(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_getServerAddress(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - char **arg2 = (char **) 0 ; - unsigned short *arg3 = (unsigned short *) 0 ; - size_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - char *tempServerHost2 = 0 ; - unsigned short tempServerPort2 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - arg2 = &tempServerHost2; - arg3 = &tempServerPort2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_getServerAddress",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_getServerAddress" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - ecode4 = SWIG_AsVal_size_t(obj1, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_SessionOptions_getServerAddress" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_getServerAddress(arg1,(char const **)arg2,arg3,arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int(*arg3)); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_connectTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - unsigned int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_connectTimeout",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_connectTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (unsigned int)blpapi_SessionOptions_connectTimeout(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultServices(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - char *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_defaultServices",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_defaultServices" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_SessionOptions_defaultServices(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultSubscriptionService(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - char *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_defaultSubscriptionService",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_defaultSubscriptionService" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_SessionOptions_defaultSubscriptionService(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultTopicPrefix(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - char *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_defaultTopicPrefix",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_defaultTopicPrefix" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_SessionOptions_defaultTopicPrefix(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_clientMode(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_clientMode",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_clientMode" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_clientMode(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_maxPendingRequests(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_maxPendingRequests",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_maxPendingRequests" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_maxPendingRequests(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_autoRestartOnDisconnection(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_autoRestartOnDisconnection",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_autoRestartOnDisconnection" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_autoRestartOnDisconnection(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_authenticationOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - char *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_authenticationOptions",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_authenticationOptions" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_SessionOptions_authenticationOptions(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_numStartAttempts(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_numStartAttempts",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_numStartAttempts" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_numStartAttempts(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_maxEventQueueSize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_maxEventQueueSize",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_maxEventQueueSize" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = blpapi_SessionOptions_maxEventQueueSize(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_slowConsumerWarningHiWaterMark(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - float result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_slowConsumerWarningHiWaterMark",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_slowConsumerWarningHiWaterMark" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (float)blpapi_SessionOptions_slowConsumerWarningHiWaterMark(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_slowConsumerWarningLoWaterMark(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - float result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_slowConsumerWarningLoWaterMark",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_slowConsumerWarningLoWaterMark" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (float)blpapi_SessionOptions_slowConsumerWarningLoWaterMark(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultKeepAliveInactivityTime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_defaultKeepAliveInactivityTime",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_defaultKeepAliveInactivityTime" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_defaultKeepAliveInactivityTime(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultKeepAliveResponseTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_defaultKeepAliveResponseTimeout",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_defaultKeepAliveResponseTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_defaultKeepAliveResponseTimeout(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_keepAliveEnabled(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_keepAliveEnabled",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_keepAliveEnabled" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_keepAliveEnabled(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_recordSubscriptionDataReceiveTimes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_recordSubscriptionDataReceiveTimes",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_recordSubscriptionDataReceiveTimes" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_recordSubscriptionDataReceiveTimes(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_serviceCheckTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_serviceCheckTimeout",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_serviceCheckTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_serviceCheckTimeout(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_serviceDownloadTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_serviceDownloadTimeout",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_serviceDownloadTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_serviceDownloadTimeout(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_flushPublishedEventsTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_flushPublishedEventsTimeout",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_flushPublishedEventsTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_flushPublishedEventsTimeout(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_TlsOptions_t *arg1 = (blpapi_TlsOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_TlsOptions_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TlsOptions_destroy" "', argument " "1"" of type '" "blpapi_TlsOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_TlsOptions_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_TlsOptions_destroy(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_createFromFiles(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - char *arg2 = (char *) 0 ; - char *arg3 = (char *) 0 ; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - blpapi_TlsOptions_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_TlsOptions_createFromFiles",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TlsOptions_createFromFiles" "', argument " "1"" of type '" "char const *""'"); - } - arg1 = reinterpret_cast< char * >(buf1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_TlsOptions_createFromFiles" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_TlsOptions_createFromFiles" "', argument " "3"" of type '" "char const *""'"); - } - arg3 = reinterpret_cast< char * >(buf3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_TlsOptions_t *)blpapi_TlsOptions_createFromFiles((char const *)arg1,(char const *)arg2,(char const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; - return resultobj; -fail: - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_createFromBlobs(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - int arg2 ; - char *arg3 = (char *) 0 ; - char *arg4 = (char *) 0 ; - int arg5 ; - int res1 ; - Py_ssize_t size1 = 0 ; - void const *buf1 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; - int res4 ; - Py_ssize_t size4 = 0 ; - void const *buf4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - blpapi_TlsOptions_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_TlsOptions_createFromBlobs",&obj0,&obj1,&obj2)) SWIG_fail; - { - res1 = PyObject_AsReadBuffer(obj0, &buf1, &size1); - if (res1<0) { - PyErr_Clear(); - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TlsOptions_createFromBlobs" "', argument " "1"" of type '" "(const char *clientCredentialsRawData, int clientCredentialsRawDataLength)""'"); - } - arg1 = (char *) buf1; - arg2 = (int) (size1 / sizeof(char const)); - } - res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_TlsOptions_createFromBlobs" "', argument " "3"" of type '" "char const *""'"); - } - arg3 = reinterpret_cast< char * >(buf3); - { - res4 = PyObject_AsReadBuffer(obj2, &buf4, &size4); - if (res4<0) { - PyErr_Clear(); - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_TlsOptions_createFromBlobs" "', argument " "4"" of type '" "(const char *trustedCertificatesRawData, int trustedCertificatesRawDataLength)""'"); - } - arg4 = (char *) buf4; - arg5 = (int) (size4 / sizeof(char const)); - } - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_TlsOptions_t *)blpapi_TlsOptions_createFromBlobs((char const *)arg1,arg2,(char const *)arg3,(char const *)arg4,arg5); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; - return resultobj; -fail: - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_setTlsHandshakeTimeoutMs(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_TlsOptions_t *arg1 = (blpapi_TlsOptions_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TlsOptions_setTlsHandshakeTimeoutMs",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TlsOptions_setTlsHandshakeTimeoutMs" "', argument " "1"" of type '" "blpapi_TlsOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_TlsOptions_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_TlsOptions_setTlsHandshakeTimeoutMs" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_TlsOptions_setTlsHandshakeTimeoutMs(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_setCrlFetchTimeoutMs(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_TlsOptions_t *arg1 = (blpapi_TlsOptions_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TlsOptions_setCrlFetchTimeoutMs",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TlsOptions_setCrlFetchTimeoutMs" "', argument " "1"" of type '" "blpapi_TlsOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_TlsOptions_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_TlsOptions_setCrlFetchTimeoutMs" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_TlsOptions_setCrlFetchTimeoutMs(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Name_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - PyObject * obj0 = 0 ; - blpapi_Name_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Name_create",&obj0)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Name_create" "', argument " "1"" of type '" "char const *""'"); - } - arg1 = reinterpret_cast< char * >(buf1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Name_t *)blpapi_Name_create((char const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - return resultobj; -fail: - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Name_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Name_t *arg1 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Name_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Name_destroy" "', argument " "1"" of type '" "blpapi_Name_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Name_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_Name_destroy(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Name_equalsStr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Name_t *arg1 = (blpapi_Name_t *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Name_equalsStr",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Name_equalsStr" "', argument " "1"" of type '" "blpapi_Name_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Name_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Name_equalsStr" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Name_equalsStr((blpapi_Name const *)arg1,(char const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Name_string(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Name_t *arg1 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - char *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Name_string",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Name_string" "', argument " "1"" of type '" "blpapi_Name_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Name_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_Name_string((blpapi_Name const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Name_length(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Name_t *arg1 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Name_length",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Name_length" "', argument " "1"" of type '" "blpapi_Name_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Name_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = blpapi_Name_length((blpapi_Name const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Name_findName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - PyObject * obj0 = 0 ; - blpapi_Name_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Name_findName",&obj0)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Name_findName" "', argument " "1"" of type '" "char const *""'"); - } - arg1 = reinterpret_cast< char * >(buf1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Name_t *)blpapi_Name_findName((char const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - return resultobj; -fail: - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SubscriptionList_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":blpapi_SubscriptionList_create")) SWIG_fail; - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_SubscriptionList_t *)blpapi_SubscriptionList_create(); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SubscriptionList_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_destroy" "', argument " "1"" of type '" "blpapi_SubscriptionList_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SubscriptionList_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_SubscriptionList_destroy(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_addResolved(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_SubscriptionList_addResolved",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_addResolved" "', argument " "1"" of type '" "blpapi_SubscriptionList_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SubscriptionList_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SubscriptionList_addResolved" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_SubscriptionList_addResolved" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_CorrelationId_t * >(argp3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SubscriptionList_addResolved(arg1,(char const *)arg2,(blpapi_CorrelationId_t_ const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SubscriptionList_clear",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_clear" "', argument " "1"" of type '" "blpapi_SubscriptionList_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SubscriptionList_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SubscriptionList_clear(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_append(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; - blpapi_SubscriptionList_t *arg2 = (blpapi_SubscriptionList_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SubscriptionList_append",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_append" "', argument " "1"" of type '" "blpapi_SubscriptionList_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SubscriptionList_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SubscriptionList_append" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); - } - arg2 = reinterpret_cast< blpapi_SubscriptionList_t * >(argp2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SubscriptionList_append(arg1,(blpapi_SubscriptionList const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SubscriptionList_size",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_size" "', argument " "1"" of type '" "blpapi_SubscriptionList_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_SubscriptionList_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SubscriptionList_size((blpapi_SubscriptionList const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_correlationIdAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; - blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_CorrelationId_t temp2 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SubscriptionList_correlationIdAt",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_correlationIdAt" "', argument " "1"" of type '" "blpapi_SubscriptionList_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_SubscriptionList_t * >(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_SubscriptionList_correlationIdAt" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SubscriptionList_correlationIdAt((blpapi_SubscriptionList const *)arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(CorrelationId_t_clone(*arg2), SWIGTYPE_p_blpapi_CorrelationId_t_, SWIG_POINTER_OWN)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_topicStringAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; - char **arg2 = (char **) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - char *temp2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SubscriptionList_topicStringAt",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_topicStringAt" "', argument " "1"" of type '" "blpapi_SubscriptionList_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SubscriptionList_t * >(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_SubscriptionList_topicStringAt" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SubscriptionList_topicStringAt(arg1,(char const **)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_isResolvedAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; - int *arg2 = (int *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int temp2 ; - int res2 = SWIG_TMPOBJ ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SubscriptionList_isResolvedAt",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_isResolvedAt" "', argument " "1"" of type '" "blpapi_SubscriptionList_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SubscriptionList_t * >(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_SubscriptionList_isResolvedAt" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SubscriptionList_isResolvedAt(arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (SWIG_IsTmpObj(res2)) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg2))); - } else { - int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_int, new_flags)); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_parts_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Datetime_tag *arg1 = (blpapi_Datetime_tag *) 0 ; - blpapi_UChar_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned char val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_parts_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_parts_set" "', argument " "1"" of type '" "blpapi_Datetime_tag *""'"); - } - arg1 = reinterpret_cast< blpapi_Datetime_tag * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_parts_set" "', argument " "2"" of type '" "blpapi_UChar_t""'"); - } - arg2 = static_cast< blpapi_UChar_t >(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - if (arg1) (arg1)->parts = arg2; - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_parts_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Datetime_tag *arg1 = (blpapi_Datetime_tag *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - blpapi_UChar_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_parts_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_parts_get" "', argument " "1"" of type '" "blpapi_Datetime_tag *""'"); - } - arg1 = reinterpret_cast< blpapi_Datetime_tag * >(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_UChar_t) ((arg1)->parts); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_unsigned_SS_char(static_cast< unsigned char >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_hours_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Datetime_tag *arg1 = (blpapi_Datetime_tag *) 0 ; - blpapi_UChar_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned char val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_hours_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_hours_set" "', argument " "1"" of type '" "blpapi_Datetime_tag *""'"); - } - arg1 = reinterpret_cast< blpapi_Datetime_tag * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_hours_set" "', argument " "2"" of type '" "blpapi_UChar_t""'"); - } - arg2 = static_cast< blpapi_UChar_t >(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - if (arg1) (arg1)->hours = arg2; - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_hours_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Datetime_tag *arg1 = (blpapi_Datetime_tag *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - blpapi_UChar_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_hours_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_hours_get" "', argument " "1"" of type '" "blpapi_Datetime_tag *""'"); - } - arg1 = reinterpret_cast< blpapi_Datetime_tag * >(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_UChar_t) ((arg1)->hours); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_unsigned_SS_char(static_cast< unsigned char >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_minutes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Datetime_tag *arg1 = (blpapi_Datetime_tag *) 0 ; - blpapi_UChar_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned char val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_minutes_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_minutes_set" "', argument " "1"" of type '" "blpapi_Datetime_tag *""'"); - } - arg1 = reinterpret_cast< blpapi_Datetime_tag * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_minutes_set" "', argument " "2"" of type '" "blpapi_UChar_t""'"); - } - arg2 = static_cast< blpapi_UChar_t >(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - if (arg1) (arg1)->minutes = arg2; - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_minutes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Datetime_tag *arg1 = (blpapi_Datetime_tag *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - blpapi_UChar_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_minutes_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_minutes_get" "', argument " "1"" of type '" "blpapi_Datetime_tag *""'"); - } - arg1 = reinterpret_cast< blpapi_Datetime_tag * >(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_UChar_t) ((arg1)->minutes); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_unsigned_SS_char(static_cast< unsigned char >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_seconds_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Datetime_tag *arg1 = (blpapi_Datetime_tag *) 0 ; - blpapi_UChar_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned char val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_seconds_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_seconds_set" "', argument " "1"" of type '" "blpapi_Datetime_tag *""'"); - } - arg1 = reinterpret_cast< blpapi_Datetime_tag * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_seconds_set" "', argument " "2"" of type '" "blpapi_UChar_t""'"); - } - arg2 = static_cast< blpapi_UChar_t >(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - if (arg1) (arg1)->seconds = arg2; - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_seconds_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Datetime_tag *arg1 = (blpapi_Datetime_tag *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - blpapi_UChar_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_seconds_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_seconds_get" "', argument " "1"" of type '" "blpapi_Datetime_tag *""'"); - } - arg1 = reinterpret_cast< blpapi_Datetime_tag * >(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_UChar_t) ((arg1)->seconds); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_unsigned_SS_char(static_cast< unsigned char >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_milliSeconds_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Datetime_tag *arg1 = (blpapi_Datetime_tag *) 0 ; - blpapi_UInt16_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned short val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_milliSeconds_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_milliSeconds_set" "', argument " "1"" of type '" "blpapi_Datetime_tag *""'"); - } - arg1 = reinterpret_cast< blpapi_Datetime_tag * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_short(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_milliSeconds_set" "', argument " "2"" of type '" "blpapi_UInt16_t""'"); - } - arg2 = static_cast< blpapi_UInt16_t >(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - if (arg1) (arg1)->milliSeconds = arg2; - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_milliSeconds_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Datetime_tag *arg1 = (blpapi_Datetime_tag *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - blpapi_UInt16_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_milliSeconds_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_milliSeconds_get" "', argument " "1"" of type '" "blpapi_Datetime_tag *""'"); - } - arg1 = reinterpret_cast< blpapi_Datetime_tag * >(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_UInt16_t) ((arg1)->milliSeconds); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_unsigned_SS_short(static_cast< unsigned short >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_month_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Datetime_tag *arg1 = (blpapi_Datetime_tag *) 0 ; - blpapi_UChar_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned char val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_month_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_month_set" "', argument " "1"" of type '" "blpapi_Datetime_tag *""'"); - } - arg1 = reinterpret_cast< blpapi_Datetime_tag * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_month_set" "', argument " "2"" of type '" "blpapi_UChar_t""'"); - } - arg2 = static_cast< blpapi_UChar_t >(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - if (arg1) (arg1)->month = arg2; - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_month_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Datetime_tag *arg1 = (blpapi_Datetime_tag *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - blpapi_UChar_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_month_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_month_get" "', argument " "1"" of type '" "blpapi_Datetime_tag *""'"); - } - arg1 = reinterpret_cast< blpapi_Datetime_tag * >(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_UChar_t) ((arg1)->month); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_unsigned_SS_char(static_cast< unsigned char >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_day_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Datetime_tag *arg1 = (blpapi_Datetime_tag *) 0 ; - blpapi_UChar_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned char val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_day_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_day_set" "', argument " "1"" of type '" "blpapi_Datetime_tag *""'"); - } - arg1 = reinterpret_cast< blpapi_Datetime_tag * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_day_set" "', argument " "2"" of type '" "blpapi_UChar_t""'"); - } - arg2 = static_cast< blpapi_UChar_t >(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - if (arg1) (arg1)->day = arg2; - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_day_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Datetime_tag *arg1 = (blpapi_Datetime_tag *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - blpapi_UChar_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_day_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_day_get" "', argument " "1"" of type '" "blpapi_Datetime_tag *""'"); - } - arg1 = reinterpret_cast< blpapi_Datetime_tag * >(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_UChar_t) ((arg1)->day); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_unsigned_SS_char(static_cast< unsigned char >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_year_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Datetime_tag *arg1 = (blpapi_Datetime_tag *) 0 ; - blpapi_UInt16_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned short val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_year_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_year_set" "', argument " "1"" of type '" "blpapi_Datetime_tag *""'"); - } - arg1 = reinterpret_cast< blpapi_Datetime_tag * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_short(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_year_set" "', argument " "2"" of type '" "blpapi_UInt16_t""'"); - } - arg2 = static_cast< blpapi_UInt16_t >(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - if (arg1) (arg1)->year = arg2; - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_year_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Datetime_tag *arg1 = (blpapi_Datetime_tag *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - blpapi_UInt16_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_year_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_year_get" "', argument " "1"" of type '" "blpapi_Datetime_tag *""'"); - } - arg1 = reinterpret_cast< blpapi_Datetime_tag * >(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_UInt16_t) ((arg1)->year); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_unsigned_SS_short(static_cast< unsigned short >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_offset_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Datetime_tag *arg1 = (blpapi_Datetime_tag *) 0 ; - blpapi_Int16_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - short val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_offset_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_offset_set" "', argument " "1"" of type '" "blpapi_Datetime_tag *""'"); - } - arg1 = reinterpret_cast< blpapi_Datetime_tag * >(argp1); - ecode2 = SWIG_AsVal_short(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_offset_set" "', argument " "2"" of type '" "blpapi_Int16_t""'"); - } - arg2 = static_cast< blpapi_Int16_t >(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - if (arg1) (arg1)->offset = arg2; - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_offset_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Datetime_tag *arg1 = (blpapi_Datetime_tag *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - blpapi_Int16_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_offset_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_offset_get" "', argument " "1"" of type '" "blpapi_Datetime_tag *""'"); - } - arg1 = reinterpret_cast< blpapi_Datetime_tag * >(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Int16_t) ((arg1)->offset); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_short(static_cast< short >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_blpapi_Datetime_tag(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Datetime_tag *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_blpapi_Datetime_tag")) SWIG_fail; - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Datetime_tag *)new blpapi_Datetime_tag(); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Datetime_tag, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_blpapi_Datetime_tag(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Datetime_tag *arg1 = (blpapi_Datetime_tag *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_blpapi_Datetime_tag",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_blpapi_Datetime_tag" "', argument " "1"" of type '" "blpapi_Datetime_tag *""'"); - } - arg1 = reinterpret_cast< blpapi_Datetime_tag * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - delete arg1; - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *blpapi_Datetime_tag_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_blpapi_Datetime_tag, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_tag_datetime_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_HighPrecisionDatetime_tag *arg1 = (blpapi_HighPrecisionDatetime_tag *) 0 ; - blpapi_Datetime_t *arg2 = (blpapi_Datetime_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_HighPrecisionDatetime_tag_datetime_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_tag_datetime_set" "', argument " "1"" of type '" "blpapi_HighPrecisionDatetime_tag *""'"); - } - arg1 = reinterpret_cast< blpapi_HighPrecisionDatetime_tag * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_HighPrecisionDatetime_tag_datetime_set" "', argument " "2"" of type '" "blpapi_Datetime_t *""'"); - } - arg2 = reinterpret_cast< blpapi_Datetime_t * >(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - if (arg1) (arg1)->datetime = *arg2; - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_tag_datetime_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_HighPrecisionDatetime_tag *arg1 = (blpapi_HighPrecisionDatetime_tag *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - blpapi_Datetime_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_HighPrecisionDatetime_tag_datetime_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_tag_datetime_get" "', argument " "1"" of type '" "blpapi_HighPrecisionDatetime_tag *""'"); - } - arg1 = reinterpret_cast< blpapi_HighPrecisionDatetime_tag * >(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Datetime_t *)& ((arg1)->datetime); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_tag_picoseconds_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_HighPrecisionDatetime_tag *arg1 = (blpapi_HighPrecisionDatetime_tag *) 0 ; - blpapi_UInt32_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_HighPrecisionDatetime_tag_picoseconds_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_tag_picoseconds_set" "', argument " "1"" of type '" "blpapi_HighPrecisionDatetime_tag *""'"); - } - arg1 = reinterpret_cast< blpapi_HighPrecisionDatetime_tag * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_HighPrecisionDatetime_tag_picoseconds_set" "', argument " "2"" of type '" "blpapi_UInt32_t""'"); - } - arg2 = static_cast< blpapi_UInt32_t >(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - if (arg1) (arg1)->picoseconds = arg2; - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_tag_picoseconds_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_HighPrecisionDatetime_tag *arg1 = (blpapi_HighPrecisionDatetime_tag *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - blpapi_UInt32_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_HighPrecisionDatetime_tag_picoseconds_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_tag_picoseconds_get" "', argument " "1"" of type '" "blpapi_HighPrecisionDatetime_tag *""'"); - } - arg1 = reinterpret_cast< blpapi_HighPrecisionDatetime_tag * >(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_UInt32_t) ((arg1)->picoseconds); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_blpapi_HighPrecisionDatetime_tag(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_HighPrecisionDatetime_tag *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_blpapi_HighPrecisionDatetime_tag")) SWIG_fail; - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_HighPrecisionDatetime_tag *)new blpapi_HighPrecisionDatetime_tag(); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_blpapi_HighPrecisionDatetime_tag(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_HighPrecisionDatetime_tag *arg1 = (blpapi_HighPrecisionDatetime_tag *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_blpapi_HighPrecisionDatetime_tag",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_blpapi_HighPrecisionDatetime_tag" "', argument " "1"" of type '" "blpapi_HighPrecisionDatetime_tag *""'"); - } - arg1 = reinterpret_cast< blpapi_HighPrecisionDatetime_tag * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - delete arg1; - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *blpapi_HighPrecisionDatetime_tag_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_compare(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_HighPrecisionDatetime_t *arg1 = (blpapi_HighPrecisionDatetime_t *) 0 ; - blpapi_HighPrecisionDatetime_t *arg2 = (blpapi_HighPrecisionDatetime_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_HighPrecisionDatetime_compare",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_compare" "', argument " "1"" of type '" "blpapi_HighPrecisionDatetime_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_HighPrecisionDatetime_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_HighPrecisionDatetime_compare" "', argument " "2"" of type '" "blpapi_HighPrecisionDatetime_t const *""'"); - } - arg2 = reinterpret_cast< blpapi_HighPrecisionDatetime_t * >(argp2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_HighPrecisionDatetime_compare((blpapi_HighPrecisionDatetime_tag const *)arg1,(blpapi_HighPrecisionDatetime_tag const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_print(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_HighPrecisionDatetime_t *arg1 = (blpapi_HighPrecisionDatetime_t *) 0 ; - blpapi_StreamWriter_t arg2 ; - void *arg3 = (void *) 0 ; - int arg4 ; - int arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 ; - int res2 = 0 ; - int res3 ; - int val4 ; - int ecode4 = 0 ; - int val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:blpapi_HighPrecisionDatetime_print",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_print" "', argument " "1"" of type '" "blpapi_HighPrecisionDatetime_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_HighPrecisionDatetime_t * >(argp1); - { - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_blpapi_StreamWriter_t, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_HighPrecisionDatetime_print" "', argument " "2"" of type '" "blpapi_StreamWriter_t""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "blpapi_HighPrecisionDatetime_print" "', argument " "2"" of type '" "blpapi_StreamWriter_t""'"); - } else { - blpapi_StreamWriter_t * temp = reinterpret_cast< blpapi_StreamWriter_t * >(argp2); - arg2 = *temp; - if (SWIG_IsNewObj(res2)) delete temp; - } - } - res3 = SWIG_ConvertPtr(obj2,SWIG_as_voidptrptr(&arg3), 0, 0); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_HighPrecisionDatetime_print" "', argument " "3"" of type '" "void *""'"); - } - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_HighPrecisionDatetime_print" "', argument " "4"" of type '" "int""'"); - } - arg4 = static_cast< int >(val4); - ecode5 = SWIG_AsVal_int(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_HighPrecisionDatetime_print" "', argument " "5"" of type '" "int""'"); - } - arg5 = static_cast< int >(val5); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_HighPrecisionDatetime_print((blpapi_HighPrecisionDatetime_tag const *)arg1,arg2,arg3,arg4,arg5); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_fromTimePoint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_HighPrecisionDatetime_t *arg1 = (blpapi_HighPrecisionDatetime_t *) 0 ; - blpapi_TimePoint_t *arg2 = (blpapi_TimePoint_t *) 0 ; - short arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - short val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_HighPrecisionDatetime_fromTimePoint",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_fromTimePoint" "', argument " "1"" of type '" "blpapi_HighPrecisionDatetime_t *""'"); - } - arg1 = reinterpret_cast< blpapi_HighPrecisionDatetime_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_TimePoint_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_HighPrecisionDatetime_fromTimePoint" "', argument " "2"" of type '" "blpapi_TimePoint_t const *""'"); - } - arg2 = reinterpret_cast< blpapi_TimePoint_t * >(argp2); - ecode3 = SWIG_AsVal_short(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_HighPrecisionDatetime_fromTimePoint" "', argument " "3"" of type '" "short""'"); - } - arg3 = static_cast< short >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_HighPrecisionDatetime_fromTimePoint(arg1,(blpapi_TimePoint_t const *)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Constant_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - blpapi_Name_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_name",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_name" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Constant_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Name_t *)blpapi_Constant_name((blpapi_Constant const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Constant_description(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - char *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_description",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_description" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Constant_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_Constant_description((blpapi_Constant const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Constant_status(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_status",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_status" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Constant_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Constant_status((blpapi_Constant const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Constant_datatype(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_datatype",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_datatype" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Constant_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Constant_datatype((blpapi_Constant const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Constant_getValueAsInt64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; - blpapi_Int64_t *arg2 = (blpapi_Int64_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Int64_t temp2 ; - int res2 = SWIG_TMPOBJ ; - PyObject * obj0 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_getValueAsInt64",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_getValueAsInt64" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Constant_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Constant_getValueAsInt64((blpapi_Constant const *)arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (SWIG_IsTmpObj(res2)) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_long_SS_long((*arg2))); - } else { - int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_long_long, new_flags)); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Constant_getValueAsFloat64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; - blpapi_Float64_t *arg2 = (blpapi_Float64_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Float64_t temp2 ; - int res2 = SWIG_TMPOBJ ; - PyObject * obj0 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_getValueAsFloat64",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_getValueAsFloat64" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Constant_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Constant_getValueAsFloat64((blpapi_Constant const *)arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (SWIG_IsTmpObj(res2)) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_double((*arg2))); - } else { - int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_double, new_flags)); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Constant_getValueAsDatetime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; - blpapi_Datetime_t *arg2 = (blpapi_Datetime_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - arg2 = new blpapi_Datetime_t; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_getValueAsDatetime",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_getValueAsDatetime" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Constant_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Constant_getValueAsDatetime((blpapi_Constant const *)arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((arg2), SWIGTYPE_p_blpapi_Datetime_tag, SWIG_POINTER_OWN)); - arg2 = 0; - if(arg2) delete arg2; - return resultobj; -fail: - if(arg2) delete arg2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Constant_getValueAsString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; - char **arg2 = (char **) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - char *temp2 = 0 ; - PyObject * obj0 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_getValueAsString",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_getValueAsString" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Constant_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Constant_getValueAsString((blpapi_Constant const *)arg1,(char const **)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ConstantList_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ConstantList_t *arg1 = (blpapi_ConstantList_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - blpapi_Name_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ConstantList_name",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_name" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_ConstantList_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Name_t *)blpapi_ConstantList_name((blpapi_ConstantList const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ConstantList_description(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ConstantList_t *arg1 = (blpapi_ConstantList_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - char *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ConstantList_description",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_description" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_ConstantList_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_ConstantList_description((blpapi_ConstantList const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ConstantList_numConstants(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ConstantList_t *arg1 = (blpapi_ConstantList_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ConstantList_numConstants",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_numConstants" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_ConstantList_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ConstantList_numConstants((blpapi_ConstantList const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ConstantList_datatype(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ConstantList_t *arg1 = (blpapi_ConstantList_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ConstantList_datatype",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_datatype" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_ConstantList_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ConstantList_datatype((blpapi_ConstantList const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ConstantList_status(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ConstantList_t *arg1 = (blpapi_ConstantList_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ConstantList_status",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_status" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_ConstantList_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ConstantList_status((blpapi_ConstantList const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ConstantList_getConstant(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ConstantList_t *arg1 = (blpapi_ConstantList_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - blpapi_Constant_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_ConstantList_getConstant",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_getConstant" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_ConstantList_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ConstantList_getConstant" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ConstantList_getConstant" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_Name_t * >(argp3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Constant_t *)blpapi_ConstantList_getConstant((blpapi_ConstantList const *)arg1,(char const *)arg2,(blpapi_Name const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Constant, 0 | 0 ); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ConstantList_getConstantAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ConstantList_t *arg1 = (blpapi_ConstantList_t *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - blpapi_Constant_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ConstantList_getConstantAt",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_getConstantAt" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_ConstantList_t * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_ConstantList_getConstantAt" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Constant_t *)blpapi_ConstantList_getConstantAt((blpapi_ConstantList const *)arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Constant, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - blpapi_Name_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaElementDefinition_name",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_name" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_SchemaElementDefinition_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Name_t *)blpapi_SchemaElementDefinition_name((void *const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_description(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - char *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaElementDefinition_description",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_description" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_SchemaElementDefinition_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_SchemaElementDefinition_description((void *const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_status(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaElementDefinition_status",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_status" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_SchemaElementDefinition_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SchemaElementDefinition_status((void *const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_type(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - blpapi_SchemaTypeDefinition_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaElementDefinition_type",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_type" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_SchemaElementDefinition_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_SchemaTypeDefinition_t *)blpapi_SchemaElementDefinition_type((void *const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_void, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_numAlternateNames(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaElementDefinition_numAlternateNames",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_numAlternateNames" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_SchemaElementDefinition_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = blpapi_SchemaElementDefinition_numAlternateNames((void *const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_getAlternateName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - blpapi_Name_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SchemaElementDefinition_getAlternateName",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_getAlternateName" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_SchemaElementDefinition_t * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SchemaElementDefinition_getAlternateName" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Name_t *)blpapi_SchemaElementDefinition_getAlternateName((void *const *)arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_minValues(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaElementDefinition_minValues",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_minValues" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_SchemaElementDefinition_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = blpapi_SchemaElementDefinition_minValues((void *const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_maxValues(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaElementDefinition_maxValues",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_maxValues" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_SchemaElementDefinition_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = blpapi_SchemaElementDefinition_maxValues((void *const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - blpapi_Name_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_name",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_name" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_SchemaTypeDefinition_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Name_t *)blpapi_SchemaTypeDefinition_name((void *const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_description(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - char *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_description",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_description" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_SchemaTypeDefinition_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_SchemaTypeDefinition_description((void *const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_status(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_status",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_status" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_SchemaTypeDefinition_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SchemaTypeDefinition_status((void *const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_datatype(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_datatype",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_datatype" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_SchemaTypeDefinition_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SchemaTypeDefinition_datatype((void *const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_isComplexType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_isComplexType",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_isComplexType" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_SchemaTypeDefinition_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SchemaTypeDefinition_isComplexType((void *const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_isSimpleType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_isSimpleType",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_isSimpleType" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_SchemaTypeDefinition_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SchemaTypeDefinition_isSimpleType((void *const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_isEnumerationType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_isEnumerationType",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_isEnumerationType" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_SchemaTypeDefinition_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SchemaTypeDefinition_isEnumerationType((void *const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_numElementDefinitions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_numElementDefinitions",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_numElementDefinitions" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_SchemaTypeDefinition_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = blpapi_SchemaTypeDefinition_numElementDefinitions((void *const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_getElementDefinition(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - blpapi_SchemaElementDefinition_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_SchemaTypeDefinition_getElementDefinition",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_getElementDefinition" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_SchemaTypeDefinition_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SchemaTypeDefinition_getElementDefinition" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_SchemaTypeDefinition_getElementDefinition" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_Name_t * >(argp3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_SchemaElementDefinition_t *)blpapi_SchemaTypeDefinition_getElementDefinition((void *const *)arg1,(char const *)arg2,(blpapi_Name const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_void, 0 | 0 ); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_getElementDefinitionAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - blpapi_SchemaElementDefinition_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SchemaTypeDefinition_getElementDefinitionAt",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_getElementDefinitionAt" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_SchemaTypeDefinition_t * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SchemaTypeDefinition_getElementDefinitionAt" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_SchemaElementDefinition_t *)blpapi_SchemaTypeDefinition_getElementDefinitionAt((void *const *)arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_void, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_enumeration(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - blpapi_ConstantList_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_enumeration",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_enumeration" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_SchemaTypeDefinition_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_ConstantList_t *)blpapi_SchemaTypeDefinition_enumeration((void *const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Request_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Request_t *arg1 = (blpapi_Request_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Request_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Request, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Request_destroy" "', argument " "1"" of type '" "blpapi_Request_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Request_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_Request_destroy(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Request_elements(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Request_t *arg1 = (blpapi_Request_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - blpapi_Element_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Request_elements",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Request, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Request_elements" "', argument " "1"" of type '" "blpapi_Request_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Request_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Element_t *)blpapi_Request_elements(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Element, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Request_setPreferredRoute(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Request_t *arg1 = (blpapi_Request_t *) 0 ; - blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Request_setPreferredRoute",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Request, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Request_setPreferredRoute" "', argument " "1"" of type '" "blpapi_Request_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Request_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Request_setPreferredRoute" "', argument " "2"" of type '" "blpapi_CorrelationId_t *""'"); - } - arg2 = reinterpret_cast< blpapi_CorrelationId_t * >(argp2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_Request_setPreferredRoute(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_RequestTemplate_release(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_RequestTemplate_t *arg1 = (blpapi_RequestTemplate_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_RequestTemplate_release",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_RequestTemplate, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_RequestTemplate_release" "', argument " "1"" of type '" "blpapi_RequestTemplate_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_RequestTemplate_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_RequestTemplate_release((blpapi_RequestTemplate const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Operation_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Operation_t *arg1 = (blpapi_Operation_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - char *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Operation_name",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Operation, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Operation_name" "', argument " "1"" of type '" "blpapi_Operation_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Operation_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_Operation_name(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Operation_description(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Operation_t *arg1 = (blpapi_Operation_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - char *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Operation_description",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Operation, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Operation_description" "', argument " "1"" of type '" "blpapi_Operation_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Operation_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_Operation_description(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Operation_requestDefinition(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Operation_t *arg1 = (blpapi_Operation_t *) 0 ; - blpapi_SchemaElementDefinition_t **arg2 = (blpapi_SchemaElementDefinition_t **) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_SchemaElementDefinition_t *temp2 = 0 ; - PyObject * obj0 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Operation_requestDefinition",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Operation, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Operation_requestDefinition" "', argument " "1"" of type '" "blpapi_Operation_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Operation_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Operation_requestDefinition(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_p_void, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Operation_numResponseDefinitions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Operation_t *arg1 = (blpapi_Operation_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Operation_numResponseDefinitions",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Operation, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Operation_numResponseDefinitions" "', argument " "1"" of type '" "blpapi_Operation_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Operation_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Operation_numResponseDefinitions(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Operation_responseDefinition(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Operation_t *arg1 = (blpapi_Operation_t *) 0 ; - blpapi_SchemaElementDefinition_t **arg2 = (blpapi_SchemaElementDefinition_t **) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_SchemaElementDefinition_t *temp2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Operation_responseDefinition",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Operation, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Operation_responseDefinition" "', argument " "1"" of type '" "blpapi_Operation_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Operation_t * >(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Operation_responseDefinition" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Operation_responseDefinition(arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_p_void, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Service_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - char *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_name",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_name" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Service_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_Service_name(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Service_description(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - char *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_description",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_description" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Service_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_Service_description(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Service_numOperations(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_numOperations",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_numOperations" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Service_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Service_numOperations(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Service_numEventDefinitions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_numEventDefinitions",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_numEventDefinitions" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Service_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Service_numEventDefinitions(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Service_addRef(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_addRef",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_addRef" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Service_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Service_addRef(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Service_release(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_release",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_release" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Service_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_Service_release(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Service_authorizationServiceName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - char *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_authorizationServiceName",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_authorizationServiceName" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Service_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_Service_authorizationServiceName(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Service_getOperation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - blpapi_Operation_t **arg2 = (blpapi_Operation_t **) 0 ; - char *arg3 = (char *) 0 ; - blpapi_Name_t *arg4 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Operation_t *temp2 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Service_getOperation",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_getOperation" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Service_t * >(argp1); - res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Service_getOperation" "', argument " "3"" of type '" "char const *""'"); - } - arg3 = reinterpret_cast< char * >(buf3); - res4 = SWIG_ConvertPtr(obj2, &argp4,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Service_getOperation" "', argument " "4"" of type '" "blpapi_Name_t const *""'"); - } - arg4 = reinterpret_cast< blpapi_Name_t * >(argp4); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Service_getOperation(arg1,arg2,(char const *)arg3,(blpapi_Name const *)arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Operation, 0)); - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; - return resultobj; -fail: - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Service_getOperationAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - blpapi_Operation_t **arg2 = (blpapi_Operation_t **) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Operation_t *temp2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Service_getOperationAt",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_getOperationAt" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Service_t * >(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Service_getOperationAt" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Service_getOperationAt(arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Operation, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Service_getEventDefinition(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - blpapi_SchemaElementDefinition_t **arg2 = (blpapi_SchemaElementDefinition_t **) 0 ; - char *arg3 = (char *) 0 ; - blpapi_Name_t *arg4 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_SchemaElementDefinition_t *temp2 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Service_getEventDefinition",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_getEventDefinition" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Service_t * >(argp1); - res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Service_getEventDefinition" "', argument " "3"" of type '" "char const *""'"); - } - arg3 = reinterpret_cast< char * >(buf3); - res4 = SWIG_ConvertPtr(obj2, &argp4,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Service_getEventDefinition" "', argument " "4"" of type '" "blpapi_Name_t const *""'"); - } - arg4 = reinterpret_cast< blpapi_Name_t * >(argp4); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Service_getEventDefinition(arg1,arg2,(char const *)arg3,(blpapi_Name const *)arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_p_void, 0)); - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; - return resultobj; -fail: - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Service_getEventDefinitionAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - blpapi_SchemaElementDefinition_t **arg2 = (blpapi_SchemaElementDefinition_t **) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_SchemaElementDefinition_t *temp2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Service_getEventDefinitionAt",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_getEventDefinitionAt" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Service_t * >(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Service_getEventDefinitionAt" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Service_getEventDefinitionAt(arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_p_void, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Service_createRequest(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - blpapi_Request_t **arg2 = (blpapi_Request_t **) 0 ; - char *arg3 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Request_t *temp2 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Service_createRequest",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_createRequest" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Service_t * >(argp1); - res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Service_createRequest" "', argument " "3"" of type '" "char const *""'"); - } - arg3 = reinterpret_cast< char * >(buf3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Service_createRequest(arg1,arg2,(char const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Request, 0)); - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; - return resultobj; -fail: - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Service_createAuthorizationRequest(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - blpapi_Request_t **arg2 = (blpapi_Request_t **) 0 ; - char *arg3 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Request_t *temp2 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Service_createAuthorizationRequest",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_createAuthorizationRequest" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Service_t * >(argp1); - res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Service_createAuthorizationRequest" "', argument " "3"" of type '" "char const *""'"); - } - arg3 = reinterpret_cast< char * >(buf3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Service_createAuthorizationRequest(arg1,arg2,(char const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Request, 0)); - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; - return resultobj; -fail: - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Service_createPublishEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - blpapi_Event_t **arg2 = (blpapi_Event_t **) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Event_t *temp2 = 0 ; - PyObject * obj0 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_createPublishEvent",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_createPublishEvent" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Service_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Service_createPublishEvent(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Event, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Service_createAdminEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - blpapi_Event_t **arg2 = (blpapi_Event_t **) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Event_t *temp2 = 0 ; - PyObject * obj0 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_createAdminEvent",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_createAdminEvent" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Service_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Service_createAdminEvent(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Event, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Service_createResponseEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; - blpapi_Event_t **arg3 = (blpapi_Event_t **) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - blpapi_Event_t *temp3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - arg3 = &temp3; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Service_createResponseEvent",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_createResponseEvent" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Service_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Service_createResponseEvent" "', argument " "2"" of type '" "blpapi_CorrelationId_t const *""'"); - } - arg2 = reinterpret_cast< blpapi_CorrelationId_t * >(argp2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Service_createResponseEvent(arg1,(blpapi_CorrelationId_t_ const *)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg3), SWIGTYPE_p_blpapi_Event, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Message_messageType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - blpapi_Name_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_messageType",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_messageType" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Message_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Name_t *)blpapi_Message_messageType((blpapi_Message const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Message_topicName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - char *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_topicName",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_topicName" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Message_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_Message_topicName((blpapi_Message const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Message_service(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - blpapi_Service_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_service",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_service" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Message_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Service_t *)blpapi_Message_service((blpapi_Message const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Service, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Message_numCorrelationIds(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_numCorrelationIds",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_numCorrelationIds" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Message_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Message_numCorrelationIds((blpapi_Message const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Message_correlationId(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - blpapi_CorrelationId_t result; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Message_correlationId",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_correlationId" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Message_t * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Message_correlationId" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = blpapi_Message_correlationId((blpapi_Message const *)arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(CorrelationId_t_clone(result), SWIGTYPE_p_blpapi_CorrelationId_t_, SWIG_POINTER_OWN)); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Message_elements(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - blpapi_Element_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_elements",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_elements" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Message_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Element_t *)blpapi_Message_elements((blpapi_Message const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Element, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Message_fragmentType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_fragmentType",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_fragmentType" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Message_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Message_fragmentType((blpapi_Message const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Message_recapType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_recapType",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_recapType" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Message_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Message_recapType((blpapi_Message const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Message_print(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; - blpapi_StreamWriter_t arg2 ; - void *arg3 = (void *) 0 ; - int arg4 ; - int arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 ; - int res2 = 0 ; - int res3 ; - int val4 ; - int ecode4 = 0 ; - int val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:blpapi_Message_print",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_print" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Message_t * >(argp1); - { - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_blpapi_StreamWriter_t, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Message_print" "', argument " "2"" of type '" "blpapi_StreamWriter_t""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "blpapi_Message_print" "', argument " "2"" of type '" "blpapi_StreamWriter_t""'"); - } else { - blpapi_StreamWriter_t * temp = reinterpret_cast< blpapi_StreamWriter_t * >(argp2); - arg2 = *temp; - if (SWIG_IsNewObj(res2)) delete temp; - } - } - res3 = SWIG_ConvertPtr(obj2,SWIG_as_voidptrptr(&arg3), 0, 0); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Message_print" "', argument " "3"" of type '" "void *""'"); - } - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_Message_print" "', argument " "4"" of type '" "int""'"); - } - arg4 = static_cast< int >(val4); - ecode5 = SWIG_AsVal_int(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_Message_print" "', argument " "5"" of type '" "int""'"); - } - arg5 = static_cast< int >(val5); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Message_print((blpapi_Message const *)arg1,arg2,arg3,arg4,arg5); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Message_addRef(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_addRef",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_addRef" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Message_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Message_addRef((blpapi_Message const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Message_release(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_release",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_release" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Message_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Message_release((blpapi_Message const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Message_timeReceived(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; - blpapi_TimePoint_t *arg2 = (blpapi_TimePoint_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Message_timeReceived",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_timeReceived" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Message_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_TimePoint_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Message_timeReceived" "', argument " "2"" of type '" "blpapi_TimePoint_t *""'"); - } - arg2 = reinterpret_cast< blpapi_TimePoint_t * >(argp2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Message_timeReceived((blpapi_Message const *)arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Event_eventType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Event_t *arg1 = (blpapi_Event_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Event_eventType",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Event, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Event_eventType" "', argument " "1"" of type '" "blpapi_Event_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Event_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Event_eventType((blpapi_Event const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Event_release(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Event_t *arg1 = (blpapi_Event_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Event_release",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Event, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Event_release" "', argument " "1"" of type '" "blpapi_Event_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Event_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Event_release((blpapi_Event const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventQueue_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventQueue_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":blpapi_EventQueue_create")) SWIG_fail; - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_EventQueue_t *)blpapi_EventQueue_create(); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventQueue_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventQueue_t *arg1 = (blpapi_EventQueue_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_EventQueue_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventQueue_destroy" "', argument " "1"" of type '" "blpapi_EventQueue_t *""'"); - } - arg1 = reinterpret_cast< blpapi_EventQueue_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventQueue_destroy(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventQueue_nextEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventQueue_t *arg1 = (blpapi_EventQueue_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - blpapi_Event_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_EventQueue_nextEvent",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventQueue_nextEvent" "', argument " "1"" of type '" "blpapi_EventQueue_t *""'"); - } - arg1 = reinterpret_cast< blpapi_EventQueue_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_EventQueue_nextEvent" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Event_t *)blpapi_EventQueue_nextEvent(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Event, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventQueue_purge(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventQueue_t *arg1 = (blpapi_EventQueue_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_EventQueue_purge",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventQueue_purge" "', argument " "1"" of type '" "blpapi_EventQueue_t *""'"); - } - arg1 = reinterpret_cast< blpapi_EventQueue_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventQueue_purge(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventQueue_tryNextEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventQueue_t *arg1 = (blpapi_EventQueue_t *) 0 ; - blpapi_Event_t **arg2 = (blpapi_Event_t **) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Event_t *temp2 = 0 ; - PyObject * obj0 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_EventQueue_tryNextEvent",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventQueue_tryNextEvent" "', argument " "1"" of type '" "blpapi_EventQueue_t *""'"); - } - arg1 = reinterpret_cast< blpapi_EventQueue_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventQueue_tryNextEvent(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Event, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageIterator_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Event_t *arg1 = (blpapi_Event_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - blpapi_MessageIterator_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_MessageIterator_create",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Event, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageIterator_create" "', argument " "1"" of type '" "blpapi_Event_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Event_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_MessageIterator_t *)blpapi_MessageIterator_create((blpapi_Event const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_MessageIterator, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageIterator_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageIterator_t *arg1 = (blpapi_MessageIterator_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_MessageIterator_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageIterator, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageIterator_destroy" "', argument " "1"" of type '" "blpapi_MessageIterator_t *""'"); - } - arg1 = reinterpret_cast< blpapi_MessageIterator_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_MessageIterator_destroy(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageIterator_next(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageIterator_t *arg1 = (blpapi_MessageIterator_t *) 0 ; - blpapi_Message_t **arg2 = (blpapi_Message_t **) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Message_t *temp2 = 0 ; - PyObject * obj0 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_MessageIterator_next",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageIterator, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageIterator_next" "', argument " "1"" of type '" "blpapi_MessageIterator_t *""'"); - } - arg1 = reinterpret_cast< blpapi_MessageIterator_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_MessageIterator_next(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Message, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Identity_release(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Identity_t *arg1 = (blpapi_Identity_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Identity_release",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Identity_release" "', argument " "1"" of type '" "blpapi_Identity_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Identity_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_Identity_release(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Identity_addRef(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Identity_t *arg1 = (blpapi_Identity_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Identity_addRef",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Identity_addRef" "', argument " "1"" of type '" "blpapi_Identity_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Identity_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Identity_addRef(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Identity_hasEntitlements(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Identity_t *arg1 = (blpapi_Identity_t *) 0 ; - blpapi_Service_t *arg2 = (blpapi_Service_t *) 0 ; - blpapi_Element_t *arg3 = (blpapi_Element_t *) 0 ; - int *arg4 = (int *) 0 ; - size_t arg5 ; - int *arg6 = (int *) 0 ; - int *arg7 = (int *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:blpapi_Identity_hasEntitlements",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Identity_hasEntitlements" "', argument " "1"" of type '" "blpapi_Identity_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Identity_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Identity_hasEntitlements" "', argument " "2"" of type '" "blpapi_Service_t const *""'"); - } - arg2 = reinterpret_cast< blpapi_Service_t * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Identity_hasEntitlements" "', argument " "3"" of type '" "blpapi_Element_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_Element_t * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Identity_hasEntitlements" "', argument " "4"" of type '" "int const *""'"); - } - arg4 = reinterpret_cast< int * >(argp4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_Identity_hasEntitlements" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "blpapi_Identity_hasEntitlements" "', argument " "6"" of type '" "int *""'"); - } - arg6 = reinterpret_cast< int * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "blpapi_Identity_hasEntitlements" "', argument " "7"" of type '" "int *""'"); - } - arg7 = reinterpret_cast< int * >(argp7); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Identity_hasEntitlements((blpapi_Identity const *)arg1,(blpapi_Service const *)arg2,(blpapi_Element const *)arg3,(int const *)arg4,arg5,arg6,arg7); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Identity_isAuthorized(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Identity_t *arg1 = (blpapi_Identity_t *) 0 ; - blpapi_Service_t *arg2 = (blpapi_Service_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Identity_isAuthorized",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Identity_isAuthorized" "', argument " "1"" of type '" "blpapi_Identity_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Identity_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Identity_isAuthorized" "', argument " "2"" of type '" "blpapi_Service_t const *""'"); - } - arg2 = reinterpret_cast< blpapi_Service_t * >(argp2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Identity_isAuthorized((blpapi_Identity const *)arg1,(blpapi_Service const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Identity_getSeatType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Identity_t *arg1 = (blpapi_Identity_t *) 0 ; - int *arg2 = (int *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int temp2 ; - int res2 = SWIG_TMPOBJ ; - PyObject * obj0 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Identity_getSeatType",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Identity_getSeatType" "', argument " "1"" of type '" "blpapi_Identity_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Identity_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Identity_getSeatType((blpapi_Identity const *)arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (SWIG_IsTmpObj(res2)) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg2))); - } else { - int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_int, new_flags)); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_cancel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; - blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; - size_t arg3 ; - char *arg4 = (char *) 0 ; - int arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - int res4 ; - char *buf4 = 0 ; - int alloc4 = 0 ; - int val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:blpapi_AbstractSession_cancel",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_cancel" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); - } - arg1 = reinterpret_cast< blpapi_AbstractSession_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_cancel" "', argument " "2"" of type '" "blpapi_CorrelationId_t const *""'"); - } - arg2 = reinterpret_cast< blpapi_CorrelationId_t * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_AbstractSession_cancel" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_AbstractSession_cancel" "', argument " "4"" of type '" "char const *""'"); - } - arg4 = reinterpret_cast< char * >(buf4); - ecode5 = SWIG_AsVal_int(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_AbstractSession_cancel" "', argument " "5"" of type '" "int""'"); - } - arg5 = static_cast< int >(val5); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AbstractSession_cancel(arg1,(blpapi_CorrelationId_t_ const *)arg2,arg3,(char const *)arg4,arg5); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc4 == SWIG_NEWOBJ) delete[] buf4; - return resultobj; -fail: - if (alloc4 == SWIG_NEWOBJ) delete[] buf4; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_sendAuthorizationRequest(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; - blpapi_Request_t *arg2 = (blpapi_Request_t *) 0 ; - blpapi_Identity_t *arg3 = (blpapi_Identity_t *) 0 ; - blpapi_CorrelationId_t *arg4 = (blpapi_CorrelationId_t *) 0 ; - blpapi_EventQueue_t *arg5 = (blpapi_EventQueue_t *) 0 ; - char *arg6 = (char *) 0 ; - int arg7 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - int res6 ; - char *buf6 = 0 ; - int alloc6 = 0 ; - int val7 ; - int ecode7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:blpapi_AbstractSession_sendAuthorizationRequest",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_sendAuthorizationRequest" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); - } - arg1 = reinterpret_cast< blpapi_AbstractSession_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Request, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_sendAuthorizationRequest" "', argument " "2"" of type '" "blpapi_Request_t const *""'"); - } - arg2 = reinterpret_cast< blpapi_Request_t * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AbstractSession_sendAuthorizationRequest" "', argument " "3"" of type '" "blpapi_Identity_t *""'"); - } - arg3 = reinterpret_cast< blpapi_Identity_t * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_AbstractSession_sendAuthorizationRequest" "', argument " "4"" of type '" "blpapi_CorrelationId_t *""'"); - } - arg4 = reinterpret_cast< blpapi_CorrelationId_t * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "blpapi_AbstractSession_sendAuthorizationRequest" "', argument " "5"" of type '" "blpapi_EventQueue_t *""'"); - } - arg5 = reinterpret_cast< blpapi_EventQueue_t * >(argp5); - res6 = SWIG_AsCharPtrAndSize(obj5, &buf6, NULL, &alloc6); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "blpapi_AbstractSession_sendAuthorizationRequest" "', argument " "6"" of type '" "char const *""'"); - } - arg6 = reinterpret_cast< char * >(buf6); - ecode7 = SWIG_AsVal_int(obj6, &val7); - if (!SWIG_IsOK(ecode7)) { - SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "blpapi_AbstractSession_sendAuthorizationRequest" "', argument " "7"" of type '" "int""'"); - } - arg7 = static_cast< int >(val7); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AbstractSession_sendAuthorizationRequest(arg1,(blpapi_Request const *)arg2,arg3,arg4,arg5,(char const *)arg6,arg7); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc6 == SWIG_NEWOBJ) delete[] buf6; - return resultobj; -fail: - if (alloc6 == SWIG_NEWOBJ) delete[] buf6; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_openService(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_AbstractSession_openService",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_openService" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); - } - arg1 = reinterpret_cast< blpapi_AbstractSession_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_openService" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AbstractSession_openService(arg1,(char const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_openServiceAsync(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_AbstractSession_openServiceAsync",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_openServiceAsync" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); - } - arg1 = reinterpret_cast< blpapi_AbstractSession_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_openServiceAsync" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AbstractSession_openServiceAsync" "', argument " "3"" of type '" "blpapi_CorrelationId_t *""'"); - } - arg3 = reinterpret_cast< blpapi_CorrelationId_t * >(argp3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AbstractSession_openServiceAsync(arg1,(char const *)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_generateToken(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; - blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; - blpapi_EventQueue_t *arg3 = (blpapi_EventQueue_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_AbstractSession_generateToken",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_generateToken" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); - } - arg1 = reinterpret_cast< blpapi_AbstractSession_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_generateToken" "', argument " "2"" of type '" "blpapi_CorrelationId_t *""'"); - } - arg2 = reinterpret_cast< blpapi_CorrelationId_t * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AbstractSession_generateToken" "', argument " "3"" of type '" "blpapi_EventQueue_t *""'"); - } - arg3 = reinterpret_cast< blpapi_EventQueue_t * >(argp3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AbstractSession_generateToken(arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_generateManualToken(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; - blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; - char *arg3 = (char *) 0 ; - char *arg4 = (char *) 0 ; - blpapi_EventQueue_t *arg5 = (blpapi_EventQueue_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; - int res4 ; - char *buf4 = 0 ; - int alloc4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:blpapi_AbstractSession_generateManualToken",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_generateManualToken" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); - } - arg1 = reinterpret_cast< blpapi_AbstractSession_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_generateManualToken" "', argument " "2"" of type '" "blpapi_CorrelationId_t *""'"); - } - arg2 = reinterpret_cast< blpapi_CorrelationId_t * >(argp2); - res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AbstractSession_generateManualToken" "', argument " "3"" of type '" "char const *""'"); - } - arg3 = reinterpret_cast< char * >(buf3); - res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_AbstractSession_generateManualToken" "', argument " "4"" of type '" "char const *""'"); - } - arg4 = reinterpret_cast< char * >(buf4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "blpapi_AbstractSession_generateManualToken" "', argument " "5"" of type '" "blpapi_EventQueue_t *""'"); - } - arg5 = reinterpret_cast< blpapi_EventQueue_t * >(argp5); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AbstractSession_generateManualToken(arg1,arg2,(char const *)arg3,(char const *)arg4,arg5); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; - if (alloc4 == SWIG_NEWOBJ) delete[] buf4; - return resultobj; -fail: - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; - if (alloc4 == SWIG_NEWOBJ) delete[] buf4; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_getService(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; - blpapi_Service_t **arg2 = (blpapi_Service_t **) 0 ; - char *arg3 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Service_t *temp2 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_AbstractSession_getService",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_getService" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); - } - arg1 = reinterpret_cast< blpapi_AbstractSession_t * >(argp1); - res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AbstractSession_getService" "', argument " "3"" of type '" "char const *""'"); - } - arg3 = reinterpret_cast< char * >(buf3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AbstractSession_getService(arg1,arg2,(char const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Service, 0)); - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; - return resultobj; -fail: - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_createIdentity(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - blpapi_Identity_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AbstractSession_createIdentity",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_createIdentity" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); - } - arg1 = reinterpret_cast< blpapi_AbstractSession_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Identity_t *)blpapi_AbstractSession_createIdentity(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Identity, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Session_start(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Session_start",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_start" "', argument " "1"" of type '" "blpapi_Session_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Session_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_start(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Session_startAsync(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Session_startAsync",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_startAsync" "', argument " "1"" of type '" "blpapi_Session_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Session_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_startAsync(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Session_stop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Session_stop",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_stop" "', argument " "1"" of type '" "blpapi_Session_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Session_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_stop(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Session_stopAsync(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Session_stopAsync",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_stopAsync" "', argument " "1"" of type '" "blpapi_Session_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Session_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_stopAsync(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Session_nextEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - blpapi_Event_t **arg2 = (blpapi_Event_t **) 0 ; - unsigned int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Event_t *temp2 = 0 ; - unsigned int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Session_nextEvent",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_nextEvent" "', argument " "1"" of type '" "blpapi_Session_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Session_t * >(argp1); - ecode3 = SWIG_AsVal_unsigned_SS_int(obj1, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Session_nextEvent" "', argument " "3"" of type '" "unsigned int""'"); - } - arg3 = static_cast< unsigned int >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_nextEvent(arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Event, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Session_tryNextEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - blpapi_Event_t **arg2 = (blpapi_Event_t **) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Event_t *temp2 = 0 ; - PyObject * obj0 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Session_tryNextEvent",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_tryNextEvent" "', argument " "1"" of type '" "blpapi_Session_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Session_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_tryNextEvent(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Event, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Session_subscribe(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - blpapi_SubscriptionList_t *arg2 = (blpapi_SubscriptionList_t *) 0 ; - blpapi_Identity_t *arg3 = (blpapi_Identity_t *) 0 ; - char *arg4 = (char *) 0 ; - int arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - int res4 ; - char *buf4 = 0 ; - int alloc4 = 0 ; - int val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:blpapi_Session_subscribe",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_subscribe" "', argument " "1"" of type '" "blpapi_Session_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Session_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_subscribe" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); - } - arg2 = reinterpret_cast< blpapi_SubscriptionList_t * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_subscribe" "', argument " "3"" of type '" "blpapi_Identity_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_Identity_t * >(argp3); - res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Session_subscribe" "', argument " "4"" of type '" "char const *""'"); - } - arg4 = reinterpret_cast< char * >(buf4); - ecode5 = SWIG_AsVal_int(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_Session_subscribe" "', argument " "5"" of type '" "int""'"); - } - arg5 = static_cast< int >(val5); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_subscribe(arg1,(blpapi_SubscriptionList const *)arg2,(blpapi_Identity const *)arg3,(char const *)arg4,arg5); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc4 == SWIG_NEWOBJ) delete[] buf4; - return resultobj; -fail: - if (alloc4 == SWIG_NEWOBJ) delete[] buf4; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Session_resubscribe(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - blpapi_SubscriptionList_t *arg2 = (blpapi_SubscriptionList_t *) 0 ; - char *arg3 = (char *) 0 ; - int arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; - int val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Session_resubscribe",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_resubscribe" "', argument " "1"" of type '" "blpapi_Session_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Session_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_resubscribe" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); - } - arg2 = reinterpret_cast< blpapi_SubscriptionList_t * >(argp2); - res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_resubscribe" "', argument " "3"" of type '" "char const *""'"); - } - arg3 = reinterpret_cast< char * >(buf3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_Session_resubscribe" "', argument " "4"" of type '" "int""'"); - } - arg4 = static_cast< int >(val4); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_resubscribe(arg1,(blpapi_SubscriptionList const *)arg2,(char const *)arg3,arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; - return resultobj; -fail: - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Session_resubscribeWithId(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - blpapi_SubscriptionList_t *arg2 = (blpapi_SubscriptionList_t *) 0 ; - int arg3 ; - char *arg4 = (char *) 0 ; - int arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - int res4 ; - char *buf4 = 0 ; - int alloc4 = 0 ; - int val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:blpapi_Session_resubscribeWithId",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_resubscribeWithId" "', argument " "1"" of type '" "blpapi_Session_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Session_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_resubscribeWithId" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); - } - arg2 = reinterpret_cast< blpapi_SubscriptionList_t * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Session_resubscribeWithId" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Session_resubscribeWithId" "', argument " "4"" of type '" "char const *""'"); - } - arg4 = reinterpret_cast< char * >(buf4); - ecode5 = SWIG_AsVal_int(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_Session_resubscribeWithId" "', argument " "5"" of type '" "int""'"); - } - arg5 = static_cast< int >(val5); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_resubscribeWithId(arg1,(blpapi_SubscriptionList const *)arg2,arg3,(char const *)arg4,arg5); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc4 == SWIG_NEWOBJ) delete[] buf4; - return resultobj; -fail: - if (alloc4 == SWIG_NEWOBJ) delete[] buf4; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Session_unsubscribe(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - blpapi_SubscriptionList_t *arg2 = (blpapi_SubscriptionList_t *) 0 ; - char *arg3 = (char *) 0 ; - int arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; - int val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Session_unsubscribe",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_unsubscribe" "', argument " "1"" of type '" "blpapi_Session_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Session_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_unsubscribe" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); - } - arg2 = reinterpret_cast< blpapi_SubscriptionList_t * >(argp2); - res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_unsubscribe" "', argument " "3"" of type '" "char const *""'"); - } - arg3 = reinterpret_cast< char * >(buf3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_Session_unsubscribe" "', argument " "4"" of type '" "int""'"); - } - arg4 = static_cast< int >(val4); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_unsubscribe(arg1,(blpapi_SubscriptionList const *)arg2,(char const *)arg3,arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; - return resultobj; -fail: - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Session_setStatusCorrelationId(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - blpapi_Service_t *arg2 = (blpapi_Service_t *) 0 ; - blpapi_Identity_t *arg3 = (blpapi_Identity_t *) 0 ; - blpapi_CorrelationId_t *arg4 = (blpapi_CorrelationId_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Session_setStatusCorrelationId",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_setStatusCorrelationId" "', argument " "1"" of type '" "blpapi_Session_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Session_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_setStatusCorrelationId" "', argument " "2"" of type '" "blpapi_Service_t const *""'"); - } - arg2 = reinterpret_cast< blpapi_Service_t * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_setStatusCorrelationId" "', argument " "3"" of type '" "blpapi_Identity_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_Identity_t * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Session_setStatusCorrelationId" "', argument " "4"" of type '" "blpapi_CorrelationId_t const *""'"); - } - arg4 = reinterpret_cast< blpapi_CorrelationId_t * >(argp4); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_setStatusCorrelationId(arg1,(blpapi_Service const *)arg2,(blpapi_Identity const *)arg3,(blpapi_CorrelationId_t_ const *)arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Session_sendRequest(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - blpapi_Request_t *arg2 = (blpapi_Request_t *) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; - blpapi_Identity_t *arg4 = (blpapi_Identity_t *) 0 ; - blpapi_EventQueue_t *arg5 = (blpapi_EventQueue_t *) 0 ; - char *arg6 = (char *) 0 ; - int arg7 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - int res6 ; - char *buf6 = 0 ; - int alloc6 = 0 ; - int val7 ; - int ecode7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:blpapi_Session_sendRequest",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_sendRequest" "', argument " "1"" of type '" "blpapi_Session_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Session_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Request, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_sendRequest" "', argument " "2"" of type '" "blpapi_Request_t const *""'"); - } - arg2 = reinterpret_cast< blpapi_Request_t * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_sendRequest" "', argument " "3"" of type '" "blpapi_CorrelationId_t *""'"); - } - arg3 = reinterpret_cast< blpapi_CorrelationId_t * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Session_sendRequest" "', argument " "4"" of type '" "blpapi_Identity_t *""'"); - } - arg4 = reinterpret_cast< blpapi_Identity_t * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "blpapi_Session_sendRequest" "', argument " "5"" of type '" "blpapi_EventQueue_t *""'"); - } - arg5 = reinterpret_cast< blpapi_EventQueue_t * >(argp5); - res6 = SWIG_AsCharPtrAndSize(obj5, &buf6, NULL, &alloc6); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "blpapi_Session_sendRequest" "', argument " "6"" of type '" "char const *""'"); - } - arg6 = reinterpret_cast< char * >(buf6); - ecode7 = SWIG_AsVal_int(obj6, &val7); - if (!SWIG_IsOK(ecode7)) { - SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "blpapi_Session_sendRequest" "', argument " "7"" of type '" "int""'"); - } - arg7 = static_cast< int >(val7); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_sendRequest(arg1,(blpapi_Request const *)arg2,arg3,arg4,arg5,(char const *)arg6,arg7); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc6 == SWIG_NEWOBJ) delete[] buf6; - return resultobj; -fail: - if (alloc6 == SWIG_NEWOBJ) delete[] buf6; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Session_sendRequestTemplate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - blpapi_RequestTemplate_t *arg2 = (blpapi_RequestTemplate_t *) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Session_sendRequestTemplate",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_sendRequestTemplate" "', argument " "1"" of type '" "blpapi_Session_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Session_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_RequestTemplate, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_sendRequestTemplate" "', argument " "2"" of type '" "blpapi_RequestTemplate_t const *""'"); - } - arg2 = reinterpret_cast< blpapi_RequestTemplate_t * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_sendRequestTemplate" "', argument " "3"" of type '" "blpapi_CorrelationId_t *""'"); - } - arg3 = reinterpret_cast< blpapi_CorrelationId_t * >(argp3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_sendRequestTemplate(arg1,(blpapi_RequestTemplate const *)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Session_createSnapshotRequestTemplate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_RequestTemplate_t **arg1 = (blpapi_RequestTemplate_t **) 0 ; - blpapi_Session_t *arg2 = (blpapi_Session_t *) 0 ; - char *arg3 = (char *) 0 ; - blpapi_Identity_t *arg4 = (blpapi_Identity_t *) 0 ; - blpapi_CorrelationId_t *arg5 = (blpapi_CorrelationId_t *) 0 ; - blpapi_RequestTemplate_t *temp1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - int result; - - arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Session_createSnapshotRequestTemplate",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_Session, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_createSnapshotRequestTemplate" "', argument " "2"" of type '" "blpapi_Session_t *""'"); - } - arg2 = reinterpret_cast< blpapi_Session_t * >(argp2); - res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_createSnapshotRequestTemplate" "', argument " "3"" of type '" "char const *""'"); - } - arg3 = reinterpret_cast< char * >(buf3); - res4 = SWIG_ConvertPtr(obj2, &argp4,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Session_createSnapshotRequestTemplate" "', argument " "4"" of type '" "blpapi_Identity_t const *""'"); - } - arg4 = reinterpret_cast< blpapi_Identity_t * >(argp4); - res5 = SWIG_ConvertPtr(obj3, &argp5,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "blpapi_Session_createSnapshotRequestTemplate" "', argument " "5"" of type '" "blpapi_CorrelationId_t *""'"); - } - arg5 = reinterpret_cast< blpapi_CorrelationId_t * >(argp5); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_createSnapshotRequestTemplate(arg1,arg2,(char const *)arg3,(blpapi_Identity const *)arg4,arg5); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_RequestTemplate, 0)); - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; - return resultobj; -fail: - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Session_getAbstractSession(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - blpapi_AbstractSession_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Session_getAbstractSession",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_getAbstractSession" "', argument " "1"" of type '" "blpapi_Session_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Session_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_AbstractSession_t *)blpapi_Session_getAbstractSession(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_extractAttributeFromResolutionSuccess(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; - blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - blpapi_Element_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_extractAttributeFromResolutionSuccess",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_extractAttributeFromResolutionSuccess" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Message_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ResolutionList_extractAttributeFromResolutionSuccess" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); - } - arg2 = reinterpret_cast< blpapi_Name_t * >(argp2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Element_t *)blpapi_ResolutionList_extractAttributeFromResolutionSuccess((blpapi_Message const *)arg1,(blpapi_Name const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Element, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - blpapi_ResolutionList_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ResolutionList_create",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_create" "', argument " "1"" of type '" "blpapi_ResolutionList_t *""'"); - } - arg1 = reinterpret_cast< blpapi_ResolutionList_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_ResolutionList_t *)blpapi_ResolutionList_create(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ResolutionList_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_destroy" "', argument " "1"" of type '" "blpapi_ResolutionList_t *""'"); - } - arg1 = reinterpret_cast< blpapi_ResolutionList_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_ResolutionList_destroy(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_ResolutionList_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_add" "', argument " "1"" of type '" "blpapi_ResolutionList_t *""'"); - } - arg1 = reinterpret_cast< blpapi_ResolutionList_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ResolutionList_add" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ResolutionList_add" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_CorrelationId_t * >(argp3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ResolutionList_add(arg1,(char const *)arg2,(blpapi_CorrelationId_t_ const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_addFromMessage(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - blpapi_Message_t *arg2 = (blpapi_Message_t *) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_ResolutionList_addFromMessage",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_addFromMessage" "', argument " "1"" of type '" "blpapi_ResolutionList_t *""'"); - } - arg1 = reinterpret_cast< blpapi_ResolutionList_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Message, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ResolutionList_addFromMessage" "', argument " "2"" of type '" "blpapi_Message_t const *""'"); - } - arg2 = reinterpret_cast< blpapi_Message_t * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ResolutionList_addFromMessage" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_CorrelationId_t * >(argp3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ResolutionList_addFromMessage(arg1,(blpapi_Message const *)arg2,(blpapi_CorrelationId_t_ const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_addAttribute(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_addAttribute",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_addAttribute" "', argument " "1"" of type '" "blpapi_ResolutionList_t *""'"); - } - arg1 = reinterpret_cast< blpapi_ResolutionList_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ResolutionList_addAttribute" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); - } - arg2 = reinterpret_cast< blpapi_Name_t * >(argp2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ResolutionList_addAttribute(arg1,(blpapi_Name const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_correlationIdAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_CorrelationId_t temp2 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_correlationIdAt",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_correlationIdAt" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_ResolutionList_t * >(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ResolutionList_correlationIdAt" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ResolutionList_correlationIdAt((blpapi_ResolutionList const *)arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(CorrelationId_t_clone(*arg2), SWIGTYPE_p_blpapi_CorrelationId_t_, SWIG_POINTER_OWN)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_topicString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - char **arg2 = (char **) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - char *temp2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_topicString",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_topicString" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_ResolutionList_t * >(argp1); - res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ResolutionList_topicString" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_CorrelationId_t * >(argp3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ResolutionList_topicString((blpapi_ResolutionList const *)arg1,(char const **)arg2,(blpapi_CorrelationId_t_ const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_topicStringAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - char **arg2 = (char **) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - char *temp2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_topicStringAt",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_topicStringAt" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_ResolutionList_t * >(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ResolutionList_topicStringAt" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ResolutionList_topicStringAt((blpapi_ResolutionList const *)arg1,(char const **)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_status(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - int *arg2 = (int *) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int temp2 ; - int res2 = SWIG_TMPOBJ ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_status",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_status" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_ResolutionList_t * >(argp1); - res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ResolutionList_status" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_CorrelationId_t * >(argp3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ResolutionList_status((blpapi_ResolutionList const *)arg1,arg2,(blpapi_CorrelationId_t_ const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (SWIG_IsTmpObj(res2)) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg2))); - } else { - int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_int, new_flags)); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_statusAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - int *arg2 = (int *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int temp2 ; - int res2 = SWIG_TMPOBJ ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_statusAt",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_statusAt" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_ResolutionList_t * >(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ResolutionList_statusAt" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ResolutionList_statusAt((blpapi_ResolutionList const *)arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (SWIG_IsTmpObj(res2)) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg2))); - } else { - int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_int, new_flags)); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_attribute(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - blpapi_Element_t **arg2 = (blpapi_Element_t **) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - blpapi_CorrelationId_t *arg4 = (blpapi_CorrelationId_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Element_t *temp2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_ResolutionList_attribute",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_attribute" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_ResolutionList_t * >(argp1); - res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ResolutionList_attribute" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_Name_t * >(argp3); - res4 = SWIG_ConvertPtr(obj2, &argp4,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_ResolutionList_attribute" "', argument " "4"" of type '" "blpapi_CorrelationId_t const *""'"); - } - arg4 = reinterpret_cast< blpapi_CorrelationId_t * >(argp4); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ResolutionList_attribute((blpapi_ResolutionList const *)arg1,arg2,(blpapi_Name const *)arg3,(blpapi_CorrelationId_t_ const *)arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Element, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_attributeAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - blpapi_Element_t **arg2 = (blpapi_Element_t **) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - size_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Element_t *temp2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_ResolutionList_attributeAt",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_attributeAt" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_ResolutionList_t * >(argp1); - res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ResolutionList_attributeAt" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_Name_t * >(argp3); - ecode4 = SWIG_AsVal_size_t(obj2, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_ResolutionList_attributeAt" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ResolutionList_attributeAt((blpapi_ResolutionList const *)arg1,arg2,(blpapi_Name const *)arg3,arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Element, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_message(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - blpapi_Message_t **arg2 = (blpapi_Message_t **) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Message_t *temp2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_message",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_message" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_ResolutionList_t * >(argp1); - res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ResolutionList_message" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_CorrelationId_t * >(argp3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ResolutionList_message((blpapi_ResolutionList const *)arg1,arg2,(blpapi_CorrelationId_t_ const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Message, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_messageAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - blpapi_Message_t **arg2 = (blpapi_Message_t **) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Message_t *temp2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_messageAt",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_messageAt" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_ResolutionList_t * >(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ResolutionList_messageAt" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ResolutionList_messageAt((blpapi_ResolutionList const *)arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Message, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ResolutionList_size",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_size" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_ResolutionList_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ResolutionList_size((blpapi_ResolutionList const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Topic_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Topic_t *arg1 = (blpapi_Topic_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - blpapi_Topic_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Topic_create",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Topic_create" "', argument " "1"" of type '" "blpapi_Topic_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Topic_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Topic_t *)blpapi_Topic_create(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Topic, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Topic_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Topic_t *arg1 = (blpapi_Topic_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Topic_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Topic_destroy" "', argument " "1"" of type '" "blpapi_Topic_t *""'"); - } - arg1 = reinterpret_cast< blpapi_Topic_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_Topic_destroy(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Topic_compare(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Topic_t *arg1 = (blpapi_Topic_t *) 0 ; - blpapi_Topic_t *arg2 = (blpapi_Topic_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Topic_compare",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Topic_compare" "', argument " "1"" of type '" "blpapi_Topic_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Topic_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Topic_compare" "', argument " "2"" of type '" "blpapi_Topic_t const *""'"); - } - arg2 = reinterpret_cast< blpapi_Topic_t * >(argp2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Topic_compare((blpapi_Topic const *)arg1,(blpapi_Topic const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Topic_service(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Topic_t *arg1 = (blpapi_Topic_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - blpapi_Service_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Topic_service",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Topic_service" "', argument " "1"" of type '" "blpapi_Topic_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Topic_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Service_t *)blpapi_Topic_service((blpapi_Topic const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Service, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Topic_isActive(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Topic_t *arg1 = (blpapi_Topic_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Topic_isActive",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Topic_isActive" "', argument " "1"" of type '" "blpapi_Topic_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_Topic_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Topic_isActive((blpapi_Topic const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TopicList_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_TopicList_t *arg1 = (blpapi_TopicList_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - blpapi_TopicList_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_TopicList_create",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_create" "', argument " "1"" of type '" "blpapi_TopicList_t *""'"); - } - arg1 = reinterpret_cast< blpapi_TopicList_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_TopicList_t *)blpapi_TopicList_create(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TopicList_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_TopicList_t *arg1 = (blpapi_TopicList_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_TopicList_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_destroy" "', argument " "1"" of type '" "blpapi_TopicList_t *""'"); - } - arg1 = reinterpret_cast< blpapi_TopicList_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_TopicList_destroy(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TopicList_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_TopicList_t *arg1 = (blpapi_TopicList_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_TopicList_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_add" "', argument " "1"" of type '" "blpapi_TopicList_t *""'"); - } - arg1 = reinterpret_cast< blpapi_TopicList_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_TopicList_add" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_TopicList_add" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_CorrelationId_t * >(argp3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_TopicList_add(arg1,(char const *)arg2,(blpapi_CorrelationId_t_ const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TopicList_addFromMessage(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_TopicList_t *arg1 = (blpapi_TopicList_t *) 0 ; - blpapi_Message_t *arg2 = (blpapi_Message_t *) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_TopicList_addFromMessage",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_addFromMessage" "', argument " "1"" of type '" "blpapi_TopicList_t *""'"); - } - arg1 = reinterpret_cast< blpapi_TopicList_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Message, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_TopicList_addFromMessage" "', argument " "2"" of type '" "blpapi_Message_t const *""'"); - } - arg2 = reinterpret_cast< blpapi_Message_t * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_TopicList_addFromMessage" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_CorrelationId_t * >(argp3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_TopicList_addFromMessage(arg1,(blpapi_Message const *)arg2,(blpapi_CorrelationId_t_ const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TopicList_correlationIdAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_TopicList_t *arg1 = (blpapi_TopicList_t *) 0 ; - blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_CorrelationId_t temp2 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TopicList_correlationIdAt",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_correlationIdAt" "', argument " "1"" of type '" "blpapi_TopicList_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_TopicList_t * >(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_TopicList_correlationIdAt" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_TopicList_correlationIdAt((blpapi_TopicList const *)arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(CorrelationId_t_clone(*arg2), SWIGTYPE_p_blpapi_CorrelationId_t_, SWIG_POINTER_OWN)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TopicList_topicString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_TopicList_t *arg1 = (blpapi_TopicList_t *) 0 ; - char **arg2 = (char **) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - char *temp2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TopicList_topicString",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_topicString" "', argument " "1"" of type '" "blpapi_TopicList_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_TopicList_t * >(argp1); - res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_TopicList_topicString" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_CorrelationId_t * >(argp3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_TopicList_topicString((blpapi_TopicList const *)arg1,(char const **)arg2,(blpapi_CorrelationId_t_ const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TopicList_topicStringAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_TopicList_t *arg1 = (blpapi_TopicList_t *) 0 ; - char **arg2 = (char **) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - char *temp2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TopicList_topicStringAt",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_topicStringAt" "', argument " "1"" of type '" "blpapi_TopicList_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_TopicList_t * >(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_TopicList_topicStringAt" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_TopicList_topicStringAt((blpapi_TopicList const *)arg1,(char const **)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TopicList_status(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_TopicList_t *arg1 = (blpapi_TopicList_t *) 0 ; - int *arg2 = (int *) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int temp2 ; - int res2 = SWIG_TMPOBJ ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TopicList_status",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_status" "', argument " "1"" of type '" "blpapi_TopicList_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_TopicList_t * >(argp1); - res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_TopicList_status" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_CorrelationId_t * >(argp3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_TopicList_status((blpapi_TopicList const *)arg1,arg2,(blpapi_CorrelationId_t_ const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (SWIG_IsTmpObj(res2)) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg2))); - } else { - int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_int, new_flags)); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TopicList_statusAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_TopicList_t *arg1 = (blpapi_TopicList_t *) 0 ; - int *arg2 = (int *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int temp2 ; - int res2 = SWIG_TMPOBJ ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TopicList_statusAt",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_statusAt" "', argument " "1"" of type '" "blpapi_TopicList_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_TopicList_t * >(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_TopicList_statusAt" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_TopicList_statusAt((blpapi_TopicList const *)arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (SWIG_IsTmpObj(res2)) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg2))); - } else { - int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_int, new_flags)); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TopicList_message(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_TopicList_t *arg1 = (blpapi_TopicList_t *) 0 ; - blpapi_Message_t **arg2 = (blpapi_Message_t **) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Message_t *temp2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TopicList_message",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_message" "', argument " "1"" of type '" "blpapi_TopicList_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_TopicList_t * >(argp1); - res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_TopicList_message" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_CorrelationId_t * >(argp3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_TopicList_message((blpapi_TopicList const *)arg1,arg2,(blpapi_CorrelationId_t_ const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Message, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TopicList_messageAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_TopicList_t *arg1 = (blpapi_TopicList_t *) 0 ; - blpapi_Message_t **arg2 = (blpapi_Message_t **) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Message_t *temp2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TopicList_messageAt",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_messageAt" "', argument " "1"" of type '" "blpapi_TopicList_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_TopicList_t * >(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_TopicList_messageAt" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_TopicList_messageAt((blpapi_TopicList const *)arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Message, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TopicList_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_TopicList_t *arg1 = (blpapi_TopicList_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_TopicList_size",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_size" "', argument " "1"" of type '" "blpapi_TopicList_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_TopicList_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_TopicList_size((blpapi_TopicList const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - blpapi_ProviderEventHandler_t arg2 = (blpapi_ProviderEventHandler_t) 0 ; - blpapi_EventDispatcher_t *arg3 = (blpapi_EventDispatcher_t *) 0 ; - void *arg4 = (void *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - int res4 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - blpapi_ProviderSession_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_ProviderSession_create",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_create" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_SessionOptions_t * >(argp1); - { - int res = SWIG_ConvertFunctionPtr(obj1, (void**)(&arg2), SWIGTYPE_p_f_p_blpapi_Event_p_blpapi_ProviderSession_p_void__void); - if (!SWIG_IsOK(res)) { - SWIG_exception_fail(SWIG_ArgError(res), "in method '" "blpapi_ProviderSession_create" "', argument " "2"" of type '" "blpapi_ProviderEventHandler_t""'"); - } - } - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_EventDispatcher, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ProviderSession_create" "', argument " "3"" of type '" "blpapi_EventDispatcher_t *""'"); - } - arg3 = reinterpret_cast< blpapi_EventDispatcher_t * >(argp3); - res4 = SWIG_ConvertPtr(obj3,SWIG_as_voidptrptr(&arg4), 0, 0); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_ProviderSession_create" "', argument " "4"" of type '" "void *""'"); - } - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_ProviderSession_t *)blpapi_ProviderSession_create(arg1,arg2,arg3,arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ProviderSession_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_destroy" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = reinterpret_cast< blpapi_ProviderSession_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_ProviderSession_destroy(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_start(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ProviderSession_start",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_start" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = reinterpret_cast< blpapi_ProviderSession_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_start(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_startAsync(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ProviderSession_startAsync",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_startAsync" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = reinterpret_cast< blpapi_ProviderSession_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_startAsync(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_stop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ProviderSession_stop",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_stop" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = reinterpret_cast< blpapi_ProviderSession_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_stop(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_stopAsync(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ProviderSession_stopAsync",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_stopAsync" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = reinterpret_cast< blpapi_ProviderSession_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_stopAsync(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_nextEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - blpapi_Event_t **arg2 = (blpapi_Event_t **) 0 ; - unsigned int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Event_t *temp2 = 0 ; - unsigned int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ProviderSession_nextEvent",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_nextEvent" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = reinterpret_cast< blpapi_ProviderSession_t * >(argp1); - ecode3 = SWIG_AsVal_unsigned_SS_int(obj1, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_nextEvent" "', argument " "3"" of type '" "unsigned int""'"); - } - arg3 = static_cast< unsigned int >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_nextEvent(arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Event, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_tryNextEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - blpapi_Event_t **arg2 = (blpapi_Event_t **) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Event_t *temp2 = 0 ; - PyObject * obj0 = 0 ; - int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ProviderSession_tryNextEvent",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_tryNextEvent" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = reinterpret_cast< blpapi_ProviderSession_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_tryNextEvent(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Event, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_registerService(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Identity_t *arg3 = (blpapi_Identity_t *) 0 ; - blpapi_ServiceRegistrationOptions_t *arg4 = (blpapi_ServiceRegistrationOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_ProviderSession_registerService",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_registerService" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = reinterpret_cast< blpapi_ProviderSession_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_registerService" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ProviderSession_registerService" "', argument " "3"" of type '" "blpapi_Identity_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_Identity_t * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_ProviderSession_registerService" "', argument " "4"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); - } - arg4 = reinterpret_cast< blpapi_ServiceRegistrationOptions_t * >(argp4); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_registerService(arg1,(char const *)arg2,(blpapi_Identity const *)arg3,arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_activateSubServiceCodeRange(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - char *arg2 = (char *) 0 ; - int arg3 ; - int arg4 ; - int arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - int val3 ; - int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - int val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:blpapi_ProviderSession_activateSubServiceCodeRange",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_activateSubServiceCodeRange" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = reinterpret_cast< blpapi_ProviderSession_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_activateSubServiceCodeRange" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_activateSubServiceCodeRange" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_ProviderSession_activateSubServiceCodeRange" "', argument " "4"" of type '" "int""'"); - } - arg4 = static_cast< int >(val4); - ecode5 = SWIG_AsVal_int(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_ProviderSession_activateSubServiceCodeRange" "', argument " "5"" of type '" "int""'"); - } - arg5 = static_cast< int >(val5); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_activateSubServiceCodeRange(arg1,(char const *)arg2,arg3,arg4,arg5); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_deactivateSubServiceCodeRange(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - char *arg2 = (char *) 0 ; - int arg3 ; - int arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - int val3 ; - int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_ProviderSession_deactivateSubServiceCodeRange",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_deactivateSubServiceCodeRange" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = reinterpret_cast< blpapi_ProviderSession_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_deactivateSubServiceCodeRange" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_deactivateSubServiceCodeRange" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_ProviderSession_deactivateSubServiceCodeRange" "', argument " "4"" of type '" "int""'"); - } - arg4 = static_cast< int >(val4); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_deactivateSubServiceCodeRange(arg1,(char const *)arg2,arg3,arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_registerServiceAsync(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Identity_t *arg3 = (blpapi_Identity_t *) 0 ; - blpapi_CorrelationId_t *arg4 = (blpapi_CorrelationId_t *) 0 ; - blpapi_ServiceRegistrationOptions_t *arg5 = (blpapi_ServiceRegistrationOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:blpapi_ProviderSession_registerServiceAsync",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_registerServiceAsync" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = reinterpret_cast< blpapi_ProviderSession_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_registerServiceAsync" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ProviderSession_registerServiceAsync" "', argument " "3"" of type '" "blpapi_Identity_t const *""'"); - } - arg3 = reinterpret_cast< blpapi_Identity_t * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_ProviderSession_registerServiceAsync" "', argument " "4"" of type '" "blpapi_CorrelationId_t *""'"); - } - arg4 = reinterpret_cast< blpapi_CorrelationId_t * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "blpapi_ProviderSession_registerServiceAsync" "', argument " "5"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); - } - arg5 = reinterpret_cast< blpapi_ServiceRegistrationOptions_t * >(argp5); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_registerServiceAsync(arg1,(char const *)arg2,(blpapi_Identity const *)arg3,arg4,arg5); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_deregisterService(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ProviderSession_deregisterService",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_deregisterService" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = reinterpret_cast< blpapi_ProviderSession_t * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_deregisterService" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_deregisterService(arg1,(char const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_resolve(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - blpapi_ResolutionList_t *arg2 = (blpapi_ResolutionList_t *) 0 ; - int arg3 ; - blpapi_Identity_t *arg4 = (blpapi_Identity_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_ProviderSession_resolve",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_resolve" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = reinterpret_cast< blpapi_ProviderSession_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_resolve" "', argument " "2"" of type '" "blpapi_ResolutionList_t *""'"); - } - arg2 = reinterpret_cast< blpapi_ResolutionList_t * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_resolve" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_ProviderSession_resolve" "', argument " "4"" of type '" "blpapi_Identity_t const *""'"); - } - arg4 = reinterpret_cast< blpapi_Identity_t * >(argp4); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_resolve(arg1,arg2,arg3,(blpapi_Identity const *)arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_resolveAsync(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - blpapi_ResolutionList_t *arg2 = (blpapi_ResolutionList_t *) 0 ; - int arg3 ; - blpapi_Identity_t *arg4 = (blpapi_Identity_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_ProviderSession_resolveAsync",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_resolveAsync" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = reinterpret_cast< blpapi_ProviderSession_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_resolveAsync" "', argument " "2"" of type '" "blpapi_ResolutionList_t const *""'"); - } - arg2 = reinterpret_cast< blpapi_ResolutionList_t * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_resolveAsync" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_ProviderSession_resolveAsync" "', argument " "4"" of type '" "blpapi_Identity_t const *""'"); - } - arg4 = reinterpret_cast< blpapi_Identity_t * >(argp4); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_resolveAsync(arg1,(blpapi_ResolutionList const *)arg2,arg3,(blpapi_Identity const *)arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_createTopics(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - blpapi_TopicList_t *arg2 = (blpapi_TopicList_t *) 0 ; - int arg3 ; - blpapi_Identity_t *arg4 = (blpapi_Identity_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_ProviderSession_createTopics",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_createTopics" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = reinterpret_cast< blpapi_ProviderSession_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_createTopics" "', argument " "2"" of type '" "blpapi_TopicList_t *""'"); - } - arg2 = reinterpret_cast< blpapi_TopicList_t * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_createTopics" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_ProviderSession_createTopics" "', argument " "4"" of type '" "blpapi_Identity_t const *""'"); - } - arg4 = reinterpret_cast< blpapi_Identity_t * >(argp4); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_createTopics(arg1,arg2,arg3,(blpapi_Identity const *)arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_createTopicsAsync(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - blpapi_TopicList_t *arg2 = (blpapi_TopicList_t *) 0 ; - int arg3 ; - blpapi_Identity_t *arg4 = (blpapi_Identity_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_ProviderSession_createTopicsAsync",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_createTopicsAsync" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = reinterpret_cast< blpapi_ProviderSession_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_createTopicsAsync" "', argument " "2"" of type '" "blpapi_TopicList_t const *""'"); - } - arg2 = reinterpret_cast< blpapi_TopicList_t * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_createTopicsAsync" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_ProviderSession_createTopicsAsync" "', argument " "4"" of type '" "blpapi_Identity_t const *""'"); - } - arg4 = reinterpret_cast< blpapi_Identity_t * >(argp4); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_createTopicsAsync(arg1,(blpapi_TopicList const *)arg2,arg3,(blpapi_Identity const *)arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_getTopic(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - blpapi_Message_t *arg2 = (blpapi_Message_t *) 0 ; - blpapi_Topic_t **arg3 = (blpapi_Topic_t **) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - blpapi_Topic_t *temp3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - arg3 = &temp3; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ProviderSession_getTopic",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_getTopic" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = reinterpret_cast< blpapi_ProviderSession_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Message, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_getTopic" "', argument " "2"" of type '" "blpapi_Message_t const *""'"); - } - arg2 = reinterpret_cast< blpapi_Message_t * >(argp2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_getTopic(arg1,(blpapi_Message const *)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg3), SWIGTYPE_p_blpapi_Topic, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_createTopic(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - blpapi_Message_t *arg2 = (blpapi_Message_t *) 0 ; - blpapi_Topic_t **arg3 = (blpapi_Topic_t **) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - blpapi_Topic_t *temp3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - arg3 = &temp3; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ProviderSession_createTopic",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_createTopic" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = reinterpret_cast< blpapi_ProviderSession_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Message, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_createTopic" "', argument " "2"" of type '" "blpapi_Message_t const *""'"); - } - arg2 = reinterpret_cast< blpapi_Message_t * >(argp2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_createTopic(arg1,(blpapi_Message const *)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg3), SWIGTYPE_p_blpapi_Topic, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_createServiceStatusTopic(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - blpapi_Service_t *arg2 = (blpapi_Service_t *) 0 ; - blpapi_Topic_t **arg3 = (blpapi_Topic_t **) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - blpapi_Topic_t *temp3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - arg3 = &temp3; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ProviderSession_createServiceStatusTopic",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_createServiceStatusTopic" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = reinterpret_cast< blpapi_ProviderSession_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_createServiceStatusTopic" "', argument " "2"" of type '" "blpapi_Service_t const *""'"); - } - arg2 = reinterpret_cast< blpapi_Service_t * >(argp2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_createServiceStatusTopic(arg1,(blpapi_Service const *)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg3), SWIGTYPE_p_blpapi_Topic, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_deleteTopics(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - blpapi_Topic_t **arg2 = (blpapi_Topic_t **) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_ProviderSession_deleteTopics",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_deleteTopics" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = reinterpret_cast< blpapi_ProviderSession_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_p_blpapi_Topic, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_deleteTopics" "', argument " "2"" of type '" "blpapi_Topic_t const **""'"); - } - arg2 = reinterpret_cast< blpapi_Topic_t ** >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_deleteTopics" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_deleteTopics(arg1,(blpapi_Topic const **)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_terminateSubscriptionsOnTopics(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - blpapi_Topic_t **arg2 = (blpapi_Topic_t **) 0 ; - size_t arg3 ; - char *arg4 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - int res4 ; - char *buf4 = 0 ; - int alloc4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_ProviderSession_terminateSubscriptionsOnTopics",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_terminateSubscriptionsOnTopics" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = reinterpret_cast< blpapi_ProviderSession_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_p_blpapi_Topic, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_terminateSubscriptionsOnTopics" "', argument " "2"" of type '" "blpapi_Topic_t const **""'"); - } - arg2 = reinterpret_cast< blpapi_Topic_t ** >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_terminateSubscriptionsOnTopics" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_ProviderSession_terminateSubscriptionsOnTopics" "', argument " "4"" of type '" "char const *""'"); - } - arg4 = reinterpret_cast< char * >(buf4); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_terminateSubscriptionsOnTopics(arg1,(blpapi_Topic const **)arg2,arg3,(char const *)arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc4 == SWIG_NEWOBJ) delete[] buf4; - return resultobj; -fail: - if (alloc4 == SWIG_NEWOBJ) delete[] buf4; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_publish(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - blpapi_Event_t *arg2 = (blpapi_Event_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ProviderSession_publish",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_publish" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = reinterpret_cast< blpapi_ProviderSession_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Event, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_publish" "', argument " "2"" of type '" "blpapi_Event_t *""'"); - } - arg2 = reinterpret_cast< blpapi_Event_t * >(argp2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_publish(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_sendResponse(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - blpapi_Event_t *arg2 = (blpapi_Event_t *) 0 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_ProviderSession_sendResponse",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_sendResponse" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = reinterpret_cast< blpapi_ProviderSession_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Event, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_sendResponse" "', argument " "2"" of type '" "blpapi_Event_t *""'"); - } - arg2 = reinterpret_cast< blpapi_Event_t * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_sendResponse" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_sendResponse(arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_getAbstractSession(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - blpapi_AbstractSession_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ProviderSession_getAbstractSession",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_getAbstractSession" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = reinterpret_cast< blpapi_ProviderSession_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_AbstractSession_t *)blpapi_ProviderSession_getAbstractSession(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ServiceRegistrationOptions_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":blpapi_ServiceRegistrationOptions_create")) SWIG_fail; - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_ServiceRegistrationOptions_t *)blpapi_ServiceRegistrationOptions_create(); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_duplicate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ServiceRegistrationOptions_t *arg1 = (blpapi_ServiceRegistrationOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - blpapi_ServiceRegistrationOptions_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ServiceRegistrationOptions_duplicate",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_duplicate" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t const *""'"); - } - arg1 = reinterpret_cast< blpapi_ServiceRegistrationOptions_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_ServiceRegistrationOptions_t *)blpapi_ServiceRegistrationOptions_duplicate((blpapi_ServiceRegistrationOptions const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ServiceRegistrationOptions_t *arg1 = (blpapi_ServiceRegistrationOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ServiceRegistrationOptions_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_destroy" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_ServiceRegistrationOptions_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_ServiceRegistrationOptions_destroy(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_copy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ServiceRegistrationOptions_t *arg1 = (blpapi_ServiceRegistrationOptions_t *) 0 ; - blpapi_ServiceRegistrationOptions_t *arg2 = (blpapi_ServiceRegistrationOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ServiceRegistrationOptions_copy",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_copy" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_ServiceRegistrationOptions_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ServiceRegistrationOptions_copy" "', argument " "2"" of type '" "blpapi_ServiceRegistrationOptions_t const *""'"); - } - arg2 = reinterpret_cast< blpapi_ServiceRegistrationOptions_t * >(argp2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_ServiceRegistrationOptions_copy(arg1,(blpapi_ServiceRegistrationOptions const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ServiceRegistrationOptions_t *arg1 = (blpapi_ServiceRegistrationOptions_t *) 0 ; - int arg2 ; - int arg3 ; - int arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_ServiceRegistrationOptions_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange" "', argument " "4"" of type '" "int""'"); - } - arg4 = static_cast< int >(val4); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange(arg1,arg2,arg3,arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ServiceRegistrationOptions_t *arg1 = (blpapi_ServiceRegistrationOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_ServiceRegistrationOptions_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_setGroupId(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ServiceRegistrationOptions_t *arg1 = (blpapi_ServiceRegistrationOptions_t *) 0 ; - char *arg2 = (char *) 0 ; - unsigned int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ServiceRegistrationOptions_setGroupId",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_setGroupId" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_ServiceRegistrationOptions_t * >(argp1); - { - arg2 = PyString_AsString(obj1); - arg3 = PyString_Size(obj1); - } - { - if (!arg2) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); - } - } - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_ServiceRegistrationOptions_setGroupId(arg1,(char const *)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_setServicePriority(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ServiceRegistrationOptions_t *arg1 = (blpapi_ServiceRegistrationOptions_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ServiceRegistrationOptions_setServicePriority",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_setServicePriority" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_ServiceRegistrationOptions_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_ServiceRegistrationOptions_setServicePriority" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ServiceRegistrationOptions_setServicePriority(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_setPartsToRegister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ServiceRegistrationOptions_t *arg1 = (blpapi_ServiceRegistrationOptions_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ServiceRegistrationOptions_setPartsToRegister",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_setPartsToRegister" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_ServiceRegistrationOptions_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_ServiceRegistrationOptions_setPartsToRegister" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_ServiceRegistrationOptions_setPartsToRegister(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_getGroupId(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ServiceRegistrationOptions_t *arg1 = (blpapi_ServiceRegistrationOptions_t *) 0 ; - char *arg2 = (char *) 0 ; - int *arg3 = (int *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - char temp2[MAX_GROUP_ID_SIZE] ; - int len2 = MAX_GROUP_ID_SIZE ; - PyObject * obj0 = 0 ; - int result; - - arg2 = temp2; - arg3 = &len2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ServiceRegistrationOptions_getGroupId",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_getGroupId" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_ServiceRegistrationOptions_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ServiceRegistrationOptions_getGroupId(arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtrAndSize(arg2, *arg3)); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_getServicePriority(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ServiceRegistrationOptions_t *arg1 = (blpapi_ServiceRegistrationOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ServiceRegistrationOptions_getServicePriority",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_getServicePriority" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_ServiceRegistrationOptions_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ServiceRegistrationOptions_getServicePriority(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_getPartsToRegister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ServiceRegistrationOptions_t *arg1 = (blpapi_ServiceRegistrationOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ServiceRegistrationOptions_getPartsToRegister",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_getPartsToRegister" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); - } - arg1 = reinterpret_cast< blpapi_ServiceRegistrationOptions_t * >(argp1); - - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ServiceRegistrationOptions_getPartsToRegister(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(std::runtime_error const& error) { - SWIG_exception(SWIG_RuntimeError, error.what()); - } catch(std::exception const& error) { - SWIG_exception(SWIG_UnknownError, error.what()); - } - - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -static PyMethodDef SwigMethods[] = { - { (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL}, - { (char *)"setLoggerCallbackWrapper", _wrap_setLoggerCallbackWrapper, METH_VARARGS, NULL}, - { (char *)"blpapi_Logging_registerCallback", _wrap_blpapi_Logging_registerCallback, METH_VARARGS, NULL}, - { (char *)"blpapi_Logging_logTestMessage", _wrap_blpapi_Logging_logTestMessage, METH_VARARGS, NULL}, - { (char *)"blpapi_DiagnosticsUtil_memoryInfo_wrapper", _wrap_blpapi_DiagnosticsUtil_memoryInfo_wrapper, METH_VARARGS, NULL}, - { (char *)"blpapi_Message_timeReceived_wrapper", _wrap_blpapi_Message_timeReceived_wrapper, METH_VARARGS, NULL}, - { (char *)"blpapi_HighResolutionClock_now_wrapper", _wrap_blpapi_HighResolutionClock_now_wrapper, METH_VARARGS, NULL}, - { (char *)"blpapi_EventDispatcher_stop", _wrap_blpapi_EventDispatcher_stop, METH_VARARGS, NULL}, - { (char *)"blpapi_Service_printHelper", _wrap_blpapi_Service_printHelper, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaElementDefinition_printHelper", _wrap_blpapi_SchemaElementDefinition_printHelper, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaTypeDefinition_printHelper", _wrap_blpapi_SchemaTypeDefinition_printHelper, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_printHelper", _wrap_blpapi_SessionOptions_printHelper, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaTypeDefinition_hasElementDefinition", _wrap_blpapi_SchemaTypeDefinition_hasElementDefinition, METH_VARARGS, NULL}, - { (char *)"blpapi_ConstantList_hasConstant", _wrap_blpapi_ConstantList_hasConstant, METH_VARARGS, NULL}, - { (char *)"blpapi_Service_hasEventDefinition", _wrap_blpapi_Service_hasEventDefinition, METH_VARARGS, NULL}, - { (char *)"blpapi_Service_hasOperation", _wrap_blpapi_Service_hasOperation, METH_VARARGS, NULL}, - { (char *)"blpapi_SubscriptionList_addHelper", _wrap_blpapi_SubscriptionList_addHelper, METH_VARARGS, NULL}, - { (char *)"blpapi_Name_hasName", _wrap_blpapi_Name_hasName, METH_VARARGS, NULL}, - { (char *)"blpapi_TopicList_createFromResolutionList", _wrap_blpapi_TopicList_createFromResolutionList, METH_VARARGS, NULL}, - { (char *)"new_intArray", _wrap_new_intArray, METH_VARARGS, NULL}, - { (char *)"delete_intArray", _wrap_delete_intArray, METH_VARARGS, NULL}, - { (char *)"intArray___getitem__", _wrap_intArray___getitem__, METH_VARARGS, NULL}, - { (char *)"intArray___setitem__", _wrap_intArray___setitem__, METH_VARARGS, NULL}, - { (char *)"intArray_cast", _wrap_intArray_cast, METH_VARARGS, NULL}, - { (char *)"intArray_frompointer", _wrap_intArray_frompointer, METH_VARARGS, NULL}, - { (char *)"intArray_swigregister", intArray_swigregister, METH_VARARGS, NULL}, - { (char *)"new_topicPtrArray", _wrap_new_topicPtrArray, METH_VARARGS, NULL}, - { (char *)"delete_topicPtrArray", _wrap_delete_topicPtrArray, METH_VARARGS, NULL}, - { (char *)"topicPtrArray_getitem", _wrap_topicPtrArray_getitem, METH_VARARGS, NULL}, - { (char *)"topicPtrArray_setitem", _wrap_topicPtrArray_setitem, METH_VARARGS, NULL}, - { (char *)"CorrelationId_t_equals", _wrap_CorrelationId_t_equals, METH_VARARGS, NULL}, - { (char *)"new_CorrelationId", _wrap_new_CorrelationId, METH_VARARGS, (char *)"\n" - "A key used to identify individual subscriptions or requests.\n" - "\n" - "CorrelationId([value[, classId=0]]) constructs a CorrelationId object.\n" - "If 'value' is integer (either int or long) then created CorrelationId will have\n" - "type() == CorrelationId.INT_TYPE. Otherwise it will have\n" - "type() == CorrelationId.OBJECT_TYPE. If no arguments are specified\n" - "then it will have type() == CorrelationId.UNSET_TYPE.\n" - "\n" - "Two CorrelationIds are considered equal if they have the same\n" - "type() and:\n" - "- holds the same (not just equal!) objects in case of\n" - " type() == CorrelationId.OBJECT_TYPE\n" - "- holds equal integers in case of\n" - " type() == CorrelationId.INT_TYPE or\n" - " type() == CorrelationId.AUTOGEN_TYPE\n" - "- True otherwise\n" - " (i.e. in case of type() == CorrelationId.UNSET_TYPE)\n" - "\n" - "It is possible that an user constructed CorrelationId and a\n" - "CorrelationId generated by the API could return the same\n" - "result for value(). However, they will not compare equal because\n" - "they have different type().\n" - "\n" - "CorrelationId objects are passed to many of the Session object\n" - "methods which initiate an asynchronous operations and are\n" - "obtained from Message objects which are delivered as a result\n" - "of those asynchronous operations.\n" - "\n" - "When subscribing or requesting information an application has\n" - "the choice of providing a CorrelationId they construct\n" - "themselves or allowing the session to construct one for\n" - "them. If the application supplies a CorrelationId it must not\n" - "re-use the value contained in it in another CorrelationId\n" - "whilst the original request or subscription is still active.\n" - "\n" - "Class attributes:\n" - " Possible return values for type() method:\n" - " UNSET_TYPE The CorrelationId is unset. That is, it was created by\n" - " the default CorrelationId constructor.\n" - " INT_TYPE The CorrelationId was created from an integer (or long)\n" - " supplied by the user.\n" - " OBJECT_TYPE The CorrelationId was created from an object supplied by\n" - " the user.\n" - " AUTOGEN_TYPE The CorrelationId was created internally by API.\n" - "\n" - " MAX_CLASS_ID The maximum value allowed for classId.\n" - ""}, - { (char *)"delete_CorrelationId", _wrap_delete_CorrelationId, METH_VARARGS, NULL}, - { (char *)"CorrelationId_type", _wrap_CorrelationId_type, METH_VARARGS, (char *)"Return the type of this CorrelationId object (see xxx_TYPE class attributes)"}, - { (char *)"CorrelationId_classId", _wrap_CorrelationId_classId, METH_VARARGS, (char *)"Return the user defined classification of this CorrelationId object"}, - { (char *)"CorrelationId___asObject", _wrap_CorrelationId___asObject, METH_VARARGS, NULL}, - { (char *)"CorrelationId___asInteger", _wrap_CorrelationId___asInteger, METH_VARARGS, NULL}, - { (char *)"CorrelationId___toInteger", _wrap_CorrelationId___toInteger, METH_VARARGS, NULL}, - { (char *)"CorrelationId_swigregister", CorrelationId_swigregister, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_setElementFloat", _wrap_blpapi_Element_setElementFloat, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_setValueFloat", _wrap_blpapi_Element_setValueFloat, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_printHelper", _wrap_blpapi_Element_printHelper, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_name", _wrap_blpapi_Element_name, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_nameString", _wrap_blpapi_Element_nameString, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_definition", _wrap_blpapi_Element_definition, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_datatype", _wrap_blpapi_Element_datatype, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_isComplexType", _wrap_blpapi_Element_isComplexType, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_isArray", _wrap_blpapi_Element_isArray, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_isReadOnly", _wrap_blpapi_Element_isReadOnly, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_numValues", _wrap_blpapi_Element_numValues, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_numElements", _wrap_blpapi_Element_numElements, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_isNullValue", _wrap_blpapi_Element_isNullValue, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_isNull", _wrap_blpapi_Element_isNull, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_getElementAt", _wrap_blpapi_Element_getElementAt, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_getElement", _wrap_blpapi_Element_getElement, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_hasElementEx", _wrap_blpapi_Element_hasElementEx, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_getValueAsBool", _wrap_blpapi_Element_getValueAsBool, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_getValueAsChar", _wrap_blpapi_Element_getValueAsChar, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_getValueAsInt32", _wrap_blpapi_Element_getValueAsInt32, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_getValueAsInt64", _wrap_blpapi_Element_getValueAsInt64, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_getValueAsFloat64", _wrap_blpapi_Element_getValueAsFloat64, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_getValueAsString", _wrap_blpapi_Element_getValueAsString, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_getValueAsDatetime", _wrap_blpapi_Element_getValueAsDatetime, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_getValueAsHighPrecisionDatetime", _wrap_blpapi_Element_getValueAsHighPrecisionDatetime, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_getValueAsElement", _wrap_blpapi_Element_getValueAsElement, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_getValueAsName", _wrap_blpapi_Element_getValueAsName, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_getChoice", _wrap_blpapi_Element_getChoice, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_setValueBool", _wrap_blpapi_Element_setValueBool, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_setValueInt32", _wrap_blpapi_Element_setValueInt32, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_setValueInt64", _wrap_blpapi_Element_setValueInt64, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_setValueString", _wrap_blpapi_Element_setValueString, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_setValueDatetime", _wrap_blpapi_Element_setValueDatetime, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_setValueFromName", _wrap_blpapi_Element_setValueFromName, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_setElementBool", _wrap_blpapi_Element_setElementBool, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_setElementInt32", _wrap_blpapi_Element_setElementInt32, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_setElementInt64", _wrap_blpapi_Element_setElementInt64, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_setElementString", _wrap_blpapi_Element_setElementString, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_setElementDatetime", _wrap_blpapi_Element_setElementDatetime, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_setElementFromName", _wrap_blpapi_Element_setElementFromName, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_appendElement", _wrap_blpapi_Element_appendElement, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_setChoice", _wrap_blpapi_Element_setChoice, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_setValueFloat", _wrap_blpapi_EventFormatter_setValueFloat, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_appendValueFloat", _wrap_blpapi_EventFormatter_appendValueFloat, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_create", _wrap_blpapi_EventFormatter_create, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_destroy", _wrap_blpapi_EventFormatter_destroy, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_appendMessage", _wrap_blpapi_EventFormatter_appendMessage, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_appendMessageSeq", _wrap_blpapi_EventFormatter_appendMessageSeq, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_appendResponse", _wrap_blpapi_EventFormatter_appendResponse, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_appendRecapMessage", _wrap_blpapi_EventFormatter_appendRecapMessage, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_appendRecapMessageSeq", _wrap_blpapi_EventFormatter_appendRecapMessageSeq, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_appendFragmentedRecapMessage", _wrap_blpapi_EventFormatter_appendFragmentedRecapMessage, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_appendFragmentedRecapMessageSeq", _wrap_blpapi_EventFormatter_appendFragmentedRecapMessageSeq, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_setValueBool", _wrap_blpapi_EventFormatter_setValueBool, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_setValueChar", _wrap_blpapi_EventFormatter_setValueChar, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_setValueInt32", _wrap_blpapi_EventFormatter_setValueInt32, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_setValueInt64", _wrap_blpapi_EventFormatter_setValueInt64, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_setValueDatetime", _wrap_blpapi_EventFormatter_setValueDatetime, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_setValueString", _wrap_blpapi_EventFormatter_setValueString, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_setValueFromName", _wrap_blpapi_EventFormatter_setValueFromName, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_setValueNull", _wrap_blpapi_EventFormatter_setValueNull, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_pushElement", _wrap_blpapi_EventFormatter_pushElement, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_popElement", _wrap_blpapi_EventFormatter_popElement, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_appendValueBool", _wrap_blpapi_EventFormatter_appendValueBool, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_appendValueChar", _wrap_blpapi_EventFormatter_appendValueChar, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_appendValueInt32", _wrap_blpapi_EventFormatter_appendValueInt32, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_appendValueInt64", _wrap_blpapi_EventFormatter_appendValueInt64, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_appendValueDatetime", _wrap_blpapi_EventFormatter_appendValueDatetime, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_appendValueString", _wrap_blpapi_EventFormatter_appendValueString, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_appendValueFromName", _wrap_blpapi_EventFormatter_appendValueFromName, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_appendElement", _wrap_blpapi_EventFormatter_appendElement, METH_VARARGS, NULL}, - { (char *)"Session_createHelper", _wrap_Session_createHelper, METH_VARARGS, NULL}, - { (char *)"Session_destroyHelper", _wrap_Session_destroyHelper, METH_VARARGS, NULL}, - { (char *)"blpapi_EventDispatcher_create", _wrap_blpapi_EventDispatcher_create, METH_VARARGS, NULL}, - { (char *)"blpapi_EventDispatcher_destroy", _wrap_blpapi_EventDispatcher_destroy, METH_VARARGS, NULL}, - { (char *)"blpapi_EventDispatcher_start", _wrap_blpapi_EventDispatcher_start, METH_VARARGS, NULL}, - { (char *)"ProviderSession_createHelper", _wrap_ProviderSession_createHelper, METH_VARARGS, NULL}, - { (char *)"ProviderSession_destroyHelper", _wrap_ProviderSession_destroyHelper, METH_VARARGS, NULL}, - { (char *)"ProviderSession_terminateSubscriptionsOnTopic", _wrap_ProviderSession_terminateSubscriptionsOnTopic, METH_VARARGS, NULL}, - { (char *)"ProviderSession_flushPublishedEvents", _wrap_ProviderSession_flushPublishedEvents, METH_VARARGS, NULL}, - { (char *)"blpapi_getLastErrorDescription", _wrap_blpapi_getLastErrorDescription, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_create", _wrap_blpapi_SessionOptions_create, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_destroy", _wrap_blpapi_SessionOptions_destroy, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setServerHost", _wrap_blpapi_SessionOptions_setServerHost, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setServerPort", _wrap_blpapi_SessionOptions_setServerPort, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setServerAddress", _wrap_blpapi_SessionOptions_setServerAddress, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_removeServerAddress", _wrap_blpapi_SessionOptions_removeServerAddress, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setConnectTimeout", _wrap_blpapi_SessionOptions_setConnectTimeout, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setDefaultServices", _wrap_blpapi_SessionOptions_setDefaultServices, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setDefaultSubscriptionService", _wrap_blpapi_SessionOptions_setDefaultSubscriptionService, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setDefaultTopicPrefix", _wrap_blpapi_SessionOptions_setDefaultTopicPrefix, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg", _wrap_blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setClientMode", _wrap_blpapi_SessionOptions_setClientMode, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setMaxPendingRequests", _wrap_blpapi_SessionOptions_setMaxPendingRequests, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setAutoRestartOnDisconnection", _wrap_blpapi_SessionOptions_setAutoRestartOnDisconnection, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setAuthenticationOptions", _wrap_blpapi_SessionOptions_setAuthenticationOptions, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setNumStartAttempts", _wrap_blpapi_SessionOptions_setNumStartAttempts, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setMaxEventQueueSize", _wrap_blpapi_SessionOptions_setMaxEventQueueSize, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark", _wrap_blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark", _wrap_blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setDefaultKeepAliveInactivityTime", _wrap_blpapi_SessionOptions_setDefaultKeepAliveInactivityTime, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout", _wrap_blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setKeepAliveEnabled", _wrap_blpapi_SessionOptions_setKeepAliveEnabled, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes", _wrap_blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setServiceCheckTimeout", _wrap_blpapi_SessionOptions_setServiceCheckTimeout, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setServiceDownloadTimeout", _wrap_blpapi_SessionOptions_setServiceDownloadTimeout, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setTlsOptions", _wrap_blpapi_SessionOptions_setTlsOptions, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setFlushPublishedEventsTimeout", _wrap_blpapi_SessionOptions_setFlushPublishedEventsTimeout, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_serverHost", _wrap_blpapi_SessionOptions_serverHost, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_serverPort", _wrap_blpapi_SessionOptions_serverPort, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_numServerAddresses", _wrap_blpapi_SessionOptions_numServerAddresses, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_getServerAddress", _wrap_blpapi_SessionOptions_getServerAddress, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_connectTimeout", _wrap_blpapi_SessionOptions_connectTimeout, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_defaultServices", _wrap_blpapi_SessionOptions_defaultServices, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_defaultSubscriptionService", _wrap_blpapi_SessionOptions_defaultSubscriptionService, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_defaultTopicPrefix", _wrap_blpapi_SessionOptions_defaultTopicPrefix, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg", _wrap_blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_clientMode", _wrap_blpapi_SessionOptions_clientMode, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_maxPendingRequests", _wrap_blpapi_SessionOptions_maxPendingRequests, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_autoRestartOnDisconnection", _wrap_blpapi_SessionOptions_autoRestartOnDisconnection, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_authenticationOptions", _wrap_blpapi_SessionOptions_authenticationOptions, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_numStartAttempts", _wrap_blpapi_SessionOptions_numStartAttempts, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_maxEventQueueSize", _wrap_blpapi_SessionOptions_maxEventQueueSize, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_slowConsumerWarningHiWaterMark", _wrap_blpapi_SessionOptions_slowConsumerWarningHiWaterMark, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_slowConsumerWarningLoWaterMark", _wrap_blpapi_SessionOptions_slowConsumerWarningLoWaterMark, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_defaultKeepAliveInactivityTime", _wrap_blpapi_SessionOptions_defaultKeepAliveInactivityTime, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_defaultKeepAliveResponseTimeout", _wrap_blpapi_SessionOptions_defaultKeepAliveResponseTimeout, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_keepAliveEnabled", _wrap_blpapi_SessionOptions_keepAliveEnabled, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_recordSubscriptionDataReceiveTimes", _wrap_blpapi_SessionOptions_recordSubscriptionDataReceiveTimes, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_serviceCheckTimeout", _wrap_blpapi_SessionOptions_serviceCheckTimeout, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_serviceDownloadTimeout", _wrap_blpapi_SessionOptions_serviceDownloadTimeout, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_flushPublishedEventsTimeout", _wrap_blpapi_SessionOptions_flushPublishedEventsTimeout, METH_VARARGS, NULL}, - { (char *)"blpapi_TlsOptions_destroy", _wrap_blpapi_TlsOptions_destroy, METH_VARARGS, NULL}, - { (char *)"blpapi_TlsOptions_createFromFiles", _wrap_blpapi_TlsOptions_createFromFiles, METH_VARARGS, NULL}, - { (char *)"blpapi_TlsOptions_createFromBlobs", _wrap_blpapi_TlsOptions_createFromBlobs, METH_VARARGS, NULL}, - { (char *)"blpapi_TlsOptions_setTlsHandshakeTimeoutMs", _wrap_blpapi_TlsOptions_setTlsHandshakeTimeoutMs, METH_VARARGS, NULL}, - { (char *)"blpapi_TlsOptions_setCrlFetchTimeoutMs", _wrap_blpapi_TlsOptions_setCrlFetchTimeoutMs, METH_VARARGS, NULL}, - { (char *)"blpapi_Name_create", _wrap_blpapi_Name_create, METH_VARARGS, NULL}, - { (char *)"blpapi_Name_destroy", _wrap_blpapi_Name_destroy, METH_VARARGS, NULL}, - { (char *)"blpapi_Name_equalsStr", _wrap_blpapi_Name_equalsStr, METH_VARARGS, NULL}, - { (char *)"blpapi_Name_string", _wrap_blpapi_Name_string, METH_VARARGS, NULL}, - { (char *)"blpapi_Name_length", _wrap_blpapi_Name_length, METH_VARARGS, NULL}, - { (char *)"blpapi_Name_findName", _wrap_blpapi_Name_findName, METH_VARARGS, NULL}, - { (char *)"blpapi_SubscriptionList_create", _wrap_blpapi_SubscriptionList_create, METH_VARARGS, NULL}, - { (char *)"blpapi_SubscriptionList_destroy", _wrap_blpapi_SubscriptionList_destroy, METH_VARARGS, NULL}, - { (char *)"blpapi_SubscriptionList_addResolved", _wrap_blpapi_SubscriptionList_addResolved, METH_VARARGS, NULL}, - { (char *)"blpapi_SubscriptionList_clear", _wrap_blpapi_SubscriptionList_clear, METH_VARARGS, NULL}, - { (char *)"blpapi_SubscriptionList_append", _wrap_blpapi_SubscriptionList_append, METH_VARARGS, NULL}, - { (char *)"blpapi_SubscriptionList_size", _wrap_blpapi_SubscriptionList_size, METH_VARARGS, NULL}, - { (char *)"blpapi_SubscriptionList_correlationIdAt", _wrap_blpapi_SubscriptionList_correlationIdAt, METH_VARARGS, NULL}, - { (char *)"blpapi_SubscriptionList_topicStringAt", _wrap_blpapi_SubscriptionList_topicStringAt, METH_VARARGS, NULL}, - { (char *)"blpapi_SubscriptionList_isResolvedAt", _wrap_blpapi_SubscriptionList_isResolvedAt, METH_VARARGS, NULL}, - { (char *)"blpapi_Datetime_tag_parts_set", _wrap_blpapi_Datetime_tag_parts_set, METH_VARARGS, NULL}, - { (char *)"blpapi_Datetime_tag_parts_get", _wrap_blpapi_Datetime_tag_parts_get, METH_VARARGS, NULL}, - { (char *)"blpapi_Datetime_tag_hours_set", _wrap_blpapi_Datetime_tag_hours_set, METH_VARARGS, NULL}, - { (char *)"blpapi_Datetime_tag_hours_get", _wrap_blpapi_Datetime_tag_hours_get, METH_VARARGS, NULL}, - { (char *)"blpapi_Datetime_tag_minutes_set", _wrap_blpapi_Datetime_tag_minutes_set, METH_VARARGS, NULL}, - { (char *)"blpapi_Datetime_tag_minutes_get", _wrap_blpapi_Datetime_tag_minutes_get, METH_VARARGS, NULL}, - { (char *)"blpapi_Datetime_tag_seconds_set", _wrap_blpapi_Datetime_tag_seconds_set, METH_VARARGS, NULL}, - { (char *)"blpapi_Datetime_tag_seconds_get", _wrap_blpapi_Datetime_tag_seconds_get, METH_VARARGS, NULL}, - { (char *)"blpapi_Datetime_tag_milliSeconds_set", _wrap_blpapi_Datetime_tag_milliSeconds_set, METH_VARARGS, NULL}, - { (char *)"blpapi_Datetime_tag_milliSeconds_get", _wrap_blpapi_Datetime_tag_milliSeconds_get, METH_VARARGS, NULL}, - { (char *)"blpapi_Datetime_tag_month_set", _wrap_blpapi_Datetime_tag_month_set, METH_VARARGS, NULL}, - { (char *)"blpapi_Datetime_tag_month_get", _wrap_blpapi_Datetime_tag_month_get, METH_VARARGS, NULL}, - { (char *)"blpapi_Datetime_tag_day_set", _wrap_blpapi_Datetime_tag_day_set, METH_VARARGS, NULL}, - { (char *)"blpapi_Datetime_tag_day_get", _wrap_blpapi_Datetime_tag_day_get, METH_VARARGS, NULL}, - { (char *)"blpapi_Datetime_tag_year_set", _wrap_blpapi_Datetime_tag_year_set, METH_VARARGS, NULL}, - { (char *)"blpapi_Datetime_tag_year_get", _wrap_blpapi_Datetime_tag_year_get, METH_VARARGS, NULL}, - { (char *)"blpapi_Datetime_tag_offset_set", _wrap_blpapi_Datetime_tag_offset_set, METH_VARARGS, NULL}, - { (char *)"blpapi_Datetime_tag_offset_get", _wrap_blpapi_Datetime_tag_offset_get, METH_VARARGS, NULL}, - { (char *)"new_blpapi_Datetime_tag", _wrap_new_blpapi_Datetime_tag, METH_VARARGS, NULL}, - { (char *)"delete_blpapi_Datetime_tag", _wrap_delete_blpapi_Datetime_tag, METH_VARARGS, NULL}, - { (char *)"blpapi_Datetime_tag_swigregister", blpapi_Datetime_tag_swigregister, METH_VARARGS, NULL}, - { (char *)"blpapi_HighPrecisionDatetime_tag_datetime_set", _wrap_blpapi_HighPrecisionDatetime_tag_datetime_set, METH_VARARGS, NULL}, - { (char *)"blpapi_HighPrecisionDatetime_tag_datetime_get", _wrap_blpapi_HighPrecisionDatetime_tag_datetime_get, METH_VARARGS, NULL}, - { (char *)"blpapi_HighPrecisionDatetime_tag_picoseconds_set", _wrap_blpapi_HighPrecisionDatetime_tag_picoseconds_set, METH_VARARGS, NULL}, - { (char *)"blpapi_HighPrecisionDatetime_tag_picoseconds_get", _wrap_blpapi_HighPrecisionDatetime_tag_picoseconds_get, METH_VARARGS, NULL}, - { (char *)"new_blpapi_HighPrecisionDatetime_tag", _wrap_new_blpapi_HighPrecisionDatetime_tag, METH_VARARGS, NULL}, - { (char *)"delete_blpapi_HighPrecisionDatetime_tag", _wrap_delete_blpapi_HighPrecisionDatetime_tag, METH_VARARGS, NULL}, - { (char *)"blpapi_HighPrecisionDatetime_tag_swigregister", blpapi_HighPrecisionDatetime_tag_swigregister, METH_VARARGS, NULL}, - { (char *)"blpapi_HighPrecisionDatetime_compare", _wrap_blpapi_HighPrecisionDatetime_compare, METH_VARARGS, NULL}, - { (char *)"blpapi_HighPrecisionDatetime_print", _wrap_blpapi_HighPrecisionDatetime_print, METH_VARARGS, NULL}, - { (char *)"blpapi_HighPrecisionDatetime_fromTimePoint", _wrap_blpapi_HighPrecisionDatetime_fromTimePoint, METH_VARARGS, NULL}, - { (char *)"blpapi_Constant_name", _wrap_blpapi_Constant_name, METH_VARARGS, NULL}, - { (char *)"blpapi_Constant_description", _wrap_blpapi_Constant_description, METH_VARARGS, NULL}, - { (char *)"blpapi_Constant_status", _wrap_blpapi_Constant_status, METH_VARARGS, NULL}, - { (char *)"blpapi_Constant_datatype", _wrap_blpapi_Constant_datatype, METH_VARARGS, NULL}, - { (char *)"blpapi_Constant_getValueAsInt64", _wrap_blpapi_Constant_getValueAsInt64, METH_VARARGS, NULL}, - { (char *)"blpapi_Constant_getValueAsFloat64", _wrap_blpapi_Constant_getValueAsFloat64, METH_VARARGS, NULL}, - { (char *)"blpapi_Constant_getValueAsDatetime", _wrap_blpapi_Constant_getValueAsDatetime, METH_VARARGS, NULL}, - { (char *)"blpapi_Constant_getValueAsString", _wrap_blpapi_Constant_getValueAsString, METH_VARARGS, NULL}, - { (char *)"blpapi_ConstantList_name", _wrap_blpapi_ConstantList_name, METH_VARARGS, NULL}, - { (char *)"blpapi_ConstantList_description", _wrap_blpapi_ConstantList_description, METH_VARARGS, NULL}, - { (char *)"blpapi_ConstantList_numConstants", _wrap_blpapi_ConstantList_numConstants, METH_VARARGS, NULL}, - { (char *)"blpapi_ConstantList_datatype", _wrap_blpapi_ConstantList_datatype, METH_VARARGS, NULL}, - { (char *)"blpapi_ConstantList_status", _wrap_blpapi_ConstantList_status, METH_VARARGS, NULL}, - { (char *)"blpapi_ConstantList_getConstant", _wrap_blpapi_ConstantList_getConstant, METH_VARARGS, NULL}, - { (char *)"blpapi_ConstantList_getConstantAt", _wrap_blpapi_ConstantList_getConstantAt, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaElementDefinition_name", _wrap_blpapi_SchemaElementDefinition_name, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaElementDefinition_description", _wrap_blpapi_SchemaElementDefinition_description, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaElementDefinition_status", _wrap_blpapi_SchemaElementDefinition_status, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaElementDefinition_type", _wrap_blpapi_SchemaElementDefinition_type, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaElementDefinition_numAlternateNames", _wrap_blpapi_SchemaElementDefinition_numAlternateNames, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaElementDefinition_getAlternateName", _wrap_blpapi_SchemaElementDefinition_getAlternateName, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaElementDefinition_minValues", _wrap_blpapi_SchemaElementDefinition_minValues, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaElementDefinition_maxValues", _wrap_blpapi_SchemaElementDefinition_maxValues, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaTypeDefinition_name", _wrap_blpapi_SchemaTypeDefinition_name, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaTypeDefinition_description", _wrap_blpapi_SchemaTypeDefinition_description, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaTypeDefinition_status", _wrap_blpapi_SchemaTypeDefinition_status, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaTypeDefinition_datatype", _wrap_blpapi_SchemaTypeDefinition_datatype, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaTypeDefinition_isComplexType", _wrap_blpapi_SchemaTypeDefinition_isComplexType, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaTypeDefinition_isSimpleType", _wrap_blpapi_SchemaTypeDefinition_isSimpleType, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaTypeDefinition_isEnumerationType", _wrap_blpapi_SchemaTypeDefinition_isEnumerationType, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaTypeDefinition_numElementDefinitions", _wrap_blpapi_SchemaTypeDefinition_numElementDefinitions, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaTypeDefinition_getElementDefinition", _wrap_blpapi_SchemaTypeDefinition_getElementDefinition, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaTypeDefinition_getElementDefinitionAt", _wrap_blpapi_SchemaTypeDefinition_getElementDefinitionAt, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaTypeDefinition_enumeration", _wrap_blpapi_SchemaTypeDefinition_enumeration, METH_VARARGS, NULL}, - { (char *)"blpapi_Request_destroy", _wrap_blpapi_Request_destroy, METH_VARARGS, NULL}, - { (char *)"blpapi_Request_elements", _wrap_blpapi_Request_elements, METH_VARARGS, NULL}, - { (char *)"blpapi_Request_setPreferredRoute", _wrap_blpapi_Request_setPreferredRoute, METH_VARARGS, NULL}, - { (char *)"blpapi_RequestTemplate_release", _wrap_blpapi_RequestTemplate_release, METH_VARARGS, NULL}, - { (char *)"blpapi_Operation_name", _wrap_blpapi_Operation_name, METH_VARARGS, NULL}, - { (char *)"blpapi_Operation_description", _wrap_blpapi_Operation_description, METH_VARARGS, NULL}, - { (char *)"blpapi_Operation_requestDefinition", _wrap_blpapi_Operation_requestDefinition, METH_VARARGS, NULL}, - { (char *)"blpapi_Operation_numResponseDefinitions", _wrap_blpapi_Operation_numResponseDefinitions, METH_VARARGS, NULL}, - { (char *)"blpapi_Operation_responseDefinition", _wrap_blpapi_Operation_responseDefinition, METH_VARARGS, NULL}, - { (char *)"blpapi_Service_name", _wrap_blpapi_Service_name, METH_VARARGS, NULL}, - { (char *)"blpapi_Service_description", _wrap_blpapi_Service_description, METH_VARARGS, NULL}, - { (char *)"blpapi_Service_numOperations", _wrap_blpapi_Service_numOperations, METH_VARARGS, NULL}, - { (char *)"blpapi_Service_numEventDefinitions", _wrap_blpapi_Service_numEventDefinitions, METH_VARARGS, NULL}, - { (char *)"blpapi_Service_addRef", _wrap_blpapi_Service_addRef, METH_VARARGS, NULL}, - { (char *)"blpapi_Service_release", _wrap_blpapi_Service_release, METH_VARARGS, NULL}, - { (char *)"blpapi_Service_authorizationServiceName", _wrap_blpapi_Service_authorizationServiceName, METH_VARARGS, NULL}, - { (char *)"blpapi_Service_getOperation", _wrap_blpapi_Service_getOperation, METH_VARARGS, NULL}, - { (char *)"blpapi_Service_getOperationAt", _wrap_blpapi_Service_getOperationAt, METH_VARARGS, NULL}, - { (char *)"blpapi_Service_getEventDefinition", _wrap_blpapi_Service_getEventDefinition, METH_VARARGS, NULL}, - { (char *)"blpapi_Service_getEventDefinitionAt", _wrap_blpapi_Service_getEventDefinitionAt, METH_VARARGS, NULL}, - { (char *)"blpapi_Service_createRequest", _wrap_blpapi_Service_createRequest, METH_VARARGS, NULL}, - { (char *)"blpapi_Service_createAuthorizationRequest", _wrap_blpapi_Service_createAuthorizationRequest, METH_VARARGS, NULL}, - { (char *)"blpapi_Service_createPublishEvent", _wrap_blpapi_Service_createPublishEvent, METH_VARARGS, NULL}, - { (char *)"blpapi_Service_createAdminEvent", _wrap_blpapi_Service_createAdminEvent, METH_VARARGS, NULL}, - { (char *)"blpapi_Service_createResponseEvent", _wrap_blpapi_Service_createResponseEvent, METH_VARARGS, NULL}, - { (char *)"blpapi_Message_messageType", _wrap_blpapi_Message_messageType, METH_VARARGS, NULL}, - { (char *)"blpapi_Message_topicName", _wrap_blpapi_Message_topicName, METH_VARARGS, NULL}, - { (char *)"blpapi_Message_service", _wrap_blpapi_Message_service, METH_VARARGS, NULL}, - { (char *)"blpapi_Message_numCorrelationIds", _wrap_blpapi_Message_numCorrelationIds, METH_VARARGS, NULL}, - { (char *)"blpapi_Message_correlationId", _wrap_blpapi_Message_correlationId, METH_VARARGS, NULL}, - { (char *)"blpapi_Message_elements", _wrap_blpapi_Message_elements, METH_VARARGS, NULL}, - { (char *)"blpapi_Message_fragmentType", _wrap_blpapi_Message_fragmentType, METH_VARARGS, NULL}, - { (char *)"blpapi_Message_recapType", _wrap_blpapi_Message_recapType, METH_VARARGS, NULL}, - { (char *)"blpapi_Message_print", _wrap_blpapi_Message_print, METH_VARARGS, NULL}, - { (char *)"blpapi_Message_addRef", _wrap_blpapi_Message_addRef, METH_VARARGS, NULL}, - { (char *)"blpapi_Message_release", _wrap_blpapi_Message_release, METH_VARARGS, NULL}, - { (char *)"blpapi_Message_timeReceived", _wrap_blpapi_Message_timeReceived, METH_VARARGS, NULL}, - { (char *)"blpapi_Event_eventType", _wrap_blpapi_Event_eventType, METH_VARARGS, NULL}, - { (char *)"blpapi_Event_release", _wrap_blpapi_Event_release, METH_VARARGS, NULL}, - { (char *)"blpapi_EventQueue_create", _wrap_blpapi_EventQueue_create, METH_VARARGS, NULL}, - { (char *)"blpapi_EventQueue_destroy", _wrap_blpapi_EventQueue_destroy, METH_VARARGS, NULL}, - { (char *)"blpapi_EventQueue_nextEvent", _wrap_blpapi_EventQueue_nextEvent, METH_VARARGS, NULL}, - { (char *)"blpapi_EventQueue_purge", _wrap_blpapi_EventQueue_purge, METH_VARARGS, NULL}, - { (char *)"blpapi_EventQueue_tryNextEvent", _wrap_blpapi_EventQueue_tryNextEvent, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageIterator_create", _wrap_blpapi_MessageIterator_create, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageIterator_destroy", _wrap_blpapi_MessageIterator_destroy, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageIterator_next", _wrap_blpapi_MessageIterator_next, METH_VARARGS, NULL}, - { (char *)"blpapi_Identity_release", _wrap_blpapi_Identity_release, METH_VARARGS, NULL}, - { (char *)"blpapi_Identity_addRef", _wrap_blpapi_Identity_addRef, METH_VARARGS, NULL}, - { (char *)"blpapi_Identity_hasEntitlements", _wrap_blpapi_Identity_hasEntitlements, METH_VARARGS, NULL}, - { (char *)"blpapi_Identity_isAuthorized", _wrap_blpapi_Identity_isAuthorized, METH_VARARGS, NULL}, - { (char *)"blpapi_Identity_getSeatType", _wrap_blpapi_Identity_getSeatType, METH_VARARGS, NULL}, - { (char *)"blpapi_AbstractSession_cancel", _wrap_blpapi_AbstractSession_cancel, METH_VARARGS, NULL}, - { (char *)"blpapi_AbstractSession_sendAuthorizationRequest", _wrap_blpapi_AbstractSession_sendAuthorizationRequest, METH_VARARGS, NULL}, - { (char *)"blpapi_AbstractSession_openService", _wrap_blpapi_AbstractSession_openService, METH_VARARGS, NULL}, - { (char *)"blpapi_AbstractSession_openServiceAsync", _wrap_blpapi_AbstractSession_openServiceAsync, METH_VARARGS, NULL}, - { (char *)"blpapi_AbstractSession_generateToken", _wrap_blpapi_AbstractSession_generateToken, METH_VARARGS, NULL}, - { (char *)"blpapi_AbstractSession_generateManualToken", _wrap_blpapi_AbstractSession_generateManualToken, METH_VARARGS, NULL}, - { (char *)"blpapi_AbstractSession_getService", _wrap_blpapi_AbstractSession_getService, METH_VARARGS, NULL}, - { (char *)"blpapi_AbstractSession_createIdentity", _wrap_blpapi_AbstractSession_createIdentity, METH_VARARGS, NULL}, - { (char *)"blpapi_Session_start", _wrap_blpapi_Session_start, METH_VARARGS, NULL}, - { (char *)"blpapi_Session_startAsync", _wrap_blpapi_Session_startAsync, METH_VARARGS, NULL}, - { (char *)"blpapi_Session_stop", _wrap_blpapi_Session_stop, METH_VARARGS, NULL}, - { (char *)"blpapi_Session_stopAsync", _wrap_blpapi_Session_stopAsync, METH_VARARGS, NULL}, - { (char *)"blpapi_Session_nextEvent", _wrap_blpapi_Session_nextEvent, METH_VARARGS, NULL}, - { (char *)"blpapi_Session_tryNextEvent", _wrap_blpapi_Session_tryNextEvent, METH_VARARGS, NULL}, - { (char *)"blpapi_Session_subscribe", _wrap_blpapi_Session_subscribe, METH_VARARGS, NULL}, - { (char *)"blpapi_Session_resubscribe", _wrap_blpapi_Session_resubscribe, METH_VARARGS, NULL}, - { (char *)"blpapi_Session_resubscribeWithId", _wrap_blpapi_Session_resubscribeWithId, METH_VARARGS, NULL}, - { (char *)"blpapi_Session_unsubscribe", _wrap_blpapi_Session_unsubscribe, METH_VARARGS, NULL}, - { (char *)"blpapi_Session_setStatusCorrelationId", _wrap_blpapi_Session_setStatusCorrelationId, METH_VARARGS, NULL}, - { (char *)"blpapi_Session_sendRequest", _wrap_blpapi_Session_sendRequest, METH_VARARGS, NULL}, - { (char *)"blpapi_Session_sendRequestTemplate", _wrap_blpapi_Session_sendRequestTemplate, METH_VARARGS, NULL}, - { (char *)"blpapi_Session_createSnapshotRequestTemplate", _wrap_blpapi_Session_createSnapshotRequestTemplate, METH_VARARGS, NULL}, - { (char *)"blpapi_Session_getAbstractSession", _wrap_blpapi_Session_getAbstractSession, METH_VARARGS, NULL}, - { (char *)"blpapi_ResolutionList_extractAttributeFromResolutionSuccess", _wrap_blpapi_ResolutionList_extractAttributeFromResolutionSuccess, METH_VARARGS, NULL}, - { (char *)"blpapi_ResolutionList_create", _wrap_blpapi_ResolutionList_create, METH_VARARGS, NULL}, - { (char *)"blpapi_ResolutionList_destroy", _wrap_blpapi_ResolutionList_destroy, METH_VARARGS, NULL}, - { (char *)"blpapi_ResolutionList_add", _wrap_blpapi_ResolutionList_add, METH_VARARGS, NULL}, - { (char *)"blpapi_ResolutionList_addFromMessage", _wrap_blpapi_ResolutionList_addFromMessage, METH_VARARGS, NULL}, - { (char *)"blpapi_ResolutionList_addAttribute", _wrap_blpapi_ResolutionList_addAttribute, METH_VARARGS, NULL}, - { (char *)"blpapi_ResolutionList_correlationIdAt", _wrap_blpapi_ResolutionList_correlationIdAt, METH_VARARGS, NULL}, - { (char *)"blpapi_ResolutionList_topicString", _wrap_blpapi_ResolutionList_topicString, METH_VARARGS, NULL}, - { (char *)"blpapi_ResolutionList_topicStringAt", _wrap_blpapi_ResolutionList_topicStringAt, METH_VARARGS, NULL}, - { (char *)"blpapi_ResolutionList_status", _wrap_blpapi_ResolutionList_status, METH_VARARGS, NULL}, - { (char *)"blpapi_ResolutionList_statusAt", _wrap_blpapi_ResolutionList_statusAt, METH_VARARGS, NULL}, - { (char *)"blpapi_ResolutionList_attribute", _wrap_blpapi_ResolutionList_attribute, METH_VARARGS, NULL}, - { (char *)"blpapi_ResolutionList_attributeAt", _wrap_blpapi_ResolutionList_attributeAt, METH_VARARGS, NULL}, - { (char *)"blpapi_ResolutionList_message", _wrap_blpapi_ResolutionList_message, METH_VARARGS, NULL}, - { (char *)"blpapi_ResolutionList_messageAt", _wrap_blpapi_ResolutionList_messageAt, METH_VARARGS, NULL}, - { (char *)"blpapi_ResolutionList_size", _wrap_blpapi_ResolutionList_size, METH_VARARGS, NULL}, - { (char *)"blpapi_Topic_create", _wrap_blpapi_Topic_create, METH_VARARGS, NULL}, - { (char *)"blpapi_Topic_destroy", _wrap_blpapi_Topic_destroy, METH_VARARGS, NULL}, - { (char *)"blpapi_Topic_compare", _wrap_blpapi_Topic_compare, METH_VARARGS, NULL}, - { (char *)"blpapi_Topic_service", _wrap_blpapi_Topic_service, METH_VARARGS, NULL}, - { (char *)"blpapi_Topic_isActive", _wrap_blpapi_Topic_isActive, METH_VARARGS, NULL}, - { (char *)"blpapi_TopicList_create", _wrap_blpapi_TopicList_create, METH_VARARGS, NULL}, - { (char *)"blpapi_TopicList_destroy", _wrap_blpapi_TopicList_destroy, METH_VARARGS, NULL}, - { (char *)"blpapi_TopicList_add", _wrap_blpapi_TopicList_add, METH_VARARGS, NULL}, - { (char *)"blpapi_TopicList_addFromMessage", _wrap_blpapi_TopicList_addFromMessage, METH_VARARGS, NULL}, - { (char *)"blpapi_TopicList_correlationIdAt", _wrap_blpapi_TopicList_correlationIdAt, METH_VARARGS, NULL}, - { (char *)"blpapi_TopicList_topicString", _wrap_blpapi_TopicList_topicString, METH_VARARGS, NULL}, - { (char *)"blpapi_TopicList_topicStringAt", _wrap_blpapi_TopicList_topicStringAt, METH_VARARGS, NULL}, - { (char *)"blpapi_TopicList_status", _wrap_blpapi_TopicList_status, METH_VARARGS, NULL}, - { (char *)"blpapi_TopicList_statusAt", _wrap_blpapi_TopicList_statusAt, METH_VARARGS, NULL}, - { (char *)"blpapi_TopicList_message", _wrap_blpapi_TopicList_message, METH_VARARGS, NULL}, - { (char *)"blpapi_TopicList_messageAt", _wrap_blpapi_TopicList_messageAt, METH_VARARGS, NULL}, - { (char *)"blpapi_TopicList_size", _wrap_blpapi_TopicList_size, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_create", _wrap_blpapi_ProviderSession_create, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_destroy", _wrap_blpapi_ProviderSession_destroy, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_start", _wrap_blpapi_ProviderSession_start, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_startAsync", _wrap_blpapi_ProviderSession_startAsync, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_stop", _wrap_blpapi_ProviderSession_stop, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_stopAsync", _wrap_blpapi_ProviderSession_stopAsync, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_nextEvent", _wrap_blpapi_ProviderSession_nextEvent, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_tryNextEvent", _wrap_blpapi_ProviderSession_tryNextEvent, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_registerService", _wrap_blpapi_ProviderSession_registerService, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_activateSubServiceCodeRange", _wrap_blpapi_ProviderSession_activateSubServiceCodeRange, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_deactivateSubServiceCodeRange", _wrap_blpapi_ProviderSession_deactivateSubServiceCodeRange, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_registerServiceAsync", _wrap_blpapi_ProviderSession_registerServiceAsync, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_deregisterService", _wrap_blpapi_ProviderSession_deregisterService, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_resolve", _wrap_blpapi_ProviderSession_resolve, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_resolveAsync", _wrap_blpapi_ProviderSession_resolveAsync, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_createTopics", _wrap_blpapi_ProviderSession_createTopics, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_createTopicsAsync", _wrap_blpapi_ProviderSession_createTopicsAsync, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_getTopic", _wrap_blpapi_ProviderSession_getTopic, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_createTopic", _wrap_blpapi_ProviderSession_createTopic, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_createServiceStatusTopic", _wrap_blpapi_ProviderSession_createServiceStatusTopic, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_deleteTopics", _wrap_blpapi_ProviderSession_deleteTopics, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_terminateSubscriptionsOnTopics", _wrap_blpapi_ProviderSession_terminateSubscriptionsOnTopics, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_publish", _wrap_blpapi_ProviderSession_publish, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_sendResponse", _wrap_blpapi_ProviderSession_sendResponse, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_getAbstractSession", _wrap_blpapi_ProviderSession_getAbstractSession, METH_VARARGS, NULL}, - { (char *)"blpapi_ServiceRegistrationOptions_create", _wrap_blpapi_ServiceRegistrationOptions_create, METH_VARARGS, NULL}, - { (char *)"blpapi_ServiceRegistrationOptions_duplicate", _wrap_blpapi_ServiceRegistrationOptions_duplicate, METH_VARARGS, NULL}, - { (char *)"blpapi_ServiceRegistrationOptions_destroy", _wrap_blpapi_ServiceRegistrationOptions_destroy, METH_VARARGS, NULL}, - { (char *)"blpapi_ServiceRegistrationOptions_copy", _wrap_blpapi_ServiceRegistrationOptions_copy, METH_VARARGS, NULL}, - { (char *)"blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange", _wrap_blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange, METH_VARARGS, NULL}, - { (char *)"blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges", _wrap_blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges, METH_VARARGS, NULL}, - { (char *)"blpapi_ServiceRegistrationOptions_setGroupId", _wrap_blpapi_ServiceRegistrationOptions_setGroupId, METH_VARARGS, NULL}, - { (char *)"blpapi_ServiceRegistrationOptions_setServicePriority", _wrap_blpapi_ServiceRegistrationOptions_setServicePriority, METH_VARARGS, NULL}, - { (char *)"blpapi_ServiceRegistrationOptions_setPartsToRegister", _wrap_blpapi_ServiceRegistrationOptions_setPartsToRegister, METH_VARARGS, NULL}, - { (char *)"blpapi_ServiceRegistrationOptions_getGroupId", _wrap_blpapi_ServiceRegistrationOptions_getGroupId, METH_VARARGS, NULL}, - { (char *)"blpapi_ServiceRegistrationOptions_getServicePriority", _wrap_blpapi_ServiceRegistrationOptions_getServicePriority, METH_VARARGS, NULL}, - { (char *)"blpapi_ServiceRegistrationOptions_getPartsToRegister", _wrap_blpapi_ServiceRegistrationOptions_getPartsToRegister, METH_VARARGS, NULL}, - { NULL, NULL, 0, NULL } -}; - - -/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ - -static void *_p_BloombergLP__blpapi__SessionTo_p_BloombergLP__blpapi__AbstractSession(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((BloombergLP::blpapi::AbstractSession *) ((BloombergLP::blpapi::Session *) x)); -} -static void *_p_BloombergLP__blpapi__ProviderSessionTo_p_BloombergLP__blpapi__AbstractSession(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((BloombergLP::blpapi::AbstractSession *) ((BloombergLP::blpapi::ProviderSession *) x)); -} -static void *_p_intArrayTo_p_int(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((int *) ((intArray *) x)); -} -static swig_type_info _swigt__p_BloombergLP__blpapi__AbstractSession = {"_p_BloombergLP__blpapi__AbstractSession", "BloombergLP::blpapi::AbstractSession *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_BloombergLP__blpapi__Session = {"_p_BloombergLP__blpapi__Session", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_BloombergLP__blpapi__ProviderSession = {"_p_BloombergLP__blpapi__ProviderSession", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_blpapi_AbstractSession = {"_p_blpapi_AbstractSession", "blpapi_AbstractSession *|blpapi_AbstractSession_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_Constant = {"_p_blpapi_Constant", "blpapi_Constant *|blpapi_Constant_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_ConstantList = {"_p_blpapi_ConstantList", "blpapi_ConstantList *|blpapi_ConstantList_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_CorrelationId_t_ = {"_p_blpapi_CorrelationId_t_", "blpapi_CorrelationId_t_ *|blpapi_CorrelationId_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_Datetime_tag = {"_p_blpapi_Datetime_tag", "blpapi_Datetime_t *|blpapi_Datetime_tag *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_Element = {"_p_blpapi_Element", "blpapi_Element_t *|blpapi_Element *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_Event = {"_p_blpapi_Event", "blpapi_Event *|blpapi_Event_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_EventDispatcher = {"_p_blpapi_EventDispatcher", "blpapi_EventDispatcher *|blpapi_EventDispatcher_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_EventFormatter = {"_p_blpapi_EventFormatter", "blpapi_EventFormatter *|blpapi_EventFormatter_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_EventQueue = {"_p_blpapi_EventQueue", "blpapi_EventQueue *|blpapi_EventQueue_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_HighPrecisionDatetime_tag = {"_p_blpapi_HighPrecisionDatetime_tag", "blpapi_HighPrecisionDatetime_t *|blpapi_HighPrecisionDatetime_tag *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_Identity = {"_p_blpapi_Identity", "blpapi_Identity *|blpapi_UserHandle_t *|blpapi_UserHandle *|blpapi_Identity_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_Logging_Func_t = {"_p_blpapi_Logging_Func_t", "blpapi_Logging_Func_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_Logging_Severity_t = {"_p_blpapi_Logging_Severity_t", "enum blpapi_Logging_Severity_t *|blpapi_Logging_Severity_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_ManagedPtr_t_ = {"_p_blpapi_ManagedPtr_t_", "blpapi_ManagedPtr_t *|blpapi_ManagedPtr_t_ *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_Message = {"_p_blpapi_Message", "blpapi_Message *|blpapi_Message_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_MessageIterator = {"_p_blpapi_MessageIterator", "blpapi_MessageIterator *|blpapi_MessageIterator_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_Name = {"_p_blpapi_Name", "blpapi_Name *|blpapi_Name_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_Operation = {"_p_blpapi_Operation", "blpapi_Operation_t *|blpapi_Operation *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_ProviderSession = {"_p_blpapi_ProviderSession", "blpapi_ProviderSession *|blpapi_ProviderSession_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_Request = {"_p_blpapi_Request", "blpapi_Request *|blpapi_Request_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_RequestTemplate = {"_p_blpapi_RequestTemplate", "blpapi_RequestTemplate_t *|blpapi_RequestTemplate *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_ResolutionList = {"_p_blpapi_ResolutionList", "blpapi_ResolutionList *|blpapi_ResolutionList_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_Service = {"_p_blpapi_Service", "blpapi_Service_t *|blpapi_Service *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_ServiceRegistrationOptions = {"_p_blpapi_ServiceRegistrationOptions", "blpapi_ServiceRegistrationOptions *|blpapi_ServiceRegistrationOptions_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_Session = {"_p_blpapi_Session", "blpapi_Session *|blpapi_Session_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_SessionOptions = {"_p_blpapi_SessionOptions", "blpapi_SessionOptions *|blpapi_SessionOptions_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_StreamWriter_t = {"_p_blpapi_StreamWriter_t", "blpapi_StreamWriter_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_SubscriptionItrerator = {"_p_blpapi_SubscriptionItrerator", "blpapi_SubscriptionItrerator *|blpapi_SubscriptionIterator_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_SubscriptionList = {"_p_blpapi_SubscriptionList", "blpapi_SubscriptionList *|blpapi_SubscriptionList_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_TimePoint_t = {"_p_blpapi_TimePoint_t", "blpapi_TimePoint_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_TlsOptions = {"_p_blpapi_TlsOptions", "blpapi_TlsOptions *|blpapi_TlsOptions_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_Topic = {"_p_blpapi_Topic", "blpapi_Topic *|blpapi_Topic_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_TopicList = {"_p_blpapi_TopicList", "blpapi_TopicList *|blpapi_TopicList_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_char = {"_p_char", "char *|blpapi_Char_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_double = {"_p_double", "blpapi_Float64_t *|double *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_f_p_blpapi_Event_p_blpapi_ProviderSession_p_void__void = {"_p_f_p_blpapi_Event_p_blpapi_ProviderSession_p_void__void", "void (*)(blpapi_Event *,blpapi_ProviderSession *,void *)|blpapi_ProviderEventHandler_t", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_float = {"_p_float", "blpapi_Float32_t *|float *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_int = {"_p_int", "blpapi_Bool_t *|int *|blpapi_Int32_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_intArray = {"_p_intArray", "intArray *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_long_long = {"_p_long_long", "blpapi_Int64_t *|long long *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_blpapi_Element = {"_p_p_blpapi_Element", "blpapi_Element **|blpapi_Element_t **", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_blpapi_Event = {"_p_p_blpapi_Event", "blpapi_Event **|blpapi_Event_t **", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_blpapi_Message = {"_p_p_blpapi_Message", "blpapi_Message_t **|blpapi_Message **", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_blpapi_Name = {"_p_p_blpapi_Name", "blpapi_Name **|blpapi_Name_t **", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_blpapi_Operation = {"_p_p_blpapi_Operation", "blpapi_Operation **|blpapi_Operation_t **", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_blpapi_Request = {"_p_p_blpapi_Request", "blpapi_Request_t **|blpapi_Request **", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_blpapi_RequestTemplate = {"_p_p_blpapi_RequestTemplate", "blpapi_RequestTemplate **|blpapi_RequestTemplate_t **", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_blpapi_Service = {"_p_p_blpapi_Service", "blpapi_Service_t **|blpapi_Service **", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_blpapi_Topic = {"_p_p_blpapi_Topic", "blpapi_Topic **|blpapi_Topic_t **", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_p_void = {"_p_p_p_void", "blpapi_SchemaElementDefinition_t **|void ***", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_void = {"_p_p_void", "blpapi_SchemaElementDefinition_t *|blpapi_SchemaTypeDefinition_t *|void **", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_short = {"_p_short", "short *|blpapi_Int16_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "unsigned char *|blpapi_UChar_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_unsigned_int = {"_p_unsigned_int", "blpapi_UInt32_t *|unsigned int *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_unsigned_long_long = {"_p_unsigned_long_long", "blpapi_UInt64_t *|unsigned long long *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_unsigned_short = {"_p_unsigned_short", "unsigned short *|blpapi_UInt16_t *", 0, 0, (void*)0, 0}; - -static swig_type_info *swig_type_initial[] = { - &_swigt__p_BloombergLP__blpapi__AbstractSession, - &_swigt__p_BloombergLP__blpapi__ProviderSession, - &_swigt__p_BloombergLP__blpapi__Session, - &_swigt__p_blpapi_AbstractSession, - &_swigt__p_blpapi_Constant, - &_swigt__p_blpapi_ConstantList, - &_swigt__p_blpapi_CorrelationId_t_, - &_swigt__p_blpapi_Datetime_tag, - &_swigt__p_blpapi_Element, - &_swigt__p_blpapi_Event, - &_swigt__p_blpapi_EventDispatcher, - &_swigt__p_blpapi_EventFormatter, - &_swigt__p_blpapi_EventQueue, - &_swigt__p_blpapi_HighPrecisionDatetime_tag, - &_swigt__p_blpapi_Identity, - &_swigt__p_blpapi_Logging_Func_t, - &_swigt__p_blpapi_Logging_Severity_t, - &_swigt__p_blpapi_ManagedPtr_t_, - &_swigt__p_blpapi_Message, - &_swigt__p_blpapi_MessageIterator, - &_swigt__p_blpapi_Name, - &_swigt__p_blpapi_Operation, - &_swigt__p_blpapi_ProviderSession, - &_swigt__p_blpapi_Request, - &_swigt__p_blpapi_RequestTemplate, - &_swigt__p_blpapi_ResolutionList, - &_swigt__p_blpapi_Service, - &_swigt__p_blpapi_ServiceRegistrationOptions, - &_swigt__p_blpapi_Session, - &_swigt__p_blpapi_SessionOptions, - &_swigt__p_blpapi_StreamWriter_t, - &_swigt__p_blpapi_SubscriptionItrerator, - &_swigt__p_blpapi_SubscriptionList, - &_swigt__p_blpapi_TimePoint_t, - &_swigt__p_blpapi_TlsOptions, - &_swigt__p_blpapi_Topic, - &_swigt__p_blpapi_TopicList, - &_swigt__p_char, - &_swigt__p_double, - &_swigt__p_f_p_blpapi_Event_p_blpapi_ProviderSession_p_void__void, - &_swigt__p_float, - &_swigt__p_int, - &_swigt__p_intArray, - &_swigt__p_long_long, - &_swigt__p_p_blpapi_Element, - &_swigt__p_p_blpapi_Event, - &_swigt__p_p_blpapi_Message, - &_swigt__p_p_blpapi_Name, - &_swigt__p_p_blpapi_Operation, - &_swigt__p_p_blpapi_Request, - &_swigt__p_p_blpapi_RequestTemplate, - &_swigt__p_p_blpapi_Service, - &_swigt__p_p_blpapi_Topic, - &_swigt__p_p_char, - &_swigt__p_p_p_void, - &_swigt__p_p_void, - &_swigt__p_short, - &_swigt__p_unsigned_char, - &_swigt__p_unsigned_int, - &_swigt__p_unsigned_long_long, - &_swigt__p_unsigned_short, -}; - -static swig_cast_info _swigc__p_BloombergLP__blpapi__Session[] = {{&_swigt__p_BloombergLP__blpapi__Session, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_BloombergLP__blpapi__ProviderSession[] = {{&_swigt__p_BloombergLP__blpapi__ProviderSession, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_BloombergLP__blpapi__AbstractSession[] = { {&_swigt__p_BloombergLP__blpapi__AbstractSession, 0, 0, 0}, {&_swigt__p_BloombergLP__blpapi__Session, _p_BloombergLP__blpapi__SessionTo_p_BloombergLP__blpapi__AbstractSession, 0, 0}, {&_swigt__p_BloombergLP__blpapi__ProviderSession, _p_BloombergLP__blpapi__ProviderSessionTo_p_BloombergLP__blpapi__AbstractSession, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_AbstractSession[] = { {&_swigt__p_blpapi_AbstractSession, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_Constant[] = { {&_swigt__p_blpapi_Constant, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_ConstantList[] = { {&_swigt__p_blpapi_ConstantList, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_CorrelationId_t_[] = { {&_swigt__p_blpapi_CorrelationId_t_, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_Datetime_tag[] = { {&_swigt__p_blpapi_Datetime_tag, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_Element[] = { {&_swigt__p_blpapi_Element, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_Event[] = { {&_swigt__p_blpapi_Event, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_EventDispatcher[] = { {&_swigt__p_blpapi_EventDispatcher, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_EventFormatter[] = { {&_swigt__p_blpapi_EventFormatter, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_EventQueue[] = { {&_swigt__p_blpapi_EventQueue, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_HighPrecisionDatetime_tag[] = { {&_swigt__p_blpapi_HighPrecisionDatetime_tag, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_Identity[] = { {&_swigt__p_blpapi_Identity, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_Logging_Func_t[] = { {&_swigt__p_blpapi_Logging_Func_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_Logging_Severity_t[] = { {&_swigt__p_blpapi_Logging_Severity_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_ManagedPtr_t_[] = { {&_swigt__p_blpapi_ManagedPtr_t_, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_Message[] = { {&_swigt__p_blpapi_Message, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_MessageIterator[] = { {&_swigt__p_blpapi_MessageIterator, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_Name[] = { {&_swigt__p_blpapi_Name, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_Operation[] = { {&_swigt__p_blpapi_Operation, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_ProviderSession[] = { {&_swigt__p_blpapi_ProviderSession, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_Request[] = { {&_swigt__p_blpapi_Request, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_RequestTemplate[] = { {&_swigt__p_blpapi_RequestTemplate, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_ResolutionList[] = { {&_swigt__p_blpapi_ResolutionList, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_Service[] = { {&_swigt__p_blpapi_Service, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_ServiceRegistrationOptions[] = { {&_swigt__p_blpapi_ServiceRegistrationOptions, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_Session[] = { {&_swigt__p_blpapi_Session, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_SessionOptions[] = { {&_swigt__p_blpapi_SessionOptions, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_StreamWriter_t[] = { {&_swigt__p_blpapi_StreamWriter_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_SubscriptionItrerator[] = { {&_swigt__p_blpapi_SubscriptionItrerator, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_SubscriptionList[] = { {&_swigt__p_blpapi_SubscriptionList, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_TimePoint_t[] = { {&_swigt__p_blpapi_TimePoint_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_TlsOptions[] = { {&_swigt__p_blpapi_TlsOptions, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_Topic[] = { {&_swigt__p_blpapi_Topic, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_TopicList[] = { {&_swigt__p_blpapi_TopicList, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_double[] = { {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_f_p_blpapi_Event_p_blpapi_ProviderSession_p_void__void[] = { {&_swigt__p_f_p_blpapi_Event_p_blpapi_ProviderSession_p_void__void, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_float[] = { {&_swigt__p_float, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_int[] = { {&_swigt__p_intArray, _p_intArrayTo_p_int, 0, 0}, {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_intArray[] = { {&_swigt__p_intArray, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_long_long[] = { {&_swigt__p_long_long, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_blpapi_Element[] = { {&_swigt__p_p_blpapi_Element, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_blpapi_Event[] = { {&_swigt__p_p_blpapi_Event, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_blpapi_Message[] = { {&_swigt__p_p_blpapi_Message, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_blpapi_Name[] = { {&_swigt__p_p_blpapi_Name, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_blpapi_Operation[] = { {&_swigt__p_p_blpapi_Operation, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_blpapi_Request[] = { {&_swigt__p_p_blpapi_Request, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_blpapi_RequestTemplate[] = { {&_swigt__p_p_blpapi_RequestTemplate, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_blpapi_Service[] = { {&_swigt__p_p_blpapi_Service, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_blpapi_Topic[] = { {&_swigt__p_p_blpapi_Topic, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_char[] = { {&_swigt__p_p_char, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_p_void[] = { {&_swigt__p_p_p_void, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_void[] = { {&_swigt__p_p_void, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_short[] = { {&_swigt__p_short, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_unsigned_char[] = { {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_unsigned_int[] = { {&_swigt__p_unsigned_int, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_unsigned_long_long[] = { {&_swigt__p_unsigned_long_long, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_unsigned_short[] = { {&_swigt__p_unsigned_short, 0, 0, 0},{0, 0, 0, 0}}; - -static swig_cast_info *swig_cast_initial[] = { - _swigc__p_BloombergLP__blpapi__AbstractSession, - _swigc__p_BloombergLP__blpapi__ProviderSession, - _swigc__p_BloombergLP__blpapi__Session, - _swigc__p_blpapi_AbstractSession, - _swigc__p_blpapi_Constant, - _swigc__p_blpapi_ConstantList, - _swigc__p_blpapi_CorrelationId_t_, - _swigc__p_blpapi_Datetime_tag, - _swigc__p_blpapi_Element, - _swigc__p_blpapi_Event, - _swigc__p_blpapi_EventDispatcher, - _swigc__p_blpapi_EventFormatter, - _swigc__p_blpapi_EventQueue, - _swigc__p_blpapi_HighPrecisionDatetime_tag, - _swigc__p_blpapi_Identity, - _swigc__p_blpapi_Logging_Func_t, - _swigc__p_blpapi_Logging_Severity_t, - _swigc__p_blpapi_ManagedPtr_t_, - _swigc__p_blpapi_Message, - _swigc__p_blpapi_MessageIterator, - _swigc__p_blpapi_Name, - _swigc__p_blpapi_Operation, - _swigc__p_blpapi_ProviderSession, - _swigc__p_blpapi_Request, - _swigc__p_blpapi_RequestTemplate, - _swigc__p_blpapi_ResolutionList, - _swigc__p_blpapi_Service, - _swigc__p_blpapi_ServiceRegistrationOptions, - _swigc__p_blpapi_Session, - _swigc__p_blpapi_SessionOptions, - _swigc__p_blpapi_StreamWriter_t, - _swigc__p_blpapi_SubscriptionItrerator, - _swigc__p_blpapi_SubscriptionList, - _swigc__p_blpapi_TimePoint_t, - _swigc__p_blpapi_TlsOptions, - _swigc__p_blpapi_Topic, - _swigc__p_blpapi_TopicList, - _swigc__p_char, - _swigc__p_double, - _swigc__p_f_p_blpapi_Event_p_blpapi_ProviderSession_p_void__void, - _swigc__p_float, - _swigc__p_int, - _swigc__p_intArray, - _swigc__p_long_long, - _swigc__p_p_blpapi_Element, - _swigc__p_p_blpapi_Event, - _swigc__p_p_blpapi_Message, - _swigc__p_p_blpapi_Name, - _swigc__p_p_blpapi_Operation, - _swigc__p_p_blpapi_Request, - _swigc__p_p_blpapi_RequestTemplate, - _swigc__p_p_blpapi_Service, - _swigc__p_p_blpapi_Topic, - _swigc__p_p_char, - _swigc__p_p_p_void, - _swigc__p_p_void, - _swigc__p_short, - _swigc__p_unsigned_char, - _swigc__p_unsigned_int, - _swigc__p_unsigned_long_long, - _swigc__p_unsigned_short, -}; - - -/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */ - -static swig_const_info swig_const_table[] = { -{0, 0, 0, 0.0, 0, 0}}; - -#ifdef __cplusplus -} -#endif -/* ----------------------------------------------------------------------------- - * Type initialization: - * This problem is tough by the requirement that no dynamic - * memory is used. Also, since swig_type_info structures store pointers to - * swig_cast_info structures and swig_cast_info structures store pointers back - * to swig_type_info structures, we need some lookup code at initialization. - * The idea is that swig generates all the structures that are needed. - * The runtime then collects these partially filled structures. - * The SWIG_InitializeModule function takes these initial arrays out of - * swig_module, and does all the lookup, filling in the swig_module.types - * array with the correct data and linking the correct swig_cast_info - * structures together. - * - * The generated swig_type_info structures are assigned statically to an initial - * array. We just loop through that array, and handle each type individually. - * First we lookup if this type has been already loaded, and if so, use the - * loaded structure instead of the generated one. Then we have to fill in the - * cast linked list. The cast data is initially stored in something like a - * two-dimensional array. Each row corresponds to a type (there are the same - * number of rows as there are in the swig_type_initial array). Each entry in - * a column is one of the swig_cast_info structures for that type. - * The cast_initial array is actually an array of arrays, because each row has - * a variable number of columns. So to actually build the cast linked list, - * we find the array of casts associated with the type, and loop through it - * adding the casts to the list. The one last trick we need to do is making - * sure the type pointer in the swig_cast_info struct is correct. - * - * First off, we lookup the cast->type name to see if it is already loaded. - * There are three cases to handle: - * 1) If the cast->type has already been loaded AND the type we are adding - * casting info to has not been loaded (it is in this module), THEN we - * replace the cast->type pointer with the type pointer that has already - * been loaded. - * 2) If BOTH types (the one we are adding casting info to, and the - * cast->type) are loaded, THEN the cast info has already been loaded by - * the previous module so we just ignore it. - * 3) Finally, if cast->type has not already been loaded, then we add that - * swig_cast_info to the linked list (because the cast->type) pointer will - * be correct. - * ----------------------------------------------------------------------------- */ - -#ifdef __cplusplus -extern "C" { -#if 0 -} /* c-mode */ -#endif -#endif - -#if 0 -#define SWIGRUNTIME_DEBUG -#endif - - -SWIGRUNTIME void -SWIG_InitializeModule(void *clientdata) { - size_t i; - swig_module_info *module_head, *iter; - int init; - - /* check to see if the circular list has been setup, if not, set it up */ - if (swig_module.next==0) { - /* Initialize the swig_module */ - swig_module.type_initial = swig_type_initial; - swig_module.cast_initial = swig_cast_initial; - swig_module.next = &swig_module; - init = 1; - } else { - init = 0; - } - - /* Try and load any already created modules */ - module_head = SWIG_GetModule(clientdata); - if (!module_head) { - /* This is the first module loaded for this interpreter */ - /* so set the swig module into the interpreter */ - SWIG_SetModule(clientdata, &swig_module); - } else { - /* the interpreter has loaded a SWIG module, but has it loaded this one? */ - iter=module_head; - do { - if (iter==&swig_module) { - /* Our module is already in the list, so there's nothing more to do. */ - return; - } - iter=iter->next; - } while (iter!= module_head); - - /* otherwise we must add our module into the list */ - swig_module.next = module_head->next; - module_head->next = &swig_module; - } - - /* When multiple interpreters are used, a module could have already been initialized in - a different interpreter, but not yet have a pointer in this interpreter. - In this case, we do not want to continue adding types... everything should be - set up already */ - if (init == 0) return; - - /* Now work on filling in swig_module.types */ -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: size %d\n", swig_module.size); -#endif - for (i = 0; i < swig_module.size; ++i) { - swig_type_info *type = 0; - swig_type_info *ret; - swig_cast_info *cast; - -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); -#endif - - /* if there is another module already loaded */ - if (swig_module.next != &swig_module) { - type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name); - } - if (type) { - /* Overwrite clientdata field */ -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: found type %s\n", type->name); -#endif - if (swig_module.type_initial[i]->clientdata) { - type->clientdata = swig_module.type_initial[i]->clientdata; -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name); -#endif - } - } else { - type = swig_module.type_initial[i]; - } - - /* Insert casting types */ - cast = swig_module.cast_initial[i]; - while (cast->type) { - /* Don't need to add information already in the list */ - ret = 0; -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: look cast %s\n", cast->type->name); -#endif - if (swig_module.next != &swig_module) { - ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name); -#ifdef SWIGRUNTIME_DEBUG - if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name); -#endif - } - if (ret) { - if (type == swig_module.type_initial[i]) { -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: skip old type %s\n", ret->name); -#endif - cast->type = ret; - ret = 0; - } else { - /* Check for casting already in the list */ - swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type); -#ifdef SWIGRUNTIME_DEBUG - if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name); -#endif - if (!ocast) ret = 0; - } - } - - if (!ret) { -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name); -#endif - if (type->cast) { - type->cast->prev = cast; - cast->next = type->cast; - } - type->cast = cast; - } - cast++; - } - /* Set entry in modules->types array equal to the type */ - swig_module.types[i] = type; - } - swig_module.types[i] = 0; - -#ifdef SWIGRUNTIME_DEBUG - printf("**** SWIG_InitializeModule: Cast List ******\n"); - for (i = 0; i < swig_module.size; ++i) { - int j = 0; - swig_cast_info *cast = swig_module.cast_initial[i]; - printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); - while (cast->type) { - printf("SWIG_InitializeModule: cast type %s\n", cast->type->name); - cast++; - ++j; - } - printf("---- Total casts: %d\n",j); - } - printf("**** SWIG_InitializeModule: Cast List ******\n"); -#endif -} - -/* This function will propagate the clientdata field of type to -* any new swig_type_info structures that have been added into the list -* of equivalent types. It is like calling -* SWIG_TypeClientData(type, clientdata) a second time. -*/ -SWIGRUNTIME void -SWIG_PropagateClientData(void) { - size_t i; - swig_cast_info *equiv; - static int init_run = 0; - - if (init_run) return; - init_run = 1; - - for (i = 0; i < swig_module.size; i++) { - if (swig_module.types[i]->clientdata) { - equiv = swig_module.types[i]->cast; - while (equiv) { - if (!equiv->converter) { - if (equiv->type && !equiv->type->clientdata) - SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata); - } - equiv = equiv->next; - } - } - } -} - -#ifdef __cplusplus -#if 0 -{ - /* c-mode */ -#endif -} -#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(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 int - swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { - char *tmp; - PyObject *str = swig_varlink_str(v); - fprintf(fp,"Swig global variables "); - fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str)); - SWIG_Python_str_DelForPy3(tmp); - Py_DECREF(str); - return 0; - } - - 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 - (char *)"swigvarlink", /* tp_name */ - sizeof(swig_varlinkobject), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor) swig_varlink_dealloc, /* tp_dealloc */ - (printfunc) swig_varlink_print, /* 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 */ -#if PY_VERSION_HEX >= 0x02020000 - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */ -#endif -#if PY_VERSION_HEX >= 0x02030000 - 0, /* tp_del */ -#endif -#if PY_VERSION_HEX >= 0x02060000 - 0, /* tp_version_tag */ -#endif -#if PY_VERSION_HEX >= 0x03040000 - 0, /* tp_finalize */ -#endif -#ifdef COUNT_ALLOCS - 0, /* tp_allocs */ - 0, /* tp_frees */ - 0, /* tp_maxalloc */ -#if PY_VERSION_HEX >= 0x02050000 - 0, /* tp_prev */ -#endif - 0 /* tp_next */ -#endif - }; - varlink_type = tmp; - type_init = 1; -#if PY_VERSION_HEX < 0x02020000 - varlink_type.ob_type = &PyType_Type; -#else - if (PyType_Ready(&varlink_type) < 0) - return NULL; -#endif - } - 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, 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) { - strncpy(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 *_SWIG_globals = 0; - if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink(); - return _SWIG_globals; - } - - /* ----------------------------------------------------------------------------- - * constants/methods manipulation - * ----------------------------------------------------------------------------- */ - - /* Install Constants */ - SWIGINTERN void - SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) { - PyObject *obj = 0; - size_t i; - for (i = 0; constants[i].type; ++i) { - switch(constants[i].type) { - case SWIG_PY_POINTER: - obj = SWIG_InternalNewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0); - break; - case SWIG_PY_BINARY: - obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype)); - break; - default: - obj = 0; - break; - } - if (obj) { - PyDict_SetItemString(d, constants[i].name, obj); - Py_DECREF(obj); - } - } - } - - /* -----------------------------------------------------------------------------*/ - /* Fix SwigMethods to carry the callback ptrs when needed */ - /* -----------------------------------------------------------------------------*/ - - SWIGINTERN void - SWIG_Python_FixMethods(PyMethodDef *methods, - 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; - if (!c) continue; - c = strstr(c, "swig_ptr: "); - if (c) { - int j; - 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, - strlen(const_table[j].name)) == 0) { - ci = &(const_table[j]); - break; - } - } - if (ci) { - void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0; - if (ptr) { - size_t shift = (ci->ptype) - types; - swig_type_info *ty = types_initial[shift]; - size_t ldoc = (c - methods[i].ml_doc); - size_t lptr = strlen(ty->name)+2*sizeof(void*)+2; - char *ndoc = (char*)malloc(ldoc + lptr + 10); - if (ndoc) { - char *buff = ndoc; - strncpy(buff, methods[i].ml_doc, ldoc); - buff += ldoc; - strncpy(buff, "swig_ptr: ", 10); - buff += 10; - SWIG_PackVoidPtr(buff, ptr, ty->name, lptr); - methods[i].ml_doc = ndoc; - } - } - } - } - } - } - -#ifdef __cplusplus -} -#endif - -/* -----------------------------------------------------------------------------* - * Partial Init method - * -----------------------------------------------------------------------------*/ - -#ifdef __cplusplus -extern "C" -#endif - -SWIGEXPORT -#if PY_VERSION_HEX >= 0x03000000 -PyObject* -#else -void -#endif -SWIG_init(void) { - PyObject *m, *d, *md; -#if PY_VERSION_HEX >= 0x03000000 - static struct PyModuleDef SWIG_module = { -# if PY_VERSION_HEX >= 0x03020000 - PyModuleDef_HEAD_INIT, -# else - { - PyObject_HEAD_INIT(NULL) - NULL, /* m_init */ - 0, /* m_index */ - NULL, /* m_copy */ - }, -# endif - (char *) SWIG_name, - NULL, - -1, - SwigMethods, - NULL, - NULL, - NULL, - NULL - }; -#endif - -#if defined(SWIGPYTHON_BUILTIN) - static SwigPyClientData SwigPyObject_clientdata = { - 0, 0, 0, 0, 0, 0, 0 - }; - static PyGetSetDef this_getset_def = { - (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL - }; - static SwigPyGetSet thisown_getset_closure = { - (PyCFunction) SwigPyObject_own, - (PyCFunction) SwigPyObject_own - }; - static PyGetSetDef thisown_getset_def = { - (char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure - }; - PyTypeObject *builtin_pytype; - int builtin_base_count; - swig_type_info *builtin_basetype; - PyObject *tuple; - PyGetSetDescrObject *static_getset; - PyTypeObject *metatype; - PyTypeObject *swigpyobject; - SwigPyClientData *cd; - PyObject *public_interface, *public_symbol; - PyObject *this_descr; - PyObject *thisown_descr; - PyObject *self = 0; - int i; - - (void)builtin_pytype; - (void)builtin_base_count; - (void)builtin_basetype; - (void)tuple; - (void)static_getset; - (void)self; - - /* Metaclass is used to implement static member variables */ - metatype = SwigPyObjectType(); - assert(metatype); -#endif - - /* Fix SwigMethods to carry the callback ptrs when needed */ - SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial); - -#if PY_VERSION_HEX >= 0x03000000 - m = PyModule_Create(&SWIG_module); -#else - m = Py_InitModule((char *) SWIG_name, SwigMethods); -#endif - - md = d = PyModule_GetDict(m); - (void)md; - - SWIG_InitializeModule(0); - -#ifdef SWIGPYTHON_BUILTIN - swigpyobject = SwigPyObject_TypeOnce(); - - SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject"); - assert(SwigPyObject_stype); - cd = (SwigPyClientData*) SwigPyObject_stype->clientdata; - if (!cd) { - SwigPyObject_stype->clientdata = &SwigPyObject_clientdata; - SwigPyObject_clientdata.pytype = swigpyobject; - } else if (swigpyobject->tp_basicsize != cd->pytype->tp_basicsize) { - PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules."); -# if PY_VERSION_HEX >= 0x03000000 - return NULL; -# else - return; -# endif - } - - /* All objects have a 'this' attribute */ - this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def); - (void)this_descr; - - /* All objects have a 'thisown' attribute */ - thisown_descr = PyDescr_NewGetSet(SwigPyObject_type(), &thisown_getset_def); - (void)thisown_descr; - - public_interface = PyList_New(0); - public_symbol = 0; - (void)public_symbol; - - PyDict_SetItemString(md, "__all__", public_interface); - Py_DECREF(public_interface); - for (i = 0; SwigMethods[i].ml_name != NULL; ++i) - SwigPyBuiltin_AddPublicSymbol(public_interface, SwigMethods[i].ml_name); - for (i = 0; swig_const_table[i].name != 0; ++i) - SwigPyBuiltin_AddPublicSymbol(public_interface, swig_const_table[i].name); -#endif - - SWIG_InstallConstants(d,swig_const_table); - - SWIG_Python_SetConstant(d, "TOPICLIST_NOT_CREATED",SWIG_From_int(static_cast< int >(BloombergLP::blpapi::TopicList::NOT_CREATED))); - SWIG_Python_SetConstant(d, "TOPICLIST_CREATED",SWIG_From_int(static_cast< int >(BloombergLP::blpapi::TopicList::CREATED))); - SWIG_Python_SetConstant(d, "TOPICLIST_FAILURE",SWIG_From_int(static_cast< int >(BloombergLP::blpapi::TopicList::FAILURE))); - SWIG_Python_SetConstant(d, "RESOLUTIONLIST_UNRESOLVED",SWIG_From_int(static_cast< int >(BloombergLP::blpapi::ResolutionList::UNRESOLVED))); - SWIG_Python_SetConstant(d, "RESOLUTIONLIST_RESOLVED",SWIG_From_int(static_cast< int >(BloombergLP::blpapi::ResolutionList::RESOLVED))); - SWIG_Python_SetConstant(d, "RESOLUTIONLIST_RESOLUTION_FAILURE_BAD_SERVICE",SWIG_From_int(static_cast< int >(BloombergLP::blpapi::ResolutionList::RESOLUTION_FAILURE_BAD_SERVICE))); - SWIG_Python_SetConstant(d, "RESOLUTIONLIST_RESOLUTION_FAILURE_SERVICE_AUTHORIZATION_FAILED",SWIG_From_int(static_cast< int >(BloombergLP::blpapi::ResolutionList::RESOLUTION_FAILURE_SERVICE_AUTHORIZATION_FAILED))); - SWIG_Python_SetConstant(d, "RESOLUTIONLIST_RESOLUTION_FAILURE_BAD_TOPIC",SWIG_From_int(static_cast< int >(BloombergLP::blpapi::ResolutionList::RESOLUTION_FAILURE_BAD_TOPIC))); - SWIG_Python_SetConstant(d, "RESOLUTIONLIST_RESOLUTION_FAILURE_TOPIC_AUTHORIZATION_FAILED",SWIG_From_int(static_cast< int >(BloombergLP::blpapi::ResolutionList::RESOLUTION_FAILURE_TOPIC_AUTHORIZATION_FAILED))); - SWIG_Python_SetConstant(d, "MESSAGE_FRAGMENT_NONE",SWIG_From_int(static_cast< int >(BloombergLP::blpapi::Message::FRAGMENT_NONE))); - SWIG_Python_SetConstant(d, "MESSAGE_FRAGMENT_START",SWIG_From_int(static_cast< int >(BloombergLP::blpapi::Message::FRAGMENT_START))); - SWIG_Python_SetConstant(d, "MESSAGE_FRAGMENT_INTERMEDIATE",SWIG_From_int(static_cast< int >(BloombergLP::blpapi::Message::FRAGMENT_INTERMEDIATE))); - SWIG_Python_SetConstant(d, "MESSAGE_FRAGMENT_END",SWIG_From_int(static_cast< int >(BloombergLP::blpapi::Message::FRAGMENT_END))); - SWIG_Python_SetConstant(d, "MESSAGE_RECAPTYPE_NONE",SWIG_From_int(static_cast< int >(BloombergLP::blpapi::Message::RecapType::e_none))); - SWIG_Python_SetConstant(d, "MESSAGE_RECAPTYPE_SOLICITED",SWIG_From_int(static_cast< int >(BloombergLP::blpapi::Message::RecapType::e_solicited))); - SWIG_Python_SetConstant(d, "MESSAGE_RECAPTYPE_UNSOLICITED",SWIG_From_int(static_cast< int >(BloombergLP::blpapi::Message::RecapType::e_unsolicited))); - SWIG_Python_SetConstant(d, "ELEMENTDEFINITION_UNBOUNDED",SWIG_From_unsigned_SS_int(static_cast< unsigned int >(BLPAPI_ELEMENTDEFINITION_UNBOUNDED))); - SWIG_Python_SetConstant(d, "ELEMENT_INDEX_END",SWIG_From_size_t(static_cast< size_t >(BLPAPI_ELEMENT_INDEX_END))); - SWIG_Python_SetConstant(d, "SERVICEREGISTRATIONOPTIONS_PRIORITY_MEDIUM",SWIG_From_int(static_cast< int >(INT_MAX/2))); - SWIG_Python_SetConstant(d, "SERVICEREGISTRATIONOPTIONS_PRIORITY_HIGH",SWIG_From_int(static_cast< int >(INT_MAX))); - SWIG_Python_SetConstant(d, "CORRELATION_TYPE_UNSET",SWIG_From_int(static_cast< int >(0))); - SWIG_Python_SetConstant(d, "CORRELATION_TYPE_INT",SWIG_From_int(static_cast< int >(1))); - SWIG_Python_SetConstant(d, "CORRELATION_TYPE_POINTER",SWIG_From_int(static_cast< int >(2))); - SWIG_Python_SetConstant(d, "CORRELATION_TYPE_AUTOGEN",SWIG_From_int(static_cast< int >(3))); - SWIG_Python_SetConstant(d, "CORRELATION_MAX_CLASS_ID",SWIG_From_int(static_cast< int >(((1 << 16) -1)))); - SWIG_Python_SetConstant(d, "MANAGEDPTR_COPY",SWIG_From_int(static_cast< int >(1))); - SWIG_Python_SetConstant(d, "MANAGEDPTR_DESTROY",SWIG_From_int(static_cast< int >((-1)))); - SWIG_Python_SetConstant(d, "DATETIME_YEAR_PART",SWIG_From_int(static_cast< int >(0x1))); - SWIG_Python_SetConstant(d, "DATETIME_MONTH_PART",SWIG_From_int(static_cast< int >(0x2))); - SWIG_Python_SetConstant(d, "DATETIME_DAY_PART",SWIG_From_int(static_cast< int >(0x4))); - SWIG_Python_SetConstant(d, "DATETIME_OFFSET_PART",SWIG_From_int(static_cast< int >(0x8))); - SWIG_Python_SetConstant(d, "DATETIME_HOURS_PART",SWIG_From_int(static_cast< int >(0x10))); - SWIG_Python_SetConstant(d, "DATETIME_MINUTES_PART",SWIG_From_int(static_cast< int >(0x20))); - SWIG_Python_SetConstant(d, "DATETIME_SECONDS_PART",SWIG_From_int(static_cast< int >(0x40))); - SWIG_Python_SetConstant(d, "DATETIME_MILLISECONDS_PART",SWIG_From_int(static_cast< int >(0x80))); - SWIG_Python_SetConstant(d, "DATETIME_FRACSECONDS_PART",SWIG_From_int(static_cast< int >(0x80))); - SWIG_Python_SetConstant(d, "DATETIME_DATE_PART",SWIG_From_int(static_cast< int >((0x1|0x2|0x4)))); - SWIG_Python_SetConstant(d, "DATETIME_TIME_PART",SWIG_From_int(static_cast< int >((0x10|0x20|0x40)))); - SWIG_Python_SetConstant(d, "DATETIME_TIMEMILLI_PART",SWIG_From_int(static_cast< int >(((0x10|0x20|0x40)|0x80)))); - SWIG_Python_SetConstant(d, "DATETIME_TIMEFRACSECONDS_PART",SWIG_From_int(static_cast< int >(((0x10|0x20|0x40)|0x80)))); - SWIG_Python_SetConstant(d, "EVENTTYPE_ADMIN",SWIG_From_int(static_cast< int >(1))); - SWIG_Python_SetConstant(d, "EVENTTYPE_SESSION_STATUS",SWIG_From_int(static_cast< int >(2))); - SWIG_Python_SetConstant(d, "EVENTTYPE_SUBSCRIPTION_STATUS",SWIG_From_int(static_cast< int >(3))); - SWIG_Python_SetConstant(d, "EVENTTYPE_REQUEST_STATUS",SWIG_From_int(static_cast< int >(4))); - SWIG_Python_SetConstant(d, "EVENTTYPE_RESPONSE",SWIG_From_int(static_cast< int >(5))); - SWIG_Python_SetConstant(d, "EVENTTYPE_PARTIAL_RESPONSE",SWIG_From_int(static_cast< int >(6))); - SWIG_Python_SetConstant(d, "EVENTTYPE_SUBSCRIPTION_DATA",SWIG_From_int(static_cast< int >(8))); - SWIG_Python_SetConstant(d, "EVENTTYPE_SERVICE_STATUS",SWIG_From_int(static_cast< int >(9))); - SWIG_Python_SetConstant(d, "EVENTTYPE_TIMEOUT",SWIG_From_int(static_cast< int >(10))); - SWIG_Python_SetConstant(d, "EVENTTYPE_AUTHORIZATION_STATUS",SWIG_From_int(static_cast< int >(11))); - SWIG_Python_SetConstant(d, "EVENTTYPE_RESOLUTION_STATUS",SWIG_From_int(static_cast< int >(12))); - SWIG_Python_SetConstant(d, "EVENTTYPE_TOPIC_STATUS",SWIG_From_int(static_cast< int >(13))); - SWIG_Python_SetConstant(d, "EVENTTYPE_TOKEN_STATUS",SWIG_From_int(static_cast< int >(14))); - SWIG_Python_SetConstant(d, "EVENTTYPE_REQUEST",SWIG_From_int(static_cast< int >(15))); - SWIG_Python_SetConstant(d, "STATUS_ACTIVE",SWIG_From_int(static_cast< int >(0))); - SWIG_Python_SetConstant(d, "STATUS_DEPRECATED",SWIG_From_int(static_cast< int >(1))); - SWIG_Python_SetConstant(d, "STATUS_INACTIVE",SWIG_From_int(static_cast< int >(2))); - SWIG_Python_SetConstant(d, "STATUS_PENDING_DEPRECATION",SWIG_From_int(static_cast< int >(3))); - SWIG_Python_SetConstant(d, "SUBSCRIPTIONSTATUS_UNSUBSCRIBED",SWIG_From_int(static_cast< int >(0))); - SWIG_Python_SetConstant(d, "SUBSCRIPTIONSTATUS_SUBSCRIBING",SWIG_From_int(static_cast< int >(1))); - SWIG_Python_SetConstant(d, "SUBSCRIPTIONSTATUS_SUBSCRIBED",SWIG_From_int(static_cast< int >(2))); - SWIG_Python_SetConstant(d, "SUBSCRIPTIONSTATUS_CANCELLED",SWIG_From_int(static_cast< int >(3))); - SWIG_Python_SetConstant(d, "SUBSCRIPTIONSTATUS_PENDING_CANCELLATION",SWIG_From_int(static_cast< int >(4))); - SWIG_Python_SetConstant(d, "CLIENTMODE_AUTO",SWIG_From_int(static_cast< int >(0))); - SWIG_Python_SetConstant(d, "CLIENTMODE_DAPI",SWIG_From_int(static_cast< int >(1))); - SWIG_Python_SetConstant(d, "CLIENTMODE_SAPI",SWIG_From_int(static_cast< int >(2))); - SWIG_Python_SetConstant(d, "CLIENTMODE_COMPAT_33X",SWIG_From_int(static_cast< int >(16))); - SWIG_Python_SetConstant(d, "RESOLVEMODE_DONT_REGISTER_SERVICES",SWIG_From_int(static_cast< int >(0))); - SWIG_Python_SetConstant(d, "RESOLVEMODE_AUTO_REGISTER_SERVICES",SWIG_From_int(static_cast< int >(1))); - SWIG_Python_SetConstant(d, "SEATTYPE_INVALID_SEAT",SWIG_From_int(static_cast< int >(-1))); - SWIG_Python_SetConstant(d, "SEATTYPE_BPS",SWIG_From_int(static_cast< int >(0))); - SWIG_Python_SetConstant(d, "SEATTYPE_NONBPS",SWIG_From_int(static_cast< int >(1))); - SWIG_Python_SetConstant(d, "SERVICEREGISTRATIONOPTIONS_PRIORITY_LOW",SWIG_From_int(static_cast< int >(0))); - SWIG_Python_SetConstant(d, "REGISTRATIONPARTS_DEFAULT",SWIG_From_int(static_cast< int >(0x1))); - SWIG_Python_SetConstant(d, "REGISTRATIONPARTS_PUBLISHING",SWIG_From_int(static_cast< int >(0x2))); - SWIG_Python_SetConstant(d, "REGISTRATIONPARTS_OPERATIONS",SWIG_From_int(static_cast< int >(0x4))); - SWIG_Python_SetConstant(d, "REGISTRATIONPARTS_SUBSCRIBER_RESOLUTION",SWIG_From_int(static_cast< int >(0x8))); - SWIG_Python_SetConstant(d, "REGISTRATIONPARTS_PUBLISHER_RESOLUTION",SWIG_From_int(static_cast< int >(0x10))); - SWIG_Python_SetConstant(d, "DATATYPE_BOOL",SWIG_From_int(static_cast< int >(BLPAPI_DATATYPE_BOOL))); - SWIG_Python_SetConstant(d, "DATATYPE_CHAR",SWIG_From_int(static_cast< int >(BLPAPI_DATATYPE_CHAR))); - SWIG_Python_SetConstant(d, "DATATYPE_BYTE",SWIG_From_int(static_cast< int >(BLPAPI_DATATYPE_BYTE))); - SWIG_Python_SetConstant(d, "DATATYPE_INT32",SWIG_From_int(static_cast< int >(BLPAPI_DATATYPE_INT32))); - SWIG_Python_SetConstant(d, "DATATYPE_INT64",SWIG_From_int(static_cast< int >(BLPAPI_DATATYPE_INT64))); - SWIG_Python_SetConstant(d, "DATATYPE_FLOAT32",SWIG_From_int(static_cast< int >(BLPAPI_DATATYPE_FLOAT32))); - SWIG_Python_SetConstant(d, "DATATYPE_FLOAT64",SWIG_From_int(static_cast< int >(BLPAPI_DATATYPE_FLOAT64))); - SWIG_Python_SetConstant(d, "DATATYPE_STRING",SWIG_From_int(static_cast< int >(BLPAPI_DATATYPE_STRING))); - SWIG_Python_SetConstant(d, "DATATYPE_BYTEARRAY",SWIG_From_int(static_cast< int >(BLPAPI_DATATYPE_BYTEARRAY))); - SWIG_Python_SetConstant(d, "DATATYPE_DATE",SWIG_From_int(static_cast< int >(BLPAPI_DATATYPE_DATE))); - SWIG_Python_SetConstant(d, "DATATYPE_TIME",SWIG_From_int(static_cast< int >(BLPAPI_DATATYPE_TIME))); - SWIG_Python_SetConstant(d, "DATATYPE_DECIMAL",SWIG_From_int(static_cast< int >(BLPAPI_DATATYPE_DECIMAL))); - SWIG_Python_SetConstant(d, "DATATYPE_DATETIME",SWIG_From_int(static_cast< int >(BLPAPI_DATATYPE_DATETIME))); - SWIG_Python_SetConstant(d, "DATATYPE_ENUMERATION",SWIG_From_int(static_cast< int >(BLPAPI_DATATYPE_ENUMERATION))); - SWIG_Python_SetConstant(d, "DATATYPE_SEQUENCE",SWIG_From_int(static_cast< int >(BLPAPI_DATATYPE_SEQUENCE))); - SWIG_Python_SetConstant(d, "DATATYPE_CHOICE",SWIG_From_int(static_cast< int >(BLPAPI_DATATYPE_CHOICE))); - SWIG_Python_SetConstant(d, "DATATYPE_CORRELATION_ID",SWIG_From_int(static_cast< int >(BLPAPI_DATATYPE_CORRELATION_ID))); - SWIG_Python_SetConstant(d, "blpapi_Logging_SEVERITY_OFF",SWIG_From_int(static_cast< int >(blpapi_Logging_SEVERITY_OFF))); - SWIG_Python_SetConstant(d, "blpapi_Logging_SEVERITY_FATAL",SWIG_From_int(static_cast< int >(blpapi_Logging_SEVERITY_FATAL))); - SWIG_Python_SetConstant(d, "blpapi_Logging_SEVERITY_ERROR",SWIG_From_int(static_cast< int >(blpapi_Logging_SEVERITY_ERROR))); - SWIG_Python_SetConstant(d, "blpapi_Logging_SEVERITY_WARN",SWIG_From_int(static_cast< int >(blpapi_Logging_SEVERITY_WARN))); - SWIG_Python_SetConstant(d, "blpapi_Logging_SEVERITY_INFO",SWIG_From_int(static_cast< int >(blpapi_Logging_SEVERITY_INFO))); - SWIG_Python_SetConstant(d, "blpapi_Logging_SEVERITY_DEBUG",SWIG_From_int(static_cast< int >(blpapi_Logging_SEVERITY_DEBUG))); - SWIG_Python_SetConstant(d, "blpapi_Logging_SEVERITY_TRACE",SWIG_From_int(static_cast< int >(blpapi_Logging_SEVERITY_TRACE))); - SWIG_Python_SetConstant(d, "UNKNOWN_CLASS",SWIG_From_int(static_cast< int >(0x00000))); - SWIG_Python_SetConstant(d, "INVALIDSTATE_CLASS",SWIG_From_int(static_cast< int >(0x10000))); - SWIG_Python_SetConstant(d, "INVALIDARG_CLASS",SWIG_From_int(static_cast< int >(0x20000))); - SWIG_Python_SetConstant(d, "IOERROR_CLASS",SWIG_From_int(static_cast< int >(0x30000))); - SWIG_Python_SetConstant(d, "CNVERROR_CLASS",SWIG_From_int(static_cast< int >(0x40000))); - SWIG_Python_SetConstant(d, "BOUNDSERROR_CLASS",SWIG_From_int(static_cast< int >(0x50000))); - SWIG_Python_SetConstant(d, "NOTFOUND_CLASS",SWIG_From_int(static_cast< int >(0x60000))); - SWIG_Python_SetConstant(d, "FLDNOTFOUND_CLASS",SWIG_From_int(static_cast< int >(0x70000))); - SWIG_Python_SetConstant(d, "UNSUPPORTED_CLASS",SWIG_From_int(static_cast< int >(0x80000))); - SWIG_Python_SetConstant(d, "ERROR_UNKNOWN",SWIG_From_int(static_cast< int >((0x00000|1)))); - SWIG_Python_SetConstant(d, "ERROR_ILLEGAL_ARG",SWIG_From_int(static_cast< int >((0x20000|2)))); - SWIG_Python_SetConstant(d, "ERROR_ILLEGAL_ACCESS",SWIG_From_int(static_cast< int >((0x00000|3)))); - SWIG_Python_SetConstant(d, "ERROR_INVALID_SESSION",SWIG_From_int(static_cast< int >((0x20000|4)))); - SWIG_Python_SetConstant(d, "ERROR_DUPLICATE_CORRELATIONID",SWIG_From_int(static_cast< int >((0x20000|5)))); - SWIG_Python_SetConstant(d, "ERROR_INTERNAL_ERROR",SWIG_From_int(static_cast< int >((0x00000|6)))); - SWIG_Python_SetConstant(d, "ERROR_RESOLVE_FAILED",SWIG_From_int(static_cast< int >((0x30000|7)))); - SWIG_Python_SetConstant(d, "ERROR_CONNECT_FAILED",SWIG_From_int(static_cast< int >((0x30000|8)))); - SWIG_Python_SetConstant(d, "ERROR_ILLEGAL_STATE",SWIG_From_int(static_cast< int >((0x10000|9)))); - SWIG_Python_SetConstant(d, "ERROR_CODEC_FAILURE",SWIG_From_int(static_cast< int >((0x00000|10)))); - SWIG_Python_SetConstant(d, "ERROR_INDEX_OUT_OF_RANGE",SWIG_From_int(static_cast< int >((0x50000|11)))); - SWIG_Python_SetConstant(d, "ERROR_INVALID_CONVERSION",SWIG_From_int(static_cast< int >((0x40000|12)))); - SWIG_Python_SetConstant(d, "ERROR_ITEM_NOT_FOUND",SWIG_From_int(static_cast< int >((0x60000|13)))); - SWIG_Python_SetConstant(d, "ERROR_IO_ERROR",SWIG_From_int(static_cast< int >((0x30000|14)))); - SWIG_Python_SetConstant(d, "ERROR_CORRELATION_NOT_FOUND",SWIG_From_int(static_cast< int >((0x60000|15)))); - SWIG_Python_SetConstant(d, "ERROR_SERVICE_NOT_FOUND",SWIG_From_int(static_cast< int >((0x60000|16)))); - SWIG_Python_SetConstant(d, "ERROR_LOGON_LOOKUP_FAILED",SWIG_From_int(static_cast< int >((0x00000|17)))); - SWIG_Python_SetConstant(d, "ERROR_DS_LOOKUP_FAILED",SWIG_From_int(static_cast< int >((0x00000|18)))); - SWIG_Python_SetConstant(d, "ERROR_UNSUPPORTED_OPERATION",SWIG_From_int(static_cast< int >((0x80000|19)))); - SWIG_Python_SetConstant(d, "ERROR_DS_PROPERTY_NOT_FOUND",SWIG_From_int(static_cast< int >((0x60000|20)))); - - /* Initialize threading */ - SWIG_PYTHON_INITIALIZE_THREADS; -#if PY_VERSION_HEX >= 0x03000000 - return m; -#else - return; -#endif -} - diff --git a/blpapi/message.py b/blpapi/message.py index 7b117f2..0137a91 100644 --- a/blpapi/message.py +++ b/blpapi/message.py @@ -10,6 +10,7 @@ from __future__ import absolute_import import sys +import warnings import weakref from blpapi.datetime import _DatetimeUtil, UTC from .element import Element @@ -144,8 +145,27 @@ def topicName(self): Returns: str: Topic string of this message. If there is no topic associated with the message, empty string is returned. + + **DEPRECATED** + + This function has been deprecated because messages could contain + multiple payloads with different correlation ids, and each of these + correlation ids may map to different topic strings. + + In such a scenario, it would be incorrect to choose one out of the + multiple topics (for the various correlation id's in the message) as + the topic name for the message. Trying to make this correct would + result in extra look up costs. + + For correctness, users are encouraged to maintain a data structure in + their application to help retrieve the topic name associated with the + cid's present in the delivered message. """ + warnings.warn( + "This method is deprecated, see docstring for details", + DeprecationWarning) + return internals.blpapi_Message_topicName(self.__handle) def service(self): diff --git a/blpapi/providersession.py b/blpapi/providersession.py index 57bbdad..585654b 100644 --- a/blpapi/providersession.py +++ b/blpapi/providersession.py @@ -165,13 +165,14 @@ def setGroupId(self, groupId): # otherwise we'll get an error in SWIG wrapper. def setServicePriority(self, priority): - """Set the priority with which a service will be registered. + """Set the priority with which a subscription service will be + registered. Args: priority (int): The service priority - Set the priority with which a service will be registered to the - specified ``priority``, where numerically greater values of + Set the priority with which a subscription service will be registered + to the specified ``priority``, where numerically greater values of ``priority`` indicate higher priorities. The behavior is undefined unless ``priority`` is non-negative. Note that while the values pre-defined in ``ServiceRegistrationOptions`` are suitable for use @@ -179,6 +180,8 @@ def setServicePriority(self, priority): By default, a service will be registered with priority :attr:`PRIORITY_HIGH`. + + Note this has no effect for request-response or resolution services. """ return internals.blpapi_ServiceRegistrationOptions_setServicePriority( self.__handle, @@ -197,7 +200,8 @@ def getGroupId(self): def getServicePriority(self): """ Returns: - int: The value of the service priority in this instance. + int: The value of the priority for subscription services in this + instance. """ priority = \ internals.blpapi_ServiceRegistrationOptions_getServicePriority( @@ -550,6 +554,9 @@ def registerService(self, uri, identity=None, options=None): an asynchronous :class:`ProviderSession` then this :class:`Event` may be processed by the registered :class:`Event` before :meth:`registerService()` has returned. + + When ``identity`` is not provided, the session identity will be used if + it has been authorized. """ if options is None: options = ServiceRegistrationOptions() @@ -594,6 +601,9 @@ def registerServiceAsync(self, uri, identity=None, correlationId=None, :class:`~Event.SERVICE_STATUS` :class:`Event` which will be generated once the service has been successfully registered or registration has failed. + + When ``identity`` is not provided, the session identity will be used if + it has been authorized. """ if correlationId is None: correlationId = CorrelationId() @@ -641,6 +651,9 @@ def resolve(self, resolutionList, resolveMode=DONT_REGISTER_SERVICES, asynchronous :class:`ProviderSession` then these :class:`Event`\ s may be processed by the registered ``eventHandler`` before :meth:`resolve()` has returned. + + When ``identity`` is not provided, the session identity will be used if + it has been authorized. """ resolutionList._addSession(self) _ExceptionUtil.raiseOnError( @@ -676,6 +689,9 @@ def resolveAsync(self, resolutionList, resolveMode=DONT_REGISTER_SERVICES, :attr:`AUTO_REGISTER_SERVICES` is specified :attr:`~Event.SERVICE_STATUS` events may also be generated before or after :meth:`resolveAsync()` returns. + + When ``identity`` is not provided, the session identity will be used if + it has been authorized. """ resolutionList._addSession(self) _ExceptionUtil.raiseOnError( @@ -773,6 +789,9 @@ def createTopics(self, topicList, asynchronous :class:`ProviderSession` then these :class:`Event`\ s may be processed by the registered ``eventHandler`` before :meth:`createTopics()` has returned. + + When ``identity`` is not provided, the session identity will be used if + it has been authorized. """ topicList._addSession(self) _ExceptionUtil.raiseOnError( @@ -805,6 +824,9 @@ def createTopicsAsync(self, topicList, asynchronous :class:`ProviderSession` then these :class:`Event`\ s may be processed by the registered ``eventHandler`` before :meth:`createTopics()` has returned. + + When ``identity`` is not provided, the session identity will be used if + it has been authorized. """ topicList._addSession(self) _ExceptionUtil.raiseOnError( diff --git a/blpapi/service.py b/blpapi/service.py index 7ba4bed..6603def 100644 --- a/blpapi/service.py +++ b/blpapi/service.py @@ -7,7 +7,7 @@ provider service (can generate API data) or a consumer service. """ - +import warnings from .event import Event from .name import getNamePair from .request import Request @@ -185,8 +185,15 @@ def createAdminEvent(self): Use an :class:`EventFormatter` to add :class:`Message`\ s to the :class:`Event` and set fields. + + **DEPRECATED** + Use :meth:`Service.createPublishEvent()`. + """ + warnings.warn( + "This method is deprecated, see docstring for details", + DeprecationWarning) errCode, event = internals.blpapi_Service_createAdminEvent( self.__handle) _ExceptionUtil.raiseOnError(errCode) diff --git a/blpapi/session.py b/blpapi/session.py index 65b2290..6da74a7 100644 --- a/blpapi/session.py +++ b/blpapi/session.py @@ -304,6 +304,9 @@ def subscribe(self, subscriptionList, identity=None, requestLabel=""): A :attr:`~Event.SUBSCRIPTION_STATUS` :class:`Event` will be generated for each entry in the ``subscriptionList``. + + When ``identity`` is not provided, the session identity will be used if + it has been authorized. """ _ExceptionUtil.raiseOnError(internals.blpapi_Session_subscribe( self.__handle, @@ -433,14 +436,16 @@ def sendRequest(self, CorrelationId: The actual correlation id associated with the request - Send the specified ``request`` using the specified ``identity`` for - authorization. If the optionally specified ``correlationId`` is - supplied use it, otherwise create a :class:`CorrelationId`. The actual - :class:`CorrelationId` used is returned. If the optionally specified - ``eventQueue`` is supplied all events relating to this :class:`Request` - will arrive on that :class:`EventQueue`. If the optional - ``requestLabel`` is provided it defines a string which will be recorded - along with any diagnostics for this operation. + Send the specified ``request`` using the optionally specified + ``identity`` for authorization. If ``identity`` is not provided, then + the request will be sent using the session identity. If the optionally + specified ``correlationId`` is supplied use it, otherwise create a + :class:`CorrelationId`. The actual :class:`CorrelationId` used is + returned. If the optionally specified ``eventQueue`` is supplied all + events relating to this :class:`Request` will arrive on that + :class:`EventQueue`. If the optional ``requestLabel`` is provided it + defines a string which will be recorded along with any diagnostics for + this operation. A successful request will generate zero or more :class:`~Event.PARTIAL_RESPONSE` :class:`Message`\ s followed by @@ -450,6 +455,9 @@ def sendRequest(self, the request fails at any stage a :class:`~Event.REQUEST_STATUS` will be generated after which the :class:`CorrelationId` associated with the request may be re-used. + + When ``identity`` is not provided, the session identity will be used if + it has been authorized. """ if correlationId is None: correlationId = CorrelationId() @@ -579,6 +587,9 @@ def createSnapshotRequestTemplate( object goes out of scope while there are still some outstanding requests left, snapshot service request template will be destroyed automatically when the last request gets a final response. + + When ``identity`` is ``None``, the session identity will be used if it + has been authorized. """ rc, template = internals.blpapi_Session_createSnapshotRequestTemplate( self.__handle, diff --git a/blpapi/sessionoptions.py b/blpapi/sessionoptions.py index c7b668e..4588c7d 100644 --- a/blpapi/sessionoptions.py +++ b/blpapi/sessionoptions.py @@ -22,6 +22,8 @@ from __future__ import absolute_import from .exception import _ExceptionUtil +from . import AuthOptions +from . import CorrelationId from . import internals from . import utils from .utils import get_handle @@ -254,8 +256,60 @@ def setMaxPendingRequests(self, maxPendingRequests): self.__handle, maxPendingRequests) + def setSessionIdentityOptions(self, + authOptions, + correlationId=None): + """Sets the specified ``authOptions`` as the :class:`AuthOptions` for + the session identity, enabling automatic authorization of the session + identity during startup. + + Args: + authOptions (AuthOptions): the authorization options to use for the + session identity. + correlationId (CorrelationId): Optional. Used to identify the + messages associated with the session identity. + + Returns: + CorrelationId: The actual :class:`CorrelationId` that identifies + the messages associated with the session identity. + + The session identity lifetime is tied to the session's lifetime, so it + is guaranteed that the session identity will remain authorized during + the entire duration of the session. The identity will be authorized + before the session starts. The session will terminate if the identity + fails to authorize or is revoked. + + The session identity is used to send requests and make subscriptions if + no other identity is provided. + + By default the session identity is not authorized. + + It is possible to pass ``None`` as ``authOptions``, to reset this value + to its default state. + """ + if correlationId is None: + correlationId = CorrelationId() + + if authOptions is None: + # Use an 'empty' authoptions instance to reset the value + retcode, authOptions_handle = internals \ + .blpapi_AuthOptions_create_default() + _ExceptionUtil.raiseOnError(retcode) + authOptions = AuthOptions(authOptions_handle) + + retcode = internals.blpapi_SessionOptions_setSessionIdentityOptions( + self._handle(), + get_handle(authOptions), + get_handle(correlationId)) + _ExceptionUtil.raiseOnError(retcode) + return correlationId + def setAuthenticationOptions(self, authOptions): - """Set the specified ``authOptions`` as authentication option.""" + """Set the specified ``authOptions`` as the authentication options. + + Args: + authOptions (str): The options used during authentication. + """ internals.blpapi_SessionOptions_setAuthenticationOptions( self.__handle, authOptions) diff --git a/blpapi/version.py b/blpapi/version.py index 8410ddd..1dc2be6 100644 --- a/blpapi/version.py +++ b/blpapi/version.py @@ -5,7 +5,7 @@ from __future__ import print_function from . import versionhelper -__version__ = "3.14.0" +__version__ = "3.15.2" def print_version(): """Print version information of BLPAPI python module and blpapi C++ SDK""" diff --git a/blpapi/versionhelper_wrap.cxx b/blpapi/versionhelper_wrap.cxx deleted file mode 100644 index 53fb4b1..0000000 --- a/blpapi/versionhelper_wrap.cxx +++ /dev/null @@ -1,4024 +0,0 @@ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 3.0.12 - * - * 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. - * ----------------------------------------------------------------------------- */ - - -#ifndef SWIGPYTHON -#define SWIGPYTHON -#endif - -#define SWIG_PYTHON_THREADS -#define SWIG_PYTHON_DIRECTOR_NO_VTABLE - - -#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. - * ----------------------------------------------------------------------------- */ - -/* template workaround for compilers that cannot correctly implement the C++ standard */ -#ifndef SWIGTEMPLATEDISAMBIGUATOR -# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) -# define SWIGTEMPLATEDISAMBIGUATOR template -# elif defined(__HP_aCC) -/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ -/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ -# define SWIGTEMPLATEDISAMBIGUATOR template -# else -# define SWIGTEMPLATEDISAMBIGUATOR -# endif -#endif - -/* inline attribute */ -#ifndef SWIGINLINE -# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) -# define SWIGINLINE inline -# else -# define SWIGINLINE -# endif -#endif - -/* attribute recognised by some compilers to avoid 'unused' warnings */ -#ifndef SWIGUNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define SWIGUNUSED __attribute__ ((__unused__)) -# else -# define SWIGUNUSED -# endif -# elif defined(__ICC) -# define SWIGUNUSED __attribute__ ((__unused__)) -# else -# define SWIGUNUSED -# endif -#endif - -#ifndef SWIG_MSC_UNSUPPRESS_4505 -# if defined(_MSC_VER) -# pragma warning(disable : 4505) /* unreferenced local function has been removed */ -# endif -#endif - -#ifndef SWIGUNUSEDPARM -# ifdef __cplusplus -# define SWIGUNUSEDPARM(p) -# else -# define SWIGUNUSEDPARM(p) p SWIGUNUSED -# endif -#endif - -/* internal SWIG method */ -#ifndef SWIGINTERN -# define SWIGINTERN static SWIGUNUSED -#endif - -/* internal inline SWIG method */ -#ifndef SWIGINTERNINLINE -# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE -#endif - -/* exporting methods */ -#if defined(__GNUC__) -# if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) -# ifndef GCC_HASCLASSVISIBILITY -# define GCC_HASCLASSVISIBILITY -# endif -# endif -#endif - -#ifndef SWIGEXPORT -# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) -# if defined(STATIC_LINKED) -# define SWIGEXPORT -# else -# define SWIGEXPORT __declspec(dllexport) -# endif -# else -# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) -# define SWIGEXPORT __attribute__ ((visibility("default"))) -# else -# define SWIGEXPORT -# endif -# endif -#endif - -/* calling conventions for Windows */ -#ifndef SWIGSTDCALL -# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) -# define SWIGSTDCALL __stdcall -# else -# define SWIGSTDCALL -# endif -#endif - -/* Deal with Microsoft's attempt at deprecating C standard runtime functions */ -#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) -# define _CRT_SECURE_NO_DEPRECATE -#endif - -/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ -#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) -# define _SCL_SECURE_NO_DEPRECATE -#endif - -/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */ -#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES) -# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0 -#endif - -/* Intel's compiler complains if a variable which was never initialised is - * cast to void, which is a common idiom which we use to indicate that we - * are aware a variable isn't used. So we just silence that warning. - * See: https://github.com/swig/swig/issues/192 for more discussion. - */ -#ifdef __INTEL_COMPILER -# pragma warning disable 592 -#endif - - -#if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG) -/* Use debug wrappers with the Python release dll */ -# undef _DEBUG -# include -# define _DEBUG -#else -# include -#endif - -/* ----------------------------------------------------------------------------- - * swigrun.swg - * - * This file contains generic C API SWIG runtime support for pointer - * type checking. - * ----------------------------------------------------------------------------- */ - -/* This should only be incremented when either the layout of swig_type_info changes, - or for whatever reason, the runtime changes incompatibly */ -#define SWIG_RUNTIME_VERSION "4" - -/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ -#ifdef SWIG_TYPE_TABLE -# define SWIG_QUOTE_STRING(x) #x -# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x) -# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE) -#else -# define SWIG_TYPE_TABLE_NAME -#endif - -/* - You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for - creating a static or dynamic library from the SWIG runtime code. - In 99.9% of the cases, SWIG just needs to declare them as 'static'. - - But only do this if strictly necessary, ie, if you have problems - with your compiler or suchlike. -*/ - -#ifndef SWIGRUNTIME -# define SWIGRUNTIME SWIGINTERN -#endif - -#ifndef SWIGRUNTIMEINLINE -# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE -#endif - -/* Generic buffer size */ -#ifndef SWIG_BUFFER_SIZE -# define SWIG_BUFFER_SIZE 1024 -#endif - -/* Flags for pointer conversions */ -#define SWIG_POINTER_DISOWN 0x1 -#define SWIG_CAST_NEW_MEMORY 0x2 - -/* Flags for new pointer objects */ -#define SWIG_POINTER_OWN 0x1 - - -/* - Flags/methods for returning states. - - The SWIG conversion methods, as ConvertPtr, return an integer - that tells if the conversion was successful or not. And if not, - an error code can be returned (see swigerrors.swg for the codes). - - Use the following macros/flags to set or process the returning - states. - - In old versions of SWIG, code such as the following was usually written: - - if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { - // success code - } else { - //fail code - } - - Now you can be more explicit: - - int res = SWIG_ConvertPtr(obj,vptr,ty.flags); - if (SWIG_IsOK(res)) { - // success code - } else { - // fail code - } - - which is the same really, but now you can also do - - Type *ptr; - int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags); - if (SWIG_IsOK(res)) { - // success code - if (SWIG_IsNewObj(res) { - ... - delete *ptr; - } else { - ... - } - } else { - // fail code - } - - I.e., now SWIG_ConvertPtr can return new objects and you can - identify the case and take care of the deallocation. Of course that - also requires SWIG_ConvertPtr to return new result values, such as - - int SWIG_ConvertPtr(obj, ptr,...) { - if () { - if () { - *ptr = ; - return SWIG_NEWOBJ; - } else { - *ptr = ; - return SWIG_OLDOBJ; - } - } else { - return SWIG_BADOBJ; - } - } - - Of course, returning the plain '0(success)/-1(fail)' still works, but you can be - more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the - 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 - - int food(double) - int fooi(int); - - and you call - - food(1) // cast rank '1' (1 -> 1.0) - fooi(1) // cast rank '0' - - just use the SWIG_AddCast()/SWIG_CheckState() -*/ - -#define SWIG_OK (0) -#define SWIG_ERROR (-1) -#define SWIG_IsOK(r) (r >= 0) -#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError) - -/* The CastRankLimit says how many bits are used for the cast rank */ -#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 */ -#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 */ -#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)) -#define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r) -#define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r) -#define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK)) - -/* Cast-Rank Mode */ -#if defined(SWIG_CASTRANK_MODE) -# ifndef SWIG_TypeRank -# define SWIG_TypeRank unsigned long -# endif -# ifndef SWIG_MAXCASTRANK /* Default cast allowed */ -# define SWIG_MAXCASTRANK (2) -# endif -# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1) -# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK) -SWIGINTERNINLINE int SWIG_AddCast(int r) { - return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r; -} -SWIGINTERNINLINE int SWIG_CheckState(int r) { - return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; -} -#else /* no cast-rank mode */ -# define SWIG_AddCast(r) (r) -# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0) -#endif - - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void *(*swig_converter_func)(void *, int *); -typedef struct swig_type_info *(*swig_dycast_func)(void **); - -/* Structure to store information on one type */ -typedef struct swig_type_info { - const char *name; /* mangled name of this type */ - const char *str; /* human readable name of this type */ - swig_dycast_func dcast; /* dynamic cast function down a hierarchy */ - struct swig_cast_info *cast; /* linked list of types that can cast into this type */ - void *clientdata; /* language specific type data */ - int owndata; /* flag if the structure owns the clientdata */ -} swig_type_info; - -/* Structure to store a type and conversion function used for casting */ -typedef struct swig_cast_info { - swig_type_info *type; /* pointer to type that is equivalent to this type */ - swig_converter_func converter; /* function to cast the void pointers */ - struct swig_cast_info *next; /* pointer to next cast in linked list */ - struct swig_cast_info *prev; /* pointer to the previous cast */ -} swig_cast_info; - -/* Structure used to store module information - * Each module generates one structure like this, and the runtime collects - * all of these structures and stores them in a circularly linked list.*/ -typedef struct swig_module_info { - swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */ - size_t size; /* Number of types in this module */ - struct swig_module_info *next; /* Pointer to next element in circularly linked list */ - swig_type_info **type_initial; /* Array of initially generated type structures */ - swig_cast_info **cast_initial; /* Array of initially generated casting structures */ - void *clientdata; /* Language specific module data */ -} swig_module_info; - -/* - Compare two type names skipping the space characters, therefore - "char*" == "char *" and "Class" == "Class", etc. - - Return 0 when the two name types are equivalent, as in - strncmp, but skipping ' '. -*/ -SWIGRUNTIME int -SWIG_TypeNameComp(const char *f1, const char *l1, - const char *f2, const char *l2) { - for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) { - while ((*f1 == ' ') && (f1 != l1)) ++f1; - while ((*f2 == ' ') && (f2 != l2)) ++f2; - if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1; - } - return (int)((l1 - f1) - (l2 - f2)); -} - -/* - Check type equivalence in a name list like ||... - Return 0 if equal, -1 if nb < tb, 1 if nb > tb -*/ -SWIGRUNTIME int -SWIG_TypeCmp(const char *nb, const char *tb) { - int equiv = 1; - const char* te = tb + strlen(tb); - const char* ne = nb; - while (equiv != 0 && *ne) { - for (nb = ne; *ne; ++ne) { - if (*ne == '|') break; - } - equiv = SWIG_TypeNameComp(nb, ne, tb, te); - if (*ne) ++ne; - } - return equiv; -} - -/* - Check type equivalence in a name list like ||... - Return 0 if not equal, 1 if equal -*/ -SWIGRUNTIME int -SWIG_TypeEquiv(const char *nb, const char *tb) { - return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0; -} - -/* - Check the typename -*/ -SWIGRUNTIME swig_cast_info * -SWIG_TypeCheck(const char *c, swig_type_info *ty) { - if (ty) { - swig_cast_info *iter = ty->cast; - while (iter) { - if (strcmp(iter->type->name, c) == 0) { - if (iter == ty->cast) - return iter; - /* Move iter to the top of the linked list */ - iter->prev->next = iter->next; - if (iter->next) - iter->next->prev = iter->prev; - iter->next = ty->cast; - iter->prev = 0; - if (ty->cast) ty->cast->prev = iter; - ty->cast = iter; - return iter; - } - iter = iter->next; - } - } - return 0; -} - -/* - 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) { - if (ty) { - swig_cast_info *iter = ty->cast; - while (iter) { - if (iter->type == from) { - if (iter == ty->cast) - return iter; - /* Move iter to the top of the linked list */ - iter->prev->next = iter->next; - if (iter->next) - iter->next->prev = iter->prev; - iter->next = ty->cast; - iter->prev = 0; - if (ty->cast) ty->cast->prev = iter; - ty->cast = iter; - return iter; - } - iter = iter->next; - } - } - return 0; -} - -/* - Cast a pointer up an inheritance hierarchy -*/ -SWIGRUNTIMEINLINE void * -SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) { - return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory); -} - -/* - Dynamic pointer casting. Down an inheritance hierarchy -*/ -SWIGRUNTIME swig_type_info * -SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) { - swig_type_info *lastty = ty; - if (!ty || !ty->dcast) return ty; - while (ty && (ty->dcast)) { - ty = (*ty->dcast)(ptr); - if (ty) lastty = ty; - } - return lastty; -} - -/* - Return the name associated with this type -*/ -SWIGRUNTIMEINLINE const char * -SWIG_TypeName(const swig_type_info *ty) { - return ty->name; -} - -/* - Return the pretty name associated with this type, - that is an unmangled type name in a form presentable to the user. -*/ -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. */ - if (!type) return NULL; - if (type->str != NULL) { - const char *last_name = type->str; - const char *s; - for (s = type->str; *s; s++) - if (*s == '|') last_name = s+1; - return last_name; - } - else - return type->name; -} - -/* - Set the clientdata field for a type -*/ -SWIGRUNTIME void -SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { - swig_cast_info *cast = ti->cast; - /* if (ti->clientdata == clientdata) return; */ - ti->clientdata = clientdata; - - while (cast) { - if (!cast->converter) { - swig_type_info *tc = cast->type; - if (!tc->clientdata) { - SWIG_TypeClientData(tc, clientdata); - } - } - cast = cast->next; - } -} -SWIGRUNTIME void -SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) { - SWIG_TypeClientData(ti, clientdata); - ti->owndata = 1; -} - -/* - Search for a swig_type_info structure only by mangled name - Search is a O(log #types) - - We start searching at module start, and finish searching when start == end. - Note: if start == end at the beginning of the function, we go all the way around - the circular list. -*/ -SWIGRUNTIME swig_type_info * -SWIG_MangledTypeQueryModule(swig_module_info *start, - swig_module_info *end, - const char *name) { - swig_module_info *iter = start; - do { - if (iter->size) { - size_t l = 0; - size_t r = iter->size - 1; - do { - /* since l+r >= 0, we can (>> 1) instead (/ 2) */ - size_t i = (l + r) >> 1; - const char *iname = iter->types[i]->name; - if (iname) { - int compare = strcmp(name, iname); - if (compare == 0) { - return iter->types[i]; - } else if (compare < 0) { - if (i) { - r = i - 1; - } else { - break; - } - } else if (compare > 0) { - l = i + 1; - } - } else { - break; /* should never happen */ - } - } while (l <= r); - } - iter = iter->next; - } while (iter != end); - return 0; -} - -/* - Search for a swig_type_info structure for either a mangled name or a human readable name. - It first searches the mangled names of the types, which is a O(log #types) - If a type is not found it then searches the human readable names, which is O(#types). - - We start searching at module start, and finish searching when start == end. - Note: if start == end at the beginning of the function, we go all the way around - the circular list. -*/ -SWIGRUNTIME swig_type_info * -SWIG_TypeQueryModule(swig_module_info *start, - swig_module_info *end, - const char *name) { - /* STEP 1: Search the name field using binary search */ - swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name); - if (ret) { - return ret; - } else { - /* STEP 2: If the type hasn't been found, do a complete search - of the str field (the human readable name) */ - swig_module_info *iter = start; - do { - size_t i = 0; - for (; i < iter->size; ++i) { - if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name))) - return iter->types[i]; - } - iter = iter->next; - } while (iter != end); - } - - /* neither found a match */ - return 0; -} - -/* - Pack binary data into a string -*/ -SWIGRUNTIME char * -SWIG_PackData(char *c, void *ptr, size_t sz) { - static const char hex[17] = "0123456789abcdef"; - const unsigned char *u = (unsigned char *) ptr; - const unsigned char *eu = u + sz; - for (; u != eu; ++u) { - unsigned char uu = *u; - *(c++) = hex[(uu & 0xf0) >> 4]; - *(c++) = hex[uu & 0xf]; - } - return c; -} - -/* - Unpack binary data from a string -*/ -SWIGRUNTIME const char * -SWIG_UnpackData(const char *c, void *ptr, size_t sz) { - unsigned char *u = (unsigned char *) ptr; - const unsigned char *eu = u + sz; - for (; u != eu; ++u) { - char d = *(c++); - unsigned char uu; - if ((d >= '0') && (d <= '9')) - uu = (unsigned char)((d - '0') << 4); - else if ((d >= 'a') && (d <= 'f')) - uu = (unsigned char)((d - ('a'-10)) << 4); - else - return (char *) 0; - d = *(c++); - if ((d >= '0') && (d <= '9')) - uu |= (unsigned char)(d - '0'); - else if ((d >= 'a') && (d <= 'f')) - uu |= (unsigned char)(d - ('a'-10)); - else - return (char *) 0; - *u = uu; - } - return c; -} - -/* - Pack 'void *' into a string buffer. -*/ -SWIGRUNTIME char * -SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) { - char *r = buff; - if ((2*sizeof(void *) + 2) > bsz) return 0; - *(r++) = '_'; - r = SWIG_PackData(r,&ptr,sizeof(void *)); - if (strlen(name) + 1 > (bsz - (r - buff))) return 0; - strcpy(r,name); - return buff; -} - -SWIGRUNTIME const char * -SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) { - if (*c != '_') { - if (strcmp(c,"NULL") == 0) { - *ptr = (void *) 0; - return name; - } else { - return 0; - } - } - return SWIG_UnpackData(++c,ptr,sizeof(void *)); -} - -SWIGRUNTIME char * -SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) { - char *r = buff; - size_t lname = (name ? strlen(name) : 0); - if ((2*sz + 2 + lname) > bsz) return 0; - *(r++) = '_'; - r = SWIG_PackData(r,ptr,sz); - if (lname) { - strncpy(r,name,lname+1); - } else { - *r = 0; - } - return buff; -} - -SWIGRUNTIME const char * -SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { - if (*c != '_') { - if (strcmp(c,"NULL") == 0) { - memset(ptr,0,sz); - return name; - } else { - return 0; - } - } - return SWIG_UnpackData(++c,ptr,sz); -} - -#ifdef __cplusplus -} -#endif - -/* Errors in SWIG */ -#define SWIG_UnknownError -1 -#define SWIG_IOError -2 -#define SWIG_RuntimeError -3 -#define SWIG_IndexError -4 -#define SWIG_TypeError -5 -#define SWIG_DivisionByZero -6 -#define SWIG_OverflowError -7 -#define SWIG_SyntaxError -8 -#define SWIG_ValueError -9 -#define SWIG_SystemError -10 -#define SWIG_AttributeError -11 -#define SWIG_MemoryError -12 -#define SWIG_NullReferenceError -13 - - - -/* Compatibility macros for Python 3 */ -#if PY_VERSION_HEX >= 0x03000000 - -#define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type) -#define PyInt_Check(x) PyLong_Check(x) -#define PyInt_AsLong(x) PyLong_AsLong(x) -#define PyInt_FromLong(x) PyLong_FromLong(x) -#define PyInt_FromSize_t(x) PyLong_FromSize_t(x) -#define PyString_Check(name) PyBytes_Check(name) -#define PyString_FromString(x) PyUnicode_FromString(x) -#define PyString_Format(fmt, args) PyUnicode_Format(fmt, args) -#define PyString_AsString(str) PyBytes_AsString(str) -#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 - -#ifndef Py_TYPE -# define Py_TYPE(op) ((op)->ob_type) -#endif - -/* SWIG APIs for compatibility of both Python 2 & 3 */ - -#if PY_VERSION_HEX >= 0x03000000 -# define SWIG_Python_str_FromFormat PyUnicode_FromFormat -#else -# define SWIG_Python_str_FromFormat PyString_FromFormat -#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 >= 0x03000000 - char *cstr; - char *newstr; - Py_ssize_t len; - str = PyUnicode_AsUTF8String(str); - PyBytes_AsStringAndSize(str, &cstr, &len); - newstr = (char *) malloc(len+1); - memcpy(newstr, cstr, len+1); - Py_XDECREF(str); - return newstr; -#else - return PyString_AsString(str); -#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) -{ -#if PY_VERSION_HEX >= 0x03000000 - return PyUnicode_FromString(c); -#else - return PyString_FromString(c); -#endif -} - -/* Add PyOS_snprintf for old Pythons */ -#if PY_VERSION_HEX < 0x02020000 -# if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM) -# define PyOS_snprintf _snprintf -# else -# define PyOS_snprintf snprintf -# endif -#endif - -/* A crude PyString_FromFormat implementation for old Pythons */ -#if PY_VERSION_HEX < 0x02020000 - -#ifndef SWIG_PYBUFFER_SIZE -# define SWIG_PYBUFFER_SIZE 1024 -#endif - -static PyObject * -PyString_FromFormat(const char *fmt, ...) { - va_list ap; - char buf[SWIG_PYBUFFER_SIZE * 2]; - int res; - va_start(ap, fmt); - res = vsnprintf(buf, sizeof(buf), fmt, ap); - va_end(ap); - return (res < 0 || res >= (int)sizeof(buf)) ? 0 : PyString_FromString(buf); -} -#endif - -#ifndef PyObject_DEL -# define PyObject_DEL PyObject_Del -#endif - -/* A crude PyExc_StopIteration exception for old Pythons */ -#if PY_VERSION_HEX < 0x02020000 -# ifndef PyExc_StopIteration -# define PyExc_StopIteration PyExc_RuntimeError -# endif -# ifndef PyObject_GenericGetAttr -# define PyObject_GenericGetAttr 0 -# endif -#endif - -/* Py_NotImplemented is defined in 2.1 and up. */ -#if PY_VERSION_HEX < 0x02010000 -# ifndef Py_NotImplemented -# define Py_NotImplemented PyExc_RuntimeError -# endif -#endif - -/* A crude PyString_AsStringAndSize implementation for old Pythons */ -#if PY_VERSION_HEX < 0x02010000 -# ifndef PyString_AsStringAndSize -# define PyString_AsStringAndSize(obj, s, len) {*s = PyString_AsString(obj); *len = *s ? strlen(*s) : 0;} -# endif -#endif - -/* PySequence_Size for old Pythons */ -#if PY_VERSION_HEX < 0x02000000 -# ifndef PySequence_Size -# define PySequence_Size PySequence_Length -# endif -#endif - -/* PyBool_FromLong for old Pythons */ -#if PY_VERSION_HEX < 0x02030000 -static -PyObject *PyBool_FromLong(long ok) -{ - PyObject *result = ok ? Py_True : Py_False; - Py_INCREF(result); - return result; -} -#endif - -/* Py_ssize_t for old Pythons */ -/* This code is as recommended by: */ -/* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */ -#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) -typedef int Py_ssize_t; -# define PY_SSIZE_T_MAX INT_MAX -# define PY_SSIZE_T_MIN INT_MIN -typedef inquiry lenfunc; -typedef intargfunc ssizeargfunc; -typedef intintargfunc ssizessizeargfunc; -typedef intobjargproc ssizeobjargproc; -typedef intintobjargproc ssizessizeobjargproc; -typedef getreadbufferproc readbufferproc; -typedef getwritebufferproc writebufferproc; -typedef getsegcountproc segcountproc; -typedef getcharbufferproc charbufferproc; -static long PyNumber_AsSsize_t (PyObject *x, void *SWIGUNUSEDPARM(exc)) -{ - long result = 0; - PyObject *i = PyNumber_Int(x); - if (i) { - result = PyInt_AsLong(i); - Py_DECREF(i); - } - return result; -} -#endif - -#if PY_VERSION_HEX < 0x02050000 -#define PyInt_FromSize_t(x) PyInt_FromLong((long)x) -#endif - -#if PY_VERSION_HEX < 0x02040000 -#define Py_VISIT(op) \ - do { \ - if (op) { \ - int vret = visit((op), arg); \ - if (vret) \ - return vret; \ - } \ - } while (0) -#endif - -#if PY_VERSION_HEX < 0x02030000 -typedef struct { - PyTypeObject type; - PyNumberMethods as_number; - PyMappingMethods as_mapping; - PySequenceMethods as_sequence; - PyBufferProcs as_buffer; - PyObject *name, *slots; -} PyHeapTypeObject; -#endif - -#if PY_VERSION_HEX < 0x02030000 -typedef destructor freefunc; -#endif - -#if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION > 6) || \ - (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION > 0) || \ - (PY_MAJOR_VERSION > 3)) -# define SWIGPY_USE_CAPSULE -# define SWIGPY_CAPSULE_NAME ((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME) -#endif - -#if PY_VERSION_HEX < 0x03020000 -#define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type) -#define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name) -#define Py_hash_t long -#endif - -/* ----------------------------------------------------------------------------- - * error manipulation - * ----------------------------------------------------------------------------- */ - -SWIGRUNTIME PyObject* -SWIG_Python_ErrorType(int code) { - PyObject* type = 0; - switch(code) { - case SWIG_MemoryError: - type = PyExc_MemoryError; - break; - case SWIG_IOError: - type = PyExc_IOError; - break; - case SWIG_RuntimeError: - type = PyExc_RuntimeError; - break; - case SWIG_IndexError: - type = PyExc_IndexError; - break; - case SWIG_TypeError: - type = PyExc_TypeError; - break; - case SWIG_DivisionByZero: - type = PyExc_ZeroDivisionError; - break; - case SWIG_OverflowError: - type = PyExc_OverflowError; - break; - case SWIG_SyntaxError: - type = PyExc_SyntaxError; - break; - case SWIG_ValueError: - type = PyExc_ValueError; - break; - case SWIG_SystemError: - type = PyExc_SystemError; - break; - case SWIG_AttributeError: - type = PyExc_AttributeError; - break; - default: - type = PyExc_RuntimeError; - } - return type; -} - - -SWIGRUNTIME void -SWIG_Python_AddErrorMsg(const char* mesg) -{ - PyObject *type = 0; - PyObject *value = 0; - PyObject *traceback = 0; - - if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback); - if (value) { - char *tmp; - PyObject *old_str = PyObject_Str(value); - PyErr_Clear(); - Py_XINCREF(type); - - PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); - SWIG_Python_str_DelForPy3(tmp); - Py_DECREF(old_str); - Py_DECREF(value); - } else { - PyErr_SetString(PyExc_RuntimeError, mesg); - } -} - -#if defined(SWIG_PYTHON_NO_THREADS) -# if defined(SWIG_PYTHON_THREADS) -# undef SWIG_PYTHON_THREADS -# endif -#endif -#if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */ -# if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL) -# if (PY_VERSION_HEX >= 0x02030000) /* For 2.3 or later, use the PyGILState calls */ -# define SWIG_PYTHON_USE_GIL -# endif -# endif -# if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */ -# ifndef SWIG_PYTHON_INITIALIZE_THREADS -# define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads() -# endif -# ifdef __cplusplus /* C++ code */ - class SWIG_Python_Thread_Block { - bool status; - PyGILState_STATE state; - public: - void end() { if (status) { PyGILState_Release(state); status = false;} } - SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {} - ~SWIG_Python_Thread_Block() { end(); } - }; - class SWIG_Python_Thread_Allow { - bool status; - PyThreadState *save; - public: - void end() { if (status) { PyEval_RestoreThread(save); status = false; }} - SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {} - ~SWIG_Python_Thread_Allow() { end(); } - }; -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK SWIG_Python_Thread_Block _swig_thread_block -# define SWIG_PYTHON_THREAD_END_BLOCK _swig_thread_block.end() -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW SWIG_Python_Thread_Allow _swig_thread_allow -# define SWIG_PYTHON_THREAD_END_ALLOW _swig_thread_allow.end() -# else /* C code */ -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK PyGILState_STATE _swig_thread_block = PyGILState_Ensure() -# define SWIG_PYTHON_THREAD_END_BLOCK PyGILState_Release(_swig_thread_block) -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW PyThreadState *_swig_thread_allow = PyEval_SaveThread() -# define SWIG_PYTHON_THREAD_END_ALLOW PyEval_RestoreThread(_swig_thread_allow) -# endif -# else /* Old thread way, not implemented, user must provide it */ -# if !defined(SWIG_PYTHON_INITIALIZE_THREADS) -# define SWIG_PYTHON_INITIALIZE_THREADS -# endif -# if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK) -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK -# endif -# if !defined(SWIG_PYTHON_THREAD_END_BLOCK) -# define SWIG_PYTHON_THREAD_END_BLOCK -# endif -# if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW) -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW -# endif -# if !defined(SWIG_PYTHON_THREAD_END_ALLOW) -# define SWIG_PYTHON_THREAD_END_ALLOW -# endif -# endif -#else /* No thread support */ -# define SWIG_PYTHON_INITIALIZE_THREADS -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK -# define SWIG_PYTHON_THREAD_END_BLOCK -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW -# define SWIG_PYTHON_THREAD_END_ALLOW -#endif - -/* ----------------------------------------------------------------------------- - * Python API portion that goes into the runtime - * ----------------------------------------------------------------------------- */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* ----------------------------------------------------------------------------- - * Constant declarations - * ----------------------------------------------------------------------------- */ - -/* Constant Types */ -#define SWIG_PY_POINTER 4 -#define SWIG_PY_BINARY 5 - -/* Constant information structure */ -typedef struct swig_const_info { - int type; - char *name; - long lvalue; - double dvalue; - void *pvalue; - swig_type_info **ptype; -} swig_const_info; - - -/* ----------------------------------------------------------------------------- - * Wrapper of PyInstanceMethod_New() used in Python 3 - * It is exported to the generated module, used for -fastproxy - * ----------------------------------------------------------------------------- */ -#if PY_VERSION_HEX >= 0x03000000 -SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) -{ - return PyInstanceMethod_New(func); -} -#else -SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *SWIGUNUSEDPARM(func)) -{ - return NULL; -} -#endif - -#ifdef __cplusplus -} -#endif - - -/* ----------------------------------------------------------------------------- - * pyrun.swg - * - * This file contains the runtime support for Python modules - * and includes code for managing global variables and pointer - * type checking. - * - * ----------------------------------------------------------------------------- */ - -/* Common SWIG API */ - -/* for raw pointers */ -#define SWIG_Python_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0) -#define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtr(obj, pptr, type, flags) -#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own) - -#ifdef SWIGPYTHON_BUILTIN -#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(self, ptr, type, flags) -#else -#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags) -#endif - -#define SWIG_InternalNewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags) - -#define SWIG_CheckImplicit(ty) SWIG_Python_CheckImplicit(ty) -#define SWIG_AcquirePtr(ptr, src) SWIG_Python_AcquirePtr(ptr, src) -#define swig_owntype int - -/* for raw packed data */ -#define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) - -/* for class or struct pointers */ -#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags) -#define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags) - -/* for C or C++ function pointers */ -#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_Python_ConvertFunctionPtr(obj, pptr, type) -#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Python_NewPointerObj(NULL, ptr, type, 0) - -/* for C++ member pointers, ie, member methods */ -#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewMemberObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) - - -/* Runtime API */ - -#define SWIG_GetModule(clientdata) SWIG_Python_GetModule(clientdata) -#define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer) -#define SWIG_NewClientData(obj) SwigPyClientData_New(obj) - -#define SWIG_SetErrorObj SWIG_Python_SetErrorObj -#define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg -#define SWIG_ErrorType(code) SWIG_Python_ErrorType(code) -#define SWIG_Error(code, msg) SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg) -#define SWIG_fail goto fail - - -/* Runtime API implementation */ - -/* Error manipulation */ - -SWIGINTERN void -SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - PyErr_SetObject(errtype, obj); - Py_DECREF(obj); - SWIG_PYTHON_THREAD_END_BLOCK; -} - -SWIGINTERN void -SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - PyErr_SetString(errtype, msg); - SWIG_PYTHON_THREAD_END_BLOCK; -} - -#define SWIG_Python_Raise(obj, type, desc) SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj) - -/* Set a constant value */ - -#if defined(SWIGPYTHON_BUILTIN) - -SWIGINTERN void -SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) { - PyObject *s = PyString_InternFromString(key); - PyList_Append(seq, s); - Py_DECREF(s); -} - -SWIGINTERN void -SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) { -#if PY_VERSION_HEX < 0x02030000 - PyDict_SetItemString(d, (char *)name, obj); -#else - PyDict_SetItemString(d, name, obj); -#endif - Py_DECREF(obj); - if (public_interface) - SwigPyBuiltin_AddPublicSymbol(public_interface, name); -} - -#else - -SWIGINTERN void -SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) { -#if PY_VERSION_HEX < 0x02030000 - PyDict_SetItemString(d, (char *)name, obj); -#else - PyDict_SetItemString(d, name, obj); -#endif - Py_DECREF(obj); -} - -#endif - -/* Append a value to the result obj */ - -SWIGINTERN PyObject* -SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) { -#if !defined(SWIG_PYTHON_OUTPUT_TUPLE) - if (!result) { - result = obj; - } else if (result == Py_None) { - Py_DECREF(result); - result = obj; - } else { - if (!PyList_Check(result)) { - PyObject *o2 = result; - result = PyList_New(1); - PyList_SetItem(result, 0, o2); - } - PyList_Append(result,obj); - Py_DECREF(obj); - } - return result; -#else - PyObject* o2; - PyObject* o3; - if (!result) { - result = obj; - } else if (result == Py_None) { - Py_DECREF(result); - result = obj; - } else { - if (!PyTuple_Check(result)) { - o2 = result; - result = PyTuple_New(1); - PyTuple_SET_ITEM(result, 0, o2); - } - o3 = PyTuple_New(1); - PyTuple_SET_ITEM(o3, 0, obj); - o2 = result; - result = PySequence_Concat(o2, o3); - Py_DECREF(o2); - Py_DECREF(o3); - } - return result; -#endif -} - -/* Unpack the argument tuple */ - -SWIGINTERN Py_ssize_t -SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs) -{ - if (!args) { - if (!min && !max) { - return 1; - } else { - PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none", - name, (min == max ? "" : "at least "), (int)min); - return 0; - } - } - if (!PyTuple_Check(args)) { - if (min <= 1 && max >= 1) { - Py_ssize_t i; - objs[0] = args; - for (i = 1; i < max; ++i) { - objs[i] = 0; - } - return 2; - } - PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple"); - return 0; - } else { - Py_ssize_t l = PyTuple_GET_SIZE(args); - if (l < min) { - PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", - name, (min == max ? "" : "at least "), (int)min, (int)l); - return 0; - } else if (l > max) { - PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", - name, (min == max ? "" : "at most "), (int)max, (int)l); - return 0; - } else { - Py_ssize_t i; - for (i = 0; i < l; ++i) { - objs[i] = PyTuple_GET_ITEM(args, i); - } - for (; l < max; ++l) { - objs[l] = 0; - } - return i + 1; - } - } -} - -/* A functor is a function object with one single object argument */ -#if PY_VERSION_HEX >= 0x02020000 -#define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL); -#else -#define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunction(functor, "O", obj); -#endif - -/* - Helper for static pointer initialization for both C and C++ code, for example - static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...); -*/ -#ifdef __cplusplus -#define SWIG_STATIC_POINTER(var) var -#else -#define SWIG_STATIC_POINTER(var) var = 0; if (!var) var -#endif - -/* ----------------------------------------------------------------------------- - * Pointer declarations - * ----------------------------------------------------------------------------- */ - -/* Flags for new pointer objects */ -#define SWIG_POINTER_NOSHADOW (SWIG_POINTER_OWN << 1) -#define SWIG_POINTER_NEW (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN) - -#define SWIG_POINTER_IMPLICIT_CONV (SWIG_POINTER_DISOWN << 1) - -#define SWIG_BUILTIN_TP_INIT (SWIG_POINTER_OWN << 2) -#define SWIG_BUILTIN_INIT (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN) - -#ifdef __cplusplus -extern "C" { -#endif - -/* How to access Py_None */ -#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) -# ifndef SWIG_PYTHON_NO_BUILD_NONE -# ifndef SWIG_PYTHON_BUILD_NONE -# define SWIG_PYTHON_BUILD_NONE -# endif -# endif -#endif - -#ifdef SWIG_PYTHON_BUILD_NONE -# ifdef Py_None -# undef Py_None -# define Py_None SWIG_Py_None() -# endif -SWIGRUNTIMEINLINE PyObject * -_SWIG_Py_None(void) -{ - PyObject *none = Py_BuildValue((char*)""); - Py_DECREF(none); - return none; -} -SWIGRUNTIME PyObject * -SWIG_Py_None(void) -{ - static PyObject *SWIG_STATIC_POINTER(none) = _SWIG_Py_None(); - return none; -} -#endif - -/* The python void return value */ - -SWIGRUNTIMEINLINE PyObject * -SWIG_Py_Void(void) -{ - PyObject *none = Py_None; - Py_INCREF(none); - return none; -} - -/* SwigPyClientData */ - -typedef struct { - PyObject *klass; - PyObject *newraw; - PyObject *newargs; - PyObject *destroy; - int delargs; - int implicitconv; - PyTypeObject *pytype; -} SwigPyClientData; - -SWIGRUNTIMEINLINE int -SWIG_Python_CheckImplicit(swig_type_info *ty) -{ - SwigPyClientData *data = (SwigPyClientData *)ty->clientdata; - return data ? data->implicitconv : 0; -} - -SWIGRUNTIMEINLINE PyObject * -SWIG_Python_ExceptionType(swig_type_info *desc) { - SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0; - PyObject *klass = data ? data->klass : 0; - return (klass ? klass : PyExc_RuntimeError); -} - - -SWIGRUNTIME SwigPyClientData * -SwigPyClientData_New(PyObject* obj) -{ - if (!obj) { - return 0; - } else { - SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData)); - /* the klass element */ - data->klass = obj; - Py_INCREF(data->klass); - /* 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); - } else { -#if (PY_VERSION_HEX < 0x02020000) - data->newraw = 0; -#else - data->newraw = PyObject_GetAttrString(data->klass, (char *)"__new__"); -#endif - if (data->newraw) { - Py_INCREF(data->newraw); - data->newargs = PyTuple_New(1); - PyTuple_SetItem(data->newargs, 0, obj); - } else { - data->newargs = obj; - } - Py_INCREF(data->newargs); - } - /* the destroy method, aka as the C++ delete method */ - data->destroy = PyObject_GetAttrString(data->klass, (char *)"__swig_destroy__"); - if (PyErr_Occurred()) { - PyErr_Clear(); - data->destroy = 0; - } - if (data->destroy) { - int flags; - Py_INCREF(data->destroy); - flags = PyCFunction_GET_FLAGS(data->destroy); -#ifdef METH_O - data->delargs = !(flags & (METH_O)); -#else - data->delargs = 0; -#endif - } else { - data->delargs = 0; - } - data->implicitconv = 0; - data->pytype = 0; - return data; - } -} - -SWIGRUNTIME void -SwigPyClientData_Del(SwigPyClientData *data) { - Py_XDECREF(data->newraw); - Py_XDECREF(data->newargs); - Py_XDECREF(data->destroy); -} - -/* =============== SwigPyObject =====================*/ - -typedef struct { - PyObject_HEAD - void *ptr; - swig_type_info *ty; - int own; - PyObject *next; -#ifdef SWIGPYTHON_BUILTIN - PyObject *dict; -#endif -} SwigPyObject; - - -#ifdef SWIGPYTHON_BUILTIN - -SWIGRUNTIME PyObject * -SwigPyObject_get___dict__(PyObject *v, PyObject *SWIGUNUSEDPARM(args)) -{ - SwigPyObject *sobj = (SwigPyObject *)v; - - if (!sobj->dict) - sobj->dict = PyDict_New(); - - Py_INCREF(sobj->dict); - return sobj->dict; -} - -#endif - -SWIGRUNTIME PyObject * -SwigPyObject_long(SwigPyObject *v) -{ - return PyLong_FromVoidPtr(v->ptr); -} - -SWIGRUNTIME PyObject * -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); - if (ofmt) { -#if PY_VERSION_HEX >= 0x03000000 - res = PyUnicode_Format(ofmt,args); -#else - res = PyString_Format(ofmt,args); -#endif - Py_DECREF(ofmt); - } - Py_DECREF(args); - } - } - return res; -} - -SWIGRUNTIME PyObject * -SwigPyObject_oct(SwigPyObject *v) -{ - return SwigPyObject_format("%o",v); -} - -SWIGRUNTIME PyObject * -SwigPyObject_hex(SwigPyObject *v) -{ - return SwigPyObject_format("%x",v); -} - -SWIGRUNTIME PyObject * -#ifdef METH_NOARGS -SwigPyObject_repr(SwigPyObject *v) -#else -SwigPyObject_repr(SwigPyObject *v, PyObject *args) -#endif -{ - const char *name = SWIG_TypePrettyName(v->ty); - PyObject *repr = SWIG_Python_str_FromFormat("", (name ? name : "unknown"), (void *)v); - if (v->next) { -# ifdef METH_NOARGS - PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next); -# else - PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args); -# endif -# if PY_VERSION_HEX >= 0x03000000 - PyObject *joined = PyUnicode_Concat(repr, nrep); - Py_DecRef(repr); - Py_DecRef(nrep); - repr = joined; -# else - PyString_ConcatAndDel(&repr,nrep); -# endif - } - return repr; -} - -SWIGRUNTIME int -SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w) -{ - void *i = v->ptr; - void *j = w->ptr; - return (i < j) ? -1 : ((i > j) ? 1 : 0); -} - -/* Added for Python 3.x, would it also be useful for Python 2.x? */ -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; - } - res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0); - return res; -} - - -SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void); - -#ifdef SWIGPYTHON_BUILTIN -static swig_type_info *SwigPyObject_stype = 0; -SWIGRUNTIME PyTypeObject* -SwigPyObject_type(void) { - SwigPyClientData *cd; - assert(SwigPyObject_stype); - cd = (SwigPyClientData*) SwigPyObject_stype->clientdata; - assert(cd); - assert(cd->pytype); - return cd->pytype; -} -#else -SWIGRUNTIME PyTypeObject* -SwigPyObject_type(void) { - static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyObject_TypeOnce(); - return type; -} -#endif - -SWIGRUNTIMEINLINE int -SwigPyObject_Check(PyObject *op) { -#ifdef SWIGPYTHON_BUILTIN - PyTypeObject *target_tp = SwigPyObject_type(); - if (PyType_IsSubtype(op->ob_type, target_tp)) - return 1; - return (strcmp(op->ob_type->tp_name, "SwigPyObject") == 0); -#else - return (Py_TYPE(op) == SwigPyObject_type()) - || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0); -#endif -} - -SWIGRUNTIME PyObject * -SwigPyObject_New(void *ptr, swig_type_info *ty, int own); - -SWIGRUNTIME void -SwigPyObject_dealloc(PyObject *v) -{ - SwigPyObject *sobj = (SwigPyObject *) v; - PyObject *next = sobj->next; - if (sobj->own == SWIG_POINTER_OWN) { - swig_type_info *ty = sobj->ty; - SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; - PyObject *destroy = data ? data->destroy : 0; - if (destroy) { - /* destroy is always a VARARGS method */ - PyObject *res; - - /* PyObject_CallFunction() has the potential to silently drop - the active active exception. In cases of unnamed temporary - variable or where we just finished iterating over a generator - StopIteration will be active right now, and this needs to - remain true upon return from SwigPyObject_dealloc. So save - and restore. */ - - PyObject *val = NULL, *type = NULL, *tb = NULL; - PyErr_Fetch(&val, &type, &tb); - - 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); - } else { - PyCFunction meth = PyCFunction_GET_FUNCTION(destroy); - PyObject *mself = PyCFunction_GET_SELF(destroy); - res = ((*meth)(mself, v)); - } - if (!res) - PyErr_WriteUnraisable(destroy); - - PyErr_Restore(val, type, tb); - - Py_XDECREF(res); - } -#if !defined(SWIG_PYTHON_SILENT_MEMLEAK) - else { - const char *name = SWIG_TypePrettyName(ty); - printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown")); - } -#endif - } - Py_XDECREF(next); - PyObject_DEL(v); -} - -SWIGRUNTIME PyObject* -SwigPyObject_append(PyObject* v, PyObject* next) -{ - SwigPyObject *sobj = (SwigPyObject *) v; -#ifndef METH_O - PyObject *tmp = 0; - if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL; - next = tmp; -#endif - if (!SwigPyObject_Check(next)) { - PyErr_SetString(PyExc_TypeError, "Attempt to append a non SwigPyObject"); - return NULL; - } - sobj->next = next; - Py_INCREF(next); - return SWIG_Py_Void(); -} - -SWIGRUNTIME PyObject* -#ifdef METH_NOARGS -SwigPyObject_next(PyObject* v) -#else -SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) -#endif -{ - SwigPyObject *sobj = (SwigPyObject *) v; - if (sobj->next) { - Py_INCREF(sobj->next); - return sobj->next; - } else { - return SWIG_Py_Void(); - } -} - -SWIGINTERN PyObject* -#ifdef METH_NOARGS -SwigPyObject_disown(PyObject *v) -#else -SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) -#endif -{ - SwigPyObject *sobj = (SwigPyObject *)v; - sobj->own = 0; - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject* -#ifdef METH_NOARGS -SwigPyObject_acquire(PyObject *v) -#else -SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) -#endif -{ - SwigPyObject *sobj = (SwigPyObject *)v; - sobj->own = SWIG_POINTER_OWN; - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject* -SwigPyObject_own(PyObject *v, PyObject *args) -{ - PyObject *val = 0; -#if (PY_VERSION_HEX < 0x02020000) - if (!PyArg_ParseTuple(args,(char *)"|O:own",&val)) -#elif (PY_VERSION_HEX < 0x02050000) - if (!PyArg_UnpackTuple(args, (char *)"own", 0, 1, &val)) -#else - if (!PyArg_UnpackTuple(args, "own", 0, 1, &val)) -#endif - { - return NULL; - } - else - { - SwigPyObject *sobj = (SwigPyObject *)v; - PyObject *obj = PyBool_FromLong(sobj->own); - if (val) { -#ifdef METH_NOARGS - if (PyObject_IsTrue(val)) { - SwigPyObject_acquire(v); - } else { - SwigPyObject_disown(v); - } -#else - if (PyObject_IsTrue(val)) { - SwigPyObject_acquire(v,args); - } else { - SwigPyObject_disown(v,args); - } -#endif - } - return obj; - } -} - -#ifdef METH_O -static PyMethodDef -swigobject_methods[] = { - {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"}, - {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS, (char *)"acquires ownership of the pointer"}, - {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, - {(char *)"append", (PyCFunction)SwigPyObject_append, METH_O, (char *)"appends another 'this' object"}, - {(char *)"next", (PyCFunction)SwigPyObject_next, METH_NOARGS, (char *)"returns the next 'this' object"}, - {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_NOARGS, (char *)"returns object representation"}, - {0, 0, 0, 0} -}; -#else -static PyMethodDef -swigobject_methods[] = { - {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"}, - {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS, (char *)"acquires ownership of the pointer"}, - {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, - {(char *)"append", (PyCFunction)SwigPyObject_append, METH_VARARGS, (char *)"appends another 'this' object"}, - {(char *)"next", (PyCFunction)SwigPyObject_next, METH_VARARGS, (char *)"returns the next 'this' object"}, - {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_VARARGS, (char *)"returns object representation"}, - {0, 0, 0, 0} -}; -#endif - -#if PY_VERSION_HEX < 0x02020000 -SWIGINTERN PyObject * -SwigPyObject_getattr(SwigPyObject *sobj,char *name) -{ - return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name); -} -#endif - -SWIGRUNTIME PyTypeObject* -SwigPyObject_TypeOnce(void) { - static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer"; - - static PyNumberMethods SwigPyObject_as_number = { - (binaryfunc)0, /*nb_add*/ - (binaryfunc)0, /*nb_subtract*/ - (binaryfunc)0, /*nb_multiply*/ - /* nb_divide removed in Python 3 */ -#if PY_VERSION_HEX < 0x03000000 - (binaryfunc)0, /*nb_divide*/ -#endif - (binaryfunc)0, /*nb_remainder*/ - (binaryfunc)0, /*nb_divmod*/ - (ternaryfunc)0,/*nb_power*/ - (unaryfunc)0, /*nb_negative*/ - (unaryfunc)0, /*nb_positive*/ - (unaryfunc)0, /*nb_absolute*/ - (inquiry)0, /*nb_nonzero*/ - 0, /*nb_invert*/ - 0, /*nb_lshift*/ - 0, /*nb_rshift*/ - 0, /*nb_and*/ - 0, /*nb_xor*/ - 0, /*nb_or*/ -#if PY_VERSION_HEX < 0x03000000 - 0, /*nb_coerce*/ -#endif - (unaryfunc)SwigPyObject_long, /*nb_int*/ -#if PY_VERSION_HEX < 0x03000000 - (unaryfunc)SwigPyObject_long, /*nb_long*/ -#else - 0, /*nb_reserved*/ -#endif - (unaryfunc)0, /*nb_float*/ -#if PY_VERSION_HEX < 0x03000000 - (unaryfunc)SwigPyObject_oct, /*nb_oct*/ - (unaryfunc)SwigPyObject_hex, /*nb_hex*/ -#endif -#if PY_VERSION_HEX >= 0x03050000 /* 3.5 */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_matrix_multiply */ -#elif PY_VERSION_HEX >= 0x03000000 /* 3.0 */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */ -#elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */ -#elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */ -#elif PY_VERSION_HEX >= 0x02000000 /* 2.0.0 */ - 0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_or */ -#endif - }; - - static PyTypeObject swigpyobject_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 - (char *)"SwigPyObject", /* tp_name */ - sizeof(SwigPyObject), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)SwigPyObject_dealloc, /* tp_dealloc */ - 0, /* tp_print */ -#if PY_VERSION_HEX < 0x02020000 - (getattrfunc)SwigPyObject_getattr, /* tp_getattr */ -#else - (getattrfunc)0, /* tp_getattr */ -#endif - (setattrfunc)0, /* tp_setattr */ -#if PY_VERSION_HEX >= 0x03000000 - 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */ -#else - (cmpfunc)SwigPyObject_compare, /* tp_compare */ -#endif - (reprfunc)SwigPyObject_repr, /* tp_repr */ - &SwigPyObject_as_number, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)0, /* tp_hash */ - (ternaryfunc)0, /* tp_call */ - 0, /* tp_str */ - PyObject_GenericGetAttr, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - swigobject_doc, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)SwigPyObject_richcompare,/* tp_richcompare */ - 0, /* tp_weaklistoffset */ -#if PY_VERSION_HEX >= 0x02020000 - 0, /* tp_iter */ - 0, /* tp_iternext */ - swigobject_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - 0, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - 0, /* tp_free */ - 0, /* tp_is_gc */ - 0, /* tp_bases */ - 0, /* tp_mro */ - 0, /* tp_cache */ - 0, /* tp_subclasses */ - 0, /* tp_weaklist */ -#endif -#if PY_VERSION_HEX >= 0x02030000 - 0, /* tp_del */ -#endif -#if PY_VERSION_HEX >= 0x02060000 - 0, /* tp_version_tag */ -#endif -#if PY_VERSION_HEX >= 0x03040000 - 0, /* tp_finalize */ -#endif -#ifdef COUNT_ALLOCS - 0, /* tp_allocs */ - 0, /* tp_frees */ - 0, /* tp_maxalloc */ -#if PY_VERSION_HEX >= 0x02050000 - 0, /* tp_prev */ -#endif - 0 /* tp_next */ -#endif - }; - swigpyobject_type = tmp; - type_init = 1; -#if PY_VERSION_HEX < 0x02020000 - swigpyobject_type.ob_type = &PyType_Type; -#else - if (PyType_Ready(&swigpyobject_type) < 0) - return NULL; -#endif - } - return &swigpyobject_type; -} - -SWIGRUNTIME PyObject * -SwigPyObject_New(void *ptr, swig_type_info *ty, int own) -{ - SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type()); - if (sobj) { - sobj->ptr = ptr; - sobj->ty = ty; - sobj->own = own; - sobj->next = 0; - } - return (PyObject *)sobj; -} - -/* ----------------------------------------------------------------------------- - * Implements a simple Swig Packed type, and use it instead of string - * ----------------------------------------------------------------------------- */ - -typedef struct { - PyObject_HEAD - void *pack; - swig_type_info *ty; - size_t size; -} SwigPyPacked; - -SWIGRUNTIME int -SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags)) -{ - char result[SWIG_BUFFER_SIZE]; - fputs("pack, v->size, 0, sizeof(result))) { - fputs("at ", fp); - fputs(result, fp); - } - fputs(v->ty->name,fp); - fputs(">", fp); - return 0; -} - -SWIGRUNTIME PyObject * -SwigPyPacked_repr(SwigPyPacked *v) -{ - char result[SWIG_BUFFER_SIZE]; - if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) { - return SWIG_Python_str_FromFormat("", result, v->ty->name); - } else { - return SWIG_Python_str_FromFormat("", v->ty->name); - } -} - -SWIGRUNTIME PyObject * -SwigPyPacked_str(SwigPyPacked *v) -{ - char result[SWIG_BUFFER_SIZE]; - if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){ - return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name); - } else { - return SWIG_Python_str_FromChar(v->ty->name); - } -} - -SWIGRUNTIME int -SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w) -{ - size_t i = v->size; - size_t j = w->size; - int s = (i < j) ? -1 : ((i > j) ? 1 : 0); - return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size); -} - -SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void); - -SWIGRUNTIME PyTypeObject* -SwigPyPacked_type(void) { - static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyPacked_TypeOnce(); - return type; -} - -SWIGRUNTIMEINLINE int -SwigPyPacked_Check(PyObject *op) { - return ((op)->ob_type == SwigPyPacked_TypeOnce()) - || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0); -} - -SWIGRUNTIME void -SwigPyPacked_dealloc(PyObject *v) -{ - if (SwigPyPacked_Check(v)) { - SwigPyPacked *sobj = (SwigPyPacked *) v; - free(sobj->pack); - } - PyObject_DEL(v); -} - -SWIGRUNTIME PyTypeObject* -SwigPyPacked_TypeOnce(void) { - static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer"; - static PyTypeObject swigpypacked_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 - (char *)"SwigPyPacked", /* tp_name */ - sizeof(SwigPyPacked), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)SwigPyPacked_dealloc, /* tp_dealloc */ - (printfunc)SwigPyPacked_print, /* tp_print */ - (getattrfunc)0, /* tp_getattr */ - (setattrfunc)0, /* tp_setattr */ -#if PY_VERSION_HEX>=0x03000000 - 0, /* tp_reserved in 3.0.1 */ -#else - (cmpfunc)SwigPyPacked_compare, /* tp_compare */ -#endif - (reprfunc)SwigPyPacked_repr, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)0, /* tp_hash */ - (ternaryfunc)0, /* tp_call */ - (reprfunc)SwigPyPacked_str, /* tp_str */ - PyObject_GenericGetAttr, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - swigpacked_doc, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ -#if PY_VERSION_HEX >= 0x02020000 - 0, /* tp_iter */ - 0, /* tp_iternext */ - 0, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - 0, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - 0, /* tp_free */ - 0, /* tp_is_gc */ - 0, /* tp_bases */ - 0, /* tp_mro */ - 0, /* tp_cache */ - 0, /* tp_subclasses */ - 0, /* tp_weaklist */ -#endif -#if PY_VERSION_HEX >= 0x02030000 - 0, /* tp_del */ -#endif -#if PY_VERSION_HEX >= 0x02060000 - 0, /* tp_version_tag */ -#endif -#if PY_VERSION_HEX >= 0x03040000 - 0, /* tp_finalize */ -#endif -#ifdef COUNT_ALLOCS - 0, /* tp_allocs */ - 0, /* tp_frees */ - 0, /* tp_maxalloc */ -#if PY_VERSION_HEX >= 0x02050000 - 0, /* tp_prev */ -#endif - 0 /* tp_next */ -#endif - }; - swigpypacked_type = tmp; - type_init = 1; -#if PY_VERSION_HEX < 0x02020000 - swigpypacked_type.ob_type = &PyType_Type; -#else - if (PyType_Ready(&swigpypacked_type) < 0) - return NULL; -#endif - } - return &swigpypacked_type; -} - -SWIGRUNTIME PyObject * -SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty) -{ - SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type()); - if (sobj) { - void *pack = malloc(size); - if (pack) { - memcpy(pack, ptr, size); - sobj->pack = pack; - sobj->ty = ty; - sobj->size = size; - } else { - PyObject_DEL((PyObject *) sobj); - sobj = 0; - } - } - return (PyObject *) sobj; -} - -SWIGRUNTIME swig_type_info * -SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size) -{ - if (SwigPyPacked_Check(obj)) { - SwigPyPacked *sobj = (SwigPyPacked *)obj; - if (sobj->size != size) return 0; - memcpy(ptr, sobj->pack, size); - return sobj->ty; - } else { - return 0; - } -} - -/* ----------------------------------------------------------------------------- - * pointers/data manipulation - * ----------------------------------------------------------------------------- */ - -SWIGRUNTIMEINLINE PyObject * -_SWIG_This(void) -{ - return SWIG_Python_str_FromChar("this"); -} - -static PyObject *swig_this = NULL; - -SWIGRUNTIME PyObject * -SWIG_This(void) -{ - if (swig_this == NULL) - swig_this = _SWIG_This(); - return swig_this; -} - -/* #define SWIG_PYTHON_SLOW_GETSET_THIS */ - -/* TODO: I don't know how to implement the fast getset in Python 3 right now */ -#if PY_VERSION_HEX>=0x03000000 -#define SWIG_PYTHON_SLOW_GETSET_THIS -#endif - -SWIGRUNTIME SwigPyObject * -SWIG_Python_GetSwigThis(PyObject *pyobj) -{ - PyObject *obj; - - if (SwigPyObject_Check(pyobj)) - return (SwigPyObject *) pyobj; - -#ifdef SWIGPYTHON_BUILTIN - (void)obj; -# ifdef PyWeakref_CheckProxy - if (PyWeakref_CheckProxy(pyobj)) { - pyobj = PyWeakref_GET_OBJECT(pyobj); - if (pyobj && SwigPyObject_Check(pyobj)) - return (SwigPyObject*) pyobj; - } -# endif - return NULL; -#else - - obj = 0; - -#if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000)) - if (PyInstance_Check(pyobj)) { - obj = _PyInstance_Lookup(pyobj, SWIG_This()); - } else { - PyObject **dictptr = _PyObject_GetDictPtr(pyobj); - if (dictptr != NULL) { - PyObject *dict = *dictptr; - obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0; - } else { -#ifdef PyWeakref_CheckProxy - if (PyWeakref_CheckProxy(pyobj)) { - PyObject *wobj = PyWeakref_GET_OBJECT(pyobj); - return wobj ? SWIG_Python_GetSwigThis(wobj) : 0; - } -#endif - obj = PyObject_GetAttr(pyobj,SWIG_This()); - if (obj) { - Py_DECREF(obj); - } else { - if (PyErr_Occurred()) PyErr_Clear(); - return 0; - } - } - } -#else - obj = PyObject_GetAttr(pyobj,SWIG_This()); - if (obj) { - Py_DECREF(obj); - } else { - if (PyErr_Occurred()) PyErr_Clear(); - return 0; - } -#endif - if (obj && !SwigPyObject_Check(obj)) { - /* a PyObject is called 'this', try to get the 'real this' - SwigPyObject from it */ - return SWIG_Python_GetSwigThis(obj); - } - return (SwigPyObject *)obj; -#endif -} - -/* Acquire a pointer value */ - -SWIGRUNTIME int -SWIG_Python_AcquirePtr(PyObject *obj, int own) { - if (own == SWIG_POINTER_OWN) { - SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj); - if (sobj) { - int oldown = sobj->own; - sobj->own = own; - return oldown; - } - } - return 0; -} - -/* Convert a pointer value */ - -SWIGRUNTIME int -SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) { - int res; - SwigPyObject *sobj; - int implicit_conv = (flags & SWIG_POINTER_IMPLICIT_CONV) != 0; - - if (!obj) - return SWIG_ERROR; - if (obj == Py_None && !implicit_conv) { - if (ptr) - *ptr = 0; - return SWIG_OK; - } - - res = SWIG_ERROR; - - sobj = SWIG_Python_GetSwigThis(obj); - if (own) - *own = 0; - while (sobj) { - void *vptr = sobj->ptr; - if (ty) { - swig_type_info *to = sobj->ty; - if (to == ty) { - /* no type cast needed */ - if (ptr) *ptr = vptr; - break; - } else { - swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); - if (!tc) { - sobj = (SwigPyObject *)sobj->next; - } else { - if (ptr) { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc,vptr,&newmemory); - if (newmemory == SWIG_CAST_NEW_MEMORY) { - assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */ - if (own) - *own = *own | SWIG_CAST_NEW_MEMORY; - } - } - break; - } - } - } else { - if (ptr) *ptr = vptr; - break; - } - } - if (sobj) { - if (own) - *own = *own | sobj->own; - if (flags & SWIG_POINTER_DISOWN) { - sobj->own = 0; - } - res = SWIG_OK; - } else { - if (implicit_conv) { - SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; - if (data && !data->implicitconv) { - PyObject *klass = data->klass; - if (klass) { - PyObject *impconv; - data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/ - impconv = SWIG_Python_CallFunctor(klass, obj); - data->implicitconv = 0; - if (PyErr_Occurred()) { - PyErr_Clear(); - impconv = 0; - } - if (impconv) { - SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv); - if (iobj) { - void *vptr; - res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0); - if (SWIG_IsOK(res)) { - if (ptr) { - *ptr = vptr; - /* transfer the ownership to 'ptr' */ - iobj->own = 0; - res = SWIG_AddCast(res); - res = SWIG_AddNewMask(res); - } else { - res = SWIG_AddCast(res); - } - } - } - Py_DECREF(impconv); - } - } - } - } - if (!SWIG_IsOK(res) && obj == Py_None) { - if (ptr) - *ptr = 0; - if (PyErr_Occurred()) - PyErr_Clear(); - res = SWIG_OK; - } - } - return res; -} - -/* Convert a function ptr value */ - -SWIGRUNTIME int -SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) { - if (!PyCFunction_Check(obj)) { - return SWIG_ConvertPtr(obj, ptr, ty, 0); - } else { - void *vptr = 0; - - /* here we get the method pointer for callbacks */ - const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); - const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0; - if (desc) - desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0; - if (!desc) - return SWIG_ERROR; - if (ty) { - swig_cast_info *tc = SWIG_TypeCheck(desc,ty); - if (tc) { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc,vptr,&newmemory); - assert(!newmemory); /* newmemory handling not yet implemented */ - } else { - return SWIG_ERROR; - } - } else { - *ptr = vptr; - } - return SWIG_OK; - } -} - -/* Convert a packed value value */ - -SWIGRUNTIME int -SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) { - swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz); - if (!to) return SWIG_ERROR; - if (ty) { - if (to != ty) { - /* check type cast? */ - swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); - if (!tc) return SWIG_ERROR; - } - } - return SWIG_OK; -} - -/* ----------------------------------------------------------------------------- - * Create a new pointer object - * ----------------------------------------------------------------------------- */ - -/* - Create a new instance object, without calling __init__, and set the - 'this' attribute. -*/ - -SWIGRUNTIME PyObject* -SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) -{ -#if (PY_VERSION_HEX >= 0x02020000) - PyObject *inst = 0; - PyObject *newraw = data->newraw; - if (newraw) { - inst = PyObject_Call(newraw, data->newargs, NULL); - if (inst) { -#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); - } - } -#else - PyObject *key = SWIG_This(); - PyObject_SetAttr(inst, key, swig_this); -#endif - } - } else { -#if PY_VERSION_HEX >= 0x03000000 - inst = ((PyTypeObject*) data->newargs)->tp_new((PyTypeObject*) data->newargs, Py_None, Py_None); - if (inst) { - PyObject_SetAttr(inst, SWIG_This(), swig_this); - Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG; - } -#else - PyObject *dict = PyDict_New(); - if (dict) { - PyDict_SetItem(dict, SWIG_This(), swig_this); - inst = PyInstance_NewRaw(data->newargs, dict); - Py_DECREF(dict); - } -#endif - } - return inst; -#else -#if (PY_VERSION_HEX >= 0x02010000) - PyObject *inst = 0; - PyObject *dict = PyDict_New(); - if (dict) { - PyDict_SetItem(dict, SWIG_This(), swig_this); - inst = PyInstance_NewRaw(data->newargs, dict); - Py_DECREF(dict); - } - return (PyObject *) inst; -#else - PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type); - if (inst == NULL) { - return NULL; - } - inst->in_class = (PyClassObject *)data->newargs; - Py_INCREF(inst->in_class); - inst->in_dict = PyDict_New(); - if (inst->in_dict == NULL) { - Py_DECREF(inst); - return NULL; - } -#ifdef Py_TPFLAGS_HAVE_WEAKREFS - inst->in_weakreflist = NULL; -#endif -#ifdef Py_TPFLAGS_GC - PyObject_GC_Init(inst); -#endif - PyDict_SetItem(inst->in_dict, SWIG_This(), swig_this); - return (PyObject *) inst; -#endif -#endif -} - -SWIGRUNTIME void -SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this) -{ - PyObject *dict; -#if (PY_VERSION_HEX >= 0x02020000) && !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; - } -#endif - dict = PyObject_GetAttrString(inst, (char*)"__dict__"); - PyDict_SetItem(dict, SWIG_This(), swig_this); - Py_DECREF(dict); -} - - -SWIGINTERN PyObject * -SWIG_Python_InitShadowInstance(PyObject *args) { - PyObject *obj[2]; - if (!SWIG_Python_UnpackTuple(args, "swiginit", 2, 2, obj)) { - return NULL; - } else { - SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]); - if (sthis) { - SwigPyObject_append((PyObject*) sthis, obj[1]); - } else { - SWIG_Python_SetSwigThis(obj[0], obj[1]); - } - return SWIG_Py_Void(); - } -} - -/* Create a new pointer object */ - -SWIGRUNTIME PyObject * -SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags) { - SwigPyClientData *clientdata; - PyObject * robj; - int own; - - if (!ptr) - return SWIG_Py_Void(); - - clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0; - own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0; - if (clientdata && clientdata->pytype) { - SwigPyObject *newobj; - if (flags & SWIG_BUILTIN_TP_INIT) { - newobj = (SwigPyObject*) self; - if (newobj->ptr) { - PyObject *next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0); - while (newobj->next) - newobj = (SwigPyObject *) newobj->next; - newobj->next = next_self; - newobj = (SwigPyObject *)next_self; -#ifdef SWIGPYTHON_BUILTIN - newobj->dict = 0; -#endif - } - } else { - newobj = PyObject_New(SwigPyObject, clientdata->pytype); -#ifdef SWIGPYTHON_BUILTIN - newobj->dict = 0; -#endif - } - if (newobj) { - newobj->ptr = ptr; - newobj->ty = type; - newobj->own = own; - newobj->next = 0; - return (PyObject*) newobj; - } - return SWIG_Py_Void(); - } - - assert(!(flags & SWIG_BUILTIN_TP_INIT)); - - robj = SwigPyObject_New(ptr, type, own); - if (robj && clientdata && !(flags & SWIG_POINTER_NOSHADOW)) { - PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj); - Py_DECREF(robj); - robj = inst; - } - return robj; -} - -/* Create a new packed object */ - -SWIGRUNTIMEINLINE PyObject * -SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) { - return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void(); -} - -/* -----------------------------------------------------------------------------* - * Get type list - * -----------------------------------------------------------------------------*/ - -#ifdef SWIG_LINK_RUNTIME -void *SWIG_ReturnGlobalTypeList(void *); -#endif - -SWIGRUNTIME swig_module_info * -SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata)) { - 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 -# ifdef SWIGPY_USE_CAPSULE - type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0); -# else - type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, - (char*)"type_pointer" SWIG_TYPE_TABLE_NAME); -# endif - if (PyErr_Occurred()) { - PyErr_Clear(); - type_pointer = (void *)0; - } -#endif - } - return (swig_module_info *) type_pointer; -} - -#if PY_MAJOR_VERSION < 2 -/* PyModule_AddObject function was introduced in Python 2.0. The following function - is copied out of Python/modsupport.c in python version 2.3.4 */ -SWIGINTERN int -PyModule_AddObject(PyObject *m, char *name, PyObject *o) -{ - PyObject *dict; - if (!PyModule_Check(m)) { - PyErr_SetString(PyExc_TypeError, "PyModule_AddObject() needs module as first arg"); - return SWIG_ERROR; - } - if (!o) { - PyErr_SetString(PyExc_TypeError, "PyModule_AddObject() needs non-NULL value"); - return SWIG_ERROR; - } - - dict = PyModule_GetDict(m); - if (dict == NULL) { - /* Internal error -- modules must have a dict! */ - PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__", - PyModule_GetName(m)); - return SWIG_ERROR; - } - if (PyDict_SetItemString(dict, name, o)) - return SWIG_ERROR; - Py_DECREF(o); - return SWIG_OK; -} -#endif - -SWIGRUNTIME void -#ifdef SWIGPY_USE_CAPSULE -SWIG_Python_DestroyModule(PyObject *obj) -#else -SWIG_Python_DestroyModule(void *vptr) -#endif -{ -#ifdef SWIGPY_USE_CAPSULE - swig_module_info *swig_module = (swig_module_info *) PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME); -#else - swig_module_info *swig_module = (swig_module_info *) vptr; -#endif - swig_type_info **types = swig_module->types; - size_t i; - for (i =0; i < swig_module->size; ++i) { - swig_type_info *ty = types[i]; - if (ty->owndata) { - SwigPyClientData *data = (SwigPyClientData *) ty->clientdata; - if (data) SwigPyClientData_Del(data); - } - } - Py_DECREF(SWIG_This()); - swig_this = NULL; -} - -SWIGRUNTIME void -SWIG_Python_SetModule(swig_module_info *swig_module) { -#if PY_VERSION_HEX >= 0x03000000 - /* Add a dummy module object into sys.modules */ - PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION); -#else - static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} }; /* Sentinel */ - PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table); -#endif -#ifdef SWIGPY_USE_CAPSULE - PyObject *pointer = PyCapsule_New((void *) swig_module, SWIGPY_CAPSULE_NAME, SWIG_Python_DestroyModule); - if (pointer && module) { - PyModule_AddObject(module, (char*)"type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer); - } else { - Py_XDECREF(pointer); - } -#else - PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule); - if (pointer && module) { - PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer); - } else { - Py_XDECREF(pointer); - } -#endif -} - -/* 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) -{ - PyObject *cache = SWIG_Python_TypeCache(); - PyObject *key = SWIG_Python_str_FromChar(type); - PyObject *obj = PyDict_GetItem(cache, key); - swig_type_info *descriptor; - if (obj) { -#ifdef SWIGPY_USE_CAPSULE - descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, NULL); -#else - descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj); -#endif - } else { - swig_module_info *swig_module = SWIG_GetModule(0); - descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type); - if (descriptor) { -#ifdef SWIGPY_USE_CAPSULE - obj = PyCapsule_New((void*) descriptor, NULL, NULL); -#else - obj = PyCObject_FromVoidPtr(descriptor, NULL); -#endif - PyDict_SetItem(cache, key, obj); - Py_DECREF(obj); - } - } - Py_DECREF(key); - return descriptor; -} - -/* - For backward compatibility only -*/ -#define SWIG_POINTER_EXCEPTION 0 -#define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg) -#define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags) - -SWIGRUNTIME int -SWIG_Python_AddErrMesg(const char* mesg, int infront) -{ - if (PyErr_Occurred()) { - PyObject *type = 0; - PyObject *value = 0; - PyObject *traceback = 0; - PyErr_Fetch(&type, &value, &traceback); - if (value) { - char *tmp; - PyObject *old_str = PyObject_Str(value); - Py_XINCREF(type); - PyErr_Clear(); - if (infront) { - PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str)); - } else { - PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); - } - SWIG_Python_str_DelForPy3(tmp); - Py_DECREF(old_str); - } - return 1; - } else { - return 0; - } -} - -SWIGRUNTIME int -SWIG_Python_ArgFail(int argnum) -{ - if (PyErr_Occurred()) { - /* add information about failing argument */ - char mesg[256]; - PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum); - return SWIG_Python_AddErrMesg(mesg, 1); - } else { - return 0; - } -} - -SWIGRUNTIMEINLINE const char * -SwigPyObject_GetDesc(PyObject *self) -{ - SwigPyObject *v = (SwigPyObject *)self; - swig_type_info *ty = v ? v->ty : 0; - return ty ? ty->str : ""; -} - -SWIGRUNTIME void -SWIG_Python_TypeError(const char *type, PyObject *obj) -{ - if (type) { -#if defined(SWIG_COBJECT_TYPES) - if (obj && SwigPyObject_Check(obj)) { - const char *otype = (const char *) SwigPyObject_GetDesc(obj); - if (otype) { - PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received", - type, otype); - return; - } - } else -#endif - { - 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; - 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(str); - return; - } - } - PyErr_Format(PyExc_TypeError, "a '%s' is expected", type); - } else { - PyErr_Format(PyExc_TypeError, "unexpected type is received"); - } -} - - -/* Convert a pointer value, signal an exception on a type mismatch */ -SWIGRUNTIME void * -SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags) { - 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; -} - -#ifdef SWIGPYTHON_BUILTIN -SWIGRUNTIME int -SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { - PyTypeObject *tp = obj->ob_type; - PyObject *descr; - PyObject *encoded_name; - descrsetfunc f; - int res = -1; - -# ifdef Py_USING_UNICODE - if (PyString_Check(name)) { - name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL); - if (!name) - return -1; - } else if (!PyUnicode_Check(name)) -# else - if (!PyString_Check(name)) -# endif - { - PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name); - return -1; - } else { - Py_INCREF(name); - } - - if (!tp->tp_dict) { - if (PyType_Ready(tp) < 0) - goto done; - } - - descr = _PyType_Lookup(tp, name); - f = NULL; - if (descr != NULL) - f = descr->ob_type->tp_descr_set; - if (!f) { - if (PyString_Check(name)) { - encoded_name = name; - Py_INCREF(name); - } else { - encoded_name = PyUnicode_AsUTF8String(name); - } - PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name)); - Py_DECREF(encoded_name); - } else { - res = f(descr, obj, value); - } - - done: - Py_DECREF(name); - return res; -} -#endif - - -#ifdef __cplusplus -} -#endif - - - -#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 - - - -/* -------- TYPES TABLE (BEGIN) -------- */ - -#define SWIGTYPE_p_BloombergLP__blpapi__VersionInfo swig_types[0] -#define SWIGTYPE_p_char swig_types[1] -#define SWIGTYPE_p_int swig_types[2] -#define SWIGTYPE_p_std__ostream swig_types[3] -static swig_type_info *swig_types[5]; -static swig_module_info swig_module = {swig_types, 4, 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) - -/* -------- TYPES TABLE (END) -------- */ - -#if (PY_VERSION_HEX <= 0x02000000) -# if !defined(SWIG_PYTHON_CLASSIC) -# error "This python version requires swig to be run with the '-classic' option" -# endif -#endif - -/*----------------------------------------------- - @(target):= _versionhelper.so - ------------------------------------------------*/ -#if PY_VERSION_HEX >= 0x03000000 -# define SWIG_init PyInit__versionhelper - -#else -# define SWIG_init init_versionhelper - -#endif -#define SWIG_name "_versionhelper" - -#define SWIGVERSION 0x030012 -#define SWIG_VERSION SWIGVERSION - - -#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a)) -#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a)) - - -#include - - -namespace swig { - class SwigPtr_PyObject { - protected: - PyObject *_obj; - - public: - SwigPtr_PyObject() :_obj(0) - { - } - - SwigPtr_PyObject(const SwigPtr_PyObject& item) : _obj(item._obj) - { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - Py_XINCREF(_obj); - SWIG_PYTHON_THREAD_END_BLOCK; - } - - SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj) - { - if (initial_ref) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - Py_XINCREF(_obj); - SWIG_PYTHON_THREAD_END_BLOCK; - } - } - - SwigPtr_PyObject & operator=(const SwigPtr_PyObject& item) - { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - Py_XINCREF(item._obj); - Py_XDECREF(_obj); - _obj = item._obj; - SWIG_PYTHON_THREAD_END_BLOCK; - return *this; - } - - ~SwigPtr_PyObject() - { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - Py_XDECREF(_obj); - SWIG_PYTHON_THREAD_END_BLOCK; - } - - operator PyObject *() const - { - return _obj; - } - - PyObject *operator->() const - { - return _obj; - } - }; -} - - -namespace swig { - struct SwigVar_PyObject : SwigPtr_PyObject { - SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) { } - - SwigVar_PyObject & operator = (PyObject* obj) - { - Py_XDECREF(_obj); - _obj = obj; - return *this; - } - }; -} - - -#include "blpapi_versioninfo.h" - - -SWIGINTERNINLINE PyObject* - SWIG_From_int (int value) -{ - return PyInt_FromLong((long) value); -} - - -SWIGINTERN swig_type_info* -SWIG_pchar_descriptor(void) -{ - static int init = 0; - static swig_type_info* info = 0; - if (!init) { - info = SWIG_TypeQuery("_p_char"); - init = 1; - } - return info; -} - - -SWIGINTERNINLINE PyObject * -SWIG_FromCharPtrAndSize(const char* carray, size_t size) -{ - if (carray) { - if (size > INT_MAX) { - swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - return pchar_descriptor ? - SWIG_InternalNewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : SWIG_Py_Void(); - } else { -#if PY_VERSION_HEX >= 0x03000000 -#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) - return PyBytes_FromStringAndSize(carray, static_cast< Py_ssize_t >(size)); -#else -#if PY_VERSION_HEX >= 0x03010000 - return PyUnicode_DecodeUTF8(carray, static_cast< Py_ssize_t >(size), "surrogateescape"); -#else - return PyUnicode_FromStringAndSize(carray, static_cast< Py_ssize_t >(size)); -#endif -#endif -#else - return PyString_FromStringAndSize(carray, static_cast< Py_ssize_t >(size)); -#endif - } - } else { - return SWIG_Py_Void(); - } -} - - -SWIGINTERNINLINE PyObject * -SWIG_FromCharPtr(const char *cptr) -{ - return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0)); -} - -#ifdef __cplusplus -extern "C" { -#endif -SWIGINTERN PyObject *_wrap_blpapi_getVersionInfo(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int *arg1 = (int *) 0 ; - int *arg2 = (int *) 0 ; - int *arg3 = (int *) 0 ; - int *arg4 = (int *) 0 ; - int temp1 ; - int res1 = SWIG_TMPOBJ ; - int temp2 ; - int res2 = SWIG_TMPOBJ ; - int temp3 ; - int res3 = SWIG_TMPOBJ ; - int temp4 ; - int res4 = SWIG_TMPOBJ ; - - arg1 = &temp1; - arg2 = &temp2; - arg3 = &temp3; - arg4 = &temp4; - if (!PyArg_ParseTuple(args,(char *)":blpapi_getVersionInfo")) SWIG_fail; - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_getVersionInfo(arg1,arg2,arg3,arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - if (SWIG_IsTmpObj(res1)) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg1))); - } else { - int new_flags = SWIG_IsNewObj(res1) ? (SWIG_POINTER_OWN | 0 ) : 0 ; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg1), SWIGTYPE_p_int, new_flags)); - } - if (SWIG_IsTmpObj(res2)) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg2))); - } else { - int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_int, new_flags)); - } - if (SWIG_IsTmpObj(res3)) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg3))); - } else { - int new_flags = SWIG_IsNewObj(res3) ? (SWIG_POINTER_OWN | 0 ) : 0 ; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg3), SWIGTYPE_p_int, new_flags)); - } - if (SWIG_IsTmpObj(res4)) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg4))); - } else { - int new_flags = SWIG_IsNewObj(res4) ? (SWIG_POINTER_OWN | 0 ) : 0 ; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg4), SWIGTYPE_p_int, new_flags)); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_getVersionIdentifier(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - char *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":blpapi_getVersionIdentifier")) SWIG_fail; - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_getVersionIdentifier(); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap___lshift__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::ostream *arg1 = 0 ; - BloombergLP::blpapi::VersionInfo *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - std::ostream *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:__lshift__",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_std__ostream, 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "__lshift__" "', argument " "1"" of type '" "std::ostream &""'"); - } - if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "__lshift__" "', argument " "1"" of type '" "std::ostream &""'"); - } - arg1 = reinterpret_cast< std::ostream * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_BloombergLP__blpapi__VersionInfo, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "__lshift__" "', argument " "2"" of type '" "BloombergLP::blpapi::VersionInfo const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "__lshift__" "', argument " "2"" of type '" "BloombergLP::blpapi::VersionInfo const &""'"); - } - arg2 = reinterpret_cast< BloombergLP::blpapi::VersionInfo * >(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (std::ostream *) &BloombergLP::blpapi::operator <<(*arg1,(BloombergLP::blpapi::VersionInfo const &)*arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__ostream, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -static PyMethodDef SwigMethods[] = { - { (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL}, - { (char *)"blpapi_getVersionInfo", _wrap_blpapi_getVersionInfo, METH_VARARGS, NULL}, - { (char *)"blpapi_getVersionIdentifier", _wrap_blpapi_getVersionIdentifier, METH_VARARGS, NULL}, - { (char *)"__lshift__", _wrap___lshift__, METH_VARARGS, NULL}, - { NULL, NULL, 0, NULL } -}; - - -/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ - -static swig_type_info _swigt__p_BloombergLP__blpapi__VersionInfo = {"_p_BloombergLP__blpapi__VersionInfo", "BloombergLP::blpapi::VersionInfo *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_int = {"_p_int", "int *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__ostream = {"_p_std__ostream", "std::ostream *", 0, 0, (void*)0, 0}; - -static swig_type_info *swig_type_initial[] = { - &_swigt__p_BloombergLP__blpapi__VersionInfo, - &_swigt__p_char, - &_swigt__p_int, - &_swigt__p_std__ostream, -}; - -static swig_cast_info _swigc__p_BloombergLP__blpapi__VersionInfo[] = { {&_swigt__p_BloombergLP__blpapi__VersionInfo, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__ostream[] = { {&_swigt__p_std__ostream, 0, 0, 0},{0, 0, 0, 0}}; - -static swig_cast_info *swig_cast_initial[] = { - _swigc__p_BloombergLP__blpapi__VersionInfo, - _swigc__p_char, - _swigc__p_int, - _swigc__p_std__ostream, -}; - - -/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */ - -static swig_const_info swig_const_table[] = { -{0, 0, 0, 0.0, 0, 0}}; - -#ifdef __cplusplus -} -#endif -/* ----------------------------------------------------------------------------- - * Type initialization: - * This problem is tough by the requirement that no dynamic - * memory is used. Also, since swig_type_info structures store pointers to - * swig_cast_info structures and swig_cast_info structures store pointers back - * to swig_type_info structures, we need some lookup code at initialization. - * The idea is that swig generates all the structures that are needed. - * The runtime then collects these partially filled structures. - * The SWIG_InitializeModule function takes these initial arrays out of - * swig_module, and does all the lookup, filling in the swig_module.types - * array with the correct data and linking the correct swig_cast_info - * structures together. - * - * The generated swig_type_info structures are assigned statically to an initial - * array. We just loop through that array, and handle each type individually. - * First we lookup if this type has been already loaded, and if so, use the - * loaded structure instead of the generated one. Then we have to fill in the - * cast linked list. The cast data is initially stored in something like a - * two-dimensional array. Each row corresponds to a type (there are the same - * number of rows as there are in the swig_type_initial array). Each entry in - * a column is one of the swig_cast_info structures for that type. - * The cast_initial array is actually an array of arrays, because each row has - * a variable number of columns. So to actually build the cast linked list, - * we find the array of casts associated with the type, and loop through it - * adding the casts to the list. The one last trick we need to do is making - * sure the type pointer in the swig_cast_info struct is correct. - * - * First off, we lookup the cast->type name to see if it is already loaded. - * There are three cases to handle: - * 1) If the cast->type has already been loaded AND the type we are adding - * casting info to has not been loaded (it is in this module), THEN we - * replace the cast->type pointer with the type pointer that has already - * been loaded. - * 2) If BOTH types (the one we are adding casting info to, and the - * cast->type) are loaded, THEN the cast info has already been loaded by - * the previous module so we just ignore it. - * 3) Finally, if cast->type has not already been loaded, then we add that - * swig_cast_info to the linked list (because the cast->type) pointer will - * be correct. - * ----------------------------------------------------------------------------- */ - -#ifdef __cplusplus -extern "C" { -#if 0 -} /* c-mode */ -#endif -#endif - -#if 0 -#define SWIGRUNTIME_DEBUG -#endif - - -SWIGRUNTIME void -SWIG_InitializeModule(void *clientdata) { - size_t i; - swig_module_info *module_head, *iter; - int init; - - /* check to see if the circular list has been setup, if not, set it up */ - if (swig_module.next==0) { - /* Initialize the swig_module */ - swig_module.type_initial = swig_type_initial; - swig_module.cast_initial = swig_cast_initial; - swig_module.next = &swig_module; - init = 1; - } else { - init = 0; - } - - /* Try and load any already created modules */ - module_head = SWIG_GetModule(clientdata); - if (!module_head) { - /* This is the first module loaded for this interpreter */ - /* so set the swig module into the interpreter */ - SWIG_SetModule(clientdata, &swig_module); - } else { - /* the interpreter has loaded a SWIG module, but has it loaded this one? */ - iter=module_head; - do { - if (iter==&swig_module) { - /* Our module is already in the list, so there's nothing more to do. */ - return; - } - iter=iter->next; - } while (iter!= module_head); - - /* otherwise we must add our module into the list */ - swig_module.next = module_head->next; - module_head->next = &swig_module; - } - - /* When multiple interpreters are used, a module could have already been initialized in - a different interpreter, but not yet have a pointer in this interpreter. - In this case, we do not want to continue adding types... everything should be - set up already */ - if (init == 0) return; - - /* Now work on filling in swig_module.types */ -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: size %d\n", swig_module.size); -#endif - for (i = 0; i < swig_module.size; ++i) { - swig_type_info *type = 0; - swig_type_info *ret; - swig_cast_info *cast; - -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); -#endif - - /* if there is another module already loaded */ - if (swig_module.next != &swig_module) { - type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name); - } - if (type) { - /* Overwrite clientdata field */ -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: found type %s\n", type->name); -#endif - if (swig_module.type_initial[i]->clientdata) { - type->clientdata = swig_module.type_initial[i]->clientdata; -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name); -#endif - } - } else { - type = swig_module.type_initial[i]; - } - - /* Insert casting types */ - cast = swig_module.cast_initial[i]; - while (cast->type) { - /* Don't need to add information already in the list */ - ret = 0; -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: look cast %s\n", cast->type->name); -#endif - if (swig_module.next != &swig_module) { - ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name); -#ifdef SWIGRUNTIME_DEBUG - if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name); -#endif - } - if (ret) { - if (type == swig_module.type_initial[i]) { -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: skip old type %s\n", ret->name); -#endif - cast->type = ret; - ret = 0; - } else { - /* Check for casting already in the list */ - swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type); -#ifdef SWIGRUNTIME_DEBUG - if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name); -#endif - if (!ocast) ret = 0; - } - } - - if (!ret) { -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name); -#endif - if (type->cast) { - type->cast->prev = cast; - cast->next = type->cast; - } - type->cast = cast; - } - cast++; - } - /* Set entry in modules->types array equal to the type */ - swig_module.types[i] = type; - } - swig_module.types[i] = 0; - -#ifdef SWIGRUNTIME_DEBUG - printf("**** SWIG_InitializeModule: Cast List ******\n"); - for (i = 0; i < swig_module.size; ++i) { - int j = 0; - swig_cast_info *cast = swig_module.cast_initial[i]; - printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); - while (cast->type) { - printf("SWIG_InitializeModule: cast type %s\n", cast->type->name); - cast++; - ++j; - } - printf("---- Total casts: %d\n",j); - } - printf("**** SWIG_InitializeModule: Cast List ******\n"); -#endif -} - -/* This function will propagate the clientdata field of type to -* any new swig_type_info structures that have been added into the list -* of equivalent types. It is like calling -* SWIG_TypeClientData(type, clientdata) a second time. -*/ -SWIGRUNTIME void -SWIG_PropagateClientData(void) { - size_t i; - swig_cast_info *equiv; - static int init_run = 0; - - if (init_run) return; - init_run = 1; - - for (i = 0; i < swig_module.size; i++) { - if (swig_module.types[i]->clientdata) { - equiv = swig_module.types[i]->cast; - while (equiv) { - if (!equiv->converter) { - if (equiv->type && !equiv->type->clientdata) - SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata); - } - equiv = equiv->next; - } - } - } -} - -#ifdef __cplusplus -#if 0 -{ - /* c-mode */ -#endif -} -#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(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 int - swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { - char *tmp; - PyObject *str = swig_varlink_str(v); - fprintf(fp,"Swig global variables "); - fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str)); - SWIG_Python_str_DelForPy3(tmp); - Py_DECREF(str); - return 0; - } - - 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 - (char *)"swigvarlink", /* tp_name */ - sizeof(swig_varlinkobject), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor) swig_varlink_dealloc, /* tp_dealloc */ - (printfunc) swig_varlink_print, /* 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 */ -#if PY_VERSION_HEX >= 0x02020000 - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */ -#endif -#if PY_VERSION_HEX >= 0x02030000 - 0, /* tp_del */ -#endif -#if PY_VERSION_HEX >= 0x02060000 - 0, /* tp_version_tag */ -#endif -#if PY_VERSION_HEX >= 0x03040000 - 0, /* tp_finalize */ -#endif -#ifdef COUNT_ALLOCS - 0, /* tp_allocs */ - 0, /* tp_frees */ - 0, /* tp_maxalloc */ -#if PY_VERSION_HEX >= 0x02050000 - 0, /* tp_prev */ -#endif - 0 /* tp_next */ -#endif - }; - varlink_type = tmp; - type_init = 1; -#if PY_VERSION_HEX < 0x02020000 - varlink_type.ob_type = &PyType_Type; -#else - if (PyType_Ready(&varlink_type) < 0) - return NULL; -#endif - } - 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, 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) { - strncpy(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 *_SWIG_globals = 0; - if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink(); - return _SWIG_globals; - } - - /* ----------------------------------------------------------------------------- - * constants/methods manipulation - * ----------------------------------------------------------------------------- */ - - /* Install Constants */ - SWIGINTERN void - SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) { - PyObject *obj = 0; - size_t i; - for (i = 0; constants[i].type; ++i) { - switch(constants[i].type) { - case SWIG_PY_POINTER: - obj = SWIG_InternalNewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0); - break; - case SWIG_PY_BINARY: - obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype)); - break; - default: - obj = 0; - break; - } - if (obj) { - PyDict_SetItemString(d, constants[i].name, obj); - Py_DECREF(obj); - } - } - } - - /* -----------------------------------------------------------------------------*/ - /* Fix SwigMethods to carry the callback ptrs when needed */ - /* -----------------------------------------------------------------------------*/ - - SWIGINTERN void - SWIG_Python_FixMethods(PyMethodDef *methods, - 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; - if (!c) continue; - c = strstr(c, "swig_ptr: "); - if (c) { - int j; - 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, - strlen(const_table[j].name)) == 0) { - ci = &(const_table[j]); - break; - } - } - if (ci) { - void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0; - if (ptr) { - size_t shift = (ci->ptype) - types; - swig_type_info *ty = types_initial[shift]; - size_t ldoc = (c - methods[i].ml_doc); - size_t lptr = strlen(ty->name)+2*sizeof(void*)+2; - char *ndoc = (char*)malloc(ldoc + lptr + 10); - if (ndoc) { - char *buff = ndoc; - strncpy(buff, methods[i].ml_doc, ldoc); - buff += ldoc; - strncpy(buff, "swig_ptr: ", 10); - buff += 10; - SWIG_PackVoidPtr(buff, ptr, ty->name, lptr); - methods[i].ml_doc = ndoc; - } - } - } - } - } - } - -#ifdef __cplusplus -} -#endif - -/* -----------------------------------------------------------------------------* - * Partial Init method - * -----------------------------------------------------------------------------*/ - -#ifdef __cplusplus -extern "C" -#endif - -SWIGEXPORT -#if PY_VERSION_HEX >= 0x03000000 -PyObject* -#else -void -#endif -SWIG_init(void) { - PyObject *m, *d, *md; -#if PY_VERSION_HEX >= 0x03000000 - static struct PyModuleDef SWIG_module = { -# if PY_VERSION_HEX >= 0x03020000 - PyModuleDef_HEAD_INIT, -# else - { - PyObject_HEAD_INIT(NULL) - NULL, /* m_init */ - 0, /* m_index */ - NULL, /* m_copy */ - }, -# endif - (char *) SWIG_name, - NULL, - -1, - SwigMethods, - NULL, - NULL, - NULL, - NULL - }; -#endif - -#if defined(SWIGPYTHON_BUILTIN) - static SwigPyClientData SwigPyObject_clientdata = { - 0, 0, 0, 0, 0, 0, 0 - }; - static PyGetSetDef this_getset_def = { - (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL - }; - static SwigPyGetSet thisown_getset_closure = { - (PyCFunction) SwigPyObject_own, - (PyCFunction) SwigPyObject_own - }; - static PyGetSetDef thisown_getset_def = { - (char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure - }; - PyTypeObject *builtin_pytype; - int builtin_base_count; - swig_type_info *builtin_basetype; - PyObject *tuple; - PyGetSetDescrObject *static_getset; - PyTypeObject *metatype; - PyTypeObject *swigpyobject; - SwigPyClientData *cd; - PyObject *public_interface, *public_symbol; - PyObject *this_descr; - PyObject *thisown_descr; - PyObject *self = 0; - int i; - - (void)builtin_pytype; - (void)builtin_base_count; - (void)builtin_basetype; - (void)tuple; - (void)static_getset; - (void)self; - - /* Metaclass is used to implement static member variables */ - metatype = SwigPyObjectType(); - assert(metatype); -#endif - - /* Fix SwigMethods to carry the callback ptrs when needed */ - SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial); - -#if PY_VERSION_HEX >= 0x03000000 - m = PyModule_Create(&SWIG_module); -#else - m = Py_InitModule((char *) SWIG_name, SwigMethods); -#endif - - md = d = PyModule_GetDict(m); - (void)md; - - SWIG_InitializeModule(0); - -#ifdef SWIGPYTHON_BUILTIN - swigpyobject = SwigPyObject_TypeOnce(); - - SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject"); - assert(SwigPyObject_stype); - cd = (SwigPyClientData*) SwigPyObject_stype->clientdata; - if (!cd) { - SwigPyObject_stype->clientdata = &SwigPyObject_clientdata; - SwigPyObject_clientdata.pytype = swigpyobject; - } else if (swigpyobject->tp_basicsize != cd->pytype->tp_basicsize) { - PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules."); -# if PY_VERSION_HEX >= 0x03000000 - return NULL; -# else - return; -# endif - } - - /* All objects have a 'this' attribute */ - this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def); - (void)this_descr; - - /* All objects have a 'thisown' attribute */ - thisown_descr = PyDescr_NewGetSet(SwigPyObject_type(), &thisown_getset_def); - (void)thisown_descr; - - public_interface = PyList_New(0); - public_symbol = 0; - (void)public_symbol; - - PyDict_SetItemString(md, "__all__", public_interface); - Py_DECREF(public_interface); - for (i = 0; SwigMethods[i].ml_name != NULL; ++i) - SwigPyBuiltin_AddPublicSymbol(public_interface, SwigMethods[i].ml_name); - for (i = 0; swig_const_table[i].name != 0; ++i) - SwigPyBuiltin_AddPublicSymbol(public_interface, swig_const_table[i].name); -#endif - - SWIG_InstallConstants(d,swig_const_table); - - - /* Initialize threading */ - SWIG_PYTHON_INITIALIZE_THREADS; -#if PY_VERSION_HEX >= 0x03000000 - return m; -#else - return; -#endif -} - diff --git a/changelog.txt b/changelog.txt index 08cbea4..73be1d2 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,45 @@ +Version 3.15.2: +=============== +- Stability and performance improvements + +Version 3.15.1: +=============== +- 'blpapi.Service.createAdminEvent()' is now deprecated. Use 'blpapi.Service.createPublishEvent()' instead + +- Stability and performance improvements + +Version 3.15.0: +=============== +- Provided a simplified interface to handle authentication and authorization + - Simplified authentication settings through the new set of strongly-typed + overloads described with 'AuthOptions' class. + + - Simplified existing multi-phased approach to authorization so that both + token generation and authorization can be done by the SDK. + - If 'AuthOptions' instance is provided to the session through the + newly introduced 'setSessionIdentityOptions' (part of'SessionOptions'), + both token generation and subsequent authorization will be done by the + SDK. Successfully authorized identity would become the default + identity for the session that's used for all future requests unless + a different one is specified explicitly. + + - Additionally, two new session methods that simplify creation of + additional identities have been introduced: + - 'generateAuthorizedIdentity' - generates authorized identity + based on the provided 'AuthOptions'. + - 'getAuthorizedIdentity' - returns authorized identity that's + associated with the 'generateAuthorizedIdentity' call. + +- Improved usage of network bandwidth through support for compression + +- 'blpapi.Message.topicName()' is now deprecated + +- Stability and performance improvements + +Version 3.14.1: +=============== +- Stability and performance improvements + Version 3.14.0: =============== - Improved usage of network bandwidth for snapshot requests diff --git a/examples/ConnectionAndAuthExample.py b/examples/ConnectionAndAuthExample.py new file mode 100644 index 0000000..c7d4af5 --- /dev/null +++ b/examples/ConnectionAndAuthExample.py @@ -0,0 +1,243 @@ +# ConnectionAndAuthExample.py + +"""This example shows how to configure the library to establish connections +using different host and ports, with a session identity. +""" + +from __future__ import print_function + +from argparse import ArgumentParser, Action +import blpapi +from blpapi import AuthOptions, AuthUser + +NONE = "none" +USER = "user" +APP = "app" +USERAPP = "userapp" +DIR = "dir" + + +class AuthOptionsAction(Action): # pylint: disable=too-few-public-methods + """Parse authorization args from user input""" + + def __call__(self, parser, args, values, option_string=None): + vals = values.split("=", 1) + + auth = None + if vals[0] == NONE: + auth = AuthOptions.createDefault() + elif vals[0] == USER: + user = AuthUser.createWithLogonName() + auth = AuthOptions.createWithUser(user) + elif vals[0] == APP and len(vals) == 2: + appName = vals[1] + auth = AuthOptions.createWithApp(appName) + elif vals[0] == USERAPP and len(vals) == 2: + appName = vals[1] + user = AuthUser.createWithLogonName() + auth = AuthOptions.createWithUserAndApp(user, appName) + elif vals[0] == DIR and len(vals) == 2: + dirProperty = vals[1] + user = AuthUser.createWithActiveDirectoryProperty(dirProperty) + auth = AuthOptions.createWithUser(user) + elif vals[0] == "manual": + parts = [] + if len(vals) == 2: + parts = vals[1].split(",") + + if len(parts) != 3: + raise ValueError("Invalid auth option '%s'" % values) + + appName, ipAddress, userId = parts + user = AuthUser.createWithManualOptions(userId, ipAddress) + auth = AuthOptions.createWithUserAndApp(user, appName) + else: + raise ValueError("Invalid auth option '%s'" % values) + + setattr(args, self.dest, auth) + + +class HostAction(Action): # pylint: disable=too-few-public-methods + """ Helper class to parse host arguments """ + + def __call__(self, parser, namespace, values, option_string=None): + host = values.split(":") + if len(host) != 2: + raise ValueError("Invalid host:port '%s'" % values) + host[1] = int(host[1]) + hosts = getattr(namespace, self.dest) + if not hosts: + setattr(namespace, self.dest, [host]) + else: + hosts.append(host) + + +def getTlsOptions(args): + """Create TlsOptions from user input""" + + if (args.tls_client_credentials is None or + args.tls_trust_material is None): + return None + + print("TlsOptions enabled") + if args.read_certificate_files: + credential_blob = None + trust_blob = None + with open(args.tls_client_credentials, 'rb') as credentialfile: + credential_blob = credentialfile.read() + with open(args.tls_trust_material, 'rb') as trustfile: + trust_blob = trustfile.read() + return blpapi.TlsOptions.createFromBlobs( + credential_blob, + args.tls_client_credentials_password, + trust_blob) + + return blpapi.TlsOptions.createFromFiles( + args.tls_client_credentials, + args.tls_client_credentials_password, + args.tls_trust_material) + + +def parseCmdLine(): + """Parse command line arguments""" + + parser = ArgumentParser(description="Connection and Auth example") + + defaultUser = AuthUser.createWithLogonName() + defaultAuthOptions = AuthOptions.createWithUser(defaultUser) + + parser.add_argument("--auth", + dest="auth", + help="authentication option: " + "user|none|app=|userapp=|dir=|" + "manual=" + " (default: user)", + metavar="option", + action=AuthOptionsAction, + default=defaultAuthOptions) + + parser.add_argument("--host", + dest="host", + help="server name or IP, and port " + "(default 'localhost:8194')", + metavar="", + action=HostAction) + + parser.add_argument("--retries", + dest="retries", + help="number of connection retries " + "(default: number of hosts)", + metavar="option", + type=int, + action=AuthOptionsAction) + + # TLS Options + parser.add_argument("--tls-client-credentials", + dest="tls_client_credentials", + help="name a PKCS#12 file to use as a source of " + "client credentials", + metavar="option") + parser.add_argument("--tls-client-credentials-password", + dest="tls_client_credentials_password", + help="specify password for accessing" + " client credentials", + metavar="option", + default="") + parser.add_argument("--tls-trust-material", + dest="tls_trust_material", + help="name a PKCS#7 file to use as a source of trusted" + " certificates", + metavar="option") + parser.add_argument("--read-certificate-files", + dest="read_certificate_files", + help="(optional) read the TLS files and pass the blobs", + action="store_true") + + args = parser.parse_args() + + args.tlsOptions = getTlsOptions(args) + + if not args.host: + args.host = [["localhost", 8194]] + + if args.retries is None: + args.retries = len(args.host) + + return args + + +class ConnectionAndAuthExample: # pylint: disable=too-few-public-methods + """This example shows how to configure the library to establish + connections using different host and ports, with a session identity. + """ + + def __init__(self, options): + self.config = options + + def run(self): + """ Execute the example """ + + sessionOptions = blpapi.SessionOptions() + for i, host in enumerate(self.config.host): + sessionOptions.setServerAddress(host[0], host[1], i) + + sessionOptions.setSessionIdentityOptions(self.config.auth) + sessionOptions.setAutoRestartOnDisconnection(True) + sessionOptions.setNumStartAttempts(self.config.retries) + + if self.config.tlsOptions: + sessionOptions.setTlsOptions(self.config.tlsOptions) + + session = blpapi.Session(sessionOptions) + if not session.start(): + print("Failed to start session.") + return + print("Session started") + + while True: + event = session.nextEvent(1000) + if event: + for message in event: + print(message) + + +def main(): + """ Main function. """ + print("ConnectionAndAuthExample. Press Ctrl+C to stop.") + + options = parseCmdLine() + + example = ConnectionAndAuthExample(options) + + try: + example.run() + except Exception as err: # pylint: disable=W0703 + print("Exception caught: {}".format(err)) + + +if __name__ == "__main__": + try: + main() + except KeyboardInterrupt: + print("Ctrl+C pressed. Stopping...") + +__copyright__ = """ +Copyright 2020. Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above +copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/SessionIdentityExample.py b/examples/SessionIdentityExample.py new file mode 100644 index 0000000..b7f94a9 --- /dev/null +++ b/examples/SessionIdentityExample.py @@ -0,0 +1,144 @@ +""" SessionIdentityExample """ +from __future__ import print_function + +# pylint: disable=deprecated-module +from optparse import OptionParser, OptionValueError +import blpapi +from blpapi import AuthOptions, AuthUser + +NONE = "none" +USER = "user" +APP = "app" +USERAPP = "userapp" + +def authOptionCallback(_option, _opt, value, parser): + """Parse authorization options from user input""" + + vals = value.split('=', 1) + + parser.values.authType = vals[0] + if value == NONE: + parser.values.appName = None + elif value == USER: + parser.values.appName = None + elif vals[0] == APP and len(vals) == 2: + parser.values.appName = vals[1] + elif vals[0] == USERAPP and len(vals) == 2: + parser.values.appName = vals[1] + else: + raise OptionValueError("Invalid auth option '%s'" % value) + +def parseCmdLine(): + """Parse command line arguments""" + + parser = OptionParser(description="Example of session identity" + " authorization mechanisms.") + parser.add_option("-a", + "--ip", + dest="host", + help="server name or IP (default: localhost)", + default="localhost") + parser.add_option("-p", + dest="port", + type="int", + help="server port (default: %default)", + default=8194) + parser.add_option("--auth", + dest="authType", + help="authorization option: " + "none|user|app=|userapp=" + " (default: user)", + metavar="option", + action="callback", + callback=authOptionCallback, + type="string", + default=USER) + + options, _ = parser.parse_args() + + return options + + +class SessionIdentityExample: # pylint: disable=too-few-public-methods + """This example shows how to authorize the session identity.""" + + def __init__(self, options): + self.host = options.host + self.port = options.port + self.authOptionsType = options.authType + if hasattr(options, "appName"): + self.appName = options.appName + + def run(self): + """ Start a session using the session identity. """ + + if self.authOptionsType == USER: + authOptions = AuthOptions \ + .createWithUser(AuthUser.createWithLogonName()) + elif self.authOptionsType == APP: + authOptions = AuthOptions.createWithApp(self.appName) + elif self.authOptionsType == USERAPP: + authOptions = AuthOptions \ + .createWithUserAndApp(AuthUser.createWithLogonName(), + self.appName) + else: + authOptions = AuthOptions.createDefault() + + sessionOptions = blpapi.SessionOptions() + sessionOptions.setServerAddress(self.host, self.port, 0) + sessionOptions.setSessionIdentityOptions(authOptions) + sessionOptions.setAutoRestartOnDisconnection(True) + + session = blpapi.Session(sessionOptions) + if not session.start(): + print("Failed to start session.") + return + + while True: + event = session.tryNextEvent() + if event is None: + break + for msg in event: + print(msg) + + +def main(): + """ Main function. """ + print("SessionIdentityExample") + + options = parseCmdLine() + + example = SessionIdentityExample(options) + + try: + example.run() + except Exception as e: # pylint: disable=broad-except + print("Blpapi exception: {}".format(e)) + + +if __name__ == "__main__": + try: + main() + except KeyboardInterrupt: + print("Ctrl+C pressed. Stopping...") + +__copyright__ = """ +Copyright 2020. Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above +copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/setup.py b/setup.py index 1ded0a4..e728949 100644 --- a/setup.py +++ b/setup.py @@ -28,6 +28,20 @@ def find_version_number(): return version_match.group(1) raise RuntimeError("Unable to find version string.") +def lib_in_release(): + """Returns the right library folder name for each platform""" + if platform == 'windows': + return 'lib' + if platform == 'linux': + return 'Linux' + if platform == 'sunos': + return "lib64" if is64bit else "lib" + if platform == 'aix': + return "lib64" if is64bit else "lib" + if platform == 'darwin': + return 'Darwin' + raise Exception("Platform '" + platform + "' isn't supported") + if version < '2.6': raise Exception( "Python versions before 2.6 are not supported (current version is " @@ -38,7 +52,8 @@ def find_version_number(): blpapiLibVar = os.environ.get('BLPAPI_LIBDIR') assert blpapiRoot or (blpapiIncludesVar and blpapiLibVar), \ - "BLPAPI_ROOT environment variable isn't defined" + "BLPAPI_ROOT (or BLPAPI_INCDIR/BLPAPI_LIBDIR) " + \ + "environment variable isn't defined" is64bit = plat.architecture()[0] == '64bit' if is64bit: @@ -48,7 +63,6 @@ def find_version_number(): extraLinkArgs = [] if platform == 'windows': - blpapiLibraryPath = os.path.join(blpapiRoot, 'lib') extraLinkArgs = ['/MANIFEST'] # Handle the very frequent case when user need to use Visual C++ 2010 @@ -57,20 +71,8 @@ def find_version_number(): if (not 'VS90COMNTOOLS' in os.environ) and \ ('VS100COMNTOOLS' in os.environ): os.environ['VS90COMNTOOLS'] = os.environ['VS100COMNTOOLS'] -elif platform == 'linux': - blpapiLibraryPath = os.path.join(blpapiRoot, 'Linux') -elif platform == 'sunos': - lib = "lib64" if is64bit else "lib" - blpapiLibraryPath = os.path.join(blpapiRoot, lib) -elif platform == 'aix': - lib = "lib64" if is64bit else "lib" - blpapiLibraryPath = os.path.join(blpapiRoot, lib) -elif platform == 'darwin': - blpapiLibraryPath = os.path.join(blpapiRoot, 'Darwin') -else: - raise Exception("Platform '" + platform + "' isn't supported") -blpapiLibraryPath = blpapiLibVar or blpapiLibraryPath +blpapiLibraryPath = blpapiLibVar or os.path.join(blpapiRoot, lib_in_release()) blpapiIncludes = blpapiIncludesVar or os.path.join(blpapiRoot, 'include') blpapi_wrap = Extension( From f2da1b30dffabb7c746043bc75a59803ffa65181 Mon Sep 17 00:00:00 2001 From: Marland Sitt Date: Sat, 30 Jan 2021 21:32:25 -0800 Subject: [PATCH 06/23] Bump to v3.16.1 --- PKG-INFO | 2 +- blpapi/__init__.py | 4 + blpapi/abstractsession.py | 10 +- blpapi/compat.py | 7 + blpapi/constant.py | 28 +- blpapi/datetime.py | 40 + blpapi/exception.py | 9 - blpapi/internals.py | 252 +- blpapi/internals_wrap.c | 10063 ++++++++++------ blpapi/logging.py | 21 +- blpapi/message.py | 35 +- blpapi/providersession.py | 8 +- blpapi/request.py | 18 + blpapi/resolutionlist.py | 103 +- blpapi/schema.py | 4 + blpapi/session.py | 41 +- blpapi/test/__init__.py | 7 + blpapi/test/messageformatter.py | 465 + blpapi/test/messageproperties.py | 131 + blpapi/test/testutil.py | 167 + blpapi/testtools.py | 254 - blpapi/utils.py | 67 +- blpapi/version.py | 2 +- changelog.txt | 31 + examples/ConnectionAndAuthExample.py | 28 +- examples/ContributionsMktdataExample.py | 164 +- examples/ContributionsPageExample.py | 167 +- examples/CorrelationExample.py | 12 +- .../EntitlementsVerificationTokenExample.py | 11 +- examples/GenerateTokenExample.py | 12 +- examples/GenerateTokenSubscriptionExample.py | 12 +- examples/IntradayBarExample.py | 10 +- examples/IntradayTickExample.py | 137 +- examples/LocalMktdataSubscriptionExample.py | 295 +- examples/LocalPageSubscriptionExample.py | 137 +- examples/MktdataBroadcastPublisherExample.py | 166 +- examples/MktdataPublisher.py | 175 +- examples/PagePublisherExample.py | 170 +- examples/RefDataTableOverrideExample.py | 10 +- examples/RequestServiceExample.py | 186 +- examples/ServiceSchema.py | 202 +- examples/SessionIdentityExample.py | 21 +- examples/SimpleAsyncSubscription.py | 167 +- examples/SimpleBlockingRequestExample.py | 10 +- .../SimpleCategorizedFieldSearchExample.py | 10 +- examples/SimpleFieldInfoExample.py | 10 +- examples/SimpleFieldSearchExample.py | 10 +- examples/SimpleHistoryExample.py | 10 +- examples/SimpleIntradayBarExample.py | 10 +- examples/SimpleIntradayTickExample.py | 10 +- examples/SimpleRefDataExample.py | 10 +- examples/SimpleRefDataOverrideExample.py | 11 +- examples/SimpleSubscriptionExample.py | 11 +- examples/SimpleSubscriptionIntervalExample.py | 12 +- examples/SnapshotRequestTemplateExample.py | 157 +- examples/SubscriptionCorrelationExample.py | 10 +- .../SubscriptionWithEventHandlerExample.py | 11 +- examples/ZfpOverLeasedLinesSessionExample.py | 72 +- .../market-data-notifier/src/__init__.py | 0 .../market-data-notifier/src/appconfig.py | 128 + .../market-data-notifier/src/application.py | 49 + .../market-data-notifier/src/authorizer.py | 90 + .../src/compute_engine.py | 30 + .../src/event_processor.py | 48 + .../market-data-notifier/src/main.py | 59 + .../market-data-notifier/src/notifier.py | 44 + .../market-data-notifier/src/subscriber.py | 40 + .../src/token_generator.py | 55 + .../tests/test_application.py | 133 + .../tests/test_authorizer.py | 299 + .../tests/test_eventprocessor.py | 187 + .../tests/test_tokengenerator.py | 130 + .../mock-test-examples/snippets/events.py | 830 ++ .../mock-test-examples/snippets/refdata.py | 172 + .../snippets/resolver/resolverutils.py | 119 + .../snippets/resolver/test_resolverutils.py | 209 + setup.py | 2 +- 77 files changed, 11035 insertions(+), 5804 deletions(-) create mode 100644 blpapi/test/__init__.py create mode 100644 blpapi/test/messageformatter.py create mode 100644 blpapi/test/messageproperties.py create mode 100644 blpapi/test/testutil.py delete mode 100644 blpapi/testtools.py create mode 100644 examples/mock-test-examples/market-data-notifier/src/__init__.py create mode 100644 examples/mock-test-examples/market-data-notifier/src/appconfig.py create mode 100644 examples/mock-test-examples/market-data-notifier/src/application.py create mode 100644 examples/mock-test-examples/market-data-notifier/src/authorizer.py create mode 100644 examples/mock-test-examples/market-data-notifier/src/compute_engine.py create mode 100644 examples/mock-test-examples/market-data-notifier/src/event_processor.py create mode 100644 examples/mock-test-examples/market-data-notifier/src/main.py create mode 100644 examples/mock-test-examples/market-data-notifier/src/notifier.py create mode 100644 examples/mock-test-examples/market-data-notifier/src/subscriber.py create mode 100644 examples/mock-test-examples/market-data-notifier/src/token_generator.py create mode 100644 examples/mock-test-examples/market-data-notifier/tests/test_application.py create mode 100644 examples/mock-test-examples/market-data-notifier/tests/test_authorizer.py create mode 100644 examples/mock-test-examples/market-data-notifier/tests/test_eventprocessor.py create mode 100644 examples/mock-test-examples/market-data-notifier/tests/test_tokengenerator.py create mode 100644 examples/mock-test-examples/snippets/events.py create mode 100644 examples/mock-test-examples/snippets/refdata.py create mode 100644 examples/mock-test-examples/snippets/resolver/resolverutils.py create mode 100644 examples/mock-test-examples/snippets/resolver/test_resolverutils.py diff --git a/PKG-INFO b/PKG-INFO index fe60dc0..f77af09 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: blpapi -Version: 3.15.2 +Version: 3.16.1 Summary: Python SDK for Bloomberg BLPAPI Home-page: http://www.bloomberglabs.com/api/ Author: Bloomberg L.P. diff --git a/blpapi/__init__.py b/blpapi/__init__.py index fd6d681..8ebb030 100644 --- a/blpapi/__init__.py +++ b/blpapi/__init__.py @@ -1,6 +1,7 @@ # __init__.py # pylint: disable=missing-docstring,redefined-builtin,wildcard-import +# pylint: disable=raise-missing-from try: from .internals import CorrelationId @@ -37,6 +38,9 @@ from .zfputil import ZfpUtil from .version import __version__, version, cpp_sdk_version, print_version +# blpapi.test module +from .test import * + __copyright__ = """ Copyright 2012. Bloomberg Finance L.P. diff --git a/blpapi/abstractsession.py b/blpapi/abstractsession.py index 801eb5f..b74ef93 100644 --- a/blpapi/abstractsession.py +++ b/blpapi/abstractsession.py @@ -110,7 +110,8 @@ def openService(self, serviceName): serviceName (str): Name of the service Returns: - Service: service identified by the specified ``serviceName``. + bool: ``True`` if the service is opened successfully, ``False`` + otherwise. Attempt to open the service identified by the specified ``serviceName`` and block until the service is either opened successfully or has failed @@ -216,8 +217,8 @@ def sendAuthorizationRequest(self, get_handle(identity), get_handle(correlationId), get_handle(eventQueue), - None, # no request label - 0)) # request label length 0 + None # no request label + )) if eventQueue is not None: eventQueue._registerSession(self) return correlationId @@ -249,8 +250,7 @@ def cancel(self, correlationId): self.__handle, get_handle(correlationId), 1, # number of correlation IDs supplied - None, # no request label - 0)) # request label length 0 + None)) # no request label def generateToken(self, correlationId=None, eventQueue=None, authId=None, ipAddress=None): diff --git a/blpapi/compat.py b/blpapi/compat.py index 8b68f64..25d622c 100644 --- a/blpapi/compat.py +++ b/blpapi/compat.py @@ -73,3 +73,10 @@ def isstr(s): int_typelist = (int, long) else: int_typelist = (int,) + +# NOTE: string typelist for different python versions +# to use with isinstance builtin function +if sys.version.startswith('2'): + str_typelist = (str, unicode) +else: + str_typelist = (bytes, str) diff --git a/blpapi/constant.py b/blpapi/constant.py index 9d67a16..56940cb 100644 --- a/blpapi/constant.py +++ b/blpapi/constant.py @@ -20,7 +20,7 @@ from . import utils from . import internals -# pylint: disable=protected-access,old-style-class +# pylint: disable=protected-access class Constant: """Represents the value of a schema enumeration constant. @@ -93,8 +93,12 @@ def getValueAsInteger(self): InvalidConversionException: If the value cannot be converted to an integer. """ - errCode, value = internals.blpapi_Constant_getValueAsInt64( - self.__handle) + if self.datatype() == DataType.INT32: + errCode, value = internals.blpapi_Constant_getValueAsInt32( + self.__handle) + else: + errCode, value = internals.blpapi_Constant_getValueAsInt64( + self.__handle) _ExceptionUtil.raiseOnError(errCode) return value @@ -107,8 +111,12 @@ def getValueAsFloat(self): InvalidConversionException: If the value cannot be converted to a float. """ - errCode, value = internals.blpapi_Constant_getValueAsFloat64( - self.__handle) + if self.datatype() == DataType.FLOAT32: + errCode, value = internals.blpapi_Constant_getValueAsFloat32( + self.__handle) + else: + errCode, value = internals.blpapi_Constant_getValueAsFloat64( + self.__handle) _ExceptionUtil.raiseOnError(errCode) return value @@ -125,7 +133,7 @@ def getValueAsDatetime(self): errCode, value = internals.blpapi_Constant_getValueAsDatetime( self.__handle) _ExceptionUtil.raiseOnError(errCode) - return _DatetimeUtil.convertToNative(value) + return _DatetimeUtil.convertToNativeNotHighPrecision(value) def getValueAsString(self): """ @@ -136,8 +144,12 @@ def getValueAsString(self): InvalidConversionException: If the value cannot be converted to a string. """ - errCode, value = internals.blpapi_Constant_getValueAsString( - self.__handle) + if self.datatype() == DataType.CHAR: + errCode, value = internals.blpapi_Constant_getValueAsChar( + self.__handle) + else: + errCode, value = internals.blpapi_Constant_getValueAsString( + self.__handle) _ExceptionUtil.raiseOnError(errCode) return value diff --git a/blpapi/datetime.py b/blpapi/datetime.py index f65380c..414ec30 100644 --- a/blpapi/datetime.py +++ b/blpapi/datetime.py @@ -151,6 +151,46 @@ def convertToNative(blpapiDatetimeObj): blpapiDatetime.seconds, microsecs, tzinfo) + @staticmethod + def convertToNativeNotHighPrecision(blpapiDatetime): + """Convert BLPAPI Datetime object to a suitable Python object. + This version should only be used for logging callback which does not + provide a high precision datetime alternative.""" + + parts = blpapiDatetime.parts + hasDate = parts & internals.DATETIME_DATE_PART == \ + internals.DATETIME_DATE_PART + hasTime = parts & internals.DATETIME_TIME_PART == \ + internals.DATETIME_TIME_PART + microsecs = blpapiDatetime.milliSeconds * 1000 if parts & \ + internals.DATETIME_MILLISECONDS_PART else 0 + tzinfo = FixedOffset(blpapiDatetime.offset) if parts & \ + internals.DATETIME_OFFSET_PART else None + if hasDate: + if hasTime: + return _dt.datetime(blpapiDatetime.year, + blpapiDatetime.month, + blpapiDatetime.day, + blpapiDatetime.hours, + blpapiDatetime.minutes, + blpapiDatetime.seconds, + microsecs, + tzinfo) + # Skip an offset, because it's not informative in case of + # there is a date without the time + return _dt.date(blpapiDatetime.year, + blpapiDatetime.month, + blpapiDatetime.day) + + if not hasTime: + raise ValueError( + "Datetime object misses both time and date parts", + blpapiDatetime) + return _dt.time(blpapiDatetime.hours, + blpapiDatetime.minutes, + blpapiDatetime.seconds, + microsecs, + tzinfo) @staticmethod def isDatetime(dtime): diff --git a/blpapi/exception.py b/blpapi/exception.py index 7cb9aac..a382ef2 100644 --- a/blpapi/exception.py +++ b/blpapi/exception.py @@ -39,7 +39,6 @@ class DuplicateCorrelationIdException(Exception): The class defines an exception for non unique :class:`CorrelationId`. """ - pass class InvalidStateException(Exception): @@ -48,7 +47,6 @@ class InvalidStateException(Exception): This class defines an exception for calling methods on an object that is not in a valid state. """ - pass class InvalidArgumentException(Exception): @@ -57,7 +55,6 @@ class InvalidArgumentException(Exception): This class defines an exception for invalid arguments on method invocations. """ - pass class InvalidConversionException(Exception): @@ -65,7 +62,6 @@ class InvalidConversionException(Exception): This class defines an exception for invalid conversion of data. """ - pass class IndexOutOfRangeException(Exception): @@ -74,7 +70,6 @@ class IndexOutOfRangeException(Exception): This class defines an exception to capture the error when an invalid index is used for an operation that needs index. """ - pass class NotFoundException(Exception): @@ -84,7 +79,6 @@ class NotFoundException(Exception): found for an operation. """ - pass class FieldNotFoundException(Exception): @@ -95,7 +89,6 @@ class FieldNotFoundException(Exception): **DEPRECATED** """ - pass class UnsupportedOperationException(Exception): @@ -103,7 +96,6 @@ class UnsupportedOperationException(Exception): This class defines an exception for unsupported operations. """ - pass class UnknownErrorException(Exception): @@ -112,7 +104,6 @@ class UnknownErrorException(Exception): This class defines an exception for errors that do not fall in any predefined category. """ - pass class _ExceptionUtil(object): diff --git a/blpapi/internals.py b/blpapi/internals.py index 8057f9a..569aad8 100644 --- a/blpapi/internals.py +++ b/blpapi/internals.py @@ -264,10 +264,18 @@ def blpapi_SchemaTypeDefinition_printHelper(item, level, spacesPerLevel): return _internals.blpapi_SchemaTypeDefinition_printHelper(item, level, spacesPerLevel) blpapi_SchemaTypeDefinition_printHelper = _internals.blpapi_SchemaTypeDefinition_printHelper +def blpapi_Message_printHelper(message, level, spacesPerLevel): + return _internals.blpapi_Message_printHelper(message, level, spacesPerLevel) +blpapi_Message_printHelper = _internals.blpapi_Message_printHelper + def blpapi_SessionOptions_printHelper(sessionOptions, level, spacesPerLevel): return _internals.blpapi_SessionOptions_printHelper(sessionOptions, level, spacesPerLevel) blpapi_SessionOptions_printHelper = _internals.blpapi_SessionOptions_printHelper +def blpapi_TestUtil_serializeServiceHelper(service): + return _internals.blpapi_TestUtil_serializeServiceHelper(service) +blpapi_TestUtil_serializeServiceHelper = _internals.blpapi_TestUtil_serializeServiceHelper + def blpapi_SchemaTypeDefinition_hasElementDefinition(type, nameString, name): return _internals.blpapi_SchemaTypeDefinition_hasElementDefinition(type, nameString, name) blpapi_SchemaTypeDefinition_hasElementDefinition = _internals.blpapi_SchemaTypeDefinition_hasElementDefinition @@ -611,12 +619,12 @@ def blpapi_Element_getValueAsBool(element, index): return _internals.blpapi_Element_getValueAsBool(element, index) blpapi_Element_getValueAsBool = _internals.blpapi_Element_getValueAsBool -def blpapi_Element_getValueAsChar(element, buffer, index): - return _internals.blpapi_Element_getValueAsChar(element, buffer, index) +def blpapi_Element_getValueAsChar(element, index): + return _internals.blpapi_Element_getValueAsChar(element, index) blpapi_Element_getValueAsChar = _internals.blpapi_Element_getValueAsChar -def blpapi_Element_getValueAsInt32(element, buffer, index): - return _internals.blpapi_Element_getValueAsInt32(element, buffer, index) +def blpapi_Element_getValueAsInt32(element, index): + return _internals.blpapi_Element_getValueAsInt32(element, index) blpapi_Element_getValueAsInt32 = _internals.blpapi_Element_getValueAsInt32 def blpapi_Element_getValueAsInt64(element, index): @@ -855,6 +863,130 @@ def ProviderSession_terminateSubscriptionsOnTopic(sessionHandle, topic, message) return _internals.ProviderSession_terminateSubscriptionsOnTopic(sessionHandle, topic, message) ProviderSession_terminateSubscriptionsOnTopic = _internals.ProviderSession_terminateSubscriptionsOnTopic +def blpapi_MessageFormatter_setValueFloat(formatter, typeName, value): + return _internals.blpapi_MessageFormatter_setValueFloat(formatter, typeName, value) +blpapi_MessageFormatter_setValueFloat = _internals.blpapi_MessageFormatter_setValueFloat + +def blpapi_MessageFormatter_appendValueFloat(formatter, value): + return _internals.blpapi_MessageFormatter_appendValueFloat(formatter, value) +blpapi_MessageFormatter_appendValueFloat = _internals.blpapi_MessageFormatter_appendValueFloat + +def blpapi_MessageFormatter_setValueBool(formatter, typeName, value): + return _internals.blpapi_MessageFormatter_setValueBool(formatter, typeName, value) +blpapi_MessageFormatter_setValueBool = _internals.blpapi_MessageFormatter_setValueBool + +def blpapi_MessageFormatter_setValueChar(formatter, typeName, value): + return _internals.blpapi_MessageFormatter_setValueChar(formatter, typeName, value) +blpapi_MessageFormatter_setValueChar = _internals.blpapi_MessageFormatter_setValueChar + +def blpapi_MessageFormatter_setValueInt32(formatter, typeName, value): + return _internals.blpapi_MessageFormatter_setValueInt32(formatter, typeName, value) +blpapi_MessageFormatter_setValueInt32 = _internals.blpapi_MessageFormatter_setValueInt32 + +def blpapi_MessageFormatter_setValueInt64(formatter, typeName, value): + return _internals.blpapi_MessageFormatter_setValueInt64(formatter, typeName, value) +blpapi_MessageFormatter_setValueInt64 = _internals.blpapi_MessageFormatter_setValueInt64 + +def blpapi_MessageFormatter_setValueFloat32(formatter, typeName, value): + return _internals.blpapi_MessageFormatter_setValueFloat32(formatter, typeName, value) +blpapi_MessageFormatter_setValueFloat32 = _internals.blpapi_MessageFormatter_setValueFloat32 + +def blpapi_MessageFormatter_setValueFloat64(formatter, typeName, value): + return _internals.blpapi_MessageFormatter_setValueFloat64(formatter, typeName, value) +blpapi_MessageFormatter_setValueFloat64 = _internals.blpapi_MessageFormatter_setValueFloat64 + +def blpapi_MessageFormatter_setValueDatetime(formatter, typeName, value): + return _internals.blpapi_MessageFormatter_setValueDatetime(formatter, typeName, value) +blpapi_MessageFormatter_setValueDatetime = _internals.blpapi_MessageFormatter_setValueDatetime + +def blpapi_MessageFormatter_setValueHighPrecisionDatetime(formatter, typeName, value): + return _internals.blpapi_MessageFormatter_setValueHighPrecisionDatetime(formatter, typeName, value) +blpapi_MessageFormatter_setValueHighPrecisionDatetime = _internals.blpapi_MessageFormatter_setValueHighPrecisionDatetime + +def blpapi_MessageFormatter_setValueString(formatter, typeName, value): + return _internals.blpapi_MessageFormatter_setValueString(formatter, typeName, value) +blpapi_MessageFormatter_setValueString = _internals.blpapi_MessageFormatter_setValueString + +def blpapi_MessageFormatter_setValueFromName(formatter, typeName, value): + return _internals.blpapi_MessageFormatter_setValueFromName(formatter, typeName, value) +blpapi_MessageFormatter_setValueFromName = _internals.blpapi_MessageFormatter_setValueFromName + +def blpapi_MessageFormatter_setValueNull(formatter, typeName): + return _internals.blpapi_MessageFormatter_setValueNull(formatter, typeName) +blpapi_MessageFormatter_setValueNull = _internals.blpapi_MessageFormatter_setValueNull + +def blpapi_MessageFormatter_pushElement(formatter, typeName): + return _internals.blpapi_MessageFormatter_pushElement(formatter, typeName) +blpapi_MessageFormatter_pushElement = _internals.blpapi_MessageFormatter_pushElement + +def blpapi_MessageFormatter_popElement(formatter): + return _internals.blpapi_MessageFormatter_popElement(formatter) +blpapi_MessageFormatter_popElement = _internals.blpapi_MessageFormatter_popElement + +def blpapi_MessageFormatter_appendValueBool(formatter, value): + return _internals.blpapi_MessageFormatter_appendValueBool(formatter, value) +blpapi_MessageFormatter_appendValueBool = _internals.blpapi_MessageFormatter_appendValueBool + +def blpapi_MessageFormatter_appendValueChar(formatter, value): + return _internals.blpapi_MessageFormatter_appendValueChar(formatter, value) +blpapi_MessageFormatter_appendValueChar = _internals.blpapi_MessageFormatter_appendValueChar + +def blpapi_MessageFormatter_appendValueInt32(formatter, value): + return _internals.blpapi_MessageFormatter_appendValueInt32(formatter, value) +blpapi_MessageFormatter_appendValueInt32 = _internals.blpapi_MessageFormatter_appendValueInt32 + +def blpapi_MessageFormatter_appendValueInt64(formatter, value): + return _internals.blpapi_MessageFormatter_appendValueInt64(formatter, value) +blpapi_MessageFormatter_appendValueInt64 = _internals.blpapi_MessageFormatter_appendValueInt64 + +def blpapi_MessageFormatter_appendValueFloat32(formatter, value): + return _internals.blpapi_MessageFormatter_appendValueFloat32(formatter, value) +blpapi_MessageFormatter_appendValueFloat32 = _internals.blpapi_MessageFormatter_appendValueFloat32 + +def blpapi_MessageFormatter_appendValueFloat64(formatter, value): + return _internals.blpapi_MessageFormatter_appendValueFloat64(formatter, value) +blpapi_MessageFormatter_appendValueFloat64 = _internals.blpapi_MessageFormatter_appendValueFloat64 + +def blpapi_MessageFormatter_appendValueDatetime(formatter, value): + return _internals.blpapi_MessageFormatter_appendValueDatetime(formatter, value) +blpapi_MessageFormatter_appendValueDatetime = _internals.blpapi_MessageFormatter_appendValueDatetime + +def blpapi_MessageFormatter_appendValueHighPrecisionDatetime(formatter, value): + return _internals.blpapi_MessageFormatter_appendValueHighPrecisionDatetime(formatter, value) +blpapi_MessageFormatter_appendValueHighPrecisionDatetime = _internals.blpapi_MessageFormatter_appendValueHighPrecisionDatetime + +def blpapi_MessageFormatter_appendValueString(formatter, value): + return _internals.blpapi_MessageFormatter_appendValueString(formatter, value) +blpapi_MessageFormatter_appendValueString = _internals.blpapi_MessageFormatter_appendValueString + +def blpapi_MessageFormatter_appendValueFromName(formatter, value): + return _internals.blpapi_MessageFormatter_appendValueFromName(formatter, value) +blpapi_MessageFormatter_appendValueFromName = _internals.blpapi_MessageFormatter_appendValueFromName + +def blpapi_MessageFormatter_appendElement(formatter): + return _internals.blpapi_MessageFormatter_appendElement(formatter) +blpapi_MessageFormatter_appendElement = _internals.blpapi_MessageFormatter_appendElement + +def blpapi_MessageFormatter_FormatMessageJson(formatter, message): + return _internals.blpapi_MessageFormatter_FormatMessageJson(formatter, message) +blpapi_MessageFormatter_FormatMessageJson = _internals.blpapi_MessageFormatter_FormatMessageJson + +def blpapi_MessageFormatter_FormatMessageXml(formatter, message): + return _internals.blpapi_MessageFormatter_FormatMessageXml(formatter, message) +blpapi_MessageFormatter_FormatMessageXml = _internals.blpapi_MessageFormatter_FormatMessageXml + +def blpapi_MessageFormatter_copy(original): + return _internals.blpapi_MessageFormatter_copy(original) +blpapi_MessageFormatter_copy = _internals.blpapi_MessageFormatter_copy + +def blpapi_MessageFormatter_assign(rhs): + return _internals.blpapi_MessageFormatter_assign(rhs) +blpapi_MessageFormatter_assign = _internals.blpapi_MessageFormatter_assign + +def blpapi_MessageFormatter_destroy(formatter): + return _internals.blpapi_MessageFormatter_destroy(formatter) +blpapi_MessageFormatter_destroy = _internals.blpapi_MessageFormatter_destroy + def blpapi_AuthOptions_create_default(): return _internals.blpapi_AuthOptions_create_default() blpapi_AuthOptions_create_default = _internals.blpapi_AuthOptions_create_default @@ -1407,10 +1539,22 @@ def blpapi_Constant_datatype(constant): return _internals.blpapi_Constant_datatype(constant) blpapi_Constant_datatype = _internals.blpapi_Constant_datatype +def blpapi_Constant_getValueAsChar(constant): + return _internals.blpapi_Constant_getValueAsChar(constant) +blpapi_Constant_getValueAsChar = _internals.blpapi_Constant_getValueAsChar + +def blpapi_Constant_getValueAsInt32(constant): + return _internals.blpapi_Constant_getValueAsInt32(constant) +blpapi_Constant_getValueAsInt32 = _internals.blpapi_Constant_getValueAsInt32 + def blpapi_Constant_getValueAsInt64(constant): return _internals.blpapi_Constant_getValueAsInt64(constant) blpapi_Constant_getValueAsInt64 = _internals.blpapi_Constant_getValueAsInt64 +def blpapi_Constant_getValueAsFloat32(constant): + return _internals.blpapi_Constant_getValueAsFloat32(constant) +blpapi_Constant_getValueAsFloat32 = _internals.blpapi_Constant_getValueAsFloat32 + def blpapi_Constant_getValueAsFloat64(constant): return _internals.blpapi_Constant_getValueAsFloat64(constant) blpapi_Constant_getValueAsFloat64 = _internals.blpapi_Constant_getValueAsFloat64 @@ -1539,6 +1683,10 @@ def blpapi_Request_setPreferredRoute(request, correlationId): return _internals.blpapi_Request_setPreferredRoute(request, correlationId) blpapi_Request_setPreferredRoute = _internals.blpapi_Request_setPreferredRoute +def blpapi_Request_getRequestId(request): + return _internals.blpapi_Request_getRequestId(request) +blpapi_Request_getRequestId = _internals.blpapi_Request_getRequestId + def blpapi_RequestTemplate_release(requestTemplate): return _internals.blpapi_RequestTemplate_release(requestTemplate) blpapi_RequestTemplate_release = _internals.blpapi_RequestTemplate_release @@ -1651,6 +1799,10 @@ def blpapi_Message_correlationId(message, index): return _internals.blpapi_Message_correlationId(message, index) blpapi_Message_correlationId = _internals.blpapi_Message_correlationId +def blpapi_Message_getRequestId(message): + return _internals.blpapi_Message_getRequestId(message) +blpapi_Message_getRequestId = _internals.blpapi_Message_getRequestId + def blpapi_Message_elements(message): return _internals.blpapi_Message_elements(message) blpapi_Message_elements = _internals.blpapi_Message_elements @@ -1663,10 +1815,6 @@ def blpapi_Message_recapType(message): return _internals.blpapi_Message_recapType(message) blpapi_Message_recapType = _internals.blpapi_Message_recapType -def blpapi_Message_print(message, streamWriter, stream, indentLevel, spacesPerLevel): - return _internals.blpapi_Message_print(message, streamWriter, stream, indentLevel, spacesPerLevel) -blpapi_Message_print = _internals.blpapi_Message_print - def blpapi_Message_addRef(message): return _internals.blpapi_Message_addRef(message) blpapi_Message_addRef = _internals.blpapi_Message_addRef @@ -1743,12 +1891,12 @@ def blpapi_HighResolutionClock_now(): return _internals.blpapi_HighResolutionClock_now() blpapi_HighResolutionClock_now = _internals.blpapi_HighResolutionClock_now -def blpapi_AbstractSession_cancel(session, correlationIds, numCorrelationIds, requestLabel, requestLabelLen): - return _internals.blpapi_AbstractSession_cancel(session, correlationIds, numCorrelationIds, requestLabel, requestLabelLen) +def blpapi_AbstractSession_cancel(session, correlationIds, numCorrelationIds, requestLabel): + return _internals.blpapi_AbstractSession_cancel(session, correlationIds, numCorrelationIds, requestLabel) blpapi_AbstractSession_cancel = _internals.blpapi_AbstractSession_cancel -def blpapi_AbstractSession_sendAuthorizationRequest(session, request, identity, correlationId, eventQueue, requestLabel, requestLabelLen): - return _internals.blpapi_AbstractSession_sendAuthorizationRequest(session, request, identity, correlationId, eventQueue, requestLabel, requestLabelLen) +def blpapi_AbstractSession_sendAuthorizationRequest(session, request, identity, correlationId, eventQueue, requestLabel): + return _internals.blpapi_AbstractSession_sendAuthorizationRequest(session, request, identity, correlationId, eventQueue, requestLabel) blpapi_AbstractSession_sendAuthorizationRequest = _internals.blpapi_AbstractSession_sendAuthorizationRequest def blpapi_AbstractSession_openService(session, serviceIdentifier): @@ -1807,28 +1955,28 @@ def blpapi_Session_tryNextEvent(session): return _internals.blpapi_Session_tryNextEvent(session) blpapi_Session_tryNextEvent = _internals.blpapi_Session_tryNextEvent -def blpapi_Session_subscribe(session, subscriptionList, handle, requestLabel, requestLabelLen): - return _internals.blpapi_Session_subscribe(session, subscriptionList, handle, requestLabel, requestLabelLen) +def blpapi_Session_subscribe(session, subscriptionList, handle, requestLabel): + return _internals.blpapi_Session_subscribe(session, subscriptionList, handle, requestLabel) blpapi_Session_subscribe = _internals.blpapi_Session_subscribe -def blpapi_Session_resubscribe(session, resubscriptionList, requestLabel, requestLabelLen): - return _internals.blpapi_Session_resubscribe(session, resubscriptionList, requestLabel, requestLabelLen) +def blpapi_Session_resubscribe(session, resubscriptionList, requestLabel): + return _internals.blpapi_Session_resubscribe(session, resubscriptionList, requestLabel) blpapi_Session_resubscribe = _internals.blpapi_Session_resubscribe -def blpapi_Session_resubscribeWithId(session, resubscriptionList, resubscriptionId, requestLabel, requestLabelLen): - return _internals.blpapi_Session_resubscribeWithId(session, resubscriptionList, resubscriptionId, requestLabel, requestLabelLen) +def blpapi_Session_resubscribeWithId(session, resubscriptionList, resubscriptionId, requestLabel): + return _internals.blpapi_Session_resubscribeWithId(session, resubscriptionList, resubscriptionId, requestLabel) blpapi_Session_resubscribeWithId = _internals.blpapi_Session_resubscribeWithId -def blpapi_Session_unsubscribe(session, unsubscriptionList, requestLabel, requestLabelLen): - return _internals.blpapi_Session_unsubscribe(session, unsubscriptionList, requestLabel, requestLabelLen) +def blpapi_Session_unsubscribe(session, unsubscriptionList, requestLabel): + return _internals.blpapi_Session_unsubscribe(session, unsubscriptionList, requestLabel) blpapi_Session_unsubscribe = _internals.blpapi_Session_unsubscribe def blpapi_Session_setStatusCorrelationId(session, service, identity, correlationId): return _internals.blpapi_Session_setStatusCorrelationId(session, service, identity, correlationId) blpapi_Session_setStatusCorrelationId = _internals.blpapi_Session_setStatusCorrelationId -def blpapi_Session_sendRequest(session, request, correlationId, identity, eventQueue, requestLabel, requestLabelLen): - return _internals.blpapi_Session_sendRequest(session, request, correlationId, identity, eventQueue, requestLabel, requestLabelLen) +def blpapi_Session_sendRequest(session, request, correlationId, identity, eventQueue, requestLabel): + return _internals.blpapi_Session_sendRequest(session, request, correlationId, identity, eventQueue, requestLabel) blpapi_Session_sendRequest = _internals.blpapi_Session_sendRequest def blpapi_Session_sendRequestTemplate(session, requestTemplate, correlationId): @@ -1907,6 +2055,66 @@ def blpapi_ResolutionList_size(list): return _internals.blpapi_ResolutionList_size(list) blpapi_ResolutionList_size = _internals.blpapi_ResolutionList_size +def blpapi_TestUtil_createEvent(eventType): + return _internals.blpapi_TestUtil_createEvent(eventType) +blpapi_TestUtil_createEvent = _internals.blpapi_TestUtil_createEvent + +def blpapi_TestUtil_deserializeService(schema, schemaLength): + return _internals.blpapi_TestUtil_deserializeService(schema, schemaLength) +blpapi_TestUtil_deserializeService = _internals.blpapi_TestUtil_deserializeService + +def blpapi_TestUtil_serializeService(streamWriter, stream, service): + return _internals.blpapi_TestUtil_serializeService(streamWriter, stream, service) +blpapi_TestUtil_serializeService = _internals.blpapi_TestUtil_serializeService + +def blpapi_TestUtil_appendMessage(event, messageType, properties): + return _internals.blpapi_TestUtil_appendMessage(event, messageType, properties) +blpapi_TestUtil_appendMessage = _internals.blpapi_TestUtil_appendMessage + +def blpapi_TestUtil_createTopic(service, isActive): + return _internals.blpapi_TestUtil_createTopic(service, isActive) +blpapi_TestUtil_createTopic = _internals.blpapi_TestUtil_createTopic + +def blpapi_TestUtil_getAdminMessageDefinition(messageName): + return _internals.blpapi_TestUtil_getAdminMessageDefinition(messageName) +blpapi_TestUtil_getAdminMessageDefinition = _internals.blpapi_TestUtil_getAdminMessageDefinition + +def blpapi_MessageProperties_create(): + return _internals.blpapi_MessageProperties_create() +blpapi_MessageProperties_create = _internals.blpapi_MessageProperties_create + +def blpapi_MessageProperties_destroy(messageProperties): + return _internals.blpapi_MessageProperties_destroy(messageProperties) +blpapi_MessageProperties_destroy = _internals.blpapi_MessageProperties_destroy + +def blpapi_MessageProperties_copy(src): + return _internals.blpapi_MessageProperties_copy(src) +blpapi_MessageProperties_copy = _internals.blpapi_MessageProperties_copy + +def blpapi_MessageProperties_assign(lhs, rhs): + return _internals.blpapi_MessageProperties_assign(lhs, rhs) +blpapi_MessageProperties_assign = _internals.blpapi_MessageProperties_assign + +def blpapi_MessageProperties_setCorrelationIds(messageProperties, correlationIds): + return _internals.blpapi_MessageProperties_setCorrelationIds(messageProperties, correlationIds) +blpapi_MessageProperties_setCorrelationIds = _internals.blpapi_MessageProperties_setCorrelationIds + +def blpapi_MessageProperties_setRecapType(messageProperties, recap, fragment): + return _internals.blpapi_MessageProperties_setRecapType(messageProperties, recap, fragment) +blpapi_MessageProperties_setRecapType = _internals.blpapi_MessageProperties_setRecapType + +def blpapi_MessageProperties_setTimeReceived(messageProperties, timestamp): + return _internals.blpapi_MessageProperties_setTimeReceived(messageProperties, timestamp) +blpapi_MessageProperties_setTimeReceived = _internals.blpapi_MessageProperties_setTimeReceived + +def blpapi_MessageProperties_setService(messageProperties, service): + return _internals.blpapi_MessageProperties_setService(messageProperties, service) +blpapi_MessageProperties_setService = _internals.blpapi_MessageProperties_setService + +def blpapi_MessageProperties_setRequestId(messageProperties, requestId): + return _internals.blpapi_MessageProperties_setRequestId(messageProperties, requestId) +blpapi_MessageProperties_setRequestId = _internals.blpapi_MessageProperties_setRequestId + def blpapi_Topic_create(arg1): return _internals.blpapi_Topic_create(arg1) blpapi_Topic_create = _internals.blpapi_Topic_create diff --git a/blpapi/internals_wrap.c b/blpapi/internals_wrap.c index a569067..d294ed4 100644 --- a/blpapi/internals_wrap.c +++ b/blpapi/internals_wrap.c @@ -3044,22 +3044,24 @@ SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { #define SWIGTYPE_p_p_blpapi_Event swig_types[54] #define SWIGTYPE_p_p_blpapi_Identity swig_types[55] #define SWIGTYPE_p_p_blpapi_Message swig_types[56] -#define SWIGTYPE_p_p_blpapi_Name swig_types[57] -#define SWIGTYPE_p_p_blpapi_Operation swig_types[58] -#define SWIGTYPE_p_p_blpapi_Request swig_types[59] -#define SWIGTYPE_p_p_blpapi_RequestTemplate swig_types[60] -#define SWIGTYPE_p_p_blpapi_SchemaElementDefinition swig_types[61] -#define SWIGTYPE_p_p_blpapi_Service swig_types[62] -#define SWIGTYPE_p_p_blpapi_Topic swig_types[63] -#define SWIGTYPE_p_p_char swig_types[64] -#define SWIGTYPE_p_p_void swig_types[65] -#define SWIGTYPE_p_short swig_types[66] -#define SWIGTYPE_p_unsigned_char swig_types[67] -#define SWIGTYPE_p_unsigned_int swig_types[68] -#define SWIGTYPE_p_unsigned_long_long swig_types[69] -#define SWIGTYPE_p_unsigned_short swig_types[70] -static swig_type_info *swig_types[72]; -static swig_module_info swig_module = {swig_types, 71, 0, 0, 0, 0}; +#define SWIGTYPE_p_p_blpapi_MessageFormatter swig_types[57] +#define SWIGTYPE_p_p_blpapi_MessageProperties swig_types[58] +#define SWIGTYPE_p_p_blpapi_Name swig_types[59] +#define SWIGTYPE_p_p_blpapi_Operation swig_types[60] +#define SWIGTYPE_p_p_blpapi_Request swig_types[61] +#define SWIGTYPE_p_p_blpapi_RequestTemplate swig_types[62] +#define SWIGTYPE_p_p_blpapi_SchemaElementDefinition swig_types[63] +#define SWIGTYPE_p_p_blpapi_Service swig_types[64] +#define SWIGTYPE_p_p_blpapi_Topic swig_types[65] +#define SWIGTYPE_p_p_char swig_types[66] +#define SWIGTYPE_p_p_void swig_types[67] +#define SWIGTYPE_p_short swig_types[68] +#define SWIGTYPE_p_unsigned_char swig_types[69] +#define SWIGTYPE_p_unsigned_int swig_types[70] +#define SWIGTYPE_p_unsigned_long_long swig_types[71] +#define SWIGTYPE_p_unsigned_short swig_types[72] +static swig_type_info *swig_types[74]; +static swig_module_info swig_module = {swig_types, 73, 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) @@ -3173,6 +3175,7 @@ SWIGINTERNINLINE PyObject* #include "blpapi_identity.h" #include "blpapi_logging.h" #include "blpapi_message.h" +#include "blpapi_messageformatter.h" #include "blpapi_name.h" #include "blpapi_request.h" #include "blpapi_schema.h" @@ -3182,6 +3185,7 @@ SWIGINTERNINLINE PyObject* #include "blpapi_streamproxy.h" #include "blpapi_subscriptionlist.h" #include "blpapi_timepoint.h" +#include "blpapi_testutil.h" // publishing support #include "blpapi_eventformatter.h" @@ -3196,8 +3200,6 @@ SWIGINTERNINLINE PyObject* #define MAX_GROUP_ID_SIZE 64 #endif -#include // for tm and mktime - #include // for malloc() and free() #include // for strncpy() @@ -3280,6 +3282,24 @@ void blpapi_SchemaTypeDefinition_printHelper( *output_size = stream.size; } +void blpapi_Message_printHelper( + blpapi_Message_t *message, + int level, + int spacesPerLevel, + char **output_allocated, + int *output_size) +{ + StreamWriterData stream = {0}; + blpapi_Message_print( + message, + cstr_StreamWriter, + &stream, + level, + spacesPerLevel); + *output_allocated = stream.stream; + *output_size = stream.size; +} + void blpapi_SessionOptions_printHelper( blpapi_SessionOptions_t *sessionOptions, int level, @@ -3298,6 +3318,20 @@ void blpapi_SessionOptions_printHelper( *output_size = stream.size; } +void blpapi_TestUtil_serializeServiceHelper( + blpapi_Service_t *service, + char **output_allocated, + int *output_size) +{ + StreamWriterData stream = {0}; + blpapi_TestUtil_serializeService( + cstr_StreamWriter, + &stream, + service); + *output_allocated = stream.stream; + *output_size = stream.size; +} + int blpapi_SchemaTypeDefinition_hasElementDefinition( const blpapi_SchemaTypeDefinition_t *type, const char *nameString, @@ -3390,37 +3424,28 @@ PyObject *blpapi_DiagnosticsUtil_memoryInfo_wrapper() // Shared global object guarded by GIL PyObject* loggerCallback = 0; -static time_t blpapi_Datetime_to_unix(blpapi_Datetime_t const *original) { - time_t rawtime = time(NULL); - time_t result; - struct tm *ts = localtime(&rawtime); - - if (original->parts & BLPAPI_DATETIME_DATE_PART) { - ts->tm_year = original->year - 1900; // tm_year should contain number of years since 1900 - ts->tm_mon = original->month - 1; // tm_mon is zero based - ts->tm_mday = original->day; - if (original->parts & BLPAPI_DATETIME_TIME_PART) { - ts->tm_hour = original->hours; - ts->tm_min = original->minutes; - ts->tm_sec = original->seconds; - } - } - result = mktime(ts); - return result; -} - void loggerCallbackWrapper(blpapi_UInt64_t threadId, int severity, blpapi_Datetime_t original, const char *category, const char *message) { - time_t ts = blpapi_Datetime_to_unix(&original); - PyGILState_STATE gilstate = PyGILState_Ensure(); - PyObject* result = PyObject_CallFunction(loggerCallback, "KiIss", - threadId, severity, ts, - category, message); + blpapi_Datetime_t *outputPtr; + PyObject *datetime_obj; + PyObject* result; + + // This snippet was inspired by the code generated for SWIG to handle + // `_wrap_blpapi_Element_getValueAsDatetime`. + outputPtr = (blpapi_Datetime_t *) malloc(sizeof(blpapi_Datetime_t)); + *outputPtr = original; + datetime_obj = SWIG_NewPointerObj(outputPtr, SWIGTYPE_p_blpapi_Datetime_tag, SWIG_POINTER_OWN); + + // "KiOss" below follow the format for `Py_BuildValue` strings. + // https://docs.python.org/3/c-api/arg.html#c.Py_BuildValue + result = PyObject_CallFunction(loggerCallback, "KiOss", threadId, severity, + datetime_obj, category, message); + PyGILState_Release(gilstate); Py_XDECREF(result); } @@ -3430,13 +3455,21 @@ int setLoggerCallbackWrapper(PyObject *cb, int severity) int err; if (!PyCallable_Check(cb)) { - return -1; + if(cb != Py_None) { + return -1; + } } - Py_XINCREF(cb); - Py_XDECREF(loggerCallback); + loggerCallback = cb; // Set actual callback - err = blpapi_Logging_registerCallback(&loggerCallbackWrapper, (blpapi_Logging_Severity_t)severity); + if (cb != Py_None) { + err = blpapi_Logging_registerCallback( + &loggerCallbackWrapper, (blpapi_Logging_Severity_t)severity); + } + else { + err = blpapi_Logging_registerCallback( + 0, (blpapi_Logging_Severity_t)severity); + } if (err != 0) { return -2; } @@ -4273,6 +4306,13 @@ SWIG_FromCharPtr(const char *cptr) } +SWIGINTERNINLINE PyObject * +SWIG_From_char (char c) +{ + return SWIG_FromCharPtrAndSize(&c,1); +} + + #define SWIG_From_double PyFloat_FromDouble @@ -4503,6 +4543,50 @@ int ProviderSession_terminateSubscriptionsOnTopic(blpapi_ProviderSession_t *sess + +#include "blpapi_messageformatter.h" + +int blpapi_MessageFormatter_setValueFloat( + blpapi_MessageFormatter_t* formatter, + const blpapi_Name_t* typeName, + blpapi_Float64_t value) +{ + // The C interface will not silently discard precision to store a 64-bit + // float in a field whose schema type is 32-bit, however all Python floats + // are 64-bit, so we explicitly allow narrowing to 32 bits if necessary. + + int ret = blpapi_MessageFormatter_setValueFloat64(formatter, + typeName, + value); + if (ret) { + ret = blpapi_MessageFormatter_setValueFloat32(formatter, + typeName, + value); + } + + return ret; +} + +int blpapi_MessageFormatter_appendValueFloat( + blpapi_MessageFormatter_t* formatter, + blpapi_Float64_t value) +{ + // The C interface will not silently discard precision to store a 64-bit + // float in a field whose schema type is 32-bit, however all Python floats + // are 64-bit, so we explicitly allow narrowing to 32 bits if necessary. + + int ret = blpapi_MessageFormatter_appendValueFloat64(formatter, + value); + if (ret) { + ret = blpapi_MessageFormatter_appendValueFloat32(formatter, + value); + } + + return ret; +} + + + /* Getting isfinite working pre C99 across multiple platforms is non-trivial. Users can provide SWIG_isfinite on older platforms. */ #ifndef SWIG_isfinite /* isfinite() is a macro for C99 */ @@ -4947,6 +5031,58 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_printHelper(PyObject *SWI } +SWIGINTERN PyObject *_wrap_blpapi_Message_printHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; + int arg2 ; + int arg3 ; + char **arg4 = (char **) 0 ; + int *arg5 = (int *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + char *temp4 = 0 ; + int tempn4 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + arg4 = &temp4; arg5 = &tempn4; + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Message_printHelper",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_printHelper" "', argument " "1"" of type '" "blpapi_Message_t *""'"); + } + arg1 = (blpapi_Message_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Message_printHelper" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Message_printHelper" "', argument " "3"" of type '" "int""'"); + } + arg3 = (int)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_Message_printHelper(arg1,arg2,arg3,arg4,arg5); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + if (*arg4) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtrAndSize(*arg4,*arg5)); + free(*arg4); + } + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_printHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; @@ -4999,6 +5135,40 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_printHelper(PyObject *SWIGUNUSE } +SWIGINTERN PyObject *_wrap_blpapi_TestUtil_serializeServiceHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; + char **arg2 = (char **) 0 ; + int *arg3 = (int *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + char *temp2 = 0 ; + int tempn2 ; + PyObject * obj0 = 0 ; + + arg2 = &temp2; arg3 = &tempn2; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_TestUtil_serializeServiceHelper",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TestUtil_serializeServiceHelper" "', argument " "1"" of type '" "blpapi_Service_t *""'"); + } + arg1 = (blpapi_Service_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_TestUtil_serializeServiceHelper(arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + if (*arg2) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtrAndSize(*arg2,*arg3)); + free(*arg2); + } + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_hasElementDefinition(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; @@ -6660,28 +6830,22 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsChar(PyObject *SWIGUNUSEDPAR size_t arg3 ; void *argp1 = 0 ; int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; + blpapi_Char_t temp2 ; + int res2 = SWIG_TMPOBJ ; size_t val3 ; int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Element_getValueAsChar",&obj0,&obj1,&obj2)) SWIG_fail; + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Element_getValueAsChar",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsChar" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); } arg1 = (blpapi_Element_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_getValueAsChar" "', argument " "2"" of type '" "blpapi_Char_t *""'"); - } - arg2 = (blpapi_Char_t *)(buf2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); + ecode3 = SWIG_AsVal_size_t(obj1, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getValueAsChar" "', argument " "3"" of type '" "size_t""'"); } @@ -6692,10 +6856,14 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsChar(PyObject *SWIGUNUSEDPAR SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + if (SWIG_IsTmpObj(res2)) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_char((*arg2))); + } else { + int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_char, new_flags)); + } return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -6707,27 +6875,21 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsInt32(PyObject *SWIGUNUSEDPA size_t arg3 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; + int temp2 ; size_t val3 ; int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Element_getValueAsInt32",&obj0,&obj1,&obj2)) SWIG_fail; + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Element_getValueAsInt32",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsInt32" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); } arg1 = (blpapi_Element_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_getValueAsInt32" "', argument " "2"" of type '" "blpapi_Int32_t *""'"); - } - arg2 = (blpapi_Int32_t *)(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); + ecode3 = SWIG_AsVal_size_t(obj1, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getValueAsInt32" "', argument " "3"" of type '" "size_t""'"); } @@ -6738,6 +6900,7 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsInt32(PyObject *SWIGUNUSEDPA SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, PyInt_FromLong(*arg2)); return resultobj; fail: return NULL; @@ -9369,212 +9532,296 @@ SWIGINTERN PyObject *_wrap_ProviderSession_terminateSubscriptionsOnTopic(PyObjec } -SWIGINTERN PyObject *_wrap_blpapi_AuthOptions_create_default(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_setValueFloat(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_AuthOptions_t **arg1 = (blpapi_AuthOptions_t **) 0 ; - blpapi_AuthOptions_t *temp1 = 0 ; + blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; + blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; + blpapi_Float64_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + double val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; int result; - arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)":blpapi_AuthOptions_create_default")) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_MessageFormatter_setValueFloat",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_setValueFloat" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); + } + arg1 = (blpapi_MessageFormatter_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_setValueFloat" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); + } + arg2 = (blpapi_Name_t *)(argp2); + ecode3 = SWIG_AsVal_double(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_MessageFormatter_setValueFloat" "', argument " "3"" of type '" "blpapi_Float64_t""'"); + } + arg3 = (blpapi_Float64_t)(val3); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AuthOptions_create_default(arg1); + result = (int)blpapi_MessageFormatter_setValueFloat(arg1,(struct blpapi_Name const *)arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthOptions, 0)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_AuthOptions_create_forUserMode(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_appendValueFloat(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_AuthOptions_t **arg1 = (blpapi_AuthOptions_t **) 0 ; - blpapi_AuthUser_t *arg2 = (blpapi_AuthUser_t *) 0 ; - blpapi_AuthOptions_t *temp1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; + blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; + blpapi_Float64_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + double val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; int result; - arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthOptions_create_forUserMode",&obj0)) SWIG_fail; - res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_AuthUser, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthOptions_create_forUserMode" "', argument " "2"" of type '" "blpapi_AuthUser_t const *""'"); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_MessageFormatter_appendValueFloat",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_appendValueFloat" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } - arg2 = (blpapi_AuthUser_t *)(argp2); + arg1 = (blpapi_MessageFormatter_t *)(argp1); + ecode2 = SWIG_AsVal_double(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_MessageFormatter_appendValueFloat" "', argument " "2"" of type '" "blpapi_Float64_t""'"); + } + arg2 = (blpapi_Float64_t)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AuthOptions_create_forUserMode(arg1,(struct blpapi_AuthUser const *)arg2); + result = (int)blpapi_MessageFormatter_appendValueFloat(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthOptions, 0)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_AuthOptions_create_forAppMode(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_setValueBool(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_AuthOptions_t **arg1 = (blpapi_AuthOptions_t **) 0 ; - blpapi_AuthApplication_t *arg2 = (blpapi_AuthApplication_t *) 0 ; - blpapi_AuthOptions_t *temp1 = 0 ; + blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; + blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; + blpapi_Bool_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; + int val3 ; + int ecode3 = 0 ; PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; int result; - arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthOptions_create_forAppMode",&obj0)) SWIG_fail; - res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_AuthApplication, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_MessageFormatter_setValueBool",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_setValueBool" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); + } + arg1 = (blpapi_MessageFormatter_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthOptions_create_forAppMode" "', argument " "2"" of type '" "blpapi_AuthApplication_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_setValueBool" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); } - arg2 = (blpapi_AuthApplication_t *)(argp2); + arg2 = (blpapi_Name_t *)(argp2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_MessageFormatter_setValueBool" "', argument " "3"" of type '" "blpapi_Bool_t""'"); + } + arg3 = (blpapi_Bool_t)(val3); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AuthOptions_create_forAppMode(arg1,(struct blpapi_AuthApplication const *)arg2); + result = (int)blpapi_MessageFormatter_setValueBool(arg1,(struct blpapi_Name const *)arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthOptions, 0)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_AuthOptions_create_forUserAndAppMode(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_setValueChar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_AuthOptions_t **arg1 = (blpapi_AuthOptions_t **) 0 ; - blpapi_AuthUser_t *arg2 = (blpapi_AuthUser_t *) 0 ; - blpapi_AuthApplication_t *arg3 = (blpapi_AuthApplication_t *) 0 ; - blpapi_AuthOptions_t *temp1 = 0 ; + blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; + blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; + char arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; + char val3 ; + int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; int result; - arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_AuthOptions_create_forUserAndAppMode",&obj0,&obj1)) SWIG_fail; - res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_AuthUser, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthOptions_create_forUserAndAppMode" "', argument " "2"" of type '" "blpapi_AuthUser_t const *""'"); + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_MessageFormatter_setValueChar",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_setValueChar" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } - arg2 = (blpapi_AuthUser_t *)(argp2); - res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_AuthApplication, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AuthOptions_create_forUserAndAppMode" "', argument " "3"" of type '" "blpapi_AuthApplication_t const *""'"); + arg1 = (blpapi_MessageFormatter_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_setValueChar" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); } - arg3 = (blpapi_AuthApplication_t *)(argp3); + arg2 = (blpapi_Name_t *)(argp2); + ecode3 = SWIG_AsVal_char(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_MessageFormatter_setValueChar" "', argument " "3"" of type '" "char""'"); + } + arg3 = (char)(val3); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AuthOptions_create_forUserAndAppMode(arg1,(struct blpapi_AuthUser const *)arg2,(struct blpapi_AuthApplication const *)arg3); + result = (int)blpapi_MessageFormatter_setValueChar(arg1,(struct blpapi_Name const *)arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthOptions, 0)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_AuthOptions_create_forToken(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_setValueInt32(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_AuthOptions_t **arg1 = (blpapi_AuthOptions_t **) 0 ; - blpapi_AuthToken_t *arg2 = (blpapi_AuthToken_t *) 0 ; - blpapi_AuthOptions_t *temp1 = 0 ; + blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; + blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; + blpapi_Int32_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; + int val3 ; + int ecode3 = 0 ; PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; int result; - arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthOptions_create_forToken",&obj0)) SWIG_fail; - res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_AuthToken, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_MessageFormatter_setValueInt32",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_setValueInt32" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); + } + arg1 = (blpapi_MessageFormatter_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthOptions_create_forToken" "', argument " "2"" of type '" "blpapi_AuthToken_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_setValueInt32" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); } - arg2 = (blpapi_AuthToken_t *)(argp2); + arg2 = (blpapi_Name_t *)(argp2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_MessageFormatter_setValueInt32" "', argument " "3"" of type '" "blpapi_Int32_t""'"); + } + arg3 = (blpapi_Int32_t)(val3); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AuthOptions_create_forToken(arg1,(struct blpapi_AuthToken const *)arg2); + result = (int)blpapi_MessageFormatter_setValueInt32(arg1,(struct blpapi_Name const *)arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthOptions, 0)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_AuthOptions_duplicate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_setValueInt64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_AuthOptions_t **arg1 = (blpapi_AuthOptions_t **) 0 ; - blpapi_AuthOptions_t *arg2 = (blpapi_AuthOptions_t *) 0 ; - blpapi_AuthOptions_t *temp1 = 0 ; + blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; + blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; + blpapi_Int64_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; + long long val3 ; + int ecode3 = 0 ; PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; int result; - arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthOptions_duplicate",&obj0)) SWIG_fail; - res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_AuthOptions, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_MessageFormatter_setValueInt64",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_setValueInt64" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); + } + arg1 = (blpapi_MessageFormatter_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthOptions_duplicate" "', argument " "2"" of type '" "blpapi_AuthOptions_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_setValueInt64" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); } - arg2 = (blpapi_AuthOptions_t *)(argp2); + arg2 = (blpapi_Name_t *)(argp2); + ecode3 = SWIG_AsVal_long_SS_long(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_MessageFormatter_setValueInt64" "', argument " "3"" of type '" "blpapi_Int64_t""'"); + } + arg3 = (blpapi_Int64_t)(val3); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AuthOptions_duplicate(arg1,(struct blpapi_AuthOptions const *)arg2); + result = (int)blpapi_MessageFormatter_setValueInt64(arg1,(struct blpapi_Name const *)arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthOptions, 0)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_AuthOptions_copy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_setValueFloat32(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_AuthOptions_t *arg1 = (blpapi_AuthOptions_t *) 0 ; - blpapi_AuthOptions_t *arg2 = (blpapi_AuthOptions_t *) 0 ; + blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; + blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; + blpapi_Float32_t arg3 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; + float val3 ; + int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_AuthOptions_copy",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AuthOptions, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_MessageFormatter_setValueFloat32",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AuthOptions_copy" "', argument " "1"" of type '" "blpapi_AuthOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_setValueFloat32" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } - arg1 = (blpapi_AuthOptions_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_AuthOptions, 0 | 0 ); + arg1 = (blpapi_MessageFormatter_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthOptions_copy" "', argument " "2"" of type '" "blpapi_AuthOptions_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_setValueFloat32" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); } - arg2 = (blpapi_AuthOptions_t *)(argp2); + arg2 = (blpapi_Name_t *)(argp2); + ecode3 = SWIG_AsVal_float(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_MessageFormatter_setValueFloat32" "', argument " "3"" of type '" "blpapi_Float32_t""'"); + } + arg3 = (blpapi_Float32_t)(val3); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AuthOptions_copy(arg1,(struct blpapi_AuthOptions const *)arg2); + result = (int)blpapi_MessageFormatter_setValueFloat32(arg1,(struct blpapi_Name const *)arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); @@ -9584,164 +9831,233 @@ SWIGINTERN PyObject *_wrap_blpapi_AuthOptions_copy(PyObject *SWIGUNUSEDPARM(self } -SWIGINTERN PyObject *_wrap_blpapi_AuthOptions_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_setValueFloat64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_AuthOptions_t *arg1 = (blpapi_AuthOptions_t *) 0 ; + blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; + blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; + blpapi_Float64_t arg3 ; void *argp1 = 0 ; int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + double val3 ; + int ecode3 = 0 ; PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthOptions_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AuthOptions, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_MessageFormatter_setValueFloat64",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AuthOptions_destroy" "', argument " "1"" of type '" "blpapi_AuthOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_setValueFloat64" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } - arg1 = (blpapi_AuthOptions_t *)(argp1); + arg1 = (blpapi_MessageFormatter_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_setValueFloat64" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); + } + arg2 = (blpapi_Name_t *)(argp2); + ecode3 = SWIG_AsVal_double(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_MessageFormatter_setValueFloat64" "', argument " "3"" of type '" "blpapi_Float64_t""'"); + } + arg3 = (blpapi_Float64_t)(val3); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_AuthOptions_destroy(arg1); + result = (int)blpapi_MessageFormatter_setValueFloat64(arg1,(struct blpapi_Name const *)arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_Py_Void(); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_AuthUser_createWithLogonName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_setValueDatetime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_AuthUser_t **arg1 = (blpapi_AuthUser_t **) 0 ; - blpapi_AuthUser_t *temp1 = 0 ; + blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; + blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; + blpapi_Datetime_t *arg3 = (blpapi_Datetime_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; int result; - arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)":blpapi_AuthUser_createWithLogonName")) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_MessageFormatter_setValueDatetime",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_setValueDatetime" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); + } + arg1 = (blpapi_MessageFormatter_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_setValueDatetime" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); + } + arg2 = (blpapi_Name_t *)(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_MessageFormatter_setValueDatetime" "', argument " "3"" of type '" "blpapi_Datetime_t const *""'"); + } + arg3 = (blpapi_Datetime_t *)(argp3); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AuthUser_createWithLogonName(arg1); + result = (int)blpapi_MessageFormatter_setValueDatetime(arg1,(struct blpapi_Name const *)arg2,(struct blpapi_Datetime_tag const *)arg3); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthUser, 0)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_AuthUser_createWithActiveDirectoryProperty(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_setValueHighPrecisionDatetime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_AuthUser_t **arg1 = (blpapi_AuthUser_t **) 0 ; - char *arg2 = (char *) 0 ; - blpapi_AuthUser_t *temp1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; + blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; + blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; + blpapi_HighPrecisionDatetime_t *arg3 = (blpapi_HighPrecisionDatetime_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; int result; - arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthUser_createWithActiveDirectoryProperty",&obj0)) SWIG_fail; - res2 = SWIG_AsCharPtrAndSize(obj0, &buf2, NULL, &alloc2); + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_MessageFormatter_setValueHighPrecisionDatetime",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_setValueHighPrecisionDatetime" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); + } + arg1 = (blpapi_MessageFormatter_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthUser_createWithActiveDirectoryProperty" "', argument " "2"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_setValueHighPrecisionDatetime" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); } - arg2 = (char *)(buf2); + arg2 = (blpapi_Name_t *)(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_MessageFormatter_setValueHighPrecisionDatetime" "', argument " "3"" of type '" "blpapi_HighPrecisionDatetime_t const *""'"); + } + arg3 = (blpapi_HighPrecisionDatetime_t *)(argp3); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AuthUser_createWithActiveDirectoryProperty(arg1,(char const *)arg2); + result = (int)blpapi_MessageFormatter_setValueHighPrecisionDatetime(arg1,(struct blpapi_Name const *)arg2,(struct blpapi_HighPrecisionDatetime_tag const *)arg3); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthUser, 0)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_AuthUser_createWithManualOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_setValueString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_AuthUser_t **arg1 = (blpapi_AuthUser_t **) 0 ; - char *arg2 = (char *) 0 ; + blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; + blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; char *arg3 = (char *) 0 ; - blpapi_AuthUser_t *temp1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; int res3 ; char *buf3 = 0 ; int alloc3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; int result; - arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_AuthUser_createWithManualOptions",&obj0,&obj1)) SWIG_fail; - res2 = SWIG_AsCharPtrAndSize(obj0, &buf2, NULL, &alloc2); + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_MessageFormatter_setValueString",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_setValueString" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); + } + arg1 = (blpapi_MessageFormatter_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthUser_createWithManualOptions" "', argument " "2"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_setValueString" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); } - arg2 = (char *)(buf2); - res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); + arg2 = (blpapi_Name_t *)(argp2); + res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AuthUser_createWithManualOptions" "', argument " "3"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_MessageFormatter_setValueString" "', argument " "3"" of type '" "char const *""'"); } arg3 = (char *)(buf3); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AuthUser_createWithManualOptions(arg1,(char const *)arg2,(char const *)arg3); + result = (int)blpapi_MessageFormatter_setValueString(arg1,(struct blpapi_Name const *)arg2,(char const *)arg3); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthUser, 0)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_AuthUser_duplicate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_setValueFromName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_AuthUser_t **arg1 = (blpapi_AuthUser_t **) 0 ; - blpapi_AuthUser_t *arg2 = (blpapi_AuthUser_t *) 0 ; - blpapi_AuthUser_t *temp1 = 0 ; + blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; + blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; + blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; int result; - arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthUser_duplicate",&obj0)) SWIG_fail; - res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_AuthUser, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_MessageFormatter_setValueFromName",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_setValueFromName" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); + } + arg1 = (blpapi_MessageFormatter_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthUser_duplicate" "', argument " "2"" of type '" "blpapi_AuthUser_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_setValueFromName" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); } - arg2 = (blpapi_AuthUser_t *)(argp2); + arg2 = (blpapi_Name_t *)(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_MessageFormatter_setValueFromName" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); + } + arg3 = (blpapi_Name_t *)(argp3); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AuthUser_duplicate(arg1,(struct blpapi_AuthUser const *)arg2); + result = (int)blpapi_MessageFormatter_setValueFromName(arg1,(struct blpapi_Name const *)arg2,(struct blpapi_Name const *)arg3); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthUser, 0)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_AuthUser_copy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_setValueNull(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_AuthUser_t *arg1 = (blpapi_AuthUser_t *) 0 ; - blpapi_AuthUser_t *arg2 = (blpapi_AuthUser_t *) 0 ; + blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; + blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; @@ -9750,20 +10066,20 @@ SWIGINTERN PyObject *_wrap_blpapi_AuthUser_copy(PyObject *SWIGUNUSEDPARM(self), PyObject * obj1 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_AuthUser_copy",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AuthUser, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_MessageFormatter_setValueNull",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AuthUser_copy" "', argument " "1"" of type '" "blpapi_AuthUser_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_setValueNull" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } - arg1 = (blpapi_AuthUser_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_AuthUser, 0 | 0 ); + arg1 = (blpapi_MessageFormatter_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthUser_copy" "', argument " "2"" of type '" "blpapi_AuthUser_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_setValueNull" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); } - arg2 = (blpapi_AuthUser_t *)(argp2); + arg2 = (blpapi_Name_t *)(argp2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AuthUser_copy(arg1,(struct blpapi_AuthUser const *)arg2); + result = (int)blpapi_MessageFormatter_setValueNull(arg1,(struct blpapi_Name const *)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); @@ -9773,120 +10089,163 @@ SWIGINTERN PyObject *_wrap_blpapi_AuthUser_copy(PyObject *SWIGUNUSEDPARM(self), } -SWIGINTERN PyObject *_wrap_blpapi_AuthUser_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_pushElement(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_AuthUser_t *arg1 = (blpapi_AuthUser_t *) 0 ; + blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; + blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthUser_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AuthUser, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_MessageFormatter_pushElement",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AuthUser_destroy" "', argument " "1"" of type '" "blpapi_AuthUser_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_pushElement" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } - arg1 = (blpapi_AuthUser_t *)(argp1); + arg1 = (blpapi_MessageFormatter_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_pushElement" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); + } + arg2 = (blpapi_Name_t *)(argp2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_AuthUser_destroy(arg1); + result = (int)blpapi_MessageFormatter_pushElement(arg1,(struct blpapi_Name const *)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_Py_Void(); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_AuthApplication_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_popElement(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_AuthApplication_t **arg1 = (blpapi_AuthApplication_t **) 0 ; - char *arg2 = (char *) 0 ; - blpapi_AuthApplication_t *temp1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; + blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; PyObject * obj0 = 0 ; int result; - arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthApplication_create",&obj0)) SWIG_fail; - res2 = SWIG_AsCharPtrAndSize(obj0, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthApplication_create" "', argument " "2"" of type '" "char const *""'"); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_MessageFormatter_popElement",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_popElement" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } - arg2 = (char *)(buf2); + arg1 = (blpapi_MessageFormatter_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AuthApplication_create(arg1,(char const *)arg2); + result = (int)blpapi_MessageFormatter_popElement(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthApplication, 0)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_AuthApplication_duplicate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_appendValueBool(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_AuthApplication_t **arg1 = (blpapi_AuthApplication_t **) 0 ; - blpapi_AuthApplication_t *arg2 = (blpapi_AuthApplication_t *) 0 ; - blpapi_AuthApplication_t *temp1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; + blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; + blpapi_Bool_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; int result; - arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthApplication_duplicate",&obj0)) SWIG_fail; - res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_AuthApplication, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthApplication_duplicate" "', argument " "2"" of type '" "blpapi_AuthApplication_t const *""'"); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_MessageFormatter_appendValueBool",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_appendValueBool" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } - arg2 = (blpapi_AuthApplication_t *)(argp2); + arg1 = (blpapi_MessageFormatter_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_MessageFormatter_appendValueBool" "', argument " "2"" of type '" "blpapi_Bool_t""'"); + } + arg2 = (blpapi_Bool_t)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AuthApplication_duplicate(arg1,(struct blpapi_AuthApplication const *)arg2); + result = (int)blpapi_MessageFormatter_appendValueBool(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthApplication, 0)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_AuthApplication_copy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_appendValueChar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_AuthApplication_t *arg1 = (blpapi_AuthApplication_t *) 0 ; - blpapi_AuthApplication_t *arg2 = (blpapi_AuthApplication_t *) 0 ; + blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; + char arg2 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; + char val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_AuthApplication_copy",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AuthApplication, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_MessageFormatter_appendValueChar",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AuthApplication_copy" "', argument " "1"" of type '" "blpapi_AuthApplication_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_appendValueChar" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } - arg1 = (blpapi_AuthApplication_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_AuthApplication, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthApplication_copy" "', argument " "2"" of type '" "blpapi_AuthApplication_t const *""'"); + arg1 = (blpapi_MessageFormatter_t *)(argp1); + ecode2 = SWIG_AsVal_char(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_MessageFormatter_appendValueChar" "', argument " "2"" of type '" "char""'"); + } + arg2 = (char)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_MessageFormatter_appendValueChar(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; } - arg2 = (blpapi_AuthApplication_t *)(argp2); + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_appendValueInt32(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; + blpapi_Int32_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_MessageFormatter_appendValueInt32",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_appendValueInt32" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); + } + arg1 = (blpapi_MessageFormatter_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_MessageFormatter_appendValueInt32" "', argument " "2"" of type '" "blpapi_Int32_t""'"); + } + arg2 = (blpapi_Int32_t)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AuthApplication_copy(arg1,(struct blpapi_AuthApplication const *)arg2); + result = (int)blpapi_MessageFormatter_appendValueInt32(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); @@ -9896,98 +10255,115 @@ SWIGINTERN PyObject *_wrap_blpapi_AuthApplication_copy(PyObject *SWIGUNUSEDPARM( } -SWIGINTERN PyObject *_wrap_blpapi_AuthApplication_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_appendValueInt64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_AuthApplication_t *arg1 = (blpapi_AuthApplication_t *) 0 ; + blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; + blpapi_Int64_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; + long long val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthApplication_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AuthApplication, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_MessageFormatter_appendValueInt64",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AuthApplication_destroy" "', argument " "1"" of type '" "blpapi_AuthApplication_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_appendValueInt64" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } - arg1 = (blpapi_AuthApplication_t *)(argp1); + arg1 = (blpapi_MessageFormatter_t *)(argp1); + ecode2 = SWIG_AsVal_long_SS_long(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_MessageFormatter_appendValueInt64" "', argument " "2"" of type '" "blpapi_Int64_t""'"); + } + arg2 = (blpapi_Int64_t)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_AuthApplication_destroy(arg1); + result = (int)blpapi_MessageFormatter_appendValueInt64(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_Py_Void(); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_AuthToken_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_appendValueFloat32(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_AuthToken_t **arg1 = (blpapi_AuthToken_t **) 0 ; - char *arg2 = (char *) 0 ; - blpapi_AuthToken_t *temp1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; + blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; + blpapi_Float32_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + float val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; int result; - arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthToken_create",&obj0)) SWIG_fail; - res2 = SWIG_AsCharPtrAndSize(obj0, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthToken_create" "', argument " "2"" of type '" "char const *""'"); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_MessageFormatter_appendValueFloat32",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_appendValueFloat32" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } - arg2 = (char *)(buf2); + arg1 = (blpapi_MessageFormatter_t *)(argp1); + ecode2 = SWIG_AsVal_float(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_MessageFormatter_appendValueFloat32" "', argument " "2"" of type '" "blpapi_Float32_t""'"); + } + arg2 = (blpapi_Float32_t)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AuthToken_create(arg1,(char const *)arg2); + result = (int)blpapi_MessageFormatter_appendValueFloat32(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthToken, 0)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_AuthToken_duplicate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_appendValueFloat64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_AuthToken_t **arg1 = (blpapi_AuthToken_t **) 0 ; - blpapi_AuthToken_t *arg2 = (blpapi_AuthToken_t *) 0 ; - blpapi_AuthToken_t *temp1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; + blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; + blpapi_Float64_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + double val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; int result; - arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthToken_duplicate",&obj0)) SWIG_fail; - res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_AuthToken, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthToken_duplicate" "', argument " "2"" of type '" "blpapi_AuthToken_t const *""'"); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_MessageFormatter_appendValueFloat64",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_appendValueFloat64" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } - arg2 = (blpapi_AuthToken_t *)(argp2); + arg1 = (blpapi_MessageFormatter_t *)(argp1); + ecode2 = SWIG_AsVal_double(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_MessageFormatter_appendValueFloat64" "', argument " "2"" of type '" "blpapi_Float64_t""'"); + } + arg2 = (blpapi_Float64_t)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AuthToken_duplicate(arg1,(struct blpapi_AuthToken const *)arg2); + result = (int)blpapi_MessageFormatter_appendValueFloat64(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthToken, 0)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_AuthToken_copy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_appendValueDatetime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_AuthToken_t *arg1 = (blpapi_AuthToken_t *) 0 ; - blpapi_AuthToken_t *arg2 = (blpapi_AuthToken_t *) 0 ; + blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; + blpapi_Datetime_t *arg2 = (blpapi_Datetime_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; @@ -9996,20 +10372,20 @@ SWIGINTERN PyObject *_wrap_blpapi_AuthToken_copy(PyObject *SWIGUNUSEDPARM(self), PyObject * obj1 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_AuthToken_copy",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AuthToken, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_MessageFormatter_appendValueDatetime",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AuthToken_copy" "', argument " "1"" of type '" "blpapi_AuthToken_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_appendValueDatetime" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } - arg1 = (blpapi_AuthToken_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_AuthToken, 0 | 0 ); + arg1 = (blpapi_MessageFormatter_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthToken_copy" "', argument " "2"" of type '" "blpapi_AuthToken_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_appendValueDatetime" "', argument " "2"" of type '" "blpapi_Datetime_t const *""'"); } - arg2 = (blpapi_AuthToken_t *)(argp2); + arg2 = (blpapi_Datetime_t *)(argp2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AuthToken_copy(arg1,(struct blpapi_AuthToken const *)arg2); + result = (int)blpapi_MessageFormatter_appendValueDatetime(arg1,(struct blpapi_Datetime_tag const *)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); @@ -10019,102 +10395,143 @@ SWIGINTERN PyObject *_wrap_blpapi_AuthToken_copy(PyObject *SWIGUNUSEDPARM(self), } -SWIGINTERN PyObject *_wrap_blpapi_AuthToken_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_appendValueHighPrecisionDatetime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_AuthToken_t *arg1 = (blpapi_AuthToken_t *) 0 ; + blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; + blpapi_HighPrecisionDatetime_t *arg2 = (blpapi_HighPrecisionDatetime_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthToken_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AuthToken, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_MessageFormatter_appendValueHighPrecisionDatetime",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AuthToken_destroy" "', argument " "1"" of type '" "blpapi_AuthToken_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_appendValueHighPrecisionDatetime" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } - arg1 = (blpapi_AuthToken_t *)(argp1); + arg1 = (blpapi_MessageFormatter_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_appendValueHighPrecisionDatetime" "', argument " "2"" of type '" "blpapi_HighPrecisionDatetime_t const *""'"); + } + arg2 = (blpapi_HighPrecisionDatetime_t *)(argp2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_AuthToken_destroy(arg1); + result = (int)blpapi_MessageFormatter_appendValueHighPrecisionDatetime(arg1,(struct blpapi_HighPrecisionDatetime_tag const *)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_Py_Void(); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_getLastErrorDescription(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_appendValueString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - int arg1 ; - int val1 ; - int ecode1 = 0 ; + blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; + char *arg2 = (char *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; PyObject * obj0 = 0 ; - char *result = 0 ; + PyObject * obj1 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_getLastErrorDescription",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "blpapi_getLastErrorDescription" "', argument " "1"" of type '" "int""'"); - } - arg1 = (int)(val1); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_MessageFormatter_appendValueString",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_appendValueString" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); + } + arg1 = (blpapi_MessageFormatter_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_appendValueString" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_getLastErrorDescription(arg1); + result = (int)blpapi_MessageFormatter_appendValueString(arg1,(char const *)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_FromCharPtr((const char *)result); + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_appendValueFromName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SessionOptions_t *result = 0 ; + blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; + blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)":blpapi_SessionOptions_create")) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_MessageFormatter_appendValueFromName",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_appendValueFromName" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); + } + arg1 = (blpapi_MessageFormatter_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_appendValueFromName" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); + } + arg2 = (blpapi_Name_t *)(argp2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_SessionOptions_t *)blpapi_SessionOptions_create(); + result = (int)blpapi_MessageFormatter_appendValueFromName(arg1,(struct blpapi_Name const *)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_appendElement(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_MessageFormatter_appendElement",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_destroy" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_appendElement" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } - arg1 = (blpapi_SessionOptions_t *)(argp1); + arg1 = (blpapi_MessageFormatter_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_SessionOptions_destroy(arg1); + result = (int)blpapi_MessageFormatter_appendElement(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_Py_Void(); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setServerHost(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_FormatMessageJson(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; char *arg2 = (char *) 0 ; void *argp1 = 0 ; int res1 = 0 ; @@ -10125,20 +10542,20 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setServerHost(PyObject *SWIGUNU PyObject * obj1 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setServerHost",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_MessageFormatter_FormatMessageJson",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setServerHost" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_FormatMessageJson" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } - arg1 = (blpapi_SessionOptions_t *)(argp1); + arg1 = (blpapi_MessageFormatter_t *)(argp1); res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setServerHost" "', argument " "2"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_FormatMessageJson" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setServerHost(arg1,(char const *)arg2); + result = (int)blpapi_MessageFormatter_FormatMessageJson(arg1,(char const *)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); @@ -10150,158 +10567,121 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setServerHost(PyObject *SWIGUNU } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setServerPort(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_FormatMessageXml(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - unsigned short arg2 ; + blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; + char *arg2 = (char *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - unsigned short val2 ; - int ecode2 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setServerPort",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_MessageFormatter_FormatMessageXml",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setServerPort" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_FormatMessageXml" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } - arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_short(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setServerPort" "', argument " "2"" of type '" "unsigned short""'"); - } - arg2 = (unsigned short)(val2); + arg1 = (blpapi_MessageFormatter_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_FormatMessageXml" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setServerPort(arg1,arg2); + result = (int)blpapi_MessageFormatter_FormatMessageXml(arg1,(char const *)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setServerAddress(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_copy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - char *arg2 = (char *) 0 ; - unsigned short arg3 ; - size_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - unsigned short val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; + blpapi_MessageFormatter_t **arg1 = (blpapi_MessageFormatter_t **) 0 ; + blpapi_MessageFormatter_t *arg2 = (blpapi_MessageFormatter_t *) 0 ; + blpapi_MessageFormatter_t *temp1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_SessionOptions_setServerAddress",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setServerAddress" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_MessageFormatter_copy",&obj0)) SWIG_fail; + res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setServerAddress" "', argument " "2"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_copy" "', argument " "2"" of type '" "blpapi_MessageFormatter_t const *""'"); } - arg2 = (char *)(buf2); - ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_SessionOptions_setServerAddress" "', argument " "3"" of type '" "unsigned short""'"); - } - arg3 = (unsigned short)(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_SessionOptions_setServerAddress" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = (size_t)(val4); + arg2 = (blpapi_MessageFormatter_t *)(argp2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setServerAddress(arg1,(char const *)arg2,arg3,arg4); + result = (int)blpapi_MessageFormatter_copy(arg1,(struct blpapi_MessageFormatter const *)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_MessageFormatter, 0)); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_removeServerAddress(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_assign(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; + blpapi_MessageFormatter_t **arg1 = (blpapi_MessageFormatter_t **) 0 ; + blpapi_MessageFormatter_t *arg2 = (blpapi_MessageFormatter_t *) 0 ; + blpapi_MessageFormatter_t *temp1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_removeServerAddress",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_removeServerAddress" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_MessageFormatter_assign",&obj0)) SWIG_fail; + res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_assign" "', argument " "2"" of type '" "blpapi_MessageFormatter_t const *""'"); } - arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_removeServerAddress" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = (size_t)(val2); + arg2 = (blpapi_MessageFormatter_t *)(argp2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_removeServerAddress(arg1,arg2); + result = (int)blpapi_MessageFormatter_assign(arg1,(struct blpapi_MessageFormatter const *)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_MessageFormatter, 0)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setConnectTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - unsigned int arg2 ; + blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - unsigned int val2 ; - int ecode2 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setConnectTimeout",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_MessageFormatter_destroy",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setConnectTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_destroy" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } - arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setConnectTimeout" "', argument " "2"" of type '" "unsigned int""'"); - } - arg2 = (unsigned int)(val2); + arg1 = (blpapi_MessageFormatter_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setConnectTimeout(arg1,arg2); + result = (int)blpapi_MessageFormatter_destroy(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); @@ -10311,328 +10691,292 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setConnectTimeout(PyObject *SWI } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setDefaultServices(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_AuthOptions_create_default(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + blpapi_AuthOptions_t **arg1 = (blpapi_AuthOptions_t **) 0 ; + blpapi_AuthOptions_t *temp1 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setDefaultServices",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setDefaultServices" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setDefaultServices" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)":blpapi_AuthOptions_create_default")) SWIG_fail; { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setDefaultServices(arg1,(char const *)arg2); + result = (int)blpapi_AuthOptions_create_default(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthOptions, 0)); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setDefaultSubscriptionService(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_AuthOptions_create_forUserMode(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; + blpapi_AuthOptions_t **arg1 = (blpapi_AuthOptions_t **) 0 ; + blpapi_AuthUser_t *arg2 = (blpapi_AuthUser_t *) 0 ; + blpapi_AuthOptions_t *temp1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setDefaultSubscriptionService",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setDefaultSubscriptionService" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthOptions_create_forUserMode",&obj0)) SWIG_fail; + res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_AuthUser, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setDefaultSubscriptionService" "', argument " "2"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthOptions_create_forUserMode" "', argument " "2"" of type '" "blpapi_AuthUser_t const *""'"); } - arg2 = (char *)(buf2); + arg2 = (blpapi_AuthUser_t *)(argp2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setDefaultSubscriptionService(arg1,(char const *)arg2); + result = (int)blpapi_AuthOptions_create_forUserMode(arg1,(struct blpapi_AuthUser const *)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthOptions, 0)); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setDefaultTopicPrefix(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_AuthOptions_create_forAppMode(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; + blpapi_AuthOptions_t **arg1 = (blpapi_AuthOptions_t **) 0 ; + blpapi_AuthApplication_t *arg2 = (blpapi_AuthApplication_t *) 0 ; + blpapi_AuthOptions_t *temp1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setDefaultTopicPrefix",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setDefaultTopicPrefix" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthOptions_create_forAppMode",&obj0)) SWIG_fail; + res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_AuthApplication, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setDefaultTopicPrefix" "', argument " "2"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthOptions_create_forAppMode" "', argument " "2"" of type '" "blpapi_AuthApplication_t const *""'"); } - arg2 = (char *)(buf2); + arg2 = (blpapi_AuthApplication_t *)(argp2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_SessionOptions_setDefaultTopicPrefix(arg1,(char const *)arg2); + result = (int)blpapi_AuthOptions_create_forAppMode(arg1,(struct blpapi_AuthApplication const *)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_Py_Void(); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthOptions, 0)); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_AuthOptions_create_forUserAndAppMode(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; + blpapi_AuthOptions_t **arg1 = (blpapi_AuthOptions_t **) 0 ; + blpapi_AuthUser_t *arg2 = (blpapi_AuthUser_t *) 0 ; + blpapi_AuthApplication_t *arg3 = (blpapi_AuthApplication_t *) 0 ; + blpapi_AuthOptions_t *temp1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_AuthOptions_create_forUserAndAppMode",&obj0,&obj1)) SWIG_fail; + res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_AuthUser, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthOptions_create_forUserAndAppMode" "', argument " "2"" of type '" "blpapi_AuthUser_t const *""'"); } - arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); + arg2 = (blpapi_AuthUser_t *)(argp2); + res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_AuthApplication, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AuthOptions_create_forUserAndAppMode" "', argument " "3"" of type '" "blpapi_AuthApplication_t const *""'"); + } + arg3 = (blpapi_AuthApplication_t *)(argp3); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg(arg1,arg2); + result = (int)blpapi_AuthOptions_create_forUserAndAppMode(arg1,(struct blpapi_AuthUser const *)arg2,(struct blpapi_AuthApplication const *)arg3); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_Py_Void(); + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthOptions, 0)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setClientMode(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_AuthOptions_create_forToken(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; + blpapi_AuthOptions_t **arg1 = (blpapi_AuthOptions_t **) 0 ; + blpapi_AuthToken_t *arg2 = (blpapi_AuthToken_t *) 0 ; + blpapi_AuthOptions_t *temp1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setClientMode",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setClientMode" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthOptions_create_forToken",&obj0)) SWIG_fail; + res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_AuthToken, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthOptions_create_forToken" "', argument " "2"" of type '" "blpapi_AuthToken_t const *""'"); } - arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setClientMode" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); + arg2 = (blpapi_AuthToken_t *)(argp2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_SessionOptions_setClientMode(arg1,arg2); + result = (int)blpapi_AuthOptions_create_forToken(arg1,(struct blpapi_AuthToken const *)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_Py_Void(); + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthOptions, 0)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setMaxPendingRequests(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_AuthOptions_duplicate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; + blpapi_AuthOptions_t **arg1 = (blpapi_AuthOptions_t **) 0 ; + blpapi_AuthOptions_t *arg2 = (blpapi_AuthOptions_t *) 0 ; + blpapi_AuthOptions_t *temp1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setMaxPendingRequests",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setMaxPendingRequests" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthOptions_duplicate",&obj0)) SWIG_fail; + res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_AuthOptions, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthOptions_duplicate" "', argument " "2"" of type '" "blpapi_AuthOptions_t const *""'"); } - arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setMaxPendingRequests" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); + arg2 = (blpapi_AuthOptions_t *)(argp2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_SessionOptions_setMaxPendingRequests(arg1,arg2); + result = (int)blpapi_AuthOptions_duplicate(arg1,(struct blpapi_AuthOptions const *)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_Py_Void(); + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthOptions, 0)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setAutoRestartOnDisconnection(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_AuthOptions_copy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - int arg2 ; + blpapi_AuthOptions_t *arg1 = (blpapi_AuthOptions_t *) 0 ; + blpapi_AuthOptions_t *arg2 = (blpapi_AuthOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setAutoRestartOnDisconnection",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_AuthOptions_copy",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AuthOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setAutoRestartOnDisconnection" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AuthOptions_copy" "', argument " "1"" of type '" "blpapi_AuthOptions_t *""'"); } - arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setAutoRestartOnDisconnection" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); + arg1 = (blpapi_AuthOptions_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_AuthOptions, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthOptions_copy" "', argument " "2"" of type '" "blpapi_AuthOptions_t const *""'"); + } + arg2 = (blpapi_AuthOptions_t *)(argp2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_SessionOptions_setAutoRestartOnDisconnection(arg1,arg2); + result = (int)blpapi_AuthOptions_copy(arg1,(struct blpapi_AuthOptions const *)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_Py_Void(); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setSessionIdentityOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_AuthOptions_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - blpapi_AuthOptions_t *arg2 = (blpapi_AuthOptions_t *) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; + blpapi_AuthOptions_t *arg1 = (blpapi_AuthOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_SessionOptions_setSessionIdentityOptions",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthOptions_destroy",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AuthOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setSessionIdentityOptions" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_AuthOptions, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setSessionIdentityOptions" "', argument " "2"" of type '" "blpapi_AuthOptions_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AuthOptions_destroy" "', argument " "1"" of type '" "blpapi_AuthOptions_t *""'"); } - arg2 = (blpapi_AuthOptions_t *)(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_SessionOptions_setSessionIdentityOptions" "', argument " "3"" of type '" "blpapi_CorrelationId_t *""'"); + arg1 = (blpapi_AuthOptions_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_AuthOptions_destroy(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; } - arg3 = (blpapi_CorrelationId_t *)(argp3); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_AuthUser_createWithLogonName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_AuthUser_t **arg1 = (blpapi_AuthUser_t **) 0 ; + blpapi_AuthUser_t *temp1 = 0 ; + int result; + + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)":blpapi_AuthUser_createWithLogonName")) SWIG_fail; { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setSessionIdentityOptions(arg1,(struct blpapi_AuthOptions const *)arg2,arg3); + result = (int)blpapi_AuthUser_createWithLogonName(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthUser, 0)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setAuthenticationOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_AuthUser_createWithActiveDirectoryProperty(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + blpapi_AuthUser_t **arg1 = (blpapi_AuthUser_t **) 0 ; char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; + blpapi_AuthUser_t *temp1 = 0 ; int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setAuthenticationOptions",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setAuthenticationOptions" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthUser_createWithActiveDirectoryProperty",&obj0)) SWIG_fail; + res2 = SWIG_AsCharPtrAndSize(obj0, &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setAuthenticationOptions" "', argument " "2"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthUser_createWithActiveDirectoryProperty" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_SessionOptions_setAuthenticationOptions(arg1,(char const *)arg2); + result = (int)blpapi_AuthUser_createWithActiveDirectoryProperty(arg1,(char const *)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_Py_Void(); + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthUser, 0)); if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: @@ -10641,100 +10985,107 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setAuthenticationOptions(PyObje } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setNumStartAttempts(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_AuthUser_createWithManualOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; + blpapi_AuthUser_t **arg1 = (blpapi_AuthUser_t **) 0 ; + char *arg2 = (char *) 0 ; + char *arg3 = (char *) 0 ; + blpapi_AuthUser_t *temp1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setNumStartAttempts",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setNumStartAttempts" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_AuthUser_createWithManualOptions",&obj0,&obj1)) SWIG_fail; + res2 = SWIG_AsCharPtrAndSize(obj0, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthUser_createWithManualOptions" "', argument " "2"" of type '" "char const *""'"); } - arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setNumStartAttempts" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); + arg2 = (char *)(buf2); + res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AuthUser_createWithManualOptions" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = (char *)(buf3); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_SessionOptions_setNumStartAttempts(arg1,arg2); + result = (int)blpapi_AuthUser_createWithManualOptions(arg1,(char const *)arg2,(char const *)arg3); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_Py_Void(); + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthUser, 0)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return resultobj; fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setMaxEventQueueSize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_AuthUser_duplicate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; + blpapi_AuthUser_t **arg1 = (blpapi_AuthUser_t **) 0 ; + blpapi_AuthUser_t *arg2 = (blpapi_AuthUser_t *) 0 ; + blpapi_AuthUser_t *temp1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setMaxEventQueueSize",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setMaxEventQueueSize" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthUser_duplicate",&obj0)) SWIG_fail; + res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_AuthUser, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthUser_duplicate" "', argument " "2"" of type '" "blpapi_AuthUser_t const *""'"); } - arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setMaxEventQueueSize" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = (size_t)(val2); + arg2 = (blpapi_AuthUser_t *)(argp2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_SessionOptions_setMaxEventQueueSize(arg1,arg2); + result = (int)blpapi_AuthUser_duplicate(arg1,(struct blpapi_AuthUser const *)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_Py_Void(); + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthUser, 0)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_AuthUser_copy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - float arg2 ; + blpapi_AuthUser_t *arg1 = (blpapi_AuthUser_t *) 0 ; + blpapi_AuthUser_t *arg2 = (blpapi_AuthUser_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - float val2 ; - int ecode2 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_AuthUser_copy",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AuthUser, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AuthUser_copy" "', argument " "1"" of type '" "blpapi_AuthUser_t *""'"); } - arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_float(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark" "', argument " "2"" of type '" "float""'"); - } - arg2 = (float)(val2); + arg1 = (blpapi_AuthUser_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_AuthUser, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthUser_copy" "', argument " "2"" of type '" "blpapi_AuthUser_t const *""'"); + } + arg2 = (blpapi_AuthUser_t *)(argp2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark(arg1,arg2); + result = (int)blpapi_AuthUser_copy(arg1,(struct blpapi_AuthUser const *)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); @@ -10744,137 +11095,120 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setSlowConsumerWarningHiWaterMa } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_AuthUser_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - float arg2 ; + blpapi_AuthUser_t *arg1 = (blpapi_AuthUser_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - float val2 ; - int ecode2 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthUser_destroy",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AuthUser, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AuthUser_destroy" "', argument " "1"" of type '" "blpapi_AuthUser_t *""'"); } - arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_float(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark" "', argument " "2"" of type '" "float""'"); - } - arg2 = (float)(val2); + arg1 = (blpapi_AuthUser_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark(arg1,arg2); + blpapi_AuthUser_destroy(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setDefaultKeepAliveInactivityTime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_AuthApplication_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; + blpapi_AuthApplication_t **arg1 = (blpapi_AuthApplication_t **) 0 ; + char *arg2 = (char *) 0 ; + blpapi_AuthApplication_t *temp1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setDefaultKeepAliveInactivityTime",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setDefaultKeepAliveInactivityTime" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthApplication_create",&obj0)) SWIG_fail; + res2 = SWIG_AsCharPtrAndSize(obj0, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthApplication_create" "', argument " "2"" of type '" "char const *""'"); } - arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setDefaultKeepAliveInactivityTime" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); + arg2 = (char *)(buf2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setDefaultKeepAliveInactivityTime(arg1,arg2); + result = (int)blpapi_AuthApplication_create(arg1,(char const *)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthApplication, 0)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_AuthApplication_duplicate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; + blpapi_AuthApplication_t **arg1 = (blpapi_AuthApplication_t **) 0 ; + blpapi_AuthApplication_t *arg2 = (blpapi_AuthApplication_t *) 0 ; + blpapi_AuthApplication_t *temp1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthApplication_duplicate",&obj0)) SWIG_fail; + res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_AuthApplication, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthApplication_duplicate" "', argument " "2"" of type '" "blpapi_AuthApplication_t const *""'"); } - arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); + arg2 = (blpapi_AuthApplication_t *)(argp2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout(arg1,arg2); + result = (int)blpapi_AuthApplication_duplicate(arg1,(struct blpapi_AuthApplication const *)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthApplication, 0)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setKeepAliveEnabled(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_AuthApplication_copy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - int arg2 ; + blpapi_AuthApplication_t *arg1 = (blpapi_AuthApplication_t *) 0 ; + blpapi_AuthApplication_t *arg2 = (blpapi_AuthApplication_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setKeepAliveEnabled",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_AuthApplication_copy",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AuthApplication, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setKeepAliveEnabled" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AuthApplication_copy" "', argument " "1"" of type '" "blpapi_AuthApplication_t *""'"); } - arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setKeepAliveEnabled" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); + arg1 = (blpapi_AuthApplication_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_AuthApplication, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthApplication_copy" "', argument " "2"" of type '" "blpapi_AuthApplication_t const *""'"); + } + arg2 = (blpapi_AuthApplication_t *)(argp2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setKeepAliveEnabled(arg1,arg2); + result = (int)blpapi_AuthApplication_copy(arg1,(struct blpapi_AuthApplication const *)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); @@ -10884,31 +11218,22 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setKeepAliveEnabled(PyObject *S } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_AuthApplication_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - int arg2 ; + blpapi_AuthApplication_t *arg1 = (blpapi_AuthApplication_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthApplication_destroy",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AuthApplication, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AuthApplication_destroy" "', argument " "1"" of type '" "blpapi_AuthApplication_t *""'"); } - arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); + arg1 = (blpapi_AuthApplication_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes(arg1,arg2); + blpapi_AuthApplication_destroy(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_Py_Void(); @@ -10918,249 +11243,261 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setRecordSubscriptionDataReceiv } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setServiceCheckTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_AuthToken_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; + blpapi_AuthToken_t **arg1 = (blpapi_AuthToken_t **) 0 ; + char *arg2 = (char *) 0 ; + blpapi_AuthToken_t *temp1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setServiceCheckTimeout",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setServiceCheckTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthToken_create",&obj0)) SWIG_fail; + res2 = SWIG_AsCharPtrAndSize(obj0, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthToken_create" "', argument " "2"" of type '" "char const *""'"); } - arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setServiceCheckTimeout" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); + arg2 = (char *)(buf2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setServiceCheckTimeout(arg1,arg2); + result = (int)blpapi_AuthToken_create(arg1,(char const *)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthToken, 0)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setServiceDownloadTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_AuthToken_duplicate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; + blpapi_AuthToken_t **arg1 = (blpapi_AuthToken_t **) 0 ; + blpapi_AuthToken_t *arg2 = (blpapi_AuthToken_t *) 0 ; + blpapi_AuthToken_t *temp1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setServiceDownloadTimeout",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setServiceDownloadTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthToken_duplicate",&obj0)) SWIG_fail; + res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_AuthToken, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthToken_duplicate" "', argument " "2"" of type '" "blpapi_AuthToken_t const *""'"); } - arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setServiceDownloadTimeout" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); + arg2 = (blpapi_AuthToken_t *)(argp2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setServiceDownloadTimeout(arg1,arg2); + result = (int)blpapi_AuthToken_duplicate(arg1,(struct blpapi_AuthToken const *)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthToken, 0)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setTlsOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_AuthToken_copy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - blpapi_TlsOptions_t *arg2 = (blpapi_TlsOptions_t *) 0 ; + blpapi_AuthToken_t *arg1 = (blpapi_AuthToken_t *) 0 ; + blpapi_AuthToken_t *arg2 = (blpapi_AuthToken_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setTlsOptions",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_AuthToken_copy",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AuthToken, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setTlsOptions" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AuthToken_copy" "', argument " "1"" of type '" "blpapi_AuthToken_t *""'"); } - arg1 = (blpapi_SessionOptions_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); + arg1 = (blpapi_AuthToken_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_AuthToken, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setTlsOptions" "', argument " "2"" of type '" "blpapi_TlsOptions_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthToken_copy" "', argument " "2"" of type '" "blpapi_AuthToken_t const *""'"); } - arg2 = (blpapi_TlsOptions_t *)(argp2); + arg2 = (blpapi_AuthToken_t *)(argp2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_SessionOptions_setTlsOptions(arg1,(struct blpapi_TlsOptions const *)arg2); + result = (int)blpapi_AuthToken_copy(arg1,(struct blpapi_AuthToken const *)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_Py_Void(); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setFlushPublishedEventsTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_AuthToken_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - int arg2 ; + blpapi_AuthToken_t *arg1 = (blpapi_AuthToken_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setFlushPublishedEventsTimeout",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthToken_destroy",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AuthToken, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setFlushPublishedEventsTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AuthToken_destroy" "', argument " "1"" of type '" "blpapi_AuthToken_t *""'"); } - arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setFlushPublishedEventsTimeout" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); + arg1 = (blpapi_AuthToken_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setFlushPublishedEventsTimeout(arg1,arg2); + blpapi_AuthToken_destroy(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setBandwidthSaveModeDisabled(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_getLastErrorDescription(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; + int arg1 ; + int val1 ; + int ecode1 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; + char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setBandwidthSaveModeDisabled",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setBandwidthSaveModeDisabled" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setBandwidthSaveModeDisabled" "', argument " "2"" of type '" "int""'"); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_getLastErrorDescription",&obj0)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "blpapi_getLastErrorDescription" "', argument " "1"" of type '" "int""'"); } - arg2 = (int)(val2); + arg1 = (int)(val1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setBandwidthSaveModeDisabled(arg1,arg2); + result = (char *)blpapi_getLastErrorDescription(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_serverHost(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)":blpapi_SessionOptions_create")) SWIG_fail; + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_SessionOptions_t *)blpapi_SessionOptions_create(); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_serverHost",&obj0)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_destroy",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_serverHost" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_destroy" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_SessionOptions_serverHost(arg1); + blpapi_SessionOptions_destroy(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_FromCharPtr((const char *)result); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_serverPort(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setServerHost(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + char *arg2 = (char *) 0 ; void *argp1 = 0 ; int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; PyObject * obj0 = 0 ; - unsigned int result; + PyObject * obj1 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_serverPort",&obj0)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setServerHost",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_serverPort" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setServerHost" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setServerHost" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (unsigned int)blpapi_SessionOptions_serverPort(arg1); + result = (int)blpapi_SessionOptions_setServerHost(arg1,(char const *)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result)); + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_numServerAddresses(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setServerPort(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + unsigned short arg2 ; void *argp1 = 0 ; int res1 = 0 ; + unsigned short val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_numServerAddresses",&obj0)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setServerPort",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_numServerAddresses" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setServerPort" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_short(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setServerPort" "', argument " "2"" of type '" "unsigned short""'"); + } + arg2 = (unsigned short)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_numServerAddresses(arg1); + result = (int)blpapi_SessionOptions_setServerPort(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); @@ -11170,302 +11507,416 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_numServerAddresses(PyObject *SW } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_getServerAddress(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setServerAddress(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - char **arg2 = (char **) 0 ; - unsigned short *arg3 = (unsigned short *) 0 ; + char *arg2 = (char *) 0 ; + unsigned short arg3 ; size_t arg4 ; void *argp1 = 0 ; int res1 = 0 ; - char *tempServerHost2 = 0 ; - unsigned short tempServerPort2 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + unsigned short val3 ; + int ecode3 = 0 ; size_t val4 ; int ecode4 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; int result; - arg2 = &tempServerHost2; - arg3 = &tempServerPort2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_getServerAddress",&obj0,&obj1)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_SessionOptions_setServerAddress",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_getServerAddress" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setServerAddress" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode4 = SWIG_AsVal_size_t(obj1, &val4); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setServerAddress" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_SessionOptions_setServerAddress" "', argument " "3"" of type '" "unsigned short""'"); + } + arg3 = (unsigned short)(val3); + ecode4 = SWIG_AsVal_size_t(obj3, &val4); if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_SessionOptions_getServerAddress" "', argument " "4"" of type '" "size_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_SessionOptions_setServerAddress" "', argument " "4"" of type '" "size_t""'"); } arg4 = (size_t)(val4); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_getServerAddress(arg1,(char const **)arg2,arg3,arg4); + result = (int)blpapi_SessionOptions_setServerAddress(arg1,(char const *)arg2,arg3,arg4); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int(*arg3)); - } + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_connectTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_removeServerAddress(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + size_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; - unsigned int result; + PyObject * obj1 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_connectTimeout",&obj0)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_removeServerAddress",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_connectTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_removeServerAddress" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_removeServerAddress" "', argument " "2"" of type '" "size_t""'"); + } + arg2 = (size_t)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (unsigned int)blpapi_SessionOptions_connectTimeout(arg1); + result = (int)blpapi_SessionOptions_removeServerAddress(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultServices(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setConnectTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + unsigned int arg2 ; void *argp1 = 0 ; int res1 = 0 ; + unsigned int val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; - char *result = 0 ; + PyObject * obj1 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_defaultServices",&obj0)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setConnectTimeout",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_defaultServices" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setConnectTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setConnectTimeout" "', argument " "2"" of type '" "unsigned int""'"); + } + arg2 = (unsigned int)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_SessionOptions_defaultServices(arg1); + result = (int)blpapi_SessionOptions_setConnectTimeout(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_FromCharPtr((const char *)result); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultSubscriptionService(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setDefaultServices(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + char *arg2 = (char *) 0 ; void *argp1 = 0 ; int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; PyObject * obj0 = 0 ; - char *result = 0 ; + PyObject * obj1 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_defaultSubscriptionService",&obj0)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setDefaultServices",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_defaultSubscriptionService" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setDefaultServices" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setDefaultServices" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_SessionOptions_defaultSubscriptionService(arg1); + result = (int)blpapi_SessionOptions_setDefaultServices(arg1,(char const *)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_FromCharPtr((const char *)result); + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultTopicPrefix(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setDefaultSubscriptionService(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + char *arg2 = (char *) 0 ; void *argp1 = 0 ; int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; PyObject * obj0 = 0 ; - char *result = 0 ; + PyObject * obj1 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_defaultTopicPrefix",&obj0)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setDefaultSubscriptionService",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_defaultTopicPrefix" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setDefaultSubscriptionService" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setDefaultSubscriptionService" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_SessionOptions_defaultTopicPrefix(arg1); + result = (int)blpapi_SessionOptions_setDefaultSubscriptionService(arg1,(char const *)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_FromCharPtr((const char *)result); + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setDefaultTopicPrefix(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + char *arg2 = (char *) 0 ; void *argp1 = 0 ; int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; PyObject * obj0 = 0 ; - int result; + PyObject * obj1 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg",&obj0)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setDefaultTopicPrefix",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setDefaultTopicPrefix" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setDefaultTopicPrefix" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg(arg1); + blpapi_SessionOptions_setDefaultTopicPrefix(arg1,(char const *)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Py_Void(); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_clientMode(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + int arg2 ; void *argp1 = 0 ; int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; - int result; + PyObject * obj1 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_clientMode",&obj0)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_clientMode" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_clientMode(arg1); + blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_maxPendingRequests(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setClientMode(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + int arg2 ; void *argp1 = 0 ; int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; - int result; + PyObject * obj1 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_maxPendingRequests",&obj0)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setClientMode",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_maxPendingRequests" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setClientMode" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setClientMode" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_maxPendingRequests(arg1); + blpapi_SessionOptions_setClientMode(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_autoRestartOnDisconnection(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setMaxPendingRequests(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + int arg2 ; void *argp1 = 0 ; int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; - int result; + PyObject * obj1 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_autoRestartOnDisconnection",&obj0)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setMaxPendingRequests",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_autoRestartOnDisconnection" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setMaxPendingRequests" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setMaxPendingRequests" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_autoRestartOnDisconnection(arg1); + blpapi_SessionOptions_setMaxPendingRequests(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_authenticationOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setAutoRestartOnDisconnection(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + int arg2 ; void *argp1 = 0 ; int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; - char *result = 0 ; + PyObject * obj1 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_authenticationOptions",&obj0)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setAutoRestartOnDisconnection",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_authenticationOptions" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setAutoRestartOnDisconnection" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setAutoRestartOnDisconnection" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_SessionOptions_authenticationOptions(arg1); + blpapi_SessionOptions_setAutoRestartOnDisconnection(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_FromCharPtr((const char *)result); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_numStartAttempts(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setSessionIdentityOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + blpapi_AuthOptions_t *arg2 = (blpapi_AuthOptions_t *) 0 ; + blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_numStartAttempts",&obj0)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_SessionOptions_setSessionIdentityOptions",&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_numStartAttempts" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setSessionIdentityOptions" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_AuthOptions, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setSessionIdentityOptions" "', argument " "2"" of type '" "blpapi_AuthOptions_t const *""'"); + } + arg2 = (blpapi_AuthOptions_t *)(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_SessionOptions_setSessionIdentityOptions" "', argument " "3"" of type '" "blpapi_CorrelationId_t *""'"); + } + arg3 = (blpapi_CorrelationId_t *)(argp3); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_numStartAttempts(arg1); + result = (int)blpapi_SessionOptions_setSessionIdentityOptions(arg1,(struct blpapi_AuthOptions const *)arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); @@ -11475,101 +11926,137 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_numStartAttempts(PyObject *SWIG } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_maxEventQueueSize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setAuthenticationOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + char *arg2 = (char *) 0 ; void *argp1 = 0 ; int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; PyObject * obj0 = 0 ; - size_t result; + PyObject * obj1 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_maxEventQueueSize",&obj0)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setAuthenticationOptions",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_maxEventQueueSize" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setAuthenticationOptions" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setAuthenticationOptions" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = blpapi_SessionOptions_maxEventQueueSize(arg1); + blpapi_SessionOptions_setAuthenticationOptions(arg1,(char const *)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_size_t((size_t)(result)); + resultobj = SWIG_Py_Void(); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_slowConsumerWarningHiWaterMark(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setNumStartAttempts(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + int arg2 ; void *argp1 = 0 ; int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; - float result; + PyObject * obj1 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_slowConsumerWarningHiWaterMark",&obj0)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setNumStartAttempts",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_slowConsumerWarningHiWaterMark" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setNumStartAttempts" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setNumStartAttempts" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (float)blpapi_SessionOptions_slowConsumerWarningHiWaterMark(arg1); + blpapi_SessionOptions_setNumStartAttempts(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_float((float)(result)); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_slowConsumerWarningLoWaterMark(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setMaxEventQueueSize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + size_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; - float result; + PyObject * obj1 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_slowConsumerWarningLoWaterMark",&obj0)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setMaxEventQueueSize",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_slowConsumerWarningLoWaterMark" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setMaxEventQueueSize" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setMaxEventQueueSize" "', argument " "2"" of type '" "size_t""'"); + } + arg2 = (size_t)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (float)blpapi_SessionOptions_slowConsumerWarningLoWaterMark(arg1); + blpapi_SessionOptions_setMaxEventQueueSize(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_float((float)(result)); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultKeepAliveInactivityTime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + float arg2 ; void *argp1 = 0 ; int res1 = 0 ; + float val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_defaultKeepAliveInactivityTime",&obj0)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_defaultKeepAliveInactivityTime" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); + ecode2 = SWIG_AsVal_float(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark" "', argument " "2"" of type '" "float""'"); + } + arg2 = (float)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_defaultKeepAliveInactivityTime(arg1); + result = (int)blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); @@ -11579,23 +12066,32 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultKeepAliveInactivityTime( } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultKeepAliveResponseTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + float arg2 ; void *argp1 = 0 ; int res1 = 0 ; + float val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_defaultKeepAliveResponseTimeout",&obj0)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_defaultKeepAliveResponseTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); + ecode2 = SWIG_AsVal_float(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark" "', argument " "2"" of type '" "float""'"); + } + arg2 = (float)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_defaultKeepAliveResponseTimeout(arg1); + result = (int)blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); @@ -11605,23 +12101,32 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultKeepAliveResponseTimeout } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_keepAliveEnabled(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setDefaultKeepAliveInactivityTime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + int arg2 ; void *argp1 = 0 ; int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_keepAliveEnabled",&obj0)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setDefaultKeepAliveInactivityTime",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_keepAliveEnabled" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setDefaultKeepAliveInactivityTime" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setDefaultKeepAliveInactivityTime" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_keepAliveEnabled(arg1); + result = (int)blpapi_SessionOptions_setDefaultKeepAliveInactivityTime(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); @@ -11631,23 +12136,32 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_keepAliveEnabled(PyObject *SWIG } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_recordSubscriptionDataReceiveTimes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + int arg2 ; void *argp1 = 0 ; int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_recordSubscriptionDataReceiveTimes",&obj0)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_recordSubscriptionDataReceiveTimes" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_recordSubscriptionDataReceiveTimes(arg1); + result = (int)blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); @@ -11657,23 +12171,32 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_recordSubscriptionDataReceiveTi } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_serviceCheckTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setKeepAliveEnabled(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + int arg2 ; void *argp1 = 0 ; int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_serviceCheckTimeout",&obj0)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setKeepAliveEnabled",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_serviceCheckTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setKeepAliveEnabled" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setKeepAliveEnabled" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_serviceCheckTimeout(arg1); + result = (int)blpapi_SessionOptions_setKeepAliveEnabled(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); @@ -11683,49 +12206,66 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_serviceCheckTimeout(PyObject *S } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_serviceDownloadTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + int arg2 ; void *argp1 = 0 ; int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; - int result; + PyObject * obj1 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_serviceDownloadTimeout",&obj0)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_serviceDownloadTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_serviceDownloadTimeout(arg1); + blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_flushPublishedEventsTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setServiceCheckTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + int arg2 ; void *argp1 = 0 ; int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_flushPublishedEventsTimeout",&obj0)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setServiceCheckTimeout",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_flushPublishedEventsTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setServiceCheckTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setServiceCheckTimeout" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_flushPublishedEventsTimeout(arg1); + result = (int)blpapi_SessionOptions_setServiceCheckTimeout(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); @@ -11735,23 +12275,32 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_flushPublishedEventsTimeout(PyO } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_bandwidthSaveModeDisabled(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setServiceDownloadTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + int arg2 ; void *argp1 = 0 ; int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_bandwidthSaveModeDisabled",&obj0)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setServiceDownloadTimeout",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_bandwidthSaveModeDisabled" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setServiceDownloadTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setServiceDownloadTimeout" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_bandwidthSaveModeDisabled(arg1); + result = (int)blpapi_SessionOptions_setServiceDownloadTimeout(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); @@ -11761,146 +12310,78 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_bandwidthSaveModeDisabled(PyObj } -SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setTlsOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_TlsOptions_t *arg1 = (blpapi_TlsOptions_t *) 0 ; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + blpapi_TlsOptions_t *arg2 = (blpapi_TlsOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_TlsOptions_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TlsOptions_destroy" "', argument " "1"" of type '" "blpapi_TlsOptions_t *""'"); - } - arg1 = (blpapi_TlsOptions_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_TlsOptions_destroy(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_createFromFiles(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - char *arg2 = (char *) 0 ; - char *arg3 = (char *) 0 ; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - blpapi_TlsOptions_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_TlsOptions_createFromFiles",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setTlsOptions",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TlsOptions_createFromFiles" "', argument " "1"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setTlsOptions" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } - arg1 = (char *)(buf1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + arg1 = (blpapi_SessionOptions_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_TlsOptions_createFromFiles" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_TlsOptions_createFromFiles" "', argument " "3"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setTlsOptions" "', argument " "2"" of type '" "blpapi_TlsOptions_t const *""'"); } - arg3 = (char *)(buf3); + arg2 = (blpapi_TlsOptions_t *)(argp2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_TlsOptions_t *)blpapi_TlsOptions_createFromFiles((char const *)arg1,(char const *)arg2,(char const *)arg3); + blpapi_SessionOptions_setTlsOptions(arg1,(struct blpapi_TlsOptions const *)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); - if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + resultobj = SWIG_Py_Void(); return resultobj; fail: - if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_createFromBlobs(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setFlushPublishedEventsTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; int arg2 ; - char *arg3 = (char *) 0 ; - char *arg4 = (char *) 0 ; - int arg5 ; - int res1 ; - Py_ssize_t size1 = 0 ; - void const *buf1 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; - int res4 ; - Py_ssize_t size4 = 0 ; - void const *buf4 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - blpapi_TlsOptions_t *result = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_TlsOptions_createFromBlobs",&obj0,&obj1,&obj2)) SWIG_fail; - { - res1 = PyObject_AsReadBuffer(obj0, &buf1, &size1); - if (res1<0) { - PyErr_Clear(); - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TlsOptions_createFromBlobs" "', argument " "1"" of type '" "(const char *clientCredentialsRawData, int clientCredentialsRawDataLength)""'"); - } - arg1 = (char *) buf1; - arg2 = (int) (size1 / sizeof(char const)); - } - res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_TlsOptions_createFromBlobs" "', argument " "3"" of type '" "char const *""'"); - } - arg3 = (char *)(buf3); - { - res4 = PyObject_AsReadBuffer(obj2, &buf4, &size4); - if (res4<0) { - PyErr_Clear(); - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_TlsOptions_createFromBlobs" "', argument " "4"" of type '" "(const char *trustedCertificatesRawData, int trustedCertificatesRawDataLength)""'"); - } - arg4 = (char *) buf4; - arg5 = (int) (size4 / sizeof(char const)); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setFlushPublishedEventsTimeout",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setFlushPublishedEventsTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } + arg1 = (blpapi_SessionOptions_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setFlushPublishedEventsTimeout" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_TlsOptions_t *)blpapi_TlsOptions_createFromBlobs((char const *)arg1,arg2,(char const *)arg3,(char const *)arg4,arg5); + result = (int)blpapi_SessionOptions_setFlushPublishedEventsTimeout(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_setTlsHandshakeTimeoutMs(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setBandwidthSaveModeDisabled(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_TlsOptions_t *arg1 = (blpapi_TlsOptions_t *) 0 ; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; int arg2 ; void *argp1 = 0 ; int res1 = 0 ; @@ -11908,343 +12389,327 @@ SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_setTlsHandshakeTimeoutMs(PyObject * int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TlsOptions_setTlsHandshakeTimeoutMs",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setBandwidthSaveModeDisabled",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TlsOptions_setTlsHandshakeTimeoutMs" "', argument " "1"" of type '" "blpapi_TlsOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setBandwidthSaveModeDisabled" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } - arg1 = (blpapi_TlsOptions_t *)(argp1); + arg1 = (blpapi_SessionOptions_t *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_TlsOptions_setTlsHandshakeTimeoutMs" "', argument " "2"" of type '" "int""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setBandwidthSaveModeDisabled" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_TlsOptions_setTlsHandshakeTimeoutMs(arg1,arg2); + result = (int)blpapi_SessionOptions_setBandwidthSaveModeDisabled(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_Py_Void(); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_setCrlFetchTimeoutMs(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_serverHost(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_TlsOptions_t *arg1 = (blpapi_TlsOptions_t *) 0 ; - int arg2 ; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TlsOptions_setCrlFetchTimeoutMs",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_serverHost",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TlsOptions_setCrlFetchTimeoutMs" "', argument " "1"" of type '" "blpapi_TlsOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_serverHost" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } - arg1 = (blpapi_TlsOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_TlsOptions_setCrlFetchTimeoutMs" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); + arg1 = (blpapi_SessionOptions_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_TlsOptions_setCrlFetchTimeoutMs(arg1,arg2); + result = (char *)blpapi_SessionOptions_serverHost(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_Py_Void(); + resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Name_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_serverPort(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; PyObject * obj0 = 0 ; - blpapi_Name_t *result = 0 ; + unsigned int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Name_create",&obj0)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_serverPort",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Name_create" "', argument " "1"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_serverPort" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } - arg1 = (char *)(buf1); + arg1 = (blpapi_SessionOptions_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Name_t *)blpapi_Name_create((char const *)arg1); + result = (unsigned int)blpapi_SessionOptions_serverPort(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result)); return resultobj; fail: - if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Name_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_numServerAddresses(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Name_t *arg1 = (blpapi_Name_t *) 0 ; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Name_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_numServerAddresses",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Name_destroy" "', argument " "1"" of type '" "blpapi_Name_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_numServerAddresses" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } - arg1 = (blpapi_Name_t *)(argp1); + arg1 = (blpapi_SessionOptions_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_Name_destroy(arg1); + result = (int)blpapi_SessionOptions_numServerAddresses(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_Py_Void(); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Name_equalsStr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_getServerAddress(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Name_t *arg1 = (blpapi_Name_t *) 0 ; - char *arg2 = (char *) 0 ; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + char **arg2 = (char **) 0 ; + unsigned short *arg3 = (unsigned short *) 0 ; + size_t arg4 ; void *argp1 = 0 ; int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; + char *tempServerHost2 = 0 ; + unsigned short tempServerPort2 = 0 ; + size_t val4 ; + int ecode4 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Name_equalsStr",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + arg2 = &tempServerHost2; + arg3 = &tempServerPort2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_getServerAddress",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Name_equalsStr" "', argument " "1"" of type '" "blpapi_Name_t const *""'"); - } - arg1 = (blpapi_Name_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Name_equalsStr" "', argument " "2"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_getServerAddress" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } - arg2 = (char *)(buf2); + arg1 = (blpapi_SessionOptions_t *)(argp1); + ecode4 = SWIG_AsVal_size_t(obj1, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_SessionOptions_getServerAddress" "', argument " "4"" of type '" "size_t""'"); + } + arg4 = (size_t)(val4); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Name_equalsStr((struct blpapi_Name const *)arg1,(char const *)arg2); + result = (int)blpapi_SessionOptions_getServerAddress(arg1,(char const **)arg2,arg3,arg4); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int(*arg3)); + } return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Name_string(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_connectTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Name_t *arg1 = (blpapi_Name_t *) 0 ; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - char *result = 0 ; + unsigned int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Name_string",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_connectTimeout",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Name_string" "', argument " "1"" of type '" "blpapi_Name_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_connectTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } - arg1 = (blpapi_Name_t *)(argp1); + arg1 = (blpapi_SessionOptions_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_Name_string((struct blpapi_Name const *)arg1); + result = (unsigned int)blpapi_SessionOptions_connectTimeout(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_FromCharPtr((const char *)result); + resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Name_length(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultServices(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Name_t *arg1 = (blpapi_Name_t *) 0 ; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - size_t result; + char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Name_length",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_defaultServices",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Name_length" "', argument " "1"" of type '" "blpapi_Name_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_defaultServices" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } - arg1 = (blpapi_Name_t *)(argp1); + arg1 = (blpapi_SessionOptions_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = blpapi_Name_length((struct blpapi_Name const *)arg1); + result = (char *)blpapi_SessionOptions_defaultServices(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_size_t((size_t)(result)); + resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Name_findName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultSubscriptionService(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; PyObject * obj0 = 0 ; - blpapi_Name_t *result = 0 ; + char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Name_findName",&obj0)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_defaultSubscriptionService",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Name_findName" "', argument " "1"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_defaultSubscriptionService" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } - arg1 = (char *)(buf1); + arg1 = (blpapi_SessionOptions_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Name_t *)blpapi_Name_findName((char const *)arg1); + result = (char *)blpapi_SessionOptions_defaultSubscriptionService(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: - if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultTopicPrefix(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SubscriptionList_t *result = 0 ; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)":blpapi_SubscriptionList_create")) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_defaultTopicPrefix",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_defaultTopicPrefix" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_SubscriptionList_t *)blpapi_SubscriptionList_create(); + result = (char *)blpapi_SessionOptions_defaultTopicPrefix(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SubscriptionList_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_destroy" "', argument " "1"" of type '" "blpapi_SubscriptionList_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } - arg1 = (blpapi_SubscriptionList_t *)(argp1); + arg1 = (blpapi_SessionOptions_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_SubscriptionList_destroy(arg1); + result = (int)blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_Py_Void(); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_addResolved(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_clientMode(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_SubscriptionList_addResolved",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_clientMode",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_addResolved" "', argument " "1"" of type '" "blpapi_SubscriptionList_t *""'"); - } - arg1 = (blpapi_SubscriptionList_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SubscriptionList_addResolved" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_SubscriptionList_addResolved" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_clientMode" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } - arg3 = (blpapi_CorrelationId_t *)(argp3); + arg1 = (blpapi_SessionOptions_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SubscriptionList_addResolved(arg1,(char const *)arg2,(struct blpapi_CorrelationId_t_ const *)arg3); + result = (int)blpapi_SessionOptions_clientMode(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_maxPendingRequests(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SubscriptionList_clear",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_maxPendingRequests",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_clear" "', argument " "1"" of type '" "blpapi_SubscriptionList_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_maxPendingRequests" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } - arg1 = (blpapi_SubscriptionList_t *)(argp1); + arg1 = (blpapi_SessionOptions_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SubscriptionList_clear(arg1); + result = (int)blpapi_SessionOptions_maxPendingRequests(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); @@ -12254,32 +12719,23 @@ SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_clear(PyObject *SWIGUNUSEDPAR } -SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_append(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_autoRestartOnDisconnection(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; - blpapi_SubscriptionList_t *arg2 = (blpapi_SubscriptionList_t *) 0 ; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SubscriptionList_append",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_autoRestartOnDisconnection",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_append" "', argument " "1"" of type '" "blpapi_SubscriptionList_t *""'"); - } - arg1 = (blpapi_SubscriptionList_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SubscriptionList_append" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_autoRestartOnDisconnection" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } - arg2 = (blpapi_SubscriptionList_t *)(argp2); + arg1 = (blpapi_SessionOptions_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SubscriptionList_append(arg1,(struct blpapi_SubscriptionList const *)arg2); + result = (int)blpapi_SessionOptions_autoRestartOnDisconnection(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); @@ -12289,442 +12745,360 @@ SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_append(PyObject *SWIGUNUSEDPA } -SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_authenticationOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - int result; + char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SubscriptionList_size",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_authenticationOptions",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_size" "', argument " "1"" of type '" "blpapi_SubscriptionList_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_authenticationOptions" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } - arg1 = (blpapi_SubscriptionList_t *)(argp1); + arg1 = (blpapi_SessionOptions_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SubscriptionList_size((struct blpapi_SubscriptionList const *)arg1); + result = (char *)blpapi_SessionOptions_authenticationOptions(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_correlationIdAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_numStartAttempts(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; - blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; - size_t arg3 ; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - blpapi_CorrelationId_t temp2 ; - size_t val3 ; - int ecode3 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; int result; - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SubscriptionList_correlationIdAt",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_numStartAttempts",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_correlationIdAt" "', argument " "1"" of type '" "blpapi_SubscriptionList_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_numStartAttempts" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } - arg1 = (blpapi_SubscriptionList_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_SubscriptionList_correlationIdAt" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); + arg1 = (blpapi_SessionOptions_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SubscriptionList_correlationIdAt((struct blpapi_SubscriptionList const *)arg1,arg2,arg3); + result = (int)blpapi_SessionOptions_numStartAttempts(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - if (!result) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(CorrelationId_t_clone(arg2), SWIGTYPE_p_blpapi_CorrelationId_t_, SWIG_POINTER_OWN)); - } else { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_Py_Void()); - } return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_topicStringAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_maxEventQueueSize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; - char **arg2 = (char **) 0 ; - size_t arg3 ; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - char *temp2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; + size_t result; - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SubscriptionList_topicStringAt",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_maxEventQueueSize",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_topicStringAt" "', argument " "1"" of type '" "blpapi_SubscriptionList_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_maxEventQueueSize" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } - arg1 = (blpapi_SubscriptionList_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_SubscriptionList_topicStringAt" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); + arg1 = (blpapi_SessionOptions_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SubscriptionList_topicStringAt(arg1,(char const **)arg2,arg3); + result = blpapi_SessionOptions_maxEventQueueSize(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); + resultobj = SWIG_From_size_t((size_t)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_isResolvedAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_slowConsumerWarningHiWaterMark(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; - int *arg2 = (int *) 0 ; - size_t arg3 ; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - int temp2 ; - size_t val3 ; - int ecode3 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; + float result; - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SubscriptionList_isResolvedAt",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_slowConsumerWarningHiWaterMark",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_isResolvedAt" "', argument " "1"" of type '" "blpapi_SubscriptionList_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_slowConsumerWarningHiWaterMark" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } - arg1 = (blpapi_SubscriptionList_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_SubscriptionList_isResolvedAt" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); + arg1 = (blpapi_SessionOptions_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SubscriptionList_isResolvedAt(arg1,arg2,arg3); + result = (float)blpapi_SessionOptions_slowConsumerWarningHiWaterMark(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, PyInt_FromLong(*arg2)); + resultobj = SWIG_From_float((float)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_TimePoint_d_value_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_slowConsumerWarningLoWaterMark(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct blpapi_TimePoint *arg1 = (struct blpapi_TimePoint *) 0 ; - blpapi_Int64_t arg2 ; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - long long val2 ; - int ecode2 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + float result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TimePoint_d_value_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TimePoint, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_slowConsumerWarningLoWaterMark",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TimePoint_d_value_set" "', argument " "1"" of type '" "struct blpapi_TimePoint *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_slowConsumerWarningLoWaterMark" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } - arg1 = (struct blpapi_TimePoint *)(argp1); - ecode2 = SWIG_AsVal_long_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_TimePoint_d_value_set" "', argument " "2"" of type '" "blpapi_Int64_t""'"); - } - arg2 = (blpapi_Int64_t)(val2); + arg1 = (blpapi_SessionOptions_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - if (arg1) (arg1)->d_value = arg2; + result = (float)blpapi_SessionOptions_slowConsumerWarningLoWaterMark(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_Py_Void(); + resultobj = SWIG_From_float((float)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_TimePoint_d_value_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultKeepAliveInactivityTime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct blpapi_TimePoint *arg1 = (struct blpapi_TimePoint *) 0 ; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - blpapi_Int64_t result; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_TimePoint_d_value_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TimePoint, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_defaultKeepAliveInactivityTime",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TimePoint_d_value_get" "', argument " "1"" of type '" "struct blpapi_TimePoint *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_defaultKeepAliveInactivityTime" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } - arg1 = (struct blpapi_TimePoint *)(argp1); + arg1 = (blpapi_SessionOptions_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Int64_t) ((arg1)->d_value); + result = (int)blpapi_SessionOptions_defaultKeepAliveInactivityTime(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_long_SS_long((long long)(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_new_blpapi_TimePoint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultKeepAliveResponseTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct blpapi_TimePoint *result = 0 ; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)":new_blpapi_TimePoint")) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_defaultKeepAliveResponseTimeout",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_defaultKeepAliveResponseTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (struct blpapi_TimePoint *)calloc(1, sizeof(struct blpapi_TimePoint)); + result = (int)blpapi_SessionOptions_defaultKeepAliveResponseTimeout(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_TimePoint, SWIG_POINTER_NEW | 0 ); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_delete_blpapi_TimePoint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_keepAliveEnabled(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct blpapi_TimePoint *arg1 = (struct blpapi_TimePoint *) 0 ; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:delete_blpapi_TimePoint",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TimePoint, SWIG_POINTER_DISOWN | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_keepAliveEnabled",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_blpapi_TimePoint" "', argument " "1"" of type '" "struct blpapi_TimePoint *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_keepAliveEnabled" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } - arg1 = (struct blpapi_TimePoint *)(argp1); + arg1 = (blpapi_SessionOptions_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - free((char *) arg1); + result = (int)blpapi_SessionOptions_keepAliveEnabled(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_Py_Void(); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *blpapi_TimePoint_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_blpapi_TimePoint, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_blpapi_TimePointUtil_nanosecondsBetween(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_recordSubscriptionDataReceiveTimes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_TimePoint_t *arg1 = (blpapi_TimePoint_t *) 0 ; - blpapi_TimePoint_t *arg2 = (blpapi_TimePoint_t *) 0 ; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - long long result; + int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TimePointUtil_nanosecondsBetween",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TimePoint, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_recordSubscriptionDataReceiveTimes",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TimePointUtil_nanosecondsBetween" "', argument " "1"" of type '" "blpapi_TimePoint_t const *""'"); - } - arg1 = (blpapi_TimePoint_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_TimePoint, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_TimePointUtil_nanosecondsBetween" "', argument " "2"" of type '" "blpapi_TimePoint_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_recordSubscriptionDataReceiveTimes" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } - arg2 = (blpapi_TimePoint_t *)(argp2); + arg1 = (blpapi_SessionOptions_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (long long)blpapi_TimePointUtil_nanosecondsBetween((struct blpapi_TimePoint const *)arg1,(struct blpapi_TimePoint const *)arg2); + result = (int)blpapi_SessionOptions_recordSubscriptionDataReceiveTimes(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_long_SS_long((long long)(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_parts_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_serviceCheckTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; - blpapi_UChar_t arg2 ; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - unsigned char val2 ; - int ecode2 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_parts_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_serviceCheckTimeout",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_parts_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_serviceCheckTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } - arg1 = (struct blpapi_Datetime_tag *)(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_parts_set" "', argument " "2"" of type '" "blpapi_UChar_t""'"); - } - arg2 = (blpapi_UChar_t)(val2); + arg1 = (blpapi_SessionOptions_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - if (arg1) (arg1)->parts = arg2; + result = (int)blpapi_SessionOptions_serviceCheckTimeout(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_Py_Void(); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_parts_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_serviceDownloadTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - blpapi_UChar_t result; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_parts_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_serviceDownloadTimeout",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_parts_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_serviceDownloadTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } - arg1 = (struct blpapi_Datetime_tag *)(argp1); + arg1 = (blpapi_SessionOptions_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_UChar_t) ((arg1)->parts); + result = (int)blpapi_SessionOptions_serviceDownloadTimeout(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_unsigned_SS_char((unsigned char)(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_hours_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_flushPublishedEventsTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; - blpapi_UChar_t arg2 ; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - unsigned char val2 ; - int ecode2 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_hours_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_flushPublishedEventsTimeout",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_hours_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_flushPublishedEventsTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } - arg1 = (struct blpapi_Datetime_tag *)(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_hours_set" "', argument " "2"" of type '" "blpapi_UChar_t""'"); - } - arg2 = (blpapi_UChar_t)(val2); + arg1 = (blpapi_SessionOptions_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - if (arg1) (arg1)->hours = arg2; + result = (int)blpapi_SessionOptions_flushPublishedEventsTimeout(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_Py_Void(); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_hours_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_bandwidthSaveModeDisabled(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - blpapi_UChar_t result; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_hours_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_bandwidthSaveModeDisabled",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_hours_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_bandwidthSaveModeDisabled" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } - arg1 = (struct blpapi_Datetime_tag *)(argp1); + arg1 = (blpapi_SessionOptions_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_UChar_t) ((arg1)->hours); + result = (int)blpapi_SessionOptions_bandwidthSaveModeDisabled(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_unsigned_SS_char((unsigned char)(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_minutes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; - blpapi_UChar_t arg2 ; + blpapi_TlsOptions_t *arg1 = (blpapi_TlsOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - unsigned char val2 ; - int ecode2 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_minutes_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_TlsOptions_destroy",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_minutes_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TlsOptions_destroy" "', argument " "1"" of type '" "blpapi_TlsOptions_t *""'"); } - arg1 = (struct blpapi_Datetime_tag *)(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_minutes_set" "', argument " "2"" of type '" "blpapi_UChar_t""'"); - } - arg2 = (blpapi_UChar_t)(val2); + arg1 = (blpapi_TlsOptions_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - if (arg1) (arg1)->minutes = arg2; + blpapi_TlsOptions_destroy(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_Py_Void(); @@ -12734,117 +13108,177 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_minutes_set(PyObject *SWIGUNUSEDP } -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_minutes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_createFromFiles(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; + char *arg1 = (char *) 0 ; + char *arg2 = (char *) 0 ; + char *arg3 = (char *) 0 ; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; PyObject * obj0 = 0 ; - blpapi_UChar_t result; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + blpapi_TlsOptions_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_minutes_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_TlsOptions_createFromFiles",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_minutes_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TlsOptions_createFromFiles" "', argument " "1"" of type '" "char const *""'"); } - arg1 = (struct blpapi_Datetime_tag *)(argp1); + arg1 = (char *)(buf1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_TlsOptions_createFromFiles" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_TlsOptions_createFromFiles" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = (char *)(buf3); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_UChar_t) ((arg1)->minutes); + result = (blpapi_TlsOptions_t *)blpapi_TlsOptions_createFromFiles((char const *)arg1,(char const *)arg2,(char const *)arg3); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_unsigned_SS_char((unsigned char)(result)); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return resultobj; fail: + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_seconds_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_createFromBlobs(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; - blpapi_UChar_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned char val2 ; - int ecode2 = 0 ; + char *arg1 = (char *) 0 ; + int arg2 ; + char *arg3 = (char *) 0 ; + char *arg4 = (char *) 0 ; + int arg5 ; + int res1 ; + Py_ssize_t size1 = 0 ; + void const *buf1 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + int res4 ; + Py_ssize_t size4 = 0 ; + void const *buf4 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + blpapi_TlsOptions_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_seconds_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_seconds_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_TlsOptions_createFromBlobs",&obj0,&obj1,&obj2)) SWIG_fail; + { + res1 = PyObject_AsReadBuffer(obj0, &buf1, &size1); + if (res1<0) { + PyErr_Clear(); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TlsOptions_createFromBlobs" "', argument " "1"" of type '" "(const char *clientCredentialsRawData, int clientCredentialsRawDataLength)""'"); + } + arg1 = (char *) buf1; + arg2 = (int) (size1 / sizeof(char const)); + } + res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_TlsOptions_createFromBlobs" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = (char *)(buf3); + { + res4 = PyObject_AsReadBuffer(obj2, &buf4, &size4); + if (res4<0) { + PyErr_Clear(); + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_TlsOptions_createFromBlobs" "', argument " "4"" of type '" "(const char *trustedCertificatesRawData, int trustedCertificatesRawDataLength)""'"); + } + arg4 = (char *) buf4; + arg5 = (int) (size4 / sizeof(char const)); } - arg1 = (struct blpapi_Datetime_tag *)(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_seconds_set" "', argument " "2"" of type '" "blpapi_UChar_t""'"); - } - arg2 = (blpapi_UChar_t)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - if (arg1) (arg1)->seconds = arg2; + result = (blpapi_TlsOptions_t *)blpapi_TlsOptions_createFromBlobs((char const *)arg1,arg2,(char const *)arg3,(char const *)arg4,arg5); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_Py_Void(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return resultobj; fail: + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_seconds_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_setTlsHandshakeTimeoutMs(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; + blpapi_TlsOptions_t *arg1 = (blpapi_TlsOptions_t *) 0 ; + int arg2 ; void *argp1 = 0 ; int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; - blpapi_UChar_t result; + PyObject * obj1 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_seconds_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TlsOptions_setTlsHandshakeTimeoutMs",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_seconds_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TlsOptions_setTlsHandshakeTimeoutMs" "', argument " "1"" of type '" "blpapi_TlsOptions_t *""'"); } - arg1 = (struct blpapi_Datetime_tag *)(argp1); + arg1 = (blpapi_TlsOptions_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_TlsOptions_setTlsHandshakeTimeoutMs" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_UChar_t) ((arg1)->seconds); + blpapi_TlsOptions_setTlsHandshakeTimeoutMs(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_unsigned_SS_char((unsigned char)(result)); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_milliSeconds_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_setCrlFetchTimeoutMs(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; - blpapi_UInt16_t arg2 ; + blpapi_TlsOptions_t *arg1 = (blpapi_TlsOptions_t *) 0 ; + int arg2 ; void *argp1 = 0 ; int res1 = 0 ; - unsigned short val2 ; + int val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_milliSeconds_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TlsOptions_setCrlFetchTimeoutMs",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_milliSeconds_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TlsOptions_setCrlFetchTimeoutMs" "', argument " "1"" of type '" "blpapi_TlsOptions_t *""'"); } - arg1 = (struct blpapi_Datetime_tag *)(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_short(obj1, &val2); + arg1 = (blpapi_TlsOptions_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_milliSeconds_set" "', argument " "2"" of type '" "blpapi_UInt16_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_TlsOptions_setCrlFetchTimeoutMs" "', argument " "2"" of type '" "int""'"); } - arg2 = (blpapi_UInt16_t)(val2); + arg2 = (int)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - if (arg1) (arg1)->milliSeconds = arg2; + blpapi_TlsOptions_setCrlFetchTimeoutMs(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_Py_Void(); @@ -12854,57 +13288,51 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_milliSeconds_set(PyObject *SWIGUN } -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_milliSeconds_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Name_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; + char *arg1 = (char *) 0 ; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; PyObject * obj0 = 0 ; - blpapi_UInt16_t result; + blpapi_Name_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_milliSeconds_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Name_create",&obj0)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_milliSeconds_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Name_create" "', argument " "1"" of type '" "char const *""'"); } - arg1 = (struct blpapi_Datetime_tag *)(argp1); + arg1 = (char *)(buf1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_UInt16_t) ((arg1)->milliSeconds); + result = (blpapi_Name_t *)blpapi_Name_create((char const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return resultobj; fail: + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_month_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Name_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; - blpapi_UChar_t arg2 ; + blpapi_Name_t *arg1 = (blpapi_Name_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - unsigned char val2 ; - int ecode2 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_month_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Name_destroy",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_month_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Name_destroy" "', argument " "1"" of type '" "blpapi_Name_t *""'"); } - arg1 = (struct blpapi_Datetime_tag *)(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_month_set" "', argument " "2"" of type '" "blpapi_UChar_t""'"); - } - arg2 = (blpapi_UChar_t)(val2); + arg1 = (blpapi_Name_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - if (arg1) (arg1)->month = arg2; + blpapi_Name_destroy(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_Py_Void(); @@ -12914,177 +13342,158 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_month_set(PyObject *SWIGUNUSEDPAR } -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_month_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Name_equalsStr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; + blpapi_Name_t *arg1 = (blpapi_Name_t *) 0 ; + char *arg2 = (char *) 0 ; void *argp1 = 0 ; int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; PyObject * obj0 = 0 ; - blpapi_UChar_t result; + PyObject * obj1 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_month_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Name_equalsStr",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_month_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Name_equalsStr" "', argument " "1"" of type '" "blpapi_Name_t const *""'"); } - arg1 = (struct blpapi_Datetime_tag *)(argp1); + arg1 = (blpapi_Name_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Name_equalsStr" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_UChar_t) ((arg1)->month); + result = (int)blpapi_Name_equalsStr((struct blpapi_Name const *)arg1,(char const *)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_unsigned_SS_char((unsigned char)(result)); + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_day_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Name_string(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; - blpapi_UChar_t arg2 ; + blpapi_Name_t *arg1 = (blpapi_Name_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - unsigned char val2 ; - int ecode2 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_day_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Name_string",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_day_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Name_string" "', argument " "1"" of type '" "blpapi_Name_t const *""'"); } - arg1 = (struct blpapi_Datetime_tag *)(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_day_set" "', argument " "2"" of type '" "blpapi_UChar_t""'"); - } - arg2 = (blpapi_UChar_t)(val2); + arg1 = (blpapi_Name_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - if (arg1) (arg1)->day = arg2; + result = (char *)blpapi_Name_string((struct blpapi_Name const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_Py_Void(); + resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_day_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Name_length(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; + blpapi_Name_t *arg1 = (blpapi_Name_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - blpapi_UChar_t result; + size_t result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_day_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Name_length",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_day_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Name_length" "', argument " "1"" of type '" "blpapi_Name_t const *""'"); } - arg1 = (struct blpapi_Datetime_tag *)(argp1); + arg1 = (blpapi_Name_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_UChar_t) ((arg1)->day); + result = blpapi_Name_length((struct blpapi_Name const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_unsigned_SS_char((unsigned char)(result)); + resultobj = SWIG_From_size_t((size_t)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_year_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Name_findName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; - blpapi_UInt16_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned short val2 ; - int ecode2 = 0 ; + char *arg1 = (char *) 0 ; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + blpapi_Name_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_year_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Name_findName",&obj0)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_year_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Name_findName" "', argument " "1"" of type '" "char const *""'"); } - arg1 = (struct blpapi_Datetime_tag *)(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_short(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_year_set" "', argument " "2"" of type '" "blpapi_UInt16_t""'"); - } - arg2 = (blpapi_UInt16_t)(val2); + arg1 = (char *)(buf1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - if (arg1) (arg1)->year = arg2; + result = (blpapi_Name_t *)blpapi_Name_findName((char const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_Py_Void(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return resultobj; fail: + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_year_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - blpapi_UInt16_t result; + blpapi_SubscriptionList_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_year_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_year_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); - } - arg1 = (struct blpapi_Datetime_tag *)(argp1); + if (!PyArg_ParseTuple(args,(char *)":blpapi_SubscriptionList_create")) SWIG_fail; { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_UInt16_t) ((arg1)->year); + result = (blpapi_SubscriptionList_t *)blpapi_SubscriptionList_create(); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_offset_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; - blpapi_Int16_t arg2 ; + blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - short val2 ; - int ecode2 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_offset_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SubscriptionList_destroy",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_offset_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_destroy" "', argument " "1"" of type '" "blpapi_SubscriptionList_t *""'"); } - arg1 = (struct blpapi_Datetime_tag *)(argp1); - ecode2 = SWIG_AsVal_short(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_offset_set" "', argument " "2"" of type '" "blpapi_Int16_t""'"); - } - arg2 = (blpapi_Int16_t)(val2); + arg1 = (blpapi_SubscriptionList_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - if (arg1) (arg1)->offset = arg2; + blpapi_SubscriptionList_destroy(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_Py_Void(); @@ -13094,166 +13503,286 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_offset_set(PyObject *SWIGUNUSEDPA } -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_offset_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_addResolved(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; + blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; PyObject * obj0 = 0 ; - blpapi_Int16_t result; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_offset_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_SubscriptionList_addResolved",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_offset_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_addResolved" "', argument " "1"" of type '" "blpapi_SubscriptionList_t *""'"); } - arg1 = (struct blpapi_Datetime_tag *)(argp1); + arg1 = (blpapi_SubscriptionList_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SubscriptionList_addResolved" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_SubscriptionList_addResolved" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); + } + arg3 = (blpapi_CorrelationId_t *)(argp3); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Int16_t) ((arg1)->offset); + result = (int)blpapi_SubscriptionList_addResolved(arg1,(char const *)arg2,(struct blpapi_CorrelationId_t_ const *)arg3); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_short((short)(result)); + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_new_blpapi_Datetime_tag(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct blpapi_Datetime_tag *result = 0 ; + blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)":new_blpapi_Datetime_tag")) SWIG_fail; - { + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SubscriptionList_clear",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_clear" "', argument " "1"" of type '" "blpapi_SubscriptionList_t *""'"); + } + arg1 = (blpapi_SubscriptionList_t *)(argp1); + { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (struct blpapi_Datetime_tag *)calloc(1, sizeof(struct blpapi_Datetime_tag)); + result = (int)blpapi_SubscriptionList_clear(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Datetime_tag, SWIG_POINTER_NEW | 0 ); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_delete_blpapi_Datetime_tag(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_append(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; + blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; + blpapi_SubscriptionList_t *arg2 = (blpapi_SubscriptionList_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:delete_blpapi_Datetime_tag",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, SWIG_POINTER_DISOWN | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SubscriptionList_append",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_blpapi_Datetime_tag" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_append" "', argument " "1"" of type '" "blpapi_SubscriptionList_t *""'"); } - arg1 = (struct blpapi_Datetime_tag *)(argp1); + arg1 = (blpapi_SubscriptionList_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SubscriptionList_append" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); + } + arg2 = (blpapi_SubscriptionList_t *)(argp2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - free((char *) arg1); + result = (int)blpapi_SubscriptionList_append(arg1,(struct blpapi_SubscriptionList const *)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_Py_Void(); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *blpapi_Datetime_tag_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_blpapi_Datetime_tag, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); +SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SubscriptionList_size",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_size" "', argument " "1"" of type '" "blpapi_SubscriptionList_t const *""'"); + } + arg1 = (blpapi_SubscriptionList_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SubscriptionList_size((struct blpapi_SubscriptionList const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_tag_datetime_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + +SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_correlationIdAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct blpapi_HighPrecisionDatetime_tag *arg1 = (struct blpapi_HighPrecisionDatetime_tag *) 0 ; - blpapi_Datetime_t *arg2 = (blpapi_Datetime_t *) 0 ; + blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; + blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; + size_t arg3 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; + blpapi_CorrelationId_t temp2 ; + size_t val3 ; + int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_HighPrecisionDatetime_tag_datetime_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SubscriptionList_correlationIdAt",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_tag_datetime_set" "', argument " "1"" of type '" "struct blpapi_HighPrecisionDatetime_tag *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_correlationIdAt" "', argument " "1"" of type '" "blpapi_SubscriptionList_t const *""'"); } - arg1 = (struct blpapi_HighPrecisionDatetime_tag *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_HighPrecisionDatetime_tag_datetime_set" "', argument " "2"" of type '" "blpapi_Datetime_t *""'"); + arg1 = (blpapi_SubscriptionList_t *)(argp1); + ecode3 = SWIG_AsVal_size_t(obj1, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_SubscriptionList_correlationIdAt" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SubscriptionList_correlationIdAt((struct blpapi_SubscriptionList const *)arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; } - arg2 = (blpapi_Datetime_t *)(argp2); + resultobj = SWIG_From_int((int)(result)); + if (!result) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(CorrelationId_t_clone(arg2), SWIGTYPE_p_blpapi_CorrelationId_t_, SWIG_POINTER_OWN)); + } else { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_Py_Void()); + } + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_topicStringAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; + char **arg2 = (char **) 0 ; + size_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + char *temp2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SubscriptionList_topicStringAt",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_topicStringAt" "', argument " "1"" of type '" "blpapi_SubscriptionList_t *""'"); + } + arg1 = (blpapi_SubscriptionList_t *)(argp1); + ecode3 = SWIG_AsVal_size_t(obj1, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_SubscriptionList_topicStringAt" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - if (arg1) (arg1)->datetime = *arg2; + result = (int)blpapi_SubscriptionList_topicStringAt(arg1,(char const **)arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_Py_Void(); + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_tag_datetime_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_isResolvedAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct blpapi_HighPrecisionDatetime_tag *arg1 = (struct blpapi_HighPrecisionDatetime_tag *) 0 ; + blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; + int *arg2 = (int *) 0 ; + size_t arg3 ; void *argp1 = 0 ; int res1 = 0 ; + int temp2 ; + size_t val3 ; + int ecode3 = 0 ; PyObject * obj0 = 0 ; - blpapi_Datetime_t *result = 0 ; + PyObject * obj1 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_HighPrecisionDatetime_tag_datetime_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SubscriptionList_isResolvedAt",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_tag_datetime_get" "', argument " "1"" of type '" "struct blpapi_HighPrecisionDatetime_tag *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_isResolvedAt" "', argument " "1"" of type '" "blpapi_SubscriptionList_t *""'"); } - arg1 = (struct blpapi_HighPrecisionDatetime_tag *)(argp1); + arg1 = (blpapi_SubscriptionList_t *)(argp1); + ecode3 = SWIG_AsVal_size_t(obj1, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_SubscriptionList_isResolvedAt" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Datetime_t *)& ((arg1)->datetime); + result = (int)blpapi_SubscriptionList_isResolvedAt(arg1,arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, PyInt_FromLong(*arg2)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_tag_picoseconds_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_TimePoint_d_value_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct blpapi_HighPrecisionDatetime_tag *arg1 = (struct blpapi_HighPrecisionDatetime_tag *) 0 ; - blpapi_UInt32_t arg2 ; + struct blpapi_TimePoint *arg1 = (struct blpapi_TimePoint *) 0 ; + blpapi_Int64_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; - unsigned int val2 ; + long long val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_HighPrecisionDatetime_tag_picoseconds_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TimePoint_d_value_set",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TimePoint, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_tag_picoseconds_set" "', argument " "1"" of type '" "struct blpapi_HighPrecisionDatetime_tag *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TimePoint_d_value_set" "', argument " "1"" of type '" "struct blpapi_TimePoint *""'"); } - arg1 = (struct blpapi_HighPrecisionDatetime_tag *)(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2); + arg1 = (struct blpapi_TimePoint *)(argp1); + ecode2 = SWIG_AsVal_long_SS_long(obj1, &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_HighPrecisionDatetime_tag_picoseconds_set" "', argument " "2"" of type '" "blpapi_UInt32_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_TimePoint_d_value_set" "', argument " "2"" of type '" "blpapi_Int64_t""'"); } - arg2 = (blpapi_UInt32_t)(val2); + arg2 = (blpapi_Int64_t)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - if (arg1) (arg1)->picoseconds = arg2; + if (arg1) (arg1)->d_value = arg2; SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_Py_Void(); @@ -13263,62 +13792,62 @@ SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_tag_picoseconds_set(PyOb } -SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_tag_picoseconds_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_TimePoint_d_value_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct blpapi_HighPrecisionDatetime_tag *arg1 = (struct blpapi_HighPrecisionDatetime_tag *) 0 ; + struct blpapi_TimePoint *arg1 = (struct blpapi_TimePoint *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - blpapi_UInt32_t result; + blpapi_Int64_t result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_HighPrecisionDatetime_tag_picoseconds_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_TimePoint_d_value_get",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TimePoint, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_tag_picoseconds_get" "', argument " "1"" of type '" "struct blpapi_HighPrecisionDatetime_tag *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TimePoint_d_value_get" "', argument " "1"" of type '" "struct blpapi_TimePoint *""'"); } - arg1 = (struct blpapi_HighPrecisionDatetime_tag *)(argp1); + arg1 = (struct blpapi_TimePoint *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_UInt32_t) ((arg1)->picoseconds); + result = (blpapi_Int64_t) ((arg1)->d_value); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result)); + resultobj = SWIG_From_long_SS_long((long long)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_new_blpapi_HighPrecisionDatetime_tag(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_new_blpapi_TimePoint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct blpapi_HighPrecisionDatetime_tag *result = 0 ; + struct blpapi_TimePoint *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)":new_blpapi_HighPrecisionDatetime_tag")) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)":new_blpapi_TimePoint")) SWIG_fail; { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (struct blpapi_HighPrecisionDatetime_tag *)calloc(1, sizeof(struct blpapi_HighPrecisionDatetime_tag)); + result = (struct blpapi_TimePoint *)calloc(1, sizeof(struct blpapi_TimePoint)); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, SWIG_POINTER_NEW | 0 ); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_TimePoint, SWIG_POINTER_NEW | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_delete_blpapi_HighPrecisionDatetime_tag(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_delete_blpapi_TimePoint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct blpapi_HighPrecisionDatetime_tag *arg1 = (struct blpapi_HighPrecisionDatetime_tag *) 0 ; + struct blpapi_TimePoint *arg1 = (struct blpapi_TimePoint *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:delete_blpapi_HighPrecisionDatetime_tag",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, SWIG_POINTER_DISOWN | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:delete_blpapi_TimePoint",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TimePoint, SWIG_POINTER_DISOWN | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_blpapi_HighPrecisionDatetime_tag" "', argument " "1"" of type '" "struct blpapi_HighPrecisionDatetime_tag *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_blpapi_TimePoint" "', argument " "1"" of type '" "struct blpapi_TimePoint *""'"); } - arg1 = (struct blpapi_HighPrecisionDatetime_tag *)(argp1); + arg1 = (struct blpapi_TimePoint *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; free((char *) arg1); @@ -13331,895 +13860,832 @@ SWIGINTERN PyObject *_wrap_delete_blpapi_HighPrecisionDatetime_tag(PyObject *SWI } -SWIGINTERN PyObject *blpapi_HighPrecisionDatetime_tag_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *blpapi_TimePoint_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *obj; if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, SWIG_NewClientData(obj)); + SWIG_TypeNewClientData(SWIGTYPE_p_blpapi_TimePoint, SWIG_NewClientData(obj)); return SWIG_Py_Void(); } -SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_compare(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_TimePointUtil_nanosecondsBetween(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_HighPrecisionDatetime_t *arg1 = (blpapi_HighPrecisionDatetime_t *) 0 ; - blpapi_HighPrecisionDatetime_t *arg2 = (blpapi_HighPrecisionDatetime_t *) 0 ; + blpapi_TimePoint_t *arg1 = (blpapi_TimePoint_t *) 0 ; + blpapi_TimePoint_t *arg2 = (blpapi_TimePoint_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; - int result; + long long result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_HighPrecisionDatetime_compare",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TimePointUtil_nanosecondsBetween",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TimePoint, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_compare" "', argument " "1"" of type '" "blpapi_HighPrecisionDatetime_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TimePointUtil_nanosecondsBetween" "', argument " "1"" of type '" "blpapi_TimePoint_t const *""'"); } - arg1 = (blpapi_HighPrecisionDatetime_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); + arg1 = (blpapi_TimePoint_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_TimePoint, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_HighPrecisionDatetime_compare" "', argument " "2"" of type '" "blpapi_HighPrecisionDatetime_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_TimePointUtil_nanosecondsBetween" "', argument " "2"" of type '" "blpapi_TimePoint_t const *""'"); } - arg2 = (blpapi_HighPrecisionDatetime_t *)(argp2); + arg2 = (blpapi_TimePoint_t *)(argp2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_HighPrecisionDatetime_compare((struct blpapi_HighPrecisionDatetime_tag const *)arg1,(struct blpapi_HighPrecisionDatetime_tag const *)arg2); + result = (long long)blpapi_TimePointUtil_nanosecondsBetween((struct blpapi_TimePoint const *)arg1,(struct blpapi_TimePoint const *)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_From_long_SS_long((long long)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_print(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_parts_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_HighPrecisionDatetime_t *arg1 = (blpapi_HighPrecisionDatetime_t *) 0 ; - blpapi_StreamWriter_t arg2 ; - void *arg3 = (void *) 0 ; - int arg4 ; - int arg5 ; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; + blpapi_UChar_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 ; - int res2 = 0 ; - int res3 ; - int val4 ; - int ecode4 = 0 ; - int val5 ; - int ecode5 = 0 ; + unsigned char val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - int result; - if (!PyArg_ParseTuple(args,(char *)"OOOOO:blpapi_HighPrecisionDatetime_print",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_parts_set",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_print" "', argument " "1"" of type '" "blpapi_HighPrecisionDatetime_t const *""'"); - } - arg1 = (blpapi_HighPrecisionDatetime_t *)(argp1); - { - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_blpapi_StreamWriter_t, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_HighPrecisionDatetime_print" "', argument " "2"" of type '" "blpapi_StreamWriter_t""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "blpapi_HighPrecisionDatetime_print" "', argument " "2"" of type '" "blpapi_StreamWriter_t""'"); - } else { - arg2 = *((blpapi_StreamWriter_t *)(argp2)); - } - } - res3 = SWIG_ConvertPtr(obj2,SWIG_as_voidptrptr(&arg3), 0, 0); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_HighPrecisionDatetime_print" "', argument " "3"" of type '" "void *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_parts_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_HighPrecisionDatetime_print" "', argument " "4"" of type '" "int""'"); - } - arg4 = (int)(val4); - ecode5 = SWIG_AsVal_int(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_HighPrecisionDatetime_print" "', argument " "5"" of type '" "int""'"); + arg1 = (struct blpapi_Datetime_tag *)(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_parts_set" "', argument " "2"" of type '" "blpapi_UChar_t""'"); } - arg5 = (int)(val5); + arg2 = (blpapi_UChar_t)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_HighPrecisionDatetime_print((struct blpapi_HighPrecisionDatetime_tag const *)arg1,arg2,arg3,arg4,arg5); + if (arg1) (arg1)->parts = arg2; SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_fromTimePoint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_parts_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_HighPrecisionDatetime_t *arg1 = (blpapi_HighPrecisionDatetime_t *) 0 ; - blpapi_TimePoint_t *arg2 = (blpapi_TimePoint_t *) 0 ; - short arg3 ; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - blpapi_TimePoint_t temp2 ; - short val3 ; - int ecode3 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; + blpapi_UChar_t result; - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_HighPrecisionDatetime_fromTimePoint",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_parts_get",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_fromTimePoint" "', argument " "1"" of type '" "blpapi_HighPrecisionDatetime_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_parts_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } - arg1 = (blpapi_HighPrecisionDatetime_t *)(argp1); - ecode3 = SWIG_AsVal_short(obj1, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_HighPrecisionDatetime_fromTimePoint" "', argument " "3"" of type '" "short""'"); - } - arg3 = (short)(val3); + arg1 = (struct blpapi_Datetime_tag *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_HighPrecisionDatetime_fromTimePoint(arg1,(struct blpapi_TimePoint const *)arg2,arg3); + result = (blpapi_UChar_t) ((arg1)->parts); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); - { - blpapi_TimePoint_t *outputPtr = (blpapi_TimePoint_t *) malloc(sizeof(blpapi_TimePoint_t)); - *outputPtr = *arg2; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(outputPtr, SWIGTYPE_p_blpapi_TimePoint, SWIG_POINTER_OWN)); - } + resultobj = SWIG_From_unsigned_SS_char((unsigned char)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Constant_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_hours_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; + blpapi_UChar_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; + unsigned char val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; - blpapi_Name_t *result = 0 ; + PyObject * obj1 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_name",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_hours_set",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_name" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_hours_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } - arg1 = (blpapi_Constant_t *)(argp1); + arg1 = (struct blpapi_Datetime_tag *)(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_hours_set" "', argument " "2"" of type '" "blpapi_UChar_t""'"); + } + arg2 = (blpapi_UChar_t)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Name_t *)blpapi_Constant_name((struct blpapi_Constant const *)arg1); + if (arg1) (arg1)->hours = arg2; SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Constant_description(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_hours_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - char *result = 0 ; + blpapi_UChar_t result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_description",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_hours_get",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_description" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_hours_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } - arg1 = (blpapi_Constant_t *)(argp1); + arg1 = (struct blpapi_Datetime_tag *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_Constant_description((struct blpapi_Constant const *)arg1); + result = (blpapi_UChar_t) ((arg1)->hours); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_FromCharPtr((const char *)result); + resultobj = SWIG_From_unsigned_SS_char((unsigned char)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Constant_status(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_minutes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; + blpapi_UChar_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; + unsigned char val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; - int result; + PyObject * obj1 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_status",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_minutes_set",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_status" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_minutes_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } - arg1 = (blpapi_Constant_t *)(argp1); + arg1 = (struct blpapi_Datetime_tag *)(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_minutes_set" "', argument " "2"" of type '" "blpapi_UChar_t""'"); + } + arg2 = (blpapi_UChar_t)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Constant_status((struct blpapi_Constant const *)arg1); + if (arg1) (arg1)->minutes = arg2; SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Constant_datatype(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_minutes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - int result; + blpapi_UChar_t result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_datatype",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_minutes_get",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_datatype" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_minutes_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } - arg1 = (blpapi_Constant_t *)(argp1); + arg1 = (struct blpapi_Datetime_tag *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Constant_datatype((struct blpapi_Constant const *)arg1); + result = (blpapi_UChar_t) ((arg1)->minutes); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_From_unsigned_SS_char((unsigned char)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Constant_getValueAsInt64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_seconds_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; - blpapi_Int64_t *arg2 = (blpapi_Int64_t *) 0 ; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; + blpapi_UChar_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; - blpapi_Int64_t temp2 ; - int res2 = SWIG_TMPOBJ ; + unsigned char val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; - int result; + PyObject * obj1 = 0 ; - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_getValueAsInt64",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_seconds_set",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_getValueAsInt64" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_seconds_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } - arg1 = (blpapi_Constant_t *)(argp1); + arg1 = (struct blpapi_Datetime_tag *)(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_seconds_set" "', argument " "2"" of type '" "blpapi_UChar_t""'"); + } + arg2 = (blpapi_UChar_t)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Constant_getValueAsInt64((struct blpapi_Constant const *)arg1,arg2); + if (arg1) (arg1)->seconds = arg2; SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); - if (SWIG_IsTmpObj(res2)) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_long_SS_long((*arg2))); - } else { - int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_long_long, new_flags)); - } + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Constant_getValueAsFloat64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_seconds_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; - blpapi_Float64_t *arg2 = (blpapi_Float64_t *) 0 ; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - blpapi_Float64_t temp2 ; - int res2 = SWIG_TMPOBJ ; PyObject * obj0 = 0 ; - int result; + blpapi_UChar_t result; - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_getValueAsFloat64",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_seconds_get",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_getValueAsFloat64" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_seconds_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } - arg1 = (blpapi_Constant_t *)(argp1); + arg1 = (struct blpapi_Datetime_tag *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Constant_getValueAsFloat64((struct blpapi_Constant const *)arg1,arg2); + result = (blpapi_UChar_t) ((arg1)->seconds); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); - if (SWIG_IsTmpObj(res2)) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_double((*arg2))); - } else { - int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_double, new_flags)); - } + resultobj = SWIG_From_unsigned_SS_char((unsigned char)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Constant_getValueAsDatetime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_milliSeconds_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; - blpapi_Datetime_t *arg2 = (blpapi_Datetime_t *) 0 ; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; + blpapi_UInt16_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; - blpapi_Datetime_t temp2 ; + unsigned short val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; - int result; + PyObject * obj1 = 0 ; - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_getValueAsDatetime",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_milliSeconds_set",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_getValueAsDatetime" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_milliSeconds_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } - arg1 = (blpapi_Constant_t *)(argp1); + arg1 = (struct blpapi_Datetime_tag *)(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_short(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_milliSeconds_set" "', argument " "2"" of type '" "blpapi_UInt16_t""'"); + } + arg2 = (blpapi_UInt16_t)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Constant_getValueAsDatetime((struct blpapi_Constant const *)arg1,arg2); + if (arg1) (arg1)->milliSeconds = arg2; SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); - { - blpapi_Datetime_t *outputPtr = (blpapi_Datetime_t *) malloc(sizeof(blpapi_Datetime_t)); - *outputPtr = *arg2; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(outputPtr, SWIGTYPE_p_blpapi_Datetime_tag, SWIG_POINTER_OWN)); - } + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Constant_getValueAsString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_milliSeconds_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; - char **arg2 = (char **) 0 ; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - char *temp2 = 0 ; PyObject * obj0 = 0 ; - int result; + blpapi_UInt16_t result; - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_getValueAsString",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_milliSeconds_get",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_getValueAsString" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_milliSeconds_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } - arg1 = (blpapi_Constant_t *)(argp1); + arg1 = (struct blpapi_Datetime_tag *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Constant_getValueAsString((struct blpapi_Constant const *)arg1,(char const **)arg2); + result = (blpapi_UInt16_t) ((arg1)->milliSeconds); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); + resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_ConstantList_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_month_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_ConstantList_t *arg1 = (blpapi_ConstantList_t *) 0 ; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; + blpapi_UChar_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; + unsigned char val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; - blpapi_Name_t *result = 0 ; + PyObject * obj1 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ConstantList_name",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_month_set",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_name" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_month_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } - arg1 = (blpapi_ConstantList_t *)(argp1); + arg1 = (struct blpapi_Datetime_tag *)(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_month_set" "', argument " "2"" of type '" "blpapi_UChar_t""'"); + } + arg2 = (blpapi_UChar_t)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Name_t *)blpapi_ConstantList_name((struct blpapi_ConstantList const *)arg1); + if (arg1) (arg1)->month = arg2; SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_ConstantList_description(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_month_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_ConstantList_t *arg1 = (blpapi_ConstantList_t *) 0 ; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - char *result = 0 ; + blpapi_UChar_t result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ConstantList_description",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_month_get",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_description" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_month_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } - arg1 = (blpapi_ConstantList_t *)(argp1); + arg1 = (struct blpapi_Datetime_tag *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_ConstantList_description((struct blpapi_ConstantList const *)arg1); + result = (blpapi_UChar_t) ((arg1)->month); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_FromCharPtr((const char *)result); + resultobj = SWIG_From_unsigned_SS_char((unsigned char)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_ConstantList_numConstants(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_day_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_ConstantList_t *arg1 = (blpapi_ConstantList_t *) 0 ; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; + blpapi_UChar_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; + unsigned char val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; - int result; + PyObject * obj1 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ConstantList_numConstants",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_day_set",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_numConstants" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_day_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } - arg1 = (blpapi_ConstantList_t *)(argp1); + arg1 = (struct blpapi_Datetime_tag *)(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_day_set" "', argument " "2"" of type '" "blpapi_UChar_t""'"); + } + arg2 = (blpapi_UChar_t)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ConstantList_numConstants((struct blpapi_ConstantList const *)arg1); + if (arg1) (arg1)->day = arg2; SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_ConstantList_datatype(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_day_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_ConstantList_t *arg1 = (blpapi_ConstantList_t *) 0 ; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - int result; + blpapi_UChar_t result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ConstantList_datatype",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_day_get",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_datatype" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_day_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } - arg1 = (blpapi_ConstantList_t *)(argp1); + arg1 = (struct blpapi_Datetime_tag *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ConstantList_datatype((struct blpapi_ConstantList const *)arg1); + result = (blpapi_UChar_t) ((arg1)->day); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_From_unsigned_SS_char((unsigned char)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_ConstantList_status(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_year_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_ConstantList_t *arg1 = (blpapi_ConstantList_t *) 0 ; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; + blpapi_UInt16_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; + unsigned short val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; - int result; + PyObject * obj1 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ConstantList_status",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_year_set",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_status" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_year_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } - arg1 = (blpapi_ConstantList_t *)(argp1); + arg1 = (struct blpapi_Datetime_tag *)(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_short(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_year_set" "', argument " "2"" of type '" "blpapi_UInt16_t""'"); + } + arg2 = (blpapi_UInt16_t)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ConstantList_status((struct blpapi_ConstantList const *)arg1); + if (arg1) (arg1)->year = arg2; SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_ConstantList_getConstant(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_year_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_ConstantList_t *arg1 = (blpapi_ConstantList_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - blpapi_Constant_t *result = 0 ; + blpapi_UInt16_t result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_ConstantList_getConstant",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_year_get",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_getConstant" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); - } - arg1 = (blpapi_ConstantList_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ConstantList_getConstant" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ConstantList_getConstant" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_year_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } - arg3 = (blpapi_Name_t *)(argp3); + arg1 = (struct blpapi_Datetime_tag *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Constant_t *)blpapi_ConstantList_getConstant((struct blpapi_ConstantList const *)arg1,(char const *)arg2,(struct blpapi_Name const *)arg3); + result = (blpapi_UInt16_t) ((arg1)->year); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Constant, 0 | 0 ); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_ConstantList_getConstantAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_offset_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_ConstantList_t *arg1 = (blpapi_ConstantList_t *) 0 ; - size_t arg2 ; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; + blpapi_Int16_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; - size_t val2 ; + short val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; - blpapi_Constant_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ConstantList_getConstantAt",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_offset_set",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_getConstantAt" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_offset_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } - arg1 = (blpapi_ConstantList_t *)(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); + arg1 = (struct blpapi_Datetime_tag *)(argp1); + ecode2 = SWIG_AsVal_short(obj1, &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_ConstantList_getConstantAt" "', argument " "2"" of type '" "size_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_offset_set" "', argument " "2"" of type '" "blpapi_Int16_t""'"); } - arg2 = (size_t)(val2); + arg2 = (blpapi_Int16_t)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Constant_t *)blpapi_ConstantList_getConstantAt((struct blpapi_ConstantList const *)arg1,arg2); + if (arg1) (arg1)->offset = arg2; SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Constant, 0 | 0 ); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_offset_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - blpapi_Name_t *result = 0 ; + blpapi_Int16_t result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaElementDefinition_name",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_offset_get",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_name" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_offset_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } - arg1 = (blpapi_SchemaElementDefinition_t *)(argp1); + arg1 = (struct blpapi_Datetime_tag *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Name_t *)blpapi_SchemaElementDefinition_name((struct blpapi_SchemaElementDefinition const *)arg1); + result = (blpapi_Int16_t) ((arg1)->offset); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); + resultobj = SWIG_From_short((short)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_description(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_new_blpapi_Datetime_tag(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - char *result = 0 ; + struct blpapi_Datetime_tag *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaElementDefinition_description",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_description" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); - } - arg1 = (blpapi_SchemaElementDefinition_t *)(argp1); + if (!PyArg_ParseTuple(args,(char *)":new_blpapi_Datetime_tag")) SWIG_fail; { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_SchemaElementDefinition_description((struct blpapi_SchemaElementDefinition const *)arg1); + result = (struct blpapi_Datetime_tag *)calloc(1, sizeof(struct blpapi_Datetime_tag)); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_FromCharPtr((const char *)result); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Datetime_tag, SWIG_POINTER_NEW | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_status(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_delete_blpapi_Datetime_tag(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaElementDefinition_status",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:delete_blpapi_Datetime_tag",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, SWIG_POINTER_DISOWN | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_status" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_blpapi_Datetime_tag" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } - arg1 = (blpapi_SchemaElementDefinition_t *)(argp1); + arg1 = (struct blpapi_Datetime_tag *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SchemaElementDefinition_status((struct blpapi_SchemaElementDefinition const *)arg1); + free((char *) arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_type(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *blpapi_Datetime_tag_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *obj; + if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_blpapi_Datetime_tag, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_tag_datetime_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; + struct blpapi_HighPrecisionDatetime_tag *arg1 = (struct blpapi_HighPrecisionDatetime_tag *) 0 ; + blpapi_Datetime_t *arg2 = (blpapi_Datetime_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; PyObject * obj0 = 0 ; - blpapi_SchemaTypeDefinition_t *result = 0 ; + PyObject * obj1 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaElementDefinition_type",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_HighPrecisionDatetime_tag_datetime_set",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_type" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_tag_datetime_set" "', argument " "1"" of type '" "struct blpapi_HighPrecisionDatetime_tag *""'"); } - arg1 = (blpapi_SchemaElementDefinition_t *)(argp1); + arg1 = (struct blpapi_HighPrecisionDatetime_tag *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_HighPrecisionDatetime_tag_datetime_set" "', argument " "2"" of type '" "blpapi_Datetime_t *""'"); + } + arg2 = (blpapi_Datetime_t *)(argp2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_SchemaTypeDefinition_t *)blpapi_SchemaElementDefinition_type((struct blpapi_SchemaElementDefinition const *)arg1); + if (arg1) (arg1)->datetime = *arg2; SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_void, 0 | 0 ); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_numAlternateNames(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_tag_datetime_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; + struct blpapi_HighPrecisionDatetime_tag *arg1 = (struct blpapi_HighPrecisionDatetime_tag *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - size_t result; + blpapi_Datetime_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaElementDefinition_numAlternateNames",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_HighPrecisionDatetime_tag_datetime_get",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_numAlternateNames" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_tag_datetime_get" "', argument " "1"" of type '" "struct blpapi_HighPrecisionDatetime_tag *""'"); } - arg1 = (blpapi_SchemaElementDefinition_t *)(argp1); + arg1 = (struct blpapi_HighPrecisionDatetime_tag *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = blpapi_SchemaElementDefinition_numAlternateNames((struct blpapi_SchemaElementDefinition const *)arg1); + result = (blpapi_Datetime_t *)& ((arg1)->datetime); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_size_t((size_t)(result)); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_getAlternateName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_tag_picoseconds_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; - size_t arg2 ; + struct blpapi_HighPrecisionDatetime_tag *arg1 = (struct blpapi_HighPrecisionDatetime_tag *) 0 ; + blpapi_UInt32_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; - size_t val2 ; + unsigned int val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; - blpapi_Name_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SchemaElementDefinition_getAlternateName",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_HighPrecisionDatetime_tag_picoseconds_set",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_getAlternateName" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_tag_picoseconds_set" "', argument " "1"" of type '" "struct blpapi_HighPrecisionDatetime_tag *""'"); } - arg1 = (blpapi_SchemaElementDefinition_t *)(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); + arg1 = (struct blpapi_HighPrecisionDatetime_tag *)(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SchemaElementDefinition_getAlternateName" "', argument " "2"" of type '" "size_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_HighPrecisionDatetime_tag_picoseconds_set" "', argument " "2"" of type '" "blpapi_UInt32_t""'"); } - arg2 = (size_t)(val2); + arg2 = (blpapi_UInt32_t)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Name_t *)blpapi_SchemaElementDefinition_getAlternateName((struct blpapi_SchemaElementDefinition const *)arg1,arg2); + if (arg1) (arg1)->picoseconds = arg2; SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_minValues(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_tag_picoseconds_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; + struct blpapi_HighPrecisionDatetime_tag *arg1 = (struct blpapi_HighPrecisionDatetime_tag *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - size_t result; + blpapi_UInt32_t result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaElementDefinition_minValues",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_HighPrecisionDatetime_tag_picoseconds_get",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_minValues" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_tag_picoseconds_get" "', argument " "1"" of type '" "struct blpapi_HighPrecisionDatetime_tag *""'"); } - arg1 = (blpapi_SchemaElementDefinition_t *)(argp1); + arg1 = (struct blpapi_HighPrecisionDatetime_tag *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = blpapi_SchemaElementDefinition_minValues((struct blpapi_SchemaElementDefinition const *)arg1); + result = (blpapi_UInt32_t) ((arg1)->picoseconds); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_size_t((size_t)(result)); + resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_maxValues(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_new_blpapi_HighPrecisionDatetime_tag(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; + struct blpapi_HighPrecisionDatetime_tag *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaElementDefinition_maxValues",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_maxValues" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); - } - arg1 = (blpapi_SchemaElementDefinition_t *)(argp1); + if (!PyArg_ParseTuple(args,(char *)":new_blpapi_HighPrecisionDatetime_tag")) SWIG_fail; { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = blpapi_SchemaElementDefinition_maxValues((struct blpapi_SchemaElementDefinition const *)arg1); + result = (struct blpapi_HighPrecisionDatetime_tag *)calloc(1, sizeof(struct blpapi_HighPrecisionDatetime_tag)); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_size_t((size_t)(result)); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, SWIG_POINTER_NEW | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_delete_blpapi_HighPrecisionDatetime_tag(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; + struct blpapi_HighPrecisionDatetime_tag *arg1 = (struct blpapi_HighPrecisionDatetime_tag *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - blpapi_Name_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_name",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:delete_blpapi_HighPrecisionDatetime_tag",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, SWIG_POINTER_DISOWN | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_name" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_blpapi_HighPrecisionDatetime_tag" "', argument " "1"" of type '" "struct blpapi_HighPrecisionDatetime_tag *""'"); } - arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); + arg1 = (struct blpapi_HighPrecisionDatetime_tag *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Name_t *)blpapi_SchemaTypeDefinition_name((void *const *)arg1); + free((char *) arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_description(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - char *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_description",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_description" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); - } - arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_SchemaTypeDefinition_description((void *const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; +SWIGINTERN PyObject *blpapi_HighPrecisionDatetime_tag_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *obj; + if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); } - -SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_status(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_compare(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; + blpapi_HighPrecisionDatetime_t *arg1 = (blpapi_HighPrecisionDatetime_t *) 0 ; + blpapi_HighPrecisionDatetime_t *arg2 = (blpapi_HighPrecisionDatetime_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_status",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_HighPrecisionDatetime_compare",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_status" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_compare" "', argument " "1"" of type '" "blpapi_HighPrecisionDatetime_t const *""'"); } - arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); + arg1 = (blpapi_HighPrecisionDatetime_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_HighPrecisionDatetime_compare" "', argument " "2"" of type '" "blpapi_HighPrecisionDatetime_t const *""'"); + } + arg2 = (blpapi_HighPrecisionDatetime_t *)(argp2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SchemaTypeDefinition_status((void *const *)arg1); + result = (int)blpapi_HighPrecisionDatetime_compare((struct blpapi_HighPrecisionDatetime_tag const *)arg1,(struct blpapi_HighPrecisionDatetime_tag const *)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); @@ -14229,398 +14695,500 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_status(PyObject *SWIGUNUS } -SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_datatype(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_print(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; + blpapi_HighPrecisionDatetime_t *arg1 = (blpapi_HighPrecisionDatetime_t *) 0 ; + blpapi_StreamWriter_t arg2 ; + void *arg3 = (void *) 0 ; + int arg4 ; + int arg5 ; void *argp1 = 0 ; int res1 = 0 ; + void *argp2 ; + int res2 = 0 ; + int res3 ; + int val4 ; + int ecode4 = 0 ; + int val5 ; + int ecode5 = 0 ; PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_datatype",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OOOOO:blpapi_HighPrecisionDatetime_print",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_datatype" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_print" "', argument " "1"" of type '" "blpapi_HighPrecisionDatetime_t const *""'"); } - arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); + arg1 = (blpapi_HighPrecisionDatetime_t *)(argp1); { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SchemaTypeDefinition_datatype((void *const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); + res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_blpapi_StreamWriter_t, 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_HighPrecisionDatetime_print" "', argument " "2"" of type '" "blpapi_StreamWriter_t""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "blpapi_HighPrecisionDatetime_print" "', argument " "2"" of type '" "blpapi_StreamWriter_t""'"); + } else { + arg2 = *((blpapi_StreamWriter_t *)(argp2)); + } + } + res3 = SWIG_ConvertPtr(obj2,SWIG_as_voidptrptr(&arg3), 0, 0); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_HighPrecisionDatetime_print" "', argument " "3"" of type '" "void *""'"); + } + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_HighPrecisionDatetime_print" "', argument " "4"" of type '" "int""'"); + } + arg4 = (int)(val4); + ecode5 = SWIG_AsVal_int(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_HighPrecisionDatetime_print" "', argument " "5"" of type '" "int""'"); + } + arg5 = (int)(val5); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_HighPrecisionDatetime_print((struct blpapi_HighPrecisionDatetime_tag const *)arg1,arg2,arg3,arg4,arg5); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_isComplexType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_fromTimePoint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; + blpapi_HighPrecisionDatetime_t *arg1 = (blpapi_HighPrecisionDatetime_t *) 0 ; + blpapi_TimePoint_t *arg2 = (blpapi_TimePoint_t *) 0 ; + short arg3 ; void *argp1 = 0 ; int res1 = 0 ; + blpapi_TimePoint_t temp2 ; + short val3 ; + int ecode3 = 0 ; PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_isComplexType",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_HighPrecisionDatetime_fromTimePoint",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_isComplexType" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_fromTimePoint" "', argument " "1"" of type '" "blpapi_HighPrecisionDatetime_t *""'"); } - arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); + arg1 = (blpapi_HighPrecisionDatetime_t *)(argp1); + ecode3 = SWIG_AsVal_short(obj1, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_HighPrecisionDatetime_fromTimePoint" "', argument " "3"" of type '" "short""'"); + } + arg3 = (short)(val3); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SchemaTypeDefinition_isComplexType((void *const *)arg1); + result = (int)blpapi_HighPrecisionDatetime_fromTimePoint(arg1,(struct blpapi_TimePoint const *)arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); + { + blpapi_TimePoint_t *outputPtr = (blpapi_TimePoint_t *) malloc(sizeof(blpapi_TimePoint_t)); + *outputPtr = *arg2; + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(outputPtr, SWIGTYPE_p_blpapi_TimePoint, SWIG_POINTER_OWN)); + } return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_isSimpleType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Constant_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; + blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - int result; + blpapi_Name_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_isSimpleType",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_name",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_isSimpleType" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_name" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); } - arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); + arg1 = (blpapi_Constant_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SchemaTypeDefinition_isSimpleType((void *const *)arg1); + result = (blpapi_Name_t *)blpapi_Constant_name((struct blpapi_Constant const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_isEnumerationType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Constant_description(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; + blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - int result; + char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_isEnumerationType",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_description",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_isEnumerationType" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_description" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); } - arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); + arg1 = (blpapi_Constant_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SchemaTypeDefinition_isEnumerationType((void *const *)arg1); + result = (char *)blpapi_Constant_description((struct blpapi_Constant const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_numElementDefinitions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Constant_status(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; + blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - size_t result; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_numElementDefinitions",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_status",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_numElementDefinitions" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_status" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); } - arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); + arg1 = (blpapi_Constant_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = blpapi_SchemaTypeDefinition_numElementDefinitions((void *const *)arg1); + result = (int)blpapi_Constant_status((struct blpapi_Constant const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_size_t((size_t)(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_getElementDefinition(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Constant_datatype(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; + blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - blpapi_SchemaElementDefinition_t *result = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_SchemaTypeDefinition_getElementDefinition",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_datatype",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_getElementDefinition" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); - } - arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SchemaTypeDefinition_getElementDefinition" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_SchemaTypeDefinition_getElementDefinition" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_datatype" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); } - arg3 = (blpapi_Name_t *)(argp3); + arg1 = (blpapi_Constant_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_SchemaElementDefinition_t *)blpapi_SchemaTypeDefinition_getElementDefinition((void *const *)arg1,(char const *)arg2,(struct blpapi_Name const *)arg3); + result = (int)blpapi_Constant_datatype((struct blpapi_Constant const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_getElementDefinitionAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Constant_getValueAsChar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; - size_t arg2 ; + blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; + blpapi_Char_t *arg2 = (blpapi_Char_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; + blpapi_Char_t temp2 ; + int res2 = SWIG_TMPOBJ ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - blpapi_SchemaElementDefinition_t *result = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SchemaTypeDefinition_getElementDefinitionAt",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_getValueAsChar",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_getElementDefinitionAt" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_getValueAsChar" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); } - arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SchemaTypeDefinition_getElementDefinitionAt" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = (size_t)(val2); + arg1 = (blpapi_Constant_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_SchemaElementDefinition_t *)blpapi_SchemaTypeDefinition_getElementDefinitionAt((void *const *)arg1,arg2); + result = (int)blpapi_Constant_getValueAsChar((struct blpapi_Constant const *)arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); + resultobj = SWIG_From_int((int)(result)); + if (SWIG_IsTmpObj(res2)) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_char((*arg2))); + } else { + int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_char, new_flags)); + } return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_enumeration(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Constant_getValueAsInt32(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; + blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; + blpapi_Int32_t *arg2 = (blpapi_Int32_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; + int temp2 ; PyObject * obj0 = 0 ; - blpapi_ConstantList_t *result = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_enumeration",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_getValueAsInt32",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_enumeration" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_getValueAsInt32" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); } - arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); + arg1 = (blpapi_Constant_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_ConstantList_t *)blpapi_SchemaTypeDefinition_enumeration((void *const *)arg1); + result = (int)blpapi_Constant_getValueAsInt32((struct blpapi_Constant const *)arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, PyInt_FromLong(*arg2)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Request_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Constant_getValueAsInt64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Request_t *arg1 = (blpapi_Request_t *) 0 ; + blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; + blpapi_Int64_t *arg2 = (blpapi_Int64_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; + blpapi_Int64_t temp2 ; + int res2 = SWIG_TMPOBJ ; PyObject * obj0 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Request_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Request, 0 | 0 ); + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_getValueAsInt64",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Request_destroy" "', argument " "1"" of type '" "blpapi_Request_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_getValueAsInt64" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); } - arg1 = (blpapi_Request_t *)(argp1); + arg1 = (blpapi_Constant_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_Request_destroy(arg1); + result = (int)blpapi_Constant_getValueAsInt64((struct blpapi_Constant const *)arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_Py_Void(); + resultobj = SWIG_From_int((int)(result)); + if (SWIG_IsTmpObj(res2)) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_long_SS_long((*arg2))); + } else { + int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_long_long, new_flags)); + } return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Request_elements(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Constant_getValueAsFloat32(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Request_t *arg1 = (blpapi_Request_t *) 0 ; + blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; + blpapi_Float32_t *arg2 = (blpapi_Float32_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; + blpapi_Float32_t temp2 ; + int res2 = SWIG_TMPOBJ ; PyObject * obj0 = 0 ; - blpapi_Element_t *result = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Request_elements",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Request, 0 | 0 ); + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_getValueAsFloat32",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Request_elements" "', argument " "1"" of type '" "blpapi_Request_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_getValueAsFloat32" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); } - arg1 = (blpapi_Request_t *)(argp1); + arg1 = (blpapi_Constant_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Element_t *)blpapi_Request_elements(arg1); + result = (int)blpapi_Constant_getValueAsFloat32((struct blpapi_Constant const *)arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Element, 0 | 0 ); + resultobj = SWIG_From_int((int)(result)); + if (SWIG_IsTmpObj(res2)) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_float((*arg2))); + } else { + int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_float, new_flags)); + } return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Request_setPreferredRoute(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Constant_getValueAsFloat64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Request_t *arg1 = (blpapi_Request_t *) 0 ; - blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; + blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; + blpapi_Float64_t *arg2 = (blpapi_Float64_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; + blpapi_Float64_t temp2 ; + int res2 = SWIG_TMPOBJ ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Request_setPreferredRoute",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Request, 0 | 0 ); + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_getValueAsFloat64",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Request_setPreferredRoute" "', argument " "1"" of type '" "blpapi_Request_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_getValueAsFloat64" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); } - arg1 = (blpapi_Request_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Request_setPreferredRoute" "', argument " "2"" of type '" "blpapi_CorrelationId_t *""'"); + arg1 = (blpapi_Constant_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Constant_getValueAsFloat64((struct blpapi_Constant const *)arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; } - arg2 = (blpapi_CorrelationId_t *)(argp2); + resultobj = SWIG_From_int((int)(result)); + if (SWIG_IsTmpObj(res2)) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_double((*arg2))); + } else { + int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_double, new_flags)); + } + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Constant_getValueAsDatetime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; + blpapi_Datetime_t *arg2 = (blpapi_Datetime_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_Datetime_t temp2 ; + PyObject * obj0 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_getValueAsDatetime",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_getValueAsDatetime" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); + } + arg1 = (blpapi_Constant_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_Request_setPreferredRoute(arg1,arg2); + result = (int)blpapi_Constant_getValueAsDatetime((struct blpapi_Constant const *)arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_Py_Void(); + resultobj = SWIG_From_int((int)(result)); + { + blpapi_Datetime_t *outputPtr = (blpapi_Datetime_t *) malloc(sizeof(blpapi_Datetime_t)); + *outputPtr = *arg2; + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(outputPtr, SWIGTYPE_p_blpapi_Datetime_tag, SWIG_POINTER_OWN)); + } return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_RequestTemplate_release(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Constant_getValueAsString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_RequestTemplate_t *arg1 = (blpapi_RequestTemplate_t *) 0 ; + blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; + char **arg2 = (char **) 0 ; void *argp1 = 0 ; int res1 = 0 ; + char *temp2 = 0 ; PyObject * obj0 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_RequestTemplate_release",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_RequestTemplate, 0 | 0 ); + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_getValueAsString",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_RequestTemplate_release" "', argument " "1"" of type '" "blpapi_RequestTemplate_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_getValueAsString" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); } - arg1 = (blpapi_RequestTemplate_t *)(argp1); + arg1 = (blpapi_Constant_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_RequestTemplate_release((struct blpapi_RequestTemplate const *)arg1); + result = (int)blpapi_Constant_getValueAsString((struct blpapi_Constant const *)arg1,(char const **)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Operation_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_ConstantList_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Operation_t *arg1 = (blpapi_Operation_t *) 0 ; + blpapi_ConstantList_t *arg1 = (blpapi_ConstantList_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - char *result = 0 ; + blpapi_Name_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Operation_name",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Operation, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ConstantList_name",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Operation_name" "', argument " "1"" of type '" "blpapi_Operation_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_name" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); } - arg1 = (blpapi_Operation_t *)(argp1); + arg1 = (blpapi_ConstantList_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_Operation_name(arg1); + result = (blpapi_Name_t *)blpapi_ConstantList_name((struct blpapi_ConstantList const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_FromCharPtr((const char *)result); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Operation_description(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_ConstantList_description(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Operation_t *arg1 = (blpapi_Operation_t *) 0 ; + blpapi_ConstantList_t *arg1 = (blpapi_ConstantList_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Operation_description",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Operation, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ConstantList_description",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Operation_description" "', argument " "1"" of type '" "blpapi_Operation_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_description" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); } - arg1 = (blpapi_Operation_t *)(argp1); + arg1 = (blpapi_ConstantList_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_Operation_description(arg1); + result = (char *)blpapi_ConstantList_description((struct blpapi_ConstantList const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_FromCharPtr((const char *)result); @@ -14630,53 +15198,49 @@ SWIGINTERN PyObject *_wrap_blpapi_Operation_description(PyObject *SWIGUNUSEDPARM } -SWIGINTERN PyObject *_wrap_blpapi_Operation_requestDefinition(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_ConstantList_numConstants(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Operation_t *arg1 = (blpapi_Operation_t *) 0 ; - blpapi_SchemaElementDefinition_t **arg2 = (blpapi_SchemaElementDefinition_t **) 0 ; + blpapi_ConstantList_t *arg1 = (blpapi_ConstantList_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - blpapi_SchemaElementDefinition_t *temp2 = 0 ; PyObject * obj0 = 0 ; int result; - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Operation_requestDefinition",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Operation, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ConstantList_numConstants",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Operation_requestDefinition" "', argument " "1"" of type '" "blpapi_Operation_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_numConstants" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); } - arg1 = (blpapi_Operation_t *)(argp1); + arg1 = (blpapi_ConstantList_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Operation_requestDefinition(arg1,arg2); + result = (int)blpapi_ConstantList_numConstants((struct blpapi_ConstantList const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_SchemaElementDefinition, 0)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Operation_numResponseDefinitions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_ConstantList_datatype(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Operation_t *arg1 = (blpapi_Operation_t *) 0 ; + blpapi_ConstantList_t *arg1 = (blpapi_ConstantList_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Operation_numResponseDefinitions",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Operation, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ConstantList_datatype",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Operation_numResponseDefinitions" "', argument " "1"" of type '" "blpapi_Operation_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_datatype" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); } - arg1 = (blpapi_Operation_t *)(argp1); + arg1 = (blpapi_ConstantList_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Operation_numResponseDefinitions(arg1); + result = (int)blpapi_ConstantList_datatype((struct blpapi_ConstantList const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); @@ -14686,179 +15250,183 @@ SWIGINTERN PyObject *_wrap_blpapi_Operation_numResponseDefinitions(PyObject *SWI } -SWIGINTERN PyObject *_wrap_blpapi_Operation_responseDefinition(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_ConstantList_status(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Operation_t *arg1 = (blpapi_Operation_t *) 0 ; - blpapi_SchemaElementDefinition_t **arg2 = (blpapi_SchemaElementDefinition_t **) 0 ; - size_t arg3 ; + blpapi_ConstantList_t *arg1 = (blpapi_ConstantList_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - blpapi_SchemaElementDefinition_t *temp2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; int result; - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Operation_responseDefinition",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Operation, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ConstantList_status",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Operation_responseDefinition" "', argument " "1"" of type '" "blpapi_Operation_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_status" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); } - arg1 = (blpapi_Operation_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Operation_responseDefinition" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); + arg1 = (blpapi_ConstantList_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Operation_responseDefinition(arg1,arg2,arg3); + result = (int)blpapi_ConstantList_status((struct blpapi_ConstantList const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_SchemaElementDefinition, 0)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Operation_responseDefinitionFromName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_ConstantList_getConstant(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Operation_t *arg1 = (blpapi_Operation_t *) 0 ; - blpapi_SchemaElementDefinition_t **arg2 = (blpapi_SchemaElementDefinition_t **) 0 ; + blpapi_ConstantList_t *arg1 = (blpapi_ConstantList_t *) 0 ; + char *arg2 = (char *) 0 ; blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - blpapi_SchemaElementDefinition_t *temp2 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; - int result; + PyObject * obj2 = 0 ; + blpapi_Constant_t *result = 0 ; - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Operation_responseDefinitionFromName",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Operation, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_ConstantList_getConstant",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Operation_responseDefinitionFromName" "', argument " "1"" of type '" "blpapi_Operation_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_getConstant" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); } - arg1 = (blpapi_Operation_t *)(argp1); - res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + arg1 = (blpapi_ConstantList_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ConstantList_getConstant" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Operation_responseDefinitionFromName" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ConstantList_getConstant" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); } arg3 = (blpapi_Name_t *)(argp3); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Operation_responseDefinitionFromName(arg1,arg2,(struct blpapi_Name const *)arg3); + result = (blpapi_Constant_t *)blpapi_ConstantList_getConstant((struct blpapi_ConstantList const *)arg1,(char const *)arg2,(struct blpapi_Name const *)arg3); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_SchemaElementDefinition, 0)); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Constant, 0 | 0 ); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Service_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_ConstantList_getConstantAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; + blpapi_ConstantList_t *arg1 = (blpapi_ConstantList_t *) 0 ; + size_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; - char *result = 0 ; + PyObject * obj1 = 0 ; + blpapi_Constant_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_name",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ConstantList_getConstantAt",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_name" "', argument " "1"" of type '" "blpapi_Service_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_getConstantAt" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); } - arg1 = (blpapi_Service_t *)(argp1); + arg1 = (blpapi_ConstantList_t *)(argp1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_ConstantList_getConstantAt" "', argument " "2"" of type '" "size_t""'"); + } + arg2 = (size_t)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_Service_name(arg1); + result = (blpapi_Constant_t *)blpapi_ConstantList_getConstantAt((struct blpapi_ConstantList const *)arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_FromCharPtr((const char *)result); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Constant, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Service_description(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; + blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - char *result = 0 ; + blpapi_Name_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_description",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaElementDefinition_name",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_description" "', argument " "1"" of type '" "blpapi_Service_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_name" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); } - arg1 = (blpapi_Service_t *)(argp1); + arg1 = (blpapi_SchemaElementDefinition_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_Service_description(arg1); + result = (blpapi_Name_t *)blpapi_SchemaElementDefinition_name((struct blpapi_SchemaElementDefinition const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_FromCharPtr((const char *)result); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Service_numOperations(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_description(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; + blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - int result; + char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_numOperations",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaElementDefinition_description",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_numOperations" "', argument " "1"" of type '" "blpapi_Service_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_description" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); } - arg1 = (blpapi_Service_t *)(argp1); + arg1 = (blpapi_SchemaElementDefinition_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Service_numOperations(arg1); + result = (char *)blpapi_SchemaElementDefinition_description((struct blpapi_SchemaElementDefinition const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Service_numEventDefinitions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_status(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; + blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_numEventDefinitions",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaElementDefinition_status",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_numEventDefinitions" "', argument " "1"" of type '" "blpapi_Service_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_status" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); } - arg1 = (blpapi_Service_t *)(argp1); + arg1 = (blpapi_SchemaElementDefinition_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Service_numEventDefinitions(arg1); + result = (int)blpapi_SchemaElementDefinition_status((struct blpapi_SchemaElementDefinition const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); @@ -14868,604 +15436,503 @@ SWIGINTERN PyObject *_wrap_blpapi_Service_numEventDefinitions(PyObject *SWIGUNUS } -SWIGINTERN PyObject *_wrap_blpapi_Service_addRef(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_type(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; + blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - int result; + blpapi_SchemaTypeDefinition_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_addRef",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaElementDefinition_type",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_addRef" "', argument " "1"" of type '" "blpapi_Service_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_type" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); } - arg1 = (blpapi_Service_t *)(argp1); + arg1 = (blpapi_SchemaElementDefinition_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Service_addRef(arg1); + result = (blpapi_SchemaTypeDefinition_t *)blpapi_SchemaElementDefinition_type((struct blpapi_SchemaElementDefinition const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_void, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Service_release(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_numAlternateNames(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; + blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; + size_t result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_release",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaElementDefinition_numAlternateNames",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_release" "', argument " "1"" of type '" "blpapi_Service_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_numAlternateNames" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); } - arg1 = (blpapi_Service_t *)(argp1); + arg1 = (blpapi_SchemaElementDefinition_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_Service_release(arg1); + result = blpapi_SchemaElementDefinition_numAlternateNames((struct blpapi_SchemaElementDefinition const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_Py_Void(); + resultobj = SWIG_From_size_t((size_t)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Service_authorizationServiceName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_getAlternateName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; + blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; + size_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; - char *result = 0 ; + PyObject * obj1 = 0 ; + blpapi_Name_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_authorizationServiceName",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SchemaElementDefinition_getAlternateName",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_authorizationServiceName" "', argument " "1"" of type '" "blpapi_Service_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_getAlternateName" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); } - arg1 = (blpapi_Service_t *)(argp1); + arg1 = (blpapi_SchemaElementDefinition_t *)(argp1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SchemaElementDefinition_getAlternateName" "', argument " "2"" of type '" "size_t""'"); + } + arg2 = (size_t)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_Service_authorizationServiceName(arg1); + result = (blpapi_Name_t *)blpapi_SchemaElementDefinition_getAlternateName((struct blpapi_SchemaElementDefinition const *)arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_FromCharPtr((const char *)result); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Service_getOperation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_minValues(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - blpapi_Operation_t **arg2 = (blpapi_Operation_t **) 0 ; - char *arg3 = (char *) 0 ; - blpapi_Name_t *arg4 = (blpapi_Name_t *) 0 ; + blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - blpapi_Operation_t *temp2 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; + size_t result; - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Service_getOperation",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaElementDefinition_minValues",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_getOperation" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = (blpapi_Service_t *)(argp1); - res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Service_getOperation" "', argument " "3"" of type '" "char const *""'"); - } - arg3 = (char *)(buf3); - res4 = SWIG_ConvertPtr(obj2, &argp4,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Service_getOperation" "', argument " "4"" of type '" "blpapi_Name_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_minValues" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); } - arg4 = (blpapi_Name_t *)(argp4); + arg1 = (blpapi_SchemaElementDefinition_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Service_getOperation(arg1,arg2,(char const *)arg3,(struct blpapi_Name const *)arg4); + result = blpapi_SchemaElementDefinition_minValues((struct blpapi_SchemaElementDefinition const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Operation, 0)); - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + resultobj = SWIG_From_size_t((size_t)(result)); return resultobj; fail: - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Service_getOperationAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_maxValues(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - blpapi_Operation_t **arg2 = (blpapi_Operation_t **) 0 ; - size_t arg3 ; + blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - blpapi_Operation_t *temp2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; + size_t result; - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Service_getOperationAt",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaElementDefinition_maxValues",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_getOperationAt" "', argument " "1"" of type '" "blpapi_Service_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_maxValues" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); } - arg1 = (blpapi_Service_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Service_getOperationAt" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); + arg1 = (blpapi_SchemaElementDefinition_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Service_getOperationAt(arg1,arg2,arg3); + result = blpapi_SchemaElementDefinition_maxValues((struct blpapi_SchemaElementDefinition const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Operation, 0)); + resultobj = SWIG_From_size_t((size_t)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Service_getEventDefinition(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - blpapi_SchemaElementDefinition_t **arg2 = (blpapi_SchemaElementDefinition_t **) 0 ; - char *arg3 = (char *) 0 ; - blpapi_Name_t *arg4 = (blpapi_Name_t *) 0 ; + blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - blpapi_SchemaElementDefinition_t *temp2 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; + blpapi_Name_t *result = 0 ; - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Service_getEventDefinition",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_name",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_getEventDefinition" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = (blpapi_Service_t *)(argp1); - res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Service_getEventDefinition" "', argument " "3"" of type '" "char const *""'"); - } - arg3 = (char *)(buf3); - res4 = SWIG_ConvertPtr(obj2, &argp4,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Service_getEventDefinition" "', argument " "4"" of type '" "blpapi_Name_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_name" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); } - arg4 = (blpapi_Name_t *)(argp4); + arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Service_getEventDefinition(arg1,arg2,(char const *)arg3,(struct blpapi_Name const *)arg4); + result = (blpapi_Name_t *)blpapi_SchemaTypeDefinition_name((void *const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_SchemaElementDefinition, 0)); - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); return resultobj; fail: - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Service_getEventDefinitionAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_description(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - blpapi_SchemaElementDefinition_t **arg2 = (blpapi_SchemaElementDefinition_t **) 0 ; - size_t arg3 ; + blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - blpapi_SchemaElementDefinition_t *temp2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; + char *result = 0 ; - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Service_getEventDefinitionAt",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_description",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_getEventDefinitionAt" "', argument " "1"" of type '" "blpapi_Service_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_description" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); } - arg1 = (blpapi_Service_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Service_getEventDefinitionAt" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); + arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Service_getEventDefinitionAt(arg1,arg2,arg3); + result = (char *)blpapi_SchemaTypeDefinition_description((void *const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_SchemaElementDefinition, 0)); + resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Service_createRequest(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_status(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - blpapi_Request_t **arg2 = (blpapi_Request_t **) 0 ; - char *arg3 = (char *) 0 ; + blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - blpapi_Request_t *temp2 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; int result; - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Service_createRequest",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_status",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_createRequest" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = (blpapi_Service_t *)(argp1); - res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Service_createRequest" "', argument " "3"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_status" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); } - arg3 = (char *)(buf3); + arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Service_createRequest(arg1,arg2,(char const *)arg3); + result = (int)blpapi_SchemaTypeDefinition_status((void *const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Request, 0)); - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return resultobj; fail: - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Service_createAuthorizationRequest(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_datatype(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - blpapi_Request_t **arg2 = (blpapi_Request_t **) 0 ; - char *arg3 = (char *) 0 ; + blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - blpapi_Request_t *temp2 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; int result; - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Service_createAuthorizationRequest",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_datatype",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_createAuthorizationRequest" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = (blpapi_Service_t *)(argp1); - res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Service_createAuthorizationRequest" "', argument " "3"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_datatype" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); } - arg3 = (char *)(buf3); + arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Service_createAuthorizationRequest(arg1,arg2,(char const *)arg3); + result = (int)blpapi_SchemaTypeDefinition_datatype((void *const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Request, 0)); - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return resultobj; fail: - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Service_createPublishEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_isComplexType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - blpapi_Event_t **arg2 = (blpapi_Event_t **) 0 ; + blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - blpapi_Event_t *temp2 = 0 ; PyObject * obj0 = 0 ; int result; - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_createPublishEvent",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_isComplexType",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_createPublishEvent" "', argument " "1"" of type '" "blpapi_Service_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_isComplexType" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); } - arg1 = (blpapi_Service_t *)(argp1); + arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Service_createPublishEvent(arg1,arg2); + result = (int)blpapi_SchemaTypeDefinition_isComplexType((void *const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Event, 0)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Service_createAdminEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_isSimpleType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - blpapi_Event_t **arg2 = (blpapi_Event_t **) 0 ; + blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - blpapi_Event_t *temp2 = 0 ; PyObject * obj0 = 0 ; int result; - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_createAdminEvent",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_isSimpleType",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_createAdminEvent" "', argument " "1"" of type '" "blpapi_Service_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_isSimpleType" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); } - arg1 = (blpapi_Service_t *)(argp1); + arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Service_createAdminEvent(arg1,arg2); + result = (int)blpapi_SchemaTypeDefinition_isSimpleType((void *const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Event, 0)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Service_createResponseEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_isEnumerationType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; - blpapi_Event_t **arg3 = (blpapi_Event_t **) 0 ; + blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - blpapi_Event_t *temp3 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; int result; - arg3 = &temp3; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Service_createResponseEvent",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_isEnumerationType",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_createResponseEvent" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = (blpapi_Service_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Service_createResponseEvent" "', argument " "2"" of type '" "blpapi_CorrelationId_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_isEnumerationType" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); } - arg2 = (blpapi_CorrelationId_t *)(argp2); + arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Service_createResponseEvent(arg1,(struct blpapi_CorrelationId_t_ const *)arg2,arg3); + result = (int)blpapi_SchemaTypeDefinition_isEnumerationType((void *const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg3), SWIGTYPE_p_blpapi_Event, 0)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Message_messageType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_numElementDefinitions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; + blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - blpapi_Name_t *result = 0 ; + size_t result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_messageType",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_numElementDefinitions",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_messageType" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_numElementDefinitions" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); } - arg1 = (blpapi_Message_t *)(argp1); + arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Name_t *)blpapi_Message_messageType((struct blpapi_Message const *)arg1); + result = blpapi_SchemaTypeDefinition_numElementDefinitions((void *const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); + resultobj = SWIG_From_size_t((size_t)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Message_topicName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_getElementDefinition(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; + blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; PyObject * obj0 = 0 ; - char *result = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + blpapi_SchemaElementDefinition_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_topicName",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_SchemaTypeDefinition_getElementDefinition",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_topicName" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_getElementDefinition" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); } - arg1 = (blpapi_Message_t *)(argp1); + arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SchemaTypeDefinition_getElementDefinition" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_SchemaTypeDefinition_getElementDefinition" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); + } + arg3 = (blpapi_Name_t *)(argp3); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_Message_topicName((struct blpapi_Message const *)arg1); + result = (blpapi_SchemaElementDefinition_t *)blpapi_SchemaTypeDefinition_getElementDefinition((void *const *)arg1,(char const *)arg2,(struct blpapi_Name const *)arg3); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_FromCharPtr((const char *)result); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Message_service(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_getElementDefinitionAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; + blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; + size_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; - blpapi_Service_t *result = 0 ; + PyObject * obj1 = 0 ; + blpapi_SchemaElementDefinition_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_service",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SchemaTypeDefinition_getElementDefinitionAt",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_service" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_getElementDefinitionAt" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); } - arg1 = (blpapi_Message_t *)(argp1); + arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SchemaTypeDefinition_getElementDefinitionAt" "', argument " "2"" of type '" "size_t""'"); + } + arg2 = (size_t)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Service_t *)blpapi_Message_service((struct blpapi_Message const *)arg1); + result = (blpapi_SchemaElementDefinition_t *)blpapi_SchemaTypeDefinition_getElementDefinitionAt((void *const *)arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Service, 0 | 0 ); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Message_numCorrelationIds(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_enumeration(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; + blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - int result; + blpapi_ConstantList_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_numCorrelationIds",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_enumeration",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_numCorrelationIds" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_enumeration" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); } - arg1 = (blpapi_Message_t *)(argp1); + arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Message_numCorrelationIds((struct blpapi_Message const *)arg1); + result = (blpapi_ConstantList_t *)blpapi_SchemaTypeDefinition_enumeration((void *const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Message_correlationId(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Request_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; - size_t arg2 ; + blpapi_Request_t *arg1 = (blpapi_Request_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - blpapi_CorrelationId_t result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Message_correlationId",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Request_destroy",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Request, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_correlationId" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Request_destroy" "', argument " "1"" of type '" "blpapi_Request_t *""'"); } - arg1 = (blpapi_Message_t *)(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Message_correlationId" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = (size_t)(val2); + arg1 = (blpapi_Request_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = blpapi_Message_correlationId((struct blpapi_Message const *)arg1,arg2); + blpapi_Request_destroy(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(CorrelationId_t_clone(&result), SWIGTYPE_p_blpapi_CorrelationId_t_, SWIG_POINTER_OWN)); - } + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Message_elements(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Request_elements(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; + blpapi_Request_t *arg1 = (blpapi_Request_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; blpapi_Element_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_elements",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Request_elements",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Request, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_elements" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Request_elements" "', argument " "1"" of type '" "blpapi_Request_t *""'"); } - arg1 = (blpapi_Message_t *)(argp1); + arg1 = (blpapi_Request_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Element_t *)blpapi_Message_elements((struct blpapi_Message const *)arg1); + result = (blpapi_Element_t *)blpapi_Request_elements(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Element, 0 | 0 ); @@ -15475,115 +15942,87 @@ SWIGINTERN PyObject *_wrap_blpapi_Message_elements(PyObject *SWIGUNUSEDPARM(self } -SWIGINTERN PyObject *_wrap_blpapi_Message_fragmentType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Request_setPreferredRoute(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; + blpapi_Request_t *arg1 = (blpapi_Request_t *) 0 ; + blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_fragmentType",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Request_setPreferredRoute",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Request, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_fragmentType" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Request_setPreferredRoute" "', argument " "1"" of type '" "blpapi_Request_t *""'"); } - arg1 = (blpapi_Message_t *)(argp1); + arg1 = (blpapi_Request_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Request_setPreferredRoute" "', argument " "2"" of type '" "blpapi_CorrelationId_t *""'"); + } + arg2 = (blpapi_CorrelationId_t *)(argp2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Message_fragmentType((struct blpapi_Message const *)arg1); + blpapi_Request_setPreferredRoute(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Message_recapType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Request_getRequestId(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; + blpapi_Request_t *arg1 = (blpapi_Request_t *) 0 ; + char **arg2 = (char **) 0 ; void *argp1 = 0 ; int res1 = 0 ; + char *temp2 = 0 ; PyObject * obj0 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_recapType",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Request_getRequestId",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Request, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_recapType" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Request_getRequestId" "', argument " "1"" of type '" "blpapi_Request_t const *""'"); } - arg1 = (blpapi_Message_t *)(argp1); + arg1 = (blpapi_Request_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Message_recapType((struct blpapi_Message const *)arg1); + result = (int)blpapi_Request_getRequestId((struct blpapi_Request const *)arg1,(char const **)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Message_print(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_RequestTemplate_release(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; - blpapi_StreamWriter_t arg2 ; - void *arg3 = (void *) 0 ; - int arg4 ; - int arg5 ; + blpapi_RequestTemplate_t *arg1 = (blpapi_RequestTemplate_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 ; - int res2 = 0 ; - int res3 ; - int val4 ; - int ecode4 = 0 ; - int val5 ; - int ecode5 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOOO:blpapi_Message_print",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_RequestTemplate_release",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_RequestTemplate, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_print" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); - } - arg1 = (blpapi_Message_t *)(argp1); - { - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_blpapi_StreamWriter_t, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Message_print" "', argument " "2"" of type '" "blpapi_StreamWriter_t""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "blpapi_Message_print" "', argument " "2"" of type '" "blpapi_StreamWriter_t""'"); - } else { - arg2 = *((blpapi_StreamWriter_t *)(argp2)); - } - } - res3 = SWIG_ConvertPtr(obj2,SWIG_as_voidptrptr(&arg3), 0, 0); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Message_print" "', argument " "3"" of type '" "void *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_RequestTemplate_release" "', argument " "1"" of type '" "blpapi_RequestTemplate_t const *""'"); } - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_Message_print" "', argument " "4"" of type '" "int""'"); - } - arg4 = (int)(val4); - ecode5 = SWIG_AsVal_int(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_Message_print" "', argument " "5"" of type '" "int""'"); - } - arg5 = (int)(val5); + arg1 = (blpapi_RequestTemplate_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Message_print((struct blpapi_Message const *)arg1,arg2,arg3,arg4,arg5); + result = (int)blpapi_RequestTemplate_release((struct blpapi_RequestTemplate const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); @@ -15593,109 +16032,105 @@ SWIGINTERN PyObject *_wrap_blpapi_Message_print(PyObject *SWIGUNUSEDPARM(self), } -SWIGINTERN PyObject *_wrap_blpapi_Message_addRef(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Operation_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; + blpapi_Operation_t *arg1 = (blpapi_Operation_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - int result; + char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_addRef",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Operation_name",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Operation, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_addRef" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Operation_name" "', argument " "1"" of type '" "blpapi_Operation_t *""'"); } - arg1 = (blpapi_Message_t *)(argp1); + arg1 = (blpapi_Operation_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Message_addRef((struct blpapi_Message const *)arg1); + result = (char *)blpapi_Operation_name(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Message_release(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Operation_description(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; + blpapi_Operation_t *arg1 = (blpapi_Operation_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - int result; + char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_release",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Operation_description",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Operation, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_release" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Operation_description" "', argument " "1"" of type '" "blpapi_Operation_t *""'"); } - arg1 = (blpapi_Message_t *)(argp1); + arg1 = (blpapi_Operation_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Message_release((struct blpapi_Message const *)arg1); + result = (char *)blpapi_Operation_description(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Message_timeReceived(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Operation_requestDefinition(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; - blpapi_TimePoint_t *arg2 = (blpapi_TimePoint_t *) 0 ; + blpapi_Operation_t *arg1 = (blpapi_Operation_t *) 0 ; + blpapi_SchemaElementDefinition_t **arg2 = (blpapi_SchemaElementDefinition_t **) 0 ; void *argp1 = 0 ; int res1 = 0 ; - blpapi_TimePoint_t temp2 ; + blpapi_SchemaElementDefinition_t *temp2 = 0 ; PyObject * obj0 = 0 ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_timeReceived",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Operation_requestDefinition",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Operation, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_timeReceived" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Operation_requestDefinition" "', argument " "1"" of type '" "blpapi_Operation_t *""'"); } - arg1 = (blpapi_Message_t *)(argp1); + arg1 = (blpapi_Operation_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Message_timeReceived((struct blpapi_Message const *)arg1,arg2); + result = (int)blpapi_Operation_requestDefinition(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - { - blpapi_TimePoint_t *outputPtr = (blpapi_TimePoint_t *) malloc(sizeof(blpapi_TimePoint_t)); - *outputPtr = *arg2; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(outputPtr, SWIGTYPE_p_blpapi_TimePoint, SWIG_POINTER_OWN)); - } + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_SchemaElementDefinition, 0)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Event_eventType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Operation_numResponseDefinitions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Event_t *arg1 = (blpapi_Event_t *) 0 ; + blpapi_Operation_t *arg1 = (blpapi_Operation_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Event_eventType",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Event, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Operation_numResponseDefinitions",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Operation, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Event_eventType" "', argument " "1"" of type '" "blpapi_Event_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Operation_numResponseDefinitions" "', argument " "1"" of type '" "blpapi_Operation_t *""'"); } - arg1 = (blpapi_Event_t *)(argp1); + arg1 = (blpapi_Operation_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Event_eventType((struct blpapi_Event const *)arg1); + result = (int)blpapi_Operation_numResponseDefinitions(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); @@ -15705,127 +16140,153 @@ SWIGINTERN PyObject *_wrap_blpapi_Event_eventType(PyObject *SWIGUNUSEDPARM(self) } -SWIGINTERN PyObject *_wrap_blpapi_Event_release(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Operation_responseDefinition(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Event_t *arg1 = (blpapi_Event_t *) 0 ; + blpapi_Operation_t *arg1 = (blpapi_Operation_t *) 0 ; + blpapi_SchemaElementDefinition_t **arg2 = (blpapi_SchemaElementDefinition_t **) 0 ; + size_t arg3 ; void *argp1 = 0 ; int res1 = 0 ; + blpapi_SchemaElementDefinition_t *temp2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Event_release",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Event, 0 | 0 ); + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Operation_responseDefinition",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Operation, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Event_release" "', argument " "1"" of type '" "blpapi_Event_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Operation_responseDefinition" "', argument " "1"" of type '" "blpapi_Operation_t *""'"); } - arg1 = (blpapi_Event_t *)(argp1); + arg1 = (blpapi_Operation_t *)(argp1); + ecode3 = SWIG_AsVal_size_t(obj1, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Operation_responseDefinition" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Event_release((struct blpapi_Event const *)arg1); + result = (int)blpapi_Operation_responseDefinition(arg1,arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_SchemaElementDefinition, 0)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_EventQueue_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Operation_responseDefinitionFromName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_EventQueue_t *result = 0 ; + blpapi_Operation_t *arg1 = (blpapi_Operation_t *) 0 ; + blpapi_SchemaElementDefinition_t **arg2 = (blpapi_SchemaElementDefinition_t **) 0 ; + blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_SchemaElementDefinition_t *temp2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)":blpapi_EventQueue_create")) SWIG_fail; + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Operation_responseDefinitionFromName",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Operation, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Operation_responseDefinitionFromName" "', argument " "1"" of type '" "blpapi_Operation_t *""'"); + } + arg1 = (blpapi_Operation_t *)(argp1); + res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Operation_responseDefinitionFromName" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); + } + arg3 = (blpapi_Name_t *)(argp3); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_EventQueue_t *)blpapi_EventQueue_create(); + result = (int)blpapi_Operation_responseDefinitionFromName(arg1,arg2,(struct blpapi_Name const *)arg3); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_SchemaElementDefinition, 0)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_EventQueue_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Service_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_EventQueue_t *arg1 = (blpapi_EventQueue_t *) 0 ; + blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - int result; + char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_EventQueue_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_name",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventQueue_destroy" "', argument " "1"" of type '" "blpapi_EventQueue_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_name" "', argument " "1"" of type '" "blpapi_Service_t *""'"); } - arg1 = (blpapi_EventQueue_t *)(argp1); + arg1 = (blpapi_Service_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventQueue_destroy(arg1); + result = (char *)blpapi_Service_name(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_EventQueue_nextEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Service_description(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_EventQueue_t *arg1 = (blpapi_EventQueue_t *) 0 ; - int arg2 ; + blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - blpapi_Event_t *result = 0 ; + char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_EventQueue_nextEvent",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_description",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventQueue_nextEvent" "', argument " "1"" of type '" "blpapi_EventQueue_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_description" "', argument " "1"" of type '" "blpapi_Service_t *""'"); } - arg1 = (blpapi_EventQueue_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_EventQueue_nextEvent" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); + arg1 = (blpapi_Service_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Event_t *)blpapi_EventQueue_nextEvent(arg1,arg2); + result = (char *)blpapi_Service_description(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Event, 0 | 0 ); + resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_EventQueue_purge(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Service_numOperations(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_EventQueue_t *arg1 = (blpapi_EventQueue_t *) 0 ; + blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_EventQueue_purge",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_numOperations",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventQueue_purge" "', argument " "1"" of type '" "blpapi_EventQueue_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_numOperations" "', argument " "1"" of type '" "blpapi_Service_t *""'"); } - arg1 = (blpapi_EventQueue_t *)(argp1); + arg1 = (blpapi_Service_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventQueue_purge(arg1); + result = (int)blpapi_Service_numOperations(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); @@ -15835,78 +16296,74 @@ SWIGINTERN PyObject *_wrap_blpapi_EventQueue_purge(PyObject *SWIGUNUSEDPARM(self } -SWIGINTERN PyObject *_wrap_blpapi_EventQueue_tryNextEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Service_numEventDefinitions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_EventQueue_t *arg1 = (blpapi_EventQueue_t *) 0 ; - blpapi_Event_t **arg2 = (blpapi_Event_t **) 0 ; + blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - blpapi_Event_t *temp2 = 0 ; PyObject * obj0 = 0 ; int result; - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_EventQueue_tryNextEvent",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_numEventDefinitions",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventQueue_tryNextEvent" "', argument " "1"" of type '" "blpapi_EventQueue_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_numEventDefinitions" "', argument " "1"" of type '" "blpapi_Service_t *""'"); } - arg1 = (blpapi_EventQueue_t *)(argp1); + arg1 = (blpapi_Service_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventQueue_tryNextEvent(arg1,arg2); + result = (int)blpapi_Service_numEventDefinitions(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Event, 0)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_MessageIterator_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Service_addRef(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Event_t *arg1 = (blpapi_Event_t *) 0 ; + blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - blpapi_MessageIterator_t *result = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_MessageIterator_create",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Event, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_addRef",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageIterator_create" "', argument " "1"" of type '" "blpapi_Event_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_addRef" "', argument " "1"" of type '" "blpapi_Service_t *""'"); } - arg1 = (blpapi_Event_t *)(argp1); + arg1 = (blpapi_Service_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_MessageIterator_t *)blpapi_MessageIterator_create((struct blpapi_Event const *)arg1); + result = (int)blpapi_Service_addRef(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_MessageIterator, 0 | 0 ); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_MessageIterator_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Service_release(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_MessageIterator_t *arg1 = (blpapi_MessageIterator_t *) 0 ; + blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_MessageIterator_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageIterator, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_release",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageIterator_destroy" "', argument " "1"" of type '" "blpapi_MessageIterator_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_release" "', argument " "1"" of type '" "blpapi_Service_t *""'"); } - arg1 = (blpapi_MessageIterator_t *)(argp1); + arg1 = (blpapi_Service_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_MessageIterator_destroy(arg1); + blpapi_Service_release(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_Py_Void(); @@ -15916,770 +16373,609 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageIterator_destroy(PyObject *SWIGUNUSEDPA } -SWIGINTERN PyObject *_wrap_blpapi_MessageIterator_next(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Service_authorizationServiceName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_MessageIterator_t *arg1 = (blpapi_MessageIterator_t *) 0 ; - blpapi_Message_t **arg2 = (blpapi_Message_t **) 0 ; + blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - blpapi_Message_t *temp2 = 0 ; PyObject * obj0 = 0 ; - int result; + char *result = 0 ; - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_MessageIterator_next",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageIterator, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_authorizationServiceName",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageIterator_next" "', argument " "1"" of type '" "blpapi_MessageIterator_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_authorizationServiceName" "', argument " "1"" of type '" "blpapi_Service_t *""'"); } - arg1 = (blpapi_MessageIterator_t *)(argp1); + arg1 = (blpapi_Service_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_MessageIterator_next(arg1,arg2); + result = (char *)blpapi_Service_authorizationServiceName(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Message, 0)); + resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Identity_release(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Service_getOperation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Identity_t *arg1 = (blpapi_Identity_t *) 0 ; + blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; + blpapi_Operation_t **arg2 = (blpapi_Operation_t **) 0 ; + char *arg3 = (char *) 0 ; + blpapi_Name_t *arg4 = (blpapi_Name_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; + blpapi_Operation_t *temp2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Identity_release",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Service_getOperation",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Identity_release" "', argument " "1"" of type '" "blpapi_Identity_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_getOperation" "', argument " "1"" of type '" "blpapi_Service_t *""'"); } - arg1 = (blpapi_Identity_t *)(argp1); + arg1 = (blpapi_Service_t *)(argp1); + res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Service_getOperation" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = (char *)(buf3); + res4 = SWIG_ConvertPtr(obj2, &argp4,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Service_getOperation" "', argument " "4"" of type '" "blpapi_Name_t const *""'"); + } + arg4 = (blpapi_Name_t *)(argp4); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_Identity_release(arg1); + result = (int)blpapi_Service_getOperation(arg1,arg2,(char const *)arg3,(struct blpapi_Name const *)arg4); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_Py_Void(); + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Operation, 0)); + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return resultobj; fail: + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Identity_addRef(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Service_getOperationAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Identity_t *arg1 = (blpapi_Identity_t *) 0 ; + blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; + blpapi_Operation_t **arg2 = (blpapi_Operation_t **) 0 ; + size_t arg3 ; void *argp1 = 0 ; int res1 = 0 ; + blpapi_Operation_t *temp2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Identity_addRef",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Service_getOperationAt",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Identity_addRef" "', argument " "1"" of type '" "blpapi_Identity_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_getOperationAt" "', argument " "1"" of type '" "blpapi_Service_t *""'"); } - arg1 = (blpapi_Identity_t *)(argp1); + arg1 = (blpapi_Service_t *)(argp1); + ecode3 = SWIG_AsVal_size_t(obj1, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Service_getOperationAt" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Identity_addRef(arg1); + result = (int)blpapi_Service_getOperationAt(arg1,arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Operation, 0)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Identity_hasEntitlements(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Service_getEventDefinition(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Identity_t *arg1 = (blpapi_Identity_t *) 0 ; - blpapi_Service_t *arg2 = (blpapi_Service_t *) 0 ; - blpapi_Element_t *arg3 = (blpapi_Element_t *) 0 ; - int *arg4 = (int *) 0 ; - size_t arg5 ; - int *arg6 = (int *) 0 ; - int *arg7 = (int *) 0 ; + blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; + blpapi_SchemaElementDefinition_t **arg2 = (blpapi_SchemaElementDefinition_t **) 0 ; + char *arg3 = (char *) 0 ; + blpapi_Name_t *arg4 = (blpapi_Name_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; + blpapi_SchemaElementDefinition_t *temp2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; void *argp4 = 0 ; int res4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:blpapi_Identity_hasEntitlements",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Service_getEventDefinition",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Identity_hasEntitlements" "', argument " "1"" of type '" "blpapi_Identity_t const *""'"); - } - arg1 = (blpapi_Identity_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Identity_hasEntitlements" "', argument " "2"" of type '" "blpapi_Service_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_getEventDefinition" "', argument " "1"" of type '" "blpapi_Service_t *""'"); } - arg2 = (blpapi_Service_t *)(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + arg1 = (blpapi_Service_t *)(argp1); + res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Identity_hasEntitlements" "', argument " "3"" of type '" "blpapi_Element_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Service_getEventDefinition" "', argument " "3"" of type '" "char const *""'"); } - arg3 = (blpapi_Element_t *)(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_int, 0 | 0 ); + arg3 = (char *)(buf3); + res4 = SWIG_ConvertPtr(obj2, &argp4,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Identity_hasEntitlements" "', argument " "4"" of type '" "int const *""'"); - } - arg4 = (int *)(argp4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_Identity_hasEntitlements" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = (size_t)(val5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "blpapi_Identity_hasEntitlements" "', argument " "6"" of type '" "int *""'"); - } - arg6 = (int *)(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "blpapi_Identity_hasEntitlements" "', argument " "7"" of type '" "int *""'"); + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Service_getEventDefinition" "', argument " "4"" of type '" "blpapi_Name_t const *""'"); } - arg7 = (int *)(argp7); + arg4 = (blpapi_Name_t *)(argp4); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Identity_hasEntitlements((struct blpapi_Identity const *)arg1,(struct blpapi_Service const *)arg2,(struct blpapi_Element const *)arg3,(int const *)arg4,arg5,arg6,arg7); + result = (int)blpapi_Service_getEventDefinition(arg1,arg2,(char const *)arg3,(struct blpapi_Name const *)arg4); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_SchemaElementDefinition, 0)); + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return resultobj; fail: + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Identity_isAuthorized(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Service_getEventDefinitionAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Identity_t *arg1 = (blpapi_Identity_t *) 0 ; - blpapi_Service_t *arg2 = (blpapi_Service_t *) 0 ; + blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; + blpapi_SchemaElementDefinition_t **arg2 = (blpapi_SchemaElementDefinition_t **) 0 ; + size_t arg3 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; + blpapi_SchemaElementDefinition_t *temp2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Identity_isAuthorized",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Service_getEventDefinitionAt",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Identity_isAuthorized" "', argument " "1"" of type '" "blpapi_Identity_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_getEventDefinitionAt" "', argument " "1"" of type '" "blpapi_Service_t *""'"); } - arg1 = (blpapi_Identity_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Identity_isAuthorized" "', argument " "2"" of type '" "blpapi_Service_t const *""'"); - } - arg2 = (blpapi_Service_t *)(argp2); + arg1 = (blpapi_Service_t *)(argp1); + ecode3 = SWIG_AsVal_size_t(obj1, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Service_getEventDefinitionAt" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Identity_isAuthorized((struct blpapi_Identity const *)arg1,(struct blpapi_Service const *)arg2); + result = (int)blpapi_Service_getEventDefinitionAt(arg1,arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_SchemaElementDefinition, 0)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Identity_getSeatType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Service_createRequest(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Identity_t *arg1 = (blpapi_Identity_t *) 0 ; - int *arg2 = (int *) 0 ; + blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; + blpapi_Request_t **arg2 = (blpapi_Request_t **) 0 ; + char *arg3 = (char *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - int temp2 ; + blpapi_Request_t *temp2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Identity_getSeatType",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Service_createRequest",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Identity_getSeatType" "', argument " "1"" of type '" "blpapi_Identity_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_createRequest" "', argument " "1"" of type '" "blpapi_Service_t *""'"); } - arg1 = (blpapi_Identity_t *)(argp1); + arg1 = (blpapi_Service_t *)(argp1); + res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Service_createRequest" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = (char *)(buf3); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Identity_getSeatType((struct blpapi_Identity const *)arg1,arg2); + result = (int)blpapi_Service_createRequest(arg1,arg2,(char const *)arg3); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, PyInt_FromLong(*arg2)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Request, 0)); + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return resultobj; fail: + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_HighResolutionClock_now(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Service_createAuthorizationRequest(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_TimePoint_t *arg1 = (blpapi_TimePoint_t *) 0 ; - blpapi_TimePoint_t temp1 ; + blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; + blpapi_Request_t **arg2 = (blpapi_Request_t **) 0 ; + char *arg3 = (char *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_Request_t *temp2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; int result; - arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)":blpapi_HighResolutionClock_now")) SWIG_fail; + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Service_createAuthorizationRequest",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_createAuthorizationRequest" "', argument " "1"" of type '" "blpapi_Service_t *""'"); + } + arg1 = (blpapi_Service_t *)(argp1); + res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Service_createAuthorizationRequest" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = (char *)(buf3); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_HighResolutionClock_now(arg1); + result = (int)blpapi_Service_createAuthorizationRequest(arg1,arg2,(char const *)arg3); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - { - blpapi_TimePoint_t *outputPtr = (blpapi_TimePoint_t *) malloc(sizeof(blpapi_TimePoint_t)); - *outputPtr = *arg1; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(outputPtr, SWIGTYPE_p_blpapi_TimePoint, SWIG_POINTER_OWN)); - } + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Request, 0)); + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return resultobj; fail: + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_cancel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Service_createPublishEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; - blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; - size_t arg3 ; - char *arg4 = (char *) 0 ; - int arg5 ; + blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; + blpapi_Event_t **arg2 = (blpapi_Event_t **) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - int res4 ; - char *buf4 = 0 ; - int alloc4 = 0 ; - int val5 ; - int ecode5 = 0 ; + blpapi_Event_t *temp2 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOOO:blpapi_AbstractSession_cancel",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_createPublishEvent",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_cancel" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); - } - arg1 = (blpapi_AbstractSession_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_cancel" "', argument " "2"" of type '" "blpapi_CorrelationId_t const *""'"); - } - arg2 = (blpapi_CorrelationId_t *)(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_AbstractSession_cancel" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); - res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_AbstractSession_cancel" "', argument " "4"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_createPublishEvent" "', argument " "1"" of type '" "blpapi_Service_t *""'"); } - arg4 = (char *)(buf4); - ecode5 = SWIG_AsVal_int(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_AbstractSession_cancel" "', argument " "5"" of type '" "int""'"); - } - arg5 = (int)(val5); + arg1 = (blpapi_Service_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AbstractSession_cancel(arg1,(struct blpapi_CorrelationId_t_ const *)arg2,arg3,(char const *)arg4,arg5); + result = (int)blpapi_Service_createPublishEvent(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Event, 0)); return resultobj; fail: - if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_sendAuthorizationRequest(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Service_createAdminEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; - blpapi_Request_t *arg2 = (blpapi_Request_t *) 0 ; - blpapi_Identity_t *arg3 = (blpapi_Identity_t *) 0 ; - blpapi_CorrelationId_t *arg4 = (blpapi_CorrelationId_t *) 0 ; - blpapi_EventQueue_t *arg5 = (blpapi_EventQueue_t *) 0 ; - char *arg6 = (char *) 0 ; - int arg7 ; + blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; + blpapi_Event_t **arg2 = (blpapi_Event_t **) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - int res6 ; - char *buf6 = 0 ; - int alloc6 = 0 ; - int val7 ; - int ecode7 = 0 ; + blpapi_Event_t *temp2 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:blpapi_AbstractSession_sendAuthorizationRequest",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_createAdminEvent",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_sendAuthorizationRequest" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); - } - arg1 = (blpapi_AbstractSession_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Request, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_sendAuthorizationRequest" "', argument " "2"" of type '" "blpapi_Request_t const *""'"); - } - arg2 = (blpapi_Request_t *)(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AbstractSession_sendAuthorizationRequest" "', argument " "3"" of type '" "blpapi_Identity_t *""'"); - } - arg3 = (blpapi_Identity_t *)(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_AbstractSession_sendAuthorizationRequest" "', argument " "4"" of type '" "blpapi_CorrelationId_t *""'"); - } - arg4 = (blpapi_CorrelationId_t *)(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "blpapi_AbstractSession_sendAuthorizationRequest" "', argument " "5"" of type '" "blpapi_EventQueue_t *""'"); - } - arg5 = (blpapi_EventQueue_t *)(argp5); - res6 = SWIG_AsCharPtrAndSize(obj5, &buf6, NULL, &alloc6); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "blpapi_AbstractSession_sendAuthorizationRequest" "', argument " "6"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_createAdminEvent" "', argument " "1"" of type '" "blpapi_Service_t *""'"); } - arg6 = (char *)(buf6); - ecode7 = SWIG_AsVal_int(obj6, &val7); - if (!SWIG_IsOK(ecode7)) { - SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "blpapi_AbstractSession_sendAuthorizationRequest" "', argument " "7"" of type '" "int""'"); - } - arg7 = (int)(val7); + arg1 = (blpapi_Service_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AbstractSession_sendAuthorizationRequest(arg1,(struct blpapi_Request const *)arg2,arg3,arg4,arg5,(char const *)arg6,arg7); + result = (int)blpapi_Service_createAdminEvent(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - if (alloc6 == SWIG_NEWOBJ) free((char*)buf6); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Event, 0)); return resultobj; fail: - if (alloc6 == SWIG_NEWOBJ) free((char*)buf6); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_openService(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Service_createResponseEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; - char *arg2 = (char *) 0 ; + blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; + blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; + blpapi_Event_t **arg3 = (blpapi_Event_t **) 0 ; void *argp1 = 0 ; int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + blpapi_Event_t *temp3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_AbstractSession_openService",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + arg3 = &temp3; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Service_createResponseEvent",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_openService" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_createResponseEvent" "', argument " "1"" of type '" "blpapi_Service_t *""'"); } - arg1 = (blpapi_AbstractSession_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + arg1 = (blpapi_Service_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_openService" "', argument " "2"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Service_createResponseEvent" "', argument " "2"" of type '" "blpapi_CorrelationId_t const *""'"); } - arg2 = (char *)(buf2); + arg2 = (blpapi_CorrelationId_t *)(argp2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AbstractSession_openService(arg1,(char const *)arg2); + result = (int)blpapi_Service_createResponseEvent(arg1,(struct blpapi_CorrelationId_t_ const *)arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg3), SWIGTYPE_p_blpapi_Event, 0)); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_openServiceAsync(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Message_messageType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; + blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; + blpapi_Name_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_AbstractSession_openServiceAsync",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_messageType",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_openServiceAsync" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_messageType" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); } - arg1 = (blpapi_AbstractSession_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_openServiceAsync" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AbstractSession_openServiceAsync" "', argument " "3"" of type '" "blpapi_CorrelationId_t *""'"); - } - arg3 = (blpapi_CorrelationId_t *)(argp3); + arg1 = (blpapi_Message_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AbstractSession_openServiceAsync(arg1,(char const *)arg2,arg3); + result = (blpapi_Name_t *)blpapi_Message_messageType((struct blpapi_Message const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_generateToken(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Message_topicName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; - blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; - blpapi_EventQueue_t *arg3 = (blpapi_EventQueue_t *) 0 ; + blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; + char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_AbstractSession_generateToken",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_topicName",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_generateToken" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); - } - arg1 = (blpapi_AbstractSession_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_generateToken" "', argument " "2"" of type '" "blpapi_CorrelationId_t *""'"); - } - arg2 = (blpapi_CorrelationId_t *)(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AbstractSession_generateToken" "', argument " "3"" of type '" "blpapi_EventQueue_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_topicName" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); } - arg3 = (blpapi_EventQueue_t *)(argp3); + arg1 = (blpapi_Message_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AbstractSession_generateToken(arg1,arg2,arg3); + result = (char *)blpapi_Message_topicName((struct blpapi_Message const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_generateManualToken(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Message_service(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; - blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; - char *arg3 = (char *) 0 ; - char *arg4 = (char *) 0 ; - blpapi_EventQueue_t *arg5 = (blpapi_EventQueue_t *) 0 ; + blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; - int res4 ; - char *buf4 = 0 ; - int alloc4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - int result; + blpapi_Service_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OOOOO:blpapi_AbstractSession_generateManualToken",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_service",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_generateManualToken" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); - } - arg1 = (blpapi_AbstractSession_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_generateManualToken" "', argument " "2"" of type '" "blpapi_CorrelationId_t *""'"); - } - arg2 = (blpapi_CorrelationId_t *)(argp2); - res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AbstractSession_generateManualToken" "', argument " "3"" of type '" "char const *""'"); - } - arg3 = (char *)(buf3); - res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_AbstractSession_generateManualToken" "', argument " "4"" of type '" "char const *""'"); - } - arg4 = (char *)(buf4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "blpapi_AbstractSession_generateManualToken" "', argument " "5"" of type '" "blpapi_EventQueue_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_service" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); } - arg5 = (blpapi_EventQueue_t *)(argp5); + arg1 = (blpapi_Message_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AbstractSession_generateManualToken(arg1,arg2,(char const *)arg3,(char const *)arg4,arg5); + result = (blpapi_Service_t *)blpapi_Message_service((struct blpapi_Message const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); - if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Service, 0 | 0 ); return resultobj; fail: - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); - if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_getService(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Message_numCorrelationIds(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; - blpapi_Service_t **arg2 = (blpapi_Service_t **) 0 ; - char *arg3 = (char *) 0 ; + blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - blpapi_Service_t *temp2 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; int result; - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_AbstractSession_getService",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_numCorrelationIds",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_getService" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); - } - arg1 = (blpapi_AbstractSession_t *)(argp1); - res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AbstractSession_getService" "', argument " "3"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_numCorrelationIds" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); } - arg3 = (char *)(buf3); + arg1 = (blpapi_Message_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AbstractSession_getService(arg1,arg2,(char const *)arg3); + result = (int)blpapi_Message_numCorrelationIds((struct blpapi_Message const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Service, 0)); - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return resultobj; fail: - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_createIdentity(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Message_correlationId(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; + blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; + size_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; - blpapi_Identity_t *result = 0 ; + PyObject * obj1 = 0 ; + blpapi_CorrelationId_t result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AbstractSession_createIdentity",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Message_correlationId",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_createIdentity" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_correlationId" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); } - arg1 = (blpapi_AbstractSession_t *)(argp1); + arg1 = (blpapi_Message_t *)(argp1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Message_correlationId" "', argument " "2"" of type '" "size_t""'"); + } + arg2 = (size_t)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Identity_t *)blpapi_AbstractSession_createIdentity(arg1); + result = blpapi_Message_correlationId((struct blpapi_Message const *)arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(CorrelationId_t_clone(&result), SWIGTYPE_p_blpapi_CorrelationId_t_, SWIG_POINTER_OWN)); + } return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_generateAuthorizedIdentityAsync(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Message_getRequestId(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; - blpapi_AuthOptions_t *arg2 = (blpapi_AuthOptions_t *) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; + blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; + char **arg2 = (char **) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; + char *temp2 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_AbstractSession_generateAuthorizedIdentityAsync",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_getRequestId",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_generateAuthorizedIdentityAsync" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); - } - arg1 = (blpapi_AbstractSession_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_AuthOptions, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_generateAuthorizedIdentityAsync" "', argument " "2"" of type '" "blpapi_AuthOptions_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_getRequestId" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); } - arg2 = (blpapi_AuthOptions_t *)(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AbstractSession_generateAuthorizedIdentityAsync" "', argument " "3"" of type '" "blpapi_CorrelationId_t *""'"); - } - arg3 = (blpapi_CorrelationId_t *)(argp3); + arg1 = (blpapi_Message_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AbstractSession_generateAuthorizedIdentityAsync(arg1,(struct blpapi_AuthOptions const *)arg2,arg3); + result = (int)blpapi_Message_getRequestId((struct blpapi_Message const *)arg1,(char const **)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_getAuthorizedIdentity(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Message_elements(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; - blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; - blpapi_Identity_t **arg3 = (blpapi_Identity_t **) 0 ; + blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - blpapi_Identity_t *temp3 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; + blpapi_Element_t *result = 0 ; - arg3 = &temp3; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_AbstractSession_getAuthorizedIdentity",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_elements",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_getAuthorizedIdentity" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); - } - arg1 = (blpapi_AbstractSession_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_getAuthorizedIdentity" "', argument " "2"" of type '" "blpapi_CorrelationId_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_elements" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); } - arg2 = (blpapi_CorrelationId_t *)(argp2); + arg1 = (blpapi_Message_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AbstractSession_getAuthorizedIdentity(arg1,(struct blpapi_CorrelationId_t_ const *)arg2,arg3); + result = (blpapi_Element_t *)blpapi_Message_elements((struct blpapi_Message const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg3), SWIGTYPE_p_blpapi_Identity, 0)); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Element, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Session_start(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Message_fragmentType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; + blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Session_start",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_fragmentType",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_start" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_fragmentType" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); } - arg1 = (blpapi_Session_t *)(argp1); + arg1 = (blpapi_Message_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_start(arg1); + result = (int)blpapi_Message_fragmentType((struct blpapi_Message const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); @@ -16689,23 +16985,23 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_start(PyObject *SWIGUNUSEDPARM(self), } -SWIGINTERN PyObject *_wrap_blpapi_Session_startAsync(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Message_recapType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; + blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Session_startAsync",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_recapType",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_startAsync" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_recapType" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); } - arg1 = (blpapi_Session_t *)(argp1); + arg1 = (blpapi_Message_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_startAsync(arg1); + result = (int)blpapi_Message_recapType((struct blpapi_Message const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); @@ -16715,23 +17011,23 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_startAsync(PyObject *SWIGUNUSEDPARM(se } -SWIGINTERN PyObject *_wrap_blpapi_Session_stop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Message_addRef(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; + blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Session_stop",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_addRef",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_stop" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_addRef" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); } - arg1 = (blpapi_Session_t *)(argp1); + arg1 = (blpapi_Message_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_stop(arg1); + result = (int)blpapi_Message_addRef((struct blpapi_Message const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); @@ -16741,23 +17037,23 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_stop(PyObject *SWIGUNUSEDPARM(self), P } -SWIGINTERN PyObject *_wrap_blpapi_Session_stopAsync(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Message_release(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; + blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Session_stopAsync",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_release",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_stopAsync" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_release" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); } - arg1 = (blpapi_Session_t *)(argp1); + arg1 = (blpapi_Message_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_stopAsync(arg1); + result = (int)blpapi_Message_release((struct blpapi_Message const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); @@ -16767,679 +17063,2466 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_stopAsync(PyObject *SWIGUNUSEDPARM(sel } -SWIGINTERN PyObject *_wrap_blpapi_Session_nextEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Message_timeReceived(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - blpapi_Event_t **arg2 = (blpapi_Event_t **) 0 ; - unsigned int arg3 ; + blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; + blpapi_TimePoint_t *arg2 = (blpapi_TimePoint_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - blpapi_Event_t *temp2 = 0 ; - unsigned int val3 ; - int ecode3 = 0 ; + blpapi_TimePoint_t temp2 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Session_nextEvent",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_timeReceived",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_nextEvent" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_timeReceived" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); } - arg1 = (blpapi_Session_t *)(argp1); - ecode3 = SWIG_AsVal_unsigned_SS_int(obj1, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Session_nextEvent" "', argument " "3"" of type '" "unsigned int""'"); - } - arg3 = (unsigned int)(val3); + arg1 = (blpapi_Message_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_nextEvent(arg1,arg2,arg3); + result = (int)blpapi_Message_timeReceived((struct blpapi_Message const *)arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Event, 0)); + { + blpapi_TimePoint_t *outputPtr = (blpapi_TimePoint_t *) malloc(sizeof(blpapi_TimePoint_t)); + *outputPtr = *arg2; + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(outputPtr, SWIGTYPE_p_blpapi_TimePoint, SWIG_POINTER_OWN)); + } return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Session_tryNextEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Event_eventType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - blpapi_Event_t **arg2 = (blpapi_Event_t **) 0 ; + blpapi_Event_t *arg1 = (blpapi_Event_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - blpapi_Event_t *temp2 = 0 ; PyObject * obj0 = 0 ; int result; - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Session_tryNextEvent",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Event_eventType",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Event, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_tryNextEvent" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Event_eventType" "', argument " "1"" of type '" "blpapi_Event_t const *""'"); } - arg1 = (blpapi_Session_t *)(argp1); + arg1 = (blpapi_Event_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_tryNextEvent(arg1,arg2); + result = (int)blpapi_Event_eventType((struct blpapi_Event const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Event, 0)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Session_subscribe(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_Event_release(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - blpapi_SubscriptionList_t *arg2 = (blpapi_SubscriptionList_t *) 0 ; - blpapi_Identity_t *arg3 = (blpapi_Identity_t *) 0 ; - char *arg4 = (char *) 0 ; - int arg5 ; + blpapi_Event_t *arg1 = (blpapi_Event_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - int res4 ; - char *buf4 = 0 ; - int alloc4 = 0 ; - int val5 ; - int ecode5 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOOO:blpapi_Session_subscribe",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Event_release",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Event, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_subscribe" "', argument " "1"" of type '" "blpapi_Session_t *""'"); - } - arg1 = (blpapi_Session_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_subscribe" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); - } - arg2 = (blpapi_SubscriptionList_t *)(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_subscribe" "', argument " "3"" of type '" "blpapi_Identity_t const *""'"); - } - arg3 = (blpapi_Identity_t *)(argp3); - res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Session_subscribe" "', argument " "4"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Event_release" "', argument " "1"" of type '" "blpapi_Event_t const *""'"); } - arg4 = (char *)(buf4); - ecode5 = SWIG_AsVal_int(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_Session_subscribe" "', argument " "5"" of type '" "int""'"); - } - arg5 = (int)(val5); + arg1 = (blpapi_Event_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_subscribe(arg1,(struct blpapi_SubscriptionList const *)arg2,(struct blpapi_Identity const *)arg3,(char const *)arg4,arg5); + result = (int)blpapi_Event_release((struct blpapi_Event const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); return resultobj; fail: - if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Session_resubscribe(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_EventQueue_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - blpapi_SubscriptionList_t *arg2 = (blpapi_SubscriptionList_t *) 0 ; - char *arg3 = (char *) 0 ; - int arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; - int val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - int result; + blpapi_EventQueue_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Session_resubscribe",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_resubscribe" "', argument " "1"" of type '" "blpapi_Session_t *""'"); - } - arg1 = (blpapi_Session_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_resubscribe" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); - } - arg2 = (blpapi_SubscriptionList_t *)(argp2); - res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_resubscribe" "', argument " "3"" of type '" "char const *""'"); - } - arg3 = (char *)(buf3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_Session_resubscribe" "', argument " "4"" of type '" "int""'"); - } - arg4 = (int)(val4); + if (!PyArg_ParseTuple(args,(char *)":blpapi_EventQueue_create")) SWIG_fail; { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_resubscribe(arg1,(struct blpapi_SubscriptionList const *)arg2,(char const *)arg3,arg4); + result = (blpapi_EventQueue_t *)blpapi_EventQueue_create(); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); return resultobj; fail: - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Session_resubscribeWithId(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_EventQueue_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - blpapi_SubscriptionList_t *arg2 = (blpapi_SubscriptionList_t *) 0 ; - int arg3 ; - char *arg4 = (char *) 0 ; - int arg5 ; + blpapi_EventQueue_t *arg1 = (blpapi_EventQueue_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - int res4 ; - char *buf4 = 0 ; - int alloc4 = 0 ; - int val5 ; - int ecode5 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOOO:blpapi_Session_resubscribeWithId",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_EventQueue_destroy",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_resubscribeWithId" "', argument " "1"" of type '" "blpapi_Session_t *""'"); - } - arg1 = (blpapi_Session_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_resubscribeWithId" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); - } - arg2 = (blpapi_SubscriptionList_t *)(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Session_resubscribeWithId" "', argument " "3"" of type '" "int""'"); - } - arg3 = (int)(val3); - res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Session_resubscribeWithId" "', argument " "4"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventQueue_destroy" "', argument " "1"" of type '" "blpapi_EventQueue_t *""'"); } - arg4 = (char *)(buf4); - ecode5 = SWIG_AsVal_int(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_Session_resubscribeWithId" "', argument " "5"" of type '" "int""'"); - } - arg5 = (int)(val5); + arg1 = (blpapi_EventQueue_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_resubscribeWithId(arg1,(struct blpapi_SubscriptionList const *)arg2,arg3,(char const *)arg4,arg5); + result = (int)blpapi_EventQueue_destroy(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); return resultobj; fail: - if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Session_unsubscribe(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_EventQueue_nextEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - blpapi_SubscriptionList_t *arg2 = (blpapi_SubscriptionList_t *) 0 ; - char *arg3 = (char *) 0 ; - int arg4 ; + blpapi_EventQueue_t *arg1 = (blpapi_EventQueue_t *) 0 ; + int arg2 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; - int val4 ; - int ecode4 = 0 ; + int val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - int result; + blpapi_Event_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Session_unsubscribe",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_EventQueue_nextEvent",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_unsubscribe" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventQueue_nextEvent" "', argument " "1"" of type '" "blpapi_EventQueue_t *""'"); } - arg1 = (blpapi_Session_t *)(argp1); + arg1 = (blpapi_EventQueue_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_EventQueue_nextEvent" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_Event_t *)blpapi_EventQueue_nextEvent(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Event, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_EventQueue_purge(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_EventQueue_t *arg1 = (blpapi_EventQueue_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_EventQueue_purge",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventQueue_purge" "', argument " "1"" of type '" "blpapi_EventQueue_t *""'"); + } + arg1 = (blpapi_EventQueue_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_EventQueue_purge(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_EventQueue_tryNextEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_EventQueue_t *arg1 = (blpapi_EventQueue_t *) 0 ; + blpapi_Event_t **arg2 = (blpapi_Event_t **) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_Event_t *temp2 = 0 ; + PyObject * obj0 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_EventQueue_tryNextEvent",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventQueue_tryNextEvent" "', argument " "1"" of type '" "blpapi_EventQueue_t *""'"); + } + arg1 = (blpapi_EventQueue_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_EventQueue_tryNextEvent(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Event, 0)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_MessageIterator_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Event_t *arg1 = (blpapi_Event_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_MessageIterator_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_MessageIterator_create",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Event, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageIterator_create" "', argument " "1"" of type '" "blpapi_Event_t const *""'"); + } + arg1 = (blpapi_Event_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_MessageIterator_t *)blpapi_MessageIterator_create((struct blpapi_Event const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_MessageIterator, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_MessageIterator_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_MessageIterator_t *arg1 = (blpapi_MessageIterator_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_MessageIterator_destroy",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageIterator, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageIterator_destroy" "', argument " "1"" of type '" "blpapi_MessageIterator_t *""'"); + } + arg1 = (blpapi_MessageIterator_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_MessageIterator_destroy(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_MessageIterator_next(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_MessageIterator_t *arg1 = (blpapi_MessageIterator_t *) 0 ; + blpapi_Message_t **arg2 = (blpapi_Message_t **) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_Message_t *temp2 = 0 ; + PyObject * obj0 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_MessageIterator_next",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageIterator, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageIterator_next" "', argument " "1"" of type '" "blpapi_MessageIterator_t *""'"); + } + arg1 = (blpapi_MessageIterator_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_MessageIterator_next(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Message, 0)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Identity_release(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Identity_t *arg1 = (blpapi_Identity_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Identity_release",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Identity_release" "', argument " "1"" of type '" "blpapi_Identity_t *""'"); + } + arg1 = (blpapi_Identity_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_Identity_release(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Identity_addRef(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Identity_t *arg1 = (blpapi_Identity_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Identity_addRef",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Identity_addRef" "', argument " "1"" of type '" "blpapi_Identity_t *""'"); + } + arg1 = (blpapi_Identity_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Identity_addRef(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Identity_hasEntitlements(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Identity_t *arg1 = (blpapi_Identity_t *) 0 ; + blpapi_Service_t *arg2 = (blpapi_Service_t *) 0 ; + blpapi_Element_t *arg3 = (blpapi_Element_t *) 0 ; + int *arg4 = (int *) 0 ; + size_t arg5 ; + int *arg6 = (int *) 0 ; + int *arg7 = (int *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + size_t val5 ; + int ecode5 = 0 ; + void *argp6 = 0 ; + int res6 = 0 ; + void *argp7 = 0 ; + int res7 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:blpapi_Identity_hasEntitlements",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Identity_hasEntitlements" "', argument " "1"" of type '" "blpapi_Identity_t const *""'"); + } + arg1 = (blpapi_Identity_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Identity_hasEntitlements" "', argument " "2"" of type '" "blpapi_Service_t const *""'"); + } + arg2 = (blpapi_Service_t *)(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Identity_hasEntitlements" "', argument " "3"" of type '" "blpapi_Element_t const *""'"); + } + arg3 = (blpapi_Element_t *)(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_int, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Identity_hasEntitlements" "', argument " "4"" of type '" "int const *""'"); + } + arg4 = (int *)(argp4); + ecode5 = SWIG_AsVal_size_t(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_Identity_hasEntitlements" "', argument " "5"" of type '" "size_t""'"); + } + arg5 = (size_t)(val5); + res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_int, 0 | 0 ); + if (!SWIG_IsOK(res6)) { + SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "blpapi_Identity_hasEntitlements" "', argument " "6"" of type '" "int *""'"); + } + arg6 = (int *)(argp6); + res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_int, 0 | 0 ); + if (!SWIG_IsOK(res7)) { + SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "blpapi_Identity_hasEntitlements" "', argument " "7"" of type '" "int *""'"); + } + arg7 = (int *)(argp7); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Identity_hasEntitlements((struct blpapi_Identity const *)arg1,(struct blpapi_Service const *)arg2,(struct blpapi_Element const *)arg3,(int const *)arg4,arg5,arg6,arg7); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Identity_isAuthorized(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Identity_t *arg1 = (blpapi_Identity_t *) 0 ; + blpapi_Service_t *arg2 = (blpapi_Service_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Identity_isAuthorized",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Identity_isAuthorized" "', argument " "1"" of type '" "blpapi_Identity_t const *""'"); + } + arg1 = (blpapi_Identity_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Identity_isAuthorized" "', argument " "2"" of type '" "blpapi_Service_t const *""'"); + } + arg2 = (blpapi_Service_t *)(argp2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Identity_isAuthorized((struct blpapi_Identity const *)arg1,(struct blpapi_Service const *)arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Identity_getSeatType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Identity_t *arg1 = (blpapi_Identity_t *) 0 ; + int *arg2 = (int *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int temp2 ; + PyObject * obj0 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Identity_getSeatType",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Identity_getSeatType" "', argument " "1"" of type '" "blpapi_Identity_t const *""'"); + } + arg1 = (blpapi_Identity_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Identity_getSeatType((struct blpapi_Identity const *)arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, PyInt_FromLong(*arg2)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_HighResolutionClock_now(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_TimePoint_t *arg1 = (blpapi_TimePoint_t *) 0 ; + blpapi_TimePoint_t temp1 ; + int result; + + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)":blpapi_HighResolutionClock_now")) SWIG_fail; + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_HighResolutionClock_now(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + { + blpapi_TimePoint_t *outputPtr = (blpapi_TimePoint_t *) malloc(sizeof(blpapi_TimePoint_t)); + *outputPtr = *arg1; + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(outputPtr, SWIGTYPE_p_blpapi_TimePoint, SWIG_POINTER_OWN)); + } + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_cancel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; + blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; + size_t arg3 ; + char *arg4 = (char *) 0 ; + int arg5 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; + PyObject *asAscii4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_AbstractSession_cancel",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_cancel" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); + } + arg1 = (blpapi_AbstractSession_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_cancel" "', argument " "2"" of type '" "blpapi_CorrelationId_t const *""'"); + } + arg2 = (blpapi_CorrelationId_t *)(argp2); + ecode3 = SWIG_AsVal_size_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_AbstractSession_cancel" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); + { + if (obj3 == Py_None) { + arg4 = 0; + arg5 = 0; + } + else { + if(PyUnicode_Check(obj3)) { + asAscii4 = PyUnicode_AsASCIIString(obj3); + arg4 = PyString_AsString(asAscii4); + arg5 = PyString_Size(asAscii4); + } + else { + arg4 = PyString_AsString(obj3); + arg5 = PyString_Size(obj3); + } + } + } + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_AbstractSession_cancel(arg1,(struct blpapi_CorrelationId_t_ const *)arg2,arg3,(char const *)arg4,arg5); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + { + if(asAscii4) { + Py_DECREF(asAscii4); + } + } + return resultobj; +fail: + { + if(asAscii4) { + Py_DECREF(asAscii4); + } + } + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_sendAuthorizationRequest(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; + blpapi_Request_t *arg2 = (blpapi_Request_t *) 0 ; + blpapi_Identity_t *arg3 = (blpapi_Identity_t *) 0 ; + blpapi_CorrelationId_t *arg4 = (blpapi_CorrelationId_t *) 0 ; + blpapi_EventQueue_t *arg5 = (blpapi_EventQueue_t *) 0 ; + char *arg6 = (char *) 0 ; + int arg7 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + void *argp5 = 0 ; + int res5 = 0 ; + PyObject *asAscii6 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOO:blpapi_AbstractSession_sendAuthorizationRequest",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_sendAuthorizationRequest" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); + } + arg1 = (blpapi_AbstractSession_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Request, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_sendAuthorizationRequest" "', argument " "2"" of type '" "blpapi_Request_t const *""'"); + } + arg2 = (blpapi_Request_t *)(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AbstractSession_sendAuthorizationRequest" "', argument " "3"" of type '" "blpapi_Identity_t *""'"); + } + arg3 = (blpapi_Identity_t *)(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_AbstractSession_sendAuthorizationRequest" "', argument " "4"" of type '" "blpapi_CorrelationId_t *""'"); + } + arg4 = (blpapi_CorrelationId_t *)(argp4); + res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); + if (!SWIG_IsOK(res5)) { + SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "blpapi_AbstractSession_sendAuthorizationRequest" "', argument " "5"" of type '" "blpapi_EventQueue_t *""'"); + } + arg5 = (blpapi_EventQueue_t *)(argp5); + { + if (obj5 == Py_None) { + arg6 = 0; + arg7 = 0; + } + else { + if(PyUnicode_Check(obj5)) { + asAscii6 = PyUnicode_AsASCIIString(obj5); + arg6 = PyString_AsString(asAscii6); + arg7 = PyString_Size(asAscii6); + } + else { + arg6 = PyString_AsString(obj5); + arg7 = PyString_Size(obj5); + } + } + } + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_AbstractSession_sendAuthorizationRequest(arg1,(struct blpapi_Request const *)arg2,arg3,arg4,arg5,(char const *)arg6,arg7); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + { + if(asAscii6) { + Py_DECREF(asAscii6); + } + } + return resultobj; +fail: + { + if(asAscii6) { + Py_DECREF(asAscii6); + } + } + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_openService(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; + char *arg2 = (char *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_AbstractSession_openService",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_openService" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); + } + arg1 = (blpapi_AbstractSession_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_openService" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_AbstractSession_openService(arg1,(char const *)arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_openServiceAsync(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_AbstractSession_openServiceAsync",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_openServiceAsync" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); + } + arg1 = (blpapi_AbstractSession_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_openServiceAsync" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AbstractSession_openServiceAsync" "', argument " "3"" of type '" "blpapi_CorrelationId_t *""'"); + } + arg3 = (blpapi_CorrelationId_t *)(argp3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_AbstractSession_openServiceAsync(arg1,(char const *)arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_generateToken(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; + blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; + blpapi_EventQueue_t *arg3 = (blpapi_EventQueue_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_AbstractSession_generateToken",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_generateToken" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); + } + arg1 = (blpapi_AbstractSession_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_generateToken" "', argument " "2"" of type '" "blpapi_CorrelationId_t *""'"); + } + arg2 = (blpapi_CorrelationId_t *)(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AbstractSession_generateToken" "', argument " "3"" of type '" "blpapi_EventQueue_t *""'"); + } + arg3 = (blpapi_EventQueue_t *)(argp3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_AbstractSession_generateToken(arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_generateManualToken(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; + blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; + char *arg3 = (char *) 0 ; + char *arg4 = (char *) 0 ; + blpapi_EventQueue_t *arg5 = (blpapi_EventQueue_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + int res4 ; + char *buf4 = 0 ; + int alloc4 = 0 ; + void *argp5 = 0 ; + int res5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOOO:blpapi_AbstractSession_generateManualToken",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_generateManualToken" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); + } + arg1 = (blpapi_AbstractSession_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_generateManualToken" "', argument " "2"" of type '" "blpapi_CorrelationId_t *""'"); + } + arg2 = (blpapi_CorrelationId_t *)(argp2); + res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AbstractSession_generateManualToken" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = (char *)(buf3); + res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_AbstractSession_generateManualToken" "', argument " "4"" of type '" "char const *""'"); + } + arg4 = (char *)(buf4); + res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); + if (!SWIG_IsOK(res5)) { + SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "blpapi_AbstractSession_generateManualToken" "', argument " "5"" of type '" "blpapi_EventQueue_t *""'"); + } + arg5 = (blpapi_EventQueue_t *)(argp5); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_AbstractSession_generateManualToken(arg1,arg2,(char const *)arg3,(char const *)arg4,arg5); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); + return resultobj; +fail: + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_getService(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; + blpapi_Service_t **arg2 = (blpapi_Service_t **) 0 ; + char *arg3 = (char *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_Service_t *temp2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_AbstractSession_getService",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_getService" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); + } + arg1 = (blpapi_AbstractSession_t *)(argp1); + res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AbstractSession_getService" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = (char *)(buf3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_AbstractSession_getService(arg1,arg2,(char const *)arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Service, 0)); + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + return resultobj; +fail: + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_createIdentity(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_Identity_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AbstractSession_createIdentity",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_createIdentity" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); + } + arg1 = (blpapi_AbstractSession_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_Identity_t *)blpapi_AbstractSession_createIdentity(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_generateAuthorizedIdentityAsync(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; + blpapi_AuthOptions_t *arg2 = (blpapi_AuthOptions_t *) 0 ; + blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_AbstractSession_generateAuthorizedIdentityAsync",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_generateAuthorizedIdentityAsync" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); + } + arg1 = (blpapi_AbstractSession_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_AuthOptions, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_generateAuthorizedIdentityAsync" "', argument " "2"" of type '" "blpapi_AuthOptions_t const *""'"); + } + arg2 = (blpapi_AuthOptions_t *)(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AbstractSession_generateAuthorizedIdentityAsync" "', argument " "3"" of type '" "blpapi_CorrelationId_t *""'"); + } + arg3 = (blpapi_CorrelationId_t *)(argp3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_AbstractSession_generateAuthorizedIdentityAsync(arg1,(struct blpapi_AuthOptions const *)arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_getAuthorizedIdentity(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; + blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; + blpapi_Identity_t **arg3 = (blpapi_Identity_t **) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + blpapi_Identity_t *temp3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg3 = &temp3; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_AbstractSession_getAuthorizedIdentity",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_getAuthorizedIdentity" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); + } + arg1 = (blpapi_AbstractSession_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_getAuthorizedIdentity" "', argument " "2"" of type '" "blpapi_CorrelationId_t const *""'"); + } + arg2 = (blpapi_CorrelationId_t *)(argp2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_AbstractSession_getAuthorizedIdentity(arg1,(struct blpapi_CorrelationId_t_ const *)arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg3), SWIGTYPE_p_blpapi_Identity, 0)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Session_start(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Session_start",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_start" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + } + arg1 = (blpapi_Session_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Session_start(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Session_startAsync(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Session_startAsync",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_startAsync" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + } + arg1 = (blpapi_Session_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Session_startAsync(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Session_stop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Session_stop",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_stop" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + } + arg1 = (blpapi_Session_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Session_stop(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Session_stopAsync(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Session_stopAsync",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_stopAsync" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + } + arg1 = (blpapi_Session_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Session_stopAsync(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Session_nextEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; + blpapi_Event_t **arg2 = (blpapi_Event_t **) 0 ; + unsigned int arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_Event_t *temp2 = 0 ; + unsigned int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Session_nextEvent",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_nextEvent" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + } + arg1 = (blpapi_Session_t *)(argp1); + ecode3 = SWIG_AsVal_unsigned_SS_int(obj1, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Session_nextEvent" "', argument " "3"" of type '" "unsigned int""'"); + } + arg3 = (unsigned int)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Session_nextEvent(arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Event, 0)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Session_tryNextEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; + blpapi_Event_t **arg2 = (blpapi_Event_t **) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_Event_t *temp2 = 0 ; + PyObject * obj0 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Session_tryNextEvent",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_tryNextEvent" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + } + arg1 = (blpapi_Session_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Session_tryNextEvent(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Event, 0)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Session_subscribe(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; + blpapi_SubscriptionList_t *arg2 = (blpapi_SubscriptionList_t *) 0 ; + blpapi_Identity_t *arg3 = (blpapi_Identity_t *) 0 ; + char *arg4 = (char *) 0 ; + int arg5 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject *asAscii4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Session_subscribe",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_subscribe" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + } + arg1 = (blpapi_Session_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_subscribe" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); + } + arg2 = (blpapi_SubscriptionList_t *)(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_subscribe" "', argument " "3"" of type '" "blpapi_Identity_t const *""'"); + } + arg3 = (blpapi_Identity_t *)(argp3); + { + if (obj3 == Py_None) { + arg4 = 0; + arg5 = 0; + } + else { + if(PyUnicode_Check(obj3)) { + asAscii4 = PyUnicode_AsASCIIString(obj3); + arg4 = PyString_AsString(asAscii4); + arg5 = PyString_Size(asAscii4); + } + else { + arg4 = PyString_AsString(obj3); + arg5 = PyString_Size(obj3); + } + } + } + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Session_subscribe(arg1,(struct blpapi_SubscriptionList const *)arg2,(struct blpapi_Identity const *)arg3,(char const *)arg4,arg5); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + { + if(asAscii4) { + Py_DECREF(asAscii4); + } + } + return resultobj; +fail: + { + if(asAscii4) { + Py_DECREF(asAscii4); + } + } + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Session_resubscribe(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; + blpapi_SubscriptionList_t *arg2 = (blpapi_SubscriptionList_t *) 0 ; + char *arg3 = (char *) 0 ; + int arg4 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *asAscii3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Session_resubscribe",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_resubscribe" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + } + arg1 = (blpapi_Session_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_resubscribe" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); + } + arg2 = (blpapi_SubscriptionList_t *)(argp2); + { + if (obj2 == Py_None) { + arg3 = 0; + arg4 = 0; + } + else { + if(PyUnicode_Check(obj2)) { + asAscii3 = PyUnicode_AsASCIIString(obj2); + arg3 = PyString_AsString(asAscii3); + arg4 = PyString_Size(asAscii3); + } + else { + arg3 = PyString_AsString(obj2); + arg4 = PyString_Size(obj2); + } + } + } + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Session_resubscribe(arg1,(struct blpapi_SubscriptionList const *)arg2,(char const *)arg3,arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + { + if(asAscii3) { + Py_DECREF(asAscii3); + } + } + return resultobj; +fail: + { + if(asAscii3) { + Py_DECREF(asAscii3); + } + } + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Session_resubscribeWithId(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; + blpapi_SubscriptionList_t *arg2 = (blpapi_SubscriptionList_t *) 0 ; + int arg3 ; + char *arg4 = (char *) 0 ; + int arg5 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject *asAscii4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Session_resubscribeWithId",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_resubscribeWithId" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + } + arg1 = (blpapi_Session_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_resubscribeWithId" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); + } + arg2 = (blpapi_SubscriptionList_t *)(argp2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Session_resubscribeWithId" "', argument " "3"" of type '" "int""'"); + } + arg3 = (int)(val3); + { + if (obj3 == Py_None) { + arg4 = 0; + arg5 = 0; + } + else { + if(PyUnicode_Check(obj3)) { + asAscii4 = PyUnicode_AsASCIIString(obj3); + arg4 = PyString_AsString(asAscii4); + arg5 = PyString_Size(asAscii4); + } + else { + arg4 = PyString_AsString(obj3); + arg5 = PyString_Size(obj3); + } + } + } + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Session_resubscribeWithId(arg1,(struct blpapi_SubscriptionList const *)arg2,arg3,(char const *)arg4,arg5); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + { + if(asAscii4) { + Py_DECREF(asAscii4); + } + } + return resultobj; +fail: + { + if(asAscii4) { + Py_DECREF(asAscii4); + } + } + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Session_unsubscribe(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; + blpapi_SubscriptionList_t *arg2 = (blpapi_SubscriptionList_t *) 0 ; + char *arg3 = (char *) 0 ; + int arg4 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *asAscii3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Session_unsubscribe",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_unsubscribe" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + } + arg1 = (blpapi_Session_t *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_unsubscribe" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_unsubscribe" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); + } + arg2 = (blpapi_SubscriptionList_t *)(argp2); + { + if (obj2 == Py_None) { + arg3 = 0; + arg4 = 0; + } + else { + if(PyUnicode_Check(obj2)) { + asAscii3 = PyUnicode_AsASCIIString(obj2); + arg3 = PyString_AsString(asAscii3); + arg4 = PyString_Size(asAscii3); + } + else { + arg3 = PyString_AsString(obj2); + arg4 = PyString_Size(obj2); + } + } + } + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Session_unsubscribe(arg1,(struct blpapi_SubscriptionList const *)arg2,(char const *)arg3,arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + { + if(asAscii3) { + Py_DECREF(asAscii3); + } + } + return resultobj; +fail: + { + if(asAscii3) { + Py_DECREF(asAscii3); + } + } + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Session_setStatusCorrelationId(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; + blpapi_Service_t *arg2 = (blpapi_Service_t *) 0 ; + blpapi_Identity_t *arg3 = (blpapi_Identity_t *) 0 ; + blpapi_CorrelationId_t *arg4 = (blpapi_CorrelationId_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Session_setStatusCorrelationId",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_setStatusCorrelationId" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + } + arg1 = (blpapi_Session_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_setStatusCorrelationId" "', argument " "2"" of type '" "blpapi_Service_t const *""'"); + } + arg2 = (blpapi_Service_t *)(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_setStatusCorrelationId" "', argument " "3"" of type '" "blpapi_Identity_t const *""'"); + } + arg3 = (blpapi_Identity_t *)(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Session_setStatusCorrelationId" "', argument " "4"" of type '" "blpapi_CorrelationId_t const *""'"); + } + arg4 = (blpapi_CorrelationId_t *)(argp4); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Session_setStatusCorrelationId(arg1,(struct blpapi_Service const *)arg2,(struct blpapi_Identity const *)arg3,(struct blpapi_CorrelationId_t_ const *)arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Session_sendRequest(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; + blpapi_Request_t *arg2 = (blpapi_Request_t *) 0 ; + blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; + blpapi_Identity_t *arg4 = (blpapi_Identity_t *) 0 ; + blpapi_EventQueue_t *arg5 = (blpapi_EventQueue_t *) 0 ; + char *arg6 = (char *) 0 ; + int arg7 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + void *argp5 = 0 ; + int res5 = 0 ; + PyObject *asAscii6 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOO:blpapi_Session_sendRequest",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_sendRequest" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + } + arg1 = (blpapi_Session_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Request, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_sendRequest" "', argument " "2"" of type '" "blpapi_Request_t const *""'"); + } + arg2 = (blpapi_Request_t *)(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_sendRequest" "', argument " "3"" of type '" "blpapi_CorrelationId_t *""'"); + } + arg3 = (blpapi_CorrelationId_t *)(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Session_sendRequest" "', argument " "4"" of type '" "blpapi_Identity_t *""'"); + } + arg4 = (blpapi_Identity_t *)(argp4); + res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); + if (!SWIG_IsOK(res5)) { + SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "blpapi_Session_sendRequest" "', argument " "5"" of type '" "blpapi_EventQueue_t *""'"); + } + arg5 = (blpapi_EventQueue_t *)(argp5); + { + if (obj5 == Py_None) { + arg6 = 0; + arg7 = 0; + } + else { + if(PyUnicode_Check(obj5)) { + asAscii6 = PyUnicode_AsASCIIString(obj5); + arg6 = PyString_AsString(asAscii6); + arg7 = PyString_Size(asAscii6); + } + else { + arg6 = PyString_AsString(obj5); + arg7 = PyString_Size(obj5); + } + } + } + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Session_sendRequest(arg1,(struct blpapi_Request const *)arg2,arg3,arg4,arg5,(char const *)arg6,arg7); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + { + if(asAscii6) { + Py_DECREF(asAscii6); + } + } + return resultobj; +fail: + { + if(asAscii6) { + Py_DECREF(asAscii6); + } + } + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Session_sendRequestTemplate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; + blpapi_RequestTemplate_t *arg2 = (blpapi_RequestTemplate_t *) 0 ; + blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Session_sendRequestTemplate",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_sendRequestTemplate" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + } + arg1 = (blpapi_Session_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_RequestTemplate, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_sendRequestTemplate" "', argument " "2"" of type '" "blpapi_RequestTemplate_t const *""'"); + } + arg2 = (blpapi_RequestTemplate_t *)(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_sendRequestTemplate" "', argument " "3"" of type '" "blpapi_CorrelationId_t *""'"); + } + arg3 = (blpapi_CorrelationId_t *)(argp3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Session_sendRequestTemplate(arg1,(struct blpapi_RequestTemplate const *)arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Session_createSnapshotRequestTemplate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_RequestTemplate_t **arg1 = (blpapi_RequestTemplate_t **) 0 ; + blpapi_Session_t *arg2 = (blpapi_Session_t *) 0 ; + char *arg3 = (char *) 0 ; + blpapi_Identity_t *arg4 = (blpapi_Identity_t *) 0 ; + blpapi_CorrelationId_t *arg5 = (blpapi_CorrelationId_t *) 0 ; + blpapi_RequestTemplate_t *temp1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + void *argp5 = 0 ; + int res5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + int result; + + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Session_createSnapshotRequestTemplate",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_createSnapshotRequestTemplate" "', argument " "2"" of type '" "blpapi_Session_t *""'"); + } + arg2 = (blpapi_Session_t *)(argp2); + res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_createSnapshotRequestTemplate" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = (char *)(buf3); + res4 = SWIG_ConvertPtr(obj2, &argp4,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Session_createSnapshotRequestTemplate" "', argument " "4"" of type '" "blpapi_Identity_t const *""'"); + } + arg4 = (blpapi_Identity_t *)(argp4); + res5 = SWIG_ConvertPtr(obj3, &argp5,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res5)) { + SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "blpapi_Session_createSnapshotRequestTemplate" "', argument " "5"" of type '" "blpapi_CorrelationId_t *""'"); + } + arg5 = (blpapi_CorrelationId_t *)(argp5); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Session_createSnapshotRequestTemplate(arg1,arg2,(char const *)arg3,(struct blpapi_Identity const *)arg4,arg5); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_RequestTemplate, 0)); + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + return resultobj; +fail: + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Session_getAbstractSession(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_AbstractSession_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Session_getAbstractSession",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_getAbstractSession" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + } + arg1 = (blpapi_Session_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_AbstractSession_t *)blpapi_Session_getAbstractSession(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_extractAttributeFromResolutionSuccess(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; + blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + blpapi_Element_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_extractAttributeFromResolutionSuccess",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_extractAttributeFromResolutionSuccess" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); + } + arg1 = (blpapi_Message_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ResolutionList_extractAttributeFromResolutionSuccess" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); + } + arg2 = (blpapi_Name_t *)(argp2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_Element_t *)blpapi_ResolutionList_extractAttributeFromResolutionSuccess((struct blpapi_Message const *)arg1,(struct blpapi_Name const *)arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Element, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + blpapi_ResolutionList_t *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ResolutionList_create",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_create" "', argument " "1"" of type '" "blpapi_ResolutionList_t *""'"); + } + arg1 = (blpapi_ResolutionList_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_ResolutionList_t *)blpapi_ResolutionList_create(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ResolutionList_destroy",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_destroy" "', argument " "1"" of type '" "blpapi_ResolutionList_t *""'"); + } + arg1 = (blpapi_ResolutionList_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_ResolutionList_destroy(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_ResolutionList_add",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_add" "', argument " "1"" of type '" "blpapi_ResolutionList_t *""'"); + } + arg1 = (blpapi_ResolutionList_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ResolutionList_add" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ResolutionList_add" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); + } + arg3 = (blpapi_CorrelationId_t *)(argp3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ResolutionList_add(arg1,(char const *)arg2,(struct blpapi_CorrelationId_t_ const *)arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_addFromMessage(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; + blpapi_Message_t *arg2 = (blpapi_Message_t *) 0 ; + blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_ResolutionList_addFromMessage",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_addFromMessage" "', argument " "1"" of type '" "blpapi_ResolutionList_t *""'"); + } + arg1 = (blpapi_ResolutionList_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ResolutionList_addFromMessage" "', argument " "2"" of type '" "blpapi_Message_t const *""'"); + } + arg2 = (blpapi_Message_t *)(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ResolutionList_addFromMessage" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); + } + arg3 = (blpapi_CorrelationId_t *)(argp3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ResolutionList_addFromMessage(arg1,(struct blpapi_Message const *)arg2,(struct blpapi_CorrelationId_t_ const *)arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_addAttribute(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; + blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_addAttribute",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_addAttribute" "', argument " "1"" of type '" "blpapi_ResolutionList_t *""'"); + } + arg1 = (blpapi_ResolutionList_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ResolutionList_addAttribute" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); + } + arg2 = (blpapi_Name_t *)(argp2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ResolutionList_addAttribute(arg1,(struct blpapi_Name const *)arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_correlationIdAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; + blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; + size_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_CorrelationId_t temp2 ; + size_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_correlationIdAt",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_correlationIdAt" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); + } + arg1 = (blpapi_ResolutionList_t *)(argp1); + ecode3 = SWIG_AsVal_size_t(obj1, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ResolutionList_correlationIdAt" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ResolutionList_correlationIdAt((struct blpapi_ResolutionList const *)arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (!result) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(CorrelationId_t_clone(arg2), SWIGTYPE_p_blpapi_CorrelationId_t_, SWIG_POINTER_OWN)); + } else { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_Py_Void()); + } + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_topicString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; + char **arg2 = (char **) 0 ; + blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + char *temp2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_topicString",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_topicString" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); } - arg2 = (blpapi_SubscriptionList_t *)(argp2); - res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); + arg1 = (blpapi_ResolutionList_t *)(argp1); + res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_unsubscribe" "', argument " "3"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ResolutionList_topicString" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); } - arg3 = (char *)(buf3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_Session_unsubscribe" "', argument " "4"" of type '" "int""'"); - } - arg4 = (int)(val4); + arg3 = (blpapi_CorrelationId_t *)(argp3); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_unsubscribe(arg1,(struct blpapi_SubscriptionList const *)arg2,(char const *)arg3,arg4); + result = (int)blpapi_ResolutionList_topicString((struct blpapi_ResolutionList const *)arg1,(char const **)arg2,(struct blpapi_CorrelationId_t_ const *)arg3); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); return resultobj; fail: - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Session_setStatusCorrelationId(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_topicStringAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - blpapi_Service_t *arg2 = (blpapi_Service_t *) 0 ; - blpapi_Identity_t *arg3 = (blpapi_Identity_t *) 0 ; - blpapi_CorrelationId_t *arg4 = (blpapi_CorrelationId_t *) 0 ; + blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; + char **arg2 = (char **) 0 ; + size_t arg3 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; + char *temp2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Session_setStatusCorrelationId",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_topicStringAt",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_setStatusCorrelationId" "', argument " "1"" of type '" "blpapi_Session_t *""'"); - } - arg1 = (blpapi_Session_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_setStatusCorrelationId" "', argument " "2"" of type '" "blpapi_Service_t const *""'"); - } - arg2 = (blpapi_Service_t *)(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_setStatusCorrelationId" "', argument " "3"" of type '" "blpapi_Identity_t const *""'"); - } - arg3 = (blpapi_Identity_t *)(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Session_setStatusCorrelationId" "', argument " "4"" of type '" "blpapi_CorrelationId_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_topicStringAt" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); } - arg4 = (blpapi_CorrelationId_t *)(argp4); + arg1 = (blpapi_ResolutionList_t *)(argp1); + ecode3 = SWIG_AsVal_size_t(obj1, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ResolutionList_topicStringAt" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_setStatusCorrelationId(arg1,(struct blpapi_Service const *)arg2,(struct blpapi_Identity const *)arg3,(struct blpapi_CorrelationId_t_ const *)arg4); + result = (int)blpapi_ResolutionList_topicStringAt((struct blpapi_ResolutionList const *)arg1,(char const **)arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Session_sendRequest(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_status(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - blpapi_Request_t *arg2 = (blpapi_Request_t *) 0 ; + blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; + int *arg2 = (int *) 0 ; blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; - blpapi_Identity_t *arg4 = (blpapi_Identity_t *) 0 ; - blpapi_EventQueue_t *arg5 = (blpapi_EventQueue_t *) 0 ; - char *arg6 = (char *) 0 ; - int arg7 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; + int temp2 ; void *argp3 = 0 ; int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - int res6 ; - char *buf6 = 0 ; - int alloc6 = 0 ; - int val7 ; - int ecode7 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:blpapi_Session_sendRequest",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_status",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_sendRequest" "', argument " "1"" of type '" "blpapi_Session_t *""'"); - } - arg1 = (blpapi_Session_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Request, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_sendRequest" "', argument " "2"" of type '" "blpapi_Request_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_status" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); } - arg2 = (blpapi_Request_t *)(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + arg1 = (blpapi_ResolutionList_t *)(argp1); + res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_sendRequest" "', argument " "3"" of type '" "blpapi_CorrelationId_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ResolutionList_status" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); } arg3 = (blpapi_CorrelationId_t *)(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Session_sendRequest" "', argument " "4"" of type '" "blpapi_Identity_t *""'"); - } - arg4 = (blpapi_Identity_t *)(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "blpapi_Session_sendRequest" "', argument " "5"" of type '" "blpapi_EventQueue_t *""'"); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ResolutionList_status((struct blpapi_ResolutionList const *)arg1,arg2,(struct blpapi_CorrelationId_t_ const *)arg3); + SWIG_PYTHON_THREAD_END_ALLOW; } - arg5 = (blpapi_EventQueue_t *)(argp5); - res6 = SWIG_AsCharPtrAndSize(obj5, &buf6, NULL, &alloc6); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "blpapi_Session_sendRequest" "', argument " "6"" of type '" "char const *""'"); + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, PyInt_FromLong(*arg2)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_statusAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; + int *arg2 = (int *) 0 ; + size_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + int temp2 ; + size_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_statusAt",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_statusAt" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); } - arg6 = (char *)(buf6); - ecode7 = SWIG_AsVal_int(obj6, &val7); - if (!SWIG_IsOK(ecode7)) { - SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "blpapi_Session_sendRequest" "', argument " "7"" of type '" "int""'"); + arg1 = (blpapi_ResolutionList_t *)(argp1); + ecode3 = SWIG_AsVal_size_t(obj1, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ResolutionList_statusAt" "', argument " "3"" of type '" "size_t""'"); } - arg7 = (int)(val7); + arg3 = (size_t)(val3); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_sendRequest(arg1,(struct blpapi_Request const *)arg2,arg3,arg4,arg5,(char const *)arg6,arg7); + result = (int)blpapi_ResolutionList_statusAt((struct blpapi_ResolutionList const *)arg1,arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - if (alloc6 == SWIG_NEWOBJ) free((char*)buf6); + resultobj = SWIG_Python_AppendOutput(resultobj, PyInt_FromLong(*arg2)); return resultobj; fail: - if (alloc6 == SWIG_NEWOBJ) free((char*)buf6); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Session_sendRequestTemplate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_attribute(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - blpapi_RequestTemplate_t *arg2 = (blpapi_RequestTemplate_t *) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; + blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; + blpapi_Element_t **arg2 = (blpapi_Element_t **) 0 ; + blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; + blpapi_CorrelationId_t *arg4 = (blpapi_CorrelationId_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; + blpapi_Element_t *temp2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Session_sendRequestTemplate",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_ResolutionList_attribute",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_sendRequestTemplate" "', argument " "1"" of type '" "blpapi_Session_t *""'"); - } - arg1 = (blpapi_Session_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_RequestTemplate, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_sendRequestTemplate" "', argument " "2"" of type '" "blpapi_RequestTemplate_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_attribute" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); } - arg2 = (blpapi_RequestTemplate_t *)(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + arg1 = (blpapi_ResolutionList_t *)(argp1); + res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_sendRequestTemplate" "', argument " "3"" of type '" "blpapi_CorrelationId_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ResolutionList_attribute" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); } - arg3 = (blpapi_CorrelationId_t *)(argp3); + arg3 = (blpapi_Name_t *)(argp3); + res4 = SWIG_ConvertPtr(obj2, &argp4,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_ResolutionList_attribute" "', argument " "4"" of type '" "blpapi_CorrelationId_t const *""'"); + } + arg4 = (blpapi_CorrelationId_t *)(argp4); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_sendRequestTemplate(arg1,(struct blpapi_RequestTemplate const *)arg2,arg3); + result = (int)blpapi_ResolutionList_attribute((struct blpapi_ResolutionList const *)arg1,arg2,(struct blpapi_Name const *)arg3,(struct blpapi_CorrelationId_t_ const *)arg4); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Element, 0)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Session_createSnapshotRequestTemplate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_attributeAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_RequestTemplate_t **arg1 = (blpapi_RequestTemplate_t **) 0 ; - blpapi_Session_t *arg2 = (blpapi_Session_t *) 0 ; - char *arg3 = (char *) 0 ; - blpapi_Identity_t *arg4 = (blpapi_Identity_t *) 0 ; - blpapi_CorrelationId_t *arg5 = (blpapi_CorrelationId_t *) 0 ; - blpapi_RequestTemplate_t *temp1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; + blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; + blpapi_Element_t **arg2 = (blpapi_Element_t **) 0 ; + blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; + size_t arg4 ; + void *argp1 = 0 ; + int res1 = 0 ; + blpapi_Element_t *temp2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + size_t val4 ; + int ecode4 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; int result; - arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Session_createSnapshotRequestTemplate",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_Session, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_createSnapshotRequestTemplate" "', argument " "2"" of type '" "blpapi_Session_t *""'"); + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_ResolutionList_attributeAt",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_attributeAt" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); } - arg2 = (blpapi_Session_t *)(argp2); - res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); + arg1 = (blpapi_ResolutionList_t *)(argp1); + res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_createSnapshotRequestTemplate" "', argument " "3"" of type '" "char const *""'"); - } - arg3 = (char *)(buf3); - res4 = SWIG_ConvertPtr(obj2, &argp4,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Session_createSnapshotRequestTemplate" "', argument " "4"" of type '" "blpapi_Identity_t const *""'"); - } - arg4 = (blpapi_Identity_t *)(argp4); - res5 = SWIG_ConvertPtr(obj3, &argp5,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "blpapi_Session_createSnapshotRequestTemplate" "', argument " "5"" of type '" "blpapi_CorrelationId_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ResolutionList_attributeAt" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); } - arg5 = (blpapi_CorrelationId_t *)(argp5); + arg3 = (blpapi_Name_t *)(argp3); + ecode4 = SWIG_AsVal_size_t(obj2, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_ResolutionList_attributeAt" "', argument " "4"" of type '" "size_t""'"); + } + arg4 = (size_t)(val4); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_createSnapshotRequestTemplate(arg1,arg2,(char const *)arg3,(struct blpapi_Identity const *)arg4,arg5); + result = (int)blpapi_ResolutionList_attributeAt((struct blpapi_ResolutionList const *)arg1,arg2,(struct blpapi_Name const *)arg3,arg4); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_RequestTemplate, 0)); - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Element, 0)); return resultobj; fail: - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_Session_getAbstractSession(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_message(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; + blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; + blpapi_Message_t **arg2 = (blpapi_Message_t **) 0 ; + blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; + blpapi_Message_t *temp2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; PyObject * obj0 = 0 ; - blpapi_AbstractSession_t *result = 0 ; + PyObject * obj1 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Session_getAbstractSession",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_message",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_getAbstractSession" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_message" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); } - arg1 = (blpapi_Session_t *)(argp1); + arg1 = (blpapi_ResolutionList_t *)(argp1); + res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ResolutionList_message" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); + } + arg3 = (blpapi_CorrelationId_t *)(argp3); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_AbstractSession_t *)blpapi_Session_getAbstractSession(arg1); + result = (int)blpapi_ResolutionList_message((struct blpapi_ResolutionList const *)arg1,arg2,(struct blpapi_CorrelationId_t_ const *)arg3); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Message, 0)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_extractAttributeFromResolutionSuccess(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_messageAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; - blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; + blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; + blpapi_Message_t **arg2 = (blpapi_Message_t **) 0 ; + size_t arg3 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; + blpapi_Message_t *temp2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; - blpapi_Element_t *result = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_extractAttributeFromResolutionSuccess",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_messageAt",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_extractAttributeFromResolutionSuccess" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); - } - arg1 = (blpapi_Message_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ResolutionList_extractAttributeFromResolutionSuccess" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_messageAt" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); } - arg2 = (blpapi_Name_t *)(argp2); + arg1 = (blpapi_ResolutionList_t *)(argp1); + ecode3 = SWIG_AsVal_size_t(obj1, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ResolutionList_messageAt" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Element_t *)blpapi_ResolutionList_extractAttributeFromResolutionSuccess((struct blpapi_Message const *)arg1,(struct blpapi_Name const *)arg2); + result = (int)blpapi_ResolutionList_messageAt((struct blpapi_ResolutionList const *)arg1,arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Element, 0 | 0 ); + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Message, 0)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - blpapi_ResolutionList_t *result = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ResolutionList_create",&obj0)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ResolutionList_size",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_create" "', argument " "1"" of type '" "blpapi_ResolutionList_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_size" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); } arg1 = (blpapi_ResolutionList_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_ResolutionList_t *)blpapi_ResolutionList_create(arg1); + result = (int)blpapi_ResolutionList_size((struct blpapi_ResolutionList const *)arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_TestUtil_createEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; + blpapi_Event_t **arg1 = (blpapi_Event_t **) 0 ; + int arg2 ; + blpapi_Event_t *temp1 = 0 ; + int val2 ; + int ecode2 = 0 ; PyObject * obj0 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ResolutionList_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_TestUtil_createEvent",&obj0)) SWIG_fail; + ecode2 = SWIG_AsVal_int(obj0, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_TestUtil_createEvent" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_TestUtil_createEvent(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_Event, 0)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_TestUtil_deserializeService(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + char *arg1 = (char *) 0 ; + size_t arg2 ; + blpapi_Service_t **arg3 = (blpapi_Service_t **) 0 ; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + blpapi_Service_t *temp3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; + + arg3 = &temp3; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TestUtil_deserializeService",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_destroy" "', argument " "1"" of type '" "blpapi_ResolutionList_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TestUtil_deserializeService" "', argument " "1"" of type '" "char const *""'"); } - arg1 = (blpapi_ResolutionList_t *)(argp1); + arg1 = (char *)(buf1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_TestUtil_deserializeService" "', argument " "2"" of type '" "size_t""'"); + } + arg2 = (size_t)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_ResolutionList_destroy(arg1); + result = (int)blpapi_TestUtil_deserializeService((char const *)arg1,arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_Py_Void(); + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg3), SWIGTYPE_p_blpapi_Service, 0)); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return resultobj; fail: + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_TestUtil_serializeService(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; - void *argp1 = 0 ; + blpapi_StreamWriter_t arg1 ; + void *arg2 = (void *) 0 ; + blpapi_Service_t *arg3 = (blpapi_Service_t *) 0 ; + void *argp1 ; int res1 = 0 ; int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; PyObject * obj0 = 0 ; @@ -17447,510 +19530,474 @@ SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_add(PyObject *SWIGUNUSEDPARM(se PyObject * obj2 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_ResolutionList_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_add" "', argument " "1"" of type '" "blpapi_ResolutionList_t *""'"); + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_TestUtil_serializeService",&obj0,&obj1,&obj2)) SWIG_fail; + { + res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_blpapi_StreamWriter_t, 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TestUtil_serializeService" "', argument " "1"" of type '" "blpapi_StreamWriter_t""'"); + } + if (!argp1) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "blpapi_TestUtil_serializeService" "', argument " "1"" of type '" "blpapi_StreamWriter_t""'"); + } else { + arg1 = *((blpapi_StreamWriter_t *)(argp1)); + } } - arg1 = (blpapi_ResolutionList_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2), 0, 0); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ResolutionList_add" "', argument " "2"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_TestUtil_serializeService" "', argument " "2"" of type '" "void *""'"); } - arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ResolutionList_add" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_TestUtil_serializeService" "', argument " "3"" of type '" "blpapi_Service_t const *""'"); } - arg3 = (blpapi_CorrelationId_t *)(argp3); + arg3 = (blpapi_Service_t *)(argp3); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ResolutionList_add(arg1,(char const *)arg2,(struct blpapi_CorrelationId_t_ const *)arg3); + result = (int)blpapi_TestUtil_serializeService(arg1,arg2,(struct blpapi_Service const *)arg3); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_addFromMessage(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_TestUtil_appendMessage(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - blpapi_Message_t *arg2 = (blpapi_Message_t *) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; + blpapi_MessageFormatter_t **arg1 = (blpapi_MessageFormatter_t **) 0 ; + blpapi_Event_t *arg2 = (blpapi_Event_t *) 0 ; + blpapi_SchemaElementDefinition_t *arg3 = (blpapi_SchemaElementDefinition_t *) 0 ; + blpapi_MessageProperties_t *arg4 = (blpapi_MessageProperties_t *) 0 ; + blpapi_MessageFormatter_t *temp1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_ResolutionList_addFromMessage",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_addFromMessage" "', argument " "1"" of type '" "blpapi_ResolutionList_t *""'"); - } - arg1 = (blpapi_ResolutionList_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_TestUtil_appendMessage",&obj0,&obj1,&obj2)) SWIG_fail; + res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_Event, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ResolutionList_addFromMessage" "', argument " "2"" of type '" "blpapi_Message_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_TestUtil_appendMessage" "', argument " "2"" of type '" "blpapi_Event_t *""'"); } - arg2 = (blpapi_Message_t *)(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + arg2 = (blpapi_Event_t *)(argp2); + res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ResolutionList_addFromMessage" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_TestUtil_appendMessage" "', argument " "3"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); } - arg3 = (blpapi_CorrelationId_t *)(argp3); + arg3 = (blpapi_SchemaElementDefinition_t *)(argp3); + res4 = SWIG_ConvertPtr(obj2, &argp4,SWIGTYPE_p_blpapi_MessageProperties, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_TestUtil_appendMessage" "', argument " "4"" of type '" "blpapi_MessageProperties_t const *""'"); + } + arg4 = (blpapi_MessageProperties_t *)(argp4); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ResolutionList_addFromMessage(arg1,(struct blpapi_Message const *)arg2,(struct blpapi_CorrelationId_t_ const *)arg3); + result = (int)blpapi_TestUtil_appendMessage(arg1,arg2,(struct blpapi_SchemaElementDefinition const *)arg3,(struct blpapi_MessageProperties const *)arg4); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_MessageFormatter, 0)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_addAttribute(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_TestUtil_createTopic(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; + blpapi_Topic_t **arg1 = (blpapi_Topic_t **) 0 ; + blpapi_Service_t *arg2 = (blpapi_Service_t *) 0 ; + int arg3 ; + blpapi_Topic_t *temp1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; + int val3 ; + int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_addAttribute",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_addAttribute" "', argument " "1"" of type '" "blpapi_ResolutionList_t *""'"); - } - arg1 = (blpapi_ResolutionList_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TestUtil_createTopic",&obj0,&obj1)) SWIG_fail; + res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ResolutionList_addAttribute" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_TestUtil_createTopic" "', argument " "2"" of type '" "blpapi_Service_t const *""'"); } - arg2 = (blpapi_Name_t *)(argp2); + arg2 = (blpapi_Service_t *)(argp2); + ecode3 = SWIG_AsVal_int(obj1, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_TestUtil_createTopic" "', argument " "3"" of type '" "int""'"); + } + arg3 = (int)(val3); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ResolutionList_addAttribute(arg1,(struct blpapi_Name const *)arg2); + result = (int)blpapi_TestUtil_createTopic(arg1,(struct blpapi_Service const *)arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_Topic, 0)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_correlationIdAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_TestUtil_getAdminMessageDefinition(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_CorrelationId_t temp2 ; - size_t val3 ; - int ecode3 = 0 ; + blpapi_SchemaElementDefinition_t **arg1 = (blpapi_SchemaElementDefinition_t **) 0 ; + blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; + blpapi_SchemaElementDefinition_t *temp1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; int result; - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_correlationIdAt",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_correlationIdAt" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_TestUtil_getAdminMessageDefinition",&obj0)) SWIG_fail; + res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_TestUtil_getAdminMessageDefinition" "', argument " "2"" of type '" "blpapi_Name_t *""'"); } - arg1 = (blpapi_ResolutionList_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ResolutionList_correlationIdAt" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); + arg2 = (blpapi_Name_t *)(argp2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ResolutionList_correlationIdAt((struct blpapi_ResolutionList const *)arg1,arg2,arg3); + result = (int)blpapi_TestUtil_getAdminMessageDefinition(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); - if (!result) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(CorrelationId_t_clone(arg2), SWIGTYPE_p_blpapi_CorrelationId_t_, SWIG_POINTER_OWN)); - } else { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_Py_Void()); - } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_SchemaElementDefinition, 0)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_topicString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_MessageProperties_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - char **arg2 = (char **) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - char *temp2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + blpapi_MessageProperties_t **arg1 = (blpapi_MessageProperties_t **) 0 ; + blpapi_MessageProperties_t *temp1 = 0 ; int result; - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_topicString",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_topicString" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); - } - arg1 = (blpapi_ResolutionList_t *)(argp1); - res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ResolutionList_topicString" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); - } - arg3 = (blpapi_CorrelationId_t *)(argp3); + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)":blpapi_MessageProperties_create")) SWIG_fail; { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ResolutionList_topicString((struct blpapi_ResolutionList const *)arg1,(char const **)arg2,(struct blpapi_CorrelationId_t_ const *)arg3); + result = (int)blpapi_MessageProperties_create(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_MessageProperties, 0)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_topicStringAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_MessageProperties_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - char **arg2 = (char **) 0 ; - size_t arg3 ; + blpapi_MessageProperties_t *arg1 = (blpapi_MessageProperties_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - char *temp2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_topicStringAt",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_MessageProperties_destroy",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageProperties, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_topicStringAt" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageProperties_destroy" "', argument " "1"" of type '" "blpapi_MessageProperties_t *""'"); } - arg1 = (blpapi_ResolutionList_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ResolutionList_topicStringAt" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); + arg1 = (blpapi_MessageProperties_t *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ResolutionList_topicStringAt((struct blpapi_ResolutionList const *)arg1,(char const **)arg2,arg3); + blpapi_MessageProperties_destroy(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_status(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_MessageProperties_copy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - int *arg2 = (int *) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int temp2 ; - void *argp3 = 0 ; - int res3 = 0 ; + blpapi_MessageProperties_t **arg1 = (blpapi_MessageProperties_t **) 0 ; + blpapi_MessageProperties_t *arg2 = (blpapi_MessageProperties_t *) 0 ; + blpapi_MessageProperties_t *temp1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; int result; - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_status",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_status" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); - } - arg1 = (blpapi_ResolutionList_t *)(argp1); - res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ResolutionList_status" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)"O:blpapi_MessageProperties_copy",&obj0)) SWIG_fail; + res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_MessageProperties, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageProperties_copy" "', argument " "2"" of type '" "blpapi_MessageProperties_t const *""'"); } - arg3 = (blpapi_CorrelationId_t *)(argp3); + arg2 = (blpapi_MessageProperties_t *)(argp2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ResolutionList_status((struct blpapi_ResolutionList const *)arg1,arg2,(struct blpapi_CorrelationId_t_ const *)arg3); + result = (int)blpapi_MessageProperties_copy(arg1,(struct blpapi_MessageProperties const *)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, PyInt_FromLong(*arg2)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_MessageProperties, 0)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_statusAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_MessageProperties_assign(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - int *arg2 = (int *) 0 ; - size_t arg3 ; + blpapi_MessageProperties_t *arg1 = (blpapi_MessageProperties_t *) 0 ; + blpapi_MessageProperties_t *arg2 = (blpapi_MessageProperties_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - int temp2 ; - size_t val3 ; - int ecode3 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_statusAt",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_MessageProperties_assign",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageProperties, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_statusAt" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageProperties_assign" "', argument " "1"" of type '" "blpapi_MessageProperties_t *""'"); } - arg1 = (blpapi_ResolutionList_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ResolutionList_statusAt" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); + arg1 = (blpapi_MessageProperties_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_MessageProperties, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageProperties_assign" "', argument " "2"" of type '" "blpapi_MessageProperties_t const *""'"); + } + arg2 = (blpapi_MessageProperties_t *)(argp2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ResolutionList_statusAt((struct blpapi_ResolutionList const *)arg1,arg2,arg3); + result = (int)blpapi_MessageProperties_assign(arg1,(struct blpapi_MessageProperties const *)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, PyInt_FromLong(*arg2)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_attribute(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_MessageProperties_setCorrelationIds(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - blpapi_Element_t **arg2 = (blpapi_Element_t **) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - blpapi_CorrelationId_t *arg4 = (blpapi_CorrelationId_t *) 0 ; + blpapi_MessageProperties_t *arg1 = (blpapi_MessageProperties_t *) 0 ; + blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; + size_t arg3 ; void *argp1 = 0 ; int res1 = 0 ; - blpapi_Element_t *temp2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; int result; - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_ResolutionList_attribute",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_attribute" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); - } - arg1 = (blpapi_ResolutionList_t *)(argp1); - res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ResolutionList_attribute" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = (blpapi_Name_t *)(argp3); - res4 = SWIG_ConvertPtr(obj2, &argp4,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_ResolutionList_attribute" "', argument " "4"" of type '" "blpapi_CorrelationId_t const *""'"); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_MessageProperties_setCorrelationIds",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageProperties, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageProperties_setCorrelationIds" "', argument " "1"" of type '" "blpapi_MessageProperties_t *""'"); + } + arg1 = (blpapi_MessageProperties_t *)(argp1); + { + int sz = PyList_Size(obj1); + int res = 0; + arg2 = 0; + arg3 = sz; + if(sz) { + /* Define loop index at the top because old VisualStudio compilers */ + /* don't like variable declarations inside for-statements. */ + int i = 0; + arg2 = (blpapi_CorrelationId_t*) malloc(sizeof(blpapi_CorrelationId_t) * sz); + /* We are ignoring possible errors for malloc return value. */ + /* There aren't any perfect solutions for failure to allocate here, */ + /* and SWIG also seems to ignore this in its own generated code. */ + for(; i < sz; ++i) { + PyObject * thing = PyList_GetItem(obj1, i); + void* argp; + res = SWIG_ConvertPtr(thing, &argp, SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res)) { + SWIG_exception_fail(SWIG_ArgError(res), "in method '" "blpapi_MessageProperties_setCorrelationIds" "', argument " "2"" of type '" "blpapi_CorrelationId_t const *""'"); + } + arg2[i] = *(blpapi_CorrelationId_t*)argp; + } + } } - arg4 = (blpapi_CorrelationId_t *)(argp4); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ResolutionList_attribute((struct blpapi_ResolutionList const *)arg1,arg2,(struct blpapi_Name const *)arg3,(struct blpapi_CorrelationId_t_ const *)arg4); + result = (int)blpapi_MessageProperties_setCorrelationIds(arg1,(struct blpapi_CorrelationId_t_ const *)arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Element, 0)); + { + if(arg2) free(arg2); + } return resultobj; fail: + { + if(arg2) free(arg2); + } return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_attributeAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_MessageProperties_setRecapType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - blpapi_Element_t **arg2 = (blpapi_Element_t **) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - size_t arg4 ; + blpapi_MessageProperties_t *arg1 = (blpapi_MessageProperties_t *) 0 ; + int arg2 ; + int arg3 ; void *argp1 = 0 ; int res1 = 0 ; - blpapi_Element_t *temp2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; int result; - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_ResolutionList_attributeAt",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_MessageProperties_setRecapType",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageProperties, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_attributeAt" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); - } - arg1 = (blpapi_ResolutionList_t *)(argp1); - res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ResolutionList_attributeAt" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageProperties_setRecapType" "', argument " "1"" of type '" "blpapi_MessageProperties_t *""'"); } - arg3 = (blpapi_Name_t *)(argp3); - ecode4 = SWIG_AsVal_size_t(obj2, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_ResolutionList_attributeAt" "', argument " "4"" of type '" "size_t""'"); + arg1 = (blpapi_MessageProperties_t *)(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_MessageProperties_setRecapType" "', argument " "2"" of type '" "int""'"); } - arg4 = (size_t)(val4); + arg2 = (int)(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_MessageProperties_setRecapType" "', argument " "3"" of type '" "int""'"); + } + arg3 = (int)(val3); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ResolutionList_attributeAt((struct blpapi_ResolutionList const *)arg1,arg2,(struct blpapi_Name const *)arg3,arg4); + result = (int)blpapi_MessageProperties_setRecapType(arg1,arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Element, 0)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_message(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_MessageProperties_setTimeReceived(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - blpapi_Message_t **arg2 = (blpapi_Message_t **) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; + blpapi_MessageProperties_t *arg1 = (blpapi_MessageProperties_t *) 0 ; + blpapi_HighPrecisionDatetime_t *arg2 = (blpapi_HighPrecisionDatetime_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - blpapi_Message_t *temp2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_message",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_MessageProperties_setTimeReceived",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageProperties, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_message" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageProperties_setTimeReceived" "', argument " "1"" of type '" "blpapi_MessageProperties_t *""'"); } - arg1 = (blpapi_ResolutionList_t *)(argp1); - res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ResolutionList_message" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); + arg1 = (blpapi_MessageProperties_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageProperties_setTimeReceived" "', argument " "2"" of type '" "blpapi_HighPrecisionDatetime_t const *""'"); } - arg3 = (blpapi_CorrelationId_t *)(argp3); + arg2 = (blpapi_HighPrecisionDatetime_t *)(argp2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ResolutionList_message((struct blpapi_ResolutionList const *)arg1,arg2,(struct blpapi_CorrelationId_t_ const *)arg3); + result = (int)blpapi_MessageProperties_setTimeReceived(arg1,(struct blpapi_HighPrecisionDatetime_tag const *)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Message, 0)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_messageAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_MessageProperties_setService(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - blpapi_Message_t **arg2 = (blpapi_Message_t **) 0 ; - size_t arg3 ; + blpapi_MessageProperties_t *arg1 = (blpapi_MessageProperties_t *) 0 ; + blpapi_Service_t *arg2 = (blpapi_Service_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - blpapi_Message_t *temp2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_messageAt",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_MessageProperties_setService",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageProperties, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_messageAt" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageProperties_setService" "', argument " "1"" of type '" "blpapi_MessageProperties_t *""'"); } - arg1 = (blpapi_ResolutionList_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ResolutionList_messageAt" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); + arg1 = (blpapi_MessageProperties_t *)(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageProperties_setService" "', argument " "2"" of type '" "blpapi_Service_t const *""'"); + } + arg2 = (blpapi_Service_t *)(argp2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ResolutionList_messageAt((struct blpapi_ResolutionList const *)arg1,arg2,arg3); + result = (int)blpapi_MessageProperties_setService(arg1,(struct blpapi_Service const *)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Message, 0)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_MessageProperties_setRequestId(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; + blpapi_MessageProperties_t *arg1 = (blpapi_MessageProperties_t *) 0 ; + char *arg2 = (char *) 0 ; void *argp1 = 0 ; int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ResolutionList_size",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_MessageProperties_setRequestId",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageProperties, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_size" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageProperties_setRequestId" "', argument " "1"" of type '" "blpapi_MessageProperties_t *""'"); } - arg1 = (blpapi_ResolutionList_t *)(argp1); + arg1 = (blpapi_MessageProperties_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageProperties_setRequestId" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ResolutionList_size((struct blpapi_ResolutionList const *)arg1); + result = (int)blpapi_MessageProperties_setRequestId(arg1,(char const *)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -19826,6 +21873,7 @@ SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_setGroupId(PyObject unsigned int arg3 ; void *argp1 = 0 ; int res1 = 0 ; + PyObject *asAscii2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -19836,8 +21884,21 @@ SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_setGroupId(PyObject } arg1 = (blpapi_ServiceRegistrationOptions_t *)(argp1); { - arg2 = PyString_AsString(obj1); - arg3 = PyString_Size(obj1); + if (obj1 == Py_None) { + arg2 = 0; + arg3 = 0; + } + else { + if(PyUnicode_Check(obj1)) { + asAscii2 = PyUnicode_AsASCIIString(obj1); + arg2 = PyString_AsString(asAscii2); + arg3 = PyString_Size(asAscii2); + } + else { + arg2 = PyString_AsString(obj1); + arg3 = PyString_Size(obj1); + } + } } { if (!arg2) { @@ -19850,8 +21911,18 @@ SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_setGroupId(PyObject SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_Py_Void(); + { + if(asAscii2) { + Py_DECREF(asAscii2); + } + } return resultobj; fail: + { + if(asAscii2) { + Py_DECREF(asAscii2); + } + } return NULL; } @@ -20067,7 +22138,9 @@ static PyMethodDef SwigMethods[] = { { (char *)"blpapi_Service_printHelper", _wrap_blpapi_Service_printHelper, METH_VARARGS, NULL}, { (char *)"blpapi_SchemaElementDefinition_printHelper", _wrap_blpapi_SchemaElementDefinition_printHelper, METH_VARARGS, NULL}, { (char *)"blpapi_SchemaTypeDefinition_printHelper", _wrap_blpapi_SchemaTypeDefinition_printHelper, METH_VARARGS, NULL}, + { (char *)"blpapi_Message_printHelper", _wrap_blpapi_Message_printHelper, METH_VARARGS, NULL}, { (char *)"blpapi_SessionOptions_printHelper", _wrap_blpapi_SessionOptions_printHelper, METH_VARARGS, NULL}, + { (char *)"blpapi_TestUtil_serializeServiceHelper", _wrap_blpapi_TestUtil_serializeServiceHelper, METH_VARARGS, NULL}, { (char *)"blpapi_SchemaTypeDefinition_hasElementDefinition", _wrap_blpapi_SchemaTypeDefinition_hasElementDefinition, METH_VARARGS, NULL}, { (char *)"blpapi_ConstantList_hasConstant", _wrap_blpapi_ConstantList_hasConstant, METH_VARARGS, NULL}, { (char *)"blpapi_Service_hasEventDefinition", _wrap_blpapi_Service_hasEventDefinition, METH_VARARGS, NULL}, @@ -20197,6 +22270,37 @@ static PyMethodDef SwigMethods[] = { { (char *)"ProviderSession_createHelper", _wrap_ProviderSession_createHelper, METH_VARARGS, NULL}, { (char *)"ProviderSession_destroyHelper", _wrap_ProviderSession_destroyHelper, METH_VARARGS, NULL}, { (char *)"ProviderSession_terminateSubscriptionsOnTopic", _wrap_ProviderSession_terminateSubscriptionsOnTopic, METH_VARARGS, NULL}, + { (char *)"blpapi_MessageFormatter_setValueFloat", _wrap_blpapi_MessageFormatter_setValueFloat, METH_VARARGS, NULL}, + { (char *)"blpapi_MessageFormatter_appendValueFloat", _wrap_blpapi_MessageFormatter_appendValueFloat, METH_VARARGS, NULL}, + { (char *)"blpapi_MessageFormatter_setValueBool", _wrap_blpapi_MessageFormatter_setValueBool, METH_VARARGS, NULL}, + { (char *)"blpapi_MessageFormatter_setValueChar", _wrap_blpapi_MessageFormatter_setValueChar, METH_VARARGS, NULL}, + { (char *)"blpapi_MessageFormatter_setValueInt32", _wrap_blpapi_MessageFormatter_setValueInt32, METH_VARARGS, NULL}, + { (char *)"blpapi_MessageFormatter_setValueInt64", _wrap_blpapi_MessageFormatter_setValueInt64, METH_VARARGS, NULL}, + { (char *)"blpapi_MessageFormatter_setValueFloat32", _wrap_blpapi_MessageFormatter_setValueFloat32, METH_VARARGS, NULL}, + { (char *)"blpapi_MessageFormatter_setValueFloat64", _wrap_blpapi_MessageFormatter_setValueFloat64, METH_VARARGS, NULL}, + { (char *)"blpapi_MessageFormatter_setValueDatetime", _wrap_blpapi_MessageFormatter_setValueDatetime, METH_VARARGS, NULL}, + { (char *)"blpapi_MessageFormatter_setValueHighPrecisionDatetime", _wrap_blpapi_MessageFormatter_setValueHighPrecisionDatetime, METH_VARARGS, NULL}, + { (char *)"blpapi_MessageFormatter_setValueString", _wrap_blpapi_MessageFormatter_setValueString, METH_VARARGS, NULL}, + { (char *)"blpapi_MessageFormatter_setValueFromName", _wrap_blpapi_MessageFormatter_setValueFromName, METH_VARARGS, NULL}, + { (char *)"blpapi_MessageFormatter_setValueNull", _wrap_blpapi_MessageFormatter_setValueNull, METH_VARARGS, NULL}, + { (char *)"blpapi_MessageFormatter_pushElement", _wrap_blpapi_MessageFormatter_pushElement, METH_VARARGS, NULL}, + { (char *)"blpapi_MessageFormatter_popElement", _wrap_blpapi_MessageFormatter_popElement, METH_VARARGS, NULL}, + { (char *)"blpapi_MessageFormatter_appendValueBool", _wrap_blpapi_MessageFormatter_appendValueBool, METH_VARARGS, NULL}, + { (char *)"blpapi_MessageFormatter_appendValueChar", _wrap_blpapi_MessageFormatter_appendValueChar, METH_VARARGS, NULL}, + { (char *)"blpapi_MessageFormatter_appendValueInt32", _wrap_blpapi_MessageFormatter_appendValueInt32, METH_VARARGS, NULL}, + { (char *)"blpapi_MessageFormatter_appendValueInt64", _wrap_blpapi_MessageFormatter_appendValueInt64, METH_VARARGS, NULL}, + { (char *)"blpapi_MessageFormatter_appendValueFloat32", _wrap_blpapi_MessageFormatter_appendValueFloat32, METH_VARARGS, NULL}, + { (char *)"blpapi_MessageFormatter_appendValueFloat64", _wrap_blpapi_MessageFormatter_appendValueFloat64, METH_VARARGS, NULL}, + { (char *)"blpapi_MessageFormatter_appendValueDatetime", _wrap_blpapi_MessageFormatter_appendValueDatetime, METH_VARARGS, NULL}, + { (char *)"blpapi_MessageFormatter_appendValueHighPrecisionDatetime", _wrap_blpapi_MessageFormatter_appendValueHighPrecisionDatetime, METH_VARARGS, NULL}, + { (char *)"blpapi_MessageFormatter_appendValueString", _wrap_blpapi_MessageFormatter_appendValueString, METH_VARARGS, NULL}, + { (char *)"blpapi_MessageFormatter_appendValueFromName", _wrap_blpapi_MessageFormatter_appendValueFromName, METH_VARARGS, NULL}, + { (char *)"blpapi_MessageFormatter_appendElement", _wrap_blpapi_MessageFormatter_appendElement, METH_VARARGS, NULL}, + { (char *)"blpapi_MessageFormatter_FormatMessageJson", _wrap_blpapi_MessageFormatter_FormatMessageJson, METH_VARARGS, NULL}, + { (char *)"blpapi_MessageFormatter_FormatMessageXml", _wrap_blpapi_MessageFormatter_FormatMessageXml, METH_VARARGS, NULL}, + { (char *)"blpapi_MessageFormatter_copy", _wrap_blpapi_MessageFormatter_copy, METH_VARARGS, NULL}, + { (char *)"blpapi_MessageFormatter_assign", _wrap_blpapi_MessageFormatter_assign, METH_VARARGS, NULL}, + { (char *)"blpapi_MessageFormatter_destroy", _wrap_blpapi_MessageFormatter_destroy, METH_VARARGS, NULL}, { (char *)"blpapi_AuthOptions_create_default", _wrap_blpapi_AuthOptions_create_default, METH_VARARGS, NULL}, { (char *)"blpapi_AuthOptions_create_forUserMode", _wrap_blpapi_AuthOptions_create_forUserMode, METH_VARARGS, NULL}, { (char *)"blpapi_AuthOptions_create_forAppMode", _wrap_blpapi_AuthOptions_create_forAppMode, METH_VARARGS, NULL}, @@ -20335,7 +22439,10 @@ static PyMethodDef SwigMethods[] = { { (char *)"blpapi_Constant_description", _wrap_blpapi_Constant_description, METH_VARARGS, NULL}, { (char *)"blpapi_Constant_status", _wrap_blpapi_Constant_status, METH_VARARGS, NULL}, { (char *)"blpapi_Constant_datatype", _wrap_blpapi_Constant_datatype, METH_VARARGS, NULL}, + { (char *)"blpapi_Constant_getValueAsChar", _wrap_blpapi_Constant_getValueAsChar, METH_VARARGS, NULL}, + { (char *)"blpapi_Constant_getValueAsInt32", _wrap_blpapi_Constant_getValueAsInt32, METH_VARARGS, NULL}, { (char *)"blpapi_Constant_getValueAsInt64", _wrap_blpapi_Constant_getValueAsInt64, METH_VARARGS, NULL}, + { (char *)"blpapi_Constant_getValueAsFloat32", _wrap_blpapi_Constant_getValueAsFloat32, METH_VARARGS, NULL}, { (char *)"blpapi_Constant_getValueAsFloat64", _wrap_blpapi_Constant_getValueAsFloat64, METH_VARARGS, NULL}, { (char *)"blpapi_Constant_getValueAsDatetime", _wrap_blpapi_Constant_getValueAsDatetime, METH_VARARGS, NULL}, { (char *)"blpapi_Constant_getValueAsString", _wrap_blpapi_Constant_getValueAsString, METH_VARARGS, NULL}, @@ -20368,6 +22475,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"blpapi_Request_destroy", _wrap_blpapi_Request_destroy, METH_VARARGS, NULL}, { (char *)"blpapi_Request_elements", _wrap_blpapi_Request_elements, METH_VARARGS, NULL}, { (char *)"blpapi_Request_setPreferredRoute", _wrap_blpapi_Request_setPreferredRoute, METH_VARARGS, NULL}, + { (char *)"blpapi_Request_getRequestId", _wrap_blpapi_Request_getRequestId, METH_VARARGS, NULL}, { (char *)"blpapi_RequestTemplate_release", _wrap_blpapi_RequestTemplate_release, METH_VARARGS, NULL}, { (char *)"blpapi_Operation_name", _wrap_blpapi_Operation_name, METH_VARARGS, NULL}, { (char *)"blpapi_Operation_description", _wrap_blpapi_Operation_description, METH_VARARGS, NULL}, @@ -20396,10 +22504,10 @@ static PyMethodDef SwigMethods[] = { { (char *)"blpapi_Message_service", _wrap_blpapi_Message_service, METH_VARARGS, NULL}, { (char *)"blpapi_Message_numCorrelationIds", _wrap_blpapi_Message_numCorrelationIds, METH_VARARGS, NULL}, { (char *)"blpapi_Message_correlationId", _wrap_blpapi_Message_correlationId, METH_VARARGS, NULL}, + { (char *)"blpapi_Message_getRequestId", _wrap_blpapi_Message_getRequestId, METH_VARARGS, NULL}, { (char *)"blpapi_Message_elements", _wrap_blpapi_Message_elements, METH_VARARGS, NULL}, { (char *)"blpapi_Message_fragmentType", _wrap_blpapi_Message_fragmentType, METH_VARARGS, NULL}, { (char *)"blpapi_Message_recapType", _wrap_blpapi_Message_recapType, METH_VARARGS, NULL}, - { (char *)"blpapi_Message_print", _wrap_blpapi_Message_print, METH_VARARGS, NULL}, { (char *)"blpapi_Message_addRef", _wrap_blpapi_Message_addRef, METH_VARARGS, NULL}, { (char *)"blpapi_Message_release", _wrap_blpapi_Message_release, METH_VARARGS, NULL}, { (char *)"blpapi_Message_timeReceived", _wrap_blpapi_Message_timeReceived, METH_VARARGS, NULL}, @@ -20460,6 +22568,21 @@ static PyMethodDef SwigMethods[] = { { (char *)"blpapi_ResolutionList_message", _wrap_blpapi_ResolutionList_message, METH_VARARGS, NULL}, { (char *)"blpapi_ResolutionList_messageAt", _wrap_blpapi_ResolutionList_messageAt, METH_VARARGS, NULL}, { (char *)"blpapi_ResolutionList_size", _wrap_blpapi_ResolutionList_size, METH_VARARGS, NULL}, + { (char *)"blpapi_TestUtil_createEvent", _wrap_blpapi_TestUtil_createEvent, METH_VARARGS, NULL}, + { (char *)"blpapi_TestUtil_deserializeService", _wrap_blpapi_TestUtil_deserializeService, METH_VARARGS, NULL}, + { (char *)"blpapi_TestUtil_serializeService", _wrap_blpapi_TestUtil_serializeService, METH_VARARGS, NULL}, + { (char *)"blpapi_TestUtil_appendMessage", _wrap_blpapi_TestUtil_appendMessage, METH_VARARGS, NULL}, + { (char *)"blpapi_TestUtil_createTopic", _wrap_blpapi_TestUtil_createTopic, METH_VARARGS, NULL}, + { (char *)"blpapi_TestUtil_getAdminMessageDefinition", _wrap_blpapi_TestUtil_getAdminMessageDefinition, METH_VARARGS, NULL}, + { (char *)"blpapi_MessageProperties_create", _wrap_blpapi_MessageProperties_create, METH_VARARGS, NULL}, + { (char *)"blpapi_MessageProperties_destroy", _wrap_blpapi_MessageProperties_destroy, METH_VARARGS, NULL}, + { (char *)"blpapi_MessageProperties_copy", _wrap_blpapi_MessageProperties_copy, METH_VARARGS, NULL}, + { (char *)"blpapi_MessageProperties_assign", _wrap_blpapi_MessageProperties_assign, METH_VARARGS, NULL}, + { (char *)"blpapi_MessageProperties_setCorrelationIds", _wrap_blpapi_MessageProperties_setCorrelationIds, METH_VARARGS, NULL}, + { (char *)"blpapi_MessageProperties_setRecapType", _wrap_blpapi_MessageProperties_setRecapType, METH_VARARGS, NULL}, + { (char *)"blpapi_MessageProperties_setTimeReceived", _wrap_blpapi_MessageProperties_setTimeReceived, METH_VARARGS, NULL}, + { (char *)"blpapi_MessageProperties_setService", _wrap_blpapi_MessageProperties_setService, METH_VARARGS, NULL}, + { (char *)"blpapi_MessageProperties_setRequestId", _wrap_blpapi_MessageProperties_setRequestId, METH_VARARGS, NULL}, { (char *)"blpapi_Topic_create", _wrap_blpapi_Topic_create, METH_VARARGS, NULL}, { (char *)"blpapi_Topic_destroy", _wrap_blpapi_Topic_destroy, METH_VARARGS, NULL}, { (char *)"blpapi_Topic_compare", _wrap_blpapi_Topic_compare, METH_VARARGS, NULL}, @@ -20582,6 +22705,8 @@ static swig_type_info _swigt__p_p_blpapi_Element = {"_p_p_blpapi_Element", "stru static swig_type_info _swigt__p_p_blpapi_Event = {"_p_p_blpapi_Event", "struct blpapi_Event **|blpapi_Event_t **", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_p_blpapi_Identity = {"_p_p_blpapi_Identity", "blpapi_Identity_t **|struct blpapi_Identity **", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_p_blpapi_Message = {"_p_p_blpapi_Message", "blpapi_Message_t **|struct blpapi_Message **", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_p_blpapi_MessageFormatter = {"_p_p_blpapi_MessageFormatter", "struct blpapi_MessageFormatter **|blpapi_MessageFormatter_t **", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_p_blpapi_MessageProperties = {"_p_p_blpapi_MessageProperties", "struct blpapi_MessageProperties **|blpapi_MessageProperties_t **", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_p_blpapi_Name = {"_p_p_blpapi_Name", "struct blpapi_Name **|blpapi_Name_t **", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_p_blpapi_Operation = {"_p_p_blpapi_Operation", "struct blpapi_Operation **|blpapi_Operation_t **", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_p_blpapi_Request = {"_p_p_blpapi_Request", "blpapi_Request_t **|struct blpapi_Request **", 0, 0, (void*)0, 0}; @@ -20655,6 +22780,8 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_p_blpapi_Event, &_swigt__p_p_blpapi_Identity, &_swigt__p_p_blpapi_Message, + &_swigt__p_p_blpapi_MessageFormatter, + &_swigt__p_p_blpapi_MessageProperties, &_swigt__p_p_blpapi_Name, &_swigt__p_p_blpapi_Operation, &_swigt__p_p_blpapi_Request, @@ -20728,6 +22855,8 @@ static swig_cast_info _swigc__p_p_blpapi_Element[] = { {&_swigt__p_p_blpapi_Ele static swig_cast_info _swigc__p_p_blpapi_Event[] = { {&_swigt__p_p_blpapi_Event, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_p_blpapi_Identity[] = { {&_swigt__p_p_blpapi_Identity, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_p_blpapi_Message[] = { {&_swigt__p_p_blpapi_Message, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_p_blpapi_MessageFormatter[] = { {&_swigt__p_p_blpapi_MessageFormatter, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_p_blpapi_MessageProperties[] = { {&_swigt__p_p_blpapi_MessageProperties, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_p_blpapi_Name[] = { {&_swigt__p_p_blpapi_Name, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_p_blpapi_Operation[] = { {&_swigt__p_p_blpapi_Operation, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_p_blpapi_Request[] = { {&_swigt__p_p_blpapi_Request, 0, 0, 0},{0, 0, 0, 0}}; @@ -20801,6 +22930,8 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_p_blpapi_Event, _swigc__p_p_blpapi_Identity, _swigc__p_p_blpapi_Message, + _swigc__p_p_blpapi_MessageFormatter, + _swigc__p_p_blpapi_MessageProperties, _swigc__p_p_blpapi_Name, _swigc__p_p_blpapi_Operation, _swigc__p_p_blpapi_Request, diff --git a/blpapi/logging.py b/blpapi/logging.py index ce19796..af57575 100644 --- a/blpapi/logging.py +++ b/blpapi/logging.py @@ -6,10 +6,10 @@ register a callback for logging""" from __future__ import absolute_import -from datetime import datetime from blpapi import internals from . import utils from .compat import with_metaclass +from .datetime import _DatetimeUtil @with_metaclass(utils.MetaClassForClassesWithEnums) class Logger: @@ -25,6 +25,8 @@ class Logger: SEVERITY_DEBUG = internals.blpapi_Logging_SEVERITY_DEBUG SEVERITY_TRACE = internals.blpapi_Logging_SEVERITY_TRACE + loggerCallbacksLocal = [] # needed for temporary ref. holding + @staticmethod def registerCallback(callback, thresholdSeverity=SEVERITY_INFO): """Register the specified 'callback' that will be called for all log @@ -32,17 +34,26 @@ def registerCallback(callback, thresholdSeverity=SEVERITY_INFO): 'thresholdSeverity'. The callback needs to be registered before the start of all sessions. If this function is called multiple times, only the last registered callback will take effect. An exception of type - 'RuntimeError' will be thrown if 'callback' cannot be registered.""" + 'RuntimeError' will be thrown if 'callback' cannot be registered. + If callback is None, any existing callback shall be removed.""" def callbackWrapper(threadId, severity, ts, category, message): - dt = datetime.fromtimestamp(ts) + dt = _DatetimeUtil.convertToNativeNotHighPrecision(ts) callback(threadId, severity, dt, category, message) + callbackRef = None if callback is None else callbackWrapper + # we store a reference to callbackWrapper (that binds callback) + # for as long as it may be needed, i.e. until gc or re-register + Logger.loggerCallbacksLocal.append(callbackRef) err_code = internals.setLoggerCallbackWrapper( - callbackWrapper, thresholdSeverity) + callbackRef, thresholdSeverity) + + if len(Logger.loggerCallbacksLocal) > 1: + # we have a new cb now, let the previous one go + Logger.loggerCallbacksLocal.pop(0) if err_code == -1: raise ValueError("parameter must be a function") - elif err_code == -2: + if err_code == -2: raise RuntimeError("unable to register callback") @staticmethod diff --git a/blpapi/message.py b/blpapi/message.py index 0137a91..5bdc13b 100644 --- a/blpapi/message.py +++ b/blpapi/message.py @@ -10,13 +10,13 @@ from __future__ import absolute_import import sys -import warnings import weakref from blpapi.datetime import _DatetimeUtil, UTC from .element import Element +from .exception import _ExceptionUtil from .name import Name from . import internals -from . import utils +from .utils import deprecated, MetaClassForClassesWithEnums from .compat import with_metaclass # pylint: disable=useless-object-inheritance,protected-access @@ -28,7 +28,7 @@ from . import service -@with_metaclass(utils.MetaClassForClassesWithEnums) +@with_metaclass(MetaClassForClassesWithEnums) class Message(object): """A handle to a single message. @@ -140,6 +140,7 @@ def recapType(self): return internals.blpapi_Message_recapType(self.__handle) + @deprecated def topicName(self): """ Returns: @@ -161,11 +162,6 @@ def topicName(self): their application to help retrieve the topic name associated with the cid's present in the delivered message. """ - - warnings.warn( - "This method is deprecated, see docstring for details", - DeprecationWarning) - return internals.blpapi_Message_topicName(self.__handle) def service(self): @@ -243,6 +239,24 @@ def getElementAsDatetime(self, name): `.""" return self.asElement().getElementAsDatetime(name) + def getRequestId(self): + """Return the message's request id if one exists, otherwise return + ``None``. + + When present, the request id can be reported to Bloomberg to + troubleshoot the cause of failure messages, or issues with the data + contained in the message. + + Note that request id is not the same as correlation id and should + not be used for correlation purposes. + + Returns: + str: The request id of the message. + """ + rc, requestId = internals.blpapi_Message_getRequestId(self.__handle) + _ExceptionUtil.raiseOnError(rc) + return requestId + def asElement(self): """ Returns: @@ -274,7 +288,10 @@ def toString(self, level=0, spacesPerLevel=4): ``spacesPerLevel`` is negative, format the entire output on one line, suppressing all but the initial indentation (as governed by ``level``). """ - return self.asElement().toString(level, spacesPerLevel) + return internals.blpapi_Message_printHelper( + self.__handle, + level, + spacesPerLevel) def timeReceived(self, tzinfo=UTC): """Get the time when the message was received by the SDK. diff --git a/blpapi/providersession.py b/blpapi/providersession.py index 585654b..48212b2 100644 --- a/blpapi/providersession.py +++ b/blpapi/providersession.py @@ -76,7 +76,7 @@ from .utils import get_handle from .compat import with_metaclass -# pylint: disable=line-too-long,bad-continuation,useless-object-inheritance,too-many-lines +# pylint: disable=line-too-long,useless-object-inheritance,too-many-lines # pylint: disable=protected-access,too-many-public-methods,bare-except,too-many-function-args @with_metaclass(utils.MetaClassForClassesWithEnums) @@ -160,9 +160,7 @@ def setGroupId(self, groupId): are considered as Group Id. """ internals.blpapi_ServiceRegistrationOptions_setGroupId( - self.__handle, groupId.encode('utf-8')) - # NOTE: we should convert groupId to bytes here because - # otherwise we'll get an error in SWIG wrapper. + self.__handle, groupId) def setServicePriority(self, priority): """Set the priority with which a subscription service will be @@ -301,7 +299,7 @@ class ProviderSession(AbstractSession): __handlerProxy = None @staticmethod - def __dispatchEvent(sessionRef, eventHandle): + def __dispatchEvent(sessionRef, eventHandle): # pragma: no cover """Use sessions ref to dispatch an event""" try: session = sessionRef() diff --git a/blpapi/request.py b/blpapi/request.py index d6e4880..aeed537 100644 --- a/blpapi/request.py +++ b/blpapi/request.py @@ -9,6 +9,7 @@ import weakref from .element import Element +from .exception import _ExceptionUtil from . import internals # pylint: disable=useless-object-inheritance @@ -88,6 +89,23 @@ def getElement(self, name): `.""" return self.asElement().getElement(name) + def getRequestId(self): + """ + Return the request's id if one exists, otherwise return ``None``. + + If there are issues with this request, the request id + can be reported to Bloomberg for troubleshooting purposes. + + Note that request id is not the same as correlation + id and should not be used for correlation purposes. + + Returns: + str: The request id of the request. + """ + rc, requestId = internals.blpapi_Request_getRequestId(self.__handle) + _ExceptionUtil.raiseOnError(rc) + return requestId + def toString(self, level=0, spacesPerLevel=4): """Equivalent to :meth:`asElement().toString(level, spacesPerLevel) `.""" diff --git a/blpapi/resolutionlist.py b/blpapi/resolutionlist.py index 133f86a..8d4c25b 100644 --- a/blpapi/resolutionlist.py +++ b/blpapi/resolutionlist.py @@ -5,13 +5,11 @@ This component implements a list of topics that require resolution. """ -from .element import Element from .exception import _ExceptionUtil from .message import Message -from .name import Name from . import internals from . import utils -from .utils import get_handle +from .utils import deprecated, get_handle from .internals import CorrelationId from .compat import with_metaclass @@ -43,29 +41,17 @@ class ResolutionList(object): internals.RESOLUTIONLIST_RESOLUTION_FAILURE_TOPIC_AUTHORIZATION_FAILED @staticmethod + @deprecated("attributes are no longer supported.") + # pylint: disable=unused-argument,no-self-use def extractAttributeFromResolutionSuccess(message, attribute): - """Return the value of the value in the specified ``message``. - - Args: - message (Message): Message to extract the attribute from - attribute (Name): Attribute to extract + """ + Raises: + UnsupportedOperationException: Unconditionally. - Returns: - Element: Value of the value in the specified ``message`` which - represents the specified ``attribute``. If the ``attribute`` is not - present an empty :class:`Element` is returned. - - The ``message`` must be a message of type ``RESOLUTION_SUCCESS``. The - ``attribute`` should be an attribute that was requested using - :meth:`addAttribute()` on the :class:`ResolutionList` passed to the - :meth:`~ProviderSession.resolve()` or - :meth:`~ProviderSession.resolveAsync()` that caused this - ``RESOLUTION_SUCCESS`` message. + **DEPRECATED** + Attributes are no longer supported. """ - i = internals # to fit next line in 79 chars - res = i.blpapi_ResolutionList_extractAttributeFromResolutionSuccess( - get_handle(message), get_handle(attribute)) - return Element(res, message) + _ExceptionUtil.raiseOnError(internals.ERROR_UNSUPPORTED_OPERATION) def __init__(self): """Create an empty :class:`ResolutionList`.""" @@ -125,18 +111,17 @@ def add(self, topicOrMessage, correlationId=None): topicOrMessage, get_handle(correlationId)) + @deprecated("attributes are no longer supported.") + # pylint: disable=unused-argument,no-self-use def addAttribute(self, attribute): - """Add the specified ``attribute`` to the list of attributes. - - Args: - attribute (str): Attribute to add + """ + Raises: + UnsupportedOperationException: Unconditionally. - Returns: - int: ``0`` on success, negative number on failure. + **DEPRECATED** + Attributes are no longer supported. """ - attribute = Name(attribute) - return internals.blpapi_ResolutionList_addAttribute( - self.__handle, get_handle(attribute)) + _ExceptionUtil.raiseOnError(internals.ERROR_UNSUPPORTED_OPERATION) def correlationIdAt(self, index): """ @@ -235,57 +220,31 @@ def statusAt(self, index): _ExceptionUtil.raiseOnError(errorCode) return status + @deprecated("attributes are no longer supported") + # pylint: disable=unused-argument,no-self-use def attribute(self, attribute, correlationId): """ - Args: - attribute (str): Attribute of the entry - correlationId (CorrelationId): Correlation id identifying an entry - in this list - - Returns: - Element: Value for the specified ``attribute`` of this list entry. - Raises: - Exception: If ``correlationId`` does not identify an entry in this - :class:`ResolutionList` or if the status of the entry - identified by ``correlationId`` is not ``RESOLVED``. + UnsupportedOperationException: Unconditionally. - The :class:`Element` returned may be empty if the resolution service - cannot provide the attribute. + **DEPRECATED** + Attributes are no longer supported. """ - attribute = Name(attribute) - errorCode, element = internals.blpapi_ResolutionList_attribute( - self.__handle, - get_handle(attribute), - get_handle(correlationId)) - - _ExceptionUtil.raiseOnError(errorCode) - return Element(element, self) + # pylint no-self-use + _ExceptionUtil.raiseOnError(internals.ERROR_UNSUPPORTED_OPERATION) + @deprecated("attributes are no longer supported") + # pylint: disable=unused-argument,no-self-use def attributeAt(self, attribute, index): """ - Args: - attribute (str): Attribute of the entry - index (int): Index of the entry - - Returns: - Element: Value for the specified ``attribute`` of this list entry. - Raises: - Exception: If ``index >= size()`` or if the status of the - ``index``\ th entry identified by ``correlationId`` is not - ``RESOLVED``. - """ - attribute = Name(attribute) - errorCode, element = internals.blpapi_ResolutionList_attributeAt( - self.__handle, - get_handle(attribute), - index) + UnsupportedOperationException: Unconditionally. - _ExceptionUtil.raiseOnError(errorCode) - - return Element(element, self) + **DEPRECATED** + Attributes are no longer supported. + """ + _ExceptionUtil.raiseOnError(internals.ERROR_UNSUPPORTED_OPERATION) def message(self, correlationId): """ diff --git a/blpapi/schema.py b/blpapi/schema.py index f40e5af..4957175 100644 --- a/blpapi/schema.py +++ b/blpapi/schema.py @@ -197,6 +197,10 @@ def toString(self, level=0, spacesPerLevel=4): level, spacesPerLevel) + def _handle(self): + """Return the internal implementation.""" + return self.__handle + def _sessions(self): """Return session(s) this object is related to. For internal use.""" return self.__sessions diff --git a/blpapi/session.py b/blpapi/session.py index 6da74a7..71ddc82 100644 --- a/blpapi/session.py +++ b/blpapi/session.py @@ -312,8 +312,7 @@ def subscribe(self, subscriptionList, identity=None, requestLabel=""): self.__handle, get_handle(subscriptionList), get_handle(identity), - requestLabel, - len(requestLabel))) + requestLabel)) def unsubscribe(self, subscriptionList): """Cancel subscriptions from the specified ``subscriptionList``. @@ -344,8 +343,7 @@ def unsubscribe(self, subscriptionList): _ExceptionUtil.raiseOnError(internals.blpapi_Session_unsubscribe( self.__handle, get_handle(subscriptionList), - None, - 0)) + None)) def resubscribe( self, @@ -381,15 +379,13 @@ def resubscribe( error = internals.blpapi_Session_resubscribe( self.__handle, get_handle(subscriptionList), - requestLabel, - len(requestLabel)) + requestLabel) else: error = internals.blpapi_Session_resubscribeWithId( self.__handle, get_handle(subscriptionList), - resubscriptionId, - requestLabel, - len(requestLabel)) + resubscriptionId, # an int, not a cid + requestLabel) _ExceptionUtil.raiseOnError(error) @@ -467,8 +463,7 @@ def sendRequest(self, get_handle(correlationId), get_handle(identity), get_handle(eventQueue), - requestLabel, - len(requestLabel)) + requestLabel) _ExceptionUtil.raiseOnError(res) if eventQueue is not None: eventQueue._registerSession(self) @@ -511,17 +506,17 @@ def sendRequestTemplate(self, requestTemplate, correlationId=None): def createSnapshotRequestTemplate( self, subscriptionString, - identity, - correlationId): + correlationId, + identity=None): """Create a snapshot request template for getting subscription data specified by the ``subscriptionString`` using the specified ``identity``. Args: subscriptionString (str): String that specifies the subscription - identity (Identity): Identity used for authorization correlationId (CorrelationId): Correlation id to associate with events generated by this operation + identity (Identity): Identity used for authorization. Returns: RequestTemplate: Created request template @@ -591,11 +586,25 @@ def createSnapshotRequestTemplate( When ``identity`` is ``None``, the session identity will be used if it has been authorized. """ + + cidArg = correlationId + identityArg = identity + + # we changed the order of last two arguments + # old clients may have them swapped at call site. + # This detects the swap and calls the method correctly. + + # Note: cid may never be None, only identity is allowed None + # Hence, in the swapped case identity must be of type CorrelationId + if isinstance(identity, CorrelationId): + cidArg = identity + identityArg = correlationId + rc, template = internals.blpapi_Session_createSnapshotRequestTemplate( self.__handle, subscriptionString, - get_handle(identity), - get_handle(correlationId)) + get_handle(identityArg), + get_handle(cidArg)) _ExceptionUtil.raiseOnError(rc) reqTemplate = RequestTemplate(template) return reqTemplate diff --git a/blpapi/test/__init__.py b/blpapi/test/__init__.py new file mode 100644 index 0000000..ae57d0c --- /dev/null +++ b/blpapi/test/__init__.py @@ -0,0 +1,7 @@ +# __init__.py + +# pylint: disable=missing-docstring + +from .messageformatter import MessageFormatter +from .messageproperties import MessageProperties +from .testutil import * diff --git a/blpapi/test/messageformatter.py b/blpapi/test/messageformatter.py new file mode 100644 index 0000000..e071933 --- /dev/null +++ b/blpapi/test/messageformatter.py @@ -0,0 +1,465 @@ +# messageformatter.py + +""" Class for formatting mock messages. """ + +# pylint: disable=function-redefined,ungrouped-imports,no-name-in-module + +import sys +from functools import update_wrapper +from datetime import date, time, datetime +from json import dumps + +from blpapi import internals, Name +from blpapi.datetime import _DatetimeUtil +from blpapi.compat import conv2str, int_typelist, isstr, str_typelist +from blpapi.exception import _ExceptionUtil +from blpapi.utils import \ + get_handle, \ + MAX_32BIT_INT, \ + MIN_32BIT_INT, \ + MIN_64BIT_INT, \ + MAX_64BIT_INT + +if sys.version_info >= (3, 4): + from functools import singledispatch +else: + def singledispatch(func): + """ Transform a function into a single-dispatch generic function. + + This function is intended to provide a basic implementation of + `functools.singledispatch` found in Python >= 3.4. No caching + optimizations are performed. Types are matched naively: there is no + support for inherited types. + """ + + registry = {} + funcname = getattr(func, "__name__", "singledispatch function") + + def dispatch(cls): + """ Return the function registered to `cls`. If there is no + function associated with `cls`, return `func`. + """ + + # Return `func` instead of `None` because the native + # python implementation ultimately ends up doing this for + # types whose closest match in the registry is type + # `object` + return registry.get(cls, func) + + def register(cls, func=None): + """ Register a new function `func` for the given `cls`. """ + + # Return a lambda so that `register` can be used as a decorator + if func is None: + return lambda f: register(cls, f) + + registry[cls] = func + + return func + + def wrapper(*args, **kw): + """ Wrap the provided `func` from `singledispatch` to provide + additional functionality without modifying `func` directly. + """ + if not args: + raise TypeError("{} requires at least 1 positional argument" + .format(funcname)) + + return dispatch(args[0].__class__)(*args, **kw) + + wrapper.register = register + wrapper.dispatch = dispatch + wrapper.registry = registry + update_wrapper(wrapper, func) + return wrapper + +def _singledispatchmethod(arg_index): + """ Decorator to implement singledispatch on a class method. + `arg_index` indicates the argument whose type will be used to determine + the function to which to dispatch. + """ + + def _singleDispatchMethodImpl(func): + """ Implementation of `_singledispatchmethod`. """ + dispatcher = singledispatch(func) + # `dispatcher` is `func` wrapped by singledispatch + # `dispatcher` has an attribute `register()`, which is a decorator, + # which registers the typed funcs to call based on the arg passed to + # `func` + def _wrapper(*args, **kw): + # singledispatch bases the type on the first arg, which is `self` + # in a method. Instead, we need the 3rd argument, skipping over + # `self` and `name` in `setElement(self, name, value)` + return dispatcher.dispatch(args[arg_index].__class__)(*args, **kw) + # give `_wrapper` a `.register()` attribute + _wrapper.register = dispatcher.register + # makes `_wrapper` look like `func` with regards to metadata and + # attributes + update_wrapper(_wrapper, func) + return _wrapper + + return _singleDispatchMethodImpl + +class MessageFormatter(): + """ :class:`MessageFormatter` is used to populate/format a message. It + supports writing only once to each field. Attempting to set an already set + element will fail. + + Note that the behavior is undefined if: + + * A message is formatted with :meth:`formatMessageJson` or + :meth:`formatMessageXml` or :meth:`formatMessageDict` is further + formatted. + + * A message formatted with `set*()` or `append*()` is further formatted + using :meth:`formatMessageJson` or :meth:`formatMessageXml` or + :meth:`formatMessageDict`. + + Currently, the JSON and XML formatting methods have some known limitations: + + * The parsers can not differentiate complex field types + (sequences, choices, arrays) that are empty with complex field types that + are missing / null. These fields are dropped and absent in the message + contents. + + * Enumerations of type "Datetime", or any "Datetime" element with timezone + offset or sub-microsecond precision (e.g. nanoseconds) are not supported. + """ + + def __init__(self, handle): + """ For internal use only. """ + self.__handle = handle + + def _handle(self): + return self.__handle + + def setElement(self, name, value): + """ Set the element with the specified ``name`` to the specified + ``value`` in the current :class:`blpapi.Message` referenced by this + :class:`MessageFormatter`. + + Args: + name (Name or str): Identifies the element which will be set to + ``value``. + value (bool or str or int or float or datetime.date or \ + datetime.time or datetime.datetime or Name or None): + The value to assign to the specified element. + + Raises: + Exception: An exception is raised if any of the following are true: + - The ``name`` is invalid for the current message + - The element identified by ``name`` has already been set + - The ``value`` cannot be assigned to the element identified by + ``name`` + """ + if isstr(name): + name = Name(conv2str(name)) + self._setElement(name, value) + + # pylint: disable=unused-argument,no-self-use + @_singledispatchmethod(2) + def _setElement(self, name, value): + """ Implementation for :meth:`setElement`. + + Args: + name (Name): Identifies the element which will be set to ``value`` + value (bool or str or int or float or date or time or + datetime or Name or None): + The value to assign to the specified element. + + Raises: + Exception: An exception is raised if any of the following are true: + - The ``name`` is invalid for the current message + - The element identified by ``name`` has already been set + - The ``value`` cannot be assigned to the element identified by + ``name`` + """ + raise TypeError("The type of value {} is not supported. Type is {}." + .format(value, type(value)) + + " Please refer to the documentation for the" + + " supported types.") + + @_setElement.register(bool) + def _(self, name, value): + """ Dispatch method for setting `bool` types. """ + _ExceptionUtil.raiseOnError( + internals.blpapi_MessageFormatter_setValueBool( + self.__handle, + get_handle(name), + value)) + + @_setElement.register(datetime) + @_setElement.register(date) + @_setElement.register(time) + def _(self, name, value): + """ Dispatch method for setting time types. """ + _ExceptionUtil.raiseOnError( + internals.blpapi_MessageFormatter_setValueHighPrecisionDatetime( + self.__handle, + get_handle(name), + _DatetimeUtil.convertToBlpapi(value))) + + def _setElementInt(self, name, value): + """ Dispatch method for setting integer types. """ + if MIN_32BIT_INT <= value <= MAX_32BIT_INT: + _ExceptionUtil.raiseOnError( + internals.blpapi_MessageFormatter_setValueInt32( + self.__handle, + get_handle(name), + value)) + elif MIN_64BIT_INT <= value <= MAX_64BIT_INT: + _ExceptionUtil.raiseOnError( + internals.blpapi_MessageFormatter_setValueInt64( + self.__handle, + get_handle(name), + value)) + else: + raise ValueError("Value is out of element's supported range") + for _int_type in int_typelist: + _setElement.register(_int_type, _setElementInt) + + @_setElement.register(float) + def _(self, name, value): + """ Dispatch method for setting `float` types. """ + _ExceptionUtil.raiseOnError( + internals.blpapi_MessageFormatter_setValueFloat( + self.__handle, + get_handle(name), + value)) + + @_setElement.register(Name) + def _(self, name, value): + """ Dispatch method for setting `Name` types. """ + _ExceptionUtil.raiseOnError( + internals.blpapi_MessageFormatter_setValueFromName( + self.__handle, + get_handle(name), + get_handle(value))) + + @_setElement.register(type(None)) + def _(self, name, _): + """ Dispatch method for setting `None` types. """ + _ExceptionUtil.raiseOnError( + internals.blpapi_MessageFormatter_setValueNull( + self.__handle, + get_handle(name))) + + def _setElementStr(self, name, value): + """ Dispatch method for setting string types. """ + _ExceptionUtil.raiseOnError( + internals.blpapi_MessageFormatter_setValueString( + self.__handle, + get_handle(name), + conv2str(value))) + for _str_type in str_typelist: + _setElement.register(_str_type, _setElementStr) + + def pushElement(self, name): + """ Change the level at which this :class:`MessageFormatter` is + operating to the element specified by ``name``. + + After this returns, the context of the :class:`MessageFormatter` is set + to the element specified by ``name`` in the schema and any calls to + :meth:`setElement` or meth:`pushElement` are applied at that level. + + If ``name`` represents an array of scalars then :meth:`appendValue` + must be used to add values. + + If ``name`` represents an array of complex types then + :meth:`appendElement()` must be used. + + Args: + name (Name or str): Specifies the :class:`blpapi.Element` on which + to operate. The element must identify either a choice, a + sequence or an array at the current level of the schema or the + behavior is undefined. + + Raises: + Exception: If the ``name`` is invalid for the current message or if + the element identified by ``name`` has already been set. + """ + if isstr(name): + name = Name(conv2str(name)) + _ExceptionUtil.raiseOnError( + internals.blpapi_MessageFormatter_pushElement( + self.__handle, + get_handle(name))) + + def popElement(self): + """ Undo the most recent call to :meth:`pushElement` on this + :class:`MessageFormatter` and return the context of the + :class:`MessageFormatter` to where it was before the call to + :meth:`pushElement`. Once :meth:`popElement` has been called, + it is invalid to attempt to re-visit the same context. + """ + _ExceptionUtil.raiseOnError( + internals.blpapi_MessageFormatter_popElement(self.__handle)) + + @_singledispatchmethod(1) + def appendValue(self, value): + """ Append the specified ``value`` to the element on which this + :class:`MessageFormatter` is operating. + + Args: + value (bool or str or int or float or datetime.date or \ + datetime.time or datetime.datetime or Name): + The value to append. + + Raises: + Exception: If the schema of the message is flat or the current + element to which ``value`` is appended is not an array. + """ + _ExceptionUtil.raiseOnError( + internals.blpapi_MessageFormatter_appendValueString( + self.__handle, + value)) + + @appendValue.register(bool) + def _(self, value): + """ Dispatch method for appending `bool` types. """ + _ExceptionUtil.raiseOnError( + internals.blpapi_MessageFormatter_appendValueBool( + self.__handle, + value)) + + @appendValue.register(datetime) + @appendValue.register(date) + @appendValue.register(time) + def _(self, value): + """ Dispatch method for appending time types. """ + _ExceptionUtil.raiseOnError( + internals.blpapi_MessageFormatter_appendValueHighPrecisionDatetime( + self.__handle, + _DatetimeUtil.convertToBlpapi(value))) + + def _appendValueInt(self, value): + """ Dispatch method for appending integer types. """ + if MIN_32BIT_INT <= value <= MAX_32BIT_INT: + _ExceptionUtil.raiseOnError( + internals.blpapi_MessageFormatter_appendValueInt32( + self.__handle, + value)) + elif MIN_64BIT_INT <= value <= MAX_64BIT_INT: + _ExceptionUtil.raiseOnError( + internals.blpapi_MessageFormatter_appendValueInt64( + self.__handle, + value)) + else: + raise ValueError("Value is out of element's supported range") + for _int_type in int_typelist: + appendValue.register(_int_type, _appendValueInt) + + @appendValue.register(float) + def _(self, value): + """ Dispatch method for appending `float` types. """ + _ExceptionUtil.raiseOnError( + internals.blpapi_MessageFormatter_appendValueFloat( + self.__handle, + value)) + + @appendValue.register(Name) + def _(self, value): + """ Dispatch method for appending `Name` types. """ + _ExceptionUtil.raiseOnError( + internals.blpapi_MessageFormatter_appendValueFromName( + self.__handle, + get_handle(value))) + + def _appendValueStr(self, value): + """ Dispatch method for appending string types. """ + _ExceptionUtil.raiseOnError( + internals.blpapi_MessageFormatter_appendValueString( + self.__handle, + conv2str(value))) + for _str_type in str_typelist: + appendValue.register(_str_type, _appendValueStr) + + def appendElement(self): + """ Create an array :class:`blpapi.Element` and append it to the + :class:`blpapi.Element` on which this :class:`MessageFormatter` is + operating. + + Raises: + Exception: If the schema of the :class:`blpapi.Message` is flat or + the current :class:`blpapi.Element` to which this new + :class:`blpapi.Element` is being appended is not an array, a + sequence or a choice. + """ + _ExceptionUtil.raiseOnError( + internals.blpapi_MessageFormatter_appendElement(self.__handle)) + + def formatMessageJson(self, jsonMessage): + """ Format the :class:`blpapi.Message` from its ``JSON`` representation. + + Args: + jsonMessage (str): A ``JSON``-formatted ``str`` representing the + content used to format the message. + + Raises: + Exception: If the method fails to format the + :class:`blpapi.Message`. + + The behavior is undefined if further formatting is done using + this :class:`MessageFormatter`. + """ + _ExceptionUtil.raiseOnError( + internals.blpapi_MessageFormatter_FormatMessageJson( + self.__handle, + jsonMessage)) + + def formatMessageXml(self, xmlMessage): + """ Format the :class:`blpapi.Message` from its ``XML`` representation. + + Args: + xmlMessage (str): An ``XML``-formatted ``str`` representing the + content used to format the message. + + Raises: + Exception: If the method fails to format the + :class:`blpapi.Message`. + + The behavior is undefined if further formatting is done using + this :class:`MessageFormatter`. + """ + _ExceptionUtil.raiseOnError( + internals.blpapi_MessageFormatter_FormatMessageXml( + self.__handle, + xmlMessage)) + + def formatMessageDict(self, dictMessage): + """ Format the :class:`blpapi.Message` from its ``dict`` representation. + + Args: + dictMessage (dict): A dictionary representing the content used to + format the message. + + Raises: + Exception: If the method fails to format the + :class:`blpapi.Message`. + + The behavior is undefined if further formatting is done using + this :class:`MessageFormatter`. + """ + self.formatMessageJson(dumps(dictMessage)) + + +__copyright__ = """ +Copyright 2020. Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above +copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/blpapi/test/messageproperties.py b/blpapi/test/messageproperties.py new file mode 100644 index 0000000..4385e48 --- /dev/null +++ b/blpapi/test/messageproperties.py @@ -0,0 +1,131 @@ +# messageproperties.py + +""" Class for defining properties of mock messages. """ + +import blpapi +from blpapi import internals +from blpapi.exception import _ExceptionUtil +from blpapi.datetime import _DatetimeUtil +from ..utils import get_handle + +class MessageProperties(): + """ + This class represents properties of a message that are not part of the + message contents, such as the correlation ids or timestamp. + """ + + def __init__(self): + """ + Create 'MessageProperties' with default values. + + Default value for the 'CorrelationId' property is an empty list. + Default value for the 'recapType' property is 'Message.RECAPTYPE_NONE'. + Default value for the 'fragmentType' property is + 'Message.FRAGMENT_NONE'. + Default value for the 'Service' and 'timeReceived' is "unset". + """ + rc, self.__handle = internals.blpapi_MessageProperties_create() + _ExceptionUtil.raiseOnError(rc) + + def __del__(self): + try: + self.destroy() + except (NameError, AttributeError): + pass + + def destroy(self): + """Destroy this :class:`MessageProperties`.""" + if self.__handle: + internals.blpapi_MessageProperties_destroy(self.__handle) + self.__handle = None + + def setCorrelationIds(self, cids): + """ + Set the `correlationIds` properties of the message. + + Args: + cids ([CorrelationId]): list of correlation ids of the message. + """ + errorCode = internals.blpapi_MessageProperties_setCorrelationIds( + self.__handle, list(cids)) + _ExceptionUtil.raiseOnError(errorCode) + + def setRecapType(self, recapType, + fragmentType=blpapi.Message.FRAGMENT_NONE): + """ + Set the `recapType` and `fragmentType` properties of the message. + + Args: + recapType (int): Recap type of the message. See + :class:`blpapi.Message` for valid values. + fragmentType (int): Optional. Fragment type of the message. See + :class:`blpapi.Message` for valid values. The default value is + ``blpapi.Message.FRAGMENT_NONE``. + """ + errorCode = internals.blpapi_MessageProperties_setRecapType( + self.__handle, recapType, fragmentType) + _ExceptionUtil.raiseOnError(errorCode) + + def setTimeReceived(self, timestamp): + """ + Set the `timeReceived` property of the message. + + Args: + timestamp (datetime.datetime): Timestamp of the message. + """ + ts = _DatetimeUtil.convertToBlpapi(timestamp) + errorCode = internals.blpapi_MessageProperties_setTimeReceived( + self.__handle, ts) + _ExceptionUtil.raiseOnError(errorCode) + + def setRequestId(self, requestId): + """ + Set the `requestId` property. + A copy of this string is expected to be returned + by :meth:`blpapi.Message.getRequestId()`. + If `requestId` is empty or `None`, the method throws. + + Args: + requestId (str): RequestId of the message. + """ + errorCode = internals.blpapi_MessageProperties_setRequestId( + self.__handle, requestId) + _ExceptionUtil.raiseOnError(errorCode) + + + def setService(self, service): + """ + Set the `service` property of the message. + + Args: + service (Service): Service of the message. + """ + errorCode = internals.blpapi_MessageProperties_setService( + self.__handle, get_handle(service)) + _ExceptionUtil.raiseOnError(errorCode) + + def _handle(self): + """For internal use only.""" + return self.__handle + + +__copyright__ = """ +Copyright 2020. Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above +copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/blpapi/test/testutil.py b/blpapi/test/testutil.py new file mode 100644 index 0000000..9182595 --- /dev/null +++ b/blpapi/test/testutil.py @@ -0,0 +1,167 @@ +# testutil.py + +""" This module provides a set of utility functions to allow SDK clients to +create events/messages for unit-testing their applications. +""" + +from blpapi import internals +from blpapi import Event, Name, SchemaElementDefinition, Service, Topic +from blpapi.compat import conv2str, isstr +from blpapi.exception import _ExceptionUtil +from blpapi.utils import get_handle +from blpapi.test import MessageProperties, MessageFormatter + + +def createEvent(eventType): + """ Create an :class:`blpapi.Event` with the specified ``eventType`` to be + used for testing. + + Args: + eventType (int): Specifies the type of event. See :class:`blpapi.Event` + for a list of enumerated values (e.g., `Event.SUBSCRIPTION_DATA`). + + Returns: + Event: An event used for testing. It cannot be used for publishing. + + The behavior is undefined if :class:`blpapi.EventFormatter` is + used with the returned :class:`blpapi.Event`. + """ + rc, event_handle = internals.blpapi_TestUtil_createEvent(eventType) + _ExceptionUtil.raiseOnError(rc) + event = Event(event_handle, sessions=None) + return event + +def appendMessage(event, elementDef, properties=None): + """ Create a new message and append it to the specified ``event``. + Return a :class:`MessageFormatter` to format the last appended message. + + Args: + event (Event): The ``event`` to which the new message will + be appended. The ``event`` must be a test :class:`blpapi.Event` + created by :meth:`createEvent()`. + elementDef (SchemaElementDefinition): Used to verify and encode + the contents of the message. + properties (MessageProperties): Used to set the metadata properties for + the message. + + Returns: + MessageFormatter: The :class:`MessageFormatter` used to format the last + appended message. + + Raises: + Exception: If the method fails to append the message. + """ + if properties is None: + properties = MessageProperties() + rc, formatter_handle = internals.blpapi_TestUtil_appendMessage( + get_handle(event), + get_handle(elementDef), + get_handle(properties)) + _ExceptionUtil.raiseOnError(rc) + message_formatter = MessageFormatter(formatter_handle) + return message_formatter + +def deserializeService(serviceXMLStr): + """ Create a :class:`blpapi.Service` instance from the specified + ``serviceXMLStr``. + + Args: + serviceXMLStr (str): A ``str`` representation of a + :class:`blpapi.Service` in ``XML`` format. The ``str`` should only + contain ASCII characters without any embedded ``null`` characters. + Returns: + Service: A :class:`blpapi.Service` created from ``serviceXMLStr``. + + Raises: + Exception: If deserialization fails. + """ + rc, service_handle = internals.blpapi_TestUtil_deserializeService( + serviceXMLStr, + len(serviceXMLStr)) + _ExceptionUtil.raiseOnError(rc) + service = Service(service_handle, sessions=None) + return service + +def serializeService(service): + """ Serialize the provided ``service`` in ``XML`` format. + + Args: + service (Service): The :class:`blpapi.Service` to be serialized. + + Returns: + str: The ``service`` represented as an ``XML`` formatted ``str``. + + Raises: + Exception: If the service can't be serialized successfully. + """ + service_str = internals.blpapi_TestUtil_serializeServiceHelper( + get_handle(service)) + return service_str + +def createTopic(service, isActive=True): + """ Create a valid :class:`blpapi.Topic` with the specified ``service`` to + support testing publishers. The expected use case is to support returning a + custom :class:`blpapi.Topic` while mocking + :meth:`blpapi.ProviderSession.getTopic()` methods. + + Args: + service (Service): The :class:`blpapi.Service` to which the returned + :class:`blpapi.Topic` will belong. + isActive (bool): Optional. Specifies whether the returned + :class:`blpapi.Topic` is active. + + Returns: + Topic: A valid :class:`blpapi.Topic` with the specified ``service``. + """ + rc, topic_handle = internals.blpapi_TestUtil_createTopic( + get_handle(service), + isActive) + _ExceptionUtil.raiseOnError(rc) + topic = Topic(topic_handle, sessions=None) + return topic + +def getAdminMessageDefinition(messageName): + """ Return the definition for an admin message of the specified + ``messageName``. + + Args: + messageName (Name or str): The name of the desired admin message. + + Returns: + SchemaElementDefinition: The element definition for the message + specified by ``messageName``. + + Raises: + Exception: If ``messageName`` does not name an admin message. + """ + if isstr(messageName): + messageName = Name(conv2str(messageName)) + rc, schema_element_definition_handle = \ + internals.blpapi_TestUtil_getAdminMessageDefinition( + get_handle(messageName)) + _ExceptionUtil.raiseOnError(rc) + schema_definition = \ + SchemaElementDefinition(schema_element_definition_handle, sessions=None) + return schema_definition + + +__copyright__ = """ +Copyright 2020. Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above +copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/blpapi/testtools.py b/blpapi/testtools.py deleted file mode 100644 index 5d14cf6..0000000 --- a/blpapi/testtools.py +++ /dev/null @@ -1,254 +0,0 @@ -"""This tool tries to register every blpapi_*** function call in a database. -Resulting information can be used later to generate test coverage report. -This module doesn't ment to be used directly.""" - -# pylint: disable=useless-import-alias,global-statement - -import sqlite3 -from collections import defaultdict -from threading import Lock -import inspect -import blpapi.internals as internals - - -#import blpapi-py modules -import blpapi - -__MODULES = [ - blpapi, - blpapi.abstractsession, - blpapi.constant, - blpapi.datatype, - blpapi.datetime, - blpapi.element, - blpapi.event, - blpapi.eventdispatcher, - blpapi.eventformatter, - #blpapi.exception, - blpapi.identity, - blpapi.message, - blpapi.name, - blpapi.providersession, - blpapi.request, - blpapi.resolutionlist, - blpapi.schema, - blpapi.service, - blpapi.session, - blpapi.sessionoptions, - blpapi.subscriptionlist, - blpapi.topic, - blpapi.topiclist, - blpapi.utils, -] - - -__DBNAME = 'coverage.db' -__connection = None -__cursor = None -__cursorLock = Lock() - -__EXCEPTIONS = set([ - "blpapi_Datetime_tag", -]) - -def __writeCallToDB(method_name, test_name, class_name=None): - """ writes to db """ - global __cursor, __cursorLock - with __cursorLock: - query = """ - INSERT OR IGNORE INTO {table_name} (test_name, method_name) - VALUES ('{test_name}', '{method_name}'); - """ - table_name = None - if class_name is None: - full_method_name = method_name - table_name = 'api_calls_by_test' - else: - full_method_name = "{0}.{1}".format(class_name, method_name) - table_name = 'method_calls_by_test' - - if __cursor is not None: - __cursor.execute(query.format(test_name=test_name, - method_name=full_method_name, - table_name=table_name,)) - else: - print("No database connection, calling {method} from {test}".format( - method=full_method_name, test=test_name)) - -def logCallsToDB(method_name, test_name, obj, clsname=None): - """Basic logging decorator""" - def newcall(*args, **kwargs): - __writeCallToDB(method_name, test_name, clsname) - return obj(*args, **kwargs) - return newcall - -def getAllAPIFunctionNames(): - """Get list of all blpapi function names""" - global __EXCEPTIONS - results = [] - for name, obj in internals.__dict__.items(): - # Hack function that starts with 'blpapi_' signature - # this is an API methods. - signature = 'blpapi_' - if name.startswith(signature) and name not in __EXCEPTIONS: - if hasattr(obj, '__call__'): - # API function was found - results.append(name) - return results - -def alterClass(cls, clsName, testName, wrapper): - """Wrap each class method with decorator""" - for mname, value in cls.__dict__.items(): - if hasattr(value, '__call__'): - setattr(cls, mname, wrapper(mname, testName, value, clsName)) - -def hackInternalsModule(testname, wrap=logCallsToDB): - """Wraps all API calls with a decorator provided by user""" - for name in getAllAPIFunctionNames(): - obj = internals.__dict__[name] - # modify API function - internals.__dict__[name] = wrap(name, testname, obj) - # Wrap all blpapi class methods - global __MODULES - hackModules(__MODULES, testname, wrap) - -def getAllClasses(modules): - """List all classes in a modules list""" - result = {} - for module in modules: - for name, value in inspect.getmembers(module): - if inspect.isclass(value): - result[name] = value - return result - -def getAllClassMethods(modulesList): - """List all class methods in listed modules""" - result = [] - for module in modulesList: - for cname, cls in inspect.getmembers(module): - if inspect.isclass(cls): - for mname, mvalue in cls.__dict__.items(): - if hasattr(mvalue, '__call__'): - result.append('{0}.{1}'.format(cname, mname)) - return result - -def hackModules(modulesList, testname, wrap=logCallsToDB): - clsList = getAllClasses(modulesList) - for clsName, cls in clsList.items(): - alterClass(cls, clsName, testname, wrap) - -def init(): - """Initialize module state (sqlite database)""" - global __cursor, __connection, __DBNAME, __MODULES - conn = sqlite3.connect(__DBNAME, check_same_thread=False) - cursor = conn.cursor() - __connection = conn - __cursor = cursor - # There should be two tables, one with all API functions - # supported, other with all called functions by test. - query = """ - CREATE TABLE IF NOT EXISTS all_api_exists ( - method_name TEXT, - UNIQUE(method_name) - ) - """ - cursor.execute(query) - - query = """ - CREATE TABLE IF NOT EXISTS api_calls_by_test ( - test_name TEXT, - method_name TEXT, - UNIQUE(test_name, method_name) - ) - """ - cursor.execute(query) - - query = """ - CREATE TABLE IF NOT EXISTS all_class_methods ( - method_name TEXT, - UNIQUE(method_name) - ) - """ - cursor.execute(query) - - query = """ - CREATE TABLE IF NOT EXISTS method_calls_by_test ( - test_name TEXT, - method_name TEXT, - UNIQUE(test_name, method_name) - ) - """ - cursor.execute(query) - - # Initialize API table - for name in getAllAPIFunctionNames(): - query = """ - INSERT OR IGNORE INTO all_api_exists (method_name) - VALUES ('{method_name}'); - """ - if cursor is not None: - cursor.execute(query.format(method_name=name)) - - for name in getAllClassMethods(__MODULES): - query = """ - INSERT OR IGNORE INTO all_class_methods (method_name) - VALUES ('{method_name}'); - """ - if cursor is not None: - cursor.execute(query.format(method_name=name)) - conn.commit() - -def commit(): - global __connection, __cursor - __connection.commit() - -class Coverage: - """ coverage """ - def __init__(self, cur, - api_table_name='all_api_exists', - calls_table_name='api_calls_by_test'): - self.__api_table_name = api_table_name - self.__calls_table_name = calls_table_name - self.__tests = defaultdict(list) - self.__allfn = [] - self.__cursor = cur - self.readDB() - - def readDB(self): - """ select from db """ - query = """SELECT * from {0};""".format(self.__api_table_name) - for name, in self.__cursor.execute(query): - self.__allfn.append(name) - - query = """SELECT test_name, method_name FROM {0};""".format( - self.__calls_table_name) - for test, method in self.__cursor.execute(query): - self.__tests[test].append(method) - - def getTotalCoverage(self): - """ returns coverage """ - from itertools import chain - allexists = set(self.__allfn) - alltested = set(chain(*self.__tests.values())) - uncovered = allexists - alltested - return { - "numtested": len(alltested), - "numexists": len(allexists), - "needcheck": len(uncovered), - "uncovered": uncovered, - } - -def getCodeCoverage(): - """ returns coverage """ - global __cursor - blpapi_coverage = Coverage(__cursor) - blpapipy_coverage = Coverage(__cursor, api_table_name="all_class_methods", - calls_table_name='method_calls_by_test') - return { - "blpapi": blpapi_coverage.getTotalCoverage(), - "blpapipy": blpapipy_coverage.getTotalCoverage(), - } - -# Init everything on module load -print("Initializing testtools, database name %s" % __DBNAME) -init() diff --git a/blpapi/utils.py b/blpapi/utils.py index a7d74a6..def1ead 100644 --- a/blpapi/utils.py +++ b/blpapi/utils.py @@ -2,6 +2,14 @@ """Internal utils.""" +import functools +import warnings + +MIN_32BIT_INT = -(2**31) +MAX_32BIT_INT = 2**31 - 1 +MIN_64BIT_INT = -(2**63) +MAX_64BIT_INT = 2**63 - 1 + #pylint: disable=too-few-public-methods, useless-object-inheritance class Iterator(object): """Universal iterator for many of BLPAPI objects. @@ -39,10 +47,9 @@ def __iter__(self): def __next__(self): if self.__index == self.__num: raise StopIteration() - else: - res = self.__getter(self.__obj, self.__index) - self.__index += 1 - return res + res = self.__getter(self.__obj, self.__index) + self.__index += 1 + return res next = __next__ @@ -58,7 +65,6 @@ class MetaClassForClassesWithEnums(type): class EnumError(TypeError): """Raise this on attempt to change value of an enumeration constant. """ - pass def __setattr__(cls, name, value): """Change the value of an attribute if it is not an enum. @@ -67,8 +73,7 @@ def __setattr__(cls, name, value): """ if name.isupper() and name in cls.__dict__: raise cls.EnumError("Can't change value of enum %s" % name) - else: - type.__setattr__(cls, name, value) + type.__setattr__(cls, name, value) def __delattr__(cls, name): """Unbind the attribute if it is not an enum. @@ -77,8 +82,7 @@ def __delattr__(cls, name): """ if name.isupper() and name in cls.__dict__: raise cls.EnumError("Can't unbind enum %s" % name) - else: - type.__delattr__(cls, name) + type.__delattr__(cls, name) def get_handle(thing): """Returns the result of thing._handle() or None if thing is None""" @@ -90,6 +94,51 @@ def invoke_if_valid(cb, value): return value return cb(value) +def deprecated(func_or_reason): + ''' + This is a decorator which can be used to mark classes or functions + as deprecated. It results in a warning being emitted when the class or the + function is called. + + To use this, decorate the deprecated class or function with + **@deprecated** with or without a message: + + code-block:: python + + from blpapi.util import deprecated + + @deprecated + def old_function(msg): + print(msg) + + @deprecated + class OldClass: + + @deprecated("use another function") + def old_function(self, msg); + print(msg) + ''' + + is_func = callable(func_or_reason) + message = "see docstring for details." if is_func else func_or_reason + + def decorate(func): + + @functools.wraps(func) + def wrap_func(*args, **kwargs): + warnings.warn( + "%s is deprecated, %s." % (func.__name__, message), + category=DeprecationWarning, + stacklevel=2) + return func(*args, **kwargs) + + return wrap_func + + if is_func: + return decorate(func_or_reason) + + return decorate + __copyright__ = """ Copyright 2012. Bloomberg Finance L.P. diff --git a/blpapi/version.py b/blpapi/version.py index 1dc2be6..54a7b49 100644 --- a/blpapi/version.py +++ b/blpapi/version.py @@ -5,7 +5,7 @@ from __future__ import print_function from . import versionhelper -__version__ = "3.15.2" +__version__ = "3.16.1" def print_version(): """Print version information of BLPAPI python module and blpapi C++ SDK""" diff --git a/changelog.txt b/changelog.txt index 73be1d2..f3299a3 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,34 @@ +Version 3.16.1: +=============== +- Stability and performance improvements + +Version 3.16.0: +=============== +- Attributes are no longer supported in 'blpapi.ResolutionList' + Support for attributes during resolution was never fully implemented + and is now deprecated. + +- Provide users ability to unit test applications offline using testing frameworks + The new utility module 'blpapi.test' can be used to create test events + and test messages. The test messages can be generated using Python + dictionaries, XML, JSON, or they can be built in a similar way to how + messages are normally constructed in the SDK. + +- Added unique request id to network interactions + A new, globally unique, request id has been added to network + interactions. The request id is a string that can be obtained by + calling 'Request.getRequestId()' before sending a request, and + 'Message.getRequestId()' for messages delivered to the application. + + Not all requests and messages will have a request id, notably + subscription data messages will *not* have a request id except + for recaps. + + This unique identifier will be useful when contacting support as it + will help quickly locate the interactions related to that event. + +- Stability and performance improvements + Version 3.15.2: =============== - Stability and performance improvements diff --git a/examples/ConnectionAndAuthExample.py b/examples/ConnectionAndAuthExample.py index c7d4af5..c13bb70 100644 --- a/examples/ConnectionAndAuthExample.py +++ b/examples/ConnectionAndAuthExample.py @@ -5,10 +5,18 @@ """ from __future__ import print_function - -from argparse import ArgumentParser, Action -import blpapi -from blpapi import AuthOptions, AuthUser +from argparse import ArgumentParser, Action, RawTextHelpFormatter +import os +import sys +import platform as plat +if sys.version_info >= (3, 8) and plat.system().lower() == "windows": + # pylint: disable=no-member + with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): + import blpapi + from blpapi import AuthOptions, AuthUser +else: + import blpapi + from blpapi import AuthOptions, AuthUser NONE = "none" USER = "user" @@ -25,7 +33,7 @@ def __call__(self, parser, args, values, option_string=None): auth = None if vals[0] == NONE: - auth = AuthOptions.createDefault() + auth = None elif vals[0] == USER: user = AuthUser.createWithLogonName() auth = AuthOptions.createWithUser(user) @@ -101,8 +109,9 @@ def getTlsOptions(args): def parseCmdLine(): """Parse command line arguments""" - parser = ArgumentParser(description="Connection and Auth example") - + parser = ArgumentParser(description="Connection and Auth example", + formatter_class=lambda prog: RawTextHelpFormatter( + prog, width=99)) defaultUser = AuthUser.createWithLogonName() defaultAuthOptions = AuthOptions.createWithUser(defaultUser) @@ -111,7 +120,10 @@ def parseCmdLine(): help="authentication option: " "user|none|app=|userapp=|dir=|" "manual=" - " (default: user)", + " (default: user)\n" + "'none' is applicable to Desktop API product " + "that requires Bloomberg Professional service " + "to be installed locally.", metavar="option", action=AuthOptionsAction, default=defaultAuthOptions) diff --git a/examples/ContributionsMktdataExample.py b/examples/ContributionsMktdataExample.py index 606e651..09181b7 100644 --- a/examples/ContributionsMktdataExample.py +++ b/examples/ContributionsMktdataExample.py @@ -4,36 +4,28 @@ import time from optparse import OptionParser, OptionValueError -import datetime -import threading -import blpapi -# compatibility between python 2 and 3 -from blpapi.compat import with_metaclass - -TOKEN_SUCCESS = blpapi.Name("TokenGenerationSuccess") -TOKEN_FAILURE = blpapi.Name("TokenGenerationFailure") -AUTHORIZATION_SUCCESS = blpapi.Name("AuthorizationSuccess") -TOKEN = blpapi.Name("token") + +import os +import platform as plat +import sys +if sys.version_info >= (3, 8) and plat.system().lower() == "windows": + # pylint: disable=no-member + with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): + import blpapi +else: + import blpapi + MARKET_DATA = blpapi.Name("MarketData") SESSION_TERMINATED = blpapi.Name("SessionTerminated") g_running = True -g_mutex = threading.Lock() - -@with_metaclass(blpapi.utils.MetaClassForClassesWithEnums) -class AuthorizationStatus: # pylint: disable=too-few-public-methods - WAITING = 1 - AUTHORIZED = 2 - FAILED = 3 - -g_authorizationStatus = dict() -class MyStream(object): # pylint: disable=too-few-public-methods,useless-object-inheritance +class MyStream(object): # pylint: disable=too-few-public-methods def __init__(self, id=""): self.id = id -class MyEventHandler(object): # pylint: disable=too-few-public-methods,useless-object-inheritance +class MyEventHandler(object): # pylint: disable=too-few-public-methods """Event handler for the session""" def processEvent(self, event, session): @@ -49,15 +41,6 @@ def processEvent(self, event, session): continue cids = msg.correlationIds() - with g_mutex: - for cid in cids: - if cid in g_authorizationStatus: - if msg.messageType() == AUTHORIZATION_SUCCESS: - g_authorizationStatus[cid] = \ - AuthorizationStatus.AUTHORIZED - else: - g_authorizationStatus[cid] = \ - AuthorizationStatus.FAILED def authOptionCallback(option, opt, value, parser): """Parse authorization options from user input""" @@ -65,23 +48,39 @@ def authOptionCallback(option, opt, value, parser): vals = value.split('=', 1) if value == "user": - parser.values.auth = "AuthenticationType=OS_LOGON" + authUser = blpapi.AuthUser.createWithLogonName() + authOptions = blpapi.AuthOptions.createWithUser(authUser) elif value == "none": - parser.values.auth = None + authOptions = None elif vals[0] == "app" and len(vals) == 2: - parser.values.auth = "AuthenticationMode=APPLICATION_ONLY;"\ - "ApplicationAuthenticationType=APPNAME_AND_KEY;"\ - "ApplicationName=" + vals[1] + appName = vals[1] + authOptions = blpapi.AuthOptions.createWithApp(appName) elif vals[0] == "userapp" and len(vals) == 2: - parser.values.auth = "AuthenticationMode=USER_AND_APPLICATION;"\ - "AuthenticationType=OS_LOGON;"\ - "ApplicationAuthenticationType=APPNAME_AND_KEY;"\ - "ApplicationName=" + vals[1] + appName = vals[1] + authUser = blpapi.AuthUser.createWithLogonName() + authOptions = blpapi.AuthOptions\ + .createWithUserAndApp(authUser, appName) elif vals[0] == "dir" and len(vals) == 2: - parser.values.auth = "AuthenticationType=DIRECTORY_SERVICE;"\ - "DirSvcPropertyName=" + vals[1] + activeDirectoryProperty = vals[1] + authUser = blpapi.AuthUser\ + .createWithActiveDirectoryProperty(activeDirectoryProperty) + authOptions = blpapi.AuthOptions.createWithUser(authUser) + elif vals[0] == "manual": + parts = [] + if len(vals) == 2: + parts = vals[1].split(',') + + if len(parts) != 3: + raise OptionValueError("Invalid auth option {}".format(value)) + + appName, ip, userId = parts + + authUser = blpapi.AuthUser.createWithManualOptions(userId, ip) + authOptions = blpapi.AuthOptions.createWithUserAndApp(authUser, appName) else: - raise OptionValueError("Invalid auth option '%s'" % value) + raise OptionValueError("Invalid auth option '{}'".format(value)) + + parser.values.auth = {'option' : authOptions} def parseCmdLine(): """Parse command line arguments""" @@ -113,13 +112,19 @@ def parseCmdLine(): parser.add_option("--auth", dest="auth", help="authentication option: " - "user|none|app=|userapp=|dir=" - " (default: %default)", + "user|none|app=|userapp=|dir=" + "|manual=" + " (default: user)\n" + "'none' is applicable to Desktop API product " + "that requires Bloomberg Professional service " + "to be installed locally.", metavar="option", action="callback", callback=authOptionCallback, type="string", - default="user") + default={"option" : + blpapi.AuthOptions.createWithUser( + blpapi.AuthUser.createWithLogonName())}) # TLS Options parser.add_option("--tls-client-credentials", @@ -156,7 +161,7 @@ def parseCmdLine(): metavar="port", type="int") - (options, args) = parser.parse_args() + (options, _) = parser.parse_args() if not options.hosts: options.hosts = ["localhost"] @@ -177,54 +182,6 @@ def parseCmdLine(): return options -def authorize(authService, identity, session, cid): - """Authorize the identity""" - - with g_mutex: - g_authorizationStatus[cid] = AuthorizationStatus.WAITING - - tokenEventQueue = blpapi.EventQueue() - - # Generate token - session.generateToken(eventQueue=tokenEventQueue) - - # Process related response - ev = tokenEventQueue.nextEvent() - token = None - if ev.eventType() == blpapi.Event.TOKEN_STATUS or \ - ev.eventType() == blpapi.Event.REQUEST_STATUS: - for msg in ev: - print(msg) - if msg.messageType() == TOKEN_SUCCESS: - token = msg.getElementAsString(TOKEN) - elif msg.messageType() == TOKEN_FAILURE: - break - if not token: - print("Failed to get token") - return False - - # Create and fill the authorization request - authRequest = authService.createAuthorizationRequest() - authRequest.set(TOKEN, token) - - # Send authorization request to "fill" the Identity - session.sendAuthorizationRequest(authRequest, identity, cid) - - # Process related responses - startTime = datetime.datetime.today() - WAIT_TIME_SECONDS = datetime.timedelta(seconds=10) - while True: - with g_mutex: - if AuthorizationStatus.WAITING != g_authorizationStatus[cid]: - return AuthorizationStatus.AUTHORIZED == \ - g_authorizationStatus[cid] - - endTime = datetime.datetime.today() - if endTime - startTime > WAIT_TIME_SECONDS: - return False - - time.sleep(1) - def getTlsOptions(options): """Parse TlsOptions from user input""" @@ -282,7 +239,7 @@ def main(): sessionOptions = prepareZfpSessionOptions(options) \ if options.remote \ else prepareStandardSessionOptions(options) - sessionOptions.setAuthenticationOptions(options.auth) + sessionOptions.setSessionIdentityOptions(options.auth['option']) sessionOptions.setAutoRestartOnDisconnection(True) myEventHandler = MyEventHandler() @@ -296,28 +253,13 @@ def main(): print("Failed to start session.") return - providerIdentity = session.createIdentity() - - if options.auth: - isAuthorized = False - authServiceName = "//blp/apiauth" - if session.openService(authServiceName): - authService = session.getService(authServiceName) - isAuthorized = authorize( - authService, providerIdentity, session, - blpapi.CorrelationId("auth")) - if not isAuthorized: - print("No authorization") - return - topicList = blpapi.TopicList() topicList.add(options.service + options.topic, blpapi.CorrelationId(MyStream(options.topic))) # Create topics session.createTopics(topicList, - blpapi.ProviderSession.AUTO_REGISTER_SERVICES, - providerIdentity) + blpapi.ProviderSession.AUTO_REGISTER_SERVICES) # createTopics() is synchronous, topicList will be updated # with the results of topic creation (resolution will happen # under the covers) diff --git a/examples/ContributionsPageExample.py b/examples/ContributionsPageExample.py index c14e203..7f11dc6 100644 --- a/examples/ContributionsPageExample.py +++ b/examples/ContributionsPageExample.py @@ -3,36 +3,27 @@ from __future__ import absolute_import from optparse import OptionParser, OptionValueError -import datetime -import threading import time -import blpapi -# compatibility between python 2 and 3 -from blpapi.compat import with_metaclass - -TOKEN_SUCCESS = blpapi.Name("TokenGenerationSuccess") -TOKEN_FAILURE = blpapi.Name("TokenGenerationFailure") -AUTHORIZATION_SUCCESS = blpapi.Name("AuthorizationSuccess") -TOKEN = blpapi.Name("token") -SESSION_TERMINATED = blpapi.Name("SessionTerminated") -g_running = True -g_mutex = threading.Lock() +import os +import sys +import platform as plat +if sys.version_info >= (3, 8) and plat.system().lower() == "windows": + # pylint: disable=no-member + with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): + import blpapi +else: + import blpapi -@with_metaclass(blpapi.utils.MetaClassForClassesWithEnums) -class AuthorizationStatus: # pylint: disable=too-few-public-methods - WAITING = 1 - AUTHORIZED = 2 - FAILED = 3 +SESSION_TERMINATED = blpapi.Name("SessionTerminated") -g_authorizationStatus = dict() -class MyStream(object): # pylint: disable=too-few-public-methods,useless-object-inheritance +class MyStream(object): # pylint: disable=too-few-public-methods def __init__(self, id=""): self.id = id -class MyEventHandler(object): # pylint: disable=too-few-public-methods,useless-object-inheritance +class MyEventHandler(object): # pylint: disable=too-few-public-methods """Event handler for the session""" def processEvent(self, event, session): @@ -47,16 +38,6 @@ def processEvent(self, event, session): g_running = False continue - cids = msg.correlationIds() - with g_mutex: - for cid in cids: - if cid in g_authorizationStatus: - if msg.messageType() == AUTHORIZATION_SUCCESS: - g_authorizationStatus[cid] = \ - AuthorizationStatus.AUTHORIZED - else: - g_authorizationStatus[cid] = \ - AuthorizationStatus.FAILED def authOptionCallback(option, opt, value, parser): """Parse authorization options from user input""" @@ -64,43 +45,39 @@ def authOptionCallback(option, opt, value, parser): vals = value.split('=', 1) if value == "user": - parser.values.auth = {'option' : "AuthenticationType=OS_LOGON"} + authUser = blpapi.AuthUser.createWithLogonName() + authOptions = blpapi.AuthOptions.createWithUser(authUser) elif value == "none": - parser.values.auth = {'option' : None} + authOptions = None elif vals[0] == "app" and len(vals) == 2: - parser.values.auth = { - 'option' : "AuthenticationMode=APPLICATION_ONLY;" - "ApplicationAuthenticationType=APPNAME_AND_KEY;" - "ApplicationName=" + vals[1]} + appName = vals[1] + authOptions = blpapi.AuthOptions.createWithApp(appName) elif vals[0] == "userapp" and len(vals) == 2: - parser.values.auth = { - 'option' : "AuthenticationMode=USER_AND_APPLICATION;" - "AuthenticationType=OS_LOGON;" - "ApplicationAuthenticationType=APPNAME_AND_KEY;" - "ApplicationName=" + vals[1]} + appName = vals[1] + authUser = blpapi.AuthUser.createWithLogonName() + authOptions = blpapi.AuthOptions\ + .createWithUserAndApp(authUser, appName) elif vals[0] == "dir" and len(vals) == 2: - parser.values.auth = { - 'option' : "AuthenticationType=DIRECTORY_SERVICE;" - "DirSvcPropertyName=" + vals[1]} + activeDirectoryProperty = vals[1] + authUser = blpapi.AuthUser\ + .createWithActiveDirectoryProperty(activeDirectoryProperty) + authOptions = blpapi.AuthOptions.createWithUser(authUser) elif vals[0] == "manual": parts = [] if len(vals) == 2: parts = vals[1].split(',') - # TODO: Add support for user+ip only if len(parts) != 3: - raise OptionValueError("Invalid auth option '%s'" % value) + raise OptionValueError("Invalid auth option {}".format(value)) - option = "AuthenticationMode=USER_AND_APPLICATION;" + \ - "AuthenticationType=MANUAL;" + \ - "ApplicationAuthenticationType=APPNAME_AND_KEY;" + \ - "ApplicationName=" + parts[0] + appName, ip, userId = parts - parser.values.auth = {'option' : option, - 'manual' : {'ip' : parts[1], - 'user' : parts[2]}} + authUser = blpapi.AuthUser.createWithManualOptions(userId, ip) + authOptions = blpapi.AuthOptions.createWithUserAndApp(authUser, appName) else: - raise OptionValueError("Invalid auth option '%s'" % value) + raise OptionValueError("Invalid auth option '{}'".format(value)) + + parser.values.auth = {'option' : authOptions} def parseCmdLine(): """Parse command line arguments""" @@ -140,7 +117,10 @@ def parseCmdLine(): help="authentication option: " "user|none|app=|userapp=|dir=" "|manual=" - " (default: %default)", + " (default: none)\n" + "'none' is applicable to Desktop API product " + "that requires Bloomberg Professional service " + "to be installed locally.", metavar="option", action="callback", callback=authOptionCallback, @@ -182,7 +162,7 @@ def parseCmdLine(): metavar="port", type="int") - (options, args) = parser.parse_args() + (options, _) = parser.parse_args() if not options.hosts: options.hosts = ["localhost"] @@ -203,59 +183,6 @@ def parseCmdLine(): return options -def authorize(authService, identity, session, cid, manual_options=None): - """Authorize the identity""" - - with g_mutex: - g_authorizationStatus[cid] = AuthorizationStatus.WAITING - - tokenEventQueue = blpapi.EventQueue() - - if manual_options: - session.generateToken(authId=manual_options['user'], - ipAddress=manual_options['ip'], - eventQueue=tokenEventQueue) - else: - session.generateToken(eventQueue=tokenEventQueue) - - # Process related response - ev = tokenEventQueue.nextEvent() - token = None - if ev.eventType() == blpapi.Event.TOKEN_STATUS or \ - ev.eventType() == blpapi.Event.REQUEST_STATUS: - for msg in ev: - print(msg) - if msg.messageType() == TOKEN_SUCCESS: - token = msg.getElementAsString(TOKEN) - elif msg.messageType() == TOKEN_FAILURE: - break - - if not token: - print("Failed to get token") - return False - - # Create and fill the authorization request - authRequest = authService.createAuthorizationRequest() - authRequest.set(TOKEN, token) - - # Send authorization request to "fill" the Identity - session.sendAuthorizationRequest(authRequest, identity, cid) - - # Process related responses - startTime = datetime.datetime.today() - WAIT_TIME_SECONDS = datetime.timedelta(seconds=10) - while True: - with g_mutex: - if AuthorizationStatus.WAITING != g_authorizationStatus[cid]: - return AuthorizationStatus.AUTHORIZED == \ - g_authorizationStatus[cid] - - endTime = datetime.datetime.today() - if endTime - startTime > WAIT_TIME_SECONDS: - return False - - time.sleep(1) - def getTlsOptions(options): """Parse TlsOptions from user input""" @@ -313,7 +240,7 @@ def main(): sessionOptions = prepareZfpSessionOptions(options) \ if options.remote \ else prepareStandardSessionOptions(options) - sessionOptions.setAuthenticationOptions(options.auth['option']) + sessionOptions.setSessionIdentityOptions(options.auth['option']) sessionOptions.setAutoRestartOnDisconnection(True) myEventHandler = MyEventHandler() @@ -327,29 +254,13 @@ def main(): print("Failed to start session.") return - providerIdentity = session.createIdentity() - - if options.auth['option']: - isAuthorized = False - authServiceName = "//blp/apiauth" - if session.openService(authServiceName): - authService = session.getService(authServiceName) - isAuthorized = authorize( - authService, providerIdentity, session, - blpapi.CorrelationId("auth"), - options.auth.get('manual')) - if not isAuthorized: - print("No authorization") - return - topicList = blpapi.TopicList() topicList.add(options.service + options.topic, blpapi.CorrelationId(MyStream(options.topic))) # Create topics session.createTopics(topicList, - blpapi.ProviderSession.AUTO_REGISTER_SERVICES, - providerIdentity) + blpapi.ProviderSession.AUTO_REGISTER_SERVICES) # createTopics() is synchronous, topicList will be updated # with the results of topic creation (resolution will happen # under the covers) diff --git a/examples/CorrelationExample.py b/examples/CorrelationExample.py index 31965dd..38a9c6a 100644 --- a/examples/CorrelationExample.py +++ b/examples/CorrelationExample.py @@ -2,9 +2,17 @@ from __future__ import print_function from __future__ import absolute_import -import blpapi from optparse import OptionParser +import os +import platform as plat +import sys +if sys.version_info >= (3, 8) and plat.system().lower() == "windows": + # pylint: disable=no-member + with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): + import blpapi +else: + import blpapi class Window(object): def __init__(self, name): @@ -88,7 +96,7 @@ def main(): window = msg.correlationIds()[0].value() window.displaySecurityInfo(msg) - # Response completly received, so we could exit + # Response completely received, so we could exit if event.eventType() == blpapi.Event.RESPONSE: break finally: diff --git a/examples/EntitlementsVerificationTokenExample.py b/examples/EntitlementsVerificationTokenExample.py index 1279829..b8537f0 100644 --- a/examples/EntitlementsVerificationTokenExample.py +++ b/examples/EntitlementsVerificationTokenExample.py @@ -2,9 +2,18 @@ from __future__ import print_function from __future__ import absolute_import -import blpapi from optparse import OptionParser +import os +import platform as plat +import sys +if sys.version_info >= (3, 8) and plat.system().lower() == "windows": + # pylint: disable=no-member + with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): + import blpapi +else: + import blpapi + SECURITY_DATA = blpapi.Name("securityData") SECURITY = blpapi.Name("security") EID_DATA = blpapi.Name("eidData") diff --git a/examples/GenerateTokenExample.py b/examples/GenerateTokenExample.py index 2b82cc0..6370bda 100644 --- a/examples/GenerateTokenExample.py +++ b/examples/GenerateTokenExample.py @@ -2,9 +2,17 @@ from __future__ import print_function from __future__ import absolute_import -import blpapi from optparse import OptionParser -import traceback + +import os +import platform as plat +import sys +if sys.version_info >= (3, 8) and plat.system().lower() == "windows": + # pylint: disable=no-member + with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): + import blpapi +else: + import blpapi AUTHORIZATION_SUCCESS = blpapi.Name("AuthorizationSuccess") AUTHORIZATION_FAILURE = blpapi.Name("AuthorizationFailure") diff --git a/examples/GenerateTokenSubscriptionExample.py b/examples/GenerateTokenSubscriptionExample.py index 2c8ba4e..b0ce2f4 100644 --- a/examples/GenerateTokenSubscriptionExample.py +++ b/examples/GenerateTokenSubscriptionExample.py @@ -2,9 +2,17 @@ from __future__ import print_function from __future__ import absolute_import -import blpapi from optparse import OptionParser -import traceback + +import os +import platform as plat +import sys +if sys.version_info >= (3, 8) and plat.system().lower() == "windows": + # pylint: disable=no-member + with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): + import blpapi +else: + import blpapi AUTHORIZATION_SUCCESS = blpapi.Name("AuthorizationSuccess") AUTHORIZATION_FAILURE = blpapi.Name("AuthorizationFailure") diff --git a/examples/IntradayBarExample.py b/examples/IntradayBarExample.py index e9e8895..02c81cd 100644 --- a/examples/IntradayBarExample.py +++ b/examples/IntradayBarExample.py @@ -2,11 +2,19 @@ from __future__ import print_function from __future__ import absolute_import -import blpapi import copy import datetime from optparse import OptionParser, Option, OptionValueError +import os +import platform as plat +import sys +if sys.version_info >= (3, 8) and plat.system().lower() == "windows": + # pylint: disable=no-member + with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): + import blpapi +else: + import blpapi BAR_DATA = blpapi.Name("barData") BAR_TICK_DATA = blpapi.Name("barTickData") diff --git a/examples/IntradayTickExample.py b/examples/IntradayTickExample.py index ae7ed9c..65e822d 100644 --- a/examples/IntradayTickExample.py +++ b/examples/IntradayTickExample.py @@ -2,11 +2,20 @@ from __future__ import print_function from __future__ import absolute_import -import blpapi import copy import datetime from optparse import OptionParser, Option, OptionValueError +import os +import platform as plat +import sys +if sys.version_info >= (3, 8) and plat.system().lower() == "windows": + # pylint: disable=no-member + with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): + import blpapi +else: + import blpapi + TICK_DATA = blpapi.Name("tickData") COND_CODE = blpapi.Name("conditionCodes") TICK_SIZE = blpapi.Name("size") @@ -17,32 +26,46 @@ CATEGORY = blpapi.Name("category") MESSAGE = blpapi.Name("message") SESSION_TERMINATED = blpapi.Name("SessionTerminated") -TOKEN_SUCCESS = blpapi.Name("TokenGenerationSuccess") -TOKEN_FAILURE = blpapi.Name("TokenGenerationFailure") -AUTHORIZATION_SUCCESS = blpapi.Name("AuthorizationSuccess") -TOKEN = blpapi.Name("token") def authOptionCallback(option, opt, value, parser): + """Parse authorization options from user input""" + vals = value.split('=', 1) if value == "user": - parser.values.auth = "AuthenticationType=OS_LOGON" + authUser = blpapi.AuthUser.createWithLogonName() + authOptions = blpapi.AuthOptions.createWithUser(authUser) elif value == "none": - parser.values.auth = None + authOptions = None elif vals[0] == "app" and len(vals) == 2: - parser.values.auth = "AuthenticationMode=APPLICATION_ONLY;"\ - "ApplicationAuthenticationType=APPNAME_AND_KEY;"\ - "ApplicationName=" + vals[1] + appName = vals[1] + authOptions = blpapi.AuthOptions.createWithApp(appName) elif vals[0] == "userapp" and len(vals) == 2: - parser.values.auth = "AuthenticationMode=USER_AND_APPLICATION;"\ - "AuthenticationType=OS_LOGON;"\ - "ApplicationAuthenticationType=APPNAME_AND_KEY;"\ - "ApplicationName=" + vals[1] + appName = vals[1] + authUser = blpapi.AuthUser.createWithLogonName() + authOptions = blpapi.AuthOptions\ + .createWithUserAndApp(authUser, appName) elif vals[0] == "dir" and len(vals) == 2: - parser.values.auth = "AuthenticationType=DIRECTORY_SERVICE;"\ - "DirSvcPropertyName=" + vals[1] + activeDirectoryProperty = vals[1] + authUser = blpapi.AuthUser\ + .createWithActiveDirectoryProperty(activeDirectoryProperty) + authOptions = blpapi.AuthOptions.createWithUser(authUser) + elif vals[0] == "manual": + parts = [] + if len(vals) == 2: + parts = vals[1].split(',') + + if len(parts) != 3: + raise OptionValueError("Invalid auth option {}".format(value)) + + appName, ip, userId = parts + + authUser = blpapi.AuthUser.createWithManualOptions(userId, ip) + authOptions = blpapi.AuthOptions.createWithUserAndApp(authUser, appName) else: - raise OptionValueError("Invalid auth option '%s'" % value) + raise OptionValueError("Invalid auth option '{}'".format(value)) + + parser.values.auth = {'option' : authOptions} def checkDateTime(option, opt, value): @@ -109,15 +132,22 @@ def parseCmdLine(): parser.add_option("--auth", dest="auth", help="authentication option: " - "user|none|app=|userapp=|dir=" - " (default: %default)", + "user|none|app=|userapp=|dir=" + "|manual=" + " (default: user)\n" + "'none' is applicable to Desktop API product " + "that requires Bloomberg Professional service " + "to be installed locally.", metavar="option", action="callback", callback=authOptionCallback, type="string", - default="user") + default={"option" : + blpapi.AuthOptions.createWithUser( + blpapi.AuthUser.createWithLogonName())}) - (options, args) = parser.parse_args() + + (options, _) = parser.parse_args() if not options.host: options.host = ["localhost"] @@ -127,53 +157,6 @@ def parseCmdLine(): return options -def authorize(authService, identity, session, cid): - tokenEventQueue = blpapi.EventQueue() - - session.generateToken(eventQueue=tokenEventQueue) - - # Process related response - ev = tokenEventQueue.nextEvent() - token = None - if ev.eventType() == blpapi.Event.TOKEN_STATUS or \ - ev.eventType() == blpapi.Event.REQUEST_STATUS: - for msg in ev: - print(msg) - if msg.messageType() == TOKEN_SUCCESS: - token = msg.getElementAsString(TOKEN) - elif msg.messageType() == TOKEN_FAILURE: - break - - if not token: - print("Failed to get token") - return False - - # Create and fill the authorization request - authRequest = authService.createAuthorizationRequest() - authRequest.set(TOKEN, token) - - # Send authorization request to "fill" the Identity - session.sendAuthorizationRequest(authRequest, identity, cid) - - # Process related responses - startTime = datetime.datetime.today() - WAIT_TIME_SECONDS = 10 - while True: - event = session.nextEvent(WAIT_TIME_SECONDS * 1000) - if event.eventType() == blpapi.Event.RESPONSE or \ - event.eventType() == blpapi.Event.REQUEST_STATUS or \ - event.eventType() == blpapi.Event.PARTIAL_RESPONSE: - for msg in event: - print(msg) - if msg.messageType() == AUTHORIZATION_SUCCESS: - return True - print("Authorization failed") - return False - - endTime = datetime.datetime.today() - if endTime - startTime > datetime.timedelta(seconds=WAIT_TIME_SECONDS): - return False - def printErrorInfo(leadingStr, errorInfo): print("%s%s (%s)" % (leadingStr, errorInfo.getElementAsString(CATEGORY), @@ -282,7 +265,7 @@ def main(): sessionOptions = blpapi.SessionOptions() sessionOptions.setServerHost(options.host) sessionOptions.setServerPort(options.port) - sessionOptions.setAuthenticationOptions(options.auth) + sessionOptions.setSessionIdentityOptions(options.auth['option']) print("Connecting to %s:%s" % (options.host, options.port)) # Create a Session @@ -293,27 +276,13 @@ def main(): print("Failed to start session.") return - identity = None - if options.auth: - identity = session.createIdentity() - isAuthorized = False - authServiceName = "//blp/apiauth" - if session.openService(authServiceName): - authService = session.getService(authServiceName) - isAuthorized = authorize( - authService, identity, session, - blpapi.CorrelationId("auth")) - if not isAuthorized: - print("No authorization") - return - try: # Open service to get historical data from if not session.openService("//blp/refdata"): print("Failed to open //blp/refdata") return - sendIntradayTickRequest(session, options, identity) + sendIntradayTickRequest(session, options) # wait for events from session. eventLoop(session) diff --git a/examples/LocalMktdataSubscriptionExample.py b/examples/LocalMktdataSubscriptionExample.py index c301a73..8325e44 100644 --- a/examples/LocalMktdataSubscriptionExample.py +++ b/examples/LocalMktdataSubscriptionExample.py @@ -2,14 +2,23 @@ from __future__ import print_function from __future__ import absolute_import -import datetime from optparse import OptionParser, OptionValueError -import blpapi -TOKEN_SUCCESS = blpapi.Name("TokenGenerationSuccess") -TOKEN_FAILURE = blpapi.Name("TokenGenerationFailure") -AUTHORIZATION_SUCCESS = blpapi.Name("AuthorizationSuccess") -TOKEN = blpapi.Name("token") +import os +import platform as plat +import sys +if sys.version_info >= (3, 8) and plat.system().lower() == "windows": + # pylint: disable=no-member + with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): + import blpapi +else: + import blpapi + +SUBSCRIPTION_FAILURE = blpapi.Name("SubscriptionFailure") +SUBSCRIPTION_TERMINATED = blpapi.Name("SubscriptionTerminated") +SESSION_STARTUP_FAILURE = blpapi.Name("SessionStartupFailure") +SESSION_TERMINATED = blpapi.Name("SessionTerminated") +SERVICE_OPEN_FAILURE = blpapi.Name("ServiceOpenFailure") def authOptionCallback(option, opt, value, parser): """Parse authorization options from user input""" @@ -17,43 +26,39 @@ def authOptionCallback(option, opt, value, parser): vals = value.split('=', 1) if value == "user": - parser.values.auth = {'option' : "AuthenticationType=OS_LOGON"} + authUser = blpapi.AuthUser.createWithLogonName() + authOptions = blpapi.AuthOptions.createWithUser(authUser) elif value == "none": - parser.values.auth = {'option' : None} + authOptions = None elif vals[0] == "app" and len(vals) == 2: - parser.values.auth = { - 'option' : "AuthenticationMode=APPLICATION_ONLY;" - "ApplicationAuthenticationType=APPNAME_AND_KEY;" - "ApplicationName=" + vals[1]} + appName = vals[1] + authOptions = blpapi.AuthOptions.createWithApp(appName) elif vals[0] == "userapp" and len(vals) == 2: - parser.values.auth = { - 'option' : "AuthenticationMode=USER_AND_APPLICATION;" - "AuthenticationType=OS_LOGON;" - "ApplicationAuthenticationType=APPNAME_AND_KEY;" - "ApplicationName=" + vals[1]} + appName = vals[1] + authUser = blpapi.AuthUser.createWithLogonName() + authOptions = blpapi.AuthOptions\ + .createWithUserAndApp(authUser, appName) elif vals[0] == "dir" and len(vals) == 2: - parser.values.auth = { - 'option' : "AuthenticationType=DIRECTORY_SERVICE;" - "DirSvcPropertyName=" + vals[1]} + activeDirectoryProperty = vals[1] + authUser = blpapi.AuthUser\ + .createWithActiveDirectoryProperty(activeDirectoryProperty) + authOptions = blpapi.AuthOptions.createWithUser(authUser) elif vals[0] == "manual": parts = [] if len(vals) == 2: parts = vals[1].split(',') - # TODO: Add support for user+ip only if len(parts) != 3: - raise OptionValueError("Invalid auth option '%s'" % value) + raise OptionValueError("Invalid auth option {}".format(value)) - option = "AuthenticationMode=USER_AND_APPLICATION;" + \ - "AuthenticationType=MANUAL;" + \ - "ApplicationAuthenticationType=APPNAME_AND_KEY;" + \ - "ApplicationName=" + parts[0] + appName, ip, userId = parts - parser.values.auth = {'option' : option, - 'manual' : {'ip' : parts[1], - 'user' : parts[2]}} + authUser = blpapi.AuthUser.createWithManualOptions(userId, ip) + authOptions = blpapi.AuthOptions.createWithUserAndApp(authUser, appName) else: - raise OptionValueError("Invalid auth option '%s'" % value) + raise OptionValueError("Invalid auth option '{}'".format(value)) + + parser.values.auth = {'option' : authOptions} def parseCmdLine(): """Parse command line arguments""" @@ -106,7 +111,10 @@ def parseCmdLine(): help="authentication option: " "user|none|app=|userapp=|dir=" "|manual=" - " (default: %default)", + " (default: none)\n" + "'none' is applicable to Desktop API product " + "that requires Bloomberg Professional service " + "to be installed locally.", metavar="option", action="callback", callback=authOptionCallback, @@ -168,64 +176,10 @@ def parseCmdLine(): elif options.zfpPort == 8196: options.remote = blpapi.ZfpUtil.REMOTE_8196 else: - raise RuntimeError("Invalid ZFP port: " + options.zfpPort) + raise RuntimeError("Invalid ZFP port: {}".format(options.zfpPort)) return options -def authorize(authService, identity, session, cid, manual_options=None): - """Authorize the identity""" - - tokenEventQueue = blpapi.EventQueue() - - if manual_options: - session.generateToken(authId=manual_options['user'], - ipAddress=manual_options['ip'], - eventQueue=tokenEventQueue) - else: - session.generateToken(eventQueue=tokenEventQueue) - - # Process related response - ev = tokenEventQueue.nextEvent() - token = None - if ev.eventType() == blpapi.Event.TOKEN_STATUS or \ - ev.eventType() == blpapi.Event.REQUEST_STATUS: - for msg in ev: - print(msg) - if msg.messageType() == TOKEN_SUCCESS: - token = msg.getElementAsString(TOKEN) - elif msg.messageType() == TOKEN_FAILURE: - break - - if not token: - print("Failed to get token") - return False - - # Create and fill the authorization request - authRequest = authService.createAuthorizationRequest() - authRequest.set(TOKEN, token) - - # Send authorization request to "fill" the Identity - session.sendAuthorizationRequest(authRequest, identity, cid) - - # Process related responses - startTime = datetime.datetime.today() - WAIT_TIME_SECONDS = 10 - while True: - event = session.nextEvent(WAIT_TIME_SECONDS * 1000) - if event.eventType() == blpapi.Event.RESPONSE or \ - event.eventType() == blpapi.Event.REQUEST_STATUS or \ - event.eventType() == blpapi.Event.PARTIAL_RESPONSE: - for msg in event: - print(msg) - if msg.messageType() == AUTHORIZATION_SUCCESS: - return True - print("Authorization failed") - return False - - endTime = datetime.datetime.today() - if endTime - startTime > datetime.timedelta(seconds=WAIT_TIME_SECONDS): - return False - def getTlsOptions(options): """Parse TlsOptions from user input""" @@ -252,24 +206,13 @@ def getTlsOptions(options): options.tls_trust_material) def prepareStandardSessionOptions(options): - """Prepare SessionOptions for a regular session""" + """Prepares SessionOptions for connections other than ZFP Leased Line connections.""" sessionOptions = blpapi.SessionOptions() for idx, host in enumerate(options.hosts): sessionOptions.setServerAddress(host, options.port, idx) - # NOTE: If running without a backup server, make many attempts to - # connect/reconnect to give that host a chance to come back up (the - # larger the number, the longer it will take for SessionStartupFailure - # to come on startup, or SessionTerminated due to inability to fail - # over). We don't have to do that in a redundant configuration - it's - # expected at least one server is up and reachable at any given time, - # so only try to connect to each server once. - sessionOptions.setNumStartAttempts(len(options.hosts) - if len(options.hosts) > 1 else 1000) - - print("Connecting to port %d on %s" % ( - options.port, ", ".join(options.hosts))) + print("Connecting to port {} on {}".format(options.port, ", ".join(options.hosts) )) if options.tlsOptions: sessionOptions.setTlsOptions(options.tlsOptions) @@ -277,7 +220,7 @@ def prepareStandardSessionOptions(options): return sessionOptions def prepareZfpSessionOptions(options): - """Prepare SessionOptions for a ZFP session""" + """Prepares SessionOptions for ZFP Leased Line connections.""" print("Creating a ZFP connection for leased lines.") sessionOptions = blpapi.ZfpUtil.getZfpOptionsForLeasedLines( @@ -285,6 +228,98 @@ def prepareZfpSessionOptions(options): options.tlsOptions) return sessionOptions +def checkFailures(session): + """Checks failure events published by the session.""" + + # Note that the loop uses 'session.tryNextEvent' as all events have + # been produced before calling this function, but there could be no events + # at all in the queue if the OS fails to allocate resources. + while True: + event = session.tryNextEvent() + if event is None: + return + + eventType = event.eventType() + for msg in event: + print(msg) + if processGenericMessage(eventType, msg): + return + +def processSubscriptionEvents(session, maxEvents): + eventCount = 0 + while True: + # Specify timeout to give a chance for Ctrl-C + event = session.nextEvent(1000) + eventType = event.eventType() + for msg in event: + print(msg) + messageType = msg.messageType() + if eventType == blpapi.Event.SUBSCRIPTION_STATUS: + if messageType == SUBSCRIPTION_FAILURE \ + or messageType == SUBSCRIPTION_TERMINATED: + errorDescription = msg.getElement("reason") \ + .getElementAsString("description") + print("Subscription failed: {}".format(errorDescription)) + printContactSupportMessage(msg) + elif eventType == blpapi.Event.SUBSCRIPTION_DATA: + if msg.recapType() == blpapi.Message.RECAPTYPE_SOLICITED: + if msg.getRequestId() is not None: + # An init paint tick can have an associated + # RequestId that is used to identify the + # source of the data and can be used when + # contacting support + print("Received init paint with RequestId {}".format(msg.getRequestId())) + else: + + # SESSION_STATUS events can happen at any time and + # should be handled as the session can be terminated, + # e.g. session identity can be revoked at a later + # time, which terminates the session. + if processGenericMessage(eventType, msg): + return + + if event.eventType() == blpapi.Event.SUBSCRIPTION_DATA: + eventCount += 1 + if eventCount >= maxEvents: + break + +def processGenericMessage(eventType, message): + """Prints error information if the 'message' is a failure message.""" + + messageType = message.messageType() + + # When using a session identity, i.e. + # 'SessionOptions.setSessionIdentityOptions(AuthOptions)', token + # generation failure, authorization failure or revocation terminates the + # session, in which case, applications only need to check session status + # messages. Applications don't need to handle token or authorization messages + if eventType == blpapi.Event.SESSION_STATUS: + if messageType == SESSION_TERMINATED or \ + messageType == SESSION_STARTUP_FAILURE: + error = message.getElement("reason").getElementAsString("description") + print("Session failed to start or terminated: {}".format(error)) + printContactSupportMessage(message) + # Session failed to start/terminated + return True + elif eventType == blpapi.Event.SERVICE_STATUS: + if messageType == SERVICE_OPEN_FAILURE: + serviceName = message.getElementAsString("serviceName") + error = message.getElement("reason").getElementAsString("description") + print("Failed to open {}: {}".format(serviceName, error)) + printContactSupportMessage(message) + + # Session OK + return False + +def printContactSupportMessage(msg): + """Prints contact support message.""" + + # Messages can have associated RequestIds which + # identify operations (related to them) through the network. + requestId = msg.getRequestId() + if requestId is not None: + print("When contacting support, please provide RequestId {}".format(requestId)) + def main(): """Main function""" @@ -294,55 +329,29 @@ def main(): sessionOptions = prepareZfpSessionOptions(options) \ if options.remote \ else prepareStandardSessionOptions(options) - sessionOptions.setAuthenticationOptions(options.auth['option']) - sessionOptions.setAutoRestartOnDisconnection(True) + sessionOptions.setSessionIdentityOptions(options.auth['option']) session = blpapi.Session(sessionOptions) - - if not session.start(): - print("Failed to start session.") - return - - subscriptionIdentity = session.createIdentity() - - if options.auth['option']: - isAuthorized = False - authServiceName = "//blp/apiauth" - if session.openService(authServiceName): - authService = session.getService(authServiceName) - isAuthorized = authorize( - authService, subscriptionIdentity, session, - blpapi.CorrelationId("auth"), - options.auth.get('manual')) - if not isAuthorized: - print("No authorization") + try: + if not session.start(): + checkFailures(session) + print("Failed to start session.") return - subscriptions = blpapi.SubscriptionList() - for t in options.topics: - topic = options.service + t - subscriptions.add(topic, - options.fields, - options.options, - blpapi.CorrelationId(topic)) + if not session.openService(options.service): + checkFailures(session) + return - session.subscribe(subscriptions, subscriptionIdentity) + subscriptions = blpapi.SubscriptionList() + for t in options.topics: + topic = options.service + t + subscriptions.add(topic, + options.fields, + options.options, + blpapi.CorrelationId(topic)) + session.subscribe(subscriptions) - try: - eventCount = 0 - while True: - # Specify timeout to give a chance for Ctrl-C - event = session.nextEvent(1000) - for msg in event: - if event.eventType() == blpapi.Event.SUBSCRIPTION_STATUS or \ - event.eventType() == blpapi.Event.SUBSCRIPTION_DATA: - print("%s - %s" % (msg.correlationIds()[0].value(), msg)) - else: - print(msg) - if event.eventType() == blpapi.Event.SUBSCRIPTION_DATA: - eventCount += 1 - if eventCount >= options.maxEvents: - break + processSubscriptionEvents(session, options.maxEvents) finally: session.stop() diff --git a/examples/LocalPageSubscriptionExample.py b/examples/LocalPageSubscriptionExample.py index 0314bf8..6a5f2c6 100644 --- a/examples/LocalPageSubscriptionExample.py +++ b/examples/LocalPageSubscriptionExample.py @@ -2,42 +2,56 @@ from __future__ import print_function from __future__ import absolute_import -import blpapi -import datetime -import time -import traceback -import weakref from optparse import OptionParser, OptionValueError -from blpapi import Event as EventType -TOKEN_SUCCESS = blpapi.Name("TokenGenerationSuccess") -TOKEN_FAILURE = blpapi.Name("TokenGenerationFailure") -AUTHORIZATION_SUCCESS = blpapi.Name("AuthorizationSuccess") -TOKEN = blpapi.Name("token") +import os +import platform as plat +import sys +if sys.version_info >= (3, 8) and plat.system().lower() == "windows": + # pylint: disable=no-member + with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): + import blpapi +else: + import blpapi def authOptionCallback(option, opt, value, parser): vals = value.split('=', 1) if value == "user": - parser.values.auth = "AuthenticationType=OS_LOGON" + authUser = blpapi.AuthUser.createWithLogonName() + authOptions = blpapi.AuthOptions.createWithUser(authUser) elif value == "none": - parser.values.auth = None + authOptions = None elif vals[0] == "app" and len(vals) == 2: - parser.values.auth = "AuthenticationMode=APPLICATION_ONLY;"\ - "ApplicationAuthenticationType=APPNAME_AND_KEY;"\ - "ApplicationName=" + vals[1] + appName = vals[1] + authOptions = blpapi.AuthOptions.createWithApp(appName) elif vals[0] == "userapp" and len(vals) == 2: - parser.values.auth = "AuthenticationMode=USER_AND_APPLICATION;"\ - "AuthenticationType=OS_LOGON;"\ - "ApplicationAuthenticationType=APPNAME_AND_KEY;"\ - "ApplicationName=" + vals[1] + appName = vals[1] + authUser = blpapi.AuthUser.createWithLogonName() + authOptions = blpapi.AuthOptions\ + .createWithUserAndApp(authUser, appName) elif vals[0] == "dir" and len(vals) == 2: - parser.values.auth = "AuthenticationType=DIRECTORY_SERVICE;"\ - "DirSvcPropertyName=" + vals[1] + activeDirectoryProperty = vals[1] + authUser = blpapi.AuthUser\ + .createWithActiveDirectoryProperty(activeDirectoryProperty) + authOptions = blpapi.AuthOptions.createWithUser(authUser) + elif vals[0] == "manual": + parts = [] + if len(vals) == 2: + parts = vals[1].split(',') + + if len(parts) != 3: + raise OptionValueError("Invalid auth option {}".format(value)) + + appName, ip, userId = parts + + authUser = blpapi.AuthUser.createWithManualOptions(userId, ip) + authOptions = blpapi.AuthOptions.createWithUserAndApp(authUser, appName) else: - raise OptionValueError("Invalid auth option '%s'" % value) + raise OptionValueError("Invalid auth option '{}'".format(value)) + parser.values.auth = {'option' : authOptions} def parseCmdLine(): parser = OptionParser(description="Page monitor.") @@ -68,69 +82,26 @@ def parseCmdLine(): parser.add_option("--auth", dest="auth", help="authentication option: " - "user|none|app=|userapp=|dir=" - " (default: %default)", + "user|none|app=|userapp=|dir=" + " (default: user)\n" + "'none' is applicable to Desktop API product " + "that requires Bloomberg Professional service " + "to be installed locally.", metavar="option", action="callback", callback=authOptionCallback, type="string", - default="user") + default={"option" : + blpapi.AuthOptions.createWithUser( + blpapi.AuthUser.createWithLogonName())}) - (options, args) = parser.parse_args() + (options, _) = parser.parse_args() if not options.hosts: options.hosts = ["localhost"] return options - -def authorize(authService, identity, session, cid): - tokenEventQueue = blpapi.EventQueue() - session.generateToken(eventQueue=tokenEventQueue) - - # Process related response - ev = tokenEventQueue.nextEvent() - token = None - if ev.eventType() == blpapi.Event.TOKEN_STATUS or \ - ev.eventType() == blpapi.Event.REQUEST_STATUS: - for msg in ev: - print(msg) - if msg.messageType() == TOKEN_SUCCESS: - token = msg.getElementAsString(TOKEN) - elif msg.messageType() == TOKEN_FAILURE: - break - - if not token: - print("Failed to get token") - return False - - # Create and fill the authorization request - authRequest = authService.createAuthorizationRequest() - authRequest.set(TOKEN, token) - - # Send authorization request to "fill" the Identity - session.sendAuthorizationRequest(authRequest, identity, cid) - - # Process related responses - startTime = datetime.datetime.today() - WAIT_TIME_SECONDS = 10 - while True: - event = session.nextEvent(WAIT_TIME_SECONDS * 1000) - if event.eventType() == blpapi.Event.RESPONSE or \ - event.eventType() == blpapi.Event.REQUEST_STATUS or \ - event.eventType() == blpapi.Event.PARTIAL_RESPONSE: - for msg in event: - print(msg) - if msg.messageType() == AUTHORIZATION_SUCCESS: - return True - print("Authorization failed") - return False - - endTime = datetime.datetime.today() - if endTime - startTime > datetime.timedelta(seconds=WAIT_TIME_SECONDS): - return False - - def main(): options = parseCmdLine() @@ -138,7 +109,7 @@ def main(): sessionOptions = blpapi.SessionOptions() for idx, host in enumerate(options.hosts): sessionOptions.setServerAddress(host, options.port, idx) - sessionOptions.setAuthenticationOptions(options.auth) + sessionOptions.setSessionIdentityOptions(options.auth['option']) sessionOptions.setAutoRestartOnDisconnection(True) # NOTE: If running without a backup server, make many attempts to @@ -159,27 +130,13 @@ def main(): print("Failed to start session.") return - subscriptionIdentity = session.createIdentity() - - if options.auth: - isAuthorized = False - authServiceName = "//blp/apiauth" - if session.openService(authServiceName): - authService = session.getService(authServiceName) - isAuthorized = authorize( - authService, subscriptionIdentity, session, - blpapi.CorrelationId("auth")) - if not isAuthorized: - print("No authorization") - return - topic = options.service + "/1245/4/5" topic2 = options.service + "/330/1/1" subscriptions = blpapi.SubscriptionList() subscriptions.add(topic, correlationId=blpapi.CorrelationId(topic)) subscriptions.add(topic2, correlationId=blpapi.CorrelationId(topic2)) - session.subscribe(subscriptions, subscriptionIdentity) + session.subscribe(subscriptions) try: eventCount = 0 diff --git a/examples/MktdataBroadcastPublisherExample.py b/examples/MktdataBroadcastPublisherExample.py index 407f688..6dc203d 100644 --- a/examples/MktdataBroadcastPublisherExample.py +++ b/examples/MktdataBroadcastPublisherExample.py @@ -2,33 +2,22 @@ from __future__ import print_function from __future__ import absolute_import -import blpapi -# compatibility between python 2 and 3 -from blpapi.compat import with_metaclass import time from optparse import OptionParser, OptionValueError -import datetime -import threading -TOKEN_SUCCESS = blpapi.Name("TokenGenerationSuccess") -TOKEN_FAILURE = blpapi.Name("TokenGenerationFailure") -AUTHORIZATION_SUCCESS = blpapi.Name("AuthorizationSuccess") -TOKEN = blpapi.Name("token") -SESSION_TERMINATED = blpapi.Name("SessionTerminated") +import os +import platform as plat +import sys +if sys.version_info >= (3, 8) and plat.system().lower() == "windows": + # pylint: disable=no-member + with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): + import blpapi +else: + import blpapi +SESSION_TERMINATED = blpapi.Name("SessionTerminated") g_running = True -g_mutex = threading.Lock() - - -@with_metaclass(blpapi.utils.MetaClassForClassesWithEnums) -class AuthorizationStatus: - WAITING = 1 - AUTHORIZED = 2 - FAILED = 3 - - -g_authorizationStatus = dict() class MyStream(object): @@ -47,40 +36,46 @@ def processEvent(self, event, session): g_running = False continue - cids = msg.correlationIds() - with g_mutex: - for cid in cids: - if cid in g_authorizationStatus: - if msg.messageType() == AUTHORIZATION_SUCCESS: - g_authorizationStatus[cid] = \ - AuthorizationStatus.AUTHORIZED - else: - g_authorizationStatus[cid] = \ - AuthorizationStatus.FAILED - def authOptionCallback(option, opt, value, parser): + """Parse authorization options from user input""" + vals = value.split('=', 1) if value == "user": - parser.values.auth = "AuthenticationType=OS_LOGON" + authUser = blpapi.AuthUser.createWithLogonName() + authOptions = blpapi.AuthOptions.createWithUser(authUser) elif value == "none": - parser.values.auth = None + authOptions = None elif vals[0] == "app" and len(vals) == 2: - parser.values.auth = "AuthenticationMode=APPLICATION_ONLY;"\ - "ApplicationAuthenticationType=APPNAME_AND_KEY;"\ - "ApplicationName=" + vals[1] + appName = vals[1] + authOptions = blpapi.AuthOptions.createWithApp(appName) elif vals[0] == "userapp" and len(vals) == 2: - parser.values.auth = "AuthenticationMode=USER_AND_APPLICATION;"\ - "AuthenticationType=OS_LOGON;"\ - "ApplicationAuthenticationType=APPNAME_AND_KEY;"\ - "ApplicationName=" + vals[1] + appName = vals[1] + authUser = blpapi.AuthUser.createWithLogonName() + authOptions = blpapi.AuthOptions\ + .createWithUserAndApp(authUser, appName) elif vals[0] == "dir" and len(vals) == 2: - parser.values.auth = "AuthenticationType=DIRECTORY_SERVICE;"\ - "DirSvcPropertyName=" + vals[1] + activeDirectoryProperty = vals[1] + authUser = blpapi.AuthUser\ + .createWithActiveDirectoryProperty(activeDirectoryProperty) + authOptions = blpapi.AuthOptions.createWithUser(authUser) + elif vals[0] == "manual": + parts = [] + if len(vals) == 2: + parts = vals[1].split(',') + + if len(parts) != 3: + raise OptionValueError("Invalid auth option {}".format(value)) + + appName, ip, userId = parts + + authUser = blpapi.AuthUser.createWithManualOptions(userId, ip) + authOptions = blpapi.AuthOptions.createWithUserAndApp(authUser, appName) else: - raise OptionValueError("Invalid auth option '%s'" % value) + raise OptionValueError("Invalid auth option '{}'".format(value)) + parser.values.auth = {'option' : authOptions} def parseCmdLine(): parser = OptionParser(description="Publish market data.") @@ -124,15 +119,21 @@ def parseCmdLine(): parser.add_option("--auth", dest="auth", help="authentication option: " - "user|none|app=|userapp=|dir=" - " (default: %default)", + "user|none|app=|userapp=|dir=" + "|manual=" + " (default: user)\n" + "'none' is applicable to Desktop API product " + "that requires Bloomberg Professional service " + "to be installed locally.", metavar="option", action="callback", callback=authOptionCallback, type="string", - default="user") + default={"option" : + blpapi.AuthOptions.createWithUser( + blpapi.AuthUser.createWithLogonName())}) - (options, args) = parser.parse_args() + (options, _) = parser.parse_args() if not options.hosts: options.hosts = ["localhost"] @@ -143,53 +144,6 @@ def parseCmdLine(): return options -def authorize(authService, identity, session, cid): - with g_mutex: - g_authorizationStatus[cid] = AuthorizationStatus.WAITING - - tokenEventQueue = blpapi.EventQueue() - - # Generate token - session.generateToken(eventQueue=tokenEventQueue) - - # Process related response - ev = tokenEventQueue.nextEvent() - token = None - if ev.eventType() == blpapi.Event.TOKEN_STATUS or \ - ev.eventType() == blpapi.Event.REQUEST_STATUS: - for msg in ev: - print(msg) - if msg.messageType() == TOKEN_SUCCESS: - token = msg.getElementAsString(TOKEN) - elif msg.messageType() == TOKEN_FAILURE: - break - if not token: - print("Failed to get token") - return False - - # Create and fill the authorization request - authRequest = authService.createAuthorizationRequest() - authRequest.set(TOKEN, token) - - # Send authorization request to "fill" the Identity - session.sendAuthorizationRequest(authRequest, identity, cid) - - # Process related responses - startTime = datetime.datetime.today() - WAIT_TIME_SECONDS = datetime.timedelta(seconds=10) - while True: - with g_mutex: - if AuthorizationStatus.WAITING != g_authorizationStatus[cid]: - return AuthorizationStatus.AUTHORIZED == \ - g_authorizationStatus[cid] - - endTime = datetime.datetime.today() - if endTime - startTime > WAIT_TIME_SECONDS: - return False - - time.sleep(1) - - def main(): options = parseCmdLine() @@ -197,7 +151,7 @@ def main(): sessionOptions = blpapi.SessionOptions() for idx, host in enumerate(options.hosts): sessionOptions.setServerAddress(host, options.port, idx) - sessionOptions.setAuthenticationOptions(options.auth) + sessionOptions.setSessionIdentityOptions(options.auth['option']) sessionOptions.setAutoRestartOnDisconnection(True) # NOTE: If running without a backup server, make many attempts to @@ -220,20 +174,6 @@ def main(): print("Failed to start session.") return - providerIdentity = session.createIdentity() - - if options.auth: - isAuthorized = False - authServiceName = "//blp/apiauth" - if session.openService(authServiceName): - authService = session.getService(authServiceName) - isAuthorized = authorize( - authService, providerIdentity, session, - blpapi.CorrelationId("auth")) - if not isAuthorized: - print("No authorization") - return - if options.groupId is not None: # NOTE: will perform explicit service registration here, instead # of letting createTopics do it, as the latter approach doesn't @@ -241,9 +181,10 @@ def main(): serviceOptions = blpapi.ServiceRegistrationOptions() serviceOptions.setGroupId(options.groupId) if not session.registerService(options.service, - identity, + session.getAuthorizedIdentity(), serviceOptions): print("Failed to register %s" % options.service) + session.stop() return topicList = blpapi.TopicList() @@ -252,8 +193,7 @@ def main(): # Create topics session.createTopics(topicList, - blpapi.ProviderSession.AUTO_REGISTER_SERVICES, - providerIdentity) + blpapi.ProviderSession.AUTO_REGISTER_SERVICES) # createTopics() is synchronous, topicList will be updated # with the results of topic creation (resolution will happen # under the covers) diff --git a/examples/MktdataPublisher.py b/examples/MktdataPublisher.py index 4afe535..a8b5aee 100644 --- a/examples/MktdataPublisher.py +++ b/examples/MktdataPublisher.py @@ -2,21 +2,24 @@ from __future__ import print_function from __future__ import absolute_import -import blpapi -# compatibility between python 2 and 3 -from blpapi.compat import with_metaclass import time from optparse import OptionParser, OptionValueError import datetime import threading -AUTHORIZATION_SUCCESS = blpapi.Name("AuthorizationSuccess") +import os +import platform as plat +import sys +if sys.version_info >= (3, 8) and plat.system().lower() == "windows": + # pylint: disable=no-member + with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): + import blpapi +else: + import blpapi + PERMISSION_REQUEST = blpapi.Name("PermissionRequest") RESOLUTION_SUCCESS = blpapi.Name("ResolutionSuccess") SESSION_TERMINATED = blpapi.Name("SessionTerminated") -TOKEN = blpapi.Name("token") -TOKEN_SUCCESS = blpapi.Name("TokenGenerationSuccess") -TOKEN_FAILURE = blpapi.Name("TokenGenerationFailure") TOPICS = blpapi.Name("topics") TOPIC_CREATED = blpapi.Name("TopicCreated") TOPIC_SUBSCRIBED = blpapi.Name("TopicSubscribed") @@ -91,16 +94,6 @@ def isAvailable(self): g_condition = threading.Condition(g_mutex) -@with_metaclass(blpapi.utils.MetaClassForClassesWithEnums) -class AuthorizationStatus: - WAITING = 1 - AUTHORIZED = 2 - FAILED = 3 - - -g_authorizationStatus = dict() - - class MyEventHandler(object): def __init__(self, serviceName, @@ -292,42 +285,49 @@ def processEvent(self, event, session): else: for msg in event: print(msg) - cids = msg.correlationIds() - with g_mutex: - for cid in cids: - if cid in g_authorizationStatus: - if msg.messageType() == AUTHORIZATION_SUCCESS: - g_authorizationStatus[cid] = \ - AuthorizationStatus.AUTHORIZED - else: - g_authorizationStatus[cid] = \ - AuthorizationStatus.FAILED return True def authOptionCallback(option, opt, value, parser): + """Parse authorization options from user input""" + vals = value.split('=', 1) if value == "user": - parser.values.auth = "AuthenticationType=OS_LOGON" + authUser = blpapi.AuthUser.createWithLogonName() + authOptions = blpapi.AuthOptions.createWithUser(authUser) elif value == "none": - parser.values.auth = None + authOptions = None elif vals[0] == "app" and len(vals) == 2: - parser.values.auth = "AuthenticationMode=APPLICATION_ONLY;"\ - "ApplicationAuthenticationType=APPNAME_AND_KEY;"\ - "ApplicationName=" + vals[1] + appName = vals[1] + authOptions = blpapi.AuthOptions.createWithApp(appName) elif vals[0] == "userapp" and len(vals) == 2: - parser.values.auth = "AuthenticationMode=USER_AND_APPLICATION;"\ - "AuthenticationType=OS_LOGON;"\ - "ApplicationAuthenticationType=APPNAME_AND_KEY;"\ - "ApplicationName=" + vals[1] + appName = vals[1] + authUser = blpapi.AuthUser.createWithLogonName() + authOptions = blpapi.AuthOptions\ + .createWithUserAndApp(authUser, appName) elif vals[0] == "dir" and len(vals) == 2: - parser.values.auth = "AuthenticationType=DIRECTORY_SERVICE;"\ - "DirSvcPropertyName=" + vals[1] + activeDirectoryProperty = vals[1] + authUser = blpapi.AuthUser\ + .createWithActiveDirectoryProperty(activeDirectoryProperty) + authOptions = blpapi.AuthOptions.createWithUser(authUser) + elif vals[0] == "manual": + parts = [] + if len(vals) == 2: + parts = vals[1].split(',') + + if len(parts) != 3: + raise OptionValueError("Invalid auth option {}".format(value)) + + appName, ip, userId = parts + + authUser = blpapi.AuthUser.createWithManualOptions(userId, ip) + authOptions = blpapi.AuthOptions.createWithUserAndApp(authUser, appName) else: - raise OptionValueError("Invalid auth option '%s'" % value) + raise OptionValueError("Invalid auth option '{}'".format(value)) + parser.values.auth = {'option' : authOptions} def parseCmdLine(): parser = OptionParser(description="Publish market data.") @@ -387,13 +387,19 @@ def parseCmdLine(): parser.add_option("--auth", dest="auth", help="authentication option: " - "user|none|app=|userapp=|dir=" - " (default: %default)", + "user|none|app=|userapp=|dir=" + "|manual=" + " (default: user)\n" + "'none' is applicable to Desktop API product " + "that requires Bloomberg Professional service " + "to be installed locally.", metavar="option", action="callback", callback=authOptionCallback, type="string", - default="user") + default={"option" : + blpapi.AuthOptions.createWithUser( + blpapi.AuthUser.createWithLogonName())}) parser.add_option("--ssc", dest="ssc", help="active sub-service code option: " @@ -406,7 +412,7 @@ def parseCmdLine(): metavar="rssc", default="") - (options, args) = parser.parse_args() + (options, _) = parser.parse_args() if not options.hosts: options.hosts = ["localhost"] @@ -438,54 +444,6 @@ def deactivate(options, session): sscEnd) -def authorize(authService, identity, session, cid): - global g_mutex, g_authorizationStatus - - with g_mutex: - g_authorizationStatus[cid] = AuthorizationStatus.WAITING - - tokenEventQueue = blpapi.EventQueue() - - # Generate token - session.generateToken(eventQueue=tokenEventQueue) - - # Process related response - ev = tokenEventQueue.nextEvent() - token = None - if ev.eventType() == blpapi.Event.TOKEN_STATUS: - for msg in ev: - print(msg) - if msg.messageType() == TOKEN_SUCCESS: - token = msg.getElementAsString(TOKEN) - elif msg.messageType() == TOKEN_FAILURE: - break - if not token: - print("Failed to get token") - return False - - # Create and fill the authorization request - authRequest = authService.createAuthorizationRequest() - authRequest.set(TOKEN, token) - - # Send authorization request to "fill" the Identity - session.sendAuthorizationRequest(authRequest, identity, cid) - - # Process related responses - startTime = datetime.datetime.today() - WAIT_TIME_SECONDS = datetime.timedelta(seconds=10) - while True: - with g_mutex: - if AuthorizationStatus.WAITING != g_authorizationStatus[cid]: - return AuthorizationStatus.AUTHORIZED == \ - g_authorizationStatus[cid] - - endTime = datetime.datetime.today() - if endTime - startTime > WAIT_TIME_SECONDS: - return False - - time.sleep(1) - - def main(): options = parseCmdLine() @@ -493,7 +451,7 @@ def main(): sessionOptions = blpapi.SessionOptions() for idx, host in enumerate(options.hosts): sessionOptions.setServerAddress(host, options.port, idx) - sessionOptions.setAuthenticationOptions(options.auth) + sessionOptions.setSessionIdentityOptions(options.auth['option']) sessionOptions.setAutoRestartOnDisconnection(True) # NOTE: If running without a backup server, make many attempts to @@ -525,20 +483,6 @@ def main(): print("Failed to start session.") return - providerIdentity = session.createIdentity() - - if options.auth: - isAuthorized = False - authServiceName = "//blp/apiauth" - if session.openService(authServiceName): - authService = session.getService(authServiceName) - isAuthorized = authorize( - authService, providerIdentity, session, - blpapi.CorrelationId("auth")) - if not isAuthorized: - print("No authorization") - return - serviceOptions = blpapi.ServiceRegistrationOptions() if options.groupId is not None: serviceOptions.setGroupId(options.groupId) @@ -556,17 +500,16 @@ def main(): print(("FAILED to add active sub service codes." " Exception %s" % e.description())) - if not session.registerService(options.service, - providerIdentity, - serviceOptions): - print("Failed to register '%s'" % options.service) - return - - service = session.getService(options.service) - elementDef = service.getEventDefinition(PUBLISH_MESSAGE_TYPE) - eventCount = 0 - try: + if not session.registerService(options.service, + session.getAuthorizedIdentity(), + serviceOptions): + print("Failed to register '%s'" % options.service) + return + + service = session.getService(options.service) + elementDef = service.getEventDefinition(PUBLISH_MESSAGE_TYPE) + eventCount = 0 numPublished = 0 while g_running: event = service.createPublishEvent() diff --git a/examples/PagePublisherExample.py b/examples/PagePublisherExample.py index 3c67f9b..bcd7ad7 100644 --- a/examples/PagePublisherExample.py +++ b/examples/PagePublisherExample.py @@ -2,21 +2,24 @@ from __future__ import print_function from __future__ import absolute_import -import blpapi -# compatibility between python 2 and 3 -from blpapi.compat import with_metaclass import time from optparse import OptionParser, OptionValueError import datetime import threading -AUTHORIZATION_SUCCESS = blpapi.Name("AuthorizationSuccess") +import os +import platform as plat +import sys +if sys.version_info >= (3, 8) and plat.system().lower() == "windows": + # pylint: disable=no-member + with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): + import blpapi +else: + import blpapi + RESOLUTION_SUCCESS = blpapi.Name("ResolutionSuccess") PERMISSION_REQUEST = blpapi.Name("PermissionRequest") SESSION_TERMINATED = blpapi.Name("SessionTerminated") -TOKEN = blpapi.Name("token") -TOKEN_SUCCESS = blpapi.Name("TokenGenerationSuccess") -TOKEN_FAILURE = blpapi.Name("TokenGenerationFailure") TOPICS = blpapi.Name("topics") TOPIC_CREATED = blpapi.Name("TopicCreated") TOPIC_RECAP = blpapi.Name("TopicRecap") @@ -28,16 +31,6 @@ g_mutex = threading.Lock() -@with_metaclass(blpapi.utils.MetaClassForClassesWithEnums) -class AuthorizationStatus: - WAITING = 1 - AUTHORIZED = 2 - FAILED = 3 - - -g_authorizationStatus = dict() - - class MyStream(object): def __init__(self, id=""): self.id = id @@ -204,42 +197,48 @@ def processEvent(self, event, session): else: for msg in event: print(msg) - cids = msg.correlationIds() - with g_mutex: - for cid in cids: - if cid in g_authorizationStatus: - if msg.messageType() == AUTHORIZATION_SUCCESS: - g_authorizationStatus[cid] = \ - AuthorizationStatus.AUTHORIZED - else: - g_authorizationStatus[cid] = \ - AuthorizationStatus.FAILED - return True def authOptionCallback(option, opt, value, parser): + """Parse authorization options from user input""" + vals = value.split('=', 1) if value == "user": - parser.values.auth = "AuthenticationType=OS_LOGON" + authUser = blpapi.AuthUser.createWithLogonName() + authOptions = blpapi.AuthOptions.createWithUser(authUser) elif value == "none": - parser.values.auth = None + authOptions = None elif vals[0] == "app" and len(vals) == 2: - parser.values.auth = "AuthenticationMode=APPLICATION_ONLY;"\ - "ApplicationAuthenticationType=APPNAME_AND_KEY;"\ - "ApplicationName=" + vals[1] + appName = vals[1] + authOptions = blpapi.AuthOptions.createWithApp(appName) elif vals[0] == "userapp" and len(vals) == 2: - parser.values.auth = "AuthenticationMode=USER_AND_APPLICATION;"\ - "AuthenticationType=OS_LOGON;"\ - "ApplicationAuthenticationType=APPNAME_AND_KEY;"\ - "ApplicationName=" + vals[1] + appName = vals[1] + authUser = blpapi.AuthUser.createWithLogonName() + authOptions = blpapi.AuthOptions\ + .createWithUserAndApp(authUser, appName) elif vals[0] == "dir" and len(vals) == 2: - parser.values.auth = "AuthenticationType=DIRECTORY_SERVICE;"\ - "DirSvcPropertyName=" + vals[1] + activeDirectoryProperty = vals[1] + authUser = blpapi.AuthUser\ + .createWithActiveDirectoryProperty(activeDirectoryProperty) + authOptions = blpapi.AuthOptions.createWithUser(authUser) + elif vals[0] == "manual": + parts = [] + if len(vals) == 2: + parts = vals[1].split(',') + + if len(parts) != 3: + raise OptionValueError("Invalid auth option {}".format(value)) + + appName, ip, userId = parts + + authUser = blpapi.AuthUser.createWithManualOptions(userId, ip) + authOptions = blpapi.AuthOptions.createWithUserAndApp(authUser, appName) else: - raise OptionValueError("Invalid auth option '%s'" % value) + raise OptionValueError("Invalid auth option '{}'".format(value)) + parser.values.auth = {'option' : authOptions} def parseCmdLine(): parser = OptionParser(description="Publish on a topic.") @@ -275,15 +274,21 @@ def parseCmdLine(): parser.add_option("--auth", dest="auth", help="authentication option: " - "user|none|app=|userapp=|dir=" - " (default: %default)", + "user|none|app=|userapp=|dir=" + "|manual=" + " (default: user)\n" + "'none' is applicable to Desktop API product " + "that requires Bloomberg Professional service " + "to be installed locally.", metavar="option", action="callback", callback=authOptionCallback, type="string", - default="user") + default={"option" : + blpapi.AuthOptions.createWithUser( + blpapi.AuthUser.createWithLogonName())}) - (options, args) = parser.parse_args() + (options, _) = parser.parse_args() if not options.hosts: options.hosts = ["localhost"] @@ -291,53 +296,6 @@ def parseCmdLine(): return options -def authorize(authService, identity, session, cid): - with g_mutex: - g_authorizationStatus[cid] = AuthorizationStatus.WAITING - - tokenEventQueue = blpapi.EventQueue() - - # Generate token - session.generateToken(eventQueue=tokenEventQueue) - - # Process related response - ev = tokenEventQueue.nextEvent() - token = None - if ev.eventType() == blpapi.Event.TOKEN_STATUS or \ - ev.eventType() == blpapi.Event.REQUEST_STATUS: - for msg in ev: - print(msg) - if msg.messageType() == TOKEN_SUCCESS: - token = msg.getElementAsString(TOKEN) - elif msg.messageType() == TOKEN_FAILURE: - break - if not token: - print("Failed to get token") - return False - - # Create and fill the authorization request - authRequest = authService.createAuthorizationRequest() - authRequest.set(TOKEN, token) - - # Send authorization request to "fill" the Identity - session.sendAuthorizationRequest(authRequest, identity, cid) - - # Process related responses - startTime = datetime.datetime.today() - WAIT_TIME_SECONDS = datetime.timedelta(seconds=10) - while True: - with g_mutex: - if AuthorizationStatus.WAITING != g_authorizationStatus[cid]: - return AuthorizationStatus.AUTHORIZED == \ - g_authorizationStatus[cid] - - endTime = datetime.datetime.today() - if endTime - startTime > WAIT_TIME_SECONDS: - return False - - time.sleep(1) - - def main(): options = parseCmdLine() @@ -345,7 +303,7 @@ def main(): sessionOptions = blpapi.SessionOptions() for idx, host in enumerate(options.hosts): sessionOptions.setServerAddress(host, options.port, idx) - sessionOptions.setAuthenticationOptions(options.auth) + sessionOptions.setSessionIdentityOptions(options.auth['option']) sessionOptions.setAutoRestartOnDisconnection(True) sessionOptions.setNumStartAttempts(len(options.hosts)) @@ -363,34 +321,20 @@ def main(): print("Failed to start session.") return - providerIdentity = session.createIdentity() - - if options.auth: - isAuthorized = False - authServiceName = "//blp/apiauth" - if session.openService(authServiceName): - authService = session.getService(authServiceName) - isAuthorized = authorize( - authService, providerIdentity, session, - blpapi.CorrelationId("auth")) - if not isAuthorized: - print("No authorization") - return - serviceOptions = blpapi.ServiceRegistrationOptions() if options.groupId is not None: serviceOptions.setGroupId(options.groupId) serviceOptions.setServicePriority(options.priority) - if not session.registerService(options.service, - providerIdentity, - serviceOptions): - print("Failed to register '%s'" % options.service) - return + try: + if not session.registerService(options.service, + session.getAuthorizedIdentity(), + serviceOptions): + print("Failed to register '%s'" % options.service) + return - service = session.getService(options.service) + service = session.getService(options.service) - try: # Now we will start publishing value = 1 while g_running: diff --git a/examples/RefDataTableOverrideExample.py b/examples/RefDataTableOverrideExample.py index 4d3019f..c62195f 100644 --- a/examples/RefDataTableOverrideExample.py +++ b/examples/RefDataTableOverrideExample.py @@ -2,9 +2,17 @@ from __future__ import print_function from __future__ import absolute_import -import blpapi from optparse import OptionParser +import os +import platform as plat +import sys +if sys.version_info >= (3, 8) and plat.system().lower() == "windows": + # pylint: disable=no-member + with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): + import blpapi +else: + import blpapi SECURITY_DATA = blpapi.Name("securityData") SECURITY = blpapi.Name("security") diff --git a/examples/RequestServiceExample.py b/examples/RequestServiceExample.py index abc8211..9f9ad98 100644 --- a/examples/RequestServiceExample.py +++ b/examples/RequestServiceExample.py @@ -2,36 +2,27 @@ from __future__ import print_function from __future__ import absolute_import -import blpapi -# compatibility between python 2 and 3 -from blpapi.compat import with_metaclass -import datetime import time import threading from optparse import OptionParser, OptionValueError -AUTHORIZATION_SUCCESS = blpapi.Name("AuthorizationSuccess") +import os +import platform as plat +import sys +if sys.version_info >= (3, 8) and plat.system().lower() == "windows": + # pylint: disable=no-member + with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): + import blpapi +else: + import blpapi + RESOLUTION_SUCCESS = blpapi.Name("ResolutionSuccess") SESSION_TERMINATED = blpapi.Name("SessionTerminated") -TOKEN = blpapi.Name("token") -TOKEN_SUCCESS = blpapi.Name("TokenGenerationSuccess") -TOKEN_FAILURE = blpapi.Name("TokenGenerationFailure") - g_running = True g_mutex = threading.Lock() -@with_metaclass(blpapi.utils.MetaClassForClassesWithEnums) -class AuthorizationStatus: - WAITING = 1 - AUTHORIZED = 2 - FAILED = 3 - - -g_authorizationStatus = dict() - - class MyProviderEventHandler(object): def __init__(self, serviceName): self.serviceName = serviceName @@ -102,17 +93,6 @@ def processEvent(self, event, session): else: for msg in event: print(msg) - cids = msg.correlationIds() - with g_mutex: - for cid in cids: - if cid in g_authorizationStatus: - if msg.messageType() == AUTHORIZATION_SUCCESS: - g_authorizationStatus[cid] = \ - AuthorizationStatus.AUTHORIZED - else: - g_authorizationStatus[cid] = \ - AuthorizationStatus.FAILED - return True @@ -121,40 +101,47 @@ def processEvent(self, event, session): print("Client received an event") for msg in event: print(msg) - cids = msg.correlationIds() - with g_mutex: - for cid in cids: - if cid in g_authorizationStatus: - if msg.messageType() == AUTHORIZATION_SUCCESS: - g_authorizationStatus[cid] = \ - AuthorizationStatus.AUTHORIZED - else: - g_authorizationStatus[cid] = \ - AuthorizationStatus.FAILED def authOptionCallback(option, opt, value, parser): + """Parse authorization options from user input""" + vals = value.split('=', 1) if value == "user": - parser.values.auth = "AuthenticationType=OS_LOGON" + authUser = blpapi.AuthUser.createWithLogonName() + authOptions = blpapi.AuthOptions.createWithUser(authUser) elif value == "none": - parser.values.auth = None + authOptions = None elif vals[0] == "app" and len(vals) == 2: - parser.values.auth = "AuthenticationMode=APPLICATION_ONLY;"\ - "ApplicationAuthenticationType=APPNAME_AND_KEY;"\ - "ApplicationName=" + vals[1] + appName = vals[1] + authOptions = blpapi.AuthOptions.createWithApp(appName) elif vals[0] == "userapp" and len(vals) == 2: - parser.values.auth = "AuthenticationMode=USER_AND_APPLICATION;"\ - "AuthenticationType=OS_LOGON;"\ - "ApplicationAuthenticationType=APPNAME_AND_KEY;"\ - "ApplicationName=" + vals[1] + appName = vals[1] + authUser = blpapi.AuthUser.createWithLogonName() + authOptions = blpapi.AuthOptions\ + .createWithUserAndApp(authUser, appName) elif vals[0] == "dir" and len(vals) == 2: - parser.values.auth = "AuthenticationType=DIRECTORY_SERVICE;"\ - "DirSvcPropertyName=" + vals[1] + activeDirectoryProperty = vals[1] + authUser = blpapi.AuthUser\ + .createWithActiveDirectoryProperty(activeDirectoryProperty) + authOptions = blpapi.AuthOptions.createWithUser(authUser) + elif vals[0] == "manual": + parts = [] + if len(vals) == 2: + parts = vals[1].split(',') + + if len(parts) != 3: + raise OptionValueError("Invalid auth option {}".format(value)) + + appName, ip, userId = parts + + authUser = blpapi.AuthUser.createWithManualOptions(userId, ip) + authOptions = blpapi.AuthOptions.createWithUserAndApp(authUser, appName) else: - raise OptionValueError("Invalid auth option '%s'" % value) + raise OptionValueError("Invalid auth option '{}'".format(value)) + parser.values.auth = {'option' : authOptions} def parseCmdLine(): parser = OptionParser() @@ -199,15 +186,21 @@ def parseCmdLine(): parser.add_option("--auth", dest="auth", help="authentication option: " - "user|none|app=|userapp=|dir=" - " (default: %default)", + "user|none|app=|userapp=|dir=" + "|manual=" + " (default: user)\n" + "'none' is applicable to Desktop API product " + "that requires Bloomberg Professional service " + "to be installed locally.", metavar="option", action="callback", callback=authOptionCallback, type="string", - default="user") + default={"option" : + blpapi.AuthOptions.createWithUser( + blpapi.AuthUser.createWithLogonName())}) - (options, args) = parser.parse_args() + (options, _) = parser.parse_args() if not options.hosts: options.hosts = ["localhost"] @@ -228,21 +221,7 @@ def serverRun(session, options): print("Failed to start server session.") return - providerIdentity = session.createIdentity() - - if options.auth: - isAuthorized = False - authServiceName = "//blp/apiauth" - if session.openService(authServiceName): - authService = session.getService(authServiceName) - isAuthorized = authorize( - authService, providerIdentity, session, - blpapi.CorrelationId("sauth")) - if not isAuthorized: - print("No authorization") - return - - if not session.registerService(options.service, providerIdentity): + if not session.registerService(options.service): print("Failed to register", options.service) return @@ -254,20 +233,6 @@ def clientRun(session, options): print("Failed to start client session.") return - identity = session.createIdentity() - - if options.auth: - isAuthorized = False - authServiceName = "//blp/apiauth" - if session.openService(authServiceName): - authService = session.getService(authServiceName) - isAuthorized = authorize( - authService, identity, session, - blpapi.CorrelationId("cauth")) - if not isAuthorized: - print("No authorization") - return - if not session.openService(options.service): print("Failed to open", options.service) return @@ -291,8 +256,8 @@ def clientRun(session, options): print("Sendind Request:", request) eventQueue = blpapi.EventQueue() - session.sendRequest(request, identity, blpapi.CorrelationId("AddRequest"), - eventQueue) + session.sendRequest( + request, None, blpapi.CorrelationId("AddRequest"), eventQueue) while True: # Specify timeout to give a chance for Ctrl-C @@ -314,51 +279,6 @@ def clientRun(session, options): break -def authorize(authService, identity, session, cid): - with g_mutex: - g_authorizationStatus[cid] = AuthorizationStatus.WAITING - - tokenEventQueue = blpapi.EventQueue() - session.generateToken(eventQueue=tokenEventQueue) - - # Process related response - ev = tokenEventQueue.nextEvent() - token = None - if ev.eventType() == blpapi.Event.TOKEN_STATUS or \ - ev.eventType() == blpapi.Event.REQUEST_STATUS: - for msg in ev: - print(msg) - if msg.messageType() == TOKEN_SUCCESS: - token = msg.getElementAsString(TOKEN) - elif msg.messageType() == TOKEN_FAILURE: - break - - if not token: - print("Failed to get token") - return False - - # Create and fill the authorization request - authRequest = authService.createAuthorizationRequest() - authRequest.set(TOKEN, token) - - # Send authorization request to "fill" the Identity - session.sendAuthorizationRequest(authRequest, identity, cid) - - # Process related responses - startTime = datetime.datetime.today() - WAIT_TIME_SECONDS = 10 - while True: - with g_mutex: - if AuthorizationStatus.WAITING != g_authorizationStatus[cid]: - return AuthorizationStatus.AUTHORIZED == g_authorizationStatus[cid] - - endTime = datetime.datetime.today() - if endTime - startTime > datetime.timedelta(seconds=WAIT_TIME_SECONDS): - return False - - time.sleep(1) - - def main(): options = parseCmdLine() @@ -366,7 +286,7 @@ def main(): sessionOptions = blpapi.SessionOptions() for idx, host in enumerate(options.hosts): sessionOptions.setServerAddress(host, options.port, idx) - sessionOptions.setAuthenticationOptions(options.auth) + sessionOptions.setSessionIdentityOptions(options.auth['option']) sessionOptions.setAutoRestartOnDisconnection(True) sessionOptions.setNumStartAttempts(len(options.hosts)) diff --git a/examples/ServiceSchema.py b/examples/ServiceSchema.py index cde7309..70289ee 100644 --- a/examples/ServiceSchema.py +++ b/examples/ServiceSchema.py @@ -2,17 +2,19 @@ from __future__ import print_function from __future__ import absolute_import -import blpapi -import time -from optparse import OptionParser +from optparse import OptionParser, OptionValueError + +import os +import platform as plat +import sys +if sys.version_info >= (3, 8) and plat.system().lower() == "windows": + # pylint: disable=no-member + with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): + import blpapi +else: + import blpapi -TOKEN_SUCCESS = blpapi.Name("TokenGenerationSuccess") -TOKEN_FAILURE = blpapi.Name("TokenGenerationFailure") -AUTHORIZATION_SUCCESS = blpapi.Name("AuthorizationSuccess") REFERENCE_DATA_RESPONSE = blpapi.Name("ReferenceDataResponse") -TOKEN = blpapi.Name("token") -AUTH_SERVICE = "//blp/apiauth" - ELEMENT_DATATYPE_NAMES = { blpapi.DataType.BOOL: "BOOL", @@ -43,6 +45,46 @@ } +def authOptionCallback(option, opt, value, parser): + """Parse authorization options from user input""" + + vals = value.split('=', 1) + + if value == "user": + authUser = blpapi.AuthUser.createWithLogonName() + authOptions = blpapi.AuthOptions.createWithUser(authUser) + elif value == "none": + authOptions = None + elif vals[0] == "app" and len(vals) == 2: + appName = vals[1] + authOptions = blpapi.AuthOptions.createWithApp(appName) + elif vals[0] == "userapp" and len(vals) == 2: + appName = vals[1] + authUser = blpapi.AuthUser.createWithLogonName() + authOptions = blpapi.AuthOptions\ + .createWithUserAndApp(authUser, appName) + elif vals[0] == "dir" and len(vals) == 2: + activeDirectoryProperty = vals[1] + authUser = blpapi.AuthUser\ + .createWithActiveDirectoryProperty(activeDirectoryProperty) + authOptions = blpapi.AuthOptions.createWithUser(authUser) + elif vals[0] == "manual": + parts = [] + if len(vals) == 2: + parts = vals[1].split(',') + + if len(parts) != 3: + raise OptionValueError("Invalid auth option {}".format(value)) + + appName, ip, userId = parts + + authUser = blpapi.AuthUser.createWithManualOptions(userId, ip) + authOptions = blpapi.AuthOptions.createWithUserAndApp(authUser, appName) + else: + raise OptionValueError("Invalid auth option '{}'".format(value)) + + parser.values.auth = {'option' : authOptions} + def parseCmdLine(): parser = OptionParser() parser.add_option("-a", @@ -63,120 +105,28 @@ def parseCmdLine(): default="//blp/apiflds", help="SERVICE to print the schema of " "('//blp/apiflds' by default)") - parser.add_option("", - "--auth-type", - type="choice", - choices=["LOGON", "NONE", "APPLICATION", "DIRSVC", - "USER_APP"], - dest="authType", - help="Authentification type: LOGON (default), NONE, " - "APPLICATION, DIRSVC or USER_APP", - default="LOGON") - parser.add_option("", - "--auth-name", - dest="authName", - help="The name of application or directory service", - default="") - - (options, args) = parser.parse_args() - - options.auth = getAuthentificationOptions(options.authType, - options.authName) - + parser.add_option("--auth", + dest="auth", + help="authentication option: " + "user|none|app=|userapp=|dir=" + "|manual=" + " (default: user)\n" + "'none' is applicable to Desktop API product " + "that requires Bloomberg Professional service " + "to be installed locally.", + metavar="option", + action="callback", + callback=authOptionCallback, + type="string", + default={"option" : + blpapi.AuthOptions.createWithUser( + blpapi.AuthUser.createWithLogonName())}) + (options, _) = parser.parse_args() return options -def getAuthentificationOptions(type, name): - if type == "NONE": - return None - elif type == "USER_APP": - return "AuthenticationMode=USER_AND_APPLICATION;"\ - "AuthenticationType=OS_LOGON;"\ - "ApplicationAuthenticationType=APPNAME_AND_KEY;"\ - "ApplicationName=" + name - elif type == "APPLICATION": - return "AuthenticationMode=APPLICATION_ONLY;"\ - "ApplicationAuthenticationType=APPNAME_AND_KEY;"\ - "ApplicationName=" + name - elif type == "DIRSVC": - return "AuthenticationType=DIRECTORY_SERVICE;"\ - "DirSvcPropertyName=" + name - else: - return "AuthenticationType=OS_LOGON" - - def printMessage(msg): - if msg.messageType() != REFERENCE_DATA_RESPONSE: - print("[{0}]: {1}".format(", ".join(map(str, msg.correlationIds())), - msg)) - else: - # This case demonstrates how to get values of individual elements - securityDataArray = msg.getElement("securityData") - for securityData in securityDataArray.values(): - securityName = securityData.getElementValue("security") - print(securityName) - fieldData = securityData.getElement("fieldData") - for fieldName in options.field: - try: - fieldValue = fieldData.getElementValue(fieldName) - print(("%s %s" % (fieldName, fieldValue))) - except: - print(("%s n/a" % fieldName)) - - -def auth(session): - eq = blpapi.EventQueue() - - # Generate token - session.generateToken(eventQueue=eq) - - # Process related response - ev = eq.nextEvent() - token = None - if ev.eventType() == blpapi.Event.TOKEN_STATUS: - for msg in ev: - printMessage(msg) - if msg.messageType() == TOKEN_SUCCESS: - token = msg.getElementAsString(TOKEN) - elif msg.messageType() == TOKEN_FAILURE: - break - if not token: - raise Exception("Failed to get token") - - # Purge EventQueue to reuse one for the next request - eq.purge() - - # Open authentification service - if not session.openService(AUTH_SERVICE): - raise Exception("Failed to open auth service") - - # Obtain opened service - authService = session.getService(AUTH_SERVICE) - - # Create and fill the authorization request - authRequest = authService.createAuthorizationRequest() - authRequest.set(TOKEN, token) - - # Create Identity - identity = session.createIdentity() - - # Send authorization request to "fill" the Identity - session.sendAuthorizationRequest(authRequest, identity, eventQueue=eq) - - # Process related responses - while True: - ev = eq.nextEvent() - if ev.eventType() in set([ - blpapi.Event.RESPONSE, - blpapi.Event.PARTIAL_RESPONSE, - blpapi.Event.REQUEST_STATUS]): - for msg in ev: - printMessage(msg) - if msg.messageType() == AUTHORIZATION_SUCCESS: - # auth passed, identity "filled" - return identity - else: - raise Exception("Authorization failed") + print("[{0}]: {1}".format(", ".join(map(str, msg.correlationIds())), msg)) def getIndent(level): @@ -273,8 +223,7 @@ def main(): sessionOptions = blpapi.SessionOptions() sessionOptions.setServerHost(options.host) sessionOptions.setServerPort(options.port) - if options.auth: - sessionOptions.setAuthenticationOptions(options.auth) + sessionOptions.setSessionIdentityOptions(options.auth['option']) # Create a Session session = blpapi.Session(sessionOptions) @@ -286,17 +235,6 @@ def main(): try: print("Session started.") - # Perform authentification - if options.auth: - identity = auth(session) - print("Authentification passed ({0})".format( - {-1: "Unknown seat type", - 0: "BPS", - 1: "No BPS"}[identity.getSeatType()])) - else: - identity = None - print("No authentification specified") - # Open service to get reference data from if not session.openService(options.service): raise Exception("Can't open '{0}' service.".format( diff --git a/examples/SessionIdentityExample.py b/examples/SessionIdentityExample.py index b7f94a9..73ec82b 100644 --- a/examples/SessionIdentityExample.py +++ b/examples/SessionIdentityExample.py @@ -3,8 +3,18 @@ # pylint: disable=deprecated-module from optparse import OptionParser, OptionValueError -import blpapi -from blpapi import AuthOptions, AuthUser + +import os +import platform as plat +import sys +if sys.version_info >= (3, 8) and plat.system().lower() == "windows": + # pylint: disable=no-member + with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): + import blpapi + from blpapi import AuthOptions, AuthUser +else: + import blpapi + from blpapi import AuthOptions, AuthUser NONE = "none" USER = "user" @@ -47,7 +57,10 @@ def parseCmdLine(): dest="authType", help="authorization option: " "none|user|app=|userapp=" - " (default: user)", + " (default: user)\n" + "'none' is applicable to Desktop API product " + "that requires Bloomberg Professional service " + "to be installed locally.", metavar="option", action="callback", callback=authOptionCallback, @@ -82,7 +95,7 @@ def run(self): .createWithUserAndApp(AuthUser.createWithLogonName(), self.appName) else: - authOptions = AuthOptions.createDefault() + authOptions = None sessionOptions = blpapi.SessionOptions() sessionOptions.setServerAddress(self.host, self.port, 0) diff --git a/examples/SimpleAsyncSubscription.py b/examples/SimpleAsyncSubscription.py index 242ced1..53c44b5 100644 --- a/examples/SimpleAsyncSubscription.py +++ b/examples/SimpleAsyncSubscription.py @@ -2,26 +2,28 @@ from __future__ import print_function from __future__ import absolute_import -import blpapi import time -import traceback try: import thread except ImportError: import _thread as thread -import weakref -from optparse import OptionParser -from blpapi import Event as EventType +from optparse import OptionParser, OptionValueError + +import os +import platform as plat +import sys +if sys.version_info >= (3, 8) and plat.system().lower() == "windows": + # pylint: disable=no-member + with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): + import blpapi + from blpapi import Event as EventType +else: + import blpapi + from blpapi import Event as EventType + SESSION_STARTED = blpapi.Name("SessionStarted") SESSION_STARTUP_FAILURE = blpapi.Name("SessionStartupFailure") -TOKEN_SUCCESS = blpapi.Name("TokenGenerationSuccess") -TOKEN_FAILURE = blpapi.Name("TokenGenerationFailure") -AUTHORIZATION_SUCCESS = blpapi.Name("AuthorizationSuccess") -AUTHORIZATION_FAILURE = blpapi.Name("AuthorizationFailure") -TOKEN = blpapi.Name("token") -AUTH_SERVICE = "//blp/apiauth" - EVENT_TYPE_NAMES = { EventType.ADMIN: "ADMIN", @@ -45,25 +47,6 @@ class Error(Exception): pass -def getAuthentificationOptions(type, name): - if type == "NONE": - return None - elif type == "USER_APP": - return "AuthenticationMode=USER_AND_APPLICATION;"\ - "AuthenticationType=OS_LOGON;"\ - "ApplicationAuthenticationType=APPNAME_AND_KEY;"\ - "ApplicationName=" + name - elif type == "APPLICATION": - return "AuthenticationMode=APPLICATION_ONLY;"\ - "ApplicationAuthenticationType=APPNAME_AND_KEY;"\ - "ApplicationName=" + name - elif type == "DIRSVC": - return "AuthenticationType=DIRECTORY_SERVICE;"\ - "DirSvcPropertyName=" + name - else: - return "AuthenticationType=OS_LOGON" - - def topicName(security): if security.startswith("//"): return security @@ -78,6 +61,45 @@ def printMessage(msg, eventType): EVENT_TYPE_NAMES[eventType], msg)) +def authOptionCallback(option, opt, value, parser): + """Parse authorization options from user input""" + + vals = value.split('=', 1) + + if value == "user": + authUser = blpapi.AuthUser.createWithLogonName() + authOptions = blpapi.AuthOptions.createWithUser(authUser) + elif value == "none": + authOptions = None + elif vals[0] == "app" and len(vals) == 2: + appName = vals[1] + authOptions = blpapi.AuthOptions.createWithApp(appName) + elif vals[0] == "userapp" and len(vals) == 2: + appName = vals[1] + authUser = blpapi.AuthUser.createWithLogonName() + authOptions = blpapi.AuthOptions\ + .createWithUserAndApp(authUser, appName) + elif vals[0] == "dir" and len(vals) == 2: + activeDirectoryProperty = vals[1] + authUser = blpapi.AuthUser\ + .createWithActiveDirectoryProperty(activeDirectoryProperty) + authOptions = blpapi.AuthOptions.createWithUser(authUser) + elif vals[0] == "manual": + parts = [] + if len(vals) == 2: + parts = vals[1].split(',') + + if len(parts) != 3: + raise OptionValueError("Invalid auth option {}".format(value)) + + appName, ip, userId = parts + + authUser = blpapi.AuthUser.createWithManualOptions(userId, ip) + authOptions = blpapi.AuthOptions.createWithUserAndApp(authUser, appName) + else: + raise OptionValueError("Invalid auth option '{}'".format(value)) + + parser.values.auth = {'option' : authOptions} def parseCmdLine(): parser = OptionParser() @@ -110,28 +132,27 @@ def parseCmdLine(): "('LAST_PRICE,BID,ASK' by default)", metavar="FIELDS", default="LAST_PRICE,BID,ASK") - parser.add_option("", - "--auth-type", - type="choice", - choices=["LOGON", "NONE", "APPLICATION", "DIRSVC", - "USER_APP"], - dest="authType", - help="Authentification type: LOGON (default), NONE, " - "APPLICATION, DIRSVC or USER_APP", - default="LOGON") - parser.add_option("", - "--auth-name", - dest="authName", - help="The name of application or directory service", - default="") - - (options, args) = parser.parse_args() + parser.add_option("--auth", + dest="auth", + help="authentication option: " + "user|none|app=|userapp=|dir=" + "|manual=" + " (default: user)\n" + "'none' is applicable to Desktop API product " + "that requires Bloomberg Professional service " + "to be installed locally.", + metavar="option", + action="callback", + callback=authOptionCallback, + type="string", + default={"option" : + blpapi.AuthOptions.createWithUser( + blpapi.AuthUser.createWithLogonName())}) + + (options, _) = parser.parse_args() if not options.securities: options.securities = ["IBM US Equity"] - - options.auth = getAuthentificationOptions(options.authType, - options.authName) return options @@ -160,50 +181,11 @@ def processEvent(event, session): if eventType == EventType.SESSION_STATUS: if msg.messageType() == SESSION_STARTED: # Session.startAsync completed successfully - # Start the authorization if needed - if options.auth: - # Generate token - session.generateToken() - else: - identity = None - # Subscribe for the specified securities/fields - subscribe(session, options) + # Subscribe for the specified securities/fields + subscribe(session, options) elif msg.messageType() == SESSION_STARTUP_FAILURE: # Session.startAsync failed, raise exception to exit raise Error("Can't start session") - - elif eventType == EventType.TOKEN_STATUS: - if msg.messageType() == TOKEN_SUCCESS: - # Token generated successfully - # Continue the authorization - # Get generated token - token = msg.getElementAsString(TOKEN) - # Open auth service (we do it syncroniously, just in case) - if not session.openService(AUTH_SERVICE): - raise Error("Failed to open auth service") - # Obtain opened service - authService = session.getService(AUTH_SERVICE) - # Create and fill the authorization request - authRequest = authService.createAuthorizationRequest() - authRequest.set(TOKEN, token) - # Create Identity - identity = session.createIdentity() - # Send authorization request to "fill" the Identity - session.sendAuthorizationRequest(authRequest, identity) - else: - # Token generation failed, raise exception to exit - raise Error("Failed to generate token") - - elif eventType == EventType.RESPONSE \ - or eventType == EventType.PARTIAL_RESPONSE: - if msg.messageType() == AUTHORIZATION_SUCCESS: - # Authorization passed, identity "filled" and can be used - # Subscribe for the specified securities/fields with using - # of the identity - subscribe(session, options, identity) - elif msg.messageType() == AUTHORIZATION_FAILURE: - # Authorization failed, raise exception to exit - raise Error("Failed to pass authorization") except Error as ex: print("Error in event handler:", ex) # Interrupt a "sleep loop" in main thread @@ -218,8 +200,7 @@ def main(): sessionOptions = blpapi.SessionOptions() sessionOptions.setServerHost(options.host) sessionOptions.setServerPort(options.port) - if options.auth: - sessionOptions.setAuthenticationOptions(options.auth) + sessionOptions.setSessionIdentityOptions(options.auth['option']) # Create an EventDispatcher with 2 processing threads dispatcher = blpapi.EventDispatcher(2) diff --git a/examples/SimpleBlockingRequestExample.py b/examples/SimpleBlockingRequestExample.py index 0a786aa..28f04bd 100644 --- a/examples/SimpleBlockingRequestExample.py +++ b/examples/SimpleBlockingRequestExample.py @@ -2,9 +2,17 @@ from __future__ import print_function from __future__ import absolute_import -import blpapi from optparse import OptionParser +import os +import platform as plat +import sys +if sys.version_info >= (3, 8) and plat.system().lower() == "windows": + # pylint: disable=no-member + with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): + import blpapi +else: + import blpapi LAST_PRICE = blpapi.Name("LAST_PRICE") diff --git a/examples/SimpleCategorizedFieldSearchExample.py b/examples/SimpleCategorizedFieldSearchExample.py index e384d6a..5a2bbaa 100644 --- a/examples/SimpleCategorizedFieldSearchExample.py +++ b/examples/SimpleCategorizedFieldSearchExample.py @@ -2,9 +2,17 @@ from __future__ import print_function from __future__ import absolute_import -import blpapi from optparse import OptionParser +import os +import platform as plat +import sys +if sys.version_info >= (3, 8) and plat.system().lower() == "windows": + # pylint: disable=no-member + with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): + import blpapi +else: + import blpapi APIFLDS_SVC = "//blp/apiflds" PADDING = " " diff --git a/examples/SimpleFieldInfoExample.py b/examples/SimpleFieldInfoExample.py index b0524ad..801bff1 100644 --- a/examples/SimpleFieldInfoExample.py +++ b/examples/SimpleFieldInfoExample.py @@ -2,9 +2,17 @@ from __future__ import print_function from __future__ import absolute_import -import blpapi from optparse import OptionParser +import os +import platform as plat +import sys +if sys.version_info >= (3, 8) and plat.system().lower() == "windows": + # pylint: disable=no-member + with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): + import blpapi +else: + import blpapi APIFLDS_SVC = "//blp/apiflds" PADDING = " " diff --git a/examples/SimpleFieldSearchExample.py b/examples/SimpleFieldSearchExample.py index 752f6bb..abdc209 100644 --- a/examples/SimpleFieldSearchExample.py +++ b/examples/SimpleFieldSearchExample.py @@ -2,9 +2,17 @@ from __future__ import print_function from __future__ import absolute_import -import blpapi from optparse import OptionParser +import os +import platform as plat +import sys +if sys.version_info >= (3, 8) and plat.system().lower() == "windows": + # pylint: disable=no-member + with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): + import blpapi +else: + import blpapi APIFLDS_SVC = "//blp/apiflds" PADDING = " " diff --git a/examples/SimpleHistoryExample.py b/examples/SimpleHistoryExample.py index 039693c..b37359f 100644 --- a/examples/SimpleHistoryExample.py +++ b/examples/SimpleHistoryExample.py @@ -2,9 +2,17 @@ from __future__ import print_function from __future__ import absolute_import -import blpapi from optparse import OptionParser +import os +import platform as plat +import sys +if sys.version_info >= (3, 8) and plat.system().lower() == "windows": + # pylint: disable=no-member + with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): + import blpapi +else: + import blpapi def parseCmdLine(): parser = OptionParser(description="Retrieve reference data.") diff --git a/examples/SimpleIntradayBarExample.py b/examples/SimpleIntradayBarExample.py index 227fc11..95e8133 100644 --- a/examples/SimpleIntradayBarExample.py +++ b/examples/SimpleIntradayBarExample.py @@ -2,10 +2,18 @@ from __future__ import print_function from __future__ import absolute_import -import blpapi import datetime from optparse import OptionParser +import os +import platform as plat +import sys +if sys.version_info >= (3, 8) and plat.system().lower() == "windows": + # pylint: disable=no-member + with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): + import blpapi +else: + import blpapi def parseCmdLine(): parser = OptionParser(description="Retrieve reference data.") diff --git a/examples/SimpleIntradayTickExample.py b/examples/SimpleIntradayTickExample.py index f0c9050..484c20b 100644 --- a/examples/SimpleIntradayTickExample.py +++ b/examples/SimpleIntradayTickExample.py @@ -2,10 +2,18 @@ from __future__ import print_function from __future__ import absolute_import -import blpapi import datetime from optparse import OptionParser +import os +import platform as plat +import sys +if sys.version_info >= (3, 8) and plat.system().lower() == "windows": + # pylint: disable=no-member + with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): + import blpapi +else: + import blpapi def parseCmdLine(): parser = OptionParser(description="Retrieve reference data.") diff --git a/examples/SimpleRefDataExample.py b/examples/SimpleRefDataExample.py index fb8125e..2644ee5 100644 --- a/examples/SimpleRefDataExample.py +++ b/examples/SimpleRefDataExample.py @@ -2,9 +2,17 @@ from __future__ import print_function from __future__ import absolute_import -import blpapi from optparse import OptionParser +import os +import platform as plat +import sys +if sys.version_info >= (3, 8) and plat.system().lower() == "windows": + # pylint: disable=no-member + with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): + import blpapi +else: + import blpapi def parseCmdLine(): parser = OptionParser(description="Retrieve reference data.") diff --git a/examples/SimpleRefDataOverrideExample.py b/examples/SimpleRefDataOverrideExample.py index a4cad1e..038091e 100644 --- a/examples/SimpleRefDataOverrideExample.py +++ b/examples/SimpleRefDataOverrideExample.py @@ -2,9 +2,18 @@ from __future__ import print_function from __future__ import absolute_import -import blpapi from optparse import OptionParser +import os +import platform as plat +import sys +if sys.version_info >= (3, 8) and plat.system().lower() == "windows": + # pylint: disable=no-member + with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): + import blpapi +else: + import blpapi + SECURITY_DATA = blpapi.Name("securityData") SECURITY = blpapi.Name("security") FIELD_DATA = blpapi.Name("fieldData") diff --git a/examples/SimpleSubscriptionExample.py b/examples/SimpleSubscriptionExample.py index 422b869..0eeb960 100644 --- a/examples/SimpleSubscriptionExample.py +++ b/examples/SimpleSubscriptionExample.py @@ -2,10 +2,17 @@ from __future__ import print_function from __future__ import absolute_import -import blpapi -import time from optparse import OptionParser +import os +import platform as plat +import sys +if sys.version_info >= (3, 8) and plat.system().lower() == "windows": + # pylint: disable=no-member + with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): + import blpapi +else: + import blpapi def parseCmdLine(): parser = OptionParser(description="Retrieve realtime data.") diff --git a/examples/SimpleSubscriptionIntervalExample.py b/examples/SimpleSubscriptionIntervalExample.py index 283c148..dd472a8 100644 --- a/examples/SimpleSubscriptionIntervalExample.py +++ b/examples/SimpleSubscriptionIntervalExample.py @@ -2,10 +2,18 @@ from __future__ import print_function from __future__ import absolute_import -import blpapi -import time from optparse import OptionParser +import os +import platform as plat +import sys +if sys.version_info >= (3, 8) and plat.system().lower() == "windows": + # pylint: disable=no-member + with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): + import blpapi +else: + import blpapi + def parseCmdLine(): parser = OptionParser(description="Retrieve realtime data.") diff --git a/examples/SnapshotRequestTemplateExample.py b/examples/SnapshotRequestTemplateExample.py index cb0169d..7086c28 100644 --- a/examples/SnapshotRequestTemplateExample.py +++ b/examples/SnapshotRequestTemplateExample.py @@ -5,36 +5,55 @@ import datetime from optparse import OptionParser, OptionValueError -import blpapi +import os +import platform as plat +import sys +if sys.version_info >= (3, 8) and plat.system().lower() == "windows": + # pylint: disable=no-member + with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): + import blpapi +else: + import blpapi + +def authOptionCallback(option, opt, value, parser): + """Parse authorization options from user input""" -TOKEN_SUCCESS = blpapi.Name("TokenGenerationSuccess") -TOKEN_FAILURE = blpapi.Name("TokenGenerationFailure") -AUTHORIZATION_SUCCESS = blpapi.Name("AuthorizationSuccess") -TOKEN = blpapi.Name("token") - - -def authOptionCallback(_option, _opt, value, parser): vals = value.split('=', 1) if value == "user": - parser.values.auth = "AuthenticationType=OS_LOGON" + authUser = blpapi.AuthUser.createWithLogonName() + authOptions = blpapi.AuthOptions.createWithUser(authUser) elif value == "none": - parser.values.auth = None + authOptions = None elif vals[0] == "app" and len(vals) == 2: - parser.values.auth = "AuthenticationMode=APPLICATION_ONLY;"\ - "ApplicationAuthenticationType=APPNAME_AND_KEY;"\ - "ApplicationName=" + vals[1] + appName = vals[1] + authOptions = blpapi.AuthOptions.createWithApp(appName) elif vals[0] == "userapp" and len(vals) == 2: - parser.values.auth = "AuthenticationMode=USER_AND_APPLICATION;"\ - "AuthenticationType=OS_LOGON;"\ - "ApplicationAuthenticationType=APPNAME_AND_KEY;"\ - "ApplicationName=" + vals[1] + appName = vals[1] + authUser = blpapi.AuthUser.createWithLogonName() + authOptions = blpapi.AuthOptions\ + .createWithUserAndApp(authUser, appName) elif vals[0] == "dir" and len(vals) == 2: - parser.values.auth = "AuthenticationType=DIRECTORY_SERVICE;"\ - "DirSvcPropertyName=" + vals[1] + activeDirectoryProperty = vals[1] + authUser = blpapi.AuthUser\ + .createWithActiveDirectoryProperty(activeDirectoryProperty) + authOptions = blpapi.AuthOptions.createWithUser(authUser) + elif vals[0] == "manual": + parts = [] + if len(vals) == 2: + parts = vals[1].split(',') + + if len(parts) != 3: + raise OptionValueError("Invalid auth option {}".format(value)) + + appName, ip, userId = parts + + authUser = blpapi.AuthUser.createWithManualOptions(userId, ip) + authOptions = blpapi.AuthOptions.createWithUserAndApp(authUser, appName) else: - raise OptionValueError("Invalid auth option '%s'" % value) + raise OptionValueError("Invalid auth option '{}'".format(value)) + parser.values.auth = {'option' : authOptions} def parseCmdLine(): """parse cli arguments""" @@ -84,13 +103,19 @@ def parseCmdLine(): parser.add_option("--auth", dest="auth", help="authentication option: " - "user|none|app=|userapp=|dir=" - " (default: %default)", + "user|none|app=|userapp=|dir=" + "|manual=" + " (default: user)\n" + "'none' is applicable to Desktop API product " + "that requires Bloomberg Professional service " + "to be installed locally.", metavar="option", action="callback", callback=authOptionCallback, type="string", - default="user") + default={"option" : + blpapi.AuthOptions.createWithUser( + blpapi.AuthUser.createWithLogonName())}) (opts, _) = parser.parse_args() @@ -103,54 +128,6 @@ def parseCmdLine(): return opts -def authorize(authService, identity, session, cid): - """authorize the session for identity via authService""" - tokenEventQueue = blpapi.EventQueue() - session.generateToken(eventQueue=tokenEventQueue) - - # Process related response - ev = tokenEventQueue.nextEvent() - token = None - if ev.eventType() == blpapi.Event.TOKEN_STATUS or \ - ev.eventType() == blpapi.Event.REQUEST_STATUS: - for msg in ev: - print(msg) - if msg.messageType() == TOKEN_SUCCESS: - token = msg.getElementAsString(TOKEN) - elif msg.messageType() == TOKEN_FAILURE: - break - - if not token: - print("Failed to get token") - return False - - # Create and fill the authorization request - authRequest = authService.createAuthorizationRequest() - authRequest.set(TOKEN, token) - - # Send authorization request to "fill" the Identity - session.sendAuthorizationRequest(authRequest, identity, cid) - - # Process related responses - startTime = datetime.datetime.today() - WAIT_TIME_SECONDS = 10 - while True: - event = session.nextEvent(WAIT_TIME_SECONDS * 1000) - if event.eventType() == blpapi.Event.RESPONSE or \ - event.eventType() == blpapi.Event.REQUEST_STATUS or \ - event.eventType() == blpapi.Event.PARTIAL_RESPONSE: - for msg in event: - print(msg) - if msg.messageType() == AUTHORIZATION_SUCCESS: - return True - print("Authorization failed") - return False - - endTime = datetime.datetime.today() - if endTime - startTime > datetime.timedelta(seconds=WAIT_TIME_SECONDS): - return False - - def main(): """main entry point""" global options @@ -160,7 +137,7 @@ def main(): sessionOptions = blpapi.SessionOptions() for idx, host in enumerate(options.hosts): sessionOptions.setServerAddress(host, options.port, idx) - sessionOptions.setAuthenticationOptions(options.auth) + sessionOptions.setSessionIdentityOptions(options.auth['option']) sessionOptions.setAutoRestartOnDisconnection(True) # NOTE: If running without a backup server, make many attempts to @@ -181,21 +158,6 @@ def main(): print("Failed to start session.") return - subscriptionIdentity = None - if options.auth: - subscriptionIdentity = session.createIdentity() - isAuthorized = False - authServiceName = "//blp/apiauth" - if session.openService(authServiceName): - authService = session.getService(authServiceName) - isAuthorized = authorize(authService, subscriptionIdentity, - session, blpapi.CorrelationId("auth")) - if not isAuthorized: - print("No authorization") - return - else: - print("Not using authorization") - fieldStr = "?fields=" + ",".join(options.fields) snapshots = [] @@ -204,7 +166,6 @@ def main(): subscriptionString = options.service + topic + fieldStr snapshots.append(session.createSnapshotRequestTemplate( subscriptionString, - subscriptionIdentity, blpapi.CorrelationId(i))) nextCorrelationId += 1 @@ -219,9 +180,13 @@ def main(): msg.messageType() == requestTemplateAvailable: for requestTemplate in snapshots: - session.sendRequestTemplate( - requestTemplate, - blpapi.CorrelationId(nextCorrelationId)) + try: + session.sendRequestTemplate( + requestTemplate, + blpapi.CorrelationId(nextCorrelationId)) + except blpapi.Exception as err: + print("Failed to send due to: ", err) + snapshots.remove(requestTemplate) nextCorrelationId += 1 elif event.eventType() == blpapi.Event.RESPONSE or \ @@ -238,9 +203,13 @@ def main(): break elif event.eventType() == blpapi.Event.TIMEOUT: for requestTemplate in snapshots: - session.sendRequestTemplate( - requestTemplate, - blpapi.CorrelationId(nextCorrelationId)) + try: + session.sendRequestTemplate( + requestTemplate, + blpapi.CorrelationId(nextCorrelationId)) + except blpapi.Exception as err: + print("Failed to send due to: ", err) + snapshots.remove(requestTemplate) nextCorrelationId += 1 finally: diff --git a/examples/SubscriptionCorrelationExample.py b/examples/SubscriptionCorrelationExample.py index 0a472c2..6e855ae 100644 --- a/examples/SubscriptionCorrelationExample.py +++ b/examples/SubscriptionCorrelationExample.py @@ -2,9 +2,17 @@ from __future__ import print_function from __future__ import absolute_import -import blpapi from optparse import OptionParser +import os +import platform as plat +import sys +if sys.version_info >= (3, 8) and plat.system().lower() == "windows": + # pylint: disable=no-member + with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): + import blpapi +else: + import blpapi class GridWindow(object): def __init__(self, name, securities): diff --git a/examples/SubscriptionWithEventHandlerExample.py b/examples/SubscriptionWithEventHandlerExample.py index 993fd16..d3688a7 100644 --- a/examples/SubscriptionWithEventHandlerExample.py +++ b/examples/SubscriptionWithEventHandlerExample.py @@ -2,10 +2,19 @@ from __future__ import print_function from __future__ import absolute_import -import blpapi from optparse import OptionParser import time +import os +import platform as plat +import sys +if sys.version_info >= (3, 8) and plat.system().lower() == "windows": + # pylint: disable=no-member + with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): + import blpapi +else: + import blpapi + EXCEPTIONS = blpapi.Name("exceptions") FIELD_ID = blpapi.Name("fieldId") diff --git a/examples/ZfpOverLeasedLinesSessionExample.py b/examples/ZfpOverLeasedLinesSessionExample.py index 3475a34..1183d14 100644 --- a/examples/ZfpOverLeasedLinesSessionExample.py +++ b/examples/ZfpOverLeasedLinesSessionExample.py @@ -10,55 +10,55 @@ from __future__ import print_function from argparse import ArgumentParser, Action -import blpapi + +import os +import platform as plat +import sys +if sys.version_info >= (3, 8) and plat.system().lower() == "windows": + # pylint: disable=no-member + with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): + import blpapi + from blpapi import AuthOptions, AuthUser +else: + import blpapi + from blpapi import AuthOptions, AuthUser class AuthOptionsAction(Action): # pylint: disable=too-few-public-methods """Parse authorization args from user input""" def __call__(self, parser, args, values, option_string=None): - - value = values - vals = value.split("=", 1) + vals = values.split("=", 1) auth = None - value = values - if value == "user": - auth = {"option" : "AuthenticationType=OS_LOGON"} - elif value == "none": - auth = {"option" : None} + if vals[0] == "none": + auth = None + elif vals[0] == "user": + user = AuthUser.createWithLogonName() + auth = AuthOptions.createWithUser(user) elif vals[0] == "app" and len(vals) == 2: - auth = { - "option" : "AuthenticationMode=APPLICATION_ONLY;" - "ApplicationAuthenticationType=APPNAME_AND_KEY;" - "ApplicationName=" + vals[1]} + appName = vals[1] + auth = AuthOptions.createWithApp(appName) elif vals[0] == "userapp" and len(vals) == 2: - auth = { - "option" : "AuthenticationMode" - "=USER_AND_APPLICATION;AuthenticationType=OS_LOGON;" - "ApplicationAuthenticationType=APPNAME_AND_KEY;" - "ApplicationName=" + vals[1]} + appName = vals[1] + user = AuthUser.createWithLogonName() + auth = AuthOptions.createWithUserAndApp(user, appName) elif vals[0] == "dir" and len(vals) == 2: - auth = { - "option" : "AuthenticationType=DIRECTORY_SERVICE;" - "DirSvcPropertyName=" + vals[1]} + dirProperty = vals[1] + user = AuthUser.createWithActiveDirectoryProperty(dirProperty) + auth = AuthOptions.createWithUser(user) elif vals[0] == "manual": parts = [] if len(vals) == 2: parts = vals[1].split(",") if len(parts) != 3: - raise ValueError("Invalid auth option '%s'" % value) + raise ValueError("Invalid auth option '%s'" % values) - option = ("AuthenticationMode=USER_AND_APPLICATION;" - "AuthenticationType=MANUAL;" - "ApplicationAuthenticationType=APPNAME_AND_KEY;" - "ApplicationName=") + parts[0] - - auth = {"option" : option, - "manual" : {"ip" : parts[1], - "user" : parts[2]}} + appName, ipAddress, userId = parts + user = AuthUser.createWithManualOptions(userId, ipAddress) + auth = AuthOptions.createWithUserAndApp(user, appName) else: - raise ValueError("Invalid auth option '%s'" % value) + raise ValueError("Invalid auth option '%s'" % values) setattr(args, self.dest, auth) @@ -74,16 +74,18 @@ def parseCmdLine(): type=int, default=8194, metavar="port") - parser.add_argument("--auth", dest="auth", help="authentication option: " "user|none|app=|userapp=|dir=|" "manual=" - " (default: none)", + " (default: none)\n" + "'none' is applicable to Desktop API product " + "that requires Bloomberg Professional service " + "to be installed locally.", metavar="option", action=AuthOptionsAction, - default={"option" : None}) + default=None) # TLS Options parser.add_argument("--tls-client-credentials", @@ -164,7 +166,7 @@ def main(): # Fill SessionOptions sessionOptions = prepareZfpSessionOptions(args) - sessionOptions.setAuthenticationOptions(args.auth['option']) + sessionOptions.setSessionIdentityOptions(args.auth) sessionOptions.setAutoRestartOnDisconnection(True) numHosts = sessionOptions.numServerAddresses() diff --git a/examples/mock-test-examples/market-data-notifier/src/__init__.py b/examples/mock-test-examples/market-data-notifier/src/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/examples/mock-test-examples/market-data-notifier/src/appconfig.py b/examples/mock-test-examples/market-data-notifier/src/appconfig.py new file mode 100644 index 0000000..f751792 --- /dev/null +++ b/examples/mock-test-examples/market-data-notifier/src/appconfig.py @@ -0,0 +1,128 @@ +"""Sample command line parser.""" + +from argparse import ArgumentParser, Action + +class AuthOptionsAction(Action): # pylint: disable=too-few-public-methods + """Parse authorization args from user input.""" + + def __call__(self, parser, args, values, option_string=None): + + value = values + vals = value.split("=", 1) + + auth = None + if value == "user": + auth = {"option" : "AuthenticationType=OS_LOGON"} + elif value == "none": + auth = {"option" : None} + elif vals[0] == "app" and len(vals) == 2: + auth = { + "option" : "AuthenticationMode=APPLICATION_ONLY;" + "ApplicationAuthenticationType=APPNAME_AND_KEY;" + "ApplicationName=" + vals[1]} + elif vals[0] == "userapp" and len(vals) == 2: + auth = { + "option" : "AuthenticationMode" + "=USER_AND_APPLICATION;AuthenticationType=OS_LOGON;" + "ApplicationAuthenticationType=APPNAME_AND_KEY;" + "ApplicationName=" + vals[1]} + elif vals[0] == "dir" and len(vals) == 2: + auth = { + "option" : "AuthenticationType=DIRECTORY_SERVICE;" + "DirSvcPropertyName=" + vals[1]} + elif vals[0] == "manual": + parts = [] + if len(vals) == 2: + parts = vals[1].split(",") + + if len(parts) != 3: + raise ValueError("Invalid auth option '%s'" % value) + + option = ("AuthenticationMode=USER_AND_APPLICATION;" + "AuthenticationType=MANUAL;" + "ApplicationAuthenticationType=APPNAME_AND_KEY;" + "ApplicationName=") + parts[0] + + auth = {"option" : option, + "manual" : {"ip" : parts[1], + "user" : parts[2]}} + else: + raise ValueError("Invalid auth option '%s'" % value) + + setattr(args, self.dest, auth) + + +def parseCmdLine(): + """Parse command line arguments.""" + + parser = ArgumentParser(description="Retrieve realtime data.") + parser.add_argument("-a", + "--ip", + dest="hosts", + help="server name or IP (default: localhost)", + metavar="ipAddress", + action="append", + default=[]) + parser.add_argument("-p", + dest="port", + type=int, + help="server port (default: %default)", + metavar="tcpPort", + default=8194) + parser.add_argument("-s", + dest="service", + help="service name (default: %default)", + metavar="service", + default="//viper/mktdata") + parser.add_argument( + "-t", + dest="topics", + help="topic name (default: //blp/mktdata/ticker/IBM Equity)", + metavar="topic", + action="append", + default=['//blp/mktdata/ticker/IBM Equity']) + parser.add_argument("-f", + dest="fields", + help="field to subscribe to (default: LAST_PRICE)", + metavar="field", + action="append", + default=['LAST_PRICE']) + parser.add_argument("-o", + dest="options", + help="subscription options (default: empty)", + metavar="option", + action="append", + default=[]) + parser.add_argument("--auth", + dest="auth", + help="authentication option: " + "user|none|app=|userapp=|dir=|" + "manual=" + " (default: none)", + metavar="option", + action=AuthOptionsAction, + default={"option" : None}) + + args = parser.parse_args() + return args + +__copyright__ = """ +Copyright 2020. Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above +copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/mock-test-examples/market-data-notifier/src/application.py b/examples/mock-test-examples/market-data-notifier/src/application.py new file mode 100644 index 0000000..77af352 --- /dev/null +++ b/examples/mock-test-examples/market-data-notifier/src/application.py @@ -0,0 +1,49 @@ +"""Sample application.""" + +from __future__ import print_function + +# pylint: disable=too-few-public-methods +class Application(): + """Custom application for demonstration purposes.""" + + def __init__(self, session, authorizer, subscriber, options): + self._session = session + self._authorizer = authorizer + self._subscriber = subscriber + self._options = options + + def run(self): + """Start the application.""" + if not self._session.start(): + print("Failed to start session") + return + + identity = self._session.createIdentity() + if not self._authorizer.authorize(identity): + print("No authorization") + return + + self._subscriber.subscribe( + self._options.topics, self._options.fields, + self._options.options, identity) + +__copyright__ = """ +Copyright 2020. Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above +copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/mock-test-examples/market-data-notifier/src/authorizer.py b/examples/mock-test-examples/market-data-notifier/src/authorizer.py new file mode 100644 index 0000000..b9ef328 --- /dev/null +++ b/examples/mock-test-examples/market-data-notifier/src/authorizer.py @@ -0,0 +1,90 @@ +"""Sample authorization related component.""" + +from __future__ import print_function + +import datetime + +import blpapi + +AUTHORIZATION_SUCCESS = blpapi.Name("AuthorizationSuccess") +TOKEN = blpapi.Name("token") + +# pylint: disable=too-few-public-methods, too-many-branches +class Authorizer(): + """Helper for authorization.""" + + def __init__(self, session, token_generator): + self._session = session + self._token_generator = token_generator + + def _authorize(self, auth_service, identity, cid, event_queue=None): + """Authorize the identity.""" + + token = self._token_generator.generate() + + if token is None: + print("Failed to get token") + return False + + # Create and fill the authorization request + auth_request = auth_service.createAuthorizationRequest() + auth_request.set(TOKEN, token) + + if event_queue is None: + event_queue = blpapi.EventQueue() + + # Send authorization request to "fill" the Identity + self._session.sendAuthorizationRequest( + auth_request, identity, cid, event_queue) + + # Process related responses + start_time = datetime.datetime.today() + WAIT_TIME_SECONDS = 10 + while True: + event = event_queue.nextEvent(WAIT_TIME_SECONDS * 1000) + if event.eventType() == blpapi.Event.RESPONSE or \ + event.eventType() == blpapi.Event.REQUEST_STATUS or \ + event.eventType() == blpapi.Event.PARTIAL_RESPONSE: + for msg in event: + print(msg) + if msg.messageType() == AUTHORIZATION_SUCCESS: + return True + print("Authorization failed") + return False + + end_time = datetime.datetime.today() + max_time_diff = datetime.timedelta(seconds=WAIT_TIME_SECONDS) + if end_time - start_time > max_time_diff: + return False + + def authorize(self, identity, queue=None): + """Authorize the provided identity. + + Return True on success and False on failure. + """ + if self._session.openService("//blp/apiauth"): + service = self._session.getService("//blp/apiauth") + cid = blpapi.CorrelationId("auth") + return self._authorize(service, identity, cid, queue) + return False + +__copyright__ = """ +Copyright 2020. Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above +copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/mock-test-examples/market-data-notifier/src/compute_engine.py b/examples/mock-test-examples/market-data-notifier/src/compute_engine.py new file mode 100644 index 0000000..6983431 --- /dev/null +++ b/examples/mock-test-examples/market-data-notifier/src/compute_engine.py @@ -0,0 +1,30 @@ +"""Dummy 'compute engine' for testing purposes""" + +# pylint: disable=too-few-public-methods, no-init, no-self-use +class ComputeEngine(): + """A class that does some 'financial computation'.""" + + def someVeryComplexComputation(self, value): + """Computation to be tested.""" + return value * 2 + +__copyright__ = """ +Copyright 2020. Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above +copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/mock-test-examples/market-data-notifier/src/event_processor.py b/examples/mock-test-examples/market-data-notifier/src/event_processor.py new file mode 100644 index 0000000..12512d5 --- /dev/null +++ b/examples/mock-test-examples/market-data-notifier/src/event_processor.py @@ -0,0 +1,48 @@ +"""Simple class for handling incoming events from a session""" +import blpapi + +TOKEN_SUCCESS = blpapi.Name("TokenSuccess") +TOKEN_FAILURE = blpapi.Name("TokenFailure") +TOKEN = blpapi.Name("token") + +# pylint: disable=too-few-public-methods +class EventProcessor(): + """Custom EventHandler implementation for demonstration purposes.""" + + def __init__(self, notifier, compute_engine): + self._notifier = notifier + self._compute_engine = compute_engine + + def processEvent(self, event, _): + """Action for each event from the session.""" + for msg in event: + if event.eventType() == blpapi.Event.SESSION_STATUS: + self._notifier.log_session_state(msg) + elif event.eventType() == blpapi.Event.SUBSCRIPTION_STATUS: + self._notifier.log_subscription_state(msg) + elif event.eventType() == blpapi.Event.SUBSCRIPTION_DATA: + last_price = msg.getElementAsFloat("LAST_PRICE") + result = \ + self._compute_engine.someVeryComplexComputation(last_price) + self._notifier.send_to_terminal(result) + +__copyright__ = """ +Copyright 2020. Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above +copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/mock-test-examples/market-data-notifier/src/main.py b/examples/mock-test-examples/market-data-notifier/src/main.py new file mode 100644 index 0000000..859b6dd --- /dev/null +++ b/examples/mock-test-examples/market-data-notifier/src/main.py @@ -0,0 +1,59 @@ +"""Sample script for subscribing to a security.""" + +import blpapi + +import appconfig +from compute_engine import ComputeEngine +from notifier import Notifier +from event_processor import EventProcessor +from token_generator import TokenGenerator +from authorizer import Authorizer +from subscriber import Subscriber +from application import Application + +if __name__ == "__main__": + options = appconfig.parseCmdLine() + compute_engine = ComputeEngine() + notifier = Notifier() + event_processor = EventProcessor(notifier, compute_engine) + + so = blpapi.SessionOptions() + for i, host in enumerate(options.hosts): + so.setServerAddress(host, options.port, i) + + so.setAuthenticationOptions(options.auth['option']) + + session = blpapi.Session(so, event_processor.processEvent) + + token_generator = TokenGenerator(session) + authorizer = Authorizer(session, token_generator) + + subscriber = Subscriber(session) + + application = Application(session, authorizer, subscriber, options) + + application.run() + + input("Press Enter to continue...\n") + + +__copyright__ = """ +Copyright 2020. Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above +copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/mock-test-examples/market-data-notifier/src/notifier.py b/examples/mock-test-examples/market-data-notifier/src/notifier.py new file mode 100644 index 0000000..6e581a4 --- /dev/null +++ b/examples/mock-test-examples/market-data-notifier/src/notifier.py @@ -0,0 +1,44 @@ +"""Sample class for testing purposes.""" +from __future__ import print_function + +# pylint: disable=no-init,no-self-use +class Notifier(): + """ + Notifier is an approximation of a class that attempts to: + 1. Log all session events (for example SessionStartupFailure). + 2. Log all subscription events (for example SubscriptionStarted). + 3. Deliver subscription data to terminal ("Bloomberg terminal"). + """ + + def log_session_state(self, msg): + """Print the provided message.""" + print("Logging Session state with " + str(msg)) + + def log_subscription_state(self, msg): + """Print the provided message.""" + print("Logging Subscription state with " + str(msg)) + + def send_to_terminal(self, value): + """Print the provided value.""" + print("VALUE = " + str(value)) + +__copyright__ = """ +Copyright 2020. Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above +copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/mock-test-examples/market-data-notifier/src/subscriber.py b/examples/mock-test-examples/market-data-notifier/src/subscriber.py new file mode 100644 index 0000000..213af7d --- /dev/null +++ b/examples/mock-test-examples/market-data-notifier/src/subscriber.py @@ -0,0 +1,40 @@ +"""Sample subscriber for testing.""" + +import blpapi + +# pylint: disable=too-few-public-methods,too-many-arguments +class Subscriber(): + """Custom Subscriber implementation for demonstration purposes.""" + + def __init__(self, session): + self._session = session + + def subscribe(self, topics, fields, options, identity): + """Subscribes to the provided service/topics.""" + + subscription_list = blpapi.SubscriptionList() + for topic in topics: + subscription_list.add(topic, fields, options, + blpapi.CorrelationId(topic)) + self._session.subscribe(subscription_list, identity) + +__copyright__ = """ +Copyright 2020. Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above +copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/mock-test-examples/market-data-notifier/src/token_generator.py b/examples/mock-test-examples/market-data-notifier/src/token_generator.py new file mode 100644 index 0000000..1c35c2e --- /dev/null +++ b/examples/mock-test-examples/market-data-notifier/src/token_generator.py @@ -0,0 +1,55 @@ +"""Sample token generator for testing.""" + +import blpapi + +TOKEN_SUCCESS = blpapi.Name("TokenGenerationSuccess") +TOKEN_FAILURE = blpapi.Name("TokenGenerationFailure") +TOKEN = blpapi.Name("token") + +# pylint: disable=too-few-public-methods +class TokenGenerator(): + """Generates a token for later authorization.""" + + def __init__(self, session): + self._session = session + + def generate(self, event_queue=None): + """Generate a token.""" + + token = None + if event_queue is None: + event_queue = blpapi.EventQueue() + + self._session.generateToken(blpapi.CorrelationId(), event_queue) + + event = event_queue.nextEvent() + if event.eventType() == blpapi.Event.REQUEST_STATUS or \ + event.eventType() == blpapi.Event.TOKEN_STATUS: + for msg in event: + if msg.messageType() == TOKEN_SUCCESS: + token = msg.getElementAsString(TOKEN) + return token + if msg.messageType() == TOKEN_FAILURE: + return None + return None + +__copyright__ = """ +Copyright 2020. Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above +copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/mock-test-examples/market-data-notifier/tests/test_application.py b/examples/mock-test-examples/market-data-notifier/tests/test_application.py new file mode 100644 index 0000000..80a9ea1 --- /dev/null +++ b/examples/mock-test-examples/market-data-notifier/tests/test_application.py @@ -0,0 +1,133 @@ +""" Test suite for Application. """ + +import unittest + +try: + from unittest.mock import Mock +except ImportError: + from mock import Mock + +import os +import sys +#pylint: disable=line-too-long,wrong-import-position +sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../src'))) +from application import Application + + +class TestApplication(unittest.TestCase): + """ Test cases for Application. """ + + def setUp(self): + self.mock_session = Mock() + self.mock_authorizer = Mock() + self.mock_subscriber = Mock() + self.mock_options = Mock() + + def testSessionStartFail(self): + """ Verify that if the session fails to start, no authorization or + subscriptions are made. + + Plan: + Set up and verify the following mocks: + a. start() returns False. + b. authorize() is not called. + c. subscribe() is not called. + """ + application = Application(self.mock_session, + self.mock_authorizer, + self.mock_subscriber, + self.mock_options) + + self.mock_session.start.return_value = False + application.run() + + self.mock_session.start.assert_called_once() + self.mock_authorizer.authorize.assert_not_called() + self.mock_subscriber.subscribe.assert_not_called() + + def testSessionAuthorizeFail(self): + """ Verify that if authorization fails, no subscriptions are made. + + Plan: + Set up and verify the following mocks: + a. start() returns True. + b. authorize() fails and returns False. + c. subscribe() is not called. + """ + application = Application(self.mock_session, + self.mock_authorizer, + self.mock_subscriber, + self.mock_options) + + self.mock_session.start.return_value = True + self.mock_authorizer.authorize.return_value = False + + application.run() + + self.mock_session.start.assert_called_once() + self.mock_authorizer.authorize.assert_called_once() + self.mock_subscriber.subscribe.assert_not_called() + + def testSubscribeWithConfig(self): + """ Verify the correct topics and fields are used when subscribing on + the session. + + Plan: + Set up and verify the following mocks: + a. start() returns True. + b. authorize() succeeds and returns True. + c. subscribe() is called with the same topics and fields configured in + the options. + """ + expected_topics = ["IBM US Equity", "MSFT US Equity"] + expected_fields = ["LAST_PRICE", "BID", "ASK"] + service_name = "//blp/mktdata" + + self.mock_options.configure_mock(**{ + "service": service_name, + "topics": expected_topics, + "fields": expected_fields + }) + + application = Application(self.mock_session, + self.mock_authorizer, + self.mock_subscriber, + self.mock_options) + + self.mock_session.start.return_value = True + self.mock_authorizer.authorize.return_value = True + + application.run() + + self.mock_session.start.assert_called_once() + self.mock_authorizer.authorize.assert_called_once() + + actual_topics = self.mock_subscriber.subscribe.call_args[0][0] + actual_fields = self.mock_subscriber.subscribe.call_args[0][1] + self.assertEqual(expected_topics, actual_topics) + self.assertEqual(expected_fields, actual_fields) + + +if __name__ == "__main__": + unittest.main() + +__copyright__ = """ +Copyright 2020. Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above +copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/mock-test-examples/market-data-notifier/tests/test_authorizer.py b/examples/mock-test-examples/market-data-notifier/tests/test_authorizer.py new file mode 100644 index 0000000..9abc66e --- /dev/null +++ b/examples/mock-test-examples/market-data-notifier/tests/test_authorizer.py @@ -0,0 +1,299 @@ +""" Test suite for Authorizer. """ + +import unittest + +try: + from unittest.mock import Mock +except ImportError: + from mock import Mock + +import os +import sys +#pylint: disable=line-too-long,wrong-import-position +sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../src'))) +from authorizer import Authorizer + +import blpapi + + +APIAUTH_SCHEMA = \ +""" + + + + Request + AuthorizationRequest + Response + AuthorizationSuccess + AuthorizationFailure + true + + + Request + TokenRequest + Response + TokenResponse + + false + false + false + false + false + + + + seqAuthorizationRequest + + + true + false + + + + true + false + + + + seqTokenRequest + + + true + false + + + + true + false + + + + seqErrorInfo + + + true + false + + + + true + false + + + + true + false + + + + true + false + + + + true + false + + + + seqAuthorizationSuccess + + + seqAuthorizationFailure + + + true + false + + + + seqAuthorizationTokenResponse + + + seqTokenResponse + + + true + false + + + + true + false + + + + choiceRequest + + + true + false + + + + true + false + + + + choiceResponse + + + true + false + + + + true + false + + + + true + false + + + + +""" + +class TestAuthorizer(unittest.TestCase): + """ Test cases for Authorizer. """ + + def setUp(self): + self.mock_session = Mock() + self.mock_token_generator = Mock() + self.authorizer = Authorizer(self.mock_session, + self.mock_token_generator) + self.mock_event_queue = Mock() + + def testAuthorizationSuccess(self): + """ Verify that for a valid identity the authorization returns True. + + Plan: + 1. Create a service instance from the apiauth schema. + 2. Set the following expectations: + b. Verify that service is opened and successfully retrieved. + 3. Create an admin event to represent the authorization success. + 4. Call authorize() + 4. Verify the following: + a. The service is opened and retrieved. + b. A token is generated. + c. An authorization request is sent. + d. authorize() returns True. + """ + self.mock_session.openService.return_value = True + + service = blpapi.test.deserializeService(APIAUTH_SCHEMA) + self.mock_session.getService.return_value = service + + token = "abcdefg" + self.mock_token_generator.generate.return_value = token + + event = blpapi.test.createEvent(blpapi.Event.RESPONSE) + authorization_success = blpapi.Name("AuthorizationSuccess") + schema_def = \ + blpapi.test.getAdminMessageDefinition(authorization_success) + + blpapi.test.appendMessage(event, schema_def) + + # The AuthorizationSuccess message does not have any fields, therefore + # no formatting is required. + + self.mock_event_queue.nextEvent.return_value = event + + identity = Mock() + authorization_result = self.authorizer.authorize(identity, + self.mock_event_queue) + + self.mock_session.openService.assert_called_once() + self.mock_session.getService.assert_called_once() + self.mock_session.sendAuthorizationRequest.assert_called_once() + + self.mock_token_generator.generate.assert_called_once() + self.mock_event_queue.nextEvent.assert_called_once() + + self.assertTrue(authorization_result) + + def testAuthorizationFailure(self): + """ Verify that for a invalid identity the authorization returns False. + + Plan: + 1. Create a service instance from the apiauth schema. + 2. Create and format an event to represent the authorization failure. + 3. Call authorize() + 4. Verify the following: + a. The service is opened and retrieved. + b. A token is generated. + c. An authorization request is sent. + d. authorize() returns False. + """ + self.mock_session.openService.return_value = True + + service = blpapi.test.deserializeService(APIAUTH_SCHEMA) + self.mock_session.getService.return_value = service + + token = "abcdefg" + self.mock_token_generator.generate.return_value = token + + event = blpapi.test.createEvent(blpapi.Event.RESPONSE) + authorization_request = blpapi.Name("AuthorizationRequest") + authorization_failure_index = 1 + schema_def = service \ + .getOperation(authorization_request) \ + .getResponseDefinitionAt(authorization_failure_index) + + formatter = blpapi.test.appendMessage(event, schema_def) + + message_content = { + "reason": { + "code": 101, + "message": "Invalid user", + "category": "BAD_ARGS", + "subcategory": "INVALID_USER", + "source": "test-source" + } + } + + formatter.formatMessageDict(message_content) + + self.mock_event_queue.nextEvent.return_value = event + + identity = Mock() + authorization_result = self.authorizer.authorize(identity, + self.mock_event_queue) + + self.mock_session.openService.assert_called_once() + self.mock_session.getService.assert_called_once() + self.mock_session.sendAuthorizationRequest.assert_called_once() + + self.mock_token_generator.generate.assert_called_once() + self.mock_event_queue.nextEvent.assert_called_once() + + self.assertFalse(authorization_result) + + +if __name__ == "__main__": + unittest.main() + +__copyright__ = """ +Copyright 2020. Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above +copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/mock-test-examples/market-data-notifier/tests/test_eventprocessor.py b/examples/mock-test-examples/market-data-notifier/tests/test_eventprocessor.py new file mode 100644 index 0000000..63ca39f --- /dev/null +++ b/examples/mock-test-examples/market-data-notifier/tests/test_eventprocessor.py @@ -0,0 +1,187 @@ +""" Test suite for EventProcessor. """ + +import unittest + +try: + from unittest.mock import Mock +except ImportError: + from mock import Mock + +import os +import sys +#pylint: disable=line-too-long,wrong-import-position +sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../src'))) +from event_processor import EventProcessor + +import blpapi + + +MKTDATA_SCHEMA = \ +""" + + + + 0 + 1 + 2 + 3 + 4 + 9999 + + 134217729 + + 9999 + + + + fields in subscription + + Last Trade/Last Price + 65536 + + + Bid Price + 131072 + + + Ask Price + 196608 + + + Volume + 458753 + + + + +""" + +class TestEventProcessor(unittest.TestCase): + """ Test cases for EventProcessor. """ + + def setUp(self): + self.mock_session = Mock() + self.mock_notifier = Mock() + self.mock_compute_engine = Mock() + self.event_processor = EventProcessor(self.mock_notifier, + self.mock_compute_engine) + + def testNotifierReceivesSessionStarted(self): + """ Verify that notifier receives a `SessionStarted' message. + + Plan: + 1. Create a SessionStatus admin event using blpapi.test.createEvent(). + 2. Obtain the message schema using + blpapi.test.getAdminMessageDefinition(). + 3. Append a message of type SessionStarted using + blpapi.test.appendMessage(). + 4. Verify that the expected message is passed to + notifier.log_session_state(). + """ + event = blpapi.test.createEvent(blpapi.Event.SESSION_STATUS) + session_started = blpapi.Name("SessionStarted") + schema_def = blpapi.test.getAdminMessageDefinition(session_started) + + blpapi.test.appendMessage(event, schema_def) + + self.event_processor.processEvent(event, self.mock_session) + + self.mock_notifier.log_session_state.assert_called_once() + actual_message = self.mock_notifier.log_session_state.call_args[0][0] + self.assertEqual(session_started, actual_message.messageType()) + + + def testNotifierReceivesSubscriptionStarted(self): + """ Verify that notifier receives a `SubscriptionStarted` message. + + Plan: + 1. Create a SubscriptionStatus admin event using + blpapi.test.createEvent(). + 2. Obtain the schema for SubscriptionStarted message using + blpapi.test.getAdminMessageDefinition(). + 3. Append a message of type `SubscriptionStarted` using + blpapi.test.appendMessage(). + 4. Verify that the expected message is passed to + notifier.log_subscription_state(). + """ + event = blpapi.test.createEvent(blpapi.Event.SUBSCRIPTION_STATUS) + subscription_started = blpapi.Name("SubscriptionStarted") + schema_def = blpapi.test.getAdminMessageDefinition(subscription_started) + + blpapi.test.appendMessage(event, schema_def) + + self.event_processor.processEvent(event, self.mock_session) + + self.mock_notifier.log_subscription_state.assert_called_once() + actual_message = \ + self.mock_notifier.log_subscription_state.call_args[0][0] + self.assertEqual(subscription_started, actual_message.messageType()) + + def testNotifierReceivesSubscriptionData(self): + """ Verify that: + 1. Compute engine receives the correct LAST_PRICE. + 2. Compute engine performs the correct computation and returns the + correct value. + 3. The correct value is sent to the terminal. + + Plan: + 1. Obtain the service by deserializing its schema. + 2. Create a SubscriptionEvent using blpapi.test.createEvent(). + 3. Obtain the element schema definition from the service. + 4. Append a message of type `MarketDataEvents' using + blpapi.test.appendMessage(). + 5. Format the message using the formatter returned by appendMessage(). + In this example the message's body is represented by + { LAST_PRICE: 142.80 }. + 6. Verify that the expected and actual values are the same. + """ + event = blpapi.test.createEvent(blpapi.Event.SUBSCRIPTION_DATA) + + service = blpapi.test.deserializeService(MKTDATA_SCHEMA) + mktdata_events = blpapi.Name("MarketDataEvents") + schema_def = service.getEventDefinition(mktdata_events) + + formatter = blpapi.test.appendMessage(event, schema_def) + + expected_last_price = 142.80 + message_content = { + "LAST_PRICE": expected_last_price + } + formatter.formatMessageDict(message_content) + + expected_compute_result = 200.00 + + self.mock_compute_engine.someVeryComplexComputation.return_value = \ + expected_compute_result + + self.event_processor.processEvent(event, self.mock_session) + + self.mock_compute_engine.someVeryComplexComputation \ + .assert_called_once_with(expected_last_price) + self.mock_notifier.send_to_terminal \ + .assert_called_once_with(expected_compute_result) + + +if __name__ == "__main__": + unittest.main() + +__copyright__ = """ +Copyright 2020. Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above +copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/mock-test-examples/market-data-notifier/tests/test_tokengenerator.py b/examples/mock-test-examples/market-data-notifier/tests/test_tokengenerator.py new file mode 100644 index 0000000..c0239aa --- /dev/null +++ b/examples/mock-test-examples/market-data-notifier/tests/test_tokengenerator.py @@ -0,0 +1,130 @@ +""" Test suite for TokenGenerator. """ + +import unittest + +try: + from unittest.mock import Mock +except ImportError: + from mock import Mock + +import os +import sys +#pylint: disable=line-too-long,wrong-import-position +sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../src'))) +from token_generator import TokenGenerator + +import blpapi + + +class TestTokenGenerator(unittest.TestCase): + """ Test cases for TokenGenerator. """ + + def setUp(self): + self.mock_session = Mock() + self.mock_event_queue = Mock() + self.token_generator = TokenGenerator(self.mock_session) + + def testTokenGenerationSuccess(self): + """ Verify that on token generation success, the application receives + a valid token. + + Plan: + 1. Create a TokenStatus admin event using blpapi.test.createEvent(). + 2. Obtain the schema for TokenGenerationSuccess using + blpapi.test.getAdminMessageDefinition(). + 3. Append a message of type TokenGenerationSuccess using + blpapi.test.appendMessage(). + 4. Using the returned formatter, format the message. In this example + the message has body { "token": "dummy_token" }. + `token` is the element name, and `dummy_token` is the token value + which will be delivered to the client application. + 5. Setup the event queue to return the appropriate event. + 6. Verify that the expected token value is generated. + """ + event = blpapi.test.createEvent(blpapi.Event.TOKEN_STATUS) + token_success = blpapi.Name("TokenGenerationSuccess") + schema_def = blpapi.test.getAdminMessageDefinition(token_success) + + formatter = blpapi.test.appendMessage(event, schema_def) + + expected_token = "dummy_token" + message_content = { + "token": expected_token + } + + formatter.formatMessageDict(message_content) + + self.mock_event_queue.nextEvent.return_value = event + + actual_token = self.token_generator.generate(self.mock_event_queue) + + self.mock_session.generateToken.assert_called_once() + self.mock_event_queue.nextEvent.assert_called_once() + self.assertEqual(expected_token, actual_token) + + def testTokenGenerationFailure(self): + """ Verify that on token generation failure, the application receives an + empty token. + + Plan: + 1. Create a TokenStatus admin event using blpapi.test.createEvent(). + 2. Obtain schema for TokenGenerationFailure using + blpapi.test.getAdminMessageDefinition(). + 3. Append a message of type TokenGenerationFailure using + blpapi.test.appendMessage(). + 4. Using the returned formatter, format the message. In this example, + the message body contains the reason for failure. + The reason is delivered to the user application. + 5. Setup the event queue to return the appropriate event. + 6. Verify that the actual token is None. + """ + message_content = { + "reason": { + "source": "apitkns (apiauth) on n795", + "category": "NO_AUTH", + "errorCode": 3, + "description": "App not in emrs ...", + "subcategory": "INVALID_APP" + } + } + event = blpapi.test.createEvent(blpapi.Event.TOKEN_STATUS) + + token_failure = blpapi.Name("TokenGenerationFailure") + schema_def = blpapi.test.getAdminMessageDefinition(token_failure) + + formatter = blpapi.test.appendMessage(event, schema_def) + + formatter.formatMessageDict(message_content) + + self.mock_event_queue.nextEvent.return_value = event + + actual_token = self.token_generator.generate(self.mock_event_queue) + + self.mock_session.generateToken.assert_called_once() + self.mock_event_queue.nextEvent.assert_called_once() + self.assertIsNone(actual_token) + + +if __name__ == "__main__": + unittest.main() + +__copyright__ = """ +Copyright 2020. Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above +copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/mock-test-examples/snippets/events.py b/examples/mock-test-examples/snippets/events.py new file mode 100644 index 0000000..c1bfb27 --- /dev/null +++ b/examples/mock-test-examples/snippets/events.py @@ -0,0 +1,830 @@ +"""Sample unit test cases""" + +import unittest + +import blpapi + +# pylint: disable=no-self-use +# unlike "proper" unit tests, the provided samples do not include any +# assertions, so there is no 'self' use in the tests. + +# pylint: disable=too-many-public-methods + +class TestEvents(unittest.TestCase): + """The following test cases provide an example of how to mock different + events supported by the blpapi-sdk. The code to set up the expectation and + verification of values is omitted from example tests.""" + +# ===================== +# SESSION STATUS EVENTS +# ===================== + + def testSessionStarted(self): + """Sample SessionStarted message""" + event = blpapi.test.createEvent(blpapi.Event.SESSION_STATUS) + schema = blpapi.test.getAdminMessageDefinition( + blpapi.Name("SessionStarted")) + + formatter = blpapi.test.appendMessage(event, schema) + + content = { + "initialEndpoints": [ + {"address": "12.34.56.78:8194"}, + {"address": "98.76.54.32:8194"} + ] + } + + formatter.formatMessageDict(content) + + def testSessionStartupFailure(self): + """Sample SessionStartupFailure message""" + event = blpapi.test.createEvent(blpapi.Event.SESSION_STATUS) + schema = blpapi.test.getAdminMessageDefinition( + blpapi.Name("SessionStartupFailure")) + + formatter = blpapi.test.appendMessage(event, schema) + + content = { + "reason": { + "source": "TestUtil", + "errorCode": -1, + "category": "CATEGORY", + "description": "for testing", + "subcategory": "SUBCATEGORY", + } + } + + formatter.formatMessageDict(content) + + def testSessionTerminated(self): + """Sample SessionTerminated message""" + event = blpapi.test.createEvent(blpapi.Event.SESSION_STATUS) + schema = blpapi.test.getAdminMessageDefinition( + blpapi.Name("SessionTerminated")) + + formatter = blpapi.test.appendMessage(event, schema) + + content = { + "reason": { + "source": "TestUtil", + "errorCode": -1, + "category": "CATEGORY", + "description": "for testing", + "subcategory": "SUBCATEGORY", + } + } + + formatter.formatMessageDict(content) + + def testSessionConnectionUp(self): + """Sample SessionConnectionUp message""" + event = blpapi.test.createEvent(blpapi.Event.SESSION_STATUS) + schema = blpapi.test.getAdminMessageDefinition( + blpapi.Name("SessionConnectionUp")) + + formatter = blpapi.test.appendMessage(event, schema) + + content = { + "server": "12.34.56.78:8194", + "serverId": "ny-hostname", + "encryptionStatus": "Clear", + "compressionStatus": "Uncompressed" + } + + formatter.formatMessageDict(content) + + def testSessionConnectionDown(self): + """Sample SessionConnectionDown message""" + event = blpapi.test.createEvent(blpapi.Event.SESSION_STATUS) + schema = blpapi.test.getAdminMessageDefinition( + blpapi.Name("SessionConnectionDown")) + + formatter = blpapi.test.appendMessage(event, schema) + + content = { + "server": "12.34.56.78:8194", + "serverId": "ny-hostname", + } + + formatter.formatMessageDict(content) + + def testSessionClusterInfo(self): + """Sample SessionClusterInfo message""" + event = blpapi.test.createEvent(blpapi.Event.SESSION_STATUS) + schema = blpapi.test.getAdminMessageDefinition( + blpapi.Name("SessionClusterInfo")) + + formatter = blpapi.test.appendMessage(event, schema) + + content = { + "name": "clustername", + "endpoints": [ + {"address": "12.34.56.78:8194"}, + {"address": "98.76.54.32:8194"} + ] + } + + formatter.formatMessageDict(content) + + def testSessionClusterUpdate(self): + """Sample SessionClusterUpdate message""" + event = blpapi.test.createEvent(blpapi.Event.SESSION_STATUS) + schema = blpapi.test.getAdminMessageDefinition( + blpapi.Name("SessionClusterUpdate")) + + formatter = blpapi.test.appendMessage(event, schema) + + content = { + "name": "clustername", + "endpointsAdded": [ + {"address": "12.34.56.78:8194"} + ], + "endpointsRemoved": [ + {"address": "98.76.54.32:8194"} + ] + } + + formatter.formatMessageDict(content) + +# ============ +# ADMIN EVENTS +# ============ + + def testSlowConsumerWarning(self): + """Sample SlowConsumerWarning message""" + event = blpapi.test.createEvent(blpapi.Event.ADMIN) + schema = blpapi.test.getAdminMessageDefinition( + blpapi.Name("SlowConsumerWarning")) + blpapi.test.appendMessage(event, schema) + + def testSlowConsumerWarningCleared(self): + """Sample SlowConsumerWarningCleared message""" + event = blpapi.test.createEvent(blpapi.Event.ADMIN) + schema = blpapi.test.getAdminMessageDefinition( + blpapi.Name("SlowConsumerWarningCleared")) + + formatter = blpapi.test.appendMessage(event, schema) + + content = { + "eventsDropped": 123 + } + + formatter.formatMessageDict(content) + + def testDataLoss(self): + """Sample DataLoss message""" + event = blpapi.test.createEvent(blpapi.Event.ADMIN) + schema = blpapi.test.getAdminMessageDefinition(blpapi.Name("DataLoss")) + + formatter = blpapi.test.appendMessage(event, schema) + + content = { + "id": "id", + "source": "Test", + "numMessagesDropped": 123 + } + + formatter.formatMessageDict(content) + + def testRequestTemplateAvailable(self): + """Sample RequestTemplateAvailable message""" + event = blpapi.test.createEvent(blpapi.Event.ADMIN) + schema = blpapi.test.getAdminMessageDefinition( + blpapi.Name("RequestTemplateAvailable")) + + formatter = blpapi.test.appendMessage(event, schema) + + content = { + "boundTo": { + "dataConnection": [ + { + "address": "12.34.56.78:8194" + } + ] + } + } + + formatter.formatMessageDict(content) + + def testRequestTemplatePending(self): + """Sample RequestTemplatePending message""" + event = blpapi.test.createEvent(blpapi.Event.ADMIN) + schema = blpapi.test.getAdminMessageDefinition( + blpapi.Name("RequestTemplatePending")) + + blpapi.test.appendMessage(event, schema) + + def testRequestTemplateTerminated(self): + """Sample RequestTemplateTerminated message""" + event = blpapi.test.createEvent(blpapi.Event.ADMIN) + schema = blpapi.test.getAdminMessageDefinition( + blpapi.Name("RequestTemplateTerminated")) + + formatter = blpapi.test.appendMessage(event, schema) + + content = { + "reason": { + "source": "TestUtil", + "errorCode": -1, + "category": "CATEGORY", + "description": "for testing", + "subcategory": "SUBCATEGORY", + } + } + + formatter.formatMessageDict(content) + +# ===================== +# SERVICE STATUS EVENTS +# ===================== + + def testServiceOpened(self): + """Sample ServiceOpened message""" + event = blpapi.test.createEvent(blpapi.Event.SERVICE_STATUS) + schema = blpapi.test.getAdminMessageDefinition( + blpapi.Name("ServiceOpened")) + + formatter = blpapi.test.appendMessage(event, schema) + + content = { + "serviceName": "//blp/myservice" + } + + formatter.formatMessageDict(content) + + def testServiceOpenFailure(self): + """Sample ServiceOpenFailure message""" + event = blpapi.test.createEvent(blpapi.Event.SERVICE_STATUS) + schema = blpapi.test.getAdminMessageDefinition( + blpapi.Name("ServiceOpenFailure")) + + formatter = blpapi.test.appendMessage(event, schema) + + content = { + "reason": { + "source": "TestUtil", + "errorCode": -1, + "category": "CATEGORY", + "description": "for testing", + "subcategory": "SUBCATEGORY", + } + } + + formatter.formatMessageDict(content) + + def testServiceRegistered(self): + """Sample ServiceRegistered message""" + event = blpapi.test.createEvent(blpapi.Event.SERVICE_STATUS) + schema = blpapi.test.getAdminMessageDefinition( + blpapi.Name("ServiceRegistered")) + + formatter = blpapi.test.appendMessage(event, schema) + + content = { + "serviceName": "//blp/myservice" + } + + formatter.formatMessageDict(content) + + def testServiceRegisterFailure(self): + """Sample ServiceRegisterFailure message""" + event = blpapi.test.createEvent(blpapi.Event.SERVICE_STATUS) + schema = blpapi.test.getAdminMessageDefinition( + blpapi.Name("ServiceRegisterFailure")) + + formatter = blpapi.test.appendMessage(event, schema) + + content = { + "reason": { + "source": "TestUtil", + "errorCode": -1, + "category": "CATEGORY", + "description": "for testing", + "subcategory": "SUBCATEGORY", + } + } + + formatter.formatMessageDict(content) + + def testServiceDeregistered(self): + """Sample ServiceDeregistered message""" + event = blpapi.test.createEvent(blpapi.Event.SERVICE_STATUS) + schema = blpapi.test.getAdminMessageDefinition( + blpapi.Name("ServiceDeregistered")) + + formatter = blpapi.test.appendMessage(event, schema) + + content = { + "serviceName": "//blp/myservice" + } + + formatter.formatMessageDict(content) + + def testServiceDown(self): + """Sample ServiceDown message""" + event = blpapi.test.createEvent(blpapi.Event.SERVICE_STATUS) + schema = blpapi.test.getAdminMessageDefinition( + blpapi.Name("ServiceDown")) + + formatter = blpapi.test.appendMessage(event, schema) + + # content = { + # "serviceName": "//blp/myservice", + # "servicePart": { + # "publishing": { } + # }, + # "endpoint": "12.34.56.78" + # } + # formatter.formatMessageDict(content) + + # Existence of void types (e.g. "servicePart" elements") are not + # well-supported by the JSON/XML interface. Instead, use the + # `EventFormatter`-like interface provided by `MessageFormatter`. + formatter.setElement(blpapi.Name("serviceName"), "//blp/myservice") + formatter.pushElement(blpapi.Name("servicePart")) + formatter.setElement(blpapi.Name("publishing"), None) + formatter.popElement() + formatter.setElement(blpapi.Name("endpoint"), "12.34.56.78") + + def testServiceUp(self): + """Sample ServiceUp message""" + event = blpapi.test.createEvent(blpapi.Event.SERVICE_STATUS) + schema = blpapi.test.getAdminMessageDefinition( + blpapi.Name("ServiceUp")) + + formatter = blpapi.test.appendMessage(event, schema) + + # content = { + # "serviceName": "//blp/myservice", + # "servicePart": { + # "publishing": { } + # }, + # "endpoint": "12.34.56.78" + # } + # formatter.formatMessageDict(content) + + # Existence of void types (e.g. "servicePart" elements") are not + # well-supported by the JSON/XML interface. Instead, use the + # `EventFormatter`-like interface provided by `MessageFormatter`. + formatter.setElement(blpapi.Name("serviceName"), "//blp/myservice") + formatter.pushElement(blpapi.Name("servicePart")) + formatter.setElement(blpapi.Name("publishing"), None) + formatter.popElement() + formatter.setElement(blpapi.Name("endpoint"), "12.34.56.78") + + def testServiceAvailabilityInfo(self): + """Sample ServiceAvailabilityInfo message""" + event = blpapi.test.createEvent(blpapi.Event.SERVICE_STATUS) + schema = blpapi.test.getAdminMessageDefinition( + blpapi.Name("ServiceAvailabilityInfo")) + + formatter = blpapi.test.appendMessage(event, schema) + + content = { + "serviceName": "//blp/myservice", + "serverAdded": { + "address": "12.34.56.78" + }, + "serverRemoved": { + "address": "12.34.56.78" + }, + "servers": [ + "12.34.56.78", + "12.34.56.78" + ] + } + formatter.formatMessageDict(content) + +# =================== +# TOKEN STATUS EVENTS +# =================== + + def testTokenGenerationSuccess(self): + """Sample TokenGenerationSuccess message""" + event = blpapi.test.createEvent(blpapi.Event.TOKEN_STATUS) + schema = blpapi.test.getAdminMessageDefinition( + blpapi.Name("TokenGenerationSuccess")) + + formatter = blpapi.test.appendMessage(event, schema) + + content = { + "token": "mytoken" + } + + formatter.formatMessageDict(content) + + def testTokenGenerationFailure(self): + """Sample TokenGenerationFailure message""" + event = blpapi.test.createEvent(blpapi.Event.TOKEN_STATUS) + schema = blpapi.test.getAdminMessageDefinition( + blpapi.Name("TokenGenerationFailure")) + + formatter = blpapi.test.appendMessage(event, schema) + + content = { + "reason": { + "source": "TestUtil", + "errorCode": -1, + "category": "CATEGORY", + "description": "for testing", + "subcategory": "SUBCATEGORY", + } + } + + formatter.formatMessageDict(content) + +# ========================== +# SUBSCRIPTION STATUS EVENTS +# ========================== + + def testSubscriptionStarted(self): + """Sample SubscriptionStarted message""" + event = blpapi.test.createEvent(blpapi.Event.SUBSCRIPTION_STATUS) + schema = blpapi.test.getAdminMessageDefinition( + blpapi.Name("SubscriptionStarted")) + + formatter = blpapi.test.appendMessage(event, schema) + + content = { + "exceptions": [ + { + "fieldId": "field", + "reason": { + "source": "TestUtil", + "errorCode": -1, + "category": "CATEGORY", + "description": "for testing", + "subcategory": "SUBCATEGORY", + } + } + ], + "resubscriptionId": 123, + "streamIds": ["123", "456"], + "receivedFrom": {"address": "12.34.56.78:81964"}, + "reason": "TestUtil" + } + + formatter.formatMessageDict(content) + + def testSubscriptionFailure(self): + """Sample SubscriptionFailure message""" + event = blpapi.test.createEvent(blpapi.Event.SUBSCRIPTION_STATUS) + schema = blpapi.test.getAdminMessageDefinition( + blpapi.Name("SubscriptionFailure")) + + formatter = blpapi.test.appendMessage(event, schema) + + content = { + "reason": { + "source": "TestUtil", + "errorCode": -1, + "category": "CATEGORY", + "description": "for testing", + "subcategory": "SUBCATEGORY", + }, + "failureDetails": [ + { + "fieldId": "field", + "reason": { + "source": "TestUtil", + "errorCode": -1, + "category": "CATEGORY", + "description": "for testing", + "subcategory": "SUBCATEGORY", + } + } + ], + "resubscriptionId": 123, + } + + formatter.formatMessageDict(content) + + def testSubscriptionStreamsActivated(self): + """Sample SubscriptionStreamsActivated message""" + event = blpapi.test.createEvent(blpapi.Event.SUBSCRIPTION_STATUS) + schema = blpapi.test.getAdminMessageDefinition( + blpapi.Name("SubscriptionStreamsActivated")) + + formatter = blpapi.test.appendMessage(event, schema) + + content = { + "streams": [ + { + "id": "streamId", + "endpoint": {"address": "12.34.56.78:8194"} + } + ], + "reason": "TestUtil" + } + + formatter.formatMessageDict(content) + + def testSubscriptionStreamsDeactivated(self): + """Sample SubscriptionStreamsDeactivated message""" + event = blpapi.test.createEvent(blpapi.Event.SUBSCRIPTION_STATUS) + schema = blpapi.test.getAdminMessageDefinition( + blpapi.Name("SubscriptionStreamsDeactivated")) + + formatter = blpapi.test.appendMessage(event, schema) + + content = { + "streams": [ + { + "id": "streamId", + "endpoint": {"address": "12.34.56.78:8194"} + } + ], + "reason": "TestUtil" + } + + formatter.formatMessageDict(content) + + def testSubscriptionTerminated(self): + """Sample SubscriptionTerminated message""" + event = blpapi.test.createEvent(blpapi.Event.SUBSCRIPTION_STATUS) + schema = blpapi.test.getAdminMessageDefinition( + blpapi.Name("SubscriptionTerminated")) + + formatter = blpapi.test.appendMessage(event, schema) + + content = { + "reason": { + "source": "TestUtil", + "errorCode": -1, + "category": "CATEGORY", + "description": "for testing", + "subcategory": "SUBCATEGORY", + } + } + + formatter.formatMessageDict(content) + +# ===================== +# REQUEST STATUS EVENTS +# ===================== + + def testRequestFailure(self): + """Sample RequestFailure message""" + event = blpapi.test.createEvent(blpapi.Event.REQUEST_STATUS) + schema = blpapi.test.getAdminMessageDefinition( + blpapi.Name("RequestFailure")) + + formatter = blpapi.test.appendMessage(event, schema) + + content = { + "reason": { + "source": "TestUtil", + "errorCode": -1, + "category": "CATEGORY", + "description": "for testing", + "subcategory": "SUBCATEGORY", + } + } + + formatter.formatMessageDict(content) + +# ======================== +# RESOLUTION STATUS EVENTS +# ======================== + + def testResolutionSuccess(self): + """Sample ResolutionSuccess message""" + event = blpapi.test.createEvent(blpapi.Event.RESOLUTION_STATUS) + schema = blpapi.test.getAdminMessageDefinition( + blpapi.Name("ResolutionSuccess")) + + formatter = blpapi.test.appendMessage(event, schema) + + content = { + "resolvedTopic": "//blp/myservice/rtopic" + } + + formatter.formatMessageDict(content) + + def testResolutionFailure(self): + """Sample ResolutionFailure message""" + event = blpapi.test.createEvent(blpapi.Event.RESOLUTION_STATUS) + schema = blpapi.test.getAdminMessageDefinition( + blpapi.Name("ResolutionFailure")) + + formatter = blpapi.test.appendMessage(event, schema) + + content = { + "reason": { + "source": "TestUtil", + "errorCode": -1, + "category": "CATEGORY", + "description": "for testing", + "subcategory": "SUBCATEGORY", + } + } + + formatter.formatMessageDict(content) + +# ============================ +# PERMISSION STATUS OPERATIONS +# ============================ + + def testPermissionRequest(self): + """Sample PermissionRequest message""" + event = blpapi.test.createEvent(blpapi.Event.REQUEST) + schema = blpapi.test.getAdminMessageDefinition( + blpapi.Name("PermissionRequest")) + + formatter = blpapi.test.appendMessage(event, schema) + + content = { + "topics": ["topic1", "topic2"], + "serviceName": "//blp/mytestservice", + "uuid": 1234, + "seatType": 1234, + "applicationId": 1234, + "userName": "someName", + "appName": "myAppName", + "deviceAddress": "myDevice" + } + + formatter.formatMessageDict(content) + + def testPermissionResponse(self): + """Sample PermissionResponse message""" + # Unlike the other admin messages, 'PermissionResponse' is not + # delivered to applications by the SDK. It is used by resolvers to + # respond to incoming 'PermissionRequest' messages. BLPAPI applications + # are not expected to handle these messages. + # + # For testing if an application is publishing 'PermissionResponse' + # messages with correct values, it is recommended to mock the related + # `ProviderSession::publish()` method to capture the published events. + # See the provided testing examples for more detail. + + +# =================== +# TOPIC STATUS EVENTS +# =================== + + def testTopicCreated(self): + """Sample TopicCreated message""" + event = blpapi.test.createEvent(blpapi.Event.TOPIC_STATUS) + schema = blpapi.test.getAdminMessageDefinition( + blpapi.Name("TopicCreated")) + + formatter = blpapi.test.appendMessage(event, schema) + + content = { + "topic": "mytopic" + } + + formatter.formatMessageDict(content) + + def testTopicCreateFailure(self): + """Sample TopicCreateFailure message""" + event = blpapi.test.createEvent(blpapi.Event.TOPIC_STATUS) + schema = blpapi.test.getAdminMessageDefinition( + blpapi.Name("TopicCreateFailure")) + + formatter = blpapi.test.appendMessage(event, schema) + + content = { + "topic": "mytopic", + "reason": { + "source": "TestUtil", + "errorCode": -1, + "category": "CATEGORY", + "description": "for testing", + "subcategory": "SUBCATEGORY", + } + } + + formatter.formatMessageDict(content) + + def testTopicDeleted(self): + """Sample TopicDeleted message""" + event = blpapi.test.createEvent(blpapi.Event.TOPIC_STATUS) + schema = blpapi.test.getAdminMessageDefinition( + blpapi.Name("TopicDeleted")) + + formatter = blpapi.test.appendMessage(event, schema) + + content = { + "topic": "mytopic", + "reason": "TestUtil" + } + + formatter.formatMessageDict(content) + + def testTopicSubscribed(self): + """Sample TopicSubscribed message""" + event = blpapi.test.createEvent(blpapi.Event.TOPIC_STATUS) + schema = blpapi.test.getAdminMessageDefinition( + blpapi.Name("TopicSubscribed")) + + formatter = blpapi.test.appendMessage(event, schema) + + content = { + "topic": "mytopic", + "topicWithOptions": "topicwithopts" + } + + formatter.formatMessageDict(content) + + def testTopicResubscribed(self): + """Sample TopicResubscribed message""" + event = blpapi.test.createEvent(blpapi.Event.TOPIC_STATUS) + schema = blpapi.test.getAdminMessageDefinition( + blpapi.Name("TopicResubscribed")) + + formatter = blpapi.test.appendMessage(event, schema) + + content = { + "topic": "mytopic", + "topicWithOptions": "topicwithopts", + "reason": "TestUtil" + } + + formatter.formatMessageDict(content) + + def testTopicUnsubscribed(self): + """Sample TopicUnsubscribed message""" + event = blpapi.test.createEvent(blpapi.Event.TOPIC_STATUS) + schema = blpapi.test.getAdminMessageDefinition( + blpapi.Name("TopicUnsubscribed")) + + formatter = blpapi.test.appendMessage(event, schema) + + content = { + "topic": "mytopic", + "reason": "TestUtil" + } + + formatter.formatMessageDict(content) + + def testTopicActivated(self): + """Sample TopicActivated message""" + event = blpapi.test.createEvent(blpapi.Event.TOPIC_STATUS) + schema = blpapi.test.getAdminMessageDefinition( + blpapi.Name("TopicActivated")) + + formatter = blpapi.test.appendMessage(event, schema) + + content = { + "topic": "mytopic" + } + + formatter.formatMessageDict(content) + + def testTopicDeactivated(self): + """Sample TopicDeactivated message""" + event = blpapi.test.createEvent(blpapi.Event.TOPIC_STATUS) + schema = blpapi.test.getAdminMessageDefinition( + blpapi.Name("TopicDeactivated")) + + formatter = blpapi.test.appendMessage(event, schema) + + content = { + "topic": "mytopic", + "reason": "TestUtil" + } + + formatter.formatMessageDict(content) + + def testTopicRecap(self): + """Sample TopicRecap message""" + event = blpapi.test.createEvent(blpapi.Event.TOPIC_STATUS) + schema = blpapi.test.getAdminMessageDefinition( + blpapi.Name("TopicRecap")) + + formatter = blpapi.test.appendMessage(event, schema) + + content = { + "topic": "mytopic", + "isSolicited": True, + "topicWithOptions": "topicwithopts" + } + + formatter.formatMessageDict(content) + +if __name__ == '__main__': + unittest.main() + + +__copyright__ = """ +Copyright 2020. Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above +copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/mock-test-examples/snippets/refdata.py b/examples/mock-test-examples/snippets/refdata.py new file mode 100644 index 0000000..d8ce75f --- /dev/null +++ b/examples/mock-test-examples/snippets/refdata.py @@ -0,0 +1,172 @@ +""" Sample unit test cases. """ + +import unittest + +import blpapi + +#pylint: disable=line-too-long +REF_DATA_SCHEMA = \ +"\ +\ + \ + \ + ReferenceDataRequest\ + Response\ + ReferenceDataResponse\ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + true\ + false\ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + The contents of this type depends on the response\ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ +" + + +class TestRefdata(unittest.TestCase): + """ Responses in `//blp/refdata` use a different dynamic schema for each + response, depending on the fields requested. This makes it is necessary to + create an ad-hoc schema for the test cases. + + The example in this repository provides an example schema that supports + successful and unsuccessful `ReferenceDataResponse` types. The provided + schema can be modified to handle additional fields as needed. + """ + + def setUp(self): + self.refdataService = blpapi.test.deserializeService(REF_DATA_SCHEMA) + self.requestName = blpapi.Name("ReferenceDataRequest") + + def testRefdataResponseSuccess(self): + """ Verify that a successful `ReferenceDataResponse` can be created + with the provided sample schema. Note that some of the fields are not + filled in this example. + """ + event = blpapi.test.createEvent(blpapi.Event.RESPONSE) + + schema = self.refdataService \ + .getOperation(self.requestName) \ + .getResponseDefinitionAt(0) + + formatter = blpapi.test.appendMessage(event, schema) + + content = { + "securityData": [ + { + "security": "IBM US Equity", + "fieldData": { + "LAST_PRICE": 138.533300 + }, + "sequenceNumber": 0 + } + ] + } + + formatter.formatMessageDict(content) + + def testRefdataResponseFailure(self): + """ Verify that an unsuccessful `ReferenceDataResponse` can be created + with the provided sample schema. Note that some of the fields are not + filled in this example. + """ + event = blpapi.test.createEvent(blpapi.Event.RESPONSE) + + schema = self.refdataService \ + .getOperation(self.requestName) \ + .getResponseDefinitionAt(0) + + formatter = blpapi.test.appendMessage(event, schema) + + content = { + "securityData": [ + { + "security": "IBM US Equity", + "fieldData": {}, + "fieldExceptions": [{ + "fieldId": "PX_LAST", + "errorInfo": { + "source": "src", + "code": 5, + "category": "NO_AUTH", + "message": "Field..", + "subcategory": "FIELD.." + } + }], + "sequenceNumber": 0 + } + ] + } + + formatter.formatMessageDict(content) + + +if __name__ == '__main__': + unittest.main() + + +__copyright__ = """ +Copyright 2020. Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above +copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/mock-test-examples/snippets/resolver/resolverutils.py b/examples/mock-test-examples/snippets/resolver/resolverutils.py new file mode 100644 index 0000000..f34567d --- /dev/null +++ b/examples/mock-test-examples/snippets/resolver/resolverutils.py @@ -0,0 +1,119 @@ +""" Sample utility functions for registering a service and handling permission +requests. """ + +import blpapi + +# 'blpapi.Name' objects are more expensive to construct than `str`, but +# are more efficient on use through the interface. By creating the +# 'blpapi.Name' objects in advance we can take advantage of the efficiency +# without paying the cost of constructing them when needed. +PERMISSION_REQUEST = blpapi.Name("PermissionRequest") +PERMISSION_RESPONSE = blpapi.Name("PermissionResponse") +TOPIC = blpapi.Name("topic") +TOPICS = blpapi.Name("topics") +TOPIC_PERMISSION = blpapi.Name("topicPermissions") +RESULT = blpapi.Name("result") +REASON = blpapi.Name("reason") +SOURCE = blpapi.Name("source") +CATEGORY = blpapi.Name("category") +SUBCATEGORY = blpapi.Name("subcategory") +DESCRIPTION = blpapi.Name("description") + +ALLOWED_APP_ID = 1234 +RESOLVER_ID = "service:hostname" +# This can be any string, but it's helpful to provide information on the +# instance of the resolver that responded to debug failures in production. + +def resolutionServiceRegistration(providerSession, + providerIdentity, + serviceName): + """ This helper demonstrates how to register a service. + + This helper assumes the following: + * Specified `providerSession` is already started + * Specified `providerIdentity` is already authorized if auth is needed or + default-constructed if authorization is not required. + + Args: + providerSession (ProviderSession): The session to register services. + providerIdentity (Identity): Identity used to verify permissions to + provide the service being registered. + serviceName (str): Name of the service. + + Returns: + bool: True if service registration succeeds; False otherwise. + """ + serviceOptions = blpapi.ServiceRegistrationOptions() + + dummyPriority = 123 + serviceOptions.setServicePriority(dummyPriority) + + serviceOptions.setPartsToRegister( + blpapi.ServiceRegistrationOptions.PART_PUBLISHER_RESOLUTION) + + if not providerSession.registerService(serviceName, + providerIdentity, + serviceOptions): + print("Failed to register {}".format(serviceName)) + return False + + return True + +def handlePermissionRequest(providerSession, service, request): + """ Respond to a PermissionRequest. + + Only accept requests with applicationId `ALLOWED_APP_ID`. + """ + assert request.messageType() == PERMISSION_REQUEST + + disallowed = 1 + if request.hasElement("applicationId") and \ + request.getElementAsInteger("applicationId") == ALLOWED_APP_ID: + disallowed = 0 + + response = service.createResponseEvent(request.correlationIds()[0]) + formatter = blpapi.EventFormatter(response) + formatter.appendResponse(PERMISSION_RESPONSE) + + topics = request.getElement(TOPICS) + formatter.pushElement(TOPIC_PERMISSION) + + for i in range(topics.numValues()): + formatter.appendElement() + formatter.setElement(TOPIC, topics.getValueAsString(i)) + formatter.setElement(RESULT, disallowed) + if disallowed: + formatter.pushElement(REASON) + formatter.setElement(SOURCE, RESOLVER_ID) + formatter.setElement(CATEGORY, "NOT_AUTHORIZED") + formatter.setElement(SUBCATEGORY, "") + formatter.setElement(DESCRIPTION, "Only app 1234 allowed") + formatter.popElement() + formatter.popElement() + + formatter.popElement() + + providerSession.sendResponse(response) + return True + + +__copyright__ = """ +Copyright 2020. Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above +copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/mock-test-examples/snippets/resolver/test_resolverutils.py b/examples/mock-test-examples/snippets/resolver/test_resolverutils.py new file mode 100644 index 0000000..34b3375 --- /dev/null +++ b/examples/mock-test-examples/snippets/resolver/test_resolverutils.py @@ -0,0 +1,209 @@ +""" Sample test cases for mocking `blpapi` objects and using the `blpapi.test` +submodule in the context of resolvers. +""" + +import unittest + +try: + from unittest.mock import ANY, Mock +except ImportError: + from mock import ANY, Mock + +import blpapi + +from resolverutils import \ + resolutionServiceRegistration, \ + handlePermissionRequest + + +RESULT = blpapi.Name("result") +REASON = blpapi.Name("reason") +CATEGORY = blpapi.Name("category") +NOT_AUTHORIZED = blpapi.Name("NOT_AUTHORIZED") +TOPIC_PERMISSIONS = blpapi.Name("topicPermissions") +PERMISSION_REQUEST = blpapi.Name("PermissionRequest") +PERMISSION_RESPONSE = blpapi.Name("PermissionResponse") + +ALLOWED_APP_ID = 1234 +INVALID_APP_ID = 4321 + +def createPermissionEvent(cid, applicationId): + """ Create a mock PermissionRequest `event`. """ + props = blpapi.test.MessageProperties() + props.setCorrelationIds([cid]) + + request = blpapi.test.createEvent(blpapi.Event.REQUEST) + + schemaDef = blpapi.test.getAdminMessageDefinition(PERMISSION_REQUEST) + + content = { + "topics": [ + "topic1", + "topic2" + ], + "serviceName": "//blp/mytestservice", + "applicationId": applicationId + } + + formatter = blpapi.test.appendMessage(request, schemaDef, props) + + formatter.formatMessageDict(content) + + return request + + +def getFirstMessage(event): + """ Retrieve the first `Message` from the provided `event`. """ + for msg in event: + return msg + raise Exception("No messages in event") + +#pylint: disable=line-too-long +def getService(): + """ Create a basic `Service` instance by deserializing a schema string. """ + schema = """ + + + + 12345 + false + false + 12346 + + + + + + + + """ + return blpapi.test.deserializeService(schema) + +class TestResolverUtils(unittest.TestCase): + """ Test suite for resolverutils. """ + + def testResolutionServiceRegistration(self): + """ This test demonstrates how to mock interactions on objects of type + `ProviderSession`. + In this test, we are setting the return value of the function, and + verifying our input parameters. + """ + mockSession = Mock() + mockIdentity = Mock() + + serviceName = "//blp/mytestservice" + + mockSession.registerService.return_value = True + + registrationResult = resolutionServiceRegistration(mockSession, + mockIdentity, + serviceName) + serviceRegistrationOptions = \ + mockSession.registerService.call_args[0][2] + + self.assertTrue(registrationResult) + + mockSession.registerService.assert_called_once_with(serviceName, + mockIdentity, + ANY) + expectedPriority = 123 + self.assertEqual(expectedPriority, + serviceRegistrationOptions.getServicePriority()) + self.assertTrue(serviceRegistrationOptions.getPartsToRegister() & + blpapi.ServiceRegistrationOptions.PART_PUBLISHER_RESOLUTION) + + def testSuccessfulResolution(self): + """ Test the creation of a successful permission response. """ + mockSession = Mock() + service = getService() + + cid = blpapi.CorrelationId(1) + permissionEvent = createPermissionEvent(cid, ALLOWED_APP_ID) + permissionRequest = getFirstMessage(permissionEvent) + + handlePermissionRequest(mockSession, service, permissionRequest) + + mockSession.sendResponse.assert_called_once() + response = mockSession.sendResponse.call_args[0][0] + self.assertEqual(blpapi.Event.RESPONSE, response.eventType()) + + permissionResponse = getFirstMessage(response) + self.assertEqual(cid, permissionResponse.correlationIds()[0]) + self.assertEqual(PERMISSION_RESPONSE, permissionResponse.messageType()) + self.assertTrue(permissionResponse.hasElement(TOPIC_PERMISSIONS)) + + topicPermissions = permissionResponse.getElement(TOPIC_PERMISSIONS) + + topicCount = 2 + self.assertEqual(topicCount, topicPermissions.numValues()) + + for i in range(topicCount): + topicPermission = topicPermissions.getValueAsElement(i) + self.assertTrue(topicPermission.hasElement(RESULT)) + self.assertEqual(0, topicPermission.getElementAsInteger(RESULT)) + + def testFailedResolution(self): + """ Test the creation of a failed permission response. """ + mockSession = Mock() + service = getService() + + cid = blpapi.CorrelationId(1) + permissionEvent = createPermissionEvent(cid, INVALID_APP_ID) + permissionRequest = getFirstMessage(permissionEvent) + + handlePermissionRequest(mockSession, service, permissionRequest) + + mockSession.sendResponse.assert_called_once() + response = mockSession.sendResponse.call_args[0][0] + self.assertEqual(blpapi.Event.RESPONSE, response.eventType()) + + permissionResponse = getFirstMessage(response) + self.assertEqual(cid, permissionResponse.correlationIds()[0]) + self.assertEqual(PERMISSION_RESPONSE, permissionResponse.messageType()) + self.assertTrue(permissionResponse.hasElement(TOPIC_PERMISSIONS)) + + topicPermissions = permissionResponse.getElement(TOPIC_PERMISSIONS) + + topicCount = 2 + self.assertEqual(topicCount, topicPermissions.numValues()) + + for i in range(topicCount): + topicPermission = topicPermissions.getValueAsElement(i) + self.assertTrue(topicPermission.hasElement(RESULT)) + self.assertEqual(1, topicPermission.getElementAsInteger(RESULT)) + + self.assertTrue(topicPermission.hasElement(REASON)) + reason = topicPermission.getElement(REASON) + + self.assertTrue(reason.hasElement(CATEGORY)) + self.assertEqual(NOT_AUTHORIZED, + reason.getElementAsString(CATEGORY)) + + +if __name__ == "__main__": + unittest.main() + + +__copyright__ = """ +Copyright 2020. Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above +copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/setup.py b/setup.py index e728949..cf144dd 100644 --- a/setup.py +++ b/setup.py @@ -101,7 +101,7 @@ def lib_in_release(): description='Python SDK for Bloomberg BLPAPI', ext_modules=[blpapi_wrap, versionhelper_wrap], url='http://www.bloomberglabs.com/api/', - packages=["blpapi"], + packages=["blpapi", "blpapi.test"], classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', From 357dd4529f61195fddce90d93ef6bfdd4e771832 Mon Sep 17 00:00:00 2001 From: Marland Sitt Date: Tue, 27 Jul 2021 07:45:30 -0700 Subject: [PATCH 07/23] Bump to v3.16.2 --- License.txt | 23 + MANIFEST.in | 5 + PKG-INFO | 2 +- blpapi/versionhelper.py | 111 - changelog.txt | 4 + examples/ConnectionAndAuthExample.py | 5 +- examples/ContributionsMktdataExample.py | 27 +- examples/ContributionsPageExample.py | 25 +- examples/CorrelationExample.py | 5 +- .../EntitlementsVerificationTokenExample.py | 68 +- examples/GenerateTokenExample.py | 69 +- examples/GenerateTokenSubscriptionExample.py | 63 +- examples/IntradayBarExample.py | 8 +- examples/IntradayTickExample.py | 10 +- examples/LocalMktdataSubscriptionExample.py | 14 +- examples/LocalPageSubscriptionExample.py | 2 +- examples/MktdataBroadcastPublisherExample.py | 22 +- examples/MktdataPublisher.py | 97 +- examples/PagePublisherExample.py | 82 +- examples/RefDataTableOverrideExample.py | 5 +- examples/RequestServiceExample.py | 22 +- examples/ServiceSchema.py | 4 +- examples/SessionIdentityExample.py | 14 +- examples/SimpleAsyncSubscription.py | 67 +- examples/SimpleBlockingRequestExample.py | 9 +- .../SimpleCategorizedFieldSearchExample.py | 5 +- examples/SimpleFieldInfoExample.py | 5 +- examples/SimpleFieldSearchExample.py | 5 +- examples/SimpleHistoryExample.py | 2 +- examples/SimpleIntradayBarExample.py | 5 +- examples/SimpleIntradayTickExample.py | 5 +- examples/SimpleRefDataExample.py | 5 +- examples/SimpleRefDataOverrideExample.py | 5 +- examples/SimpleSubscriptionExample.py | 2 +- examples/SimpleSubscriptionIntervalExample.py | 2 +- examples/SnapshotRequestTemplateExample.py | 4 +- examples/SubscriptionCorrelationExample.py | 4 +- .../SubscriptionWithEventHandlerExample.py | 4 +- setup.cfg | 13 +- setup.py | 17 +- {blpapi => src/blpapi}/__init__.py | 18 + {blpapi => src/blpapi}/abstractsession.py | 28 +- {blpapi => src/blpapi}/auth.py | 45 +- src/blpapi/chandle.py | 55 + {blpapi => src/blpapi}/compat.py | 0 {blpapi => src/blpapi}/constant.py | 0 {blpapi => src/blpapi}/datatype.py | 0 {blpapi => src/blpapi}/datetime.py | 0 {blpapi => src/blpapi}/debug.py | 0 {blpapi => src/blpapi}/debug_environment.py | 0 {blpapi => src/blpapi}/diagnosticsutil.py | 0 {blpapi => src/blpapi}/element.py | 0 {blpapi => src/blpapi}/event.py | 66 +- {blpapi => src/blpapi}/eventdispatcher.py | 29 +- {blpapi => src/blpapi}/eventformatter.py | 35 +- {blpapi => src/blpapi}/exception.py | 0 {blpapi => src/blpapi}/highresclock.py | 0 {blpapi => src/blpapi}/identity.py | 27 +- {blpapi => src/blpapi}/internals.py | 780 +- {blpapi => src/blpapi}/internals_wrap.c | 6544 ++++++++--------- {blpapi => src/blpapi}/logging.py | 0 {blpapi => src/blpapi}/message.py | 23 +- {blpapi => src/blpapi}/name.py | 30 +- {blpapi => src/blpapi}/providersession.py | 57 +- {blpapi => src/blpapi}/request.py | 21 +- {blpapi => src/blpapi}/requesttemplate.py | 23 +- {blpapi => src/blpapi}/resolutionlist.py | 27 +- {blpapi => src/blpapi}/schema.py | 14 +- {blpapi => src/blpapi}/service.py | 20 +- {blpapi => src/blpapi}/session.py | 25 +- {blpapi => src/blpapi}/sessionoptions.py | 46 +- {blpapi => src/blpapi}/subscriptionlist.py | 26 +- {blpapi => src/blpapi}/test/__init__.py | 0 .../blpapi}/test/messageformatter.py | 0 .../blpapi}/test/messageproperties.py | 0 {blpapi => src/blpapi}/test/testutil.py | 0 {blpapi => src/blpapi}/topic.py | 26 +- {blpapi => src/blpapi}/topiclist.py | 28 +- {blpapi => src/blpapi}/utils.py | 0 {blpapi => src/blpapi}/version.py | 2 +- src/blpapi/versionhelper.py | 73 + {blpapi => src/blpapi}/versionhelper_wrap.c | 862 +-- {blpapi => src/blpapi}/zfputil.py | 0 83 files changed, 4102 insertions(+), 5674 deletions(-) create mode 100644 License.txt create mode 100644 MANIFEST.in delete mode 100644 blpapi/versionhelper.py rename {blpapi => src/blpapi}/__init__.py (79%) rename {blpapi => src/blpapi}/abstractsession.py (96%) rename {blpapi => src/blpapi}/auth.py (89%) create mode 100644 src/blpapi/chandle.py rename {blpapi => src/blpapi}/compat.py (100%) rename {blpapi => src/blpapi}/constant.py (100%) rename {blpapi => src/blpapi}/datatype.py (100%) rename {blpapi => src/blpapi}/datetime.py (100%) rename {blpapi => src/blpapi}/debug.py (100%) rename {blpapi => src/blpapi}/debug_environment.py (100%) rename {blpapi => src/blpapi}/diagnosticsutil.py (100%) rename {blpapi => src/blpapi}/element.py (100%) rename {blpapi => src/blpapi}/event.py (86%) rename {blpapi => src/blpapi}/eventdispatcher.py (86%) rename {blpapi => src/blpapi}/eventformatter.py (95%) rename {blpapi => src/blpapi}/exception.py (100%) rename {blpapi => src/blpapi}/highresclock.py (100%) rename {blpapi => src/blpapi}/identity.py (92%) rename {blpapi => src/blpapi}/internals.py (61%) rename {blpapi => src/blpapi}/internals_wrap.c (77%) rename {blpapi => src/blpapi}/logging.py (100%) rename {blpapi => src/blpapi}/message.py (96%) rename {blpapi => src/blpapi}/name.py (90%) rename {blpapi => src/blpapi}/providersession.py (97%) rename {blpapi => src/blpapi}/request.py (91%) rename {blpapi => src/blpapi}/requesttemplate.py (80%) rename {blpapi => src/blpapi}/resolutionlist.py (94%) rename {blpapi => src/blpapi}/schema.py (96%) rename {blpapi => src/blpapi}/service.py (97%) rename {blpapi => src/blpapi}/session.py (98%) rename {blpapi => src/blpapi}/sessionoptions.py (97%) rename {blpapi => src/blpapi}/subscriptionlist.py (95%) rename {blpapi => src/blpapi}/test/__init__.py (100%) rename {blpapi => src/blpapi}/test/messageformatter.py (100%) rename {blpapi => src/blpapi}/test/messageproperties.py (100%) rename {blpapi => src/blpapi}/test/testutil.py (100%) rename {blpapi => src/blpapi}/topic.py (85%) rename {blpapi => src/blpapi}/topiclist.py (93%) rename {blpapi => src/blpapi}/utils.py (100%) rename {blpapi => src/blpapi}/version.py (97%) create mode 100644 src/blpapi/versionhelper.py rename {blpapi => src/blpapi}/versionhelper_wrap.c (84%) rename {blpapi => src/blpapi}/zfputil.py (100%) diff --git a/License.txt b/License.txt new file mode 100644 index 0000000..3011024 --- /dev/null +++ b/License.txt @@ -0,0 +1,23 @@ +All files Copyright 2012 Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this proprietary software and associated documentation files (the "Software"), +to use, publish, or distribute copies of the Software, and to permit persons to +whom the Software is furnished to do so. + +Any other use, including modifying, adapting, reverse engineering, decompiling, +or disassembling, is not permitted. + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + + diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..8676bcb --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,5 @@ +include README changelog.txt NOTES License.txt + +recursive-include examples *.py + +prune cpp-licenses diff --git a/PKG-INFO b/PKG-INFO index f77af09..f1f3af1 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: blpapi -Version: 3.16.1 +Version: 3.16.2 Summary: Python SDK for Bloomberg BLPAPI Home-page: http://www.bloomberglabs.com/api/ Author: Bloomberg L.P. diff --git a/blpapi/versionhelper.py b/blpapi/versionhelper.py deleted file mode 100644 index a1d736e..0000000 --- a/blpapi/versionhelper.py +++ /dev/null @@ -1,111 +0,0 @@ -# This file was automatically generated by SWIG (http://www.swig.org). -# Version 3.0.12 -# -# Do not make changes to this file unless you know what you are doing--modify -# the SWIG interface file instead. - -"""blpapi version helper""" - - -from sys import version_info as _swig_python_version_info -if _swig_python_version_info >= (2, 7, 0): - def swig_import_helper(): - import importlib - pkg = __name__.rpartition('.')[0] - mname = '.'.join((pkg, '_versionhelper')).lstrip('.') - try: - return importlib.import_module(mname) - except ImportError: - return importlib.import_module('_versionhelper') - _versionhelper = swig_import_helper() - del swig_import_helper -elif _swig_python_version_info >= (2, 6, 0): - def swig_import_helper(): - from os.path import dirname - import imp - fp = None - try: - fp, pathname, description = imp.find_module('_versionhelper', [dirname(__file__)]) - except ImportError: - import _versionhelper - return _versionhelper - try: - _mod = imp.load_module('_versionhelper', fp, pathname, description) - finally: - if fp is not None: - fp.close() - return _mod - _versionhelper = swig_import_helper() - del swig_import_helper -else: - import _versionhelper -del _swig_python_version_info - -try: - _swig_property = property -except NameError: - pass # Python < 2.2 doesn't have 'property'. - -try: - import builtins as __builtin__ -except ImportError: - import __builtin__ - -def _swig_setattr_nondynamic(self, class_type, name, value, static=1): - if (name == "thisown"): - return self.this.own(value) - if (name == "this"): - if type(value).__name__ == 'SwigPyObject': - self.__dict__[name] = value - return - method = class_type.__swig_setmethods__.get(name, None) - if method: - return method(self, value) - if (not static): - if _newclass: - object.__setattr__(self, name, value) - else: - self.__dict__[name] = value - else: - raise AttributeError("You cannot add attributes to %s" % self) - - -def _swig_setattr(self, class_type, name, value): - return _swig_setattr_nondynamic(self, class_type, name, value, 0) - - -def _swig_getattr(self, class_type, name): - if (name == "thisown"): - return self.this.own() - method = class_type.__swig_getmethods__.get(name, None) - if method: - return method(self) - raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name)) - - -def _swig_repr(self): - try: - strthis = "proxy of " + self.this.__repr__() - except __builtin__.Exception: - strthis = "" - return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) - -try: - _object = object - _newclass = 1 -except __builtin__.Exception: - class _object: - pass - _newclass = 0 - - -def blpapi_getVersionInfo(): - return _versionhelper.blpapi_getVersionInfo() -blpapi_getVersionInfo = _versionhelper.blpapi_getVersionInfo - -def blpapi_getVersionIdentifier(): - return _versionhelper.blpapi_getVersionIdentifier() -blpapi_getVersionIdentifier = _versionhelper.blpapi_getVersionIdentifier -# This file is compatible with both classic and new-style classes. - - diff --git a/changelog.txt b/changelog.txt index f3299a3..6f5668a 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,7 @@ +Version 3.16.2: +=============== +- Stability and performance improvements + Version 3.16.1: =============== - Stability and performance improvements diff --git a/examples/ConnectionAndAuthExample.py b/examples/ConnectionAndAuthExample.py index c13bb70..9a55501 100644 --- a/examples/ConnectionAndAuthExample.py +++ b/examples/ConnectionAndAuthExample.py @@ -140,8 +140,7 @@ def parseCmdLine(): help="number of connection retries " "(default: number of hosts)", metavar="option", - type=int, - action=AuthOptionsAction) + type=int) # TLS Options parser.add_argument("--tls-client-credentials", @@ -223,7 +222,7 @@ def main(): try: example.run() - except Exception as err: # pylint: disable=W0703 + except blpapi.Exception as err: print("Exception caught: {}".format(err)) diff --git a/examples/ContributionsMktdataExample.py b/examples/ContributionsMktdataExample.py index 09181b7..6e4c250 100644 --- a/examples/ContributionsMktdataExample.py +++ b/examples/ContributionsMktdataExample.py @@ -4,7 +4,7 @@ import time from optparse import OptionParser, OptionValueError - +from threading import Event import os import platform as plat import sys @@ -18,31 +18,29 @@ MARKET_DATA = blpapi.Name("MarketData") SESSION_TERMINATED = blpapi.Name("SessionTerminated") -g_running = True - class MyStream(object): # pylint: disable=too-few-public-methods - def __init__(self, id=""): - self.id = id + def __init__(self, sid=""): + self.id = sid class MyEventHandler(object): # pylint: disable=too-few-public-methods """Event handler for the session""" - def processEvent(self, event, session): - """Process session event""" + def __init__(self, stop): + """ Construct a handler """ + self.stop = stop - global g_running + def processEvent(self, event, _sesssion): + """Process session event""" for msg in event: print(msg) if event.eventType() == blpapi.Event.SESSION_STATUS: if msg.messageType() == SESSION_TERMINATED: - g_running = False + self.stop.set() continue - cids = msg.correlationIds() - -def authOptionCallback(option, opt, value, parser): +def authOptionCallback(_option, _opt, value, parser): """Parse authorization options from user input""" vals = value.split('=', 1) @@ -242,7 +240,8 @@ def main(): sessionOptions.setSessionIdentityOptions(options.auth['option']) sessionOptions.setAutoRestartOnDisconnection(True) - myEventHandler = MyEventHandler() + stop = Event() + myEventHandler = MyEventHandler(stop) # Create a Session session = blpapi.ProviderSession(sessionOptions, @@ -281,7 +280,7 @@ def main(): try: # Now we will start publishing value = 1 - while streams and g_running: + while streams and not stop.is_set(): event = service.createPublishEvent() eventFormatter = blpapi.EventFormatter(event) diff --git a/examples/ContributionsPageExample.py b/examples/ContributionsPageExample.py index 7f11dc6..1bfc030 100644 --- a/examples/ContributionsPageExample.py +++ b/examples/ContributionsPageExample.py @@ -3,8 +3,8 @@ from __future__ import absolute_import from optparse import OptionParser, OptionValueError +from threading import Event import time - import os import sys import platform as plat @@ -17,29 +17,29 @@ SESSION_TERMINATED = blpapi.Name("SessionTerminated") - class MyStream(object): # pylint: disable=too-few-public-methods - def __init__(self, id=""): - self.id = id + def __init__(self, sid=""): + self.id = sid class MyEventHandler(object): # pylint: disable=too-few-public-methods """Event handler for the session""" - def processEvent(self, event, session): - """Process session event""" - - global g_running + def __init__(self, stop): + """Construct an event handler""" + self.stop = stop + def processEvent(self, event, _session): + """Process session event""" for msg in event: print(msg) if event.eventType() == blpapi.Event.SESSION_STATUS: if msg.messageType() == SESSION_TERMINATED: - g_running = False + self.stop.set() continue -def authOptionCallback(option, opt, value, parser): +def authOptionCallback(_option, _opt, value, parser): """Parse authorization options from user input""" vals = value.split('=', 1) @@ -243,7 +243,8 @@ def main(): sessionOptions.setSessionIdentityOptions(options.auth['option']) sessionOptions.setAutoRestartOnDisconnection(True) - myEventHandler = MyEventHandler() + stop = Event() + myEventHandler = MyEventHandler(stop) # Create a Session session = blpapi.ProviderSession(sessionOptions, @@ -281,7 +282,7 @@ def main(): try: # Now we will start publishing - while streams and g_running: + while streams and not stop.is_set(): event = service.createPublishEvent() eventFormatter = blpapi.EventFormatter(event) diff --git a/examples/CorrelationExample.py b/examples/CorrelationExample.py index 38a9c6a..014d8fb 100644 --- a/examples/CorrelationExample.py +++ b/examples/CorrelationExample.py @@ -37,9 +37,9 @@ def parseCmdLine(): metavar="tcpPort", default=8194) - (options, args) = parser.parse_args() + poptions,_ = parser.parse_args() - return options + return poptions def startSession(session): @@ -56,7 +56,6 @@ def startSession(session): def main(): - global options options = parseCmdLine() # Fill SessionOptions diff --git a/examples/EntitlementsVerificationTokenExample.py b/examples/EntitlementsVerificationTokenExample.py index b8537f0..0fae7f0 100644 --- a/examples/EntitlementsVerificationTokenExample.py +++ b/examples/EntitlementsVerificationTokenExample.py @@ -23,11 +23,6 @@ APIAUTH_SVC = "//blp/apiauth" REFDATA_SVC = "//blp/refdata" -g_securities = None -g_tokens = None -g_session = None -g_identities = [] - def printEvent(event): for msg in event: @@ -38,6 +33,10 @@ def printEvent(event): class SessionEventHandler(object): + def __init__(self, identities, tokens): + self.identities = identities + self.tokens = tokens + def printFailedEntitlements(self, listOfFailedEIDs): print(listOfFailedEIDs) @@ -55,7 +54,7 @@ def distributeMessage(self, msg): if (entitlements is not None and entitlements.isValid() and entitlements.numValues() > 0): - for j, identity in enumerate(g_identities): + for j, identity in enumerate(self.identities): if identity.hasEntitlements(service, entitlements): print("User: %s is entitled to get data for: %s" % \ (j + 1, ticker)) @@ -66,19 +65,19 @@ def distributeMessage(self, msg): identity.getFailedEntitlements(service, entitlements)[1]) else: - for token in g_tokens: + for token in self.tokens: print("User: %s is entitled to get data for: %s" % \ (token, ticker)) # Now Distribute message to the user. def processResponseEvent(self, event): for msg in event: - if msg.hasElement("RESPONSE_ERROR"): + if msg.hasElement("RESPONSE_ERROR") or msg.hasElement("responseError"): print(msg) continue self.distributeMessage(msg) - def processEvent(self, event, session): + def processEvent(self, event, _session): if (event.eventType() == blpapi.Event.SESSION_STATUS or event.eventType() == blpapi.Event.SERVICE_STATUS or event.eventType() == blpapi.Event.REQUEST_STATUS or @@ -123,7 +122,7 @@ def parseCmdLine(): metavar="tcpPort", default=8194) - (options, args) = parser.parse_args() + options,_ = parser.parse_args() if not options.securities: options.securities = ["MSFT US Equity"] @@ -131,19 +130,19 @@ def parseCmdLine(): return options -def authorizeUsers(): - authService = g_session.getService(APIAUTH_SVC) +def authorizeUsers(session, tokens, identities): + authService = session.getService(APIAUTH_SVC) is_any_user_authorized = False # Authorize each of the users - for index, token in enumerate(g_tokens): - identity = g_session.createIdentity() - g_identities.append(identity) + for index, token in enumerate(tokens): + identity = session.createIdentity() + identities.append(identity) authRequest = authService.createAuthorizationRequest() authRequest.set("token", token) correlator = blpapi.CorrelationId(token) eventQueue = blpapi.EventQueue() - g_session.sendAuthorizationRequest(authRequest, + session.sendAuthorizationRequest(authRequest, identity, correlator, eventQueue) @@ -160,14 +159,14 @@ def authorizeUsers(): return is_any_user_authorized -def sendRefDataRequest(): - refDataService = g_session.getService(REFDATA_SVC) +def sendRefDataRequest(session, securities): + refDataService = session.getService(REFDATA_SVC) request = refDataService.createRequest(REFRENCEDATA_REQUEST) # Add securities to the request - securities = request.getElement("securities") - for security in g_securities: - securities.appendValue(security) + securitiesEl = request.getElement("securities") + for security in securities: + securitiesEl.appendValue(security) # Add fields to the request fields = request.getElement("fields") @@ -178,11 +177,10 @@ def sendRefDataRequest(): # Send the request using the server's credentials print("Sending RefDataRequest using server credentials...") - g_session.sendRequest(request) + session.sendRequest(request) def main(): - global g_session, g_securities, g_tokens options = parseCmdLine() # Create SessionOptions object and populate it with data @@ -190,36 +188,38 @@ def main(): sessionOptions.setServerHost(options.host) sessionOptions.setServerPort(options.port) - g_securities = options.securities + securities = options.securities if not options.tokens: print("No tokens were specified") return - g_tokens = options.tokens - print(g_tokens) + tokens = options.tokens + print(tokens) + + identities = [] # Create Session object and connect to Bloomberg services print("Connecting to %s:%s" % (options.host, options.port)) - eventHandler = SessionEventHandler() - g_session = blpapi.Session(sessionOptions, eventHandler.processEvent) - if not g_session.start(): + eventHandler = SessionEventHandler(identities, tokens) + session = blpapi.Session(sessionOptions, eventHandler.processEvent) + if not session.start(): print("Failed to start session.") return # Open authorization service - if not g_session.openService("//blp/apiauth"): + if not session.openService("//blp/apiauth"): print("Failed to open //blp/apiauth") return # Open reference data service - if not g_session.openService("//blp/refdata"): + if not session.openService("//blp/refdata"): print("Failed to open //blp/refdata") return # Authorize all the users that are interested in receiving data - if authorizeUsers(): + if authorizeUsers(session, tokens, identities): # Make the various requests that we need to make - sendRefDataRequest() + sendRefDataRequest(session, securities) try: # Wait for enter key to exit application @@ -227,7 +227,7 @@ def main(): input() finally: # Stop the session - g_session.stop() + session.stop() if __name__ == "__main__": print("EntitlementsVerificationTokenExample") diff --git a/examples/GenerateTokenExample.py b/examples/GenerateTokenExample.py index 6370bda..fddf0a3 100644 --- a/examples/GenerateTokenExample.py +++ b/examples/GenerateTokenExample.py @@ -19,13 +19,6 @@ TOKEN_SUCCESS = blpapi.Name("TokenGenerationSuccess") TOKEN_FAILURE = blpapi.Name("TokenGenerationFailure") - -g_session = None -g_identity = None -g_securities = None -g_fields = None - - def parseCmdLine(): # Parse command-line parameters parser = OptionParser(description="Generate a token for authorization") @@ -58,7 +51,7 @@ def parseCmdLine(): help="dirSvcProperty", metavar="dirSvcProperty") - (options, args) = parser.parse_args() + options,_ = parser.parse_args() if not options.securities: options.securities = ["IBM US Equity"] @@ -69,26 +62,25 @@ def parseCmdLine(): return options -def sendRequest(): - refDataService = g_session.getService("//blp/refdata") +def sendRequest(session, identity, securities, fields): + refDataService = session.getService("//blp/refdata") request = refDataService.createRequest("ReferenceDataRequest") # Add securities to the request - securities = request.getElement("securities") - for security in g_securities: - securities.appendValue(security) + securitiesEl = request.getElement("securities") + for security in securities: + securitiesEl.appendValue(security) # Add fields to the request - fields = request.getElement("fields") - for field in g_fields: - fields.appendValue(field) + fieldsEl = request.getElement("fields") + for field in fields: + fieldsEl.appendValue(field) print("Sending request: %s" % request) - g_session.sendRequest(request, g_identity) + session.sendRequest(request, identity) -def processTokenStatus(event): - global g_identity +def processTokenStatus(event, session): print("processTokenEvents") # Handle response to token generation request @@ -97,24 +89,24 @@ def processTokenStatus(event): print(msg) # Authentication phase has passed; send authorization request - authService = g_session.getService("//blp/apiauth") + authService = session.getService("//blp/apiauth") authRequest = authService.createAuthorizationRequest() authRequest.set("token", msg.getElementAsString("token")) - g_identity = g_session.createIdentity() - g_session.sendAuthorizationRequest( + identity = session.createIdentity() + session.sendAuthorizationRequest( authRequest, - g_identity, + identity, blpapi.CorrelationId(1)) elif msg.messageType() == TOKEN_FAILURE: # Token generation failure print(msg) - return False - return True + return None + return identity -def processEvent(event): +def processEvent(event, session, identity, securities, fields): print("processEvent") # Handle response to authorization request; handle reference data @@ -122,7 +114,7 @@ def processEvent(event): if msg.messageType() == AUTHORIZATION_SUCCESS: # Authorization phase has passed; request data print("Authorization SUCCESS") - sendRequest() + sendRequest(session, identity, securities, fields) elif msg.messageType() == AUTHORIZATION_FAILURE: # Authorization failure print("Authorization FAILED") @@ -138,7 +130,6 @@ def processEvent(event): def main(): - global g_session, g_securities, g_fields options = parseCmdLine() # Create SessionOptions object and populate it with data @@ -152,37 +143,39 @@ def main(): print("authOptions = %s" % authOptions) sessionOptions.setAuthenticationOptions(authOptions) - g_securities = options.securities - g_fields = options.fields + securities = options.securities + fields = options.fields # Create Session object and connect to Bloomberg services print("Connecting to %s:%s" % (options.host, options.port)) - g_session = blpapi.Session(sessionOptions) - if not g_session.start(): + session = blpapi.Session(sessionOptions) + if not session.start(): print("Failed to start session.") return # Open reference data service - if not g_session.openService("//blp/refdata"): + if not session.openService("//blp/refdata"): print("Failed to open //blp/refdata") return # Open authorization service - if not g_session.openService("//blp/apiauth"): + if not session.openService("//blp/apiauth"): print("Failed to open //blp/apiauth") return # Submit a token generation request tokenReqId = blpapi.CorrelationId(99) - g_session.generateToken(tokenReqId) + session.generateToken(tokenReqId) + identity = None while True: - event = g_session.nextEvent() + event = session.nextEvent() if event.eventType() == blpapi.Event.TOKEN_STATUS: - if not processTokenStatus(event): + identity = processTokenStatus(event, session) + if identity is None: break else: - if not processEvent(event): + if not processEvent(event, session, identity, securities, fields): break diff --git a/examples/GenerateTokenSubscriptionExample.py b/examples/GenerateTokenSubscriptionExample.py index b0ce2f4..4fa1ca9 100644 --- a/examples/GenerateTokenSubscriptionExample.py +++ b/examples/GenerateTokenSubscriptionExample.py @@ -19,14 +19,6 @@ TOKEN_SUCCESS = blpapi.Name("TokenGenerationSuccess") TOKEN_FAILURE = blpapi.Name("TokenGenerationFailure") - -g_session = None -g_identity = None -g_securities = None -g_fields = None -g_options = None - - def parseCmdLine(): parser = OptionParser(description="Generate a token for authorization") parser.add_option("-a", @@ -64,7 +56,7 @@ def parseCmdLine(): help="dirSvcProperty", metavar="dirSvcProperty") - (options, args) = parser.parse_args() + options,_ = parser.parse_args() if not options.securities: options.securities = ["IBM US Equity"] @@ -75,22 +67,21 @@ def parseCmdLine(): return options -def subscribe(): +def subscribe(session, identity, securities, fields, soptions = None): # Create a SubscriptionList and populate it with securities, fields etc subscriptions = blpapi.SubscriptionList() - for i, security in enumerate(g_securities): + for i, security in enumerate(securities): subscriptions.add(security, - g_fields, - g_options, + fields, + soptions, blpapi.CorrelationId(i)) print("Subscribing...") - g_session.subscribe(subscriptions, g_identity) + session.subscribe(subscriptions, identity) -def processTokenStatus(event): - global g_identity +def processTokenStatus(event, session): print("processTokenEvents") for msg in event: @@ -98,29 +89,29 @@ def processTokenStatus(event): print(msg) # Authentication phase has passed; send authorization request - authService = g_session.getService("//blp/apiauth") + authService = session.getService("//blp/apiauth") authRequest = authService.createAuthorizationRequest() authRequest.set("token", msg.getElementAsString("token")) - g_identity = g_session.createIdentity() - g_session.sendAuthorizationRequest( + identity = session.createIdentity() + session.sendAuthorizationRequest( authRequest, - g_identity, + identity, blpapi.CorrelationId(1)) elif msg.messageType() == TOKEN_FAILURE: # Token generation failure print(msg) - return False - return True + return None + return identity -def processEvent(event): +def processEvent(event, session, identity, securities, fields): print("processEvent") for msg in event: if msg.messageType() == AUTHORIZATION_SUCCESS: # Authorization phase has passed; subscribe to market data print("Authorization SUCCESS") - subscribe() + subscribe(session, identity, securities, fields) elif msg.messageType() == AUTHORIZATION_FAILURE: # Authorization failure print("Authorization FAILED") @@ -132,7 +123,6 @@ def processEvent(event): def main(): - global g_session, g_securities, g_fields print("GenerateTokenSubscriptionExample") options = parseCmdLine() @@ -148,42 +138,45 @@ def main(): print("authOptions = %s" % authOptions) sessionOptions.setAuthenticationOptions(authOptions) - g_securities = options.securities - g_fields = options.fields + securities = options.securities + fields = options.fields print("Connecting to %s:%s" % (options.host, options.port)) - g_session = blpapi.Session(sessionOptions) - if not g_session.start(): + session = blpapi.Session(sessionOptions) + if not session.start(): print("Failed to start session.") return # Open market data service - if not g_session.openService("//blp/mktdata"): + if not session.openService("//blp/mktdata"): print("Failed to open //blp/mktdata") return # Open authorization service - if not g_session.openService("//blp/apiauth"): + if not session.openService("//blp/apiauth"): print("Failed to open //blp/apiauth") return # Submit a token generation request tokenReqId = blpapi.CorrelationId(99) - g_session.generateToken(tokenReqId) + session.generateToken(tokenReqId) + + identity = None # Handle and respond to incoming events while True: # nextEvent() method below is called with a timeout to let # the program catch Ctrl-C between arrivals of new events - event = g_session.nextEvent(1000) + event = session.nextEvent(1000) if event.eventType() != blpapi.Event.TIMEOUT: if event.eventType() == blpapi.Event.TOKEN_STATUS: # Handle response to token generation request - if not processTokenStatus(event): + identity = processTokenStatus(event, session) + if identity is None: break else: # Handle all other events - if not processEvent(event): + if not processEvent(event, session, identity, securities, fields): break diff --git a/examples/IntradayBarExample.py b/examples/IntradayBarExample.py index 02c81cd..79cfadc 100644 --- a/examples/IntradayBarExample.py +++ b/examples/IntradayBarExample.py @@ -31,7 +31,7 @@ MESSAGE = blpapi.Name("message") -def checkDateTime(option, opt, value): +def checkDateTime(_option, opt, value): try: return datetime.datetime.strptime(value, "%Y-%m-%d %H:%M:%S") except ValueError as ex: @@ -99,7 +99,7 @@ def parseCmdLine(): action="store_true", default=False) - (options, args) = parser.parse_args() + options,_ = parser.parse_args() return options @@ -115,7 +115,7 @@ def processMessage(msg): for bar in data.values(): time = bar.getElementAsDatetime(TIME) - open = bar.getElementAsFloat(OPEN) + open_ = bar.getElementAsFloat(OPEN) high = bar.getElementAsFloat(HIGH) low = bar.getElementAsFloat(LOW) close = bar.getElementAsFloat(CLOSE) @@ -123,7 +123,7 @@ def processMessage(msg): volume = bar.getElementAsInteger(VOLUME) print("%s\t\t%.3f\t\t%.3f\t\t%.3f\t\t%.3f\t\t%d\t\t%d" % \ - (time.strftime("%m/%d/%y %H:%M"), open, high, low, close, + (time.strftime("%m/%d/%y %H:%M"), open_, high, low, close, numEvents, volume)) diff --git a/examples/IntradayTickExample.py b/examples/IntradayTickExample.py index 65e822d..1a82762 100644 --- a/examples/IntradayTickExample.py +++ b/examples/IntradayTickExample.py @@ -27,7 +27,7 @@ MESSAGE = blpapi.Name("message") SESSION_TERMINATED = blpapi.Name("SessionTerminated") -def authOptionCallback(option, opt, value, parser): +def authOptionCallback(_option, _opt, value, parser): """Parse authorization options from user input""" vals = value.split('=', 1) @@ -68,7 +68,7 @@ def authOptionCallback(option, opt, value, parser): parser.values.auth = {'option' : authOptions} -def checkDateTime(option, opt, value): +def checkDateTime(_option, opt, value): try: return datetime.datetime.strptime(value, "%Y-%m-%d %H:%M:%S") except ValueError as ex: @@ -169,9 +169,9 @@ def processMessage(msg): print("----\t\t\t\t----\t-----\t\t----\t--") for item in data.values(): - time = item.getElementAsDatetime(TIME) + item.getElementAsDatetime(TIME) timeString = item.getElementAsString(TIME) - type = item.getElementAsString(TYPE) + type_ = item.getElementAsString(TYPE) value = item.getElementAsFloat(VALUE) size = item.getElementAsInteger(TICK_SIZE) if item.hasElement(COND_CODE): @@ -179,7 +179,7 @@ def processMessage(msg): else: cc = "" - print("%s\t%s\t%.3f\t\t%d\t%s" % (timeString, type, value, size, cc)) + print("%s\t%s\t%.3f\t\t%d\t%s" % (timeString, type_, value, size, cc)) def processResponseEvent(event): diff --git a/examples/LocalMktdataSubscriptionExample.py b/examples/LocalMktdataSubscriptionExample.py index 8325e44..f081b77 100644 --- a/examples/LocalMktdataSubscriptionExample.py +++ b/examples/LocalMktdataSubscriptionExample.py @@ -20,7 +20,7 @@ SESSION_TERMINATED = blpapi.Name("SessionTerminated") SERVICE_OPEN_FAILURE = blpapi.Name("ServiceOpenFailure") -def authOptionCallback(option, opt, value, parser): +def authOptionCallback(_option, _opt, value, parser): """Parse authorization options from user input""" vals = value.split('=', 1) @@ -156,7 +156,7 @@ def parseCmdLine(): metavar="port", type="int") - (options, args) = parser.parse_args() + options,_ = parser.parse_args() if not options.hosts: options.hosts = ["localhost"] @@ -257,9 +257,7 @@ def processSubscriptionEvents(session, maxEvents): if eventType == blpapi.Event.SUBSCRIPTION_STATUS: if messageType == SUBSCRIPTION_FAILURE \ or messageType == SUBSCRIPTION_TERMINATED: - errorDescription = msg.getElement("reason") \ - .getElementAsString("description") - print("Subscription failed: {}".format(errorDescription)) + print("Subscription failed") printContactSupportMessage(msg) elif eventType == blpapi.Event.SUBSCRIPTION_DATA: if msg.recapType() == blpapi.Message.RECAPTYPE_SOLICITED: @@ -296,16 +294,14 @@ def processGenericMessage(eventType, message): if eventType == blpapi.Event.SESSION_STATUS: if messageType == SESSION_TERMINATED or \ messageType == SESSION_STARTUP_FAILURE: - error = message.getElement("reason").getElementAsString("description") - print("Session failed to start or terminated: {}".format(error)) + print("Session failed to start or terminated") printContactSupportMessage(message) # Session failed to start/terminated return True elif eventType == blpapi.Event.SERVICE_STATUS: if messageType == SERVICE_OPEN_FAILURE: serviceName = message.getElementAsString("serviceName") - error = message.getElement("reason").getElementAsString("description") - print("Failed to open {}: {}".format(serviceName, error)) + print("Failed to open {}".format(serviceName)) printContactSupportMessage(message) # Session OK diff --git a/examples/LocalPageSubscriptionExample.py b/examples/LocalPageSubscriptionExample.py index 6a5f2c6..71eb05c 100644 --- a/examples/LocalPageSubscriptionExample.py +++ b/examples/LocalPageSubscriptionExample.py @@ -15,7 +15,7 @@ import blpapi -def authOptionCallback(option, opt, value, parser): +def authOptionCallback(_option, _opt, value, parser): vals = value.split('=', 1) if value == "user": diff --git a/examples/MktdataBroadcastPublisherExample.py b/examples/MktdataBroadcastPublisherExample.py index 6dc203d..c40e904 100644 --- a/examples/MktdataBroadcastPublisherExample.py +++ b/examples/MktdataBroadcastPublisherExample.py @@ -4,7 +4,7 @@ import time from optparse import OptionParser, OptionValueError - +from threading import Event import os import platform as plat import sys @@ -17,27 +17,26 @@ SESSION_TERMINATED = blpapi.Name("SessionTerminated") -g_running = True - class MyStream(object): - def __init__(self, id=""): - self.id = id + def __init__(self, sid=""): + self.id = sid class MyEventHandler(object): - def processEvent(self, event, session): - global g_running + def __init__(self, stop): + self.stop = stop + def processEvent(self, event, _session): for msg in event: print(msg) if event.eventType() == blpapi.Event.SESSION_STATUS: if msg.messageType() == SESSION_TERMINATED: - g_running = False + self.stop.set() continue -def authOptionCallback(option, opt, value, parser): +def authOptionCallback(_option, _opt, value, parser): """Parse authorization options from user input""" vals = value.split('=', 1) @@ -163,7 +162,8 @@ def main(): # so only try to connect to each server once. sessionOptions.setNumStartAttempts(1 if len(options.hosts) > 1 else 1000) - myEventHandler = MyEventHandler() + stop = Event() + myEventHandler = MyEventHandler(stop) # Create a Session session = blpapi.ProviderSession(sessionOptions, @@ -218,7 +218,7 @@ def main(): try: # Now we will start publishing tickCount = 1 - while streams and g_running: + while streams and not stop.is_set(): event = service.createPublishEvent() eventFormatter = blpapi.EventFormatter(event) diff --git a/examples/MktdataPublisher.py b/examples/MktdataPublisher.py index a8b5aee..0a044ef 100644 --- a/examples/MktdataPublisher.py +++ b/examples/MktdataPublisher.py @@ -27,12 +27,9 @@ TOPIC_RECAP = blpapi.Name("TopicRecap") -g_running = True - - class MyStream(object): - def __init__(self, id="", fields=None): - self.id = id + def __init__(self, sid="", fields=None): + self.id = sid self.fields = fields if fields else [] self.lastValue = 0 self.topic = blpapi.Topic() @@ -70,7 +67,7 @@ def fillData(self, eventFormatter, elementDef): eventFormatter.setElement(f, value) def fillDataNull(self, eventFormatter, elementDef): - for i, f in enumerate(self.fields): + for f in self.fields: if not elementDef.typeDefinition().hasElementDefinition(f): print("Invalid field '%s'" % f) continue @@ -87,34 +84,33 @@ def isAvailable(self): return self.topic.isValid() and self.isSubscribed -g_streams = dict() -g_availableTopicCount = 0 -g_mutex = threading.Lock() -# Indicates if g_availableTopicCount is non-zero -g_condition = threading.Condition(g_mutex) - - class MyEventHandler(object): def __init__(self, serviceName, messageType, fields, eids, - resolveSubServiceCode): + resolveSubServiceCode, + mutex, + stop, + condition): self.serviceName = serviceName self.messageType = messageType self.fields = fields self.eids = eids self.resolveSubServiceCode = resolveSubServiceCode + self.mutex = mutex + self.stop = stop + self.condition = condition + self.streams = dict() + self.availableTopicCount = 0 def processEvent(self, event, session): - global g_availableTopicCount, g_running - if event.eventType() == blpapi.Event.SESSION_STATUS: for msg in event: print(msg) if msg.messageType() == SESSION_TERMINATED: - g_running = False + self.stop.set() elif event.eventType() == blpapi.Event.TOPIC_STATUS: topicList = blpapi.TopicList() @@ -123,40 +119,40 @@ def processEvent(self, event, session): print(msg) if msg.messageType() == TOPIC_SUBSCRIBED: topicStr = msg.getElementAsString("topic") - with g_mutex: - if topicStr not in g_streams: + with self.mutex: + if topicStr not in self.streams: # TopicList knows how to add an entry based on a # TOPIC_SUBSCRIBED message. topicList.add(msg) - g_streams[topicStr] = MyStream(topicStr, + self.streams[topicStr] = MyStream(topicStr, self.fields) - stream = g_streams[topicStr] + stream = self.streams[topicStr] stream.isSubscribed = True if stream.isAvailable(): - g_availableTopicCount += 1 - g_condition.notifyAll() + self.availableTopicCount += 1 + self.condition.notifyAll() elif msg.messageType() == TOPIC_UNSUBSCRIBED: topicStr = msg.getElementAsString("topic") - with g_mutex: - if topicStr not in g_streams: + with self.mutex: + if topicStr not in self.streams: # We should never be coming here. # TOPIC_UNSUBSCRIBED can not come before # a TOPIC_SUBSCRIBED or TOPIC_CREATED continue - stream = g_streams[topicStr] + stream = self.streams[topicStr] if stream.isAvailable(): - g_availableTopicCount -= 1 - g_condition.notifyAll() + self.availableTopicCount -= 1 + self.condition.notifyAll() stream.isSubscribed = False elif msg.messageType() == TOPIC_CREATED: topicStr = msg.getElementAsString("topic") - with g_mutex: - if topicStr not in g_streams: - g_streams[topicStr] = MyStream(topicStr, + with self.mutex: + if topicStr not in self.streams: + self.streams[topicStr] = MyStream(topicStr, self.fields) - stream = g_streams[topicStr] + stream = self.streams[topicStr] try: stream.topic = session.getTopic(msg) except blpapi.Exception as e: @@ -165,8 +161,8 @@ def processEvent(self, event, session): continue if stream.isAvailable(): - g_availableTopicCount = g_availableTopicCount + 1 - g_condition.notifyAll() + self.availableTopicCount += 1 + self.condition.notifyAll() elif msg.messageType() == TOPIC_RECAP: # Here we send a recap in response to a Recap request. @@ -174,10 +170,10 @@ def processEvent(self, event, session): topicStr = msg.getElementAsString("topic") recapEvent = None - with g_mutex: - if topicStr not in g_streams: + with self.mutex: + if topicStr not in self.streams: continue - stream = g_streams[topicStr] + stream = self.streams[topicStr] if not stream.isAvailable(): continue @@ -225,11 +221,10 @@ def processEvent(self, event, session): permission = 1 # ALLOWED: 0, DENIED: 1 ef = blpapi.EventFormatter(response) if msg.hasElement("uuid"): - uuid = msg.getElementAsInteger("uuid") + msg.getElementAsInteger("uuid") permission = 0 if msg.hasElement("applicationId"): - applicationId = \ - msg.getElementAsInteger("applicationId") + msg.getElementAsInteger("applicationId") permission = 0 # In appendResponse the string is the name of the @@ -289,7 +284,7 @@ def processEvent(self, event, session): return True -def authOptionCallback(option, opt, value, parser): +def authOptionCallback(_option, _opt, value, parser): """Parse authorization options from user input""" vals = value.split('=', 1) @@ -467,12 +462,18 @@ def main(): options.port, " ".join(options.hosts))) PUBLISH_MESSAGE_TYPE = blpapi.Name(options.messageType) + mutex = threading.Lock() + stop = threading.Event() + condition = threading.Condition(mutex) myEventHandler = MyEventHandler(options.service, PUBLISH_MESSAGE_TYPE, options.fields, options.eids, - options.rssc) + options.rssc, + mutex, + stop, + condition) # Create a Session session = blpapi.ProviderSession(sessionOptions, @@ -511,14 +512,14 @@ def main(): elementDef = service.getEventDefinition(PUBLISH_MESSAGE_TYPE) eventCount = 0 numPublished = 0 - while g_running: + while not stop.is_set(): event = service.createPublishEvent() - with g_condition: - while g_availableTopicCount == 0: + with condition: + while myEventHandler.availableTopicCount == 0: # Set timeout to 1 - give a chance for CTRL-C - g_condition.wait(1) - if not g_running: + condition.wait(1) + if stop.is_set(): return publishNull = False @@ -527,7 +528,7 @@ def main(): eventCount = 0 publishNull = True eventFormatter = blpapi.EventFormatter(event) - for topicName, stream in g_streams.items(): + for _,stream in myEventHandler.streams.items(): if not stream.isAvailable(): continue eventFormatter.appendMessage(PUBLISH_MESSAGE_TYPE, diff --git a/examples/PagePublisherExample.py b/examples/PagePublisherExample.py index bcd7ad7..ccb0b43 100644 --- a/examples/PagePublisherExample.py +++ b/examples/PagePublisherExample.py @@ -4,7 +4,6 @@ import time from optparse import OptionParser, OptionValueError -import datetime import threading import os @@ -27,13 +26,11 @@ TOPIC_UNSUBSCRIBED = blpapi.Name("TopicUnsubscribed") -g_running = True -g_mutex = threading.Lock() class MyStream(object): - def __init__(self, id=""): - self.id = id + def __init__(self, sid=""): + self.id = sid self.isInitialPaintSent = False self.topic = blpapi.Topic() self.isSubscribed = False @@ -41,25 +38,23 @@ def __init__(self, id=""): def isAvailable(self): return self.topic.isValid() and self.isSubscribed -g_streams = dict() -g_availableTopicCount = 0 -g_mutex = threading.Lock() -# Indicates if g_availableTopicCount is non-zero -g_condition = threading.Condition(g_mutex) - class MyEventHandler(object): - def __init__(self, serviceName): + def __init__(self, serviceName, mutex, stop, condition): self.serviceName = serviceName + self.mutex = mutex + self.stop = stop + self.condition = condition + self.streams = dict() + self.availableTopicCount = 0 def processEvent(self, event, session): - global g_availableTopicCount, g_running if event.eventType() == blpapi.Event.SESSION_STATUS: for msg in event: print(msg) if msg.messageType() == SESSION_TERMINATED: - g_running = False + self.stop.set() elif event.eventType() == blpapi.Event.TOPIC_STATUS: topicList = blpapi.TopicList() @@ -68,38 +63,38 @@ def processEvent(self, event, session): print(msg) if msg.messageType() == TOPIC_SUBSCRIBED: topicStr = msg.getElementAsString("topic") - with g_mutex: - if topicStr not in g_streams: + with self.mutex: + if topicStr not in self.streams: # TopicList knows how to add an entry based on a # TOPIC_SUBSCRIBED message. topicList.add(msg) - g_streams[topicStr] = MyStream(topicStr) - stream = g_streams[topicStr] + self.streams[topicStr] = MyStream(topicStr) + stream = self.streams[topicStr] stream.isSubscribed = True if stream.isAvailable(): - g_availableTopicCount += 1 - g_condition.notifyAll() + self.availableTopicCount += 1 + self.condition.notifyAll() elif msg.messageType() == TOPIC_UNSUBSCRIBED: topicStr = msg.getElementAsString("topic") - with g_mutex: - if topicStr not in g_streams: + with self.mutex: + if topicStr not in self.streams: # We should never be coming here. # TOPIC_UNSUBSCRIBED can not come before # a TOPIC_SUBSCRIBED or TOPIC_CREATED continue - stream = g_streams[topicStr] + stream = self.streams[topicStr] if stream.isAvailable(): - g_availableTopicCount -= 1 - g_condition.notifyAll() + self.availableTopicCount -= 1 + self.condition.notifyAll() stream.isSubscribed = False elif msg.messageType() == TOPIC_CREATED: topicStr = msg.getElementAsString("topic") - with g_mutex: - if topicStr not in g_streams: - g_streams[topicStr] = MyStream(topicStr) - stream = g_streams[topicStr] + with self.mutex: + if topicStr not in self.streams: + self.streams[topicStr] = MyStream(topicStr) + stream = self.streams[topicStr] try: stream.topic = session.getTopic(msg) except blpapi.Exception as e: @@ -108,8 +103,8 @@ def processEvent(self, event, session): continue if stream.isAvailable(): - g_availableTopicCount += 1 - g_condition.notifyAll() + self.availableTopicCount += 1 + self.condition.notifyAll() elif msg.messageType() == TOPIC_RECAP: # Here we send a recap in response to a Recap request. @@ -117,10 +112,10 @@ def processEvent(self, event, session): topicStr = msg.getElementAsString("topic") recapEvent = None - with g_mutex: - if topicStr not in g_streams: + with self.mutex: + if topicStr not in self.streams: continue - stream = g_streams[topicStr] + stream = self.streams[topicStr] if not stream.isAvailable(): continue @@ -200,7 +195,7 @@ def processEvent(self, event, session): return True -def authOptionCallback(option, opt, value, parser): +def authOptionCallback(_option, _opt, value, parser): """Parse authorization options from user input""" vals = value.split('=', 1) @@ -310,7 +305,10 @@ def main(): print("Connecting to port %d on %s" % ( options.port, " ".join(options.hosts))) - myEventHandler = MyEventHandler(options.service) + mutex = threading.Lock() + stop = threading.Event() + condition = threading.Condition(mutex) + myEventHandler = MyEventHandler(options.service, mutex, stop, condition) # Create a Session session = blpapi.ProviderSession(sessionOptions, @@ -337,18 +335,18 @@ def main(): # Now we will start publishing value = 1 - while g_running: + while not stop.is_set(): event = service.createPublishEvent() - with g_condition: - while g_availableTopicCount == 0: + with condition: + while myEventHandler.availableTopicCount == 0: # Set timeout to 1 - give a chance for CTRL-C - g_condition.wait(1) - if not g_running: + condition.wait(1) + if stop.is_set(): return eventFormatter = blpapi.EventFormatter(event) - for topicName, stream in g_streams.items(): + for _, stream in myEventHandler.streams.items(): if not stream.isAvailable(): continue diff --git a/examples/RefDataTableOverrideExample.py b/examples/RefDataTableOverrideExample.py index c62195f..c9471ca 100644 --- a/examples/RefDataTableOverrideExample.py +++ b/examples/RefDataTableOverrideExample.py @@ -37,9 +37,9 @@ def parseCmdLine(): metavar="tcpPort", default=8194) - (options, args) = parser.parse_args() + poptions,_ = parser.parse_args() - return options + return poptions def processMessage(msg): @@ -66,7 +66,6 @@ def processMessage(msg): def main(): - global options options = parseCmdLine() # Fill SessionOptions diff --git a/examples/RequestServiceExample.py b/examples/RequestServiceExample.py index 9f9ad98..52c9123 100644 --- a/examples/RequestServiceExample.py +++ b/examples/RequestServiceExample.py @@ -3,7 +3,6 @@ from __future__ import absolute_import import time -import threading from optparse import OptionParser, OptionValueError import os @@ -19,23 +18,19 @@ RESOLUTION_SUCCESS = blpapi.Name("ResolutionSuccess") SESSION_TERMINATED = blpapi.Name("SessionTerminated") -g_running = True -g_mutex = threading.Lock() - class MyProviderEventHandler(object): def __init__(self, serviceName): self.serviceName = serviceName def processEvent(self, event, session): - global g_running print("Server received an event") if event.eventType() == blpapi.Event.SESSION_STATUS: for msg in event: print(msg) if msg.messageType() == SESSION_TERMINATED: - g_running = False + pass elif event.eventType() == blpapi.Event.RESOLUTION_STATUS: for msg in event: @@ -97,13 +92,13 @@ def processEvent(self, event, session): class MyRequesterEventHandler(object): - def processEvent(self, event, session): + def processEvent(self, event, _session): print("Client received an event") for msg in event: print(msg) -def authOptionCallback(option, opt, value, parser): +def authOptionCallback(_option, _opt, value, parser): """Parse authorization options from user input""" vals = value.split('=', 1) @@ -268,12 +263,11 @@ def clientRun(session, options): print("Client received an event") for msg in event: - with g_mutex: - if event.eventType() == blpapi.Event.RESPONSE: - if msg.hasElement("timestamp"): - responseTime = msg.getElementAsFloat("timestamp") - print("Response latency =", time.time() - responseTime) - print(msg) + if event.eventType() == blpapi.Event.RESPONSE: + if msg.hasElement("timestamp"): + responseTime = msg.getElementAsFloat("timestamp") + print("Response latency =", time.time() - responseTime) + print(msg) if event.eventType() == blpapi.Event.RESPONSE: break diff --git a/examples/ServiceSchema.py b/examples/ServiceSchema.py index 70289ee..686b1bb 100644 --- a/examples/ServiceSchema.py +++ b/examples/ServiceSchema.py @@ -45,7 +45,7 @@ } -def authOptionCallback(option, opt, value, parser): +def authOptionCallback(_option, _opt, value, parser): """Parse authorization options from user input""" vals = value.split('=', 1) @@ -201,7 +201,7 @@ def printElementDefinition(ed, level=0): printElementDefinition(i, level + 1) -def printOperation(operation, service): +def printOperation(operation, _service): print("{0} \"{1}\" Request:".format( operation.name(), operation.description())) diff --git a/examples/SessionIdentityExample.py b/examples/SessionIdentityExample.py index 73ec82b..be3c7c2 100644 --- a/examples/SessionIdentityExample.py +++ b/examples/SessionIdentityExample.py @@ -55,12 +55,12 @@ def parseCmdLine(): default=8194) parser.add_option("--auth", dest="authType", - help="authorization option: " - "none|user|app=|userapp=" - " (default: user)\n" - "'none' is applicable to Desktop API product " - "that requires Bloomberg Professional service " - "to be installed locally.", + help="authentication option: " + "user|none|app=|userapp=" + " (default: user)\n" + "'none' is applicable to Desktop API product " + "that requires Bloomberg Professional service " + "to be installed locally.", metavar="option", action="callback", callback=authOptionCallback, @@ -125,7 +125,7 @@ def main(): try: example.run() - except Exception as e: # pylint: disable=broad-except + except blpapi.Exception as e: print("Blpapi exception: {}".format(e)) diff --git a/examples/SimpleAsyncSubscription.py b/examples/SimpleAsyncSubscription.py index 53c44b5..14cd8e6 100644 --- a/examples/SimpleAsyncSubscription.py +++ b/examples/SimpleAsyncSubscription.py @@ -61,7 +61,7 @@ def printMessage(msg, eventType): EVENT_TYPE_NAMES[eventType], msg)) -def authOptionCallback(option, opt, value, parser): +def authOptionCallback(_option, _opt, value, parser): """Parse authorization options from user input""" vals = value.split('=', 1) @@ -149,51 +149,51 @@ def parseCmdLine(): blpapi.AuthOptions.createWithUser( blpapi.AuthUser.createWithLogonName())}) - (options, _) = parser.parse_args() + poptions,_ = parser.parse_args() - if not options.securities: - options.securities = ["IBM US Equity"] - return options + if not poptions.securities: + poptions.securities = ["IBM US Equity"] + return poptions # Subscribe 'session' for the securities and fields specified in 'options' -def subscribe(session, options, identity=None): +def subscribe(session, poptions, identity=None): sl = blpapi.SubscriptionList() - for s in options.securities: + for s in poptions.securities: topic = topicName(s) cid = blpapi.CorrelationId(s) print("Subscribing {0} => {1}".format(cid, topic)) - sl.add(topic, options.fields, correlationId=cid) + sl.add(topic, poptions.fields, correlationId=cid) session.subscribe(sl, identity) # Event handler -def processEvent(event, session): - global identity - global options - - try: - eventType = event.eventType() - for msg in event: - # Print all aincoming messages including the SubscriptionData - printMessage(msg, eventType) - - if eventType == EventType.SESSION_STATUS: - if msg.messageType() == SESSION_STARTED: - # Session.startAsync completed successfully - # Subscribe for the specified securities/fields - subscribe(session, options) - elif msg.messageType() == SESSION_STARTUP_FAILURE: - # Session.startAsync failed, raise exception to exit - raise Error("Can't start session") - except Error as ex: - print("Error in event handler:", ex) - # Interrupt a "sleep loop" in main thread - thread.interrupt_main() +class MyEventHandler(object): + def __init__(self, poptions): + self.options = poptions + + def processEvent(self, event, session): + try: + eventType = event.eventType() + for msg in event: + # Print all aincoming messages including the SubscriptionData + printMessage(msg, eventType) + + if eventType == EventType.SESSION_STATUS: + if msg.messageType() == SESSION_STARTED: + # Session.startAsync completed successfully + # Subscribe for the specified securities/fields + subscribe(session, self.options) + elif msg.messageType() == SESSION_STARTUP_FAILURE: + # Session.startAsync failed, raise exception to exit + raise Error("Can't start session") + except Error as ex: + print("Error in event handler:", ex) + # Interrupt a "sleep loop" in main thread + thread.interrupt_main() def main(): - global options options = parseCmdLine() # Fill SessionOptions @@ -202,11 +202,14 @@ def main(): sessionOptions.setServerPort(options.port) sessionOptions.setSessionIdentityOptions(options.auth['option']) + # Create a handler + handler = MyEventHandler(options) + # Create an EventDispatcher with 2 processing threads dispatcher = blpapi.EventDispatcher(2) # Create a Session - session = blpapi.Session(sessionOptions, processEvent, dispatcher) + session = blpapi.Session(sessionOptions, handler.processEvent, dispatcher) # Start dispatcher to "pump" the received events dispatcher.start() diff --git a/examples/SimpleBlockingRequestExample.py b/examples/SimpleBlockingRequestExample.py index 28f04bd..dc146ea 100644 --- a/examples/SimpleBlockingRequestExample.py +++ b/examples/SimpleBlockingRequestExample.py @@ -18,7 +18,7 @@ class MyEventHandler(object): - def processEvent(self, event, session): + def processEvent(self, event, _session): try: if event.eventType() == blpapi.Event.SUBSCRIPTION_DATA: for msg in event: @@ -26,7 +26,7 @@ def processEvent(self, event, session): field = msg.getElement(LAST_PRICE) print(field.name(), "=", field.getValueAsString()) return True - except Exception as e: + except blpapi.Exception as e: print("Exception:", e) return False @@ -46,13 +46,12 @@ def parseCmdLine(): metavar="tcpPort", default=8194) - (options, args) = parser.parse_args() + poptions,_ = parser.parse_args() - return options + return poptions def main(): - global options options = parseCmdLine() # Fill SessionOptions diff --git a/examples/SimpleCategorizedFieldSearchExample.py b/examples/SimpleCategorizedFieldSearchExample.py index 5a2bbaa..d62cd9a 100644 --- a/examples/SimpleCategorizedFieldSearchExample.py +++ b/examples/SimpleCategorizedFieldSearchExample.py @@ -50,9 +50,9 @@ def parseCmdLine(): metavar="tcpPort", default=8194) - (options, args) = parser.parse_args() + poptions,_ = parser.parse_args() - return options + return poptions def printField(field): @@ -80,7 +80,6 @@ def printHeader(): def main(): - global options options = parseCmdLine() # Fill SessionOptions diff --git a/examples/SimpleFieldInfoExample.py b/examples/SimpleFieldInfoExample.py index 801bff1..e71b971 100644 --- a/examples/SimpleFieldInfoExample.py +++ b/examples/SimpleFieldInfoExample.py @@ -45,9 +45,9 @@ def parseCmdLine(): metavar="tcpPort", default=8194) - (options, args) = parser.parse_args() + poptions,_ = parser.parse_args() - return options + return poptions def printField(field): @@ -75,7 +75,6 @@ def printHeader(): def main(): - global options options = parseCmdLine() # Fill SessionOptions diff --git a/examples/SimpleFieldSearchExample.py b/examples/SimpleFieldSearchExample.py index abdc209..409d7d3 100644 --- a/examples/SimpleFieldSearchExample.py +++ b/examples/SimpleFieldSearchExample.py @@ -45,9 +45,9 @@ def parseCmdLine(): metavar="tcpPort", default=8194) - (options, args) = parser.parse_args() + poptions,_ = parser.parse_args() - return options + return poptions def printField(field): @@ -75,7 +75,6 @@ def printHeader(): def main(): - global options options = parseCmdLine() # Fill SessionOptions diff --git a/examples/SimpleHistoryExample.py b/examples/SimpleHistoryExample.py index b37359f..46adc1d 100644 --- a/examples/SimpleHistoryExample.py +++ b/examples/SimpleHistoryExample.py @@ -29,7 +29,7 @@ def parseCmdLine(): metavar="tcpPort", default=8194) - (options, args) = parser.parse_args() + options,_ = parser.parse_args() return options diff --git a/examples/SimpleIntradayBarExample.py b/examples/SimpleIntradayBarExample.py index 95e8133..e1725af 100644 --- a/examples/SimpleIntradayBarExample.py +++ b/examples/SimpleIntradayBarExample.py @@ -30,9 +30,9 @@ def parseCmdLine(): metavar="tcpPort", default=8194) - (options, args) = parser.parse_args() + poptions,_ = parser.parse_args() - return options + return poptions def getPreviousTradingDate(): @@ -49,7 +49,6 @@ def getPreviousTradingDate(): def main(): - global options options = parseCmdLine() # Fill SessionOptions diff --git a/examples/SimpleIntradayTickExample.py b/examples/SimpleIntradayTickExample.py index 484c20b..19660e0 100644 --- a/examples/SimpleIntradayTickExample.py +++ b/examples/SimpleIntradayTickExample.py @@ -30,9 +30,9 @@ def parseCmdLine(): metavar="tcpPort", default=8194) - (options, args) = parser.parse_args() + poptions,_ = parser.parse_args() - return options + return poptions def getPreviousTradingDate(): @@ -49,7 +49,6 @@ def getPreviousTradingDate(): def main(): - global options options = parseCmdLine() # Fill SessionOptions diff --git a/examples/SimpleRefDataExample.py b/examples/SimpleRefDataExample.py index 2644ee5..d336d7e 100644 --- a/examples/SimpleRefDataExample.py +++ b/examples/SimpleRefDataExample.py @@ -29,13 +29,12 @@ def parseCmdLine(): metavar="tcpPort", default=8194) - (options, args) = parser.parse_args() + poptions,_ = parser.parse_args() - return options + return poptions def main(): - global options options = parseCmdLine() # Fill SessionOptions diff --git a/examples/SimpleRefDataOverrideExample.py b/examples/SimpleRefDataOverrideExample.py index 038091e..766196b 100644 --- a/examples/SimpleRefDataOverrideExample.py +++ b/examples/SimpleRefDataOverrideExample.py @@ -37,9 +37,9 @@ def parseCmdLine(): metavar="tcpPort", default=8194) - (options, args) = parser.parse_args() + poptions,_ = parser.parse_args() - return options + return poptions def processMessage(msg): @@ -68,7 +68,6 @@ def processMessage(msg): def main(): - global options options = parseCmdLine() # Fill SessionOptions diff --git a/examples/SimpleSubscriptionExample.py b/examples/SimpleSubscriptionExample.py index 0eeb960..ac2faf7 100644 --- a/examples/SimpleSubscriptionExample.py +++ b/examples/SimpleSubscriptionExample.py @@ -35,7 +35,7 @@ def parseCmdLine(): metavar="maxEvents", default=1000000) - (options, args) = parser.parse_args() + options,_ = parser.parse_args() return options diff --git a/examples/SimpleSubscriptionIntervalExample.py b/examples/SimpleSubscriptionIntervalExample.py index dd472a8..72b477d 100644 --- a/examples/SimpleSubscriptionIntervalExample.py +++ b/examples/SimpleSubscriptionIntervalExample.py @@ -36,7 +36,7 @@ def parseCmdLine(): metavar="maxEvents", default=1000000) - (options, args) = parser.parse_args() + options,_ = parser.parse_args() return options diff --git a/examples/SnapshotRequestTemplateExample.py b/examples/SnapshotRequestTemplateExample.py index 7086c28..1206662 100644 --- a/examples/SnapshotRequestTemplateExample.py +++ b/examples/SnapshotRequestTemplateExample.py @@ -2,7 +2,6 @@ from __future__ import print_function from __future__ import absolute_import -import datetime from optparse import OptionParser, OptionValueError import os @@ -15,7 +14,7 @@ else: import blpapi -def authOptionCallback(option, opt, value, parser): +def authOptionCallback(_option, _opt, value, parser): """Parse authorization options from user input""" vals = value.split('=', 1) @@ -130,7 +129,6 @@ def parseCmdLine(): def main(): """main entry point""" - global options options = parseCmdLine() # Fill SessionOptions diff --git a/examples/SubscriptionCorrelationExample.py b/examples/SubscriptionCorrelationExample.py index 6e855ae..82925b3 100644 --- a/examples/SubscriptionCorrelationExample.py +++ b/examples/SubscriptionCorrelationExample.py @@ -19,7 +19,7 @@ def __init__(self, name, securities): self.name = name self.securities = securities - def processSecurityUpdate(self, msg, row): + def processSecurityUpdate(self, _msg, row): topicName = self.securities[row] print("%s:%s,%s" % (self.name, row, topicName)) @@ -45,7 +45,7 @@ def parseCmdLine(): metavar="maxEvents", default=1000000) - (options, args) = parser.parse_args() + options,_ = parser.parse_args() return options diff --git a/examples/SubscriptionWithEventHandlerExample.py b/examples/SubscriptionWithEventHandlerExample.py index d3688a7..f9754a4 100644 --- a/examples/SubscriptionWithEventHandlerExample.py +++ b/examples/SubscriptionWithEventHandlerExample.py @@ -74,7 +74,7 @@ def processMiscEvents(self, event): for msg in event: print("%s: %s" % (timeStamp, msg.messageType())) - def processEvent(self, event, session): + def processEvent(self, event, _session): try: if event.eventType() == blpapi.Event.SUBSCRIPTION_DATA: return self.processSubscriptionDataEvent(event) @@ -120,7 +120,7 @@ def parseCmdLine(): action="append", default=[]) - (options, args) = parser.parse_args() + options,_ = parser.parse_args() if not options.topics: options.topics = ["IBM US Equity"] diff --git a/setup.cfg b/setup.cfg index 50902e0..766ca3f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,16 @@ [bdist_rpm] -doc_files = README examples changelog.txt NOTES +doc_files = + README + examples + changelog.txt + NOTES + +[metadata] +license_files = + License.txt + cpp-licenses/LICENSE.openssl + cpp-licenses/License.inteldfp + cpp-licenses/License.blpapi-cpp [egg_info] tag_build = diff --git a/setup.py b/setup.py index cf144dd..1877049 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ import re import codecs -from sys import version +from sys import argv, version from setuptools import setup, Extension os.chdir(os.path.dirname(os.path.realpath(__file__))) @@ -17,7 +17,7 @@ def find_version_number(): """Load the version number from blpapi/version.py""" - version_path = os.path.abspath(os.path.join('blpapi', 'version.py')) + version_path = os.path.abspath(os.path.join('src', 'blpapi', 'version.py')) version_file = None with codecs.open(version_path, 'r') as fp: version_file = fp.read() @@ -62,6 +62,7 @@ def lib_in_release(): blpapiLibraryName = 'blpapi3_32' extraLinkArgs = [] +package_data = {} if platform == 'windows': extraLinkArgs = ['/MANIFEST'] @@ -72,12 +73,18 @@ def lib_in_release(): ('VS100COMNTOOLS' in os.environ): os.environ['VS90COMNTOOLS'] = os.environ['VS100COMNTOOLS'] + if 'bdist_wheel' in argv: + # get src/blpapi/*.dll + package_data = { + "blpapi": ["blpapi3_64.dll" if is64bit else "blpapi3_32.dll"] + } + blpapiLibraryPath = blpapiLibVar or os.path.join(blpapiRoot, lib_in_release()) blpapiIncludes = blpapiIncludesVar or os.path.join(blpapiRoot, 'include') blpapi_wrap = Extension( 'blpapi._internals', - sources=['blpapi/internals_wrap.c'], + sources=['src/blpapi/internals_wrap.c'], include_dirs=[blpapiIncludes], library_dirs=[blpapiLibraryPath], libraries=[blpapiLibraryName], @@ -86,7 +93,7 @@ def lib_in_release(): versionhelper_wrap = Extension( 'blpapi._versionhelper', - sources=['blpapi/versionhelper_wrap.c'], + sources=['src/blpapi/versionhelper_wrap.c'], include_dirs=[blpapiIncludes], library_dirs=[blpapiLibraryPath], libraries=[blpapiLibraryName], @@ -102,6 +109,8 @@ def lib_in_release(): ext_modules=[blpapi_wrap, versionhelper_wrap], url='http://www.bloomberglabs.com/api/', packages=["blpapi", "blpapi.test"], + package_dir={'': 'src'}, + package_data=package_data, classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', diff --git a/blpapi/__init__.py b/src/blpapi/__init__.py similarity index 79% rename from blpapi/__init__.py rename to src/blpapi/__init__.py index 8ebb030..aa09425 100644 --- a/blpapi/__init__.py +++ b/src/blpapi/__init__.py @@ -3,6 +3,24 @@ # pylint: disable=missing-docstring,redefined-builtin,wildcard-import # pylint: disable=raise-missing-from +# pylint: disable=no-member +import platform +if platform.system().lower() == 'windows': + import glob + import os + + blpapi_dir = os.path.abspath(os.path.dirname(__file__)) + is_64bit = platform.architecture()[0].startswith("64") + dll_glob = "*64.dll" if is_64bit else "*32.dll" + + # Attempt to read dlls at the root of blpapi installation + # We do not copy the dlls for the source distribution so they are not + # guaranteed to be there. + # In that case, the next block is going to be skipped entirely. + for filename in glob.glob(os.path.join(blpapi_dir, dll_glob)): + from ctypes import CDLL + CDLL(os.path.abspath(filename)) + try: from .internals import CorrelationId except ImportError as error: diff --git a/blpapi/abstractsession.py b/src/blpapi/abstractsession.py similarity index 96% rename from blpapi/abstractsession.py rename to src/blpapi/abstractsession.py index b74ef93..ff9b776 100644 --- a/blpapi/abstractsession.py +++ b/src/blpapi/abstractsession.py @@ -16,7 +16,7 @@ cannot contain the character '/'. """ -# pylint: disable=protected-access,useless-object-inheritance +# pylint: disable=protected-access from . import exception from .exception import _ExceptionUtil @@ -27,9 +27,10 @@ from . import utils from .utils import get_handle from .compat import with_metaclass +from .chandle import CHandle @with_metaclass(utils.MetaClassForClassesWithEnums) -class AbstractSession(object): +class AbstractSession(CHandle): """A common interface shared between publish and consumer sessions. This class provides an abstract session which defines shared interface @@ -84,7 +85,7 @@ class AbstractSession(object): ``nextEvent()``. """ - def __init__(self, handle=None): + def __init__(self, handle=None, dtor=None): """Instantiate an :class:`AbstractSession` with the specified handle. Args: @@ -101,6 +102,7 @@ def __init__(self, handle=None): if self.__class__ is AbstractSession: raise NotImplementedError("Don't instantiate this class directly.\ Create sessions using one of the concrete subclasses of this class.") + super(AbstractSession, self).__init__(handle, dtor) self.__handle = handle def openService(self, serviceName): @@ -224,14 +226,14 @@ def sendAuthorizationRequest(self, return correlationId def cancel(self, correlationId): - """Cancel ``correlationId`` request. + """Cancel request(s) with a single ``correlationId`` or a list. Args: - correlationId (CorrelationId or [CorrelationId]): Correlation id - associated with the request to cancel + correlationId (CorrelationId or [CorrelationId]): Correlation id(s) + associated with the request(s) to cancel - If the specified ``correlationId`` identifies a current - request then cancel that request. + For all specified ``correlationId`` values that identify + an ongoing request cancel that request. Once this call returns the specified ``correlationId`` will not be seen in any subsequent :class:`Message` obtained from a @@ -245,12 +247,14 @@ def cancel(self, correlationId): as this method returns it is preferable not to aggressively re-use correlation IDs, particularly with an asynchronous Session. """ - + if isinstance(correlationId, list): + cids = correlationId + else: + cids = [correlationId] _ExceptionUtil.raiseOnError(internals.blpapi_AbstractSession_cancel( self.__handle, - get_handle(correlationId), - 1, # number of correlation IDs supplied - None)) # no request label + cids, + None)) # no request label def generateToken(self, correlationId=None, eventQueue=None, authId=None, ipAddress=None): diff --git a/blpapi/auth.py b/src/blpapi/auth.py similarity index 89% rename from blpapi/auth.py rename to src/blpapi/auth.py index a52c23d..e430fa5 100644 --- a/blpapi/auth.py +++ b/src/blpapi/auth.py @@ -5,9 +5,9 @@ from blpapi import internals from blpapi.utils import get_handle from blpapi.exception import _ExceptionUtil +from .chandle import CHandle - -class AuthOptions: +class AuthOptions(CHandle): """Defines the authorization options which the user can set on :class:`SessionOptions` as the authorization options for the session identity or use to authorize other identities. @@ -15,9 +15,13 @@ class AuthOptions: def __init__(self, handle, **kwargs): """For internal use only.""" + super(AuthOptions, self).__init__(handle, None) self.__handle = handle self.__app_handle = kwargs.get("app_handle") self.__token_handle = kwargs.get("token_handle") + self._options_dtor = internals.blpapi_AuthOptions_destroy + self._app_dtor = internals.blpapi_AuthApplication_destroy + self._token_dtor = internals.blpapi_AuthToken_destroy @classmethod def createWithUser(cls, user): @@ -97,28 +101,18 @@ def createWithUserAndApp(cls, user, appName): _ExceptionUtil.raiseOnError(retcode) return cls(authOptions_handle, app_handle=app_handle) - def __del__(self): - try: - self.destroy() - except (NameError, AttributeError): - pass - def destroy(self): """Destroy this :class:`AuthOptions`.""" if self.__handle: - internals.blpapi_AuthOptions_destroy(self.__handle) + self._options_dtor(self.__handle) self.__handle = None if self.__app_handle: - internals.blpapi_AuthApplication_destroy(self.__app_handle) + self._app_dtor(self.__app_handle) self.__app_handle = None if self.__token_handle: - internals.blpapi_AuthToken_destroy(self.__token_handle) + self._token_dtor(self.__token_handle) self.__token_handle = None - def _handle(self): - """For internal use only.""" - return self.__handle - @staticmethod def _create_app_handle(appName): """For internal use only.""" @@ -136,25 +130,15 @@ def _create_token_handle(token): return token_handle -class AuthUser: +class AuthUser(CHandle): """Contains user-specific authorization options.""" def __init__(self, handle): """For internal use only.""" + super(AuthUser, self).__init__( + handle, internals.blpapi_AuthUser_destroy) self.__handle = handle - def __del__(self): - try: - self.destroy() - except (NameError, AttributeError): - pass - - def destroy(self): - """Destroy this :class:`AuthUser`.""" - if self.__handle: - internals.blpapi_AuthUser_destroy(self.__handle) - self.__handle = None - @classmethod def createWithLogonName(cls): """Creates an :class:`AuthUser` instance configured for Operating @@ -209,11 +193,6 @@ def createWithManualOptions(cls, userId, ipAddress): _ExceptionUtil.raiseOnError(retcode) return cls(handle) - def _handle(self): - """For internal use only.""" - return self.__handle - - __copyright__ = """ Copyright 2020. Bloomberg Finance L.P. diff --git a/src/blpapi/chandle.py b/src/blpapi/chandle.py new file mode 100644 index 0000000..2a72426 --- /dev/null +++ b/src/blpapi/chandle.py @@ -0,0 +1,55 @@ +# chandle.py + +"""A module which defines base class for blpapi classes. + +This file defines a 'CHandle' class. +It handles the life of an object with a handle from C layer. +""" + +# pylint: disable=useless-object-inheritance + +class CHandle(object): + """A base class for objects that rely on C handles""" + + def __init__(self, handle, dtor): + """ Set the handle and the dtor """ + self.__handle = handle + self._dtor = dtor + + def __del__(self): + """ Destroy the object """ + try: + self.destroy() + except (NameError, AttributeError): + pass + + def destroy(self): + """ Destroy the handle using stored dtor """ + if self.__handle: + self._dtor(self.__handle) + self.__handle = None + + def _handle(self): + """Return the internal implementation.""" + return self.__handle + +__copyright__ = """ +Copyright 2020. Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, co, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above +copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/blpapi/compat.py b/src/blpapi/compat.py similarity index 100% rename from blpapi/compat.py rename to src/blpapi/compat.py diff --git a/blpapi/constant.py b/src/blpapi/constant.py similarity index 100% rename from blpapi/constant.py rename to src/blpapi/constant.py diff --git a/blpapi/datatype.py b/src/blpapi/datatype.py similarity index 100% rename from blpapi/datatype.py rename to src/blpapi/datatype.py diff --git a/blpapi/datetime.py b/src/blpapi/datetime.py similarity index 100% rename from blpapi/datetime.py rename to src/blpapi/datetime.py diff --git a/blpapi/debug.py b/src/blpapi/debug.py similarity index 100% rename from blpapi/debug.py rename to src/blpapi/debug.py diff --git a/blpapi/debug_environment.py b/src/blpapi/debug_environment.py similarity index 100% rename from blpapi/debug_environment.py rename to src/blpapi/debug_environment.py diff --git a/blpapi/diagnosticsutil.py b/src/blpapi/diagnosticsutil.py similarity index 100% rename from blpapi/diagnosticsutil.py rename to src/blpapi/diagnosticsutil.py diff --git a/blpapi/element.py b/src/blpapi/element.py similarity index 100% rename from blpapi/element.py rename to src/blpapi/element.py diff --git a/blpapi/event.py b/src/blpapi/event.py similarity index 86% rename from blpapi/event.py rename to src/blpapi/event.py index 56850c9..9d3cab1 100644 --- a/blpapi/event.py +++ b/src/blpapi/event.py @@ -38,10 +38,9 @@ from . import utils from .utils import get_handle from .compat import with_metaclass +from .chandle import CHandle -# pylint: disable=useless-object-inheritance - -class MessageIterator(object): +class MessageIterator(CHandle): """An iterator over the :class:`Message` objects within an :class:`Event`. Few clients will ever make direct use of :class:`MessageIterator` objects; @@ -50,21 +49,13 @@ class MessageIterator(object): """ def __init__(self, event): - self.__handle = \ - internals.blpapi_MessageIterator_create(get_handle(event)) + selfhandle = internals.blpapi_MessageIterator_create(get_handle(event)) + super(MessageIterator, self).__init__( + selfhandle, + internals.blpapi_MessageIterator_destroy) + self.__handle = selfhandle self.__event = event - def __del__(self): - try: - self.destroy() - except (NameError, AttributeError): - pass - - def destroy(self): - if self.__handle: - internals.blpapi_MessageIterator_destroy(self.__handle) - self.__handle = None - def __iter__(self): return self @@ -79,7 +70,7 @@ def __next__(self): @with_metaclass(utils.MetaClassForClassesWithEnums) -class Event(object): +class Event(CHandle): """A single event resulting from a subscription or a request. :class:`Event` objects are created by the API and passed to the application @@ -133,21 +124,10 @@ class Event(object): """Unknown event""" def __init__(self, handle, sessions): + super(Event, self).__init__(handle, internals.blpapi_Event_release) self.__handle = handle self.__sessions = sessions - def __del__(self): - try: - self.destroy() - except (NameError, AttributeError): - pass - - def destroy(self): - """Destructor""" - if self.__handle: - internals.blpapi_Event_release(self.__handle) - self.__handle = None - def eventType(self): """ Returns: @@ -162,10 +142,6 @@ def __iter__(self): """ return MessageIterator(self) - def _handle(self): - """Return the internal implementation.""" - return self.__handle - def _sessions(self): """Return session(s) that this 'Event' is related to. @@ -176,7 +152,7 @@ def _sessions(self): # derived from this class from changes: -class EventQueue(object): +class EventQueue(CHandle): """A construct used to handle replies to request synchronously. When a request is submitted an application can either handle the responses @@ -191,21 +167,13 @@ def __init__(self): :meth:`~Session.sendRequest()` and :meth:`~Session.sendAuthorizationRequest()` methods. """ - self.__handle = internals.blpapi_EventQueue_create() + selfhandle = internals.blpapi_EventQueue_create() + super(EventQueue, self).__init__( + selfhandle, + internals.blpapi_EventQueue_destroy) + self.__handle = selfhandle self.__sessions = set() - def __del__(self): - try: - self.destroy() - except (NameError, AttributeError): - pass - - def destroy(self): - """Destructor.""" - if self.__handle: - internals.blpapi_EventQueue_destroy(self.__handle) - self.__handle = None - def nextEvent(self, timeout=0): """ Args: @@ -245,10 +213,6 @@ def purge(self): internals.blpapi_EventQueue_purge(self.__handle) self.__sessions.clear() - def _handle(self): - """Return the internal implementation. For internal use.""" - return self.__handle - def _registerSession(self, session): """Add a new session to this 'EventQueue'. For internal use.""" self.__sessions.add(session) diff --git a/blpapi/eventdispatcher.py b/src/blpapi/eventdispatcher.py similarity index 86% rename from blpapi/eventdispatcher.py rename to src/blpapi/eventdispatcher.py index 6fc8f76..a1a1f9e 100644 --- a/blpapi/eventdispatcher.py +++ b/src/blpapi/eventdispatcher.py @@ -8,10 +8,9 @@ import warnings from . import internals +from .chandle import CHandle -# pylint: disable=useless-object-inheritance - -class EventDispatcher(object): +class EventDispatcher(CHandle): """Dispatches events from one or more Sessions through callbacks :class:`EventDispatcher` objects are optionally specified when Session @@ -36,21 +35,11 @@ def __init__(self, numDispatcherThreads=1): ``numDispatcherThreads`` threads is created to dispatch events. The behavior is undefined if ``numDispatcherThreads`` is ``0``. """ - - self.__handle = internals.blpapi_EventDispatcher_create( - numDispatcherThreads) - - def __del__(self): - try: - self.destroy() - except (NameError, AttributeError): - pass - - def destroy(self): - """Destructor.""" - if self.__handle: - internals.blpapi_EventDispatcher_destroy(self.__handle) - self.__handle = None + selfhandle = internals.blpapi_EventDispatcher_create(numDispatcherThreads) + super(EventDispatcher, self).__init__( + selfhandle, + internals.blpapi_EventDispatcher_destroy) + self.__handle = selfhandle def start(self): """Start generating callbacks for events from sessions associated with @@ -92,10 +81,6 @@ def stop(self, async_=False, **kwargs): return internals.blpapi_EventDispatcher_stop(self.__handle, async_) - def _handle(self): - """Return the internal implementation.""" - return self.__handle - __copyright__ = """ Copyright 2012. Bloomberg Finance L.P. diff --git a/blpapi/eventformatter.py b/src/blpapi/eventformatter.py similarity index 95% rename from blpapi/eventformatter.py rename to src/blpapi/eventformatter.py index 9233aed..f866430 100644 --- a/blpapi/eventformatter.py +++ b/src/blpapi/eventformatter.py @@ -5,17 +5,15 @@ This component adds messages to an Event which can be later published. """ - - -from .exception import _ExceptionUtil +from .exception import _ExceptionUtil, InvalidConversionException from .datetime import _DatetimeUtil from .message import Message from .name import Name, getNamePair from . import internals from .utils import get_handle, invoke_if_valid +from .chandle import CHandle -#pylint: disable=useless-object-inheritance -class EventFormatter(object): +class EventFormatter(CHandle): """:class:`EventFormatter` is used to populate :class:`Event`\ s for publishing. @@ -91,7 +89,8 @@ def __getTraits(value): return EventFormatter.__int32Traits if -(2 ** 63) <= value <= (2 ** 63 - 1): return EventFormatter.__int64Traits - raise ValueError("value is out of supported range") + raise InvalidConversionException( + "Value is out of supported range (INT64): {}".format(value), 0) if isinstance(value, float): return EventFormatter.__floatTraits if _DatetimeUtil.isDatetime(value): @@ -112,21 +111,11 @@ def __init__(self, event): referencing the same :class:`Event` will result in an exception being raised. """ - - self.__handle = internals.blpapi_EventFormatter_create( - get_handle(event)) - - def __del__(self): - try: - self.destroy() - except (NameError, AttributeError): - pass - - def destroy(self): - """Destroy this :class:`EventFormatter` object.""" - if self.__handle: - internals.blpapi_EventFormatter_destroy(self.__handle) - self.__handle = None + selfhandle = internals.blpapi_EventFormatter_create(get_handle(event)) + super(EventFormatter, self).__init__( + selfhandle, + internals.blpapi_EventFormatter_destroy) + self.__handle = selfhandle def appendMessage(self, messageType, topic, sequenceNumber=None): """Append an (empty) message to the :class:`Event` referenced by this @@ -370,10 +359,6 @@ def appendElement(self): _ExceptionUtil.raiseOnError( internals.blpapi_EventFormatter_appendElement(self.__handle)) - def _handle(self): - """Return the internal implementation.""" - return self.__handle - __copyright__ = """ Copyright 2012. Bloomberg Finance L.P. diff --git a/blpapi/exception.py b/src/blpapi/exception.py similarity index 100% rename from blpapi/exception.py rename to src/blpapi/exception.py diff --git a/blpapi/highresclock.py b/src/blpapi/highresclock.py similarity index 100% rename from blpapi/highresclock.py rename to src/blpapi/highresclock.py diff --git a/blpapi/identity.py b/src/blpapi/identity.py similarity index 92% rename from blpapi/identity.py rename to src/blpapi/identity.py index 743438c..b83b205 100644 --- a/blpapi/identity.py +++ b/src/blpapi/identity.py @@ -12,11 +12,10 @@ from . import utils from .utils import get_handle from .compat import with_metaclass - -# pylint: disable=useless-object-inheritance +from .chandle import CHandle @with_metaclass(utils.MetaClassForClassesWithEnums) -class Identity(object): +class Identity(CHandle): """Provides access to the entitlements for a specific user. An unauthorized Identity is created using @@ -49,26 +48,12 @@ def __init__(self, handle, sessions): handle: Handle to the internal implementation sessions: Sessions associated with this object """ + super(Identity, self).__init__( + handle, internals.blpapi_Identity_release) self.__handle = handle self.__sessions = sessions internals.blpapi_Identity_addRef(self.__handle) - def __del__(self): - try: - self.destroy() - except (NameError, AttributeError): - pass - - def destroy(self): - """Destructor. - - Destroying the last :class:`Identity` for a specific user cancels any - authorizations associated with it. - """ - if self.__handle: - internals.blpapi_Identity_release(self.__handle) - self.__handle = None - def hasEntitlements(self, service, entitlements): """ Args: @@ -186,10 +171,6 @@ def getSeatType(self): _ExceptionUtil.raiseOnError(res[0]) return res[1] - def _handle(self): - """Return the internal implementation.""" - return self.__handle - # Protect enumeration constant(s) defined in this class and in classes # derived from this class from changes: diff --git a/blpapi/internals.py b/src/blpapi/internals.py similarity index 61% rename from blpapi/internals.py rename to src/blpapi/internals.py index 569aad8..1daa275 100644 --- a/blpapi/internals.py +++ b/src/blpapi/internals.py @@ -1,5 +1,5 @@ # This file was automatically generated by SWIG (http://www.swig.org). -# Version 3.0.12 +# Version 4.0.1 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. @@ -28,97 +28,62 @@ IN THE SOFTWARE. """ - from sys import version_info as _swig_python_version_info -if _swig_python_version_info >= (2, 7, 0): - def swig_import_helper(): - import importlib - pkg = __name__.rpartition('.')[0] - mname = '.'.join((pkg, '_internals')).lstrip('.') - try: - return importlib.import_module(mname) - except ImportError: - return importlib.import_module('_internals') - _internals = swig_import_helper() - del swig_import_helper -elif _swig_python_version_info >= (2, 6, 0): - def swig_import_helper(): - from os.path import dirname - import imp - fp = None - try: - fp, pathname, description = imp.find_module('_internals', [dirname(__file__)]) - except ImportError: - import _internals - return _internals - try: - _mod = imp.load_module('_internals', fp, pathname, description) - finally: - if fp is not None: - fp.close() - return _mod - _internals = swig_import_helper() - del swig_import_helper +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 _internals else: import _internals -del _swig_python_version_info - -try: - _swig_property = property -except NameError: - pass # Python < 2.2 doesn't have 'property'. try: import builtins as __builtin__ except ImportError: import __builtin__ -def _swig_setattr_nondynamic(self, class_type, name, value, static=1): - if (name == "thisown"): - return self.this.own(value) - if (name == "this"): - if type(value).__name__ == 'SwigPyObject': - self.__dict__[name] = value - return - method = class_type.__swig_setmethods__.get(name, None) - if method: - return method(self, value) - if (not static): - if _newclass: - object.__setattr__(self, name, value) +def _swig_repr(self): + try: + strthis = "proxy of " + self.this.__repr__() + except __builtin__.Exception: + strthis = "" + return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) + + +def _swig_setattr_nondynamic_instance_variable(set): + def set_instance_attr(self, name, value): + if name == "thisown": + self.this.own(value) + elif name == "this": + set(self, name, value) + elif hasattr(self, name) and isinstance(getattr(type(self), name), property): + set(self, name, value) else: - self.__dict__[name] = value - else: - raise AttributeError("You cannot add attributes to %s" % self) + raise AttributeError("You cannot add instance attributes to %s" % self) + return set_instance_attr -def _swig_setattr(self, class_type, name, value): - return _swig_setattr_nondynamic(self, class_type, name, value, 0) +def _swig_setattr_nondynamic_class_variable(set): + def set_class_attr(cls, name, value): + if hasattr(cls, name) and not isinstance(getattr(cls, name), property): + set(cls, name, value) + else: + raise AttributeError("You cannot add class attributes to %s" % cls) + return set_class_attr -def _swig_getattr(self, class_type, name): - if (name == "thisown"): - return self.this.own() - method = class_type.__swig_getmethods__.get(name, None) - if method: - return method(self) - raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name)) +def _swig_add_metaclass(metaclass): + """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass""" + def wrapper(cls): + return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy()) + return wrapper -def _swig_repr(self): - try: - strthis = "proxy of " + self.this.__repr__() - except __builtin__.Exception: - strthis = "" - return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) +class _SwigNonDynamicMeta(type): + """Meta class to enforce nondynamic attributes (no new attributes) for a class""" + __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__) -try: - _object = object - _newclass = 1 -except __builtin__.Exception: - class _object: - pass - _newclass = 0 ELEMENTDEFINITION_UNBOUNDED = _internals.ELEMENTDEFINITION_UNBOUNDED ELEMENT_INDEX_END = _internals.ELEMENT_INDEX_END @@ -230,94 +195,67 @@ class _object: def setLoggerCallbackWrapper(cb, severity): return _internals.setLoggerCallbackWrapper(cb, severity) -setLoggerCallbackWrapper = _internals.setLoggerCallbackWrapper def blpapi_HighPrecisionDatetime_fromTimePoint_wrapper(original): return _internals.blpapi_HighPrecisionDatetime_fromTimePoint_wrapper(original) -blpapi_HighPrecisionDatetime_fromTimePoint_wrapper = _internals.blpapi_HighPrecisionDatetime_fromTimePoint_wrapper def blpapi_Logging_registerCallback(callback, thresholdSeverity): return _internals.blpapi_Logging_registerCallback(callback, thresholdSeverity) -blpapi_Logging_registerCallback = _internals.blpapi_Logging_registerCallback def blpapi_Logging_logTestMessage(severity): return _internals.blpapi_Logging_logTestMessage(severity) -blpapi_Logging_logTestMessage = _internals.blpapi_Logging_logTestMessage def blpapi_DiagnosticsUtil_memoryInfo_wrapper(): return _internals.blpapi_DiagnosticsUtil_memoryInfo_wrapper() -blpapi_DiagnosticsUtil_memoryInfo_wrapper = _internals.blpapi_DiagnosticsUtil_memoryInfo_wrapper def blpapi_EventDispatcher_stop(handle, asynch): return _internals.blpapi_EventDispatcher_stop(handle, asynch) -blpapi_EventDispatcher_stop = _internals.blpapi_EventDispatcher_stop def blpapi_Service_printHelper(service, level, spacesPerLevel): return _internals.blpapi_Service_printHelper(service, level, spacesPerLevel) -blpapi_Service_printHelper = _internals.blpapi_Service_printHelper def blpapi_SchemaElementDefinition_printHelper(item, level, spacesPerLevel): return _internals.blpapi_SchemaElementDefinition_printHelper(item, level, spacesPerLevel) -blpapi_SchemaElementDefinition_printHelper = _internals.blpapi_SchemaElementDefinition_printHelper def blpapi_SchemaTypeDefinition_printHelper(item, level, spacesPerLevel): return _internals.blpapi_SchemaTypeDefinition_printHelper(item, level, spacesPerLevel) -blpapi_SchemaTypeDefinition_printHelper = _internals.blpapi_SchemaTypeDefinition_printHelper def blpapi_Message_printHelper(message, level, spacesPerLevel): return _internals.blpapi_Message_printHelper(message, level, spacesPerLevel) -blpapi_Message_printHelper = _internals.blpapi_Message_printHelper def blpapi_SessionOptions_printHelper(sessionOptions, level, spacesPerLevel): return _internals.blpapi_SessionOptions_printHelper(sessionOptions, level, spacesPerLevel) -blpapi_SessionOptions_printHelper = _internals.blpapi_SessionOptions_printHelper def blpapi_TestUtil_serializeServiceHelper(service): return _internals.blpapi_TestUtil_serializeServiceHelper(service) -blpapi_TestUtil_serializeServiceHelper = _internals.blpapi_TestUtil_serializeServiceHelper def blpapi_SchemaTypeDefinition_hasElementDefinition(type, nameString, name): return _internals.blpapi_SchemaTypeDefinition_hasElementDefinition(type, nameString, name) -blpapi_SchemaTypeDefinition_hasElementDefinition = _internals.blpapi_SchemaTypeDefinition_hasElementDefinition def blpapi_ConstantList_hasConstant(list, nameString, name): return _internals.blpapi_ConstantList_hasConstant(list, nameString, name) -blpapi_ConstantList_hasConstant = _internals.blpapi_ConstantList_hasConstant def blpapi_Service_hasEventDefinition(service, nameString, name): return _internals.blpapi_Service_hasEventDefinition(service, nameString, name) -blpapi_Service_hasEventDefinition = _internals.blpapi_Service_hasEventDefinition def blpapi_Service_hasOperation(service, nameString, name): return _internals.blpapi_Service_hasOperation(service, nameString, name) -blpapi_Service_hasOperation = _internals.blpapi_Service_hasOperation def blpapi_SubscriptionList_addHelper(list, topic, correlationId, fields, options): return _internals.blpapi_SubscriptionList_addHelper(list, topic, correlationId, fields, options) -blpapi_SubscriptionList_addHelper = _internals.blpapi_SubscriptionList_addHelper def blpapi_Name_hasName(nameString): return _internals.blpapi_Name_hasName(nameString) -blpapi_Name_hasName = _internals.blpapi_Name_hasName - -def blpapi_TopicList_createFromResolutionList(arg1): - return _internals.blpapi_TopicList_createFromResolutionList(arg1) -blpapi_TopicList_createFromResolutionList = _internals.blpapi_TopicList_createFromResolutionList -class intArray(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, intArray, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, intArray, name) + +def blpapi_TopicList_createFromResolutionList(_from): + return _internals.blpapi_TopicList_createFromResolutionList(_from) +class intArray(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, nelements): - this = _internals.new_intArray(nelements) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this + _internals.intArray_swiginit(self, _internals.new_intArray(nelements)) __swig_destroy__ = _internals.delete_intArray - __del__ = lambda self: None def __getitem__(self, index): return _internals.intArray___getitem__(self, index) @@ -327,39 +265,34 @@ def __setitem__(self, index, value): def cast(self): return _internals.intArray_cast(self) - if _newclass: - frompointer = staticmethod(_internals.intArray_frompointer) - else: - frompointer = _internals.intArray_frompointer -intArray_swigregister = _internals.intArray_swigregister -intArray_swigregister(intArray) + + @staticmethod + def frompointer(t): + return _internals.intArray_frompointer(t) + +# Register intArray in _internals: +_internals.intArray_swigregister(intArray) def intArray_frompointer(t): return _internals.intArray_frompointer(t) -intArray_frompointer = _internals.intArray_frompointer def new_topicPtrArray(nelements): return _internals.new_topicPtrArray(nelements) -new_topicPtrArray = _internals.new_topicPtrArray def delete_topicPtrArray(ary): return _internals.delete_topicPtrArray(ary) -delete_topicPtrArray = _internals.delete_topicPtrArray def topicPtrArray_getitem(ary, index): return _internals.topicPtrArray_getitem(ary, index) -topicPtrArray_getitem = _internals.topicPtrArray_getitem def topicPtrArray_setitem(ary, index, value): return _internals.topicPtrArray_setitem(ary, index, value) -topicPtrArray_setitem = _internals.topicPtrArray_setitem def CorrelationId_t_equals(cid1, cid2): return _internals.CorrelationId_t_equals(cid1, cid2) -CorrelationId_t_equals = _internals.CorrelationId_t_equals -class CorrelationId(_object): - """ +class CorrelationId(object): + r""" A key used to identify individual subscriptions or requests. Two :class:`CorrelationId` objects are considered equal if they have the same @@ -392,14 +325,9 @@ class CorrelationId(_object): :class:`CorrelationId`. """ - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, CorrelationId, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, CorrelationId, name) + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr - __swig_getmethods__["value"] = _internals.CorrelationId_value_get - if _newclass: - value = _swig_property(_internals.CorrelationId_value_get) + value = property(_internals.CorrelationId_value_get) UNSET_TYPE = _internals.CORRELATION_TYPE_UNSET """The :class:`CorrelationId` is unset. That is, it was created by the @@ -429,7 +357,7 @@ class CorrelationId(_object): def __str__(self): """x.__str__() <==> str(x)""" valueType = self.type() - valueTypeName = CorrelationId.__TYPE_NAMES[valueType] + valueTypeName = CorrelationId.__TYPE_NAMES[valueType] if valueType == CorrelationId.UNSET_TYPE: return valueTypeName @@ -479,7 +407,7 @@ def _handle(self): def __init__(self, *args): - """ + r""" ``CorrelationId([value[, classId=0]])`` constructs a :class:`CorrelationId` object. @@ -491,32 +419,25 @@ def __init__(self, *args): The maximum allowed ``classId`` value is :attr:`MAX_CLASS_ID`. """ - this = _internals.new_CorrelationId(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this + _internals.CorrelationId_swiginit(self, _internals.new_CorrelationId(*args)) __swig_destroy__ = _internals.delete_CorrelationId - __del__ = lambda self: None def type(self): - """ + r""" Returns: int: The type of this CorrelationId object (see the ``xxx_TYPE`` class attributes) """ return _internals.CorrelationId_type(self) - def classId(self): - """ + r""" Returns: int: The user defined classification of this :class:`CorrelationId` object """ return _internals.CorrelationId_classId(self) - def __asObject(self): return _internals.CorrelationId___asObject(self) @@ -525,555 +446,417 @@ def __asInteger(self): def __toInteger(self): return _internals.CorrelationId___toInteger(self) -CorrelationId_swigregister = _internals.CorrelationId_swigregister -CorrelationId_swigregister(CorrelationId) - -class blpapi_CorrelationId_t__value(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, blpapi_CorrelationId_t__value, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, blpapi_CorrelationId_t__value, name) + +# Register CorrelationId in _internals: +_internals.CorrelationId_swigregister(CorrelationId) + +class blpapi_CorrelationId_t__value(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): - this = _internals.new_blpapi_CorrelationId_t__value() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this + _internals.blpapi_CorrelationId_t__value_swiginit(self, _internals.new_blpapi_CorrelationId_t__value()) __swig_destroy__ = _internals.delete_blpapi_CorrelationId_t__value - __del__ = lambda self: None -blpapi_CorrelationId_t__value_swigregister = _internals.blpapi_CorrelationId_t__value_swigregister -blpapi_CorrelationId_t__value_swigregister(blpapi_CorrelationId_t__value) + +# Register blpapi_CorrelationId_t__value in _internals: +_internals.blpapi_CorrelationId_t__value_swigregister(blpapi_CorrelationId_t__value) def blpapi_Element_setElementFloat(element, nameString, name, value): return _internals.blpapi_Element_setElementFloat(element, nameString, name, value) -blpapi_Element_setElementFloat = _internals.blpapi_Element_setElementFloat def blpapi_Element_setValueFloat(element, value, index): return _internals.blpapi_Element_setValueFloat(element, value, index) -blpapi_Element_setValueFloat = _internals.blpapi_Element_setValueFloat def blpapi_Element_printHelper(element, level, spacesPerLevel): return _internals.blpapi_Element_printHelper(element, level, spacesPerLevel) -blpapi_Element_printHelper = _internals.blpapi_Element_printHelper def blpapi_Element_name(element): return _internals.blpapi_Element_name(element) -blpapi_Element_name = _internals.blpapi_Element_name def blpapi_Element_nameString(element): return _internals.blpapi_Element_nameString(element) -blpapi_Element_nameString = _internals.blpapi_Element_nameString def blpapi_Element_definition(element): return _internals.blpapi_Element_definition(element) -blpapi_Element_definition = _internals.blpapi_Element_definition def blpapi_Element_datatype(element): return _internals.blpapi_Element_datatype(element) -blpapi_Element_datatype = _internals.blpapi_Element_datatype def blpapi_Element_isComplexType(element): return _internals.blpapi_Element_isComplexType(element) -blpapi_Element_isComplexType = _internals.blpapi_Element_isComplexType def blpapi_Element_isArray(element): return _internals.blpapi_Element_isArray(element) -blpapi_Element_isArray = _internals.blpapi_Element_isArray def blpapi_Element_isReadOnly(element): return _internals.blpapi_Element_isReadOnly(element) -blpapi_Element_isReadOnly = _internals.blpapi_Element_isReadOnly def blpapi_Element_numValues(element): return _internals.blpapi_Element_numValues(element) -blpapi_Element_numValues = _internals.blpapi_Element_numValues def blpapi_Element_numElements(element): return _internals.blpapi_Element_numElements(element) -blpapi_Element_numElements = _internals.blpapi_Element_numElements def blpapi_Element_isNullValue(element, position): return _internals.blpapi_Element_isNullValue(element, position) -blpapi_Element_isNullValue = _internals.blpapi_Element_isNullValue def blpapi_Element_isNull(element): return _internals.blpapi_Element_isNull(element) -blpapi_Element_isNull = _internals.blpapi_Element_isNull def blpapi_Element_getElementAt(element, position): return _internals.blpapi_Element_getElementAt(element, position) -blpapi_Element_getElementAt = _internals.blpapi_Element_getElementAt def blpapi_Element_getElement(element, nameString, name): return _internals.blpapi_Element_getElement(element, nameString, name) -blpapi_Element_getElement = _internals.blpapi_Element_getElement def blpapi_Element_hasElementEx(element, nameString, name, excludeNullElements, reserved): return _internals.blpapi_Element_hasElementEx(element, nameString, name, excludeNullElements, reserved) -blpapi_Element_hasElementEx = _internals.blpapi_Element_hasElementEx def blpapi_Element_getValueAsBool(element, index): return _internals.blpapi_Element_getValueAsBool(element, index) -blpapi_Element_getValueAsBool = _internals.blpapi_Element_getValueAsBool def blpapi_Element_getValueAsChar(element, index): return _internals.blpapi_Element_getValueAsChar(element, index) -blpapi_Element_getValueAsChar = _internals.blpapi_Element_getValueAsChar def blpapi_Element_getValueAsInt32(element, index): return _internals.blpapi_Element_getValueAsInt32(element, index) -blpapi_Element_getValueAsInt32 = _internals.blpapi_Element_getValueAsInt32 def blpapi_Element_getValueAsInt64(element, index): return _internals.blpapi_Element_getValueAsInt64(element, index) -blpapi_Element_getValueAsInt64 = _internals.blpapi_Element_getValueAsInt64 def blpapi_Element_getValueAsFloat64(element, index): return _internals.blpapi_Element_getValueAsFloat64(element, index) -blpapi_Element_getValueAsFloat64 = _internals.blpapi_Element_getValueAsFloat64 def blpapi_Element_getValueAsString(element, index): return _internals.blpapi_Element_getValueAsString(element, index) -blpapi_Element_getValueAsString = _internals.blpapi_Element_getValueAsString def blpapi_Element_getValueAsDatetime(element, index): return _internals.blpapi_Element_getValueAsDatetime(element, index) -blpapi_Element_getValueAsDatetime = _internals.blpapi_Element_getValueAsDatetime def blpapi_Element_getValueAsHighPrecisionDatetime(element, index): return _internals.blpapi_Element_getValueAsHighPrecisionDatetime(element, index) -blpapi_Element_getValueAsHighPrecisionDatetime = _internals.blpapi_Element_getValueAsHighPrecisionDatetime def blpapi_Element_getValueAsElement(element, index): return _internals.blpapi_Element_getValueAsElement(element, index) -blpapi_Element_getValueAsElement = _internals.blpapi_Element_getValueAsElement def blpapi_Element_getValueAsName(element, index): return _internals.blpapi_Element_getValueAsName(element, index) -blpapi_Element_getValueAsName = _internals.blpapi_Element_getValueAsName def blpapi_Element_getChoice(element): return _internals.blpapi_Element_getChoice(element) -blpapi_Element_getChoice = _internals.blpapi_Element_getChoice def blpapi_Element_setValueBool(element, value, index): return _internals.blpapi_Element_setValueBool(element, value, index) -blpapi_Element_setValueBool = _internals.blpapi_Element_setValueBool def blpapi_Element_setValueInt32(element, value, index): return _internals.blpapi_Element_setValueInt32(element, value, index) -blpapi_Element_setValueInt32 = _internals.blpapi_Element_setValueInt32 def blpapi_Element_setValueInt64(element, value, index): return _internals.blpapi_Element_setValueInt64(element, value, index) -blpapi_Element_setValueInt64 = _internals.blpapi_Element_setValueInt64 def blpapi_Element_setValueString(element, value, index): return _internals.blpapi_Element_setValueString(element, value, index) -blpapi_Element_setValueString = _internals.blpapi_Element_setValueString def blpapi_Element_setValueHighPrecisionDatetime(element, value, index): return _internals.blpapi_Element_setValueHighPrecisionDatetime(element, value, index) -blpapi_Element_setValueHighPrecisionDatetime = _internals.blpapi_Element_setValueHighPrecisionDatetime def blpapi_Element_setValueFromName(element, value, index): return _internals.blpapi_Element_setValueFromName(element, value, index) -blpapi_Element_setValueFromName = _internals.blpapi_Element_setValueFromName def blpapi_Element_setElementBool(element, nameString, name, value): return _internals.blpapi_Element_setElementBool(element, nameString, name, value) -blpapi_Element_setElementBool = _internals.blpapi_Element_setElementBool def blpapi_Element_setElementInt32(element, nameString, name, value): return _internals.blpapi_Element_setElementInt32(element, nameString, name, value) -blpapi_Element_setElementInt32 = _internals.blpapi_Element_setElementInt32 def blpapi_Element_setElementInt64(element, nameString, name, value): return _internals.blpapi_Element_setElementInt64(element, nameString, name, value) -blpapi_Element_setElementInt64 = _internals.blpapi_Element_setElementInt64 def blpapi_Element_setElementString(element, nameString, name, value): return _internals.blpapi_Element_setElementString(element, nameString, name, value) -blpapi_Element_setElementString = _internals.blpapi_Element_setElementString def blpapi_Element_setElementHighPrecisionDatetime(element, nameString, name, value): return _internals.blpapi_Element_setElementHighPrecisionDatetime(element, nameString, name, value) -blpapi_Element_setElementHighPrecisionDatetime = _internals.blpapi_Element_setElementHighPrecisionDatetime def blpapi_Element_setElementFromName(element, elementName, name, buffer): return _internals.blpapi_Element_setElementFromName(element, elementName, name, buffer) -blpapi_Element_setElementFromName = _internals.blpapi_Element_setElementFromName def blpapi_Element_appendElement(element): return _internals.blpapi_Element_appendElement(element) -blpapi_Element_appendElement = _internals.blpapi_Element_appendElement def blpapi_Element_setChoice(element, nameCstr, name, index): return _internals.blpapi_Element_setChoice(element, nameCstr, name, index) -blpapi_Element_setChoice = _internals.blpapi_Element_setChoice def blpapi_EventFormatter_setValueFloat(formatter, typeString, typeName, value): return _internals.blpapi_EventFormatter_setValueFloat(formatter, typeString, typeName, value) -blpapi_EventFormatter_setValueFloat = _internals.blpapi_EventFormatter_setValueFloat def blpapi_EventFormatter_appendValueFloat(formatter, value): return _internals.blpapi_EventFormatter_appendValueFloat(formatter, value) -blpapi_EventFormatter_appendValueFloat = _internals.blpapi_EventFormatter_appendValueFloat def blpapi_EventFormatter_create(event): return _internals.blpapi_EventFormatter_create(event) -blpapi_EventFormatter_create = _internals.blpapi_EventFormatter_create def blpapi_EventFormatter_destroy(victim): return _internals.blpapi_EventFormatter_destroy(victim) -blpapi_EventFormatter_destroy = _internals.blpapi_EventFormatter_destroy def blpapi_EventFormatter_appendMessage(formatter, typeString, typeName, topic): return _internals.blpapi_EventFormatter_appendMessage(formatter, typeString, typeName, topic) -blpapi_EventFormatter_appendMessage = _internals.blpapi_EventFormatter_appendMessage def blpapi_EventFormatter_appendMessageSeq(formatter, typeString, typeName, topic, sequenceNumber, arg6): return _internals.blpapi_EventFormatter_appendMessageSeq(formatter, typeString, typeName, topic, sequenceNumber, arg6) -blpapi_EventFormatter_appendMessageSeq = _internals.blpapi_EventFormatter_appendMessageSeq def blpapi_EventFormatter_appendResponse(formatter, typeString, typeName): return _internals.blpapi_EventFormatter_appendResponse(formatter, typeString, typeName) -blpapi_EventFormatter_appendResponse = _internals.blpapi_EventFormatter_appendResponse def blpapi_EventFormatter_appendRecapMessage(formatter, topic, cid): return _internals.blpapi_EventFormatter_appendRecapMessage(formatter, topic, cid) -blpapi_EventFormatter_appendRecapMessage = _internals.blpapi_EventFormatter_appendRecapMessage def blpapi_EventFormatter_appendRecapMessageSeq(formatter, topic, cid, sequenceNumber, arg5): return _internals.blpapi_EventFormatter_appendRecapMessageSeq(formatter, topic, cid, sequenceNumber, arg5) -blpapi_EventFormatter_appendRecapMessageSeq = _internals.blpapi_EventFormatter_appendRecapMessageSeq def blpapi_EventFormatter_appendFragmentedRecapMessage(formatter, typeString, typeName, topic, cid, fragmentType): return _internals.blpapi_EventFormatter_appendFragmentedRecapMessage(formatter, typeString, typeName, topic, cid, fragmentType) -blpapi_EventFormatter_appendFragmentedRecapMessage = _internals.blpapi_EventFormatter_appendFragmentedRecapMessage def blpapi_EventFormatter_appendFragmentedRecapMessageSeq(formatter, typeString, typeName, topic, fragmentType, sequenceNumber): return _internals.blpapi_EventFormatter_appendFragmentedRecapMessageSeq(formatter, typeString, typeName, topic, fragmentType, sequenceNumber) -blpapi_EventFormatter_appendFragmentedRecapMessageSeq = _internals.blpapi_EventFormatter_appendFragmentedRecapMessageSeq def blpapi_EventFormatter_setValueBool(formatter, typeString, typeName, value): return _internals.blpapi_EventFormatter_setValueBool(formatter, typeString, typeName, value) -blpapi_EventFormatter_setValueBool = _internals.blpapi_EventFormatter_setValueBool def blpapi_EventFormatter_setValueChar(formatter, typeString, typeName, value): return _internals.blpapi_EventFormatter_setValueChar(formatter, typeString, typeName, value) -blpapi_EventFormatter_setValueChar = _internals.blpapi_EventFormatter_setValueChar def blpapi_EventFormatter_setValueInt32(formatter, typeString, typeName, value): return _internals.blpapi_EventFormatter_setValueInt32(formatter, typeString, typeName, value) -blpapi_EventFormatter_setValueInt32 = _internals.blpapi_EventFormatter_setValueInt32 def blpapi_EventFormatter_setValueInt64(formatter, typeString, typeName, value): return _internals.blpapi_EventFormatter_setValueInt64(formatter, typeString, typeName, value) -blpapi_EventFormatter_setValueInt64 = _internals.blpapi_EventFormatter_setValueInt64 def blpapi_EventFormatter_setValueHighPrecisionDatetime(formatter, typeString, typeName, value): return _internals.blpapi_EventFormatter_setValueHighPrecisionDatetime(formatter, typeString, typeName, value) -blpapi_EventFormatter_setValueHighPrecisionDatetime = _internals.blpapi_EventFormatter_setValueHighPrecisionDatetime def blpapi_EventFormatter_setValueString(formatter, typeString, typeName, value): return _internals.blpapi_EventFormatter_setValueString(formatter, typeString, typeName, value) -blpapi_EventFormatter_setValueString = _internals.blpapi_EventFormatter_setValueString def blpapi_EventFormatter_setValueFromName(formatter, typeString, typeName, value): return _internals.blpapi_EventFormatter_setValueFromName(formatter, typeString, typeName, value) -blpapi_EventFormatter_setValueFromName = _internals.blpapi_EventFormatter_setValueFromName def blpapi_EventFormatter_setValueNull(formatter, typeString, typeName): return _internals.blpapi_EventFormatter_setValueNull(formatter, typeString, typeName) -blpapi_EventFormatter_setValueNull = _internals.blpapi_EventFormatter_setValueNull def blpapi_EventFormatter_pushElement(formatter, typeString, typeName): return _internals.blpapi_EventFormatter_pushElement(formatter, typeString, typeName) -blpapi_EventFormatter_pushElement = _internals.blpapi_EventFormatter_pushElement def blpapi_EventFormatter_popElement(formatter): return _internals.blpapi_EventFormatter_popElement(formatter) -blpapi_EventFormatter_popElement = _internals.blpapi_EventFormatter_popElement def blpapi_EventFormatter_appendValueBool(formatter, value): return _internals.blpapi_EventFormatter_appendValueBool(formatter, value) -blpapi_EventFormatter_appendValueBool = _internals.blpapi_EventFormatter_appendValueBool def blpapi_EventFormatter_appendValueChar(formatter, value): return _internals.blpapi_EventFormatter_appendValueChar(formatter, value) -blpapi_EventFormatter_appendValueChar = _internals.blpapi_EventFormatter_appendValueChar def blpapi_EventFormatter_appendValueInt32(formatter, value): return _internals.blpapi_EventFormatter_appendValueInt32(formatter, value) -blpapi_EventFormatter_appendValueInt32 = _internals.blpapi_EventFormatter_appendValueInt32 def blpapi_EventFormatter_appendValueInt64(formatter, value): return _internals.blpapi_EventFormatter_appendValueInt64(formatter, value) -blpapi_EventFormatter_appendValueInt64 = _internals.blpapi_EventFormatter_appendValueInt64 def blpapi_EventFormatter_appendValueHighPrecisionDatetime(formatter, value): return _internals.blpapi_EventFormatter_appendValueHighPrecisionDatetime(formatter, value) -blpapi_EventFormatter_appendValueHighPrecisionDatetime = _internals.blpapi_EventFormatter_appendValueHighPrecisionDatetime def blpapi_EventFormatter_appendValueString(formatter, value): return _internals.blpapi_EventFormatter_appendValueString(formatter, value) -blpapi_EventFormatter_appendValueString = _internals.blpapi_EventFormatter_appendValueString def blpapi_EventFormatter_appendValueFromName(formatter, value): return _internals.blpapi_EventFormatter_appendValueFromName(formatter, value) -blpapi_EventFormatter_appendValueFromName = _internals.blpapi_EventFormatter_appendValueFromName def blpapi_EventFormatter_appendElement(formatter): return _internals.blpapi_EventFormatter_appendElement(formatter) -blpapi_EventFormatter_appendElement = _internals.blpapi_EventFormatter_appendElement def Session_createHelper(parameters, eventHandlerFunc, dispatcher): return _internals.Session_createHelper(parameters, eventHandlerFunc, dispatcher) -Session_createHelper = _internals.Session_createHelper def Session_destroyHelper(sessionHandle, eventHandlerFunc): return _internals.Session_destroyHelper(sessionHandle, eventHandlerFunc) -Session_destroyHelper = _internals.Session_destroyHelper def blpapi_EventDispatcher_create(numDispatcherThreads): return _internals.blpapi_EventDispatcher_create(numDispatcherThreads) -blpapi_EventDispatcher_create = _internals.blpapi_EventDispatcher_create def blpapi_EventDispatcher_destroy(handle): return _internals.blpapi_EventDispatcher_destroy(handle) -blpapi_EventDispatcher_destroy = _internals.blpapi_EventDispatcher_destroy def blpapi_EventDispatcher_start(handle): return _internals.blpapi_EventDispatcher_start(handle) -blpapi_EventDispatcher_start = _internals.blpapi_EventDispatcher_start def ProviderSession_createHelper(parameters, eventHandlerFunc, dispatcher): return _internals.ProviderSession_createHelper(parameters, eventHandlerFunc, dispatcher) -ProviderSession_createHelper = _internals.ProviderSession_createHelper def ProviderSession_destroyHelper(sessionHandle, eventHandlerFunc): return _internals.ProviderSession_destroyHelper(sessionHandle, eventHandlerFunc) -ProviderSession_destroyHelper = _internals.ProviderSession_destroyHelper def ProviderSession_terminateSubscriptionsOnTopic(sessionHandle, topic, message): return _internals.ProviderSession_terminateSubscriptionsOnTopic(sessionHandle, topic, message) -ProviderSession_terminateSubscriptionsOnTopic = _internals.ProviderSession_terminateSubscriptionsOnTopic def blpapi_MessageFormatter_setValueFloat(formatter, typeName, value): return _internals.blpapi_MessageFormatter_setValueFloat(formatter, typeName, value) -blpapi_MessageFormatter_setValueFloat = _internals.blpapi_MessageFormatter_setValueFloat def blpapi_MessageFormatter_appendValueFloat(formatter, value): return _internals.blpapi_MessageFormatter_appendValueFloat(formatter, value) -blpapi_MessageFormatter_appendValueFloat = _internals.blpapi_MessageFormatter_appendValueFloat def blpapi_MessageFormatter_setValueBool(formatter, typeName, value): return _internals.blpapi_MessageFormatter_setValueBool(formatter, typeName, value) -blpapi_MessageFormatter_setValueBool = _internals.blpapi_MessageFormatter_setValueBool def blpapi_MessageFormatter_setValueChar(formatter, typeName, value): return _internals.blpapi_MessageFormatter_setValueChar(formatter, typeName, value) -blpapi_MessageFormatter_setValueChar = _internals.blpapi_MessageFormatter_setValueChar def blpapi_MessageFormatter_setValueInt32(formatter, typeName, value): return _internals.blpapi_MessageFormatter_setValueInt32(formatter, typeName, value) -blpapi_MessageFormatter_setValueInt32 = _internals.blpapi_MessageFormatter_setValueInt32 def blpapi_MessageFormatter_setValueInt64(formatter, typeName, value): return _internals.blpapi_MessageFormatter_setValueInt64(formatter, typeName, value) -blpapi_MessageFormatter_setValueInt64 = _internals.blpapi_MessageFormatter_setValueInt64 def blpapi_MessageFormatter_setValueFloat32(formatter, typeName, value): return _internals.blpapi_MessageFormatter_setValueFloat32(formatter, typeName, value) -blpapi_MessageFormatter_setValueFloat32 = _internals.blpapi_MessageFormatter_setValueFloat32 def blpapi_MessageFormatter_setValueFloat64(formatter, typeName, value): return _internals.blpapi_MessageFormatter_setValueFloat64(formatter, typeName, value) -blpapi_MessageFormatter_setValueFloat64 = _internals.blpapi_MessageFormatter_setValueFloat64 def blpapi_MessageFormatter_setValueDatetime(formatter, typeName, value): return _internals.blpapi_MessageFormatter_setValueDatetime(formatter, typeName, value) -blpapi_MessageFormatter_setValueDatetime = _internals.blpapi_MessageFormatter_setValueDatetime def blpapi_MessageFormatter_setValueHighPrecisionDatetime(formatter, typeName, value): return _internals.blpapi_MessageFormatter_setValueHighPrecisionDatetime(formatter, typeName, value) -blpapi_MessageFormatter_setValueHighPrecisionDatetime = _internals.blpapi_MessageFormatter_setValueHighPrecisionDatetime def blpapi_MessageFormatter_setValueString(formatter, typeName, value): return _internals.blpapi_MessageFormatter_setValueString(formatter, typeName, value) -blpapi_MessageFormatter_setValueString = _internals.blpapi_MessageFormatter_setValueString def blpapi_MessageFormatter_setValueFromName(formatter, typeName, value): return _internals.blpapi_MessageFormatter_setValueFromName(formatter, typeName, value) -blpapi_MessageFormatter_setValueFromName = _internals.blpapi_MessageFormatter_setValueFromName def blpapi_MessageFormatter_setValueNull(formatter, typeName): return _internals.blpapi_MessageFormatter_setValueNull(formatter, typeName) -blpapi_MessageFormatter_setValueNull = _internals.blpapi_MessageFormatter_setValueNull def blpapi_MessageFormatter_pushElement(formatter, typeName): return _internals.blpapi_MessageFormatter_pushElement(formatter, typeName) -blpapi_MessageFormatter_pushElement = _internals.blpapi_MessageFormatter_pushElement def blpapi_MessageFormatter_popElement(formatter): return _internals.blpapi_MessageFormatter_popElement(formatter) -blpapi_MessageFormatter_popElement = _internals.blpapi_MessageFormatter_popElement def blpapi_MessageFormatter_appendValueBool(formatter, value): return _internals.blpapi_MessageFormatter_appendValueBool(formatter, value) -blpapi_MessageFormatter_appendValueBool = _internals.blpapi_MessageFormatter_appendValueBool def blpapi_MessageFormatter_appendValueChar(formatter, value): return _internals.blpapi_MessageFormatter_appendValueChar(formatter, value) -blpapi_MessageFormatter_appendValueChar = _internals.blpapi_MessageFormatter_appendValueChar def blpapi_MessageFormatter_appendValueInt32(formatter, value): return _internals.blpapi_MessageFormatter_appendValueInt32(formatter, value) -blpapi_MessageFormatter_appendValueInt32 = _internals.blpapi_MessageFormatter_appendValueInt32 def blpapi_MessageFormatter_appendValueInt64(formatter, value): return _internals.blpapi_MessageFormatter_appendValueInt64(formatter, value) -blpapi_MessageFormatter_appendValueInt64 = _internals.blpapi_MessageFormatter_appendValueInt64 def blpapi_MessageFormatter_appendValueFloat32(formatter, value): return _internals.blpapi_MessageFormatter_appendValueFloat32(formatter, value) -blpapi_MessageFormatter_appendValueFloat32 = _internals.blpapi_MessageFormatter_appendValueFloat32 def blpapi_MessageFormatter_appendValueFloat64(formatter, value): return _internals.blpapi_MessageFormatter_appendValueFloat64(formatter, value) -blpapi_MessageFormatter_appendValueFloat64 = _internals.blpapi_MessageFormatter_appendValueFloat64 def blpapi_MessageFormatter_appendValueDatetime(formatter, value): return _internals.blpapi_MessageFormatter_appendValueDatetime(formatter, value) -blpapi_MessageFormatter_appendValueDatetime = _internals.blpapi_MessageFormatter_appendValueDatetime def blpapi_MessageFormatter_appendValueHighPrecisionDatetime(formatter, value): return _internals.blpapi_MessageFormatter_appendValueHighPrecisionDatetime(formatter, value) -blpapi_MessageFormatter_appendValueHighPrecisionDatetime = _internals.blpapi_MessageFormatter_appendValueHighPrecisionDatetime def blpapi_MessageFormatter_appendValueString(formatter, value): return _internals.blpapi_MessageFormatter_appendValueString(formatter, value) -blpapi_MessageFormatter_appendValueString = _internals.blpapi_MessageFormatter_appendValueString def blpapi_MessageFormatter_appendValueFromName(formatter, value): return _internals.blpapi_MessageFormatter_appendValueFromName(formatter, value) -blpapi_MessageFormatter_appendValueFromName = _internals.blpapi_MessageFormatter_appendValueFromName def blpapi_MessageFormatter_appendElement(formatter): return _internals.blpapi_MessageFormatter_appendElement(formatter) -blpapi_MessageFormatter_appendElement = _internals.blpapi_MessageFormatter_appendElement def blpapi_MessageFormatter_FormatMessageJson(formatter, message): return _internals.blpapi_MessageFormatter_FormatMessageJson(formatter, message) -blpapi_MessageFormatter_FormatMessageJson = _internals.blpapi_MessageFormatter_FormatMessageJson def blpapi_MessageFormatter_FormatMessageXml(formatter, message): return _internals.blpapi_MessageFormatter_FormatMessageXml(formatter, message) -blpapi_MessageFormatter_FormatMessageXml = _internals.blpapi_MessageFormatter_FormatMessageXml def blpapi_MessageFormatter_copy(original): return _internals.blpapi_MessageFormatter_copy(original) -blpapi_MessageFormatter_copy = _internals.blpapi_MessageFormatter_copy def blpapi_MessageFormatter_assign(rhs): return _internals.blpapi_MessageFormatter_assign(rhs) -blpapi_MessageFormatter_assign = _internals.blpapi_MessageFormatter_assign def blpapi_MessageFormatter_destroy(formatter): return _internals.blpapi_MessageFormatter_destroy(formatter) -blpapi_MessageFormatter_destroy = _internals.blpapi_MessageFormatter_destroy def blpapi_AuthOptions_create_default(): return _internals.blpapi_AuthOptions_create_default() -blpapi_AuthOptions_create_default = _internals.blpapi_AuthOptions_create_default def blpapi_AuthOptions_create_forUserMode(user): return _internals.blpapi_AuthOptions_create_forUserMode(user) -blpapi_AuthOptions_create_forUserMode = _internals.blpapi_AuthOptions_create_forUserMode def blpapi_AuthOptions_create_forAppMode(app): return _internals.blpapi_AuthOptions_create_forAppMode(app) -blpapi_AuthOptions_create_forAppMode = _internals.blpapi_AuthOptions_create_forAppMode def blpapi_AuthOptions_create_forUserAndAppMode(user, app): return _internals.blpapi_AuthOptions_create_forUserAndAppMode(user, app) -blpapi_AuthOptions_create_forUserAndAppMode = _internals.blpapi_AuthOptions_create_forUserAndAppMode def blpapi_AuthOptions_create_forToken(token): return _internals.blpapi_AuthOptions_create_forToken(token) -blpapi_AuthOptions_create_forToken = _internals.blpapi_AuthOptions_create_forToken def blpapi_AuthOptions_duplicate(dup): return _internals.blpapi_AuthOptions_duplicate(dup) -blpapi_AuthOptions_duplicate = _internals.blpapi_AuthOptions_duplicate def blpapi_AuthOptions_copy(lhs, rhs): return _internals.blpapi_AuthOptions_copy(lhs, rhs) -blpapi_AuthOptions_copy = _internals.blpapi_AuthOptions_copy def blpapi_AuthOptions_destroy(options): return _internals.blpapi_AuthOptions_destroy(options) -blpapi_AuthOptions_destroy = _internals.blpapi_AuthOptions_destroy def blpapi_AuthUser_createWithLogonName(): return _internals.blpapi_AuthUser_createWithLogonName() -blpapi_AuthUser_createWithLogonName = _internals.blpapi_AuthUser_createWithLogonName def blpapi_AuthUser_createWithActiveDirectoryProperty(propertyName): return _internals.blpapi_AuthUser_createWithActiveDirectoryProperty(propertyName) -blpapi_AuthUser_createWithActiveDirectoryProperty = _internals.blpapi_AuthUser_createWithActiveDirectoryProperty def blpapi_AuthUser_createWithManualOptions(userId, ipAddress): return _internals.blpapi_AuthUser_createWithManualOptions(userId, ipAddress) -blpapi_AuthUser_createWithManualOptions = _internals.blpapi_AuthUser_createWithManualOptions def blpapi_AuthUser_duplicate(dup): return _internals.blpapi_AuthUser_duplicate(dup) -blpapi_AuthUser_duplicate = _internals.blpapi_AuthUser_duplicate def blpapi_AuthUser_copy(lhs, rhs): return _internals.blpapi_AuthUser_copy(lhs, rhs) -blpapi_AuthUser_copy = _internals.blpapi_AuthUser_copy def blpapi_AuthUser_destroy(user): return _internals.blpapi_AuthUser_destroy(user) -blpapi_AuthUser_destroy = _internals.blpapi_AuthUser_destroy def blpapi_AuthApplication_create(appName): return _internals.blpapi_AuthApplication_create(appName) -blpapi_AuthApplication_create = _internals.blpapi_AuthApplication_create def blpapi_AuthApplication_duplicate(dup): return _internals.blpapi_AuthApplication_duplicate(dup) -blpapi_AuthApplication_duplicate = _internals.blpapi_AuthApplication_duplicate def blpapi_AuthApplication_copy(lhs, rhs): return _internals.blpapi_AuthApplication_copy(lhs, rhs) -blpapi_AuthApplication_copy = _internals.blpapi_AuthApplication_copy def blpapi_AuthApplication_destroy(app): return _internals.blpapi_AuthApplication_destroy(app) -blpapi_AuthApplication_destroy = _internals.blpapi_AuthApplication_destroy def blpapi_AuthToken_create(tokenStr): return _internals.blpapi_AuthToken_create(tokenStr) -blpapi_AuthToken_create = _internals.blpapi_AuthToken_create def blpapi_AuthToken_duplicate(dup): return _internals.blpapi_AuthToken_duplicate(dup) -blpapi_AuthToken_duplicate = _internals.blpapi_AuthToken_duplicate def blpapi_AuthToken_copy(lhs, rhs): return _internals.blpapi_AuthToken_copy(lhs, rhs) -blpapi_AuthToken_copy = _internals.blpapi_AuthToken_copy def blpapi_AuthToken_destroy(token): return _internals.blpapi_AuthToken_destroy(token) -blpapi_AuthToken_destroy = _internals.blpapi_AuthToken_destroy UNKNOWN_CLASS = _internals.UNKNOWN_CLASS INVALIDSTATE_CLASS = _internals.INVALIDSTATE_CLASS INVALIDARG_CLASS = _internals.INVALIDARG_CLASS @@ -1107,1237 +890,896 @@ def blpapi_AuthToken_destroy(token): def blpapi_getLastErrorDescription(resultCode): return _internals.blpapi_getLastErrorDescription(resultCode) -blpapi_getLastErrorDescription = _internals.blpapi_getLastErrorDescription def blpapi_SessionOptions_create(): return _internals.blpapi_SessionOptions_create() -blpapi_SessionOptions_create = _internals.blpapi_SessionOptions_create def blpapi_SessionOptions_destroy(parameters): return _internals.blpapi_SessionOptions_destroy(parameters) -blpapi_SessionOptions_destroy = _internals.blpapi_SessionOptions_destroy def blpapi_SessionOptions_setServerHost(parameters, serverHost): return _internals.blpapi_SessionOptions_setServerHost(parameters, serverHost) -blpapi_SessionOptions_setServerHost = _internals.blpapi_SessionOptions_setServerHost def blpapi_SessionOptions_setServerPort(parameters, serverPort): return _internals.blpapi_SessionOptions_setServerPort(parameters, serverPort) -blpapi_SessionOptions_setServerPort = _internals.blpapi_SessionOptions_setServerPort def blpapi_SessionOptions_setServerAddress(parameters, serverHost, serverPort, index): return _internals.blpapi_SessionOptions_setServerAddress(parameters, serverHost, serverPort, index) -blpapi_SessionOptions_setServerAddress = _internals.blpapi_SessionOptions_setServerAddress def blpapi_SessionOptions_removeServerAddress(parameters, index): return _internals.blpapi_SessionOptions_removeServerAddress(parameters, index) -blpapi_SessionOptions_removeServerAddress = _internals.blpapi_SessionOptions_removeServerAddress def blpapi_SessionOptions_setConnectTimeout(parameters, timeoutInMilliseconds): return _internals.blpapi_SessionOptions_setConnectTimeout(parameters, timeoutInMilliseconds) -blpapi_SessionOptions_setConnectTimeout = _internals.blpapi_SessionOptions_setConnectTimeout def blpapi_SessionOptions_setDefaultServices(parameters, defaultServices): return _internals.blpapi_SessionOptions_setDefaultServices(parameters, defaultServices) -blpapi_SessionOptions_setDefaultServices = _internals.blpapi_SessionOptions_setDefaultServices def blpapi_SessionOptions_setDefaultSubscriptionService(parameters, serviceIdentifier): return _internals.blpapi_SessionOptions_setDefaultSubscriptionService(parameters, serviceIdentifier) -blpapi_SessionOptions_setDefaultSubscriptionService = _internals.blpapi_SessionOptions_setDefaultSubscriptionService def blpapi_SessionOptions_setDefaultTopicPrefix(parameters, prefix): return _internals.blpapi_SessionOptions_setDefaultTopicPrefix(parameters, prefix) -blpapi_SessionOptions_setDefaultTopicPrefix = _internals.blpapi_SessionOptions_setDefaultTopicPrefix def blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg(parameters, allowMultipleCorrelatorsPerMsg): return _internals.blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg(parameters, allowMultipleCorrelatorsPerMsg) -blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg = _internals.blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg def blpapi_SessionOptions_setClientMode(parameters, clientMode): return _internals.blpapi_SessionOptions_setClientMode(parameters, clientMode) -blpapi_SessionOptions_setClientMode = _internals.blpapi_SessionOptions_setClientMode def blpapi_SessionOptions_setMaxPendingRequests(parameters, maxPendingRequests): return _internals.blpapi_SessionOptions_setMaxPendingRequests(parameters, maxPendingRequests) -blpapi_SessionOptions_setMaxPendingRequests = _internals.blpapi_SessionOptions_setMaxPendingRequests def blpapi_SessionOptions_setAutoRestartOnDisconnection(parameters, autoRestart): return _internals.blpapi_SessionOptions_setAutoRestartOnDisconnection(parameters, autoRestart) -blpapi_SessionOptions_setAutoRestartOnDisconnection = _internals.blpapi_SessionOptions_setAutoRestartOnDisconnection def blpapi_SessionOptions_setSessionIdentityOptions(parameters, authOptions, cid): return _internals.blpapi_SessionOptions_setSessionIdentityOptions(parameters, authOptions, cid) -blpapi_SessionOptions_setSessionIdentityOptions = _internals.blpapi_SessionOptions_setSessionIdentityOptions def blpapi_SessionOptions_setAuthenticationOptions(parameters, authOptions): return _internals.blpapi_SessionOptions_setAuthenticationOptions(parameters, authOptions) -blpapi_SessionOptions_setAuthenticationOptions = _internals.blpapi_SessionOptions_setAuthenticationOptions def blpapi_SessionOptions_setNumStartAttempts(parameters, numStartAttempts): return _internals.blpapi_SessionOptions_setNumStartAttempts(parameters, numStartAttempts) -blpapi_SessionOptions_setNumStartAttempts = _internals.blpapi_SessionOptions_setNumStartAttempts def blpapi_SessionOptions_setMaxEventQueueSize(parameters, maxEventQueueSize): return _internals.blpapi_SessionOptions_setMaxEventQueueSize(parameters, maxEventQueueSize) -blpapi_SessionOptions_setMaxEventQueueSize = _internals.blpapi_SessionOptions_setMaxEventQueueSize def blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark(parameters, hiWaterMark): return _internals.blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark(parameters, hiWaterMark) -blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark = _internals.blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark def blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark(parameters, loWaterMark): return _internals.blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark(parameters, loWaterMark) -blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark = _internals.blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark def blpapi_SessionOptions_setDefaultKeepAliveInactivityTime(parameters, inactivityMsecs): return _internals.blpapi_SessionOptions_setDefaultKeepAliveInactivityTime(parameters, inactivityMsecs) -blpapi_SessionOptions_setDefaultKeepAliveInactivityTime = _internals.blpapi_SessionOptions_setDefaultKeepAliveInactivityTime def blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout(parameters, timeoutMsecs): return _internals.blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout(parameters, timeoutMsecs) -blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout = _internals.blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout def blpapi_SessionOptions_setKeepAliveEnabled(parameters, isEnabled): return _internals.blpapi_SessionOptions_setKeepAliveEnabled(parameters, isEnabled) -blpapi_SessionOptions_setKeepAliveEnabled = _internals.blpapi_SessionOptions_setKeepAliveEnabled def blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes(parameters, shouldRecord): return _internals.blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes(parameters, shouldRecord) -blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes = _internals.blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes def blpapi_SessionOptions_setServiceCheckTimeout(paramaters, timeoutMsecs): return _internals.blpapi_SessionOptions_setServiceCheckTimeout(paramaters, timeoutMsecs) -blpapi_SessionOptions_setServiceCheckTimeout = _internals.blpapi_SessionOptions_setServiceCheckTimeout def blpapi_SessionOptions_setServiceDownloadTimeout(paramaters, timeoutMsecs): return _internals.blpapi_SessionOptions_setServiceDownloadTimeout(paramaters, timeoutMsecs) -blpapi_SessionOptions_setServiceDownloadTimeout = _internals.blpapi_SessionOptions_setServiceDownloadTimeout def blpapi_SessionOptions_setTlsOptions(paramaters, tlsOptions): return _internals.blpapi_SessionOptions_setTlsOptions(paramaters, tlsOptions) -blpapi_SessionOptions_setTlsOptions = _internals.blpapi_SessionOptions_setTlsOptions def blpapi_SessionOptions_setFlushPublishedEventsTimeout(paramaters, timeoutMsecs): return _internals.blpapi_SessionOptions_setFlushPublishedEventsTimeout(paramaters, timeoutMsecs) -blpapi_SessionOptions_setFlushPublishedEventsTimeout = _internals.blpapi_SessionOptions_setFlushPublishedEventsTimeout def blpapi_SessionOptions_setBandwidthSaveModeDisabled(parameters, disableBandwidthSaveMode): return _internals.blpapi_SessionOptions_setBandwidthSaveModeDisabled(parameters, disableBandwidthSaveMode) -blpapi_SessionOptions_setBandwidthSaveModeDisabled = _internals.blpapi_SessionOptions_setBandwidthSaveModeDisabled def blpapi_SessionOptions_serverHost(parameters): return _internals.blpapi_SessionOptions_serverHost(parameters) -blpapi_SessionOptions_serverHost = _internals.blpapi_SessionOptions_serverHost def blpapi_SessionOptions_serverPort(parameters): return _internals.blpapi_SessionOptions_serverPort(parameters) -blpapi_SessionOptions_serverPort = _internals.blpapi_SessionOptions_serverPort def blpapi_SessionOptions_numServerAddresses(parameters): return _internals.blpapi_SessionOptions_numServerAddresses(parameters) -blpapi_SessionOptions_numServerAddresses = _internals.blpapi_SessionOptions_numServerAddresses def blpapi_SessionOptions_getServerAddress(parameters, index): return _internals.blpapi_SessionOptions_getServerAddress(parameters, index) -blpapi_SessionOptions_getServerAddress = _internals.blpapi_SessionOptions_getServerAddress def blpapi_SessionOptions_connectTimeout(parameters): return _internals.blpapi_SessionOptions_connectTimeout(parameters) -blpapi_SessionOptions_connectTimeout = _internals.blpapi_SessionOptions_connectTimeout def blpapi_SessionOptions_defaultServices(parameters): return _internals.blpapi_SessionOptions_defaultServices(parameters) -blpapi_SessionOptions_defaultServices = _internals.blpapi_SessionOptions_defaultServices def blpapi_SessionOptions_defaultSubscriptionService(parameters): return _internals.blpapi_SessionOptions_defaultSubscriptionService(parameters) -blpapi_SessionOptions_defaultSubscriptionService = _internals.blpapi_SessionOptions_defaultSubscriptionService def blpapi_SessionOptions_defaultTopicPrefix(parameters): return _internals.blpapi_SessionOptions_defaultTopicPrefix(parameters) -blpapi_SessionOptions_defaultTopicPrefix = _internals.blpapi_SessionOptions_defaultTopicPrefix def blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg(parameters): return _internals.blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg(parameters) -blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg = _internals.blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg def blpapi_SessionOptions_clientMode(parameters): return _internals.blpapi_SessionOptions_clientMode(parameters) -blpapi_SessionOptions_clientMode = _internals.blpapi_SessionOptions_clientMode def blpapi_SessionOptions_maxPendingRequests(parameters): return _internals.blpapi_SessionOptions_maxPendingRequests(parameters) -blpapi_SessionOptions_maxPendingRequests = _internals.blpapi_SessionOptions_maxPendingRequests def blpapi_SessionOptions_autoRestartOnDisconnection(parameters): return _internals.blpapi_SessionOptions_autoRestartOnDisconnection(parameters) -blpapi_SessionOptions_autoRestartOnDisconnection = _internals.blpapi_SessionOptions_autoRestartOnDisconnection def blpapi_SessionOptions_authenticationOptions(parameters): return _internals.blpapi_SessionOptions_authenticationOptions(parameters) -blpapi_SessionOptions_authenticationOptions = _internals.blpapi_SessionOptions_authenticationOptions def blpapi_SessionOptions_numStartAttempts(parameters): return _internals.blpapi_SessionOptions_numStartAttempts(parameters) -blpapi_SessionOptions_numStartAttempts = _internals.blpapi_SessionOptions_numStartAttempts def blpapi_SessionOptions_maxEventQueueSize(parameters): return _internals.blpapi_SessionOptions_maxEventQueueSize(parameters) -blpapi_SessionOptions_maxEventQueueSize = _internals.blpapi_SessionOptions_maxEventQueueSize def blpapi_SessionOptions_slowConsumerWarningHiWaterMark(parameters): return _internals.blpapi_SessionOptions_slowConsumerWarningHiWaterMark(parameters) -blpapi_SessionOptions_slowConsumerWarningHiWaterMark = _internals.blpapi_SessionOptions_slowConsumerWarningHiWaterMark def blpapi_SessionOptions_slowConsumerWarningLoWaterMark(parameters): return _internals.blpapi_SessionOptions_slowConsumerWarningLoWaterMark(parameters) -blpapi_SessionOptions_slowConsumerWarningLoWaterMark = _internals.blpapi_SessionOptions_slowConsumerWarningLoWaterMark def blpapi_SessionOptions_defaultKeepAliveInactivityTime(parameters): return _internals.blpapi_SessionOptions_defaultKeepAliveInactivityTime(parameters) -blpapi_SessionOptions_defaultKeepAliveInactivityTime = _internals.blpapi_SessionOptions_defaultKeepAliveInactivityTime def blpapi_SessionOptions_defaultKeepAliveResponseTimeout(parameters): return _internals.blpapi_SessionOptions_defaultKeepAliveResponseTimeout(parameters) -blpapi_SessionOptions_defaultKeepAliveResponseTimeout = _internals.blpapi_SessionOptions_defaultKeepAliveResponseTimeout def blpapi_SessionOptions_keepAliveEnabled(parameters): return _internals.blpapi_SessionOptions_keepAliveEnabled(parameters) -blpapi_SessionOptions_keepAliveEnabled = _internals.blpapi_SessionOptions_keepAliveEnabled def blpapi_SessionOptions_recordSubscriptionDataReceiveTimes(parameters): return _internals.blpapi_SessionOptions_recordSubscriptionDataReceiveTimes(parameters) -blpapi_SessionOptions_recordSubscriptionDataReceiveTimes = _internals.blpapi_SessionOptions_recordSubscriptionDataReceiveTimes def blpapi_SessionOptions_serviceCheckTimeout(parameters): return _internals.blpapi_SessionOptions_serviceCheckTimeout(parameters) -blpapi_SessionOptions_serviceCheckTimeout = _internals.blpapi_SessionOptions_serviceCheckTimeout def blpapi_SessionOptions_serviceDownloadTimeout(parameters): return _internals.blpapi_SessionOptions_serviceDownloadTimeout(parameters) -blpapi_SessionOptions_serviceDownloadTimeout = _internals.blpapi_SessionOptions_serviceDownloadTimeout def blpapi_SessionOptions_flushPublishedEventsTimeout(parameters): return _internals.blpapi_SessionOptions_flushPublishedEventsTimeout(parameters) -blpapi_SessionOptions_flushPublishedEventsTimeout = _internals.blpapi_SessionOptions_flushPublishedEventsTimeout def blpapi_SessionOptions_bandwidthSaveModeDisabled(parameters): return _internals.blpapi_SessionOptions_bandwidthSaveModeDisabled(parameters) -blpapi_SessionOptions_bandwidthSaveModeDisabled = _internals.blpapi_SessionOptions_bandwidthSaveModeDisabled def blpapi_TlsOptions_destroy(parameters): return _internals.blpapi_TlsOptions_destroy(parameters) -blpapi_TlsOptions_destroy = _internals.blpapi_TlsOptions_destroy def blpapi_TlsOptions_createFromFiles(clientCredentialsFileName, clientCredentialsPassword, trustedCertificatesFileName): return _internals.blpapi_TlsOptions_createFromFiles(clientCredentialsFileName, clientCredentialsPassword, trustedCertificatesFileName) -blpapi_TlsOptions_createFromFiles = _internals.blpapi_TlsOptions_createFromFiles def blpapi_TlsOptions_createFromBlobs(clientCredentialsRawData, clientCredentialsPassword, trustedCertificatesRawData): return _internals.blpapi_TlsOptions_createFromBlobs(clientCredentialsRawData, clientCredentialsPassword, trustedCertificatesRawData) -blpapi_TlsOptions_createFromBlobs = _internals.blpapi_TlsOptions_createFromBlobs def blpapi_TlsOptions_setTlsHandshakeTimeoutMs(paramaters, tlsHandshakeTimeoutMs): return _internals.blpapi_TlsOptions_setTlsHandshakeTimeoutMs(paramaters, tlsHandshakeTimeoutMs) -blpapi_TlsOptions_setTlsHandshakeTimeoutMs = _internals.blpapi_TlsOptions_setTlsHandshakeTimeoutMs def blpapi_TlsOptions_setCrlFetchTimeoutMs(paramaters, crlFetchTimeoutMs): return _internals.blpapi_TlsOptions_setCrlFetchTimeoutMs(paramaters, crlFetchTimeoutMs) -blpapi_TlsOptions_setCrlFetchTimeoutMs = _internals.blpapi_TlsOptions_setCrlFetchTimeoutMs def blpapi_Name_create(nameString): return _internals.blpapi_Name_create(nameString) -blpapi_Name_create = _internals.blpapi_Name_create def blpapi_Name_destroy(name): return _internals.blpapi_Name_destroy(name) -blpapi_Name_destroy = _internals.blpapi_Name_destroy def blpapi_Name_equalsStr(name, string): return _internals.blpapi_Name_equalsStr(name, string) -blpapi_Name_equalsStr = _internals.blpapi_Name_equalsStr def blpapi_Name_string(name): return _internals.blpapi_Name_string(name) -blpapi_Name_string = _internals.blpapi_Name_string def blpapi_Name_length(name): return _internals.blpapi_Name_length(name) -blpapi_Name_length = _internals.blpapi_Name_length def blpapi_Name_findName(nameString): return _internals.blpapi_Name_findName(nameString) -blpapi_Name_findName = _internals.blpapi_Name_findName def blpapi_SubscriptionList_create(): return _internals.blpapi_SubscriptionList_create() -blpapi_SubscriptionList_create = _internals.blpapi_SubscriptionList_create def blpapi_SubscriptionList_destroy(list): return _internals.blpapi_SubscriptionList_destroy(list) -blpapi_SubscriptionList_destroy = _internals.blpapi_SubscriptionList_destroy def blpapi_SubscriptionList_addResolved(list, subscriptionString, correlationId): return _internals.blpapi_SubscriptionList_addResolved(list, subscriptionString, correlationId) -blpapi_SubscriptionList_addResolved = _internals.blpapi_SubscriptionList_addResolved def blpapi_SubscriptionList_clear(list): return _internals.blpapi_SubscriptionList_clear(list) -blpapi_SubscriptionList_clear = _internals.blpapi_SubscriptionList_clear def blpapi_SubscriptionList_append(dest, src): return _internals.blpapi_SubscriptionList_append(dest, src) -blpapi_SubscriptionList_append = _internals.blpapi_SubscriptionList_append def blpapi_SubscriptionList_size(list): return _internals.blpapi_SubscriptionList_size(list) -blpapi_SubscriptionList_size = _internals.blpapi_SubscriptionList_size def blpapi_SubscriptionList_correlationIdAt(list, index): return _internals.blpapi_SubscriptionList_correlationIdAt(list, index) -blpapi_SubscriptionList_correlationIdAt = _internals.blpapi_SubscriptionList_correlationIdAt def blpapi_SubscriptionList_topicStringAt(list, index): return _internals.blpapi_SubscriptionList_topicStringAt(list, index) -blpapi_SubscriptionList_topicStringAt = _internals.blpapi_SubscriptionList_topicStringAt def blpapi_SubscriptionList_isResolvedAt(list, index): return _internals.blpapi_SubscriptionList_isResolvedAt(list, index) -blpapi_SubscriptionList_isResolvedAt = _internals.blpapi_SubscriptionList_isResolvedAt -class blpapi_TimePoint(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, blpapi_TimePoint, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, blpapi_TimePoint, name) +class blpapi_TimePoint(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr - __swig_setmethods__["d_value"] = _internals.blpapi_TimePoint_d_value_set - __swig_getmethods__["d_value"] = _internals.blpapi_TimePoint_d_value_get - if _newclass: - d_value = _swig_property(_internals.blpapi_TimePoint_d_value_get, _internals.blpapi_TimePoint_d_value_set) + d_value = property(_internals.blpapi_TimePoint_d_value_get, _internals.blpapi_TimePoint_d_value_set) def __init__(self): - this = _internals.new_blpapi_TimePoint() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this + _internals.blpapi_TimePoint_swiginit(self, _internals.new_blpapi_TimePoint()) __swig_destroy__ = _internals.delete_blpapi_TimePoint - __del__ = lambda self: None -blpapi_TimePoint_swigregister = _internals.blpapi_TimePoint_swigregister -blpapi_TimePoint_swigregister(blpapi_TimePoint) + +# Register blpapi_TimePoint in _internals: +_internals.blpapi_TimePoint_swigregister(blpapi_TimePoint) def blpapi_TimePointUtil_nanosecondsBetween(start, end): return _internals.blpapi_TimePointUtil_nanosecondsBetween(start, end) -blpapi_TimePointUtil_nanosecondsBetween = _internals.blpapi_TimePointUtil_nanosecondsBetween -class blpapi_Datetime_tag(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, blpapi_Datetime_tag, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, blpapi_Datetime_tag, name) +class blpapi_Datetime_tag(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr - __swig_setmethods__["parts"] = _internals.blpapi_Datetime_tag_parts_set - __swig_getmethods__["parts"] = _internals.blpapi_Datetime_tag_parts_get - if _newclass: - parts = _swig_property(_internals.blpapi_Datetime_tag_parts_get, _internals.blpapi_Datetime_tag_parts_set) - __swig_setmethods__["hours"] = _internals.blpapi_Datetime_tag_hours_set - __swig_getmethods__["hours"] = _internals.blpapi_Datetime_tag_hours_get - if _newclass: - hours = _swig_property(_internals.blpapi_Datetime_tag_hours_get, _internals.blpapi_Datetime_tag_hours_set) - __swig_setmethods__["minutes"] = _internals.blpapi_Datetime_tag_minutes_set - __swig_getmethods__["minutes"] = _internals.blpapi_Datetime_tag_minutes_get - if _newclass: - minutes = _swig_property(_internals.blpapi_Datetime_tag_minutes_get, _internals.blpapi_Datetime_tag_minutes_set) - __swig_setmethods__["seconds"] = _internals.blpapi_Datetime_tag_seconds_set - __swig_getmethods__["seconds"] = _internals.blpapi_Datetime_tag_seconds_get - if _newclass: - seconds = _swig_property(_internals.blpapi_Datetime_tag_seconds_get, _internals.blpapi_Datetime_tag_seconds_set) - __swig_setmethods__["milliSeconds"] = _internals.blpapi_Datetime_tag_milliSeconds_set - __swig_getmethods__["milliSeconds"] = _internals.blpapi_Datetime_tag_milliSeconds_get - if _newclass: - milliSeconds = _swig_property(_internals.blpapi_Datetime_tag_milliSeconds_get, _internals.blpapi_Datetime_tag_milliSeconds_set) - __swig_setmethods__["month"] = _internals.blpapi_Datetime_tag_month_set - __swig_getmethods__["month"] = _internals.blpapi_Datetime_tag_month_get - if _newclass: - month = _swig_property(_internals.blpapi_Datetime_tag_month_get, _internals.blpapi_Datetime_tag_month_set) - __swig_setmethods__["day"] = _internals.blpapi_Datetime_tag_day_set - __swig_getmethods__["day"] = _internals.blpapi_Datetime_tag_day_get - if _newclass: - day = _swig_property(_internals.blpapi_Datetime_tag_day_get, _internals.blpapi_Datetime_tag_day_set) - __swig_setmethods__["year"] = _internals.blpapi_Datetime_tag_year_set - __swig_getmethods__["year"] = _internals.blpapi_Datetime_tag_year_get - if _newclass: - year = _swig_property(_internals.blpapi_Datetime_tag_year_get, _internals.blpapi_Datetime_tag_year_set) - __swig_setmethods__["offset"] = _internals.blpapi_Datetime_tag_offset_set - __swig_getmethods__["offset"] = _internals.blpapi_Datetime_tag_offset_get - if _newclass: - offset = _swig_property(_internals.blpapi_Datetime_tag_offset_get, _internals.blpapi_Datetime_tag_offset_set) + parts = property(_internals.blpapi_Datetime_tag_parts_get, _internals.blpapi_Datetime_tag_parts_set) + hours = property(_internals.blpapi_Datetime_tag_hours_get, _internals.blpapi_Datetime_tag_hours_set) + minutes = property(_internals.blpapi_Datetime_tag_minutes_get, _internals.blpapi_Datetime_tag_minutes_set) + seconds = property(_internals.blpapi_Datetime_tag_seconds_get, _internals.blpapi_Datetime_tag_seconds_set) + milliSeconds = property(_internals.blpapi_Datetime_tag_milliSeconds_get, _internals.blpapi_Datetime_tag_milliSeconds_set) + month = property(_internals.blpapi_Datetime_tag_month_get, _internals.blpapi_Datetime_tag_month_set) + day = property(_internals.blpapi_Datetime_tag_day_get, _internals.blpapi_Datetime_tag_day_set) + year = property(_internals.blpapi_Datetime_tag_year_get, _internals.blpapi_Datetime_tag_year_set) + offset = property(_internals.blpapi_Datetime_tag_offset_get, _internals.blpapi_Datetime_tag_offset_set) def __init__(self): - this = _internals.new_blpapi_Datetime_tag() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this + _internals.blpapi_Datetime_tag_swiginit(self, _internals.new_blpapi_Datetime_tag()) __swig_destroy__ = _internals.delete_blpapi_Datetime_tag - __del__ = lambda self: None -blpapi_Datetime_tag_swigregister = _internals.blpapi_Datetime_tag_swigregister -blpapi_Datetime_tag_swigregister(blpapi_Datetime_tag) - -class blpapi_HighPrecisionDatetime_tag(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, blpapi_HighPrecisionDatetime_tag, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, blpapi_HighPrecisionDatetime_tag, name) + +# Register blpapi_Datetime_tag in _internals: +_internals.blpapi_Datetime_tag_swigregister(blpapi_Datetime_tag) + +class blpapi_HighPrecisionDatetime_tag(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr - __swig_setmethods__["datetime"] = _internals.blpapi_HighPrecisionDatetime_tag_datetime_set - __swig_getmethods__["datetime"] = _internals.blpapi_HighPrecisionDatetime_tag_datetime_get - if _newclass: - datetime = _swig_property(_internals.blpapi_HighPrecisionDatetime_tag_datetime_get, _internals.blpapi_HighPrecisionDatetime_tag_datetime_set) - __swig_setmethods__["picoseconds"] = _internals.blpapi_HighPrecisionDatetime_tag_picoseconds_set - __swig_getmethods__["picoseconds"] = _internals.blpapi_HighPrecisionDatetime_tag_picoseconds_get - if _newclass: - picoseconds = _swig_property(_internals.blpapi_HighPrecisionDatetime_tag_picoseconds_get, _internals.blpapi_HighPrecisionDatetime_tag_picoseconds_set) + datetime = property(_internals.blpapi_HighPrecisionDatetime_tag_datetime_get, _internals.blpapi_HighPrecisionDatetime_tag_datetime_set) + picoseconds = property(_internals.blpapi_HighPrecisionDatetime_tag_picoseconds_get, _internals.blpapi_HighPrecisionDatetime_tag_picoseconds_set) def __init__(self): - this = _internals.new_blpapi_HighPrecisionDatetime_tag() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this + _internals.blpapi_HighPrecisionDatetime_tag_swiginit(self, _internals.new_blpapi_HighPrecisionDatetime_tag()) __swig_destroy__ = _internals.delete_blpapi_HighPrecisionDatetime_tag - __del__ = lambda self: None -blpapi_HighPrecisionDatetime_tag_swigregister = _internals.blpapi_HighPrecisionDatetime_tag_swigregister -blpapi_HighPrecisionDatetime_tag_swigregister(blpapi_HighPrecisionDatetime_tag) + +# Register blpapi_HighPrecisionDatetime_tag in _internals: +_internals.blpapi_HighPrecisionDatetime_tag_swigregister(blpapi_HighPrecisionDatetime_tag) def blpapi_HighPrecisionDatetime_compare(lhs, rhs): return _internals.blpapi_HighPrecisionDatetime_compare(lhs, rhs) -blpapi_HighPrecisionDatetime_compare = _internals.blpapi_HighPrecisionDatetime_compare def blpapi_HighPrecisionDatetime_print(datetime, streamWriter, stream, level, spacesPerLevel): return _internals.blpapi_HighPrecisionDatetime_print(datetime, streamWriter, stream, level, spacesPerLevel) -blpapi_HighPrecisionDatetime_print = _internals.blpapi_HighPrecisionDatetime_print def blpapi_HighPrecisionDatetime_fromTimePoint(datetime, offset): return _internals.blpapi_HighPrecisionDatetime_fromTimePoint(datetime, offset) -blpapi_HighPrecisionDatetime_fromTimePoint = _internals.blpapi_HighPrecisionDatetime_fromTimePoint def blpapi_Constant_name(constant): return _internals.blpapi_Constant_name(constant) -blpapi_Constant_name = _internals.blpapi_Constant_name def blpapi_Constant_description(constant): return _internals.blpapi_Constant_description(constant) -blpapi_Constant_description = _internals.blpapi_Constant_description def blpapi_Constant_status(constant): return _internals.blpapi_Constant_status(constant) -blpapi_Constant_status = _internals.blpapi_Constant_status def blpapi_Constant_datatype(constant): return _internals.blpapi_Constant_datatype(constant) -blpapi_Constant_datatype = _internals.blpapi_Constant_datatype def blpapi_Constant_getValueAsChar(constant): return _internals.blpapi_Constant_getValueAsChar(constant) -blpapi_Constant_getValueAsChar = _internals.blpapi_Constant_getValueAsChar def blpapi_Constant_getValueAsInt32(constant): return _internals.blpapi_Constant_getValueAsInt32(constant) -blpapi_Constant_getValueAsInt32 = _internals.blpapi_Constant_getValueAsInt32 def blpapi_Constant_getValueAsInt64(constant): return _internals.blpapi_Constant_getValueAsInt64(constant) -blpapi_Constant_getValueAsInt64 = _internals.blpapi_Constant_getValueAsInt64 def blpapi_Constant_getValueAsFloat32(constant): return _internals.blpapi_Constant_getValueAsFloat32(constant) -blpapi_Constant_getValueAsFloat32 = _internals.blpapi_Constant_getValueAsFloat32 def blpapi_Constant_getValueAsFloat64(constant): return _internals.blpapi_Constant_getValueAsFloat64(constant) -blpapi_Constant_getValueAsFloat64 = _internals.blpapi_Constant_getValueAsFloat64 def blpapi_Constant_getValueAsDatetime(constant): return _internals.blpapi_Constant_getValueAsDatetime(constant) -blpapi_Constant_getValueAsDatetime = _internals.blpapi_Constant_getValueAsDatetime def blpapi_Constant_getValueAsString(constant): return _internals.blpapi_Constant_getValueAsString(constant) -blpapi_Constant_getValueAsString = _internals.blpapi_Constant_getValueAsString def blpapi_ConstantList_name(list): return _internals.blpapi_ConstantList_name(list) -blpapi_ConstantList_name = _internals.blpapi_ConstantList_name def blpapi_ConstantList_description(list): return _internals.blpapi_ConstantList_description(list) -blpapi_ConstantList_description = _internals.blpapi_ConstantList_description def blpapi_ConstantList_numConstants(list): return _internals.blpapi_ConstantList_numConstants(list) -blpapi_ConstantList_numConstants = _internals.blpapi_ConstantList_numConstants def blpapi_ConstantList_datatype(constant): return _internals.blpapi_ConstantList_datatype(constant) -blpapi_ConstantList_datatype = _internals.blpapi_ConstantList_datatype def blpapi_ConstantList_status(list): return _internals.blpapi_ConstantList_status(list) -blpapi_ConstantList_status = _internals.blpapi_ConstantList_status def blpapi_ConstantList_getConstant(constant, nameString, name): return _internals.blpapi_ConstantList_getConstant(constant, nameString, name) -blpapi_ConstantList_getConstant = _internals.blpapi_ConstantList_getConstant def blpapi_ConstantList_getConstantAt(constant, index): return _internals.blpapi_ConstantList_getConstantAt(constant, index) -blpapi_ConstantList_getConstantAt = _internals.blpapi_ConstantList_getConstantAt def blpapi_SchemaElementDefinition_name(field): return _internals.blpapi_SchemaElementDefinition_name(field) -blpapi_SchemaElementDefinition_name = _internals.blpapi_SchemaElementDefinition_name def blpapi_SchemaElementDefinition_description(field): return _internals.blpapi_SchemaElementDefinition_description(field) -blpapi_SchemaElementDefinition_description = _internals.blpapi_SchemaElementDefinition_description def blpapi_SchemaElementDefinition_status(field): return _internals.blpapi_SchemaElementDefinition_status(field) -blpapi_SchemaElementDefinition_status = _internals.blpapi_SchemaElementDefinition_status def blpapi_SchemaElementDefinition_type(field): return _internals.blpapi_SchemaElementDefinition_type(field) -blpapi_SchemaElementDefinition_type = _internals.blpapi_SchemaElementDefinition_type def blpapi_SchemaElementDefinition_numAlternateNames(field): return _internals.blpapi_SchemaElementDefinition_numAlternateNames(field) -blpapi_SchemaElementDefinition_numAlternateNames = _internals.blpapi_SchemaElementDefinition_numAlternateNames def blpapi_SchemaElementDefinition_getAlternateName(field, index): return _internals.blpapi_SchemaElementDefinition_getAlternateName(field, index) -blpapi_SchemaElementDefinition_getAlternateName = _internals.blpapi_SchemaElementDefinition_getAlternateName def blpapi_SchemaElementDefinition_minValues(field): return _internals.blpapi_SchemaElementDefinition_minValues(field) -blpapi_SchemaElementDefinition_minValues = _internals.blpapi_SchemaElementDefinition_minValues def blpapi_SchemaElementDefinition_maxValues(field): return _internals.blpapi_SchemaElementDefinition_maxValues(field) -blpapi_SchemaElementDefinition_maxValues = _internals.blpapi_SchemaElementDefinition_maxValues def blpapi_SchemaTypeDefinition_name(type): return _internals.blpapi_SchemaTypeDefinition_name(type) -blpapi_SchemaTypeDefinition_name = _internals.blpapi_SchemaTypeDefinition_name def blpapi_SchemaTypeDefinition_description(type): return _internals.blpapi_SchemaTypeDefinition_description(type) -blpapi_SchemaTypeDefinition_description = _internals.blpapi_SchemaTypeDefinition_description def blpapi_SchemaTypeDefinition_status(type): return _internals.blpapi_SchemaTypeDefinition_status(type) -blpapi_SchemaTypeDefinition_status = _internals.blpapi_SchemaTypeDefinition_status def blpapi_SchemaTypeDefinition_datatype(type): return _internals.blpapi_SchemaTypeDefinition_datatype(type) -blpapi_SchemaTypeDefinition_datatype = _internals.blpapi_SchemaTypeDefinition_datatype def blpapi_SchemaTypeDefinition_isComplexType(type): return _internals.blpapi_SchemaTypeDefinition_isComplexType(type) -blpapi_SchemaTypeDefinition_isComplexType = _internals.blpapi_SchemaTypeDefinition_isComplexType def blpapi_SchemaTypeDefinition_isSimpleType(type): return _internals.blpapi_SchemaTypeDefinition_isSimpleType(type) -blpapi_SchemaTypeDefinition_isSimpleType = _internals.blpapi_SchemaTypeDefinition_isSimpleType def blpapi_SchemaTypeDefinition_isEnumerationType(type): return _internals.blpapi_SchemaTypeDefinition_isEnumerationType(type) -blpapi_SchemaTypeDefinition_isEnumerationType = _internals.blpapi_SchemaTypeDefinition_isEnumerationType def blpapi_SchemaTypeDefinition_numElementDefinitions(type): return _internals.blpapi_SchemaTypeDefinition_numElementDefinitions(type) -blpapi_SchemaTypeDefinition_numElementDefinitions = _internals.blpapi_SchemaTypeDefinition_numElementDefinitions def blpapi_SchemaTypeDefinition_getElementDefinition(type, nameString, name): return _internals.blpapi_SchemaTypeDefinition_getElementDefinition(type, nameString, name) -blpapi_SchemaTypeDefinition_getElementDefinition = _internals.blpapi_SchemaTypeDefinition_getElementDefinition def blpapi_SchemaTypeDefinition_getElementDefinitionAt(type, index): return _internals.blpapi_SchemaTypeDefinition_getElementDefinitionAt(type, index) -blpapi_SchemaTypeDefinition_getElementDefinitionAt = _internals.blpapi_SchemaTypeDefinition_getElementDefinitionAt def blpapi_SchemaTypeDefinition_enumeration(element): return _internals.blpapi_SchemaTypeDefinition_enumeration(element) -blpapi_SchemaTypeDefinition_enumeration = _internals.blpapi_SchemaTypeDefinition_enumeration def blpapi_Request_destroy(request): return _internals.blpapi_Request_destroy(request) -blpapi_Request_destroy = _internals.blpapi_Request_destroy def blpapi_Request_elements(request): return _internals.blpapi_Request_elements(request) -blpapi_Request_elements = _internals.blpapi_Request_elements def blpapi_Request_setPreferredRoute(request, correlationId): return _internals.blpapi_Request_setPreferredRoute(request, correlationId) -blpapi_Request_setPreferredRoute = _internals.blpapi_Request_setPreferredRoute def blpapi_Request_getRequestId(request): return _internals.blpapi_Request_getRequestId(request) -blpapi_Request_getRequestId = _internals.blpapi_Request_getRequestId def blpapi_RequestTemplate_release(requestTemplate): return _internals.blpapi_RequestTemplate_release(requestTemplate) -blpapi_RequestTemplate_release = _internals.blpapi_RequestTemplate_release def blpapi_Operation_name(operation): return _internals.blpapi_Operation_name(operation) -blpapi_Operation_name = _internals.blpapi_Operation_name def blpapi_Operation_description(operation): return _internals.blpapi_Operation_description(operation) -blpapi_Operation_description = _internals.blpapi_Operation_description def blpapi_Operation_requestDefinition(operation): return _internals.blpapi_Operation_requestDefinition(operation) -blpapi_Operation_requestDefinition = _internals.blpapi_Operation_requestDefinition def blpapi_Operation_numResponseDefinitions(operation): return _internals.blpapi_Operation_numResponseDefinitions(operation) -blpapi_Operation_numResponseDefinitions = _internals.blpapi_Operation_numResponseDefinitions def blpapi_Operation_responseDefinition(operation, index): return _internals.blpapi_Operation_responseDefinition(operation, index) -blpapi_Operation_responseDefinition = _internals.blpapi_Operation_responseDefinition def blpapi_Operation_responseDefinitionFromName(operation, name): return _internals.blpapi_Operation_responseDefinitionFromName(operation, name) -blpapi_Operation_responseDefinitionFromName = _internals.blpapi_Operation_responseDefinitionFromName def blpapi_Service_name(service): return _internals.blpapi_Service_name(service) -blpapi_Service_name = _internals.blpapi_Service_name def blpapi_Service_description(service): return _internals.blpapi_Service_description(service) -blpapi_Service_description = _internals.blpapi_Service_description def blpapi_Service_numOperations(service): return _internals.blpapi_Service_numOperations(service) -blpapi_Service_numOperations = _internals.blpapi_Service_numOperations def blpapi_Service_numEventDefinitions(service): return _internals.blpapi_Service_numEventDefinitions(service) -blpapi_Service_numEventDefinitions = _internals.blpapi_Service_numEventDefinitions def blpapi_Service_addRef(service): return _internals.blpapi_Service_addRef(service) -blpapi_Service_addRef = _internals.blpapi_Service_addRef def blpapi_Service_release(service): return _internals.blpapi_Service_release(service) -blpapi_Service_release = _internals.blpapi_Service_release def blpapi_Service_authorizationServiceName(service): return _internals.blpapi_Service_authorizationServiceName(service) -blpapi_Service_authorizationServiceName = _internals.blpapi_Service_authorizationServiceName def blpapi_Service_getOperation(service, nameString, name): return _internals.blpapi_Service_getOperation(service, nameString, name) -blpapi_Service_getOperation = _internals.blpapi_Service_getOperation def blpapi_Service_getOperationAt(service, index): return _internals.blpapi_Service_getOperationAt(service, index) -blpapi_Service_getOperationAt = _internals.blpapi_Service_getOperationAt def blpapi_Service_getEventDefinition(service, nameString, name): return _internals.blpapi_Service_getEventDefinition(service, nameString, name) -blpapi_Service_getEventDefinition = _internals.blpapi_Service_getEventDefinition def blpapi_Service_getEventDefinitionAt(service, index): return _internals.blpapi_Service_getEventDefinitionAt(service, index) -blpapi_Service_getEventDefinitionAt = _internals.blpapi_Service_getEventDefinitionAt def blpapi_Service_createRequest(service, operation): return _internals.blpapi_Service_createRequest(service, operation) -blpapi_Service_createRequest = _internals.blpapi_Service_createRequest def blpapi_Service_createAuthorizationRequest(service, operation): return _internals.blpapi_Service_createAuthorizationRequest(service, operation) -blpapi_Service_createAuthorizationRequest = _internals.blpapi_Service_createAuthorizationRequest def blpapi_Service_createPublishEvent(service): return _internals.blpapi_Service_createPublishEvent(service) -blpapi_Service_createPublishEvent = _internals.blpapi_Service_createPublishEvent def blpapi_Service_createAdminEvent(service): return _internals.blpapi_Service_createAdminEvent(service) -blpapi_Service_createAdminEvent = _internals.blpapi_Service_createAdminEvent def blpapi_Service_createResponseEvent(service, correlationId): return _internals.blpapi_Service_createResponseEvent(service, correlationId) -blpapi_Service_createResponseEvent = _internals.blpapi_Service_createResponseEvent def blpapi_Message_messageType(message): return _internals.blpapi_Message_messageType(message) -blpapi_Message_messageType = _internals.blpapi_Message_messageType def blpapi_Message_topicName(message): return _internals.blpapi_Message_topicName(message) -blpapi_Message_topicName = _internals.blpapi_Message_topicName def blpapi_Message_service(message): return _internals.blpapi_Message_service(message) -blpapi_Message_service = _internals.blpapi_Message_service def blpapi_Message_numCorrelationIds(message): return _internals.blpapi_Message_numCorrelationIds(message) -blpapi_Message_numCorrelationIds = _internals.blpapi_Message_numCorrelationIds def blpapi_Message_correlationId(message, index): return _internals.blpapi_Message_correlationId(message, index) -blpapi_Message_correlationId = _internals.blpapi_Message_correlationId def blpapi_Message_getRequestId(message): return _internals.blpapi_Message_getRequestId(message) -blpapi_Message_getRequestId = _internals.blpapi_Message_getRequestId def blpapi_Message_elements(message): return _internals.blpapi_Message_elements(message) -blpapi_Message_elements = _internals.blpapi_Message_elements def blpapi_Message_fragmentType(message): return _internals.blpapi_Message_fragmentType(message) -blpapi_Message_fragmentType = _internals.blpapi_Message_fragmentType def blpapi_Message_recapType(message): return _internals.blpapi_Message_recapType(message) -blpapi_Message_recapType = _internals.blpapi_Message_recapType def blpapi_Message_addRef(message): return _internals.blpapi_Message_addRef(message) -blpapi_Message_addRef = _internals.blpapi_Message_addRef def blpapi_Message_release(message): return _internals.blpapi_Message_release(message) -blpapi_Message_release = _internals.blpapi_Message_release def blpapi_Message_timeReceived(message): return _internals.blpapi_Message_timeReceived(message) -blpapi_Message_timeReceived = _internals.blpapi_Message_timeReceived def blpapi_Event_eventType(event): return _internals.blpapi_Event_eventType(event) -blpapi_Event_eventType = _internals.blpapi_Event_eventType def blpapi_Event_release(event): return _internals.blpapi_Event_release(event) -blpapi_Event_release = _internals.blpapi_Event_release def blpapi_EventQueue_create(): return _internals.blpapi_EventQueue_create() -blpapi_EventQueue_create = _internals.blpapi_EventQueue_create def blpapi_EventQueue_destroy(eventQueue): return _internals.blpapi_EventQueue_destroy(eventQueue) -blpapi_EventQueue_destroy = _internals.blpapi_EventQueue_destroy def blpapi_EventQueue_nextEvent(eventQueue, timeout): return _internals.blpapi_EventQueue_nextEvent(eventQueue, timeout) -blpapi_EventQueue_nextEvent = _internals.blpapi_EventQueue_nextEvent def blpapi_EventQueue_purge(eventQueue): return _internals.blpapi_EventQueue_purge(eventQueue) -blpapi_EventQueue_purge = _internals.blpapi_EventQueue_purge def blpapi_EventQueue_tryNextEvent(eventQueue): return _internals.blpapi_EventQueue_tryNextEvent(eventQueue) -blpapi_EventQueue_tryNextEvent = _internals.blpapi_EventQueue_tryNextEvent def blpapi_MessageIterator_create(event): return _internals.blpapi_MessageIterator_create(event) -blpapi_MessageIterator_create = _internals.blpapi_MessageIterator_create def blpapi_MessageIterator_destroy(iterator): return _internals.blpapi_MessageIterator_destroy(iterator) -blpapi_MessageIterator_destroy = _internals.blpapi_MessageIterator_destroy def blpapi_MessageIterator_next(iterator): return _internals.blpapi_MessageIterator_next(iterator) -blpapi_MessageIterator_next = _internals.blpapi_MessageIterator_next def blpapi_Identity_release(handle): return _internals.blpapi_Identity_release(handle) -blpapi_Identity_release = _internals.blpapi_Identity_release def blpapi_Identity_addRef(handle): return _internals.blpapi_Identity_addRef(handle) -blpapi_Identity_addRef = _internals.blpapi_Identity_addRef def blpapi_Identity_hasEntitlements(handle, service, eidElement, entitlementIds, numEntitlements, failedEntitlements, failedEntitlementsCount): return _internals.blpapi_Identity_hasEntitlements(handle, service, eidElement, entitlementIds, numEntitlements, failedEntitlements, failedEntitlementsCount) -blpapi_Identity_hasEntitlements = _internals.blpapi_Identity_hasEntitlements def blpapi_Identity_isAuthorized(handle, service): return _internals.blpapi_Identity_isAuthorized(handle, service) -blpapi_Identity_isAuthorized = _internals.blpapi_Identity_isAuthorized def blpapi_Identity_getSeatType(handle): return _internals.blpapi_Identity_getSeatType(handle) -blpapi_Identity_getSeatType = _internals.blpapi_Identity_getSeatType def blpapi_HighResolutionClock_now(): return _internals.blpapi_HighResolutionClock_now() -blpapi_HighResolutionClock_now = _internals.blpapi_HighResolutionClock_now -def blpapi_AbstractSession_cancel(session, correlationIds, numCorrelationIds, requestLabel): - return _internals.blpapi_AbstractSession_cancel(session, correlationIds, numCorrelationIds, requestLabel) -blpapi_AbstractSession_cancel = _internals.blpapi_AbstractSession_cancel +def blpapi_AbstractSession_cancel(session, correlationIds, requestLabel): + return _internals.blpapi_AbstractSession_cancel(session, correlationIds, requestLabel) def blpapi_AbstractSession_sendAuthorizationRequest(session, request, identity, correlationId, eventQueue, requestLabel): return _internals.blpapi_AbstractSession_sendAuthorizationRequest(session, request, identity, correlationId, eventQueue, requestLabel) -blpapi_AbstractSession_sendAuthorizationRequest = _internals.blpapi_AbstractSession_sendAuthorizationRequest def blpapi_AbstractSession_openService(session, serviceIdentifier): return _internals.blpapi_AbstractSession_openService(session, serviceIdentifier) -blpapi_AbstractSession_openService = _internals.blpapi_AbstractSession_openService def blpapi_AbstractSession_openServiceAsync(session, serviceIdentifier, correlationId): return _internals.blpapi_AbstractSession_openServiceAsync(session, serviceIdentifier, correlationId) -blpapi_AbstractSession_openServiceAsync = _internals.blpapi_AbstractSession_openServiceAsync def blpapi_AbstractSession_generateToken(session, correlationId, eventQueue): return _internals.blpapi_AbstractSession_generateToken(session, correlationId, eventQueue) -blpapi_AbstractSession_generateToken = _internals.blpapi_AbstractSession_generateToken def blpapi_AbstractSession_generateManualToken(session, correlationId, user, manualIp, eventQueue): return _internals.blpapi_AbstractSession_generateManualToken(session, correlationId, user, manualIp, eventQueue) -blpapi_AbstractSession_generateManualToken = _internals.blpapi_AbstractSession_generateManualToken def blpapi_AbstractSession_getService(session, serviceIdentifier): return _internals.blpapi_AbstractSession_getService(session, serviceIdentifier) -blpapi_AbstractSession_getService = _internals.blpapi_AbstractSession_getService def blpapi_AbstractSession_createIdentity(session): return _internals.blpapi_AbstractSession_createIdentity(session) -blpapi_AbstractSession_createIdentity = _internals.blpapi_AbstractSession_createIdentity def blpapi_AbstractSession_generateAuthorizedIdentityAsync(session, authOptions, cid): return _internals.blpapi_AbstractSession_generateAuthorizedIdentityAsync(session, authOptions, cid) -blpapi_AbstractSession_generateAuthorizedIdentityAsync = _internals.blpapi_AbstractSession_generateAuthorizedIdentityAsync def blpapi_AbstractSession_getAuthorizedIdentity(session, cid): return _internals.blpapi_AbstractSession_getAuthorizedIdentity(session, cid) -blpapi_AbstractSession_getAuthorizedIdentity = _internals.blpapi_AbstractSession_getAuthorizedIdentity def blpapi_Session_start(session): return _internals.blpapi_Session_start(session) -blpapi_Session_start = _internals.blpapi_Session_start def blpapi_Session_startAsync(session): return _internals.blpapi_Session_startAsync(session) -blpapi_Session_startAsync = _internals.blpapi_Session_startAsync def blpapi_Session_stop(session): return _internals.blpapi_Session_stop(session) -blpapi_Session_stop = _internals.blpapi_Session_stop def blpapi_Session_stopAsync(session): return _internals.blpapi_Session_stopAsync(session) -blpapi_Session_stopAsync = _internals.blpapi_Session_stopAsync def blpapi_Session_nextEvent(session, timeoutInMilliseconds): return _internals.blpapi_Session_nextEvent(session, timeoutInMilliseconds) -blpapi_Session_nextEvent = _internals.blpapi_Session_nextEvent def blpapi_Session_tryNextEvent(session): return _internals.blpapi_Session_tryNextEvent(session) -blpapi_Session_tryNextEvent = _internals.blpapi_Session_tryNextEvent def blpapi_Session_subscribe(session, subscriptionList, handle, requestLabel): return _internals.blpapi_Session_subscribe(session, subscriptionList, handle, requestLabel) -blpapi_Session_subscribe = _internals.blpapi_Session_subscribe def blpapi_Session_resubscribe(session, resubscriptionList, requestLabel): return _internals.blpapi_Session_resubscribe(session, resubscriptionList, requestLabel) -blpapi_Session_resubscribe = _internals.blpapi_Session_resubscribe def blpapi_Session_resubscribeWithId(session, resubscriptionList, resubscriptionId, requestLabel): return _internals.blpapi_Session_resubscribeWithId(session, resubscriptionList, resubscriptionId, requestLabel) -blpapi_Session_resubscribeWithId = _internals.blpapi_Session_resubscribeWithId def blpapi_Session_unsubscribe(session, unsubscriptionList, requestLabel): return _internals.blpapi_Session_unsubscribe(session, unsubscriptionList, requestLabel) -blpapi_Session_unsubscribe = _internals.blpapi_Session_unsubscribe def blpapi_Session_setStatusCorrelationId(session, service, identity, correlationId): return _internals.blpapi_Session_setStatusCorrelationId(session, service, identity, correlationId) -blpapi_Session_setStatusCorrelationId = _internals.blpapi_Session_setStatusCorrelationId def blpapi_Session_sendRequest(session, request, correlationId, identity, eventQueue, requestLabel): return _internals.blpapi_Session_sendRequest(session, request, correlationId, identity, eventQueue, requestLabel) -blpapi_Session_sendRequest = _internals.blpapi_Session_sendRequest def blpapi_Session_sendRequestTemplate(session, requestTemplate, correlationId): return _internals.blpapi_Session_sendRequestTemplate(session, requestTemplate, correlationId) -blpapi_Session_sendRequestTemplate = _internals.blpapi_Session_sendRequestTemplate def blpapi_Session_createSnapshotRequestTemplate(session, subscriptionString, identity, correlationId): return _internals.blpapi_Session_createSnapshotRequestTemplate(session, subscriptionString, identity, correlationId) -blpapi_Session_createSnapshotRequestTemplate = _internals.blpapi_Session_createSnapshotRequestTemplate def blpapi_Session_getAbstractSession(session): return _internals.blpapi_Session_getAbstractSession(session) -blpapi_Session_getAbstractSession = _internals.blpapi_Session_getAbstractSession def blpapi_ResolutionList_extractAttributeFromResolutionSuccess(message, attribute): return _internals.blpapi_ResolutionList_extractAttributeFromResolutionSuccess(message, attribute) -blpapi_ResolutionList_extractAttributeFromResolutionSuccess = _internals.blpapi_ResolutionList_extractAttributeFromResolutionSuccess -def blpapi_ResolutionList_create(arg1): - return _internals.blpapi_ResolutionList_create(arg1) -blpapi_ResolutionList_create = _internals.blpapi_ResolutionList_create +def blpapi_ResolutionList_create(_from): + return _internals.blpapi_ResolutionList_create(_from) def blpapi_ResolutionList_destroy(list): return _internals.blpapi_ResolutionList_destroy(list) -blpapi_ResolutionList_destroy = _internals.blpapi_ResolutionList_destroy def blpapi_ResolutionList_add(list, topic, correlationId): return _internals.blpapi_ResolutionList_add(list, topic, correlationId) -blpapi_ResolutionList_add = _internals.blpapi_ResolutionList_add def blpapi_ResolutionList_addFromMessage(list, topic, correlationId): return _internals.blpapi_ResolutionList_addFromMessage(list, topic, correlationId) -blpapi_ResolutionList_addFromMessage = _internals.blpapi_ResolutionList_addFromMessage def blpapi_ResolutionList_addAttribute(list, name): return _internals.blpapi_ResolutionList_addAttribute(list, name) -blpapi_ResolutionList_addAttribute = _internals.blpapi_ResolutionList_addAttribute def blpapi_ResolutionList_correlationIdAt(list, index): return _internals.blpapi_ResolutionList_correlationIdAt(list, index) -blpapi_ResolutionList_correlationIdAt = _internals.blpapi_ResolutionList_correlationIdAt def blpapi_ResolutionList_topicString(list, id): return _internals.blpapi_ResolutionList_topicString(list, id) -blpapi_ResolutionList_topicString = _internals.blpapi_ResolutionList_topicString def blpapi_ResolutionList_topicStringAt(list, index): return _internals.blpapi_ResolutionList_topicStringAt(list, index) -blpapi_ResolutionList_topicStringAt = _internals.blpapi_ResolutionList_topicStringAt def blpapi_ResolutionList_status(list, id): return _internals.blpapi_ResolutionList_status(list, id) -blpapi_ResolutionList_status = _internals.blpapi_ResolutionList_status def blpapi_ResolutionList_statusAt(list, index): return _internals.blpapi_ResolutionList_statusAt(list, index) -blpapi_ResolutionList_statusAt = _internals.blpapi_ResolutionList_statusAt def blpapi_ResolutionList_attribute(list, attribute, id): return _internals.blpapi_ResolutionList_attribute(list, attribute, id) -blpapi_ResolutionList_attribute = _internals.blpapi_ResolutionList_attribute def blpapi_ResolutionList_attributeAt(list, attribute, index): return _internals.blpapi_ResolutionList_attributeAt(list, attribute, index) -blpapi_ResolutionList_attributeAt = _internals.blpapi_ResolutionList_attributeAt def blpapi_ResolutionList_message(list, id): return _internals.blpapi_ResolutionList_message(list, id) -blpapi_ResolutionList_message = _internals.blpapi_ResolutionList_message def blpapi_ResolutionList_messageAt(list, index): return _internals.blpapi_ResolutionList_messageAt(list, index) -blpapi_ResolutionList_messageAt = _internals.blpapi_ResolutionList_messageAt def blpapi_ResolutionList_size(list): return _internals.blpapi_ResolutionList_size(list) -blpapi_ResolutionList_size = _internals.blpapi_ResolutionList_size def blpapi_TestUtil_createEvent(eventType): return _internals.blpapi_TestUtil_createEvent(eventType) -blpapi_TestUtil_createEvent = _internals.blpapi_TestUtil_createEvent def blpapi_TestUtil_deserializeService(schema, schemaLength): return _internals.blpapi_TestUtil_deserializeService(schema, schemaLength) -blpapi_TestUtil_deserializeService = _internals.blpapi_TestUtil_deserializeService def blpapi_TestUtil_serializeService(streamWriter, stream, service): return _internals.blpapi_TestUtil_serializeService(streamWriter, stream, service) -blpapi_TestUtil_serializeService = _internals.blpapi_TestUtil_serializeService def blpapi_TestUtil_appendMessage(event, messageType, properties): return _internals.blpapi_TestUtil_appendMessage(event, messageType, properties) -blpapi_TestUtil_appendMessage = _internals.blpapi_TestUtil_appendMessage def blpapi_TestUtil_createTopic(service, isActive): return _internals.blpapi_TestUtil_createTopic(service, isActive) -blpapi_TestUtil_createTopic = _internals.blpapi_TestUtil_createTopic def blpapi_TestUtil_getAdminMessageDefinition(messageName): return _internals.blpapi_TestUtil_getAdminMessageDefinition(messageName) -blpapi_TestUtil_getAdminMessageDefinition = _internals.blpapi_TestUtil_getAdminMessageDefinition def blpapi_MessageProperties_create(): return _internals.blpapi_MessageProperties_create() -blpapi_MessageProperties_create = _internals.blpapi_MessageProperties_create def blpapi_MessageProperties_destroy(messageProperties): return _internals.blpapi_MessageProperties_destroy(messageProperties) -blpapi_MessageProperties_destroy = _internals.blpapi_MessageProperties_destroy def blpapi_MessageProperties_copy(src): return _internals.blpapi_MessageProperties_copy(src) -blpapi_MessageProperties_copy = _internals.blpapi_MessageProperties_copy def blpapi_MessageProperties_assign(lhs, rhs): return _internals.blpapi_MessageProperties_assign(lhs, rhs) -blpapi_MessageProperties_assign = _internals.blpapi_MessageProperties_assign def blpapi_MessageProperties_setCorrelationIds(messageProperties, correlationIds): return _internals.blpapi_MessageProperties_setCorrelationIds(messageProperties, correlationIds) -blpapi_MessageProperties_setCorrelationIds = _internals.blpapi_MessageProperties_setCorrelationIds def blpapi_MessageProperties_setRecapType(messageProperties, recap, fragment): return _internals.blpapi_MessageProperties_setRecapType(messageProperties, recap, fragment) -blpapi_MessageProperties_setRecapType = _internals.blpapi_MessageProperties_setRecapType def blpapi_MessageProperties_setTimeReceived(messageProperties, timestamp): return _internals.blpapi_MessageProperties_setTimeReceived(messageProperties, timestamp) -blpapi_MessageProperties_setTimeReceived = _internals.blpapi_MessageProperties_setTimeReceived def blpapi_MessageProperties_setService(messageProperties, service): return _internals.blpapi_MessageProperties_setService(messageProperties, service) -blpapi_MessageProperties_setService = _internals.blpapi_MessageProperties_setService def blpapi_MessageProperties_setRequestId(messageProperties, requestId): return _internals.blpapi_MessageProperties_setRequestId(messageProperties, requestId) -blpapi_MessageProperties_setRequestId = _internals.blpapi_MessageProperties_setRequestId -def blpapi_Topic_create(arg1): - return _internals.blpapi_Topic_create(arg1) -blpapi_Topic_create = _internals.blpapi_Topic_create +def blpapi_Topic_create(_from): + return _internals.blpapi_Topic_create(_from) def blpapi_Topic_destroy(victim): return _internals.blpapi_Topic_destroy(victim) -blpapi_Topic_destroy = _internals.blpapi_Topic_destroy def blpapi_Topic_compare(lhs, rhs): return _internals.blpapi_Topic_compare(lhs, rhs) -blpapi_Topic_compare = _internals.blpapi_Topic_compare def blpapi_Topic_service(topic): return _internals.blpapi_Topic_service(topic) -blpapi_Topic_service = _internals.blpapi_Topic_service def blpapi_Topic_isActive(topic): return _internals.blpapi_Topic_isActive(topic) -blpapi_Topic_isActive = _internals.blpapi_Topic_isActive -def blpapi_TopicList_create(arg1): - return _internals.blpapi_TopicList_create(arg1) -blpapi_TopicList_create = _internals.blpapi_TopicList_create +def blpapi_TopicList_create(_from): + return _internals.blpapi_TopicList_create(_from) def blpapi_TopicList_destroy(list): return _internals.blpapi_TopicList_destroy(list) -blpapi_TopicList_destroy = _internals.blpapi_TopicList_destroy def blpapi_TopicList_add(list, topic, correlationId): return _internals.blpapi_TopicList_add(list, topic, correlationId) -blpapi_TopicList_add = _internals.blpapi_TopicList_add def blpapi_TopicList_addFromMessage(list, topic, correlationId): return _internals.blpapi_TopicList_addFromMessage(list, topic, correlationId) -blpapi_TopicList_addFromMessage = _internals.blpapi_TopicList_addFromMessage def blpapi_TopicList_correlationIdAt(list, index): return _internals.blpapi_TopicList_correlationIdAt(list, index) -blpapi_TopicList_correlationIdAt = _internals.blpapi_TopicList_correlationIdAt def blpapi_TopicList_topicString(list, id): return _internals.blpapi_TopicList_topicString(list, id) -blpapi_TopicList_topicString = _internals.blpapi_TopicList_topicString def blpapi_TopicList_topicStringAt(list, index): return _internals.blpapi_TopicList_topicStringAt(list, index) -blpapi_TopicList_topicStringAt = _internals.blpapi_TopicList_topicStringAt def blpapi_TopicList_status(list, id): return _internals.blpapi_TopicList_status(list, id) -blpapi_TopicList_status = _internals.blpapi_TopicList_status def blpapi_TopicList_statusAt(list, index): return _internals.blpapi_TopicList_statusAt(list, index) -blpapi_TopicList_statusAt = _internals.blpapi_TopicList_statusAt def blpapi_TopicList_message(list, id): return _internals.blpapi_TopicList_message(list, id) -blpapi_TopicList_message = _internals.blpapi_TopicList_message def blpapi_TopicList_messageAt(list, index): return _internals.blpapi_TopicList_messageAt(list, index) -blpapi_TopicList_messageAt = _internals.blpapi_TopicList_messageAt def blpapi_TopicList_size(list): return _internals.blpapi_TopicList_size(list) -blpapi_TopicList_size = _internals.blpapi_TopicList_size def blpapi_ProviderSession_create(parameters, handler, dispatcher, userData): return _internals.blpapi_ProviderSession_create(parameters, handler, dispatcher, userData) -blpapi_ProviderSession_create = _internals.blpapi_ProviderSession_create def blpapi_ProviderSession_destroy(session): return _internals.blpapi_ProviderSession_destroy(session) -blpapi_ProviderSession_destroy = _internals.blpapi_ProviderSession_destroy def blpapi_ProviderSession_start(session): return _internals.blpapi_ProviderSession_start(session) -blpapi_ProviderSession_start = _internals.blpapi_ProviderSession_start def blpapi_ProviderSession_startAsync(session): return _internals.blpapi_ProviderSession_startAsync(session) -blpapi_ProviderSession_startAsync = _internals.blpapi_ProviderSession_startAsync def blpapi_ProviderSession_stop(session): return _internals.blpapi_ProviderSession_stop(session) -blpapi_ProviderSession_stop = _internals.blpapi_ProviderSession_stop def blpapi_ProviderSession_stopAsync(session): return _internals.blpapi_ProviderSession_stopAsync(session) -blpapi_ProviderSession_stopAsync = _internals.blpapi_ProviderSession_stopAsync def blpapi_ProviderSession_nextEvent(session, timeoutInMilliseconds): return _internals.blpapi_ProviderSession_nextEvent(session, timeoutInMilliseconds) -blpapi_ProviderSession_nextEvent = _internals.blpapi_ProviderSession_nextEvent def blpapi_ProviderSession_tryNextEvent(session): return _internals.blpapi_ProviderSession_tryNextEvent(session) -blpapi_ProviderSession_tryNextEvent = _internals.blpapi_ProviderSession_tryNextEvent def blpapi_ProviderSession_registerService(session, serviceName, identity, registrationOptions): return _internals.blpapi_ProviderSession_registerService(session, serviceName, identity, registrationOptions) -blpapi_ProviderSession_registerService = _internals.blpapi_ProviderSession_registerService def blpapi_ProviderSession_activateSubServiceCodeRange(session, serviceName, begin, end, priority): return _internals.blpapi_ProviderSession_activateSubServiceCodeRange(session, serviceName, begin, end, priority) -blpapi_ProviderSession_activateSubServiceCodeRange = _internals.blpapi_ProviderSession_activateSubServiceCodeRange def blpapi_ProviderSession_deactivateSubServiceCodeRange(session, serviceName, begin, end): return _internals.blpapi_ProviderSession_deactivateSubServiceCodeRange(session, serviceName, begin, end) -blpapi_ProviderSession_deactivateSubServiceCodeRange = _internals.blpapi_ProviderSession_deactivateSubServiceCodeRange def blpapi_ProviderSession_registerServiceAsync(session, serviceName, identity, correlationId, registrationOptions): return _internals.blpapi_ProviderSession_registerServiceAsync(session, serviceName, identity, correlationId, registrationOptions) -blpapi_ProviderSession_registerServiceAsync = _internals.blpapi_ProviderSession_registerServiceAsync def blpapi_ProviderSession_deregisterService(session, serviceName): return _internals.blpapi_ProviderSession_deregisterService(session, serviceName) -blpapi_ProviderSession_deregisterService = _internals.blpapi_ProviderSession_deregisterService def blpapi_ProviderSession_resolve(session, resolutionList, resolveMode, identity): return _internals.blpapi_ProviderSession_resolve(session, resolutionList, resolveMode, identity) -blpapi_ProviderSession_resolve = _internals.blpapi_ProviderSession_resolve def blpapi_ProviderSession_resolveAsync(session, resolutionList, resolveMode, identity): return _internals.blpapi_ProviderSession_resolveAsync(session, resolutionList, resolveMode, identity) -blpapi_ProviderSession_resolveAsync = _internals.blpapi_ProviderSession_resolveAsync def blpapi_ProviderSession_createTopics(session, topicList, resolveMode, identity): return _internals.blpapi_ProviderSession_createTopics(session, topicList, resolveMode, identity) -blpapi_ProviderSession_createTopics = _internals.blpapi_ProviderSession_createTopics def blpapi_ProviderSession_createTopicsAsync(session, topicList, resolveMode, identity): return _internals.blpapi_ProviderSession_createTopicsAsync(session, topicList, resolveMode, identity) -blpapi_ProviderSession_createTopicsAsync = _internals.blpapi_ProviderSession_createTopicsAsync def blpapi_ProviderSession_getTopic(session, message): return _internals.blpapi_ProviderSession_getTopic(session, message) -blpapi_ProviderSession_getTopic = _internals.blpapi_ProviderSession_getTopic def blpapi_ProviderSession_createTopic(session, message): return _internals.blpapi_ProviderSession_createTopic(session, message) -blpapi_ProviderSession_createTopic = _internals.blpapi_ProviderSession_createTopic def blpapi_ProviderSession_createServiceStatusTopic(session, service): return _internals.blpapi_ProviderSession_createServiceStatusTopic(session, service) -blpapi_ProviderSession_createServiceStatusTopic = _internals.blpapi_ProviderSession_createServiceStatusTopic def blpapi_ProviderSession_deleteTopics(session, topics, numTopics): return _internals.blpapi_ProviderSession_deleteTopics(session, topics, numTopics) -blpapi_ProviderSession_deleteTopics = _internals.blpapi_ProviderSession_deleteTopics def blpapi_ProviderSession_terminateSubscriptionsOnTopics(session, topics, numTopics, message): return _internals.blpapi_ProviderSession_terminateSubscriptionsOnTopics(session, topics, numTopics, message) -blpapi_ProviderSession_terminateSubscriptionsOnTopics = _internals.blpapi_ProviderSession_terminateSubscriptionsOnTopics def blpapi_ProviderSession_publish(session, event): return _internals.blpapi_ProviderSession_publish(session, event) -blpapi_ProviderSession_publish = _internals.blpapi_ProviderSession_publish def blpapi_ProviderSession_sendResponse(session, event, isPartialResponse): return _internals.blpapi_ProviderSession_sendResponse(session, event, isPartialResponse) -blpapi_ProviderSession_sendResponse = _internals.blpapi_ProviderSession_sendResponse def blpapi_ProviderSession_getAbstractSession(session): return _internals.blpapi_ProviderSession_getAbstractSession(session) -blpapi_ProviderSession_getAbstractSession = _internals.blpapi_ProviderSession_getAbstractSession def blpapi_ProviderSession_flushPublishedEvents(session, timeoutMsecs): return _internals.blpapi_ProviderSession_flushPublishedEvents(session, timeoutMsecs) -blpapi_ProviderSession_flushPublishedEvents = _internals.blpapi_ProviderSession_flushPublishedEvents def blpapi_ServiceRegistrationOptions_create(): return _internals.blpapi_ServiceRegistrationOptions_create() -blpapi_ServiceRegistrationOptions_create = _internals.blpapi_ServiceRegistrationOptions_create def blpapi_ServiceRegistrationOptions_duplicate(parameters): return _internals.blpapi_ServiceRegistrationOptions_duplicate(parameters) -blpapi_ServiceRegistrationOptions_duplicate = _internals.blpapi_ServiceRegistrationOptions_duplicate def blpapi_ServiceRegistrationOptions_destroy(parameters): return _internals.blpapi_ServiceRegistrationOptions_destroy(parameters) -blpapi_ServiceRegistrationOptions_destroy = _internals.blpapi_ServiceRegistrationOptions_destroy def blpapi_ServiceRegistrationOptions_copy(lhs, rhs): return _internals.blpapi_ServiceRegistrationOptions_copy(lhs, rhs) -blpapi_ServiceRegistrationOptions_copy = _internals.blpapi_ServiceRegistrationOptions_copy def blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange(parameters, start, end, priority): return _internals.blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange(parameters, start, end, priority) -blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange = _internals.blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange def blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges(parameters): return _internals.blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges(parameters) -blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges = _internals.blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges def blpapi_ServiceRegistrationOptions_setGroupId(parameters, groupId): return _internals.blpapi_ServiceRegistrationOptions_setGroupId(parameters, groupId) -blpapi_ServiceRegistrationOptions_setGroupId = _internals.blpapi_ServiceRegistrationOptions_setGroupId def blpapi_ServiceRegistrationOptions_setServicePriority(parameters, priority): return _internals.blpapi_ServiceRegistrationOptions_setServicePriority(parameters, priority) -blpapi_ServiceRegistrationOptions_setServicePriority = _internals.blpapi_ServiceRegistrationOptions_setServicePriority def blpapi_ServiceRegistrationOptions_setPartsToRegister(parameters, parts): return _internals.blpapi_ServiceRegistrationOptions_setPartsToRegister(parameters, parts) -blpapi_ServiceRegistrationOptions_setPartsToRegister = _internals.blpapi_ServiceRegistrationOptions_setPartsToRegister def blpapi_ServiceRegistrationOptions_getGroupId(parameters): return _internals.blpapi_ServiceRegistrationOptions_getGroupId(parameters) -blpapi_ServiceRegistrationOptions_getGroupId = _internals.blpapi_ServiceRegistrationOptions_getGroupId def blpapi_ServiceRegistrationOptions_getServicePriority(parameters): return _internals.blpapi_ServiceRegistrationOptions_getServicePriority(parameters) -blpapi_ServiceRegistrationOptions_getServicePriority = _internals.blpapi_ServiceRegistrationOptions_getServicePriority def blpapi_ServiceRegistrationOptions_getPartsToRegister(parameters): return _internals.blpapi_ServiceRegistrationOptions_getPartsToRegister(parameters) -blpapi_ServiceRegistrationOptions_getPartsToRegister = _internals.blpapi_ServiceRegistrationOptions_getPartsToRegister def blpapi_ZfpUtil_getOptionsForLeasedLines(sessionOptions, tlsOptions, remote): return _internals.blpapi_ZfpUtil_getOptionsForLeasedLines(sessionOptions, tlsOptions, remote) -blpapi_ZfpUtil_getOptionsForLeasedLines = _internals.blpapi_ZfpUtil_getOptionsForLeasedLines -# This file is compatible with both classic and new-style classes. diff --git a/blpapi/internals_wrap.c b/src/blpapi/internals_wrap.c similarity index 77% rename from blpapi/internals_wrap.c rename to src/blpapi/internals_wrap.c index d294ed4..cfe3c57 100644 --- a/blpapi/internals_wrap.c +++ b/src/blpapi/internals_wrap.c @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 3.0.12 + * Version 4.0.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 @@ -141,11 +141,16 @@ #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(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG) /* Use debug wrappers with the Python release dll */ # undef _DEBUG # include -# define _DEBUG +# define _DEBUG 1 #else # include #endif @@ -195,6 +200,7 @@ /* Flags for pointer conversions */ #define SWIG_POINTER_DISOWN 0x1 #define SWIG_CAST_NEW_MEMORY 0x2 +#define SWIG_POINTER_NO_NULL 0x4 /* Flags for new pointer objects */ #define SWIG_POINTER_OWN 0x1 @@ -419,7 +425,7 @@ SWIG_TypeCheck(const char *c, swig_type_info *ty) { swig_cast_info *iter = ty->cast; while (iter) { if (strcmp(iter->type->name, c) == 0) { -#if 0 + #if 0 if (iter == ty->cast) return iter; /* Move iter to the top of the linked list */ @@ -430,7 +436,7 @@ SWIG_TypeCheck(const char *c, swig_type_info *ty) { iter->prev = 0; if (ty->cast) ty->cast->prev = iter; ty->cast = iter; -#endif + #endif return iter; } iter = iter->next; @@ -448,7 +454,7 @@ SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) { swig_cast_info *iter = ty->cast; while (iter) { if (iter->type == from) { -#if 0 + #if 0 if (iter == ty->cast) return iter; /* Move iter to the top of the linked list */ @@ -459,7 +465,7 @@ SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) { iter->prev = 0; if (ty->cast) ty->cast->prev = iter; ty->cast = iter; -#endif + #endif return iter; } iter = iter->next; @@ -784,14 +790,16 @@ SWIGINTERN char* SWIG_Python_str_AsChar(PyObject *str) { #if PY_VERSION_HEX >= 0x03000000 - char *cstr; - char *newstr; - Py_ssize_t len; + char *newstr = 0; str = PyUnicode_AsUTF8String(str); - PyBytes_AsStringAndSize(str, &cstr, &len); - newstr = (char *) malloc(len+1); - memcpy(newstr, cstr, len+1); - Py_XDECREF(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; #else return PyString_AsString(str); @@ -815,144 +823,14 @@ SWIG_Python_str_FromChar(const char *c) #endif } -/* Add PyOS_snprintf for old Pythons */ -#if PY_VERSION_HEX < 0x02020000 -# if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM) -# define PyOS_snprintf _snprintf -# else -# define PyOS_snprintf snprintf -# endif -#endif - -/* A crude PyString_FromFormat implementation for old Pythons */ -#if PY_VERSION_HEX < 0x02020000 - -#ifndef SWIG_PYBUFFER_SIZE -# define SWIG_PYBUFFER_SIZE 1024 -#endif - -static PyObject * -PyString_FromFormat(const char *fmt, ...) { - va_list ap; - char buf[SWIG_PYBUFFER_SIZE * 2]; - int res; - va_start(ap, fmt); - res = vsnprintf(buf, sizeof(buf), fmt, ap); - va_end(ap); - return (res < 0 || res >= (int)sizeof(buf)) ? 0 : PyString_FromString(buf); -} -#endif - #ifndef PyObject_DEL # define PyObject_DEL PyObject_Del #endif -/* A crude PyExc_StopIteration exception for old Pythons */ -#if PY_VERSION_HEX < 0x02020000 -# ifndef PyExc_StopIteration -# define PyExc_StopIteration PyExc_RuntimeError -# endif -# ifndef PyObject_GenericGetAttr -# define PyObject_GenericGetAttr 0 -# endif -#endif - -/* Py_NotImplemented is defined in 2.1 and up. */ -#if PY_VERSION_HEX < 0x02010000 -# ifndef Py_NotImplemented -# define Py_NotImplemented PyExc_RuntimeError -# endif -#endif - -/* A crude PyString_AsStringAndSize implementation for old Pythons */ -#if PY_VERSION_HEX < 0x02010000 -# ifndef PyString_AsStringAndSize -# define PyString_AsStringAndSize(obj, s, len) {*s = PyString_AsString(obj); *len = *s ? strlen(*s) : 0;} -# endif -#endif - -/* PySequence_Size for old Pythons */ -#if PY_VERSION_HEX < 0x02000000 -# ifndef PySequence_Size -# define PySequence_Size PySequence_Length -# endif -#endif - -/* PyBool_FromLong for old Pythons */ -#if PY_VERSION_HEX < 0x02030000 -static -PyObject *PyBool_FromLong(long ok) -{ - PyObject *result = ok ? Py_True : Py_False; - Py_INCREF(result); - return result; -} -#endif - -/* Py_ssize_t for old Pythons */ -/* This code is as recommended by: */ -/* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */ -#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) -typedef int Py_ssize_t; -# define PY_SSIZE_T_MAX INT_MAX -# define PY_SSIZE_T_MIN INT_MIN -typedef inquiry lenfunc; -typedef intargfunc ssizeargfunc; -typedef intintargfunc ssizessizeargfunc; -typedef intobjargproc ssizeobjargproc; -typedef intintobjargproc ssizessizeobjargproc; -typedef getreadbufferproc readbufferproc; -typedef getwritebufferproc writebufferproc; -typedef getsegcountproc segcountproc; -typedef getcharbufferproc charbufferproc; -static long PyNumber_AsSsize_t (PyObject *x, void *SWIGUNUSEDPARM(exc)) -{ - long result = 0; - PyObject *i = PyNumber_Int(x); - if (i) { - result = PyInt_AsLong(i); - Py_DECREF(i); - } - return result; -} -#endif - -#if PY_VERSION_HEX < 0x02050000 -#define PyInt_FromSize_t(x) PyInt_FromLong((long)x) -#endif - -#if PY_VERSION_HEX < 0x02040000 -#define Py_VISIT(op) \ - do { \ - if (op) { \ - int vret = visit((op), arg); \ - if (vret) \ - return vret; \ - } \ - } while (0) -#endif - -#if PY_VERSION_HEX < 0x02030000 -typedef struct { - PyTypeObject type; - PyNumberMethods as_number; - PyMappingMethods as_mapping; - PySequenceMethods as_sequence; - PyBufferProcs as_buffer; - PyObject *name, *slots; -} PyHeapTypeObject; -#endif - -#if PY_VERSION_HEX < 0x02030000 -typedef destructor freefunc; -#endif - -#if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION > 6) || \ - (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION > 0) || \ - (PY_MAJOR_VERSION > 3)) +// 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 ((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME) -#endif +# define SWIGPY_CAPSULE_NAME ("swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME) #if PY_VERSION_HEX < 0x03020000 #define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type) @@ -1015,14 +893,17 @@ SWIG_Python_AddErrorMsg(const char* mesg) PyObject *value = 0; PyObject *traceback = 0; - if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback); + if (PyErr_Occurred()) + PyErr_Fetch(&type, &value, &traceback); if (value) { - char *tmp; PyObject *old_str = PyObject_Str(value); + const char *tmp = SWIG_Python_str_AsChar(old_str); PyErr_Clear(); Py_XINCREF(type); - - PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); + if (tmp) + 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); @@ -1031,6 +912,37 @@ SWIG_Python_AddErrorMsg(const char* mesg) } } +SWIGRUNTIME int +SWIG_Python_TypeErrorOccurred(PyObject *obj) +{ + PyObject *error; + if (obj) + return 0; + error = PyErr_Occurred(); + return error && PyErr_GivenExceptionMatches(error, PyExc_TypeError); +} + +SWIGRUNTIME void +SWIG_Python_RaiseOrModifyTypeError(const char *message) +{ + if (SWIG_Python_TypeErrorOccurred(NULL)) { + /* Use existing TypeError to preserve stacktrace and enhance with given message */ + PyObject *newvalue; + PyObject *type = NULL, *value = NULL, *traceback = NULL; + PyErr_Fetch(&type, &value, &traceback); +#if PY_VERSION_HEX >= 0x03000000 + newvalue = PyUnicode_FromFormat("%S\nAdditional information:\n%s", value, message); +#else + newvalue = PyString_FromFormat("%s\nAdditional information:\n%s", PyString_AsString(value), message); +#endif + Py_XDECREF(value); + PyErr_Restore(type, newvalue, traceback); + } else { + /* Raise TypeError using given message */ + PyErr_SetString(PyExc_TypeError, message); + } +} + #if defined(SWIG_PYTHON_NO_THREADS) # if defined(SWIG_PYTHON_THREADS) # undef SWIG_PYTHON_THREADS @@ -1038,9 +950,7 @@ SWIG_Python_AddErrorMsg(const char* mesg) #endif #if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */ # if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL) -# if (PY_VERSION_HEX >= 0x02030000) /* For 2.3 or later, use the PyGILState calls */ -# define SWIG_PYTHON_USE_GIL -# endif +# define SWIG_PYTHON_USE_GIL # endif # if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */ # ifndef SWIG_PYTHON_INITIALIZE_THREADS @@ -1117,30 +1027,13 @@ extern "C" { /* Constant information structure */ typedef struct swig_const_info { int type; - char *name; + const char *name; long lvalue; double dvalue; void *pvalue; swig_type_info **ptype; } swig_const_info; - -/* ----------------------------------------------------------------------------- - * Wrapper of PyInstanceMethod_New() used in Python 3 - * It is exported to the generated module, used for -fastproxy - * ----------------------------------------------------------------------------- */ -#if PY_VERSION_HEX >= 0x03000000 -SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) -{ - return PyInstanceMethod_New(func); -} -#else -SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *SWIGUNUSEDPARM(func)) -{ - return NULL; -} -#endif - #ifdef __cplusplus } #endif @@ -1155,6 +1048,14 @@ SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), * * ----------------------------------------------------------------------------- */ +#if PY_VERSION_HEX < 0x02070000 /* 2.7.0 */ +# 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" +#endif + /* Common SWIG API */ /* for raw pointers */ @@ -1238,11 +1139,7 @@ SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) { SWIGINTERN void SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) { -#if PY_VERSION_HEX < 0x02030000 - PyDict_SetItemString(d, (char *)name, obj); -#else PyDict_SetItemString(d, name, obj); -#endif Py_DECREF(obj); if (public_interface) SwigPyBuiltin_AddPublicSymbol(public_interface, name); @@ -1252,11 +1149,7 @@ SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *nam SWIGINTERN void SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) { -#if PY_VERSION_HEX < 0x02030000 - PyDict_SetItemString(d, (char *)name, obj); -#else PyDict_SetItemString(d, name, obj); -#endif Py_DECREF(obj); } @@ -1266,7 +1159,6 @@ SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) { SWIGINTERN PyObject* SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) { -#if !defined(SWIG_PYTHON_OUTPUT_TUPLE) if (!result) { result = obj; } else if (result == Py_None) { @@ -1282,29 +1174,6 @@ SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) { Py_DECREF(obj); } return result; -#else - PyObject* o2; - PyObject* o3; - if (!result) { - result = obj; - } else if (result == Py_None) { - Py_DECREF(result); - result = obj; - } else { - if (!PyTuple_Check(result)) { - o2 = result; - result = PyTuple_New(1); - PyTuple_SET_ITEM(result, 0, o2); - } - o3 = PyTuple_New(1); - PyTuple_SET_ITEM(o3, 0, obj); - o2 = result; - result = PySequence_Concat(o2, o3); - Py_DECREF(o2); - Py_DECREF(o3); - } - return result; -#endif } /* Unpack the argument tuple */ @@ -1356,11 +1225,7 @@ SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssi } /* A functor is a function object with one single object argument */ -#if PY_VERSION_HEX >= 0x02020000 #define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL); -#else -#define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunction(functor, "O", obj); -#endif /* Helper for static pointer initialization for both C and C++ code, for example @@ -1389,35 +1254,6 @@ SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssi extern "C" { #endif -/* How to access Py_None */ -#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) -# ifndef SWIG_PYTHON_NO_BUILD_NONE -# ifndef SWIG_PYTHON_BUILD_NONE -# define SWIG_PYTHON_BUILD_NONE -# endif -# endif -#endif - -#ifdef SWIG_PYTHON_BUILD_NONE -# ifdef Py_None -# undef Py_None -# define Py_None SWIG_Py_None() -# endif -SWIGRUNTIMEINLINE PyObject * -_SWIG_Py_None(void) -{ - PyObject *none = Py_BuildValue((char*)""); - Py_DECREF(none); - return none; -} -SWIGRUNTIME PyObject * -SWIG_Py_None(void) -{ - static PyObject *SWIG_STATIC_POINTER(none) = _SWIG_Py_None(); - return none; -} -#endif - /* The python void return value */ SWIGRUNTIMEINLINE PyObject * @@ -1444,7 +1280,10 @@ SWIGRUNTIMEINLINE int SWIG_Python_CheckImplicit(swig_type_info *ty) { SwigPyClientData *data = (SwigPyClientData *)ty->clientdata; - return data ? data->implicitconv : 0; + int fail = data ? data->implicitconv : 0; + if (fail) + PyErr_SetString(PyExc_TypeError, "Implicit conversion is prohibited for explicit constructors."); + return fail; } SWIGRUNTIMEINLINE PyObject * @@ -1471,11 +1310,7 @@ SwigPyClientData_New(PyObject* obj) data->newargs = obj; Py_INCREF(obj); } else { -#if (PY_VERSION_HEX < 0x02020000) - data->newraw = 0; -#else - data->newraw = PyObject_GetAttrString(data->klass, (char *)"__new__"); -#endif + data->newraw = PyObject_GetAttrString(data->klass, "__new__"); if (data->newraw) { Py_INCREF(data->newraw); data->newargs = PyTuple_New(1); @@ -1486,7 +1321,7 @@ SwigPyClientData_New(PyObject* obj) Py_INCREF(data->newargs); } /* the destroy method, aka as the C++ delete method */ - data->destroy = PyObject_GetAttrString(data->klass, (char *)"__swig_destroy__"); + data->destroy = PyObject_GetAttrString(data->klass, "__swig_destroy__"); if (PyErr_Occurred()) { PyErr_Clear(); data->destroy = 0; @@ -1495,11 +1330,7 @@ SwigPyClientData_New(PyObject* obj) int flags; Py_INCREF(data->destroy); flags = PyCFunction_GET_FLAGS(data->destroy); -#ifdef METH_O data->delargs = !(flags & (METH_O)); -#else - data->delargs = 0; -#endif } else { data->delargs = 0; } @@ -1587,20 +1418,12 @@ SwigPyObject_hex(SwigPyObject *v) } SWIGRUNTIME PyObject * -#ifdef METH_NOARGS SwigPyObject_repr(SwigPyObject *v) -#else -SwigPyObject_repr(SwigPyObject *v, PyObject *args) -#endif { const char *name = SWIG_TypePrettyName(v->ty); PyObject *repr = SWIG_Python_str_FromFormat("", (name ? name : "unknown"), (void *)v); if (v->next) { -# ifdef METH_NOARGS PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next); -# else - PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args); -# endif # if PY_VERSION_HEX >= 0x03000000 PyObject *joined = PyUnicode_Concat(repr, nrep); Py_DecRef(repr); @@ -1613,6 +1436,14 @@ SwigPyObject_repr(SwigPyObject *v, PyObject *args) return repr; } +/* We need a version taking two PyObject* parameters so it's a valid + * PyCFunction to use in swigobject_methods[]. */ +SWIGRUNTIME PyObject * +SwigPyObject_repr2(PyObject *v, PyObject *SWIGUNUSEDPARM(args)) +{ + return SwigPyObject_repr((SwigPyObject*)v); +} + SWIGRUNTIME int SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w) { @@ -1686,14 +1517,14 @@ SwigPyObject_dealloc(PyObject *v) PyObject *res; /* PyObject_CallFunction() has the potential to silently drop - the active active exception. In cases of unnamed temporary + the active exception. In cases of unnamed temporary variable or where we just finished iterating over a generator StopIteration will be active right now, and this needs to remain true upon return from SwigPyObject_dealloc. So save and restore. */ - PyObject *val = NULL, *type = NULL, *tb = NULL; - PyErr_Fetch(&val, &type, &tb); + PyObject *type = NULL, *value = NULL, *traceback = NULL; + PyErr_Fetch(&type, &value, &traceback); if (data->delargs) { /* we need to create a temporary object to carry the destroy operation */ @@ -1708,7 +1539,7 @@ SwigPyObject_dealloc(PyObject *v) if (!res) PyErr_WriteUnraisable(destroy); - PyErr_Restore(val, type, tb); + PyErr_Restore(type, value, traceback); Py_XDECREF(res); } @@ -1727,11 +1558,6 @@ SWIGRUNTIME PyObject* SwigPyObject_append(PyObject* v, PyObject* next) { SwigPyObject *sobj = (SwigPyObject *) v; -#ifndef METH_O - PyObject *tmp = 0; - if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL; - next = tmp; -#endif if (!SwigPyObject_Check(next)) { PyErr_SetString(PyExc_TypeError, "Attempt to append a non SwigPyObject"); return NULL; @@ -1742,11 +1568,7 @@ SwigPyObject_append(PyObject* v, PyObject* next) } SWIGRUNTIME PyObject* -#ifdef METH_NOARGS -SwigPyObject_next(PyObject* v) -#else SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) -#endif { SwigPyObject *sobj = (SwigPyObject *) v; if (sobj->next) { @@ -1758,11 +1580,7 @@ SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) } SWIGINTERN PyObject* -#ifdef METH_NOARGS -SwigPyObject_disown(PyObject *v) -#else SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) -#endif { SwigPyObject *sobj = (SwigPyObject *)v; sobj->own = 0; @@ -1770,11 +1588,7 @@ SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) } SWIGINTERN PyObject* -#ifdef METH_NOARGS -SwigPyObject_acquire(PyObject *v) -#else SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) -#endif { SwigPyObject *sobj = (SwigPyObject *)v; sobj->own = SWIG_POINTER_OWN; @@ -1785,70 +1599,32 @@ SWIGINTERN PyObject* SwigPyObject_own(PyObject *v, PyObject *args) { PyObject *val = 0; -#if (PY_VERSION_HEX < 0x02020000) - if (!PyArg_ParseTuple(args,(char *)"|O:own",&val)) -#elif (PY_VERSION_HEX < 0x02050000) - if (!PyArg_UnpackTuple(args, (char *)"own", 0, 1, &val)) -#else - if (!PyArg_UnpackTuple(args, "own", 0, 1, &val)) -#endif - { - return NULL; + if (!PyArg_UnpackTuple(args, "own", 0, 1, &val)) { + return NULL; + } else { + SwigPyObject *sobj = (SwigPyObject *)v; + PyObject *obj = PyBool_FromLong(sobj->own); + if (val) { + if (PyObject_IsTrue(val)) { + SwigPyObject_acquire(v,args); + } else { + SwigPyObject_disown(v,args); + } } - else - { - SwigPyObject *sobj = (SwigPyObject *)v; - PyObject *obj = PyBool_FromLong(sobj->own); - if (val) { -#ifdef METH_NOARGS - if (PyObject_IsTrue(val)) { - SwigPyObject_acquire(v); - } else { - SwigPyObject_disown(v); - } -#else - if (PyObject_IsTrue(val)) { - SwigPyObject_acquire(v,args); - } else { - SwigPyObject_disown(v,args); - } -#endif - } - return obj; - } + return obj; + } } -#ifdef METH_O static PyMethodDef swigobject_methods[] = { - {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"}, - {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS, (char *)"acquires ownership of the pointer"}, - {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, - {(char *)"append", (PyCFunction)SwigPyObject_append, METH_O, (char *)"appends another 'this' object"}, - {(char *)"next", (PyCFunction)SwigPyObject_next, METH_NOARGS, (char *)"returns the next 'this' object"}, - {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_NOARGS, (char *)"returns object representation"}, + {"disown", SwigPyObject_disown, METH_NOARGS, "releases ownership of the pointer"}, + {"acquire", SwigPyObject_acquire, METH_NOARGS, "acquires ownership of the pointer"}, + {"own", SwigPyObject_own, METH_VARARGS, "returns/sets ownership of the pointer"}, + {"append", SwigPyObject_append, METH_O, "appends another 'this' object"}, + {"next", SwigPyObject_next, METH_NOARGS, "returns the next 'this' object"}, + {"__repr__",SwigPyObject_repr2, METH_NOARGS, "returns object representation"}, {0, 0, 0, 0} }; -#else -static PyMethodDef -swigobject_methods[] = { - {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"}, - {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS, (char *)"acquires ownership of the pointer"}, - {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, - {(char *)"append", (PyCFunction)SwigPyObject_append, METH_VARARGS, (char *)"appends another 'this' object"}, - {(char *)"next", (PyCFunction)SwigPyObject_next, METH_VARARGS, (char *)"returns the next 'this' object"}, - {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_VARARGS, (char *)"returns object representation"}, - {0, 0, 0, 0} -}; -#endif - -#if PY_VERSION_HEX < 0x02020000 -SWIGINTERN PyObject * -SwigPyObject_getattr(SwigPyObject *sobj,char *name) -{ - return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name); -} -#endif SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void) { @@ -1893,12 +1669,8 @@ SwigPyObject_TypeOnce(void) { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_matrix_multiply */ #elif PY_VERSION_HEX >= 0x03000000 /* 3.0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */ -#elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */ +#else 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */ -#elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */ -#elif PY_VERSION_HEX >= 0x02000000 /* 2.0.0 */ - 0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_or */ #endif }; @@ -1912,16 +1684,12 @@ SwigPyObject_TypeOnce(void) { PyObject_HEAD_INIT(NULL) 0, /* ob_size */ #endif - (char *)"SwigPyObject", /* tp_name */ + "SwigPyObject", /* tp_name */ sizeof(SwigPyObject), /* tp_basicsize */ 0, /* tp_itemsize */ (destructor)SwigPyObject_dealloc, /* tp_dealloc */ 0, /* tp_print */ -#if PY_VERSION_HEX < 0x02020000 - (getattrfunc)SwigPyObject_getattr, /* tp_getattr */ -#else (getattrfunc)0, /* tp_getattr */ -#endif (setattrfunc)0, /* tp_setattr */ #if PY_VERSION_HEX >= 0x03000000 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */ @@ -1944,7 +1712,6 @@ SwigPyObject_TypeOnce(void) { 0, /* tp_clear */ (richcmpfunc)SwigPyObject_richcompare,/* tp_richcompare */ 0, /* tp_weaklistoffset */ -#if PY_VERSION_HEX >= 0x02020000 0, /* tp_iter */ 0, /* tp_iternext */ swigobject_methods, /* tp_methods */ @@ -1965,13 +1732,8 @@ SwigPyObject_TypeOnce(void) { 0, /* tp_cache */ 0, /* tp_subclasses */ 0, /* tp_weaklist */ -#endif -#if PY_VERSION_HEX >= 0x02030000 0, /* tp_del */ -#endif -#if PY_VERSION_HEX >= 0x02060000 0, /* tp_version_tag */ -#endif #if PY_VERSION_HEX >= 0x03040000 0, /* tp_finalize */ #endif @@ -1979,20 +1741,14 @@ SwigPyObject_TypeOnce(void) { 0, /* tp_allocs */ 0, /* tp_frees */ 0, /* tp_maxalloc */ -#if PY_VERSION_HEX >= 0x02050000 0, /* tp_prev */ -#endif 0 /* tp_next */ #endif }; swigpyobject_type = tmp; type_init = 1; -#if PY_VERSION_HEX < 0x02020000 - swigpyobject_type.ob_type = &PyType_Type; -#else if (PyType_Ready(&swigpyobject_type) < 0) return NULL; -#endif } return &swigpyobject_type; } @@ -2021,20 +1777,6 @@ typedef struct { size_t size; } SwigPyPacked; -SWIGRUNTIME int -SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags)) -{ - char result[SWIG_BUFFER_SIZE]; - fputs("pack, v->size, 0, sizeof(result))) { - fputs("at ", fp); - fputs(result, fp); - } - fputs(v->ty->name,fp); - fputs(">", fp); - return 0; -} - SWIGRUNTIME PyObject * SwigPyPacked_repr(SwigPyPacked *v) { @@ -2063,7 +1805,7 @@ SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w) size_t i = v->size; size_t j = w->size; int s = (i < j) ? -1 : ((i > j) ? 1 : 0); - return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size); + return s ? s : strncmp((const char *)v->pack, (const char *)w->pack, 2*v->size); } SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void); @@ -2103,11 +1845,11 @@ SwigPyPacked_TypeOnce(void) { PyObject_HEAD_INIT(NULL) 0, /* ob_size */ #endif - (char *)"SwigPyPacked", /* tp_name */ + "SwigPyPacked", /* tp_name */ sizeof(SwigPyPacked), /* tp_basicsize */ 0, /* tp_itemsize */ (destructor)SwigPyPacked_dealloc, /* tp_dealloc */ - (printfunc)SwigPyPacked_print, /* tp_print */ + 0, /* tp_print */ (getattrfunc)0, /* tp_getattr */ (setattrfunc)0, /* tp_setattr */ #if PY_VERSION_HEX>=0x03000000 @@ -2131,7 +1873,6 @@ SwigPyPacked_TypeOnce(void) { 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ -#if PY_VERSION_HEX >= 0x02020000 0, /* tp_iter */ 0, /* tp_iternext */ 0, /* tp_methods */ @@ -2152,13 +1893,8 @@ SwigPyPacked_TypeOnce(void) { 0, /* tp_cache */ 0, /* tp_subclasses */ 0, /* tp_weaklist */ -#endif -#if PY_VERSION_HEX >= 0x02030000 0, /* tp_del */ -#endif -#if PY_VERSION_HEX >= 0x02060000 0, /* tp_version_tag */ -#endif #if PY_VERSION_HEX >= 0x03040000 0, /* tp_finalize */ #endif @@ -2166,20 +1902,14 @@ SwigPyPacked_TypeOnce(void) { 0, /* tp_allocs */ 0, /* tp_frees */ 0, /* tp_maxalloc */ -#if PY_VERSION_HEX >= 0x02050000 0, /* tp_prev */ -#endif 0 /* tp_next */ #endif }; swigpypacked_type = tmp; type_init = 1; -#if PY_VERSION_HEX < 0x02020000 - swigpypacked_type.ob_type = &PyType_Type; -#else if (PyType_Ready(&swigpypacked_type) < 0) return NULL; -#endif } return &swigpypacked_type; } @@ -2220,20 +1950,14 @@ SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size) * pointers/data manipulation * ----------------------------------------------------------------------------- */ -SWIGRUNTIMEINLINE PyObject * -_SWIG_This(void) -{ - return SWIG_Python_str_FromChar("this"); -} - -static PyObject *swig_this = NULL; +static PyObject *Swig_This_global = NULL; SWIGRUNTIME PyObject * SWIG_This(void) { - if (swig_this == NULL) - swig_this = _SWIG_This(); - return swig_this; + if (Swig_This_global == NULL) + Swig_This_global = SWIG_Python_str_FromChar("this"); + return Swig_This_global; } /* #define SWIG_PYTHON_SLOW_GETSET_THIS */ @@ -2265,7 +1989,7 @@ SWIG_Python_GetSwigThis(PyObject *pyobj) obj = 0; -#if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000)) +#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS) if (PyInstance_Check(pyobj)) { obj = _PyInstance_Lookup(pyobj, SWIG_This()); } else { @@ -2335,7 +2059,7 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int if (obj == Py_None && !implicit_conv) { if (ptr) *ptr = 0; - return SWIG_OK; + return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; } res = SWIG_ERROR; @@ -2415,13 +2139,13 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int } } } - } - if (!SWIG_IsOK(res) && obj == Py_None) { - if (ptr) - *ptr = 0; - if (PyErr_Occurred()) - PyErr_Clear(); - res = SWIG_OK; + if (!SWIG_IsOK(res) && obj == Py_None) { + if (ptr) + *ptr = 0; + if (PyErr_Occurred()) + PyErr_Clear(); + res = SWIG_OK; + } } } return res; @@ -2435,31 +2159,28 @@ SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) { return SWIG_ConvertPtr(obj, ptr, ty, 0); } else { void *vptr = 0; - + swig_cast_info *tc; + /* here we get the method pointer for callbacks */ const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0; if (desc) desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0; - if (!desc) + if (!desc) return SWIG_ERROR; - if (ty) { - swig_cast_info *tc = SWIG_TypeCheck(desc,ty); - if (tc) { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc,vptr,&newmemory); - assert(!newmemory); /* newmemory handling not yet implemented */ - } else { - return SWIG_ERROR; - } + tc = SWIG_TypeCheck(desc,ty); + if (tc) { + int newmemory = 0; + *ptr = SWIG_TypeCast(tc,vptr,&newmemory); + assert(!newmemory); /* newmemory handling not yet implemented */ } else { - *ptr = vptr; + return SWIG_ERROR; } return SWIG_OK; } } -/* Convert a packed value value */ +/* Convert a packed pointer value */ SWIGRUNTIME int SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) { @@ -2487,7 +2208,6 @@ SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *t SWIGRUNTIME PyObject* SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) { -#if (PY_VERSION_HEX >= 0x02020000) PyObject *inst = 0; PyObject *newraw = data->newraw; if (newraw) { @@ -2510,10 +2230,18 @@ SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) } } else { #if PY_VERSION_HEX >= 0x03000000 - inst = ((PyTypeObject*) data->newargs)->tp_new((PyTypeObject*) data->newargs, Py_None, Py_None); - if (inst) { - PyObject_SetAttr(inst, SWIG_This(), swig_this); - Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG; + PyObject *empty_args = PyTuple_New(0); + if (empty_args) { + PyObject *empty_kwargs = PyDict_New(); + if (empty_kwargs) { + inst = ((PyTypeObject *)data->newargs)->tp_new((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; + } + } + Py_DECREF(empty_args); } #else PyObject *dict = PyDict_New(); @@ -2525,45 +2253,13 @@ SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) #endif } return inst; -#else -#if (PY_VERSION_HEX >= 0x02010000) - PyObject *inst = 0; - PyObject *dict = PyDict_New(); - if (dict) { - PyDict_SetItem(dict, SWIG_This(), swig_this); - inst = PyInstance_NewRaw(data->newargs, dict); - Py_DECREF(dict); - } - return (PyObject *) inst; -#else - PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type); - if (inst == NULL) { - return NULL; - } - inst->in_class = (PyClassObject *)data->newargs; - Py_INCREF(inst->in_class); - inst->in_dict = PyDict_New(); - if (inst->in_dict == NULL) { - Py_DECREF(inst); - return NULL; - } -#ifdef Py_TPFLAGS_HAVE_WEAKREFS - inst->in_weakreflist = NULL; -#endif -#ifdef Py_TPFLAGS_GC - PyObject_GC_Init(inst); -#endif - PyDict_SetItem(inst->in_dict, SWIG_This(), swig_this); - return (PyObject *) inst; -#endif -#endif } SWIGRUNTIME void SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this) { PyObject *dict; -#if (PY_VERSION_HEX >= 0x02020000) && !defined(SWIG_PYTHON_SLOW_GETSET_THIS) +#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS) PyObject **dictptr = _PyObject_GetDictPtr(inst); if (dictptr != NULL) { dict = *dictptr; @@ -2575,7 +2271,7 @@ SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this) return; } #endif - dict = PyObject_GetAttrString(inst, (char*)"__dict__"); + dict = PyObject_GetAttrString(inst, "__dict__"); PyDict_SetItem(dict, SWIG_This(), swig_this); Py_DECREF(dict); } @@ -2674,12 +2370,7 @@ SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata)) { #ifdef SWIG_LINK_RUNTIME type_pointer = SWIG_ReturnGlobalTypeList((void *)0); #else -# ifdef SWIGPY_USE_CAPSULE type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0); -# else - type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, - (char*)"type_pointer" SWIG_TYPE_TABLE_NAME); -# endif if (PyErr_Occurred()) { PyErr_Clear(); type_pointer = (void *)0; @@ -2689,48 +2380,10 @@ SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata)) { return (swig_module_info *) type_pointer; } -#if PY_MAJOR_VERSION < 2 -/* PyModule_AddObject function was introduced in Python 2.0. The following function - is copied out of Python/modsupport.c in python version 2.3.4 */ -SWIGINTERN int -PyModule_AddObject(PyObject *m, char *name, PyObject *o) -{ - PyObject *dict; - if (!PyModule_Check(m)) { - PyErr_SetString(PyExc_TypeError, "PyModule_AddObject() needs module as first arg"); - return SWIG_ERROR; - } - if (!o) { - PyErr_SetString(PyExc_TypeError, "PyModule_AddObject() needs non-NULL value"); - return SWIG_ERROR; - } - - dict = PyModule_GetDict(m); - if (dict == NULL) { - /* Internal error -- modules must have a dict! */ - PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__", - PyModule_GetName(m)); - return SWIG_ERROR; - } - if (PyDict_SetItemString(dict, name, o)) - return SWIG_ERROR; - Py_DECREF(o); - return SWIG_OK; -} -#endif - SWIGRUNTIME void -#ifdef SWIGPY_USE_CAPSULE SWIG_Python_DestroyModule(PyObject *obj) -#else -SWIG_Python_DestroyModule(void *vptr) -#endif { -#ifdef SWIGPY_USE_CAPSULE swig_module_info *swig_module = (swig_module_info *) PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME); -#else - swig_module_info *swig_module = (swig_module_info *) vptr; -#endif swig_type_info **types = swig_module->types; size_t i; for (i =0; i < swig_module->size; ++i) { @@ -2741,33 +2394,24 @@ SWIG_Python_DestroyModule(void *vptr) } } Py_DECREF(SWIG_This()); - swig_this = NULL; + Swig_This_global = NULL; } SWIGRUNTIME void SWIG_Python_SetModule(swig_module_info *swig_module) { #if PY_VERSION_HEX >= 0x03000000 /* Add a dummy module object into sys.modules */ - PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION); + PyObject *module = PyImport_AddModule("swig_runtime_data" SWIG_RUNTIME_VERSION); #else static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} }; /* Sentinel */ - PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table); + PyObject *module = Py_InitModule("swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table); #endif -#ifdef SWIGPY_USE_CAPSULE PyObject *pointer = PyCapsule_New((void *) swig_module, SWIGPY_CAPSULE_NAME, SWIG_Python_DestroyModule); if (pointer && module) { - PyModule_AddObject(module, (char*)"type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer); + PyModule_AddObject(module, "type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer); } else { Py_XDECREF(pointer); } -#else - PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule); - if (pointer && module) { - PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer); - } else { - Py_XDECREF(pointer); - } -#endif } /* The python cached type query */ @@ -2785,20 +2429,12 @@ SWIG_Python_TypeQuery(const char *type) PyObject *obj = PyDict_GetItem(cache, key); swig_type_info *descriptor; if (obj) { -#ifdef SWIGPY_USE_CAPSULE descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, NULL); -#else - descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj); -#endif } else { swig_module_info *swig_module = SWIG_GetModule(0); descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type); if (descriptor) { -#ifdef SWIGPY_USE_CAPSULE obj = PyCapsule_New((void*) descriptor, NULL, NULL); -#else - obj = PyCObject_FromVoidPtr(descriptor, NULL); -#endif PyDict_SetItem(cache, key, obj); Py_DECREF(obj); } @@ -2823,14 +2459,15 @@ SWIG_Python_AddErrMesg(const char* mesg, int infront) PyObject *traceback = 0; PyErr_Fetch(&type, &value, &traceback); if (value) { - char *tmp; PyObject *old_str = PyObject_Str(value); + const char *tmp = SWIG_Python_str_AsChar(old_str); + const char *errmesg = tmp ? tmp : "Invalid error message"; Py_XINCREF(type); PyErr_Clear(); if (infront) { - PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str)); + PyErr_Format(type, "%s %s", mesg, errmesg); } else { - PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); + PyErr_Format(type, "%s %s", errmesg, mesg); } SWIG_Python_str_DelForPy3(tmp); Py_DECREF(old_str); @@ -2956,6 +2593,8 @@ SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { Py_INCREF(name); } else { encoded_name = PyUnicode_AsUTF8String(name); + if (!encoded_name) + return -1; } PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name)); Py_DECREF(encoded_name); @@ -2982,6 +2621,21 @@ SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { +#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); + +#ifdef __cplusplus +} +#endif + + #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0) @@ -3067,11 +2721,10 @@ static swig_module_info swig_module = {swig_types, 73, 0, 0, 0, 0}; /* -------- TYPES TABLE (END) -------- */ -#if (PY_VERSION_HEX <= 0x02000000) -# if !defined(SWIG_PYTHON_CLASSIC) -# error "This python version requires swig to be run with the '-classic' option" -# endif +#ifdef SWIG_TypeQuery +# undef SWIG_TypeQuery #endif +#define SWIG_TypeQuery SWIG_Python_TypeQuery /*----------------------------------------------- @(target):= _internals.so @@ -3085,7 +2738,7 @@ static swig_module_info swig_module = {swig_types, 73, 0, 0, 0, 0}; #endif #define SWIG_name "_internals" -#define SWIGVERSION 0x030012 +#define SWIGVERSION 0x040001 #define SWIG_VERSION SWIGVERSION @@ -3186,6 +2839,7 @@ SWIGINTERNINLINE PyObject* #include "blpapi_subscriptionlist.h" #include "blpapi_timepoint.h" #include "blpapi_testutil.h" +#include "blpapi_zfputil.h" // publishing support #include "blpapi_eventformatter.h" @@ -3661,11 +3315,7 @@ SWIG_FromCharPtrAndSize(const char* carray, size_t size) #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) return PyBytes_FromStringAndSize(carray, (Py_ssize_t)(size)); #else -#if PY_VERSION_HEX >= 0x03010000 return PyUnicode_DecodeUTF8(carray, (Py_ssize_t)(size), "surrogateescape"); -#else - return PyUnicode_FromStringAndSize(carray, (Py_ssize_t)(size)); -#endif #endif #else return PyString_FromStringAndSize(carray, (Py_ssize_t)(size)); @@ -3691,6 +3341,7 @@ SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) #endif { char *cstr; Py_ssize_t len; + int ret = SWIG_OK; #if PY_VERSION_HEX>=0x03000000 #if !defined(SWIG_PYTHON_STRICT_BYTE_CHAR) if (!alloc && cptr) { @@ -3701,7 +3352,10 @@ SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) return SWIG_RuntimeError; } obj = PyUnicode_AsUTF8String(obj); - if(alloc) *alloc = SWIG_NEWOBJ; + if (!obj) + return SWIG_TypeError; + if (alloc) + *alloc = SWIG_NEWOBJ; #endif PyBytes_AsStringAndSize(obj, &cstr, &len); #else @@ -3709,21 +3363,7 @@ SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) #endif if (cptr) { if (alloc) { - /* - In python the user should not be able to modify the inner - string representation. To warranty that, if you define - SWIG_PYTHON_SAFE_CSTRINGS, a new/copy of the python string - buffer is always returned. - - The default behavior is just to return the pointer value, - so, be careful. - */ -#if defined(SWIG_PYTHON_SAFE_CSTRINGS) - if (*alloc != SWIG_OLDOBJ) -#else - if (*alloc == SWIG_NEWOBJ) -#endif - { + if (*alloc == SWIG_NEWOBJ) { *cptr = (char *)memcpy(malloc((len + 1)*sizeof(char)), cstr, sizeof(char)*(len + 1)); *alloc = SWIG_NEWOBJ; } else { @@ -3739,6 +3379,8 @@ SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) #endif #else *cptr = SWIG_Python_str_AsChar(obj); + if (!*cptr) + ret = SWIG_TypeError; #endif } } @@ -3746,7 +3388,7 @@ SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) #if PY_VERSION_HEX>=0x03000000 && !defined(SWIG_PYTHON_STRICT_BYTE_CHAR) Py_XDECREF(obj); #endif - return SWIG_OK; + return ret; } else { #if defined(SWIG_PYTHON_2_UNICODE) #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) @@ -3759,6 +3401,8 @@ SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) return SWIG_RuntimeError; } obj = PyUnicode_AsUTF8String(obj); + if (!obj) + return SWIG_TypeError; if (PyString_AsStringAndSize(obj, &cstr, &len) != -1) { if (cptr) { if (alloc) *alloc = SWIG_NEWOBJ; @@ -3944,8 +3588,8 @@ SWIGINTERN intArray *intArray_frompointer(int *t){ #include "blpapi_correlationid.h" int pyObjectManagerFunc( - blpapi_ManagedPtr_t *managedPtr, - const blpapi_ManagedPtr_t *srcPtr, + blpapi_ManagedPtr_t *managedPtr, + const blpapi_ManagedPtr_t *srcPtr, int operation) { SWIG_PYTHON_THREAD_BEGIN_BLOCK; @@ -3970,7 +3614,7 @@ blpapi_CorrelationId_t *CorrelationId_t_createEmpty() cid = (blpapi_CorrelationId_t *) malloc(sizeof(blpapi_CorrelationId_t)); memset(cid, 0, sizeof(blpapi_CorrelationId_t)); Py_END_ALLOW_THREADS - + return cid; } @@ -3987,7 +3631,7 @@ blpapi_CorrelationId_t *CorrelationId_t_createFromInteger(long long value, unsig cid->classId = classId; cid->value.intValue = value; Py_END_ALLOW_THREADS - + return cid; } @@ -3997,7 +3641,7 @@ blpapi_CorrelationId_t *CorrelationId_t_createFromObject(PyObject *value, unsign if (!value) { value = Py_None; } - + Py_BEGIN_ALLOW_THREADS cid = (blpapi_CorrelationId_t *) malloc(sizeof(blpapi_CorrelationId_t)); memset(cid, 0, sizeof(blpapi_CorrelationId_t)); @@ -4009,9 +3653,9 @@ blpapi_CorrelationId_t *CorrelationId_t_createFromObject(PyObject *value, unsign cid->value.ptrValue.manager = &pyObjectManagerFunc; cid->value.ptrValue.pointer = value; Py_END_ALLOW_THREADS - + Py_INCREF(value); - + return cid; } @@ -4027,7 +3671,7 @@ blpapi_CorrelationId_t *CorrelationId_t_clone(const blpapi_CorrelationId_t *orig blpapi_ManagedPtr_ManagerFunction_t manager = cid->value.ptrValue.manager; if (manager) { - manager(&cid->value.ptrValue, &original->value.ptrValue, + manager(&cid->value.ptrValue, &original->value.ptrValue, BLPAPI_MANAGEDPTR_COPY); } } @@ -4038,7 +3682,7 @@ blpapi_CorrelationId_t *CorrelationId_t_clone(const blpapi_CorrelationId_t *orig void CorrelationId_t_cleanup(blpapi_CorrelationId_t *cid) { if (BLPAPI_CORRELATION_TYPE_POINTER == cid->valueType) { - blpapi_ManagedPtr_ManagerFunction_t manager = + blpapi_ManagedPtr_ManagerFunction_t manager = cid->value.ptrValue.manager; if (manager) { manager(&cid->value.ptrValue, 0, BLPAPI_MANAGEDPTR_DESTROY); @@ -4053,14 +3697,14 @@ void CorrelationId_t_delete(blpapi_CorrelationId_t *cid) } CorrelationId_t_cleanup(cid); - + Py_BEGIN_ALLOW_THREADS free(cid); Py_END_ALLOW_THREADS } int CorrelationId_t_equals( - const blpapi_CorrelationId_t *cid1, + const blpapi_CorrelationId_t *cid1, const blpapi_CorrelationId_t *cid2) { if (cid1 == cid2) { @@ -4078,7 +3722,7 @@ int CorrelationId_t_equals( if (cid1->classId != cid2->classId) { return 0; } - + if (cid1->valueType == BLPAPI_CORRELATION_TYPE_POINTER) { return cid1->value.ptrValue.pointer == cid2->value.ptrValue.pointer; } else { @@ -4105,7 +3749,7 @@ PyObject *CorrelationId_t_getObject(const blpapi_CorrelationId_t *cid) { res = Py_None; } - Py_INCREF(res); + Py_INCREF(res); return res; } @@ -4424,15 +4068,15 @@ void dispatchEventProxy(blpapi_Event_t *event, blpapi_Session_t *session, void * { PyObject *eventDispatcherFunc = (PyObject *) (userData); PyObject *result; - + SWIG_PYTHON_THREAD_BEGIN_BLOCK; PyObject *arglist = PyTuple_New(1); - PyTuple_SET_ITEM(arglist, 0, + PyTuple_SET_ITEM(arglist, 0, SWIG_NewPointerObj(SWIG_as_voidptr(event), SWIGTYPE_p_blpapi_Event, 0)); - + result = PyEval_CallObject(eventDispatcherFunc, arglist); - + Py_DECREF(arglist); Py_XDECREF(result); @@ -4444,22 +4088,22 @@ blpapi_Session_t *Session_createHelper(blpapi_SessionOptions_t *parameters, blpapi_EventDispatcher_t *dispatcher) { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - const int hasHandler = + const int hasHandler = eventHandlerFunc != 0 && eventHandlerFunc != Py_None; blpapi_Session_t *const res = blpapi_Session_create( - parameters, + parameters, hasHandler ? &dispatchEventProxy : 0, dispatcher, hasHandler ? eventHandlerFunc : 0); if (!res) { return 0; - } + } SWIG_PYTHON_THREAD_END_ALLOW; - + Py_XINCREF(eventHandlerFunc); - + return res; } @@ -4468,7 +4112,7 @@ void Session_destroyHelper(blpapi_Session_t *sessionHandle, PyObject *eventHandl SWIG_PYTHON_THREAD_BEGIN_ALLOW; blpapi_Session_destroy(sessionHandle); SWIG_PYTHON_THREAD_END_ALLOW; - + Py_XDECREF(eventHandlerFunc); } @@ -4481,15 +4125,15 @@ void dispatchProviderEventProxy(blpapi_Event_t *event, blpapi_ProviderSession_t PyObject *eventDispatcherFunc = (PyObject *) (userData); PyObject *result; PyObject *arglist; - + SWIG_PYTHON_THREAD_BEGIN_BLOCK; arglist = PyTuple_New(1); - PyTuple_SET_ITEM(arglist, 0, + PyTuple_SET_ITEM(arglist, 0, SWIG_NewPointerObj(SWIG_as_voidptr(event), SWIGTYPE_p_blpapi_Event, 0)); - + result = PyEval_CallObject(eventDispatcherFunc, arglist); - + Py_DECREF(arglist); Py_XDECREF(result); @@ -4501,22 +4145,22 @@ blpapi_ProviderSession_t *ProviderSession_createHelper(blpapi_SessionOptions_t * blpapi_EventDispatcher_t *dispatcher) { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - const int hasHandler = + const int hasHandler = eventHandlerFunc != 0 && eventHandlerFunc != Py_None; blpapi_ProviderSession_t *const res = blpapi_ProviderSession_create( - parameters, + parameters, hasHandler ? &dispatchProviderEventProxy : 0, dispatcher, hasHandler ? eventHandlerFunc : 0); if (!res) { return 0; - } + } SWIG_PYTHON_THREAD_END_ALLOW; - + Py_XINCREF(eventHandlerFunc); - + return res; } @@ -4592,7 +4236,7 @@ int blpapi_MessageFormatter_appendValueFloat( /* isfinite() is a macro for C99 */ # if defined(isfinite) # define SWIG_isfinite(X) (isfinite(X)) -# elif defined __cplusplus && __cplusplus >= 201103L +# elif defined(__cplusplus) && __cplusplus >= 201103L /* Use a template so that this works whether isfinite() is std::isfinite() or * in the global namespace. The reality seems to vary between compiler * versions. @@ -4608,6 +4252,12 @@ inline int SWIG_isfinite_func(T x) { return isfinite(x); } # define SWIG_isfinite(X) (SWIG_isfinite_func(X)) +# elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)) +# define SWIG_isfinite(X) (__builtin_isfinite(X)) +# elif defined(__clang__) && defined(__has_builtin) +# if __has_builtin(__builtin_isfinite) +# define SWIG_isfinite(X) (__builtin_isfinite(X)) +# endif # elif defined(_MSC_VER) # define SWIG_isfinite(X) (_finite(X)) # elif defined(__sun) && defined(__SVR4) @@ -4702,13 +4352,12 @@ SWIGINTERN PyObject *_wrap_setLoggerCallbackWrapper(PyObject *SWIGUNUSEDPARM(sel int arg2 ; int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:setLoggerCallbackWrapper",&obj0,&obj1)) SWIG_fail; - arg1 = obj0; - ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_Python_UnpackTuple(args, "setLoggerCallbackWrapper", 2, 2, swig_obj)) SWIG_fail; + arg1 = swig_obj[0]; + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "setLoggerCallbackWrapper" "', argument " "2"" of type '" "int""'"); } @@ -4730,12 +4379,13 @@ SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_fromTimePoint_wrapper(Py blpapi_TimePoint_t arg1 ; void *argp1 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; blpapi_HighPrecisionDatetime_t result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_HighPrecisionDatetime_fromTimePoint_wrapper",&obj0)) SWIG_fail; + if (!args) SWIG_fail; + swig_obj[0] = args; { - res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_blpapi_TimePoint, 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_blpapi_TimePoint, 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_fromTimePoint_wrapper" "', argument " "1"" of type '" "blpapi_TimePoint_t""'"); } @@ -4765,13 +4415,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Logging_registerCallback(PyObject *SWIGUNUSEDP int res1 = 0 ; int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Logging_registerCallback",&obj0,&obj1)) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "blpapi_Logging_registerCallback", 2, 2, swig_obj)) SWIG_fail; { - res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_blpapi_Logging_Func_t, 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_blpapi_Logging_Func_t, 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Logging_registerCallback" "', argument " "1"" of type '" "blpapi_Logging_Func_t""'"); } @@ -4781,7 +4430,7 @@ SWIGINTERN PyObject *_wrap_blpapi_Logging_registerCallback(PyObject *SWIGUNUSEDP arg1 = *((blpapi_Logging_Func_t *)(argp1)); } } - ecode2 = SWIG_AsVal_int(obj1, &val2); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Logging_registerCallback" "', argument " "2"" of type '" "blpapi_Logging_Severity_t""'"); } @@ -4803,10 +4452,11 @@ SWIGINTERN PyObject *_wrap_blpapi_Logging_logTestMessage(PyObject *SWIGUNUSEDPAR blpapi_Logging_Severity_t arg1 ; int val1 ; int ecode1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Logging_logTestMessage",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!args) SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "blpapi_Logging_logTestMessage" "', argument " "1"" of type '" "blpapi_Logging_Severity_t""'"); } @@ -4827,7 +4477,7 @@ SWIGINTERN PyObject *_wrap_blpapi_DiagnosticsUtil_memoryInfo_wrapper(PyObject *S PyObject *resultobj = 0; PyObject *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)":blpapi_DiagnosticsUtil_memoryInfo_wrapper")) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "blpapi_DiagnosticsUtil_memoryInfo_wrapper", 0, 0, 0)) SWIG_fail; { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (PyObject *)blpapi_DiagnosticsUtil_memoryInfo_wrapper(); @@ -4848,17 +4498,16 @@ SWIGINTERN PyObject *_wrap_blpapi_EventDispatcher_stop(PyObject *SWIGUNUSEDPARM( int res1 = 0 ; int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_EventDispatcher_stop",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventDispatcher, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_EventDispatcher_stop", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventDispatcher, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventDispatcher_stop" "', argument " "1"" of type '" "blpapi_EventDispatcher_t *""'"); } arg1 = (blpapi_EventDispatcher_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_EventDispatcher_stop" "', argument " "2"" of type '" "int""'"); } @@ -4890,23 +4539,21 @@ SWIGINTERN PyObject *_wrap_blpapi_Service_printHelper(PyObject *SWIGUNUSEDPARM(s int ecode3 = 0 ; char *temp4 = 0 ; int tempn4 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; arg4 = &temp4; arg5 = &tempn4; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Service_printHelper",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Service_printHelper", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_printHelper" "', argument " "1"" of type '" "blpapi_Service_t *""'"); } arg1 = (blpapi_Service_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Service_printHelper" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Service_printHelper" "', argument " "3"" of type '" "int""'"); } @@ -4942,23 +4589,21 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_printHelper(PyObject * int ecode3 = 0 ; char *temp4 = 0 ; int tempn4 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; arg4 = &temp4; arg5 = &tempn4; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_SchemaElementDefinition_printHelper",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_SchemaElementDefinition_printHelper", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_printHelper" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t *""'"); } arg1 = (blpapi_SchemaElementDefinition_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SchemaElementDefinition_printHelper" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_SchemaElementDefinition_printHelper" "', argument " "3"" of type '" "int""'"); } @@ -4994,23 +4639,21 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_printHelper(PyObject *SWI int ecode3 = 0 ; char *temp4 = 0 ; int tempn4 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; arg4 = &temp4; arg5 = &tempn4; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_SchemaTypeDefinition_printHelper",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_SchemaTypeDefinition_printHelper", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_p_void, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_printHelper" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t *""'"); } arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SchemaTypeDefinition_printHelper" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_SchemaTypeDefinition_printHelper" "', argument " "3"" of type '" "int""'"); } @@ -5046,23 +4689,21 @@ SWIGINTERN PyObject *_wrap_blpapi_Message_printHelper(PyObject *SWIGUNUSEDPARM(s int ecode3 = 0 ; char *temp4 = 0 ; int tempn4 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; arg4 = &temp4; arg5 = &tempn4; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Message_printHelper",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Message_printHelper", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_printHelper" "', argument " "1"" of type '" "blpapi_Message_t *""'"); } arg1 = (blpapi_Message_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Message_printHelper" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Message_printHelper" "', argument " "3"" of type '" "int""'"); } @@ -5098,23 +4739,21 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_printHelper(PyObject *SWIGUNUSE int ecode3 = 0 ; char *temp4 = 0 ; int tempn4 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; arg4 = &temp4; arg5 = &tempn4; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_SessionOptions_printHelper",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_printHelper", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_printHelper" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_printHelper" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_SessionOptions_printHelper" "', argument " "3"" of type '" "int""'"); } @@ -5144,11 +4783,12 @@ SWIGINTERN PyObject *_wrap_blpapi_TestUtil_serializeServiceHelper(PyObject *SWIG int res1 = 0 ; char *temp2 = 0 ; int tempn2 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; arg2 = &temp2; arg3 = &tempn2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_TestUtil_serializeServiceHelper",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TestUtil_serializeServiceHelper" "', argument " "1"" of type '" "blpapi_Service_t *""'"); } @@ -5181,23 +4821,21 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_hasElementDefinition(PyOb int alloc2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_SchemaTypeDefinition_hasElementDefinition",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_SchemaTypeDefinition_hasElementDefinition", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_p_void, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_hasElementDefinition" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); } arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SchemaTypeDefinition_hasElementDefinition" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_SchemaTypeDefinition_hasElementDefinition" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); } @@ -5228,23 +4866,21 @@ SWIGINTERN PyObject *_wrap_blpapi_ConstantList_hasConstant(PyObject *SWIGUNUSEDP int alloc2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_ConstantList_hasConstant",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_ConstantList_hasConstant", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_hasConstant" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); } arg1 = (blpapi_ConstantList_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ConstantList_hasConstant" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ConstantList_hasConstant" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); } @@ -5275,23 +4911,21 @@ SWIGINTERN PyObject *_wrap_blpapi_Service_hasEventDefinition(PyObject *SWIGUNUSE int alloc2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Service_hasEventDefinition",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Service_hasEventDefinition", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_hasEventDefinition" "', argument " "1"" of type '" "blpapi_Service_t *""'"); } arg1 = (blpapi_Service_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Service_hasEventDefinition" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Service_hasEventDefinition" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); } @@ -5322,23 +4956,21 @@ SWIGINTERN PyObject *_wrap_blpapi_Service_hasOperation(PyObject *SWIGUNUSEDPARM( int alloc2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Service_hasOperation",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Service_hasOperation", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_hasOperation" "', argument " "1"" of type '" "blpapi_Service_t *""'"); } arg1 = (blpapi_Service_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Service_hasOperation" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Service_hasOperation" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); } @@ -5377,35 +5009,31 @@ SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_addHelper(PyObject *SWIGUNUSE int res5 ; char *buf5 = 0 ; int alloc5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; + PyObject *swig_obj[5] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOOO:blpapi_SubscriptionList_addHelper",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_SubscriptionList_addHelper", 5, 5, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_addHelper" "', argument " "1"" of type '" "blpapi_SubscriptionList_t *""'"); } arg1 = (blpapi_SubscriptionList_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SubscriptionList_addHelper" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_SubscriptionList_addHelper" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); } arg3 = (blpapi_CorrelationId_t *)(argp3); - res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4); + res4 = SWIG_AsCharPtrAndSize(swig_obj[3], &buf4, NULL, &alloc4); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_SubscriptionList_addHelper" "', argument " "4"" of type '" "char const *""'"); } arg4 = (char *)(buf4); - res5 = SWIG_AsCharPtrAndSize(obj4, &buf5, NULL, &alloc5); + res5 = SWIG_AsCharPtrAndSize(swig_obj[4], &buf5, NULL, &alloc5); if (!SWIG_IsOK(res5)) { SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "blpapi_SubscriptionList_addHelper" "', argument " "5"" of type '" "char const *""'"); } @@ -5434,11 +5062,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Name_hasName(PyObject *SWIGUNUSEDPARM(self), P int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Name_hasName",&obj0)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Name_hasName" "', argument " "1"" of type '" "char const *""'"); } @@ -5462,11 +5091,12 @@ SWIGINTERN PyObject *_wrap_blpapi_TopicList_createFromResolutionList(PyObject *S blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; blpapi_TopicList_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_TopicList_createFromResolutionList",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_createFromResolutionList" "', argument " "1"" of type '" "blpapi_ResolutionList_t *""'"); } @@ -5488,11 +5118,12 @@ SWIGINTERN PyObject *_wrap_new_intArray(PyObject *SWIGUNUSEDPARM(self), PyObject size_t arg1 ; size_t val1 ; int ecode1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; intArray *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:new_intArray",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); + if (!args) SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_size_t(swig_obj[0], &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_intArray" "', argument " "1"" of type '" "size_t""'"); } @@ -5514,10 +5145,11 @@ SWIGINTERN PyObject *_wrap_delete_intArray(PyObject *SWIGUNUSEDPARM(self), PyObj intArray *arg1 = (intArray *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; - if (!PyArg_ParseTuple(args,(char *)"O:delete_intArray",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_intArray, SWIG_POINTER_DISOWN | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_intArray, SWIG_POINTER_DISOWN | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_intArray" "', argument " "1"" of type '" "intArray *""'"); } @@ -5542,17 +5174,16 @@ SWIGINTERN PyObject *_wrap_intArray___getitem__(PyObject *SWIGUNUSEDPARM(self), int res1 = 0 ; size_t val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:intArray___getitem__",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_intArray, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "intArray___getitem__", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_intArray, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "intArray___getitem__" "', argument " "1"" of type '" "intArray *""'"); } arg1 = (intArray *)(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); + ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "intArray___getitem__" "', argument " "2"" of type '" "size_t""'"); } @@ -5580,22 +5211,20 @@ SWIGINTERN PyObject *_wrap_intArray___setitem__(PyObject *SWIGUNUSEDPARM(self), int ecode2 = 0 ; int val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; - if (!PyArg_ParseTuple(args,(char *)"OOO:intArray___setitem__",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_intArray, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "intArray___setitem__", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_intArray, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "intArray___setitem__" "', argument " "1"" of type '" "intArray *""'"); } arg1 = (intArray *)(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); + ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "intArray___setitem__" "', argument " "2"" of type '" "size_t""'"); } arg2 = (size_t)(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "intArray___setitem__" "', argument " "3"" of type '" "int""'"); } @@ -5617,11 +5246,12 @@ SWIGINTERN PyObject *_wrap_intArray_cast(PyObject *SWIGUNUSEDPARM(self), PyObjec intArray *arg1 = (intArray *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:intArray_cast",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_intArray, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_intArray, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "intArray_cast" "', argument " "1"" of type '" "intArray *""'"); } @@ -5643,11 +5273,12 @@ SWIGINTERN PyObject *_wrap_intArray_frompointer(PyObject *SWIGUNUSEDPARM(self), int *arg1 = (int *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; intArray *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:intArray_frompointer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_int, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_int, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "intArray_frompointer" "', argument " "1"" of type '" "int *""'"); } @@ -5666,21 +5297,26 @@ SWIGINTERN PyObject *_wrap_intArray_frompointer(PyObject *SWIGUNUSEDPARM(self), SWIGINTERN PyObject *intArray_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; + if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL; SWIG_TypeNewClientData(SWIGTYPE_p_intArray, SWIG_NewClientData(obj)); return SWIG_Py_Void(); } +SWIGINTERN PyObject *intArray_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + return SWIG_Python_InitShadowInstance(args); +} + SWIGINTERN PyObject *_wrap_new_topicPtrArray(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; size_t arg1 ; size_t val1 ; int ecode1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; blpapi_Topic_t **result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:new_topicPtrArray",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); + if (!args) SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_size_t(swig_obj[0], &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_topicPtrArray" "', argument " "1"" of type '" "size_t""'"); } @@ -5702,10 +5338,11 @@ SWIGINTERN PyObject *_wrap_delete_topicPtrArray(PyObject *SWIGUNUSEDPARM(self), blpapi_Topic_t **arg1 = (blpapi_Topic_t **) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; - if (!PyArg_ParseTuple(args,(char *)"O:delete_topicPtrArray",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_blpapi_Topic, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_p_blpapi_Topic, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_topicPtrArray" "', argument " "1"" of type '" "blpapi_Topic_t **""'"); } @@ -5730,17 +5367,16 @@ SWIGINTERN PyObject *_wrap_topicPtrArray_getitem(PyObject *SWIGUNUSEDPARM(self), int res1 = 0 ; size_t val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; blpapi_Topic_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OO:topicPtrArray_getitem",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_blpapi_Topic, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "topicPtrArray_getitem", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_p_blpapi_Topic, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "topicPtrArray_getitem" "', argument " "1"" of type '" "blpapi_Topic_t **""'"); } arg1 = (blpapi_Topic_t **)(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); + ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "topicPtrArray_getitem" "', argument " "2"" of type '" "size_t""'"); } @@ -5768,22 +5404,20 @@ SWIGINTERN PyObject *_wrap_topicPtrArray_setitem(PyObject *SWIGUNUSEDPARM(self), int ecode2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; - if (!PyArg_ParseTuple(args,(char *)"OOO:topicPtrArray_setitem",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_blpapi_Topic, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "topicPtrArray_setitem", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_p_blpapi_Topic, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "topicPtrArray_setitem" "', argument " "1"" of type '" "blpapi_Topic_t **""'"); } arg1 = (blpapi_Topic_t **)(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); + ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "topicPtrArray_setitem" "', argument " "2"" of type '" "size_t""'"); } arg2 = (size_t)(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "topicPtrArray_setitem" "', argument " "3"" of type '" "blpapi_Topic_t *""'"); } @@ -5808,17 +5442,16 @@ SWIGINTERN PyObject *_wrap_CorrelationId_t_equals(PyObject *SWIGUNUSEDPARM(self) int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:CorrelationId_t_equals",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "CorrelationId_t_equals", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CorrelationId_t_equals" "', argument " "1"" of type '" "blpapi_CorrelationId_t const *""'"); } arg1 = (blpapi_CorrelationId_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CorrelationId_t_equals" "', argument " "2"" of type '" "blpapi_CorrelationId_t const *""'"); } @@ -5836,11 +5469,12 @@ SWIGINTERN PyObject *_wrap_CorrelationId_value_get(PyObject *SWIGUNUSEDPARM(self struct blpapi_CorrelationId_t_ *arg1 = (struct blpapi_CorrelationId_t_ *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; blpapi_CorrelationId_t__value *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:CorrelationId_value_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CorrelationId_value_get" "', argument " "1"" of type '" "struct blpapi_CorrelationId_t_ *""'"); } @@ -5857,11 +5491,11 @@ SWIGINTERN PyObject *_wrap_CorrelationId_value_get(PyObject *SWIGUNUSEDPARM(self } -SWIGINTERN PyObject *_wrap_new_CorrelationId__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_new_CorrelationId__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **SWIGUNUSEDPARM(swig_obj)) { PyObject *resultobj = 0; struct blpapi_CorrelationId_t_ *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)":new_CorrelationId")) SWIG_fail; + if ((nobjs < 0) || (nobjs > 0)) SWIG_fail; result = (struct blpapi_CorrelationId_t_ *)new_blpapi_CorrelationId_t___SWIG_0(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_CorrelationId_t_, SWIG_POINTER_NEW | 0 ); return resultobj; @@ -5870,7 +5504,7 @@ SWIGINTERN PyObject *_wrap_new_CorrelationId__SWIG_0(PyObject *SWIGUNUSEDPARM(se } -SWIGINTERN PyObject *_wrap_new_CorrelationId__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_new_CorrelationId__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; long long arg1 ; unsigned short arg2 = (unsigned short) 0 ; @@ -5878,18 +5512,16 @@ SWIGINTERN PyObject *_wrap_new_CorrelationId__SWIG_1(PyObject *SWIGUNUSEDPARM(se int ecode1 = 0 ; unsigned short val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; struct blpapi_CorrelationId_t_ *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O|O:new_CorrelationId",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_long_SS_long(obj0, &val1); + if ((nobjs < 1) || (nobjs > 2)) SWIG_fail; + ecode1 = SWIG_AsVal_long_SS_long(swig_obj[0], &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_CorrelationId" "', argument " "1"" of type '" "long long""'"); } arg1 = (long long)(val1); - if (obj1) { - ecode2 = SWIG_AsVal_unsigned_SS_short(obj1, &val2); + if (swig_obj[1]) { + ecode2 = SWIG_AsVal_unsigned_SS_short(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CorrelationId" "', argument " "2"" of type '" "unsigned short""'"); } @@ -5903,22 +5535,20 @@ SWIGINTERN PyObject *_wrap_new_CorrelationId__SWIG_1(PyObject *SWIGUNUSEDPARM(se } -SWIGINTERN PyObject *_wrap_new_CorrelationId__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_new_CorrelationId__SWIG_2(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; PyObject *arg1 = (PyObject *) 0 ; unsigned short arg2 = (unsigned short) 0 ; unsigned short val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; struct blpapi_CorrelationId_t_ *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O|O:new_CorrelationId",&obj0,&obj1)) SWIG_fail; + if ((nobjs < 1) || (nobjs > 2)) SWIG_fail; { - arg1 = obj0; + arg1 = swig_obj[0]; } - if (obj1) { - ecode2 = SWIG_AsVal_unsigned_SS_short(obj1, &val2); + if (swig_obj[1]) { + ecode2 = SWIG_AsVal_unsigned_SS_short(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CorrelationId" "', argument " "2"" of type '" "unsigned short""'"); } @@ -5937,15 +5567,11 @@ SWIGINTERN PyObject *_wrap_new_CorrelationId(PyObject *self, PyObject *args) { PyObject *argv[3] = { 0 }; - Py_ssize_t ii; - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } + if (!(argc = SWIG_Python_UnpackTuple(args, "new_CorrelationId", 0, 2, argv))) SWIG_fail; + --argc; if (argc == 0) { - return _wrap_new_CorrelationId__SWIG_0(self, args); + return _wrap_new_CorrelationId__SWIG_0(self, argc, argv); } if ((argc >= 1) && (argc <= 2)) { int _v; @@ -5955,14 +5581,14 @@ SWIGINTERN PyObject *_wrap_new_CorrelationId(PyObject *self, PyObject *args) { } if (_v) { if (argc <= 1) { - return _wrap_new_CorrelationId__SWIG_1(self, args); + return _wrap_new_CorrelationId__SWIG_1(self, argc, argv); } { int res = SWIG_AsVal_unsigned_SS_short(argv[1], NULL); _v = SWIG_CheckState(res); } if (_v) { - return _wrap_new_CorrelationId__SWIG_1(self, args); + return _wrap_new_CorrelationId__SWIG_1(self, argc, argv); } } } @@ -5971,20 +5597,20 @@ SWIGINTERN PyObject *_wrap_new_CorrelationId(PyObject *self, PyObject *args) { _v = (argv[0] != 0); if (_v) { if (argc <= 1) { - return _wrap_new_CorrelationId__SWIG_2(self, args); + return _wrap_new_CorrelationId__SWIG_2(self, argc, argv); } { int res = SWIG_AsVal_unsigned_SS_short(argv[1], NULL); _v = SWIG_CheckState(res); } if (_v) { - return _wrap_new_CorrelationId__SWIG_2(self, args); + return _wrap_new_CorrelationId__SWIG_2(self, argc, argv); } } } fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_CorrelationId'.\n" + SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'new_CorrelationId'.\n" " Possible C/C++ prototypes are:\n" " blpapi_CorrelationId_t_::blpapi_CorrelationId_t_()\n" " blpapi_CorrelationId_t_::blpapi_CorrelationId_t_(long long,unsigned short)\n" @@ -5998,10 +5624,11 @@ SWIGINTERN PyObject *_wrap_delete_CorrelationId(PyObject *SWIGUNUSEDPARM(self), struct blpapi_CorrelationId_t_ *arg1 = (struct blpapi_CorrelationId_t_ *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; - if (!PyArg_ParseTuple(args,(char *)"O:delete_CorrelationId",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_CorrelationId_t_, SWIG_POINTER_DISOWN | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_CorrelationId_t_, SWIG_POINTER_DISOWN | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CorrelationId" "', argument " "1"" of type '" "struct blpapi_CorrelationId_t_ *""'"); } @@ -6019,11 +5646,12 @@ SWIGINTERN PyObject *_wrap_CorrelationId_type(PyObject *SWIGUNUSEDPARM(self), Py struct blpapi_CorrelationId_t_ *arg1 = (struct blpapi_CorrelationId_t_ *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; unsigned short result; - if (!PyArg_ParseTuple(args,(char *)"O:CorrelationId_type",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CorrelationId_type" "', argument " "1"" of type '" "struct blpapi_CorrelationId_t_ const *""'"); } @@ -6041,11 +5669,12 @@ SWIGINTERN PyObject *_wrap_CorrelationId_classId(PyObject *SWIGUNUSEDPARM(self), struct blpapi_CorrelationId_t_ *arg1 = (struct blpapi_CorrelationId_t_ *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; unsigned short result; - if (!PyArg_ParseTuple(args,(char *)"O:CorrelationId_classId",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CorrelationId_classId" "', argument " "1"" of type '" "struct blpapi_CorrelationId_t_ const *""'"); } @@ -6063,11 +5692,12 @@ SWIGINTERN PyObject *_wrap_CorrelationId___asObject(PyObject *SWIGUNUSEDPARM(sel struct blpapi_CorrelationId_t_ *arg1 = (struct blpapi_CorrelationId_t_ *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; PyObject *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:CorrelationId___asObject",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CorrelationId___asObject" "', argument " "1"" of type '" "struct blpapi_CorrelationId_t_ const *""'"); } @@ -6087,11 +5717,12 @@ SWIGINTERN PyObject *_wrap_CorrelationId___asInteger(PyObject *SWIGUNUSEDPARM(se struct blpapi_CorrelationId_t_ *arg1 = (struct blpapi_CorrelationId_t_ *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; long long result; - if (!PyArg_ParseTuple(args,(char *)"O:CorrelationId___asInteger",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CorrelationId___asInteger" "', argument " "1"" of type '" "struct blpapi_CorrelationId_t_ const *""'"); } @@ -6109,11 +5740,12 @@ SWIGINTERN PyObject *_wrap_CorrelationId___toInteger(PyObject *SWIGUNUSEDPARM(se struct blpapi_CorrelationId_t_ *arg1 = (struct blpapi_CorrelationId_t_ *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; long long result; - if (!PyArg_ParseTuple(args,(char *)"O:CorrelationId___toInteger",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CorrelationId___toInteger" "', argument " "1"" of type '" "struct blpapi_CorrelationId_t_ const *""'"); } @@ -6128,16 +5760,20 @@ SWIGINTERN PyObject *_wrap_CorrelationId___toInteger(PyObject *SWIGUNUSEDPARM(se SWIGINTERN PyObject *CorrelationId_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; + if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL; SWIG_TypeNewClientData(SWIGTYPE_p_blpapi_CorrelationId_t_, SWIG_NewClientData(obj)); return SWIG_Py_Void(); } +SWIGINTERN PyObject *CorrelationId_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + return SWIG_Python_InitShadowInstance(args); +} + SWIGINTERN PyObject *_wrap_new_blpapi_CorrelationId_t__value(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_CorrelationId_t__value *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)":new_blpapi_CorrelationId_t__value")) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "new_blpapi_CorrelationId_t__value", 0, 0, 0)) SWIG_fail; { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (blpapi_CorrelationId_t__value *)calloc(1, sizeof(blpapi_CorrelationId_t__value)); @@ -6155,10 +5791,11 @@ SWIGINTERN PyObject *_wrap_delete_blpapi_CorrelationId_t__value(PyObject *SWIGUN blpapi_CorrelationId_t__value *arg1 = (blpapi_CorrelationId_t__value *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; - if (!PyArg_ParseTuple(args,(char *)"O:delete_blpapi_CorrelationId_t__value",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_CorrelationId_t__value, SWIG_POINTER_DISOWN | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_CorrelationId_t__value, SWIG_POINTER_DISOWN | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_blpapi_CorrelationId_t__value" "', argument " "1"" of type '" "blpapi_CorrelationId_t__value *""'"); } @@ -6177,11 +5814,15 @@ SWIGINTERN PyObject *_wrap_delete_blpapi_CorrelationId_t__value(PyObject *SWIGUN SWIGINTERN PyObject *blpapi_CorrelationId_t__value_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; + if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL; SWIG_TypeNewClientData(SWIGTYPE_p_blpapi_CorrelationId_t__value, SWIG_NewClientData(obj)); return SWIG_Py_Void(); } +SWIGINTERN PyObject *blpapi_CorrelationId_t__value_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + return SWIG_Python_InitShadowInstance(args); +} + SWIGINTERN PyObject *_wrap_blpapi_Element_setElementFloat(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; @@ -6197,29 +5838,26 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_setElementFloat(PyObject *SWIGUNUSEDPA int res3 = 0 ; double val4 ; int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; + PyObject *swig_obj[4] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Element_setElementFloat",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_setElementFloat", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setElementFloat" "', argument " "1"" of type '" "blpapi_Element_t *""'"); } arg1 = (blpapi_Element_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setElementFloat" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_setElementFloat" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); } arg3 = (blpapi_Name_t *)(argp3); - ecode4 = SWIG_AsVal_double(obj3, &val4); + ecode4 = SWIG_AsVal_double(swig_obj[3], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_Element_setElementFloat" "', argument " "4"" of type '" "blpapi_Float64_t""'"); } @@ -6249,23 +5887,21 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_setValueFloat(PyObject *SWIGUNUSEDPARM int ecode2 = 0 ; size_t val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Element_setValueFloat",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_setValueFloat", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setValueFloat" "', argument " "1"" of type '" "blpapi_Element_t *""'"); } arg1 = (blpapi_Element_t *)(argp1); - ecode2 = SWIG_AsVal_double(obj1, &val2); + ecode2 = SWIG_AsVal_double(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Element_setValueFloat" "', argument " "2"" of type '" "blpapi_Float64_t""'"); } arg2 = (blpapi_Float64_t)(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); + ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_setValueFloat" "', argument " "3"" of type '" "size_t""'"); } @@ -6297,23 +5933,21 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_printHelper(PyObject *SWIGUNUSEDPARM(s int ecode3 = 0 ; char *temp4 = 0 ; int tempn4 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; arg4 = &temp4; arg5 = &tempn4; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Element_printHelper",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_printHelper", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_printHelper" "', argument " "1"" of type '" "blpapi_Element_t *""'"); } arg1 = (blpapi_Element_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Element_printHelper" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_printHelper" "', argument " "3"" of type '" "int""'"); } @@ -6339,11 +5973,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_name(PyObject *SWIGUNUSEDPARM(self), P blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; blpapi_Name_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Element_name",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_name" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); } @@ -6365,11 +6000,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_nameString(PyObject *SWIGUNUSEDPARM(se blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Element_nameString",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_nameString" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); } @@ -6391,11 +6027,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_definition(PyObject *SWIGUNUSEDPARM(se blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; blpapi_SchemaElementDefinition_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Element_definition",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_definition" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); } @@ -6417,11 +6054,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_datatype(PyObject *SWIGUNUSEDPARM(self blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Element_datatype",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_datatype" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); } @@ -6443,11 +6081,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_isComplexType(PyObject *SWIGUNUSEDPARM blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Element_isComplexType",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_isComplexType" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); } @@ -6469,11 +6108,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_isArray(PyObject *SWIGUNUSEDPARM(self) blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Element_isArray",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_isArray" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); } @@ -6495,11 +6135,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_isReadOnly(PyObject *SWIGUNUSEDPARM(se blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Element_isReadOnly",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_isReadOnly" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); } @@ -6521,11 +6162,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_numValues(PyObject *SWIGUNUSEDPARM(sel blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; size_t result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Element_numValues",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_numValues" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); } @@ -6547,11 +6189,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_numElements(PyObject *SWIGUNUSEDPARM(s blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; size_t result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Element_numElements",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_numElements" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); } @@ -6576,17 +6219,16 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_isNullValue(PyObject *SWIGUNUSEDPARM(s int res1 = 0 ; size_t val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Element_isNullValue",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_isNullValue", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_isNullValue" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); } arg1 = (blpapi_Element_t *)(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); + ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Element_isNullValue" "', argument " "2"" of type '" "size_t""'"); } @@ -6608,11 +6250,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_isNull(PyObject *SWIGUNUSEDPARM(self), blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Element_isNull",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_isNull" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); } @@ -6639,18 +6282,17 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_getElementAt(PyObject *SWIGUNUSEDPARM( blpapi_Element_t *temp2 = 0 ; size_t val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Element_getElementAt",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_getElementAt", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getElementAt" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); } arg1 = (blpapi_Element_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); + ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getElementAt" "', argument " "3"" of type '" "size_t""'"); } @@ -6682,24 +6324,22 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_getElement(PyObject *SWIGUNUSEDPARM(se int alloc3 = 0 ; void *argp4 = 0 ; int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Element_getElement",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_getElement", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getElement" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); } arg1 = (blpapi_Element_t *)(argp1); - res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); + res3 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf3, NULL, &alloc3); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_getElement" "', argument " "3"" of type '" "char const *""'"); } arg3 = (char *)(buf3); - res4 = SWIG_ConvertPtr(obj2, &argp4,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res4 = SWIG_ConvertPtr(swig_obj[2], &argp4,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Element_getElement" "', argument " "4"" of type '" "blpapi_Name_t const *""'"); } @@ -6737,35 +6377,31 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_hasElementEx(PyObject *SWIGUNUSEDPARM( int ecode4 = 0 ; int val5 ; int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; + PyObject *swig_obj[5] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOOO:blpapi_Element_hasElementEx",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_hasElementEx", 5, 5, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_hasElementEx" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); } arg1 = (blpapi_Element_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_hasElementEx" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_hasElementEx" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); } arg3 = (blpapi_Name_t *)(argp3); - ecode4 = SWIG_AsVal_int(obj3, &val4); + ecode4 = SWIG_AsVal_int(swig_obj[3], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_Element_hasElementEx" "', argument " "4"" of type '" "int""'"); } arg4 = (int)(val4); - ecode5 = SWIG_AsVal_int(obj4, &val5); + ecode5 = SWIG_AsVal_int(swig_obj[4], &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_Element_hasElementEx" "', argument " "5"" of type '" "int""'"); } @@ -6794,18 +6430,17 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsBool(PyObject *SWIGUNUSEDPAR int temp2 ; size_t val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Element_getValueAsBool",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_getValueAsBool", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsBool" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); } arg1 = (blpapi_Element_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); + ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getValueAsBool" "', argument " "3"" of type '" "size_t""'"); } @@ -6834,18 +6469,17 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsChar(PyObject *SWIGUNUSEDPAR int res2 = SWIG_TMPOBJ ; size_t val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Element_getValueAsChar",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_getValueAsChar", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsChar" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); } arg1 = (blpapi_Element_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); + ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getValueAsChar" "', argument " "3"" of type '" "size_t""'"); } @@ -6878,18 +6512,17 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsInt32(PyObject *SWIGUNUSEDPA int temp2 ; size_t val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Element_getValueAsInt32",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_getValueAsInt32", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsInt32" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); } arg1 = (blpapi_Element_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); + ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getValueAsInt32" "', argument " "3"" of type '" "size_t""'"); } @@ -6918,18 +6551,17 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsInt64(PyObject *SWIGUNUSEDPA int res2 = SWIG_TMPOBJ ; size_t val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Element_getValueAsInt64",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_getValueAsInt64", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsInt64" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); } arg1 = (blpapi_Element_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); + ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getValueAsInt64" "', argument " "3"" of type '" "size_t""'"); } @@ -6963,18 +6595,17 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsFloat64(PyObject *SWIGUNUSED int res2 = SWIG_TMPOBJ ; size_t val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Element_getValueAsFloat64",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_getValueAsFloat64", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsFloat64" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); } arg1 = (blpapi_Element_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); + ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getValueAsFloat64" "', argument " "3"" of type '" "size_t""'"); } @@ -7007,18 +6638,17 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsString(PyObject *SWIGUNUSEDP char *temp2 = 0 ; size_t val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Element_getValueAsString",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_getValueAsString", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsString" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); } arg1 = (blpapi_Element_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); + ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getValueAsString" "', argument " "3"" of type '" "size_t""'"); } @@ -7046,18 +6676,17 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsDatetime(PyObject *SWIGUNUSE blpapi_Datetime_t temp2 ; size_t val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Element_getValueAsDatetime",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_getValueAsDatetime", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsDatetime" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); } arg1 = (blpapi_Element_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); + ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getValueAsDatetime" "', argument " "3"" of type '" "size_t""'"); } @@ -7089,18 +6718,17 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsHighPrecisionDatetime(PyObje blpapi_HighPrecisionDatetime_t temp2 ; size_t val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Element_getValueAsHighPrecisionDatetime",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_getValueAsHighPrecisionDatetime", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsHighPrecisionDatetime" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); } arg1 = (blpapi_Element_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); + ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getValueAsHighPrecisionDatetime" "', argument " "3"" of type '" "size_t""'"); } @@ -7132,18 +6760,17 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsElement(PyObject *SWIGUNUSED blpapi_Element_t *temp2 = 0 ; size_t val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Element_getValueAsElement",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_getValueAsElement", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsElement" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); } arg1 = (blpapi_Element_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); + ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getValueAsElement" "', argument " "3"" of type '" "size_t""'"); } @@ -7171,18 +6798,17 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsName(PyObject *SWIGUNUSEDPAR blpapi_Name_t *temp2 = 0 ; size_t val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Element_getValueAsName",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_getValueAsName", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsName" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); } arg1 = (blpapi_Element_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); + ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getValueAsName" "', argument " "3"" of type '" "size_t""'"); } @@ -7207,12 +6833,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_getChoice(PyObject *SWIGUNUSEDPARM(sel void *argp1 = 0 ; int res1 = 0 ; blpapi_Element_t *temp2 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Element_getChoice",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getChoice" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); } @@ -7241,23 +6868,21 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_setValueBool(PyObject *SWIGUNUSEDPARM( int ecode2 = 0 ; size_t val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Element_setValueBool",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_setValueBool", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setValueBool" "', argument " "1"" of type '" "blpapi_Element_t *""'"); } arg1 = (blpapi_Element_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Element_setValueBool" "', argument " "2"" of type '" "blpapi_Bool_t""'"); } arg2 = (blpapi_Bool_t)(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); + ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_setValueBool" "', argument " "3"" of type '" "size_t""'"); } @@ -7285,23 +6910,21 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_setValueInt32(PyObject *SWIGUNUSEDPARM int ecode2 = 0 ; size_t val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Element_setValueInt32",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_setValueInt32", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setValueInt32" "', argument " "1"" of type '" "blpapi_Element_t *""'"); } arg1 = (blpapi_Element_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Element_setValueInt32" "', argument " "2"" of type '" "blpapi_Int32_t""'"); } arg2 = (blpapi_Int32_t)(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); + ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_setValueInt32" "', argument " "3"" of type '" "size_t""'"); } @@ -7329,23 +6952,21 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_setValueInt64(PyObject *SWIGUNUSEDPARM int ecode2 = 0 ; size_t val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Element_setValueInt64",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_setValueInt64", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setValueInt64" "', argument " "1"" of type '" "blpapi_Element_t *""'"); } arg1 = (blpapi_Element_t *)(argp1); - ecode2 = SWIG_AsVal_long_SS_long(obj1, &val2); + ecode2 = SWIG_AsVal_long_SS_long(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Element_setValueInt64" "', argument " "2"" of type '" "blpapi_Int64_t""'"); } arg2 = (blpapi_Int64_t)(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); + ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_setValueInt64" "', argument " "3"" of type '" "size_t""'"); } @@ -7374,23 +6995,21 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_setValueString(PyObject *SWIGUNUSEDPAR int alloc2 = 0 ; size_t val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Element_setValueString",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_setValueString", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setValueString" "', argument " "1"" of type '" "blpapi_Element_t *""'"); } arg1 = (blpapi_Element_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setValueString" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); + ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_setValueString" "', argument " "3"" of type '" "size_t""'"); } @@ -7420,23 +7039,21 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_setValueHighPrecisionDatetime(PyObject int res2 = 0 ; size_t val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Element_setValueHighPrecisionDatetime",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_setValueHighPrecisionDatetime", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setValueHighPrecisionDatetime" "', argument " "1"" of type '" "blpapi_Element_t *""'"); } arg1 = (blpapi_Element_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setValueHighPrecisionDatetime" "', argument " "2"" of type '" "blpapi_HighPrecisionDatetime_t const *""'"); } arg2 = (blpapi_HighPrecisionDatetime_t *)(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); + ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_setValueHighPrecisionDatetime" "', argument " "3"" of type '" "size_t""'"); } @@ -7464,23 +7081,21 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_setValueFromName(PyObject *SWIGUNUSEDP int res2 = 0 ; size_t val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Element_setValueFromName",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_setValueFromName", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setValueFromName" "', argument " "1"" of type '" "blpapi_Element_t *""'"); } arg1 = (blpapi_Element_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setValueFromName" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); } arg2 = (blpapi_Name_t *)(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); + ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_setValueFromName" "', argument " "3"" of type '" "size_t""'"); } @@ -7512,29 +7127,26 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_setElementBool(PyObject *SWIGUNUSEDPAR int res3 = 0 ; int val4 ; int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; + PyObject *swig_obj[4] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Element_setElementBool",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_setElementBool", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setElementBool" "', argument " "1"" of type '" "blpapi_Element_t *""'"); } arg1 = (blpapi_Element_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setElementBool" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_setElementBool" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); } arg3 = (blpapi_Name_t *)(argp3); - ecode4 = SWIG_AsVal_int(obj3, &val4); + ecode4 = SWIG_AsVal_int(swig_obj[3], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_Element_setElementBool" "', argument " "4"" of type '" "blpapi_Bool_t""'"); } @@ -7568,29 +7180,26 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_setElementInt32(PyObject *SWIGUNUSEDPA int res3 = 0 ; int val4 ; int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; + PyObject *swig_obj[4] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Element_setElementInt32",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_setElementInt32", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setElementInt32" "', argument " "1"" of type '" "blpapi_Element_t *""'"); } arg1 = (blpapi_Element_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setElementInt32" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_setElementInt32" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); } arg3 = (blpapi_Name_t *)(argp3); - ecode4 = SWIG_AsVal_int(obj3, &val4); + ecode4 = SWIG_AsVal_int(swig_obj[3], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_Element_setElementInt32" "', argument " "4"" of type '" "blpapi_Int32_t""'"); } @@ -7624,29 +7233,26 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_setElementInt64(PyObject *SWIGUNUSEDPA int res3 = 0 ; long long val4 ; int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; + PyObject *swig_obj[4] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Element_setElementInt64",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_setElementInt64", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setElementInt64" "', argument " "1"" of type '" "blpapi_Element_t *""'"); } arg1 = (blpapi_Element_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setElementInt64" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_setElementInt64" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); } arg3 = (blpapi_Name_t *)(argp3); - ecode4 = SWIG_AsVal_long_SS_long(obj3, &val4); + ecode4 = SWIG_AsVal_long_SS_long(swig_obj[3], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_Element_setElementInt64" "', argument " "4"" of type '" "blpapi_Int64_t""'"); } @@ -7681,29 +7287,26 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_setElementString(PyObject *SWIGUNUSEDP int res4 ; char *buf4 = 0 ; int alloc4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; + PyObject *swig_obj[4] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Element_setElementString",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_setElementString", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setElementString" "', argument " "1"" of type '" "blpapi_Element_t *""'"); } arg1 = (blpapi_Element_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setElementString" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_setElementString" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); } arg3 = (blpapi_Name_t *)(argp3); - res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4); + res4 = SWIG_AsCharPtrAndSize(swig_obj[3], &buf4, NULL, &alloc4); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Element_setElementString" "', argument " "4"" of type '" "char const *""'"); } @@ -7739,29 +7342,26 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_setElementHighPrecisionDatetime(PyObje int res3 = 0 ; void *argp4 = 0 ; int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; + PyObject *swig_obj[4] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Element_setElementHighPrecisionDatetime",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_setElementHighPrecisionDatetime", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setElementHighPrecisionDatetime" "', argument " "1"" of type '" "blpapi_Element_t *""'"); } arg1 = (blpapi_Element_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setElementHighPrecisionDatetime" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_setElementHighPrecisionDatetime" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); } arg3 = (blpapi_Name_t *)(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); + res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Element_setElementHighPrecisionDatetime" "', argument " "4"" of type '" "blpapi_HighPrecisionDatetime_t const *""'"); } @@ -7795,29 +7395,26 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_setElementFromName(PyObject *SWIGUNUSE int res3 = 0 ; void *argp4 = 0 ; int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; + PyObject *swig_obj[4] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Element_setElementFromName",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_setElementFromName", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setElementFromName" "', argument " "1"" of type '" "blpapi_Element_t *""'"); } arg1 = (blpapi_Element_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setElementFromName" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_setElementFromName" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); } arg3 = (blpapi_Name_t *)(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Element_setElementFromName" "', argument " "4"" of type '" "blpapi_Name_t const *""'"); } @@ -7843,12 +7440,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_appendElement(PyObject *SWIGUNUSEDPARM void *argp1 = 0 ; int res1 = 0 ; blpapi_Element_t *temp2 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Element_appendElement",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_appendElement" "', argument " "1"" of type '" "blpapi_Element_t *""'"); } @@ -7883,30 +7481,27 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_setChoice(PyObject *SWIGUNUSEDPARM(sel int res4 = 0 ; size_t val5 ; int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; + PyObject *swig_obj[4] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Element_setChoice",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_setChoice", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setChoice" "', argument " "1"" of type '" "blpapi_Element_t *""'"); } arg1 = (blpapi_Element_t *)(argp1); - res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); + res3 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf3, NULL, &alloc3); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_setChoice" "', argument " "3"" of type '" "char const *""'"); } arg3 = (char *)(buf3); - res4 = SWIG_ConvertPtr(obj2, &argp4,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res4 = SWIG_ConvertPtr(swig_obj[2], &argp4,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Element_setChoice" "', argument " "4"" of type '" "blpapi_Name_t const *""'"); } arg4 = (blpapi_Name_t *)(argp4); - ecode5 = SWIG_AsVal_size_t(obj3, &val5); + ecode5 = SWIG_AsVal_size_t(swig_obj[3], &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_Element_setChoice" "', argument " "5"" of type '" "size_t""'"); } @@ -7941,29 +7536,26 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueFloat(PyObject *SWIGUNU int res3 = 0 ; double val4 ; int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; + PyObject *swig_obj[4] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_EventFormatter_setValueFloat",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_setValueFloat", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_setValueFloat" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); } arg1 = (blpapi_EventFormatter_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_setValueFloat" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_setValueFloat" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); } arg3 = (blpapi_Name_t *)(argp3); - ecode4 = SWIG_AsVal_double(obj3, &val4); + ecode4 = SWIG_AsVal_double(swig_obj[3], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_EventFormatter_setValueFloat" "', argument " "4"" of type '" "blpapi_Float64_t""'"); } @@ -7990,17 +7582,16 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueFloat(PyObject *SWIG int res1 = 0 ; double val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_EventFormatter_appendValueFloat",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_appendValueFloat", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendValueFloat" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); } arg1 = (blpapi_EventFormatter_t *)(argp1); - ecode2 = SWIG_AsVal_double(obj1, &val2); + ecode2 = SWIG_AsVal_double(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_EventFormatter_appendValueFloat" "', argument " "2"" of type '" "blpapi_Float64_t""'"); } @@ -8022,11 +7613,12 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_create(PyObject *SWIGUNUSEDPARM blpapi_Event_t *arg1 = (blpapi_Event_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; blpapi_EventFormatter_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_EventFormatter_create",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Event, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Event, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_create" "', argument " "1"" of type '" "blpapi_Event_t *""'"); } @@ -8048,10 +7640,11 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_destroy(PyObject *SWIGUNUSEDPAR blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_EventFormatter_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_destroy" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); } @@ -8083,29 +7676,26 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendMessage(PyObject *SWIGUNU int res3 = 0 ; void *argp4 = 0 ; int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; + PyObject *swig_obj[4] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_EventFormatter_appendMessage",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_appendMessage", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendMessage" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); } arg1 = (blpapi_EventFormatter_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendMessage" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_appendMessage" "', argument " "3"" of type '" "blpapi_Name_t *""'"); } arg3 = (blpapi_Name_t *)(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); + res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_EventFormatter_appendMessage" "', argument " "4"" of type '" "blpapi_Topic_t const *""'"); } @@ -8145,41 +7735,36 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendMessageSeq(PyObject *SWIG int ecode5 = 0 ; unsigned int val6 ; int ecode6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; + PyObject *swig_obj[6] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:blpapi_EventFormatter_appendMessageSeq",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_appendMessageSeq", 6, 6, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendMessageSeq" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); } arg1 = (blpapi_EventFormatter_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendMessageSeq" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_appendMessageSeq" "', argument " "3"" of type '" "blpapi_Name_t *""'"); } arg3 = (blpapi_Name_t *)(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); + res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_EventFormatter_appendMessageSeq" "', argument " "4"" of type '" "blpapi_Topic_t const *""'"); } arg4 = (blpapi_Topic_t *)(argp4); - ecode5 = SWIG_AsVal_unsigned_SS_int(obj4, &val5); + ecode5 = SWIG_AsVal_unsigned_SS_int(swig_obj[4], &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_EventFormatter_appendMessageSeq" "', argument " "5"" of type '" "unsigned int""'"); } arg5 = (unsigned int)(val5); - ecode6 = SWIG_AsVal_unsigned_SS_int(obj5, &val6); + ecode6 = SWIG_AsVal_unsigned_SS_int(swig_obj[5], &val6); if (!SWIG_IsOK(ecode6)) { SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "blpapi_EventFormatter_appendMessageSeq" "', argument " "6"" of type '" "unsigned int""'"); } @@ -8210,23 +7795,21 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendResponse(PyObject *SWIGUN int alloc2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_EventFormatter_appendResponse",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_appendResponse", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendResponse" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); } arg1 = (blpapi_EventFormatter_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendResponse" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_appendResponse" "', argument " "3"" of type '" "blpapi_Name_t *""'"); } @@ -8256,23 +7839,21 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendRecapMessage(PyObject *SW int res2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_EventFormatter_appendRecapMessage",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_appendRecapMessage", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendRecapMessage" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); } arg1 = (blpapi_EventFormatter_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendRecapMessage" "', argument " "2"" of type '" "blpapi_Topic_t const *""'"); } arg2 = (blpapi_Topic_t *)(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_appendRecapMessage" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); } @@ -8306,35 +7887,31 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendRecapMessageSeq(PyObject int ecode4 = 0 ; unsigned int val5 ; int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; + PyObject *swig_obj[5] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOOO:blpapi_EventFormatter_appendRecapMessageSeq",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_appendRecapMessageSeq", 5, 5, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendRecapMessageSeq" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); } arg1 = (blpapi_EventFormatter_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendRecapMessageSeq" "', argument " "2"" of type '" "blpapi_Topic_t const *""'"); } arg2 = (blpapi_Topic_t *)(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_appendRecapMessageSeq" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); } arg3 = (blpapi_CorrelationId_t *)(argp3); - ecode4 = SWIG_AsVal_unsigned_SS_int(obj3, &val4); + ecode4 = SWIG_AsVal_unsigned_SS_int(swig_obj[3], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_EventFormatter_appendRecapMessageSeq" "', argument " "4"" of type '" "unsigned int""'"); } arg4 = (unsigned int)(val4); - ecode5 = SWIG_AsVal_unsigned_SS_int(obj4, &val5); + ecode5 = SWIG_AsVal_unsigned_SS_int(swig_obj[4], &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_EventFormatter_appendRecapMessageSeq" "', argument " "5"" of type '" "unsigned int""'"); } @@ -8372,41 +7949,36 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendFragmentedRecapMessage(Py int res5 = 0 ; int val6 ; int ecode6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; + PyObject *swig_obj[6] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:blpapi_EventFormatter_appendFragmentedRecapMessage",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_appendFragmentedRecapMessage", 6, 6, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessage" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); } arg1 = (blpapi_EventFormatter_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessage" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessage" "', argument " "3"" of type '" "blpapi_Name_t *""'"); } arg3 = (blpapi_Name_t *)(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); + res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessage" "', argument " "4"" of type '" "blpapi_Topic_t const *""'"); } arg4 = (blpapi_Topic_t *)(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + res5 = SWIG_ConvertPtr(swig_obj[4], &argp5,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); if (!SWIG_IsOK(res5)) { SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessage" "', argument " "5"" of type '" "blpapi_CorrelationId_t const *""'"); } arg5 = (blpapi_CorrelationId_t *)(argp5); - ecode6 = SWIG_AsVal_int(obj5, &val6); + ecode6 = SWIG_AsVal_int(swig_obj[5], &val6); if (!SWIG_IsOK(ecode6)) { SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessage" "', argument " "6"" of type '" "int""'"); } @@ -8446,41 +8018,36 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendFragmentedRecapMessageSeq int ecode5 = 0 ; unsigned int val6 ; int ecode6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; + PyObject *swig_obj[6] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:blpapi_EventFormatter_appendFragmentedRecapMessageSeq",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_appendFragmentedRecapMessageSeq", 6, 6, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessageSeq" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); } arg1 = (blpapi_EventFormatter_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessageSeq" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessageSeq" "', argument " "3"" of type '" "blpapi_Name_t *""'"); } arg3 = (blpapi_Name_t *)(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); + res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessageSeq" "', argument " "4"" of type '" "blpapi_Topic_t const *""'"); } arg4 = (blpapi_Topic_t *)(argp4); - ecode5 = SWIG_AsVal_int(obj4, &val5); + ecode5 = SWIG_AsVal_int(swig_obj[4], &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessageSeq" "', argument " "5"" of type '" "int""'"); } arg5 = (int)(val5); - ecode6 = SWIG_AsVal_unsigned_SS_int(obj5, &val6); + ecode6 = SWIG_AsVal_unsigned_SS_int(swig_obj[5], &val6); if (!SWIG_IsOK(ecode6)) { SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessageSeq" "', argument " "6"" of type '" "unsigned int""'"); } @@ -8514,29 +8081,26 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueBool(PyObject *SWIGUNUS int res3 = 0 ; int val4 ; int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; + PyObject *swig_obj[4] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_EventFormatter_setValueBool",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_setValueBool", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_setValueBool" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); } arg1 = (blpapi_EventFormatter_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_setValueBool" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_setValueBool" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); } arg3 = (blpapi_Name_t *)(argp3); - ecode4 = SWIG_AsVal_int(obj3, &val4); + ecode4 = SWIG_AsVal_int(swig_obj[3], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_EventFormatter_setValueBool" "', argument " "4"" of type '" "blpapi_Bool_t""'"); } @@ -8570,29 +8134,26 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueChar(PyObject *SWIGUNUS int res3 = 0 ; char val4 ; int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; + PyObject *swig_obj[4] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_EventFormatter_setValueChar",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_setValueChar", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_setValueChar" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); } arg1 = (blpapi_EventFormatter_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_setValueChar" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_setValueChar" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); } arg3 = (blpapi_Name_t *)(argp3); - ecode4 = SWIG_AsVal_char(obj3, &val4); + ecode4 = SWIG_AsVal_char(swig_obj[3], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_EventFormatter_setValueChar" "', argument " "4"" of type '" "char""'"); } @@ -8626,29 +8187,26 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueInt32(PyObject *SWIGUNU int res3 = 0 ; int val4 ; int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; + PyObject *swig_obj[4] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_EventFormatter_setValueInt32",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_setValueInt32", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_setValueInt32" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); } arg1 = (blpapi_EventFormatter_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_setValueInt32" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_setValueInt32" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); } arg3 = (blpapi_Name_t *)(argp3); - ecode4 = SWIG_AsVal_int(obj3, &val4); + ecode4 = SWIG_AsVal_int(swig_obj[3], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_EventFormatter_setValueInt32" "', argument " "4"" of type '" "blpapi_Int32_t""'"); } @@ -8682,29 +8240,26 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueInt64(PyObject *SWIGUNU int res3 = 0 ; long long val4 ; int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; + PyObject *swig_obj[4] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_EventFormatter_setValueInt64",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_setValueInt64", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_setValueInt64" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); } arg1 = (blpapi_EventFormatter_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_setValueInt64" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_setValueInt64" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); } arg3 = (blpapi_Name_t *)(argp3); - ecode4 = SWIG_AsVal_long_SS_long(obj3, &val4); + ecode4 = SWIG_AsVal_long_SS_long(swig_obj[3], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_EventFormatter_setValueInt64" "', argument " "4"" of type '" "blpapi_Int64_t""'"); } @@ -8738,29 +8293,26 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueHighPrecisionDatetime(P int res3 = 0 ; void *argp4 = 0 ; int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; + PyObject *swig_obj[4] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_EventFormatter_setValueHighPrecisionDatetime",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_setValueHighPrecisionDatetime", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_setValueHighPrecisionDatetime" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); } arg1 = (blpapi_EventFormatter_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_setValueHighPrecisionDatetime" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_setValueHighPrecisionDatetime" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); } arg3 = (blpapi_Name_t *)(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); + res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_EventFormatter_setValueHighPrecisionDatetime" "', argument " "4"" of type '" "blpapi_HighPrecisionDatetime_t const *""'"); } @@ -8795,29 +8347,26 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueString(PyObject *SWIGUN int res4 ; char *buf4 = 0 ; int alloc4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; + PyObject *swig_obj[4] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_EventFormatter_setValueString",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_setValueString", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_setValueString" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); } arg1 = (blpapi_EventFormatter_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_setValueString" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_setValueString" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); } arg3 = (blpapi_Name_t *)(argp3); - res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4); + res4 = SWIG_AsCharPtrAndSize(swig_obj[3], &buf4, NULL, &alloc4); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_EventFormatter_setValueString" "', argument " "4"" of type '" "char const *""'"); } @@ -8853,29 +8402,26 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueFromName(PyObject *SWIG int res3 = 0 ; void *argp4 = 0 ; int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; + PyObject *swig_obj[4] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_EventFormatter_setValueFromName",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_setValueFromName", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_setValueFromName" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); } arg1 = (blpapi_EventFormatter_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_setValueFromName" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_setValueFromName" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); } arg3 = (blpapi_Name_t *)(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_EventFormatter_setValueFromName" "', argument " "4"" of type '" "blpapi_Name_t const *""'"); } @@ -8906,23 +8452,21 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueNull(PyObject *SWIGUNUS int alloc2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_EventFormatter_setValueNull",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_setValueNull", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_setValueNull" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); } arg1 = (blpapi_EventFormatter_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_setValueNull" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_setValueNull" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); } @@ -8953,23 +8497,21 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_pushElement(PyObject *SWIGUNUSE int alloc2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_EventFormatter_pushElement",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_pushElement", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_pushElement" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); } arg1 = (blpapi_EventFormatter_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_pushElement" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_pushElement" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); } @@ -8993,11 +8535,12 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_popElement(PyObject *SWIGUNUSED blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_EventFormatter_popElement",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_popElement" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); } @@ -9022,17 +8565,16 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueBool(PyObject *SWIGU int res1 = 0 ; int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_EventFormatter_appendValueBool",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_appendValueBool", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendValueBool" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); } arg1 = (blpapi_EventFormatter_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_EventFormatter_appendValueBool" "', argument " "2"" of type '" "blpapi_Bool_t""'"); } @@ -9057,17 +8599,16 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueChar(PyObject *SWIGU int res1 = 0 ; char val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_EventFormatter_appendValueChar",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_appendValueChar", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendValueChar" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); } arg1 = (blpapi_EventFormatter_t *)(argp1); - ecode2 = SWIG_AsVal_char(obj1, &val2); + ecode2 = SWIG_AsVal_char(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_EventFormatter_appendValueChar" "', argument " "2"" of type '" "char""'"); } @@ -9092,17 +8633,16 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueInt32(PyObject *SWIG int res1 = 0 ; int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_EventFormatter_appendValueInt32",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_appendValueInt32", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendValueInt32" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); } arg1 = (blpapi_EventFormatter_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_EventFormatter_appendValueInt32" "', argument " "2"" of type '" "blpapi_Int32_t""'"); } @@ -9127,17 +8667,16 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueInt64(PyObject *SWIG int res1 = 0 ; long long val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_EventFormatter_appendValueInt64",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_appendValueInt64", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendValueInt64" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); } arg1 = (blpapi_EventFormatter_t *)(argp1); - ecode2 = SWIG_AsVal_long_SS_long(obj1, &val2); + ecode2 = SWIG_AsVal_long_SS_long(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_EventFormatter_appendValueInt64" "', argument " "2"" of type '" "blpapi_Int64_t""'"); } @@ -9162,17 +8701,16 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueHighPrecisionDatetim int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_EventFormatter_appendValueHighPrecisionDatetime",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_appendValueHighPrecisionDatetime", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendValueHighPrecisionDatetime" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); } arg1 = (blpapi_EventFormatter_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendValueHighPrecisionDatetime" "', argument " "2"" of type '" "blpapi_HighPrecisionDatetime_t const *""'"); } @@ -9198,17 +8736,16 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueString(PyObject *SWI int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_EventFormatter_appendValueString",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_appendValueString", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendValueString" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); } arg1 = (blpapi_EventFormatter_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendValueString" "', argument " "2"" of type '" "char const *""'"); } @@ -9235,17 +8772,16 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueFromName(PyObject *S int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_EventFormatter_appendValueFromName",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_appendValueFromName", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendValueFromName" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); } arg1 = (blpapi_EventFormatter_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendValueFromName" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); } @@ -9267,11 +8803,12 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendElement(PyObject *SWIGUNU blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_EventFormatter_appendElement",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendElement" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); } @@ -9297,21 +8834,19 @@ SWIGINTERN PyObject *_wrap_Session_createHelper(PyObject *SWIGUNUSEDPARM(self), int res1 = 0 ; void *argp3 = 0 ; int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; blpapi_Session_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OOO:Session_createHelper",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "Session_createHelper", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_createHelper" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); { - arg2 = obj1; + arg2 = swig_obj[1]; } - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_EventDispatcher, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_EventDispatcher, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Session_createHelper" "', argument " "3"" of type '" "blpapi_EventDispatcher_t *""'"); } @@ -9330,17 +8865,16 @@ SWIGINTERN PyObject *_wrap_Session_destroyHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:Session_destroyHelper",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "Session_destroyHelper", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_destroyHelper" "', argument " "1"" of type '" "blpapi_Session_t *""'"); } arg1 = (blpapi_Session_t *)(argp1); { - arg2 = obj1; + arg2 = swig_obj[1]; } Session_destroyHelper(arg1,arg2); resultobj = SWIG_Py_Void(); @@ -9355,11 +8889,12 @@ SWIGINTERN PyObject *_wrap_blpapi_EventDispatcher_create(PyObject *SWIGUNUSEDPAR size_t arg1 ; size_t val1 ; int ecode1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; blpapi_EventDispatcher_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_EventDispatcher_create",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); + if (!args) SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_size_t(swig_obj[0], &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "blpapi_EventDispatcher_create" "', argument " "1"" of type '" "size_t""'"); } @@ -9381,10 +8916,11 @@ SWIGINTERN PyObject *_wrap_blpapi_EventDispatcher_destroy(PyObject *SWIGUNUSEDPA blpapi_EventDispatcher_t *arg1 = (blpapi_EventDispatcher_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_EventDispatcher_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventDispatcher, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventDispatcher, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventDispatcher_destroy" "', argument " "1"" of type '" "blpapi_EventDispatcher_t *""'"); } @@ -9406,11 +8942,12 @@ SWIGINTERN PyObject *_wrap_blpapi_EventDispatcher_start(PyObject *SWIGUNUSEDPARM blpapi_EventDispatcher_t *arg1 = (blpapi_EventDispatcher_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_EventDispatcher_start",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventDispatcher, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventDispatcher, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventDispatcher_start" "', argument " "1"" of type '" "blpapi_EventDispatcher_t *""'"); } @@ -9436,21 +8973,19 @@ SWIGINTERN PyObject *_wrap_ProviderSession_createHelper(PyObject *SWIGUNUSEDPARM int res1 = 0 ; void *argp3 = 0 ; int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; blpapi_ProviderSession_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OOO:ProviderSession_createHelper",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "ProviderSession_createHelper", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProviderSession_createHelper" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); { - arg2 = obj1; + arg2 = swig_obj[1]; } - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_EventDispatcher, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_EventDispatcher, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProviderSession_createHelper" "', argument " "3"" of type '" "blpapi_EventDispatcher_t *""'"); } @@ -9469,17 +9004,16 @@ SWIGINTERN PyObject *_wrap_ProviderSession_destroyHelper(PyObject *SWIGUNUSEDPAR PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:ProviderSession_destroyHelper",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "ProviderSession_destroyHelper", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProviderSession_destroyHelper" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); } arg1 = (blpapi_ProviderSession_t *)(argp1); { - arg2 = obj1; + arg2 = swig_obj[1]; } ProviderSession_destroyHelper(arg1,arg2); resultobj = SWIG_Py_Void(); @@ -9501,23 +9035,21 @@ SWIGINTERN PyObject *_wrap_ProviderSession_terminateSubscriptionsOnTopic(PyObjec int res3 ; char *buf3 = 0 ; int alloc3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:ProviderSession_terminateSubscriptionsOnTopic",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "ProviderSession_terminateSubscriptionsOnTopic", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProviderSession_terminateSubscriptionsOnTopic" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); } arg1 = (blpapi_ProviderSession_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProviderSession_terminateSubscriptionsOnTopic" "', argument " "2"" of type '" "blpapi_Topic_t const *""'"); } arg2 = (blpapi_Topic_t *)(argp2); - res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); + res3 = SWIG_AsCharPtrAndSize(swig_obj[2], &buf3, NULL, &alloc3); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProviderSession_terminateSubscriptionsOnTopic" "', argument " "3"" of type '" "char const *""'"); } @@ -9543,23 +9075,21 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_setValueFloat(PyObject *SWIGU int res2 = 0 ; double val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_MessageFormatter_setValueFloat",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_setValueFloat", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_setValueFloat" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } arg1 = (blpapi_MessageFormatter_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_setValueFloat" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); } arg2 = (blpapi_Name_t *)(argp2); - ecode3 = SWIG_AsVal_double(obj2, &val3); + ecode3 = SWIG_AsVal_double(swig_obj[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_MessageFormatter_setValueFloat" "', argument " "3"" of type '" "blpapi_Float64_t""'"); } @@ -9584,17 +9114,16 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_appendValueFloat(PyObject *SW int res1 = 0 ; double val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_MessageFormatter_appendValueFloat",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_appendValueFloat", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_appendValueFloat" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } arg1 = (blpapi_MessageFormatter_t *)(argp1); - ecode2 = SWIG_AsVal_double(obj1, &val2); + ecode2 = SWIG_AsVal_double(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_MessageFormatter_appendValueFloat" "', argument " "2"" of type '" "blpapi_Float64_t""'"); } @@ -9622,23 +9151,21 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_setValueBool(PyObject *SWIGUN int res2 = 0 ; int val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_MessageFormatter_setValueBool",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_setValueBool", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_setValueBool" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } arg1 = (blpapi_MessageFormatter_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_setValueBool" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); } arg2 = (blpapi_Name_t *)(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_MessageFormatter_setValueBool" "', argument " "3"" of type '" "blpapi_Bool_t""'"); } @@ -9666,23 +9193,21 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_setValueChar(PyObject *SWIGUN int res2 = 0 ; char val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_MessageFormatter_setValueChar",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_setValueChar", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_setValueChar" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } arg1 = (blpapi_MessageFormatter_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_setValueChar" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); } arg2 = (blpapi_Name_t *)(argp2); - ecode3 = SWIG_AsVal_char(obj2, &val3); + ecode3 = SWIG_AsVal_char(swig_obj[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_MessageFormatter_setValueChar" "', argument " "3"" of type '" "char""'"); } @@ -9710,23 +9235,21 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_setValueInt32(PyObject *SWIGU int res2 = 0 ; int val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_MessageFormatter_setValueInt32",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_setValueInt32", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_setValueInt32" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } arg1 = (blpapi_MessageFormatter_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_setValueInt32" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); } arg2 = (blpapi_Name_t *)(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_MessageFormatter_setValueInt32" "', argument " "3"" of type '" "blpapi_Int32_t""'"); } @@ -9754,23 +9277,21 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_setValueInt64(PyObject *SWIGU int res2 = 0 ; long long val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_MessageFormatter_setValueInt64",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_setValueInt64", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_setValueInt64" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } arg1 = (blpapi_MessageFormatter_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_setValueInt64" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); } arg2 = (blpapi_Name_t *)(argp2); - ecode3 = SWIG_AsVal_long_SS_long(obj2, &val3); + ecode3 = SWIG_AsVal_long_SS_long(swig_obj[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_MessageFormatter_setValueInt64" "', argument " "3"" of type '" "blpapi_Int64_t""'"); } @@ -9798,23 +9319,21 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_setValueFloat32(PyObject *SWI int res2 = 0 ; float val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_MessageFormatter_setValueFloat32",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_setValueFloat32", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_setValueFloat32" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } arg1 = (blpapi_MessageFormatter_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_setValueFloat32" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); } arg2 = (blpapi_Name_t *)(argp2); - ecode3 = SWIG_AsVal_float(obj2, &val3); + ecode3 = SWIG_AsVal_float(swig_obj[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_MessageFormatter_setValueFloat32" "', argument " "3"" of type '" "blpapi_Float32_t""'"); } @@ -9842,23 +9361,21 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_setValueFloat64(PyObject *SWI int res2 = 0 ; double val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_MessageFormatter_setValueFloat64",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_setValueFloat64", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_setValueFloat64" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } arg1 = (blpapi_MessageFormatter_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_setValueFloat64" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); } arg2 = (blpapi_Name_t *)(argp2); - ecode3 = SWIG_AsVal_double(obj2, &val3); + ecode3 = SWIG_AsVal_double(swig_obj[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_MessageFormatter_setValueFloat64" "', argument " "3"" of type '" "blpapi_Float64_t""'"); } @@ -9886,23 +9403,21 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_setValueDatetime(PyObject *SW int res2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_MessageFormatter_setValueDatetime",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_setValueDatetime", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_setValueDatetime" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } arg1 = (blpapi_MessageFormatter_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_setValueDatetime" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); } arg2 = (blpapi_Name_t *)(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_MessageFormatter_setValueDatetime" "', argument " "3"" of type '" "blpapi_Datetime_t const *""'"); } @@ -9930,23 +9445,21 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_setValueHighPrecisionDatetime int res2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_MessageFormatter_setValueHighPrecisionDatetime",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_setValueHighPrecisionDatetime", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_setValueHighPrecisionDatetime" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } arg1 = (blpapi_MessageFormatter_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_setValueHighPrecisionDatetime" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); } arg2 = (blpapi_Name_t *)(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_MessageFormatter_setValueHighPrecisionDatetime" "', argument " "3"" of type '" "blpapi_HighPrecisionDatetime_t const *""'"); } @@ -9975,23 +9488,21 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_setValueString(PyObject *SWIG int res3 ; char *buf3 = 0 ; int alloc3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_MessageFormatter_setValueString",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_setValueString", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_setValueString" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } arg1 = (blpapi_MessageFormatter_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_setValueString" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); } arg2 = (blpapi_Name_t *)(argp2); - res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); + res3 = SWIG_AsCharPtrAndSize(swig_obj[2], &buf3, NULL, &alloc3); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_MessageFormatter_setValueString" "', argument " "3"" of type '" "char const *""'"); } @@ -10021,23 +9532,21 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_setValueFromName(PyObject *SW int res2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_MessageFormatter_setValueFromName",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_setValueFromName", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_setValueFromName" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } arg1 = (blpapi_MessageFormatter_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_setValueFromName" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); } arg2 = (blpapi_Name_t *)(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_MessageFormatter_setValueFromName" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); } @@ -10062,17 +9571,16 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_setValueNull(PyObject *SWIGUN int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_MessageFormatter_setValueNull",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_setValueNull", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_setValueNull" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } arg1 = (blpapi_MessageFormatter_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_setValueNull" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); } @@ -10097,17 +9605,16 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_pushElement(PyObject *SWIGUNU int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_MessageFormatter_pushElement",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_pushElement", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_pushElement" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } arg1 = (blpapi_MessageFormatter_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_pushElement" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); } @@ -10129,11 +9636,12 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_popElement(PyObject *SWIGUNUS blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_MessageFormatter_popElement",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_popElement" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } @@ -10158,17 +9666,16 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_appendValueBool(PyObject *SWI int res1 = 0 ; int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_MessageFormatter_appendValueBool",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_appendValueBool", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_appendValueBool" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } arg1 = (blpapi_MessageFormatter_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_MessageFormatter_appendValueBool" "', argument " "2"" of type '" "blpapi_Bool_t""'"); } @@ -10193,17 +9700,16 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_appendValueChar(PyObject *SWI int res1 = 0 ; char val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_MessageFormatter_appendValueChar",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_appendValueChar", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_appendValueChar" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } arg1 = (blpapi_MessageFormatter_t *)(argp1); - ecode2 = SWIG_AsVal_char(obj1, &val2); + ecode2 = SWIG_AsVal_char(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_MessageFormatter_appendValueChar" "', argument " "2"" of type '" "char""'"); } @@ -10228,17 +9734,16 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_appendValueInt32(PyObject *SW int res1 = 0 ; int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_MessageFormatter_appendValueInt32",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_appendValueInt32", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_appendValueInt32" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } arg1 = (blpapi_MessageFormatter_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_MessageFormatter_appendValueInt32" "', argument " "2"" of type '" "blpapi_Int32_t""'"); } @@ -10263,17 +9768,16 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_appendValueInt64(PyObject *SW int res1 = 0 ; long long val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_MessageFormatter_appendValueInt64",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_appendValueInt64", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_appendValueInt64" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } arg1 = (blpapi_MessageFormatter_t *)(argp1); - ecode2 = SWIG_AsVal_long_SS_long(obj1, &val2); + ecode2 = SWIG_AsVal_long_SS_long(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_MessageFormatter_appendValueInt64" "', argument " "2"" of type '" "blpapi_Int64_t""'"); } @@ -10298,17 +9802,16 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_appendValueFloat32(PyObject * int res1 = 0 ; float val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_MessageFormatter_appendValueFloat32",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_appendValueFloat32", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_appendValueFloat32" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } arg1 = (blpapi_MessageFormatter_t *)(argp1); - ecode2 = SWIG_AsVal_float(obj1, &val2); + ecode2 = SWIG_AsVal_float(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_MessageFormatter_appendValueFloat32" "', argument " "2"" of type '" "blpapi_Float32_t""'"); } @@ -10333,17 +9836,16 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_appendValueFloat64(PyObject * int res1 = 0 ; double val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_MessageFormatter_appendValueFloat64",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_appendValueFloat64", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_appendValueFloat64" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } arg1 = (blpapi_MessageFormatter_t *)(argp1); - ecode2 = SWIG_AsVal_double(obj1, &val2); + ecode2 = SWIG_AsVal_double(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_MessageFormatter_appendValueFloat64" "', argument " "2"" of type '" "blpapi_Float64_t""'"); } @@ -10368,17 +9870,16 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_appendValueDatetime(PyObject int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_MessageFormatter_appendValueDatetime",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_appendValueDatetime", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_appendValueDatetime" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } arg1 = (blpapi_MessageFormatter_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_appendValueDatetime" "', argument " "2"" of type '" "blpapi_Datetime_t const *""'"); } @@ -10403,17 +9904,16 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_appendValueHighPrecisionDatet int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_MessageFormatter_appendValueHighPrecisionDatetime",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_appendValueHighPrecisionDatetime", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_appendValueHighPrecisionDatetime" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } arg1 = (blpapi_MessageFormatter_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_appendValueHighPrecisionDatetime" "', argument " "2"" of type '" "blpapi_HighPrecisionDatetime_t const *""'"); } @@ -10439,17 +9939,16 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_appendValueString(PyObject *S int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_MessageFormatter_appendValueString",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_appendValueString", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_appendValueString" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } arg1 = (blpapi_MessageFormatter_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_appendValueString" "', argument " "2"" of type '" "char const *""'"); } @@ -10476,17 +9975,16 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_appendValueFromName(PyObject int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_MessageFormatter_appendValueFromName",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_appendValueFromName", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_appendValueFromName" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } arg1 = (blpapi_MessageFormatter_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_appendValueFromName" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); } @@ -10508,11 +10006,12 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_appendElement(PyObject *SWIGU blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_MessageFormatter_appendElement",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_appendElement" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } @@ -10538,17 +10037,16 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_FormatMessageJson(PyObject *S int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_MessageFormatter_FormatMessageJson",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_FormatMessageJson", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_FormatMessageJson" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } arg1 = (blpapi_MessageFormatter_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_FormatMessageJson" "', argument " "2"" of type '" "char const *""'"); } @@ -10576,17 +10074,16 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_FormatMessageXml(PyObject *SW int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_MessageFormatter_FormatMessageXml",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_FormatMessageXml", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_FormatMessageXml" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } arg1 = (blpapi_MessageFormatter_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_FormatMessageXml" "', argument " "2"" of type '" "char const *""'"); } @@ -10612,12 +10109,13 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_copy(PyObject *SWIGUNUSEDPARM blpapi_MessageFormatter_t *temp1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_MessageFormatter_copy",&obj0)) SWIG_fail; - res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res2 = SWIG_ConvertPtr(swig_obj[0], &argp2,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_copy" "', argument " "2"" of type '" "blpapi_MessageFormatter_t const *""'"); } @@ -10642,12 +10140,13 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_assign(PyObject *SWIGUNUSEDPA blpapi_MessageFormatter_t *temp1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_MessageFormatter_assign",&obj0)) SWIG_fail; - res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res2 = SWIG_ConvertPtr(swig_obj[0], &argp2,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_assign" "', argument " "2"" of type '" "blpapi_MessageFormatter_t const *""'"); } @@ -10670,11 +10169,12 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_destroy(PyObject *SWIGUNUSEDP blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_MessageFormatter_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_destroy" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); } @@ -10698,7 +10198,7 @@ SWIGINTERN PyObject *_wrap_blpapi_AuthOptions_create_default(PyObject *SWIGUNUSE int result; arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)":blpapi_AuthOptions_create_default")) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "blpapi_AuthOptions_create_default", 0, 0, 0)) SWIG_fail; { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)blpapi_AuthOptions_create_default(arg1); @@ -10719,12 +10219,13 @@ SWIGINTERN PyObject *_wrap_blpapi_AuthOptions_create_forUserMode(PyObject *SWIGU blpapi_AuthOptions_t *temp1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthOptions_create_forUserMode",&obj0)) SWIG_fail; - res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_AuthUser, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res2 = SWIG_ConvertPtr(swig_obj[0], &argp2,SWIGTYPE_p_blpapi_AuthUser, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthOptions_create_forUserMode" "', argument " "2"" of type '" "blpapi_AuthUser_t const *""'"); } @@ -10749,12 +10250,13 @@ SWIGINTERN PyObject *_wrap_blpapi_AuthOptions_create_forAppMode(PyObject *SWIGUN blpapi_AuthOptions_t *temp1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthOptions_create_forAppMode",&obj0)) SWIG_fail; - res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_AuthApplication, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res2 = SWIG_ConvertPtr(swig_obj[0], &argp2,SWIGTYPE_p_blpapi_AuthApplication, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthOptions_create_forAppMode" "', argument " "2"" of type '" "blpapi_AuthApplication_t const *""'"); } @@ -10782,18 +10284,17 @@ SWIGINTERN PyObject *_wrap_blpapi_AuthOptions_create_forUserAndAppMode(PyObject int res2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_AuthOptions_create_forUserAndAppMode",&obj0,&obj1)) SWIG_fail; - res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_AuthUser, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_AuthOptions_create_forUserAndAppMode", 2, 2, swig_obj)) SWIG_fail; + res2 = SWIG_ConvertPtr(swig_obj[0], &argp2,SWIGTYPE_p_blpapi_AuthUser, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthOptions_create_forUserAndAppMode" "', argument " "2"" of type '" "blpapi_AuthUser_t const *""'"); } arg2 = (blpapi_AuthUser_t *)(argp2); - res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_AuthApplication, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[1], &argp3,SWIGTYPE_p_blpapi_AuthApplication, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AuthOptions_create_forUserAndAppMode" "', argument " "3"" of type '" "blpapi_AuthApplication_t const *""'"); } @@ -10818,12 +10319,13 @@ SWIGINTERN PyObject *_wrap_blpapi_AuthOptions_create_forToken(PyObject *SWIGUNUS blpapi_AuthOptions_t *temp1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthOptions_create_forToken",&obj0)) SWIG_fail; - res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_AuthToken, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res2 = SWIG_ConvertPtr(swig_obj[0], &argp2,SWIGTYPE_p_blpapi_AuthToken, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthOptions_create_forToken" "', argument " "2"" of type '" "blpapi_AuthToken_t const *""'"); } @@ -10848,12 +10350,13 @@ SWIGINTERN PyObject *_wrap_blpapi_AuthOptions_duplicate(PyObject *SWIGUNUSEDPARM blpapi_AuthOptions_t *temp1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthOptions_duplicate",&obj0)) SWIG_fail; - res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_AuthOptions, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res2 = SWIG_ConvertPtr(swig_obj[0], &argp2,SWIGTYPE_p_blpapi_AuthOptions, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthOptions_duplicate" "', argument " "2"" of type '" "blpapi_AuthOptions_t const *""'"); } @@ -10879,17 +10382,16 @@ SWIGINTERN PyObject *_wrap_blpapi_AuthOptions_copy(PyObject *SWIGUNUSEDPARM(self int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_AuthOptions_copy",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AuthOptions, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_AuthOptions_copy", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_AuthOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AuthOptions_copy" "', argument " "1"" of type '" "blpapi_AuthOptions_t *""'"); } arg1 = (blpapi_AuthOptions_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_AuthOptions, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_AuthOptions, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthOptions_copy" "', argument " "2"" of type '" "blpapi_AuthOptions_t const *""'"); } @@ -10911,10 +10413,11 @@ SWIGINTERN PyObject *_wrap_blpapi_AuthOptions_destroy(PyObject *SWIGUNUSEDPARM(s blpapi_AuthOptions_t *arg1 = (blpapi_AuthOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthOptions_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AuthOptions, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_AuthOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AuthOptions_destroy" "', argument " "1"" of type '" "blpapi_AuthOptions_t *""'"); } @@ -10938,7 +10441,7 @@ SWIGINTERN PyObject *_wrap_blpapi_AuthUser_createWithLogonName(PyObject *SWIGUNU int result; arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)":blpapi_AuthUser_createWithLogonName")) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "blpapi_AuthUser_createWithLogonName", 0, 0, 0)) SWIG_fail; { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)blpapi_AuthUser_createWithLogonName(arg1); @@ -10960,12 +10463,13 @@ SWIGINTERN PyObject *_wrap_blpapi_AuthUser_createWithActiveDirectoryProperty(PyO int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthUser_createWithActiveDirectoryProperty",&obj0)) SWIG_fail; - res2 = SWIG_AsCharPtrAndSize(obj0, &buf2, NULL, &alloc2); + if (!args) SWIG_fail; + swig_obj[0] = args; + res2 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthUser_createWithActiveDirectoryProperty" "', argument " "2"" of type '" "char const *""'"); } @@ -10997,18 +10501,17 @@ SWIGINTERN PyObject *_wrap_blpapi_AuthUser_createWithManualOptions(PyObject *SWI int res3 ; char *buf3 = 0 ; int alloc3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_AuthUser_createWithManualOptions",&obj0,&obj1)) SWIG_fail; - res2 = SWIG_AsCharPtrAndSize(obj0, &buf2, NULL, &alloc2); + if (!SWIG_Python_UnpackTuple(args, "blpapi_AuthUser_createWithManualOptions", 2, 2, swig_obj)) SWIG_fail; + res2 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthUser_createWithManualOptions" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); - res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); + res3 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf3, NULL, &alloc3); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AuthUser_createWithManualOptions" "', argument " "3"" of type '" "char const *""'"); } @@ -11037,12 +10540,13 @@ SWIGINTERN PyObject *_wrap_blpapi_AuthUser_duplicate(PyObject *SWIGUNUSEDPARM(se blpapi_AuthUser_t *temp1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthUser_duplicate",&obj0)) SWIG_fail; - res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_AuthUser, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res2 = SWIG_ConvertPtr(swig_obj[0], &argp2,SWIGTYPE_p_blpapi_AuthUser, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthUser_duplicate" "', argument " "2"" of type '" "blpapi_AuthUser_t const *""'"); } @@ -11068,17 +10572,16 @@ SWIGINTERN PyObject *_wrap_blpapi_AuthUser_copy(PyObject *SWIGUNUSEDPARM(self), int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_AuthUser_copy",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AuthUser, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_AuthUser_copy", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_AuthUser, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AuthUser_copy" "', argument " "1"" of type '" "blpapi_AuthUser_t *""'"); } arg1 = (blpapi_AuthUser_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_AuthUser, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_AuthUser, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthUser_copy" "', argument " "2"" of type '" "blpapi_AuthUser_t const *""'"); } @@ -11100,10 +10603,11 @@ SWIGINTERN PyObject *_wrap_blpapi_AuthUser_destroy(PyObject *SWIGUNUSEDPARM(self blpapi_AuthUser_t *arg1 = (blpapi_AuthUser_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthUser_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AuthUser, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_AuthUser, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AuthUser_destroy" "', argument " "1"" of type '" "blpapi_AuthUser_t *""'"); } @@ -11128,12 +10632,13 @@ SWIGINTERN PyObject *_wrap_blpapi_AuthApplication_create(PyObject *SWIGUNUSEDPAR int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthApplication_create",&obj0)) SWIG_fail; - res2 = SWIG_AsCharPtrAndSize(obj0, &buf2, NULL, &alloc2); + if (!args) SWIG_fail; + swig_obj[0] = args; + res2 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthApplication_create" "', argument " "2"" of type '" "char const *""'"); } @@ -11160,12 +10665,13 @@ SWIGINTERN PyObject *_wrap_blpapi_AuthApplication_duplicate(PyObject *SWIGUNUSED blpapi_AuthApplication_t *temp1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthApplication_duplicate",&obj0)) SWIG_fail; - res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_AuthApplication, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res2 = SWIG_ConvertPtr(swig_obj[0], &argp2,SWIGTYPE_p_blpapi_AuthApplication, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthApplication_duplicate" "', argument " "2"" of type '" "blpapi_AuthApplication_t const *""'"); } @@ -11191,17 +10697,16 @@ SWIGINTERN PyObject *_wrap_blpapi_AuthApplication_copy(PyObject *SWIGUNUSEDPARM( int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_AuthApplication_copy",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AuthApplication, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_AuthApplication_copy", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_AuthApplication, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AuthApplication_copy" "', argument " "1"" of type '" "blpapi_AuthApplication_t *""'"); } arg1 = (blpapi_AuthApplication_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_AuthApplication, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_AuthApplication, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthApplication_copy" "', argument " "2"" of type '" "blpapi_AuthApplication_t const *""'"); } @@ -11223,10 +10728,11 @@ SWIGINTERN PyObject *_wrap_blpapi_AuthApplication_destroy(PyObject *SWIGUNUSEDPA blpapi_AuthApplication_t *arg1 = (blpapi_AuthApplication_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthApplication_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AuthApplication, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_AuthApplication, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AuthApplication_destroy" "', argument " "1"" of type '" "blpapi_AuthApplication_t *""'"); } @@ -11251,12 +10757,13 @@ SWIGINTERN PyObject *_wrap_blpapi_AuthToken_create(PyObject *SWIGUNUSEDPARM(self int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthToken_create",&obj0)) SWIG_fail; - res2 = SWIG_AsCharPtrAndSize(obj0, &buf2, NULL, &alloc2); + if (!args) SWIG_fail; + swig_obj[0] = args; + res2 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthToken_create" "', argument " "2"" of type '" "char const *""'"); } @@ -11283,12 +10790,13 @@ SWIGINTERN PyObject *_wrap_blpapi_AuthToken_duplicate(PyObject *SWIGUNUSEDPARM(s blpapi_AuthToken_t *temp1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthToken_duplicate",&obj0)) SWIG_fail; - res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_AuthToken, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res2 = SWIG_ConvertPtr(swig_obj[0], &argp2,SWIGTYPE_p_blpapi_AuthToken, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthToken_duplicate" "', argument " "2"" of type '" "blpapi_AuthToken_t const *""'"); } @@ -11314,17 +10822,16 @@ SWIGINTERN PyObject *_wrap_blpapi_AuthToken_copy(PyObject *SWIGUNUSEDPARM(self), int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_AuthToken_copy",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AuthToken, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_AuthToken_copy", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_AuthToken, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AuthToken_copy" "', argument " "1"" of type '" "blpapi_AuthToken_t *""'"); } arg1 = (blpapi_AuthToken_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_AuthToken, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_AuthToken, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthToken_copy" "', argument " "2"" of type '" "blpapi_AuthToken_t const *""'"); } @@ -11346,10 +10853,11 @@ SWIGINTERN PyObject *_wrap_blpapi_AuthToken_destroy(PyObject *SWIGUNUSEDPARM(sel blpapi_AuthToken_t *arg1 = (blpapi_AuthToken_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AuthToken_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AuthToken, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_AuthToken, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AuthToken_destroy" "', argument " "1"" of type '" "blpapi_AuthToken_t *""'"); } @@ -11371,11 +10879,12 @@ SWIGINTERN PyObject *_wrap_blpapi_getLastErrorDescription(PyObject *SWIGUNUSEDPA int arg1 ; int val1 ; int ecode1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_getLastErrorDescription",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!args) SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "blpapi_getLastErrorDescription" "', argument " "1"" of type '" "int""'"); } @@ -11396,7 +10905,7 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_create(PyObject *SWIGUNUSEDPARM PyObject *resultobj = 0; blpapi_SessionOptions_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)":blpapi_SessionOptions_create")) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_create", 0, 0, 0)) SWIG_fail; { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (blpapi_SessionOptions_t *)blpapi_SessionOptions_create(); @@ -11414,10 +10923,11 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_destroy(PyObject *SWIGUNUSEDPAR blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_destroy" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } @@ -11443,17 +10953,16 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setServerHost(PyObject *SWIGUNU int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setServerHost",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setServerHost", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setServerHost" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setServerHost" "', argument " "2"" of type '" "char const *""'"); } @@ -11480,17 +10989,16 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setServerPort(PyObject *SWIGUNU int res1 = 0 ; unsigned short val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setServerPort",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setServerPort", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setServerPort" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_short(obj1, &val2); + ecode2 = SWIG_AsVal_unsigned_SS_short(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setServerPort" "', argument " "2"" of type '" "unsigned short""'"); } @@ -11522,29 +11030,26 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setServerAddress(PyObject *SWIG int ecode3 = 0 ; size_t val4 ; int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; + PyObject *swig_obj[4] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_SessionOptions_setServerAddress",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setServerAddress", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setServerAddress" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setServerAddress" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); - ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3); + ecode3 = SWIG_AsVal_unsigned_SS_short(swig_obj[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_SessionOptions_setServerAddress" "', argument " "3"" of type '" "unsigned short""'"); } arg3 = (unsigned short)(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); + ecode4 = SWIG_AsVal_size_t(swig_obj[3], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_SessionOptions_setServerAddress" "', argument " "4"" of type '" "size_t""'"); } @@ -11571,17 +11076,16 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_removeServerAddress(PyObject *S int res1 = 0 ; size_t val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_removeServerAddress",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_removeServerAddress", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_removeServerAddress" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); + ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_removeServerAddress" "', argument " "2"" of type '" "size_t""'"); } @@ -11606,17 +11110,16 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setConnectTimeout(PyObject *SWI int res1 = 0 ; unsigned int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setConnectTimeout",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setConnectTimeout", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setConnectTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setConnectTimeout" "', argument " "2"" of type '" "unsigned int""'"); } @@ -11642,17 +11145,16 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setDefaultServices(PyObject *SW int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setDefaultServices",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setDefaultServices", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setDefaultServices" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setDefaultServices" "', argument " "2"" of type '" "char const *""'"); } @@ -11680,17 +11182,16 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setDefaultSubscriptionService(P int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setDefaultSubscriptionService",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setDefaultSubscriptionService", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setDefaultSubscriptionService" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setDefaultSubscriptionService" "', argument " "2"" of type '" "char const *""'"); } @@ -11718,16 +11219,15 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setDefaultTopicPrefix(PyObject int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setDefaultTopicPrefix",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setDefaultTopicPrefix", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setDefaultTopicPrefix" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setDefaultTopicPrefix" "', argument " "2"" of type '" "char const *""'"); } @@ -11754,16 +11254,15 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setAllowMultipleCorrelatorsPerM int res1 = 0 ; int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg" "', argument " "2"" of type '" "int""'"); } @@ -11788,16 +11287,15 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setClientMode(PyObject *SWIGUNU int res1 = 0 ; int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setClientMode",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setClientMode", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setClientMode" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setClientMode" "', argument " "2"" of type '" "int""'"); } @@ -11822,16 +11320,15 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setMaxPendingRequests(PyObject int res1 = 0 ; int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setMaxPendingRequests",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setMaxPendingRequests", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setMaxPendingRequests" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setMaxPendingRequests" "', argument " "2"" of type '" "int""'"); } @@ -11856,16 +11353,15 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setAutoRestartOnDisconnection(P int res1 = 0 ; int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setAutoRestartOnDisconnection",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setAutoRestartOnDisconnection", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setAutoRestartOnDisconnection" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setAutoRestartOnDisconnection" "', argument " "2"" of type '" "int""'"); } @@ -11893,23 +11389,21 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setSessionIdentityOptions(PyObj int res2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_SessionOptions_setSessionIdentityOptions",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setSessionIdentityOptions", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setSessionIdentityOptions" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_AuthOptions, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_AuthOptions, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setSessionIdentityOptions" "', argument " "2"" of type '" "blpapi_AuthOptions_t const *""'"); } arg2 = (blpapi_AuthOptions_t *)(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_SessionOptions_setSessionIdentityOptions" "', argument " "3"" of type '" "blpapi_CorrelationId_t *""'"); } @@ -11935,16 +11429,15 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setAuthenticationOptions(PyObje int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setAuthenticationOptions",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setAuthenticationOptions", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setAuthenticationOptions" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setAuthenticationOptions" "', argument " "2"" of type '" "char const *""'"); } @@ -11971,16 +11464,15 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setNumStartAttempts(PyObject *S int res1 = 0 ; int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setNumStartAttempts",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setNumStartAttempts", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setNumStartAttempts" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setNumStartAttempts" "', argument " "2"" of type '" "int""'"); } @@ -12005,16 +11497,15 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setMaxEventQueueSize(PyObject * int res1 = 0 ; size_t val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setMaxEventQueueSize",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setMaxEventQueueSize", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setMaxEventQueueSize" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); + ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setMaxEventQueueSize" "', argument " "2"" of type '" "size_t""'"); } @@ -12039,17 +11530,16 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setSlowConsumerWarningHiWaterMa int res1 = 0 ; float val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_float(obj1, &val2); + ecode2 = SWIG_AsVal_float(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark" "', argument " "2"" of type '" "float""'"); } @@ -12074,17 +11564,16 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setSlowConsumerWarningLoWaterMa int res1 = 0 ; float val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_float(obj1, &val2); + ecode2 = SWIG_AsVal_float(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark" "', argument " "2"" of type '" "float""'"); } @@ -12109,17 +11598,16 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setDefaultKeepAliveInactivityTi int res1 = 0 ; int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setDefaultKeepAliveInactivityTime",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setDefaultKeepAliveInactivityTime", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setDefaultKeepAliveInactivityTime" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setDefaultKeepAliveInactivityTime" "', argument " "2"" of type '" "int""'"); } @@ -12144,17 +11632,16 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setDefaultKeepAliveResponseTime int res1 = 0 ; int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout" "', argument " "2"" of type '" "int""'"); } @@ -12179,17 +11666,16 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setKeepAliveEnabled(PyObject *S int res1 = 0 ; int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setKeepAliveEnabled",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setKeepAliveEnabled", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setKeepAliveEnabled" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setKeepAliveEnabled" "', argument " "2"" of type '" "int""'"); } @@ -12214,16 +11700,15 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setRecordSubscriptionDataReceiv int res1 = 0 ; int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes" "', argument " "2"" of type '" "int""'"); } @@ -12248,17 +11733,16 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setServiceCheckTimeout(PyObject int res1 = 0 ; int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setServiceCheckTimeout",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setServiceCheckTimeout", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setServiceCheckTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setServiceCheckTimeout" "', argument " "2"" of type '" "int""'"); } @@ -12283,17 +11767,16 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setServiceDownloadTimeout(PyObj int res1 = 0 ; int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setServiceDownloadTimeout",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setServiceDownloadTimeout", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setServiceDownloadTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setServiceDownloadTimeout" "', argument " "2"" of type '" "int""'"); } @@ -12318,16 +11801,15 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setTlsOptions(PyObject *SWIGUNU int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setTlsOptions",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setTlsOptions", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setTlsOptions" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setTlsOptions" "', argument " "2"" of type '" "blpapi_TlsOptions_t const *""'"); } @@ -12352,17 +11834,16 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setFlushPublishedEventsTimeout( int res1 = 0 ; int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setFlushPublishedEventsTimeout",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setFlushPublishedEventsTimeout", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setFlushPublishedEventsTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setFlushPublishedEventsTimeout" "', argument " "2"" of type '" "int""'"); } @@ -12387,17 +11868,16 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setBandwidthSaveModeDisabled(Py int res1 = 0 ; int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_setBandwidthSaveModeDisabled",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setBandwidthSaveModeDisabled", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setBandwidthSaveModeDisabled" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setBandwidthSaveModeDisabled" "', argument " "2"" of type '" "int""'"); } @@ -12419,11 +11899,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_serverHost(PyObject *SWIGUNUSED blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_serverHost",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_serverHost" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } @@ -12445,11 +11926,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_serverPort(PyObject *SWIGUNUSED blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; unsigned int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_serverPort",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_serverPort" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } @@ -12471,11 +11953,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_numServerAddresses(PyObject *SW blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_numServerAddresses",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_numServerAddresses" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } @@ -12500,23 +11983,22 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_getServerAddress(PyObject *SWIG size_t arg4 ; void *argp1 = 0 ; int res1 = 0 ; - char *tempServerHost2 = 0 ; - unsigned short tempServerPort2 = 0 ; + char *temp2 = 0 ; + unsigned short temp3 ; size_t val4 ; int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - arg2 = &tempServerHost2; - arg3 = &tempServerPort2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SessionOptions_getServerAddress",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + arg2 = &temp2; + arg3 = &temp3; + if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_getServerAddress", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_getServerAddress" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode4 = SWIG_AsVal_size_t(obj1, &val4); + ecode4 = SWIG_AsVal_size_t(swig_obj[1], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_SessionOptions_getServerAddress" "', argument " "4"" of type '" "size_t""'"); } @@ -12527,10 +12009,8 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_getServerAddress(PyObject *SWIG SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int(*arg3)); - } + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); + resultobj = SWIG_Python_AppendOutput(resultobj, PyInt_FromLong(*arg3)); return resultobj; fail: return NULL; @@ -12542,11 +12022,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_connectTimeout(PyObject *SWIGUN blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; unsigned int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_connectTimeout",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_connectTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } @@ -12568,11 +12049,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultServices(PyObject *SWIGU blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_defaultServices",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_defaultServices" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } @@ -12594,11 +12076,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultSubscriptionService(PyOb blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_defaultSubscriptionService",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_defaultSubscriptionService" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } @@ -12620,11 +12103,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultTopicPrefix(PyObject *SW blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_defaultTopicPrefix",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_defaultTopicPrefix" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } @@ -12646,11 +12130,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg( blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } @@ -12672,11 +12157,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_clientMode(PyObject *SWIGUNUSED blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_clientMode",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_clientMode" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } @@ -12698,11 +12184,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_maxPendingRequests(PyObject *SW blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_maxPendingRequests",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_maxPendingRequests" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } @@ -12724,11 +12211,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_autoRestartOnDisconnection(PyOb blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_autoRestartOnDisconnection",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_autoRestartOnDisconnection" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } @@ -12750,11 +12238,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_authenticationOptions(PyObject blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_authenticationOptions",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_authenticationOptions" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } @@ -12776,11 +12265,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_numStartAttempts(PyObject *SWIG blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_numStartAttempts",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_numStartAttempts" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } @@ -12802,11 +12292,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_maxEventQueueSize(PyObject *SWI blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; size_t result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_maxEventQueueSize",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_maxEventQueueSize" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } @@ -12828,11 +12319,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_slowConsumerWarningHiWaterMark( blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; float result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_slowConsumerWarningHiWaterMark",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_slowConsumerWarningHiWaterMark" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } @@ -12854,11 +12346,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_slowConsumerWarningLoWaterMark( blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; float result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_slowConsumerWarningLoWaterMark",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_slowConsumerWarningLoWaterMark" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } @@ -12880,11 +12373,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultKeepAliveInactivityTime( blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_defaultKeepAliveInactivityTime",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_defaultKeepAliveInactivityTime" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } @@ -12906,11 +12400,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultKeepAliveResponseTimeout blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_defaultKeepAliveResponseTimeout",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_defaultKeepAliveResponseTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } @@ -12932,11 +12427,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_keepAliveEnabled(PyObject *SWIG blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_keepAliveEnabled",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_keepAliveEnabled" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } @@ -12958,11 +12454,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_recordSubscriptionDataReceiveTi blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_recordSubscriptionDataReceiveTimes",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_recordSubscriptionDataReceiveTimes" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } @@ -12984,11 +12481,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_serviceCheckTimeout(PyObject *S blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_serviceCheckTimeout",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_serviceCheckTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } @@ -13010,11 +12508,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_serviceDownloadTimeout(PyObject blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_serviceDownloadTimeout",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_serviceDownloadTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } @@ -13036,11 +12535,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_flushPublishedEventsTimeout(PyO blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_flushPublishedEventsTimeout",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_flushPublishedEventsTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } @@ -13062,11 +12562,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_bandwidthSaveModeDisabled(PyObj blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SessionOptions_bandwidthSaveModeDisabled",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_bandwidthSaveModeDisabled" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } @@ -13088,10 +12589,11 @@ SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_destroy(PyObject *SWIGUNUSEDPARM(se blpapi_TlsOptions_t *arg1 = (blpapi_TlsOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_TlsOptions_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TlsOptions_destroy" "', argument " "1"" of type '" "blpapi_TlsOptions_t *""'"); } @@ -13122,23 +12624,21 @@ SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_createFromFiles(PyObject *SWIGUNUSE int res3 ; char *buf3 = 0 ; int alloc3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; blpapi_TlsOptions_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_TlsOptions_createFromFiles",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_Python_UnpackTuple(args, "blpapi_TlsOptions_createFromFiles", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TlsOptions_createFromFiles" "', argument " "1"" of type '" "char const *""'"); } arg1 = (char *)(buf1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_TlsOptions_createFromFiles" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); - res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); + res3 = SWIG_AsCharPtrAndSize(swig_obj[2], &buf3, NULL, &alloc3); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_TlsOptions_createFromFiles" "', argument " "3"" of type '" "char const *""'"); } @@ -13168,43 +12668,45 @@ SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_createFromBlobs(PyObject *SWIGUNUSE char *arg3 = (char *) 0 ; char *arg4 = (char *) 0 ; int arg5 ; - int res1 ; - Py_ssize_t size1 = 0 ; - void const *buf1 = 0 ; int res3 ; char *buf3 = 0 ; int alloc3 = 0 ; - int res4 ; - Py_ssize_t size4 = 0 ; - void const *buf4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; blpapi_TlsOptions_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_TlsOptions_createFromBlobs",&obj0,&obj1,&obj2)) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "blpapi_TlsOptions_createFromBlobs", 3, 3, swig_obj)) SWIG_fail; { - res1 = PyObject_AsReadBuffer(obj0, &buf1, &size1); - if (res1<0) { + int res; Py_ssize_t size = 0; const void *buf = 0; + Py_buffer view; + res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO); + size = view.len; + buf = view.buf; + PyBuffer_Release(&view); + if (res < 0) { PyErr_Clear(); - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TlsOptions_createFromBlobs" "', argument " "1"" of type '" "(const char *clientCredentialsRawData, int clientCredentialsRawDataLength)""'"); + SWIG_exception_fail(SWIG_ArgError(res), "in method '" "blpapi_TlsOptions_createFromBlobs" "', argument " "1"" of type '" "(const char *clientCredentialsRawData, int clientCredentialsRawDataLength)""'"); } - arg1 = (char *) buf1; - arg2 = (int) (size1 / sizeof(char const)); + arg1 = (char *) buf; + arg2 = (int) (size / sizeof(char const)); } - res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); + res3 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf3, NULL, &alloc3); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_TlsOptions_createFromBlobs" "', argument " "3"" of type '" "char const *""'"); } arg3 = (char *)(buf3); { - res4 = PyObject_AsReadBuffer(obj2, &buf4, &size4); - if (res4<0) { + int res; Py_ssize_t size = 0; const void *buf = 0; + Py_buffer view; + res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO); + size = view.len; + buf = view.buf; + PyBuffer_Release(&view); + if (res < 0) { PyErr_Clear(); - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_TlsOptions_createFromBlobs" "', argument " "4"" of type '" "(const char *trustedCertificatesRawData, int trustedCertificatesRawDataLength)""'"); + SWIG_exception_fail(SWIG_ArgError(res), "in method '" "blpapi_TlsOptions_createFromBlobs" "', argument " "4"" of type '" "(const char *trustedCertificatesRawData, int trustedCertificatesRawDataLength)""'"); } - arg4 = (char *) buf4; - arg5 = (int) (size4 / sizeof(char const)); + arg4 = (char *) buf; + arg5 = (int) (size / sizeof(char const)); } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; @@ -13228,16 +12730,15 @@ SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_setTlsHandshakeTimeoutMs(PyObject * int res1 = 0 ; int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TlsOptions_setTlsHandshakeTimeoutMs",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_TlsOptions_setTlsHandshakeTimeoutMs", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TlsOptions_setTlsHandshakeTimeoutMs" "', argument " "1"" of type '" "blpapi_TlsOptions_t *""'"); } arg1 = (blpapi_TlsOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_TlsOptions_setTlsHandshakeTimeoutMs" "', argument " "2"" of type '" "int""'"); } @@ -13262,16 +12763,15 @@ SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_setCrlFetchTimeoutMs(PyObject *SWIG int res1 = 0 ; int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TlsOptions_setCrlFetchTimeoutMs",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_TlsOptions_setCrlFetchTimeoutMs", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TlsOptions_setCrlFetchTimeoutMs" "', argument " "1"" of type '" "blpapi_TlsOptions_t *""'"); } arg1 = (blpapi_TlsOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_TlsOptions_setCrlFetchTimeoutMs" "', argument " "2"" of type '" "int""'"); } @@ -13294,11 +12794,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Name_create(PyObject *SWIGUNUSEDPARM(self), Py int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; blpapi_Name_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Name_create",&obj0)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Name_create" "', argument " "1"" of type '" "char const *""'"); } @@ -13322,10 +12823,11 @@ SWIGINTERN PyObject *_wrap_blpapi_Name_destroy(PyObject *SWIGUNUSEDPARM(self), P blpapi_Name_t *arg1 = (blpapi_Name_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Name_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Name_destroy" "', argument " "1"" of type '" "blpapi_Name_t *""'"); } @@ -13351,17 +12853,16 @@ SWIGINTERN PyObject *_wrap_blpapi_Name_equalsStr(PyObject *SWIGUNUSEDPARM(self), int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Name_equalsStr",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Name_equalsStr", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Name_equalsStr" "', argument " "1"" of type '" "blpapi_Name_t const *""'"); } arg1 = (blpapi_Name_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Name_equalsStr" "', argument " "2"" of type '" "char const *""'"); } @@ -13385,11 +12886,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Name_string(PyObject *SWIGUNUSEDPARM(self), Py blpapi_Name_t *arg1 = (blpapi_Name_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Name_string",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Name_string" "', argument " "1"" of type '" "blpapi_Name_t const *""'"); } @@ -13411,11 +12913,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Name_length(PyObject *SWIGUNUSEDPARM(self), Py blpapi_Name_t *arg1 = (blpapi_Name_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; size_t result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Name_length",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Name_length" "', argument " "1"" of type '" "blpapi_Name_t const *""'"); } @@ -13438,11 +12941,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Name_findName(PyObject *SWIGUNUSEDPARM(self), int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; blpapi_Name_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Name_findName",&obj0)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Name_findName" "', argument " "1"" of type '" "char const *""'"); } @@ -13465,7 +12969,7 @@ SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_create(PyObject *SWIGUNUSEDPA PyObject *resultobj = 0; blpapi_SubscriptionList_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)":blpapi_SubscriptionList_create")) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "blpapi_SubscriptionList_create", 0, 0, 0)) SWIG_fail; { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (blpapi_SubscriptionList_t *)blpapi_SubscriptionList_create(); @@ -13483,10 +12987,11 @@ SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_destroy(PyObject *SWIGUNUSEDP blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SubscriptionList_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_destroy" "', argument " "1"" of type '" "blpapi_SubscriptionList_t *""'"); } @@ -13515,23 +13020,21 @@ SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_addResolved(PyObject *SWIGUNU int alloc2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_SubscriptionList_addResolved",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_SubscriptionList_addResolved", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_addResolved" "', argument " "1"" of type '" "blpapi_SubscriptionList_t *""'"); } arg1 = (blpapi_SubscriptionList_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SubscriptionList_addResolved" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_SubscriptionList_addResolved" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); } @@ -13555,11 +13058,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_clear(PyObject *SWIGUNUSEDPAR blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SubscriptionList_clear",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_clear" "', argument " "1"" of type '" "blpapi_SubscriptionList_t *""'"); } @@ -13584,17 +13088,16 @@ SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_append(PyObject *SWIGUNUSEDPA int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SubscriptionList_append",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_SubscriptionList_append", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_append" "', argument " "1"" of type '" "blpapi_SubscriptionList_t *""'"); } arg1 = (blpapi_SubscriptionList_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SubscriptionList_append" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); } @@ -13616,11 +13119,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_size(PyObject *SWIGUNUSEDPARM blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SubscriptionList_size",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_size" "', argument " "1"" of type '" "blpapi_SubscriptionList_t const *""'"); } @@ -13647,18 +13151,17 @@ SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_correlationIdAt(PyObject *SWI blpapi_CorrelationId_t temp2 ; size_t val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SubscriptionList_correlationIdAt",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_SubscriptionList_correlationIdAt", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_correlationIdAt" "', argument " "1"" of type '" "blpapi_SubscriptionList_t const *""'"); } arg1 = (blpapi_SubscriptionList_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); + ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_SubscriptionList_correlationIdAt" "', argument " "3"" of type '" "size_t""'"); } @@ -13690,18 +13193,17 @@ SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_topicStringAt(PyObject *SWIGU char *temp2 = 0 ; size_t val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SubscriptionList_topicStringAt",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_SubscriptionList_topicStringAt", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_topicStringAt" "', argument " "1"" of type '" "blpapi_SubscriptionList_t *""'"); } arg1 = (blpapi_SubscriptionList_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); + ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_SubscriptionList_topicStringAt" "', argument " "3"" of type '" "size_t""'"); } @@ -13729,18 +13231,17 @@ SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_isResolvedAt(PyObject *SWIGUN int temp2 ; size_t val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SubscriptionList_isResolvedAt",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_SubscriptionList_isResolvedAt", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_isResolvedAt" "', argument " "1"" of type '" "blpapi_SubscriptionList_t *""'"); } arg1 = (blpapi_SubscriptionList_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); + ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_SubscriptionList_isResolvedAt" "', argument " "3"" of type '" "size_t""'"); } @@ -13766,16 +13267,15 @@ SWIGINTERN PyObject *_wrap_blpapi_TimePoint_d_value_set(PyObject *SWIGUNUSEDPARM int res1 = 0 ; long long val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TimePoint_d_value_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TimePoint, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_TimePoint_d_value_set", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_TimePoint, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TimePoint_d_value_set" "', argument " "1"" of type '" "struct blpapi_TimePoint *""'"); } arg1 = (struct blpapi_TimePoint *)(argp1); - ecode2 = SWIG_AsVal_long_SS_long(obj1, &val2); + ecode2 = SWIG_AsVal_long_SS_long(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_TimePoint_d_value_set" "', argument " "2"" of type '" "blpapi_Int64_t""'"); } @@ -13797,11 +13297,12 @@ SWIGINTERN PyObject *_wrap_blpapi_TimePoint_d_value_get(PyObject *SWIGUNUSEDPARM struct blpapi_TimePoint *arg1 = (struct blpapi_TimePoint *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; blpapi_Int64_t result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_TimePoint_d_value_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TimePoint, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_TimePoint, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TimePoint_d_value_get" "', argument " "1"" of type '" "struct blpapi_TimePoint *""'"); } @@ -13822,7 +13323,7 @@ SWIGINTERN PyObject *_wrap_new_blpapi_TimePoint(PyObject *SWIGUNUSEDPARM(self), PyObject *resultobj = 0; struct blpapi_TimePoint *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)":new_blpapi_TimePoint")) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "new_blpapi_TimePoint", 0, 0, 0)) SWIG_fail; { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (struct blpapi_TimePoint *)calloc(1, sizeof(struct blpapi_TimePoint)); @@ -13840,10 +13341,11 @@ SWIGINTERN PyObject *_wrap_delete_blpapi_TimePoint(PyObject *SWIGUNUSEDPARM(self struct blpapi_TimePoint *arg1 = (struct blpapi_TimePoint *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; - if (!PyArg_ParseTuple(args,(char *)"O:delete_blpapi_TimePoint",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TimePoint, SWIG_POINTER_DISOWN | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_TimePoint, SWIG_POINTER_DISOWN | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_blpapi_TimePoint" "', argument " "1"" of type '" "struct blpapi_TimePoint *""'"); } @@ -13862,11 +13364,15 @@ SWIGINTERN PyObject *_wrap_delete_blpapi_TimePoint(PyObject *SWIGUNUSEDPARM(self SWIGINTERN PyObject *blpapi_TimePoint_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; + if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL; SWIG_TypeNewClientData(SWIGTYPE_p_blpapi_TimePoint, SWIG_NewClientData(obj)); return SWIG_Py_Void(); } +SWIGINTERN PyObject *blpapi_TimePoint_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + return SWIG_Python_InitShadowInstance(args); +} + SWIGINTERN PyObject *_wrap_blpapi_TimePointUtil_nanosecondsBetween(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_TimePoint_t *arg1 = (blpapi_TimePoint_t *) 0 ; @@ -13875,17 +13381,16 @@ SWIGINTERN PyObject *_wrap_blpapi_TimePointUtil_nanosecondsBetween(PyObject *SWI int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; long long result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TimePointUtil_nanosecondsBetween",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TimePoint, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_TimePointUtil_nanosecondsBetween", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_TimePoint, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TimePointUtil_nanosecondsBetween" "', argument " "1"" of type '" "blpapi_TimePoint_t const *""'"); } arg1 = (blpapi_TimePoint_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_TimePoint, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_TimePoint, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_TimePointUtil_nanosecondsBetween" "', argument " "2"" of type '" "blpapi_TimePoint_t const *""'"); } @@ -13910,16 +13415,15 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_parts_set(PyObject *SWIGUNUSEDPAR int res1 = 0 ; unsigned char val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_parts_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Datetime_tag_parts_set", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_parts_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } arg1 = (struct blpapi_Datetime_tag *)(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); + ecode2 = SWIG_AsVal_unsigned_SS_char(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_parts_set" "', argument " "2"" of type '" "blpapi_UChar_t""'"); } @@ -13941,11 +13445,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_parts_get(PyObject *SWIGUNUSEDPAR struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; blpapi_UChar_t result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_parts_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_parts_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } @@ -13970,16 +13475,15 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_hours_set(PyObject *SWIGUNUSEDPAR int res1 = 0 ; unsigned char val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_hours_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Datetime_tag_hours_set", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_hours_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } arg1 = (struct blpapi_Datetime_tag *)(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); + ecode2 = SWIG_AsVal_unsigned_SS_char(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_hours_set" "', argument " "2"" of type '" "blpapi_UChar_t""'"); } @@ -14001,11 +13505,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_hours_get(PyObject *SWIGUNUSEDPAR struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; blpapi_UChar_t result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_hours_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_hours_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } @@ -14030,16 +13535,15 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_minutes_set(PyObject *SWIGUNUSEDP int res1 = 0 ; unsigned char val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_minutes_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Datetime_tag_minutes_set", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_minutes_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } arg1 = (struct blpapi_Datetime_tag *)(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); + ecode2 = SWIG_AsVal_unsigned_SS_char(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_minutes_set" "', argument " "2"" of type '" "blpapi_UChar_t""'"); } @@ -14061,11 +13565,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_minutes_get(PyObject *SWIGUNUSEDP struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; blpapi_UChar_t result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_minutes_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_minutes_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } @@ -14090,16 +13595,15 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_seconds_set(PyObject *SWIGUNUSEDP int res1 = 0 ; unsigned char val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_seconds_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Datetime_tag_seconds_set", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_seconds_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } arg1 = (struct blpapi_Datetime_tag *)(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); + ecode2 = SWIG_AsVal_unsigned_SS_char(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_seconds_set" "', argument " "2"" of type '" "blpapi_UChar_t""'"); } @@ -14121,11 +13625,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_seconds_get(PyObject *SWIGUNUSEDP struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; blpapi_UChar_t result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_seconds_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_seconds_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } @@ -14150,16 +13655,15 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_milliSeconds_set(PyObject *SWIGUN int res1 = 0 ; unsigned short val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_milliSeconds_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Datetime_tag_milliSeconds_set", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_milliSeconds_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } arg1 = (struct blpapi_Datetime_tag *)(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_short(obj1, &val2); + ecode2 = SWIG_AsVal_unsigned_SS_short(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_milliSeconds_set" "', argument " "2"" of type '" "blpapi_UInt16_t""'"); } @@ -14181,11 +13685,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_milliSeconds_get(PyObject *SWIGUN struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; blpapi_UInt16_t result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_milliSeconds_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_milliSeconds_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } @@ -14210,16 +13715,15 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_month_set(PyObject *SWIGUNUSEDPAR int res1 = 0 ; unsigned char val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_month_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Datetime_tag_month_set", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_month_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } arg1 = (struct blpapi_Datetime_tag *)(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); + ecode2 = SWIG_AsVal_unsigned_SS_char(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_month_set" "', argument " "2"" of type '" "blpapi_UChar_t""'"); } @@ -14241,11 +13745,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_month_get(PyObject *SWIGUNUSEDPAR struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; blpapi_UChar_t result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_month_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_month_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } @@ -14270,16 +13775,15 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_day_set(PyObject *SWIGUNUSEDPARM( int res1 = 0 ; unsigned char val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_day_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Datetime_tag_day_set", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_day_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } arg1 = (struct blpapi_Datetime_tag *)(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); + ecode2 = SWIG_AsVal_unsigned_SS_char(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_day_set" "', argument " "2"" of type '" "blpapi_UChar_t""'"); } @@ -14301,11 +13805,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_day_get(PyObject *SWIGUNUSEDPARM( struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; blpapi_UChar_t result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_day_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_day_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } @@ -14330,16 +13835,15 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_year_set(PyObject *SWIGUNUSEDPARM int res1 = 0 ; unsigned short val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_year_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Datetime_tag_year_set", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_year_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } arg1 = (struct blpapi_Datetime_tag *)(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_short(obj1, &val2); + ecode2 = SWIG_AsVal_unsigned_SS_short(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_year_set" "', argument " "2"" of type '" "blpapi_UInt16_t""'"); } @@ -14361,11 +13865,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_year_get(PyObject *SWIGUNUSEDPARM struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; blpapi_UInt16_t result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_year_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_year_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } @@ -14390,16 +13895,15 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_offset_set(PyObject *SWIGUNUSEDPA int res1 = 0 ; short val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Datetime_tag_offset_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Datetime_tag_offset_set", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_offset_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } arg1 = (struct blpapi_Datetime_tag *)(argp1); - ecode2 = SWIG_AsVal_short(obj1, &val2); + ecode2 = SWIG_AsVal_short(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_offset_set" "', argument " "2"" of type '" "blpapi_Int16_t""'"); } @@ -14421,11 +13925,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_offset_get(PyObject *SWIGUNUSEDPA struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; blpapi_Int16_t result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Datetime_tag_offset_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_offset_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } @@ -14446,7 +13951,7 @@ SWIGINTERN PyObject *_wrap_new_blpapi_Datetime_tag(PyObject *SWIGUNUSEDPARM(self PyObject *resultobj = 0; struct blpapi_Datetime_tag *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)":new_blpapi_Datetime_tag")) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "new_blpapi_Datetime_tag", 0, 0, 0)) SWIG_fail; { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (struct blpapi_Datetime_tag *)calloc(1, sizeof(struct blpapi_Datetime_tag)); @@ -14464,10 +13969,11 @@ SWIGINTERN PyObject *_wrap_delete_blpapi_Datetime_tag(PyObject *SWIGUNUSEDPARM(s struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; - if (!PyArg_ParseTuple(args,(char *)"O:delete_blpapi_Datetime_tag",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Datetime_tag, SWIG_POINTER_DISOWN | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Datetime_tag, SWIG_POINTER_DISOWN | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_blpapi_Datetime_tag" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } @@ -14486,11 +13992,15 @@ SWIGINTERN PyObject *_wrap_delete_blpapi_Datetime_tag(PyObject *SWIGUNUSEDPARM(s SWIGINTERN PyObject *blpapi_Datetime_tag_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; + if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL; SWIG_TypeNewClientData(SWIGTYPE_p_blpapi_Datetime_tag, SWIG_NewClientData(obj)); return SWIG_Py_Void(); } +SWIGINTERN PyObject *blpapi_Datetime_tag_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + return SWIG_Python_InitShadowInstance(args); +} + SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_tag_datetime_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; struct blpapi_HighPrecisionDatetime_tag *arg1 = (struct blpapi_HighPrecisionDatetime_tag *) 0 ; @@ -14499,16 +14009,15 @@ SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_tag_datetime_set(PyObjec int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_HighPrecisionDatetime_tag_datetime_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_HighPrecisionDatetime_tag_datetime_set", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_tag_datetime_set" "', argument " "1"" of type '" "struct blpapi_HighPrecisionDatetime_tag *""'"); } arg1 = (struct blpapi_HighPrecisionDatetime_tag *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_HighPrecisionDatetime_tag_datetime_set" "', argument " "2"" of type '" "blpapi_Datetime_t *""'"); } @@ -14530,11 +14039,12 @@ SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_tag_datetime_get(PyObjec struct blpapi_HighPrecisionDatetime_tag *arg1 = (struct blpapi_HighPrecisionDatetime_tag *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; blpapi_Datetime_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_HighPrecisionDatetime_tag_datetime_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_tag_datetime_get" "', argument " "1"" of type '" "struct blpapi_HighPrecisionDatetime_tag *""'"); } @@ -14559,16 +14069,15 @@ SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_tag_picoseconds_set(PyOb int res1 = 0 ; unsigned int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_HighPrecisionDatetime_tag_picoseconds_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_HighPrecisionDatetime_tag_picoseconds_set", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_tag_picoseconds_set" "', argument " "1"" of type '" "struct blpapi_HighPrecisionDatetime_tag *""'"); } arg1 = (struct blpapi_HighPrecisionDatetime_tag *)(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_HighPrecisionDatetime_tag_picoseconds_set" "', argument " "2"" of type '" "blpapi_UInt32_t""'"); } @@ -14590,11 +14099,12 @@ SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_tag_picoseconds_get(PyOb struct blpapi_HighPrecisionDatetime_tag *arg1 = (struct blpapi_HighPrecisionDatetime_tag *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; blpapi_UInt32_t result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_HighPrecisionDatetime_tag_picoseconds_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_tag_picoseconds_get" "', argument " "1"" of type '" "struct blpapi_HighPrecisionDatetime_tag *""'"); } @@ -14615,7 +14125,7 @@ SWIGINTERN PyObject *_wrap_new_blpapi_HighPrecisionDatetime_tag(PyObject *SWIGUN PyObject *resultobj = 0; struct blpapi_HighPrecisionDatetime_tag *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)":new_blpapi_HighPrecisionDatetime_tag")) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "new_blpapi_HighPrecisionDatetime_tag", 0, 0, 0)) SWIG_fail; { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (struct blpapi_HighPrecisionDatetime_tag *)calloc(1, sizeof(struct blpapi_HighPrecisionDatetime_tag)); @@ -14633,10 +14143,11 @@ SWIGINTERN PyObject *_wrap_delete_blpapi_HighPrecisionDatetime_tag(PyObject *SWI struct blpapi_HighPrecisionDatetime_tag *arg1 = (struct blpapi_HighPrecisionDatetime_tag *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; - if (!PyArg_ParseTuple(args,(char *)"O:delete_blpapi_HighPrecisionDatetime_tag",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, SWIG_POINTER_DISOWN | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, SWIG_POINTER_DISOWN | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_blpapi_HighPrecisionDatetime_tag" "', argument " "1"" of type '" "struct blpapi_HighPrecisionDatetime_tag *""'"); } @@ -14655,11 +14166,15 @@ SWIGINTERN PyObject *_wrap_delete_blpapi_HighPrecisionDatetime_tag(PyObject *SWI SWIGINTERN PyObject *blpapi_HighPrecisionDatetime_tag_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; + if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL; SWIG_TypeNewClientData(SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, SWIG_NewClientData(obj)); return SWIG_Py_Void(); } +SWIGINTERN PyObject *blpapi_HighPrecisionDatetime_tag_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + return SWIG_Python_InitShadowInstance(args); +} + SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_compare(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_HighPrecisionDatetime_t *arg1 = (blpapi_HighPrecisionDatetime_t *) 0 ; @@ -14668,17 +14183,16 @@ SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_compare(PyObject *SWIGUN int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_HighPrecisionDatetime_compare",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_HighPrecisionDatetime_compare", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_compare" "', argument " "1"" of type '" "blpapi_HighPrecisionDatetime_t const *""'"); } arg1 = (blpapi_HighPrecisionDatetime_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_HighPrecisionDatetime_compare" "', argument " "2"" of type '" "blpapi_HighPrecisionDatetime_t const *""'"); } @@ -14711,21 +14225,17 @@ SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_print(PyObject *SWIGUNUS int ecode4 = 0 ; int val5 ; int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; + PyObject *swig_obj[5] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOOO:blpapi_HighPrecisionDatetime_print",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_HighPrecisionDatetime_print", 5, 5, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_print" "', argument " "1"" of type '" "blpapi_HighPrecisionDatetime_t const *""'"); } arg1 = (blpapi_HighPrecisionDatetime_t *)(argp1); { - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_blpapi_StreamWriter_t, 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_blpapi_StreamWriter_t, 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_HighPrecisionDatetime_print" "', argument " "2"" of type '" "blpapi_StreamWriter_t""'"); } @@ -14735,16 +14245,16 @@ SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_print(PyObject *SWIGUNUS arg2 = *((blpapi_StreamWriter_t *)(argp2)); } } - res3 = SWIG_ConvertPtr(obj2,SWIG_as_voidptrptr(&arg3), 0, 0); + res3 = SWIG_ConvertPtr(swig_obj[2],SWIG_as_voidptrptr(&arg3), 0, 0); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_HighPrecisionDatetime_print" "', argument " "3"" of type '" "void *""'"); } - ecode4 = SWIG_AsVal_int(obj3, &val4); + ecode4 = SWIG_AsVal_int(swig_obj[3], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_HighPrecisionDatetime_print" "', argument " "4"" of type '" "int""'"); } arg4 = (int)(val4); - ecode5 = SWIG_AsVal_int(obj4, &val5); + ecode5 = SWIG_AsVal_int(swig_obj[4], &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_HighPrecisionDatetime_print" "', argument " "5"" of type '" "int""'"); } @@ -14771,18 +14281,17 @@ SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_fromTimePoint(PyObject * blpapi_TimePoint_t temp2 ; short val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_HighPrecisionDatetime_fromTimePoint",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_HighPrecisionDatetime_fromTimePoint", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_fromTimePoint" "', argument " "1"" of type '" "blpapi_HighPrecisionDatetime_t *""'"); } arg1 = (blpapi_HighPrecisionDatetime_t *)(argp1); - ecode3 = SWIG_AsVal_short(obj1, &val3); + ecode3 = SWIG_AsVal_short(swig_obj[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_HighPrecisionDatetime_fromTimePoint" "', argument " "3"" of type '" "short""'"); } @@ -14809,11 +14318,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Constant_name(PyObject *SWIGUNUSEDPARM(self), blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; blpapi_Name_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_name",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_name" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); } @@ -14835,11 +14345,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Constant_description(PyObject *SWIGUNUSEDPARM( blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_description",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_description" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); } @@ -14861,11 +14372,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Constant_status(PyObject *SWIGUNUSEDPARM(self) blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_status",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_status" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); } @@ -14887,11 +14399,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Constant_datatype(PyObject *SWIGUNUSEDPARM(sel blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_datatype",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_datatype" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); } @@ -14916,12 +14429,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Constant_getValueAsChar(PyObject *SWIGUNUSEDPA int res1 = 0 ; blpapi_Char_t temp2 ; int res2 = SWIG_TMPOBJ ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_getValueAsChar",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_getValueAsChar" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); } @@ -14951,12 +14465,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Constant_getValueAsInt32(PyObject *SWIGUNUSEDP void *argp1 = 0 ; int res1 = 0 ; int temp2 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_getValueAsInt32",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_getValueAsInt32" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); } @@ -14982,12 +14497,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Constant_getValueAsInt64(PyObject *SWIGUNUSEDP int res1 = 0 ; blpapi_Int64_t temp2 ; int res2 = SWIG_TMPOBJ ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_getValueAsInt64",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_getValueAsInt64" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); } @@ -15018,12 +14534,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Constant_getValueAsFloat32(PyObject *SWIGUNUSE int res1 = 0 ; blpapi_Float32_t temp2 ; int res2 = SWIG_TMPOBJ ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_getValueAsFloat32",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_getValueAsFloat32" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); } @@ -15054,12 +14571,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Constant_getValueAsFloat64(PyObject *SWIGUNUSE int res1 = 0 ; blpapi_Float64_t temp2 ; int res2 = SWIG_TMPOBJ ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_getValueAsFloat64",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_getValueAsFloat64" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); } @@ -15089,12 +14607,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Constant_getValueAsDatetime(PyObject *SWIGUNUS void *argp1 = 0 ; int res1 = 0 ; blpapi_Datetime_t temp2 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_getValueAsDatetime",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_getValueAsDatetime" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); } @@ -15123,12 +14642,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Constant_getValueAsString(PyObject *SWIGUNUSED void *argp1 = 0 ; int res1 = 0 ; char *temp2 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Constant_getValueAsString",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_getValueAsString" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); } @@ -15151,11 +14671,12 @@ SWIGINTERN PyObject *_wrap_blpapi_ConstantList_name(PyObject *SWIGUNUSEDPARM(sel blpapi_ConstantList_t *arg1 = (blpapi_ConstantList_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; blpapi_Name_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ConstantList_name",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_name" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); } @@ -15177,11 +14698,12 @@ SWIGINTERN PyObject *_wrap_blpapi_ConstantList_description(PyObject *SWIGUNUSEDP blpapi_ConstantList_t *arg1 = (blpapi_ConstantList_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ConstantList_description",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_description" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); } @@ -15203,11 +14725,12 @@ SWIGINTERN PyObject *_wrap_blpapi_ConstantList_numConstants(PyObject *SWIGUNUSED blpapi_ConstantList_t *arg1 = (blpapi_ConstantList_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ConstantList_numConstants",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_numConstants" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); } @@ -15229,11 +14752,12 @@ SWIGINTERN PyObject *_wrap_blpapi_ConstantList_datatype(PyObject *SWIGUNUSEDPARM blpapi_ConstantList_t *arg1 = (blpapi_ConstantList_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ConstantList_datatype",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_datatype" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); } @@ -15255,11 +14779,12 @@ SWIGINTERN PyObject *_wrap_blpapi_ConstantList_status(PyObject *SWIGUNUSEDPARM(s blpapi_ConstantList_t *arg1 = (blpapi_ConstantList_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ConstantList_status",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_status" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); } @@ -15288,23 +14813,21 @@ SWIGINTERN PyObject *_wrap_blpapi_ConstantList_getConstant(PyObject *SWIGUNUSEDP int alloc2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; blpapi_Constant_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_ConstantList_getConstant",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_ConstantList_getConstant", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_getConstant" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); } arg1 = (blpapi_ConstantList_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ConstantList_getConstant" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ConstantList_getConstant" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); } @@ -15331,17 +14854,16 @@ SWIGINTERN PyObject *_wrap_blpapi_ConstantList_getConstantAt(PyObject *SWIGUNUSE int res1 = 0 ; size_t val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; blpapi_Constant_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ConstantList_getConstantAt",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_ConstantList_getConstantAt", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_getConstantAt" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); } arg1 = (blpapi_ConstantList_t *)(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); + ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_ConstantList_getConstantAt" "', argument " "2"" of type '" "size_t""'"); } @@ -15363,11 +14885,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_name(PyObject *SWIGUNU blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; blpapi_Name_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaElementDefinition_name",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_name" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); } @@ -15389,11 +14912,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_description(PyObject * blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaElementDefinition_description",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_description" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); } @@ -15415,11 +14939,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_status(PyObject *SWIGU blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaElementDefinition_status",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_status" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); } @@ -15441,11 +14966,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_type(PyObject *SWIGUNU blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; blpapi_SchemaTypeDefinition_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaElementDefinition_type",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_type" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); } @@ -15467,11 +14993,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_numAlternateNames(PyOb blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; size_t result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaElementDefinition_numAlternateNames",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_numAlternateNames" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); } @@ -15496,17 +15023,16 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_getAlternateName(PyObj int res1 = 0 ; size_t val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; blpapi_Name_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SchemaElementDefinition_getAlternateName",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_SchemaElementDefinition_getAlternateName", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_getAlternateName" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); } arg1 = (blpapi_SchemaElementDefinition_t *)(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); + ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SchemaElementDefinition_getAlternateName" "', argument " "2"" of type '" "size_t""'"); } @@ -15528,11 +15054,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_minValues(PyObject *SW blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; size_t result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaElementDefinition_minValues",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_minValues" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); } @@ -15554,11 +15081,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_maxValues(PyObject *SW blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; size_t result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaElementDefinition_maxValues",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_maxValues" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); } @@ -15580,11 +15108,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_name(PyObject *SWIGUNUSED blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; blpapi_Name_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_name",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_p_void, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_name" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); } @@ -15606,11 +15135,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_description(PyObject *SWI blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_description",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_p_void, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_description" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); } @@ -15632,11 +15162,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_status(PyObject *SWIGUNUS blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_status",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_p_void, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_status" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); } @@ -15658,11 +15189,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_datatype(PyObject *SWIGUN blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_datatype",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_p_void, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_datatype" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); } @@ -15684,11 +15216,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_isComplexType(PyObject *S blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_isComplexType",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_p_void, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_isComplexType" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); } @@ -15710,11 +15243,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_isSimpleType(PyObject *SW blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_isSimpleType",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_p_void, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_isSimpleType" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); } @@ -15736,11 +15270,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_isEnumerationType(PyObjec blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_isEnumerationType",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_p_void, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_isEnumerationType" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); } @@ -15762,11 +15297,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_numElementDefinitions(PyO blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; size_t result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_numElementDefinitions",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_p_void, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_numElementDefinitions" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); } @@ -15795,23 +15331,21 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_getElementDefinition(PyOb int alloc2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; blpapi_SchemaElementDefinition_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_SchemaTypeDefinition_getElementDefinition",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_SchemaTypeDefinition_getElementDefinition", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_p_void, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_getElementDefinition" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); } arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SchemaTypeDefinition_getElementDefinition" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_SchemaTypeDefinition_getElementDefinition" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); } @@ -15838,17 +15372,16 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_getElementDefinitionAt(Py int res1 = 0 ; size_t val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; blpapi_SchemaElementDefinition_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_SchemaTypeDefinition_getElementDefinitionAt",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_SchemaTypeDefinition_getElementDefinitionAt", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_p_void, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_getElementDefinitionAt" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); } arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); + ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SchemaTypeDefinition_getElementDefinitionAt" "', argument " "2"" of type '" "size_t""'"); } @@ -15870,11 +15403,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_enumeration(PyObject *SWI blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; blpapi_ConstantList_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_SchemaTypeDefinition_enumeration",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_void, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_p_void, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_enumeration" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); } @@ -15896,10 +15430,11 @@ SWIGINTERN PyObject *_wrap_blpapi_Request_destroy(PyObject *SWIGUNUSEDPARM(self) blpapi_Request_t *arg1 = (blpapi_Request_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Request_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Request, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Request, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Request_destroy" "', argument " "1"" of type '" "blpapi_Request_t *""'"); } @@ -15921,11 +15456,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Request_elements(PyObject *SWIGUNUSEDPARM(self blpapi_Request_t *arg1 = (blpapi_Request_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; blpapi_Element_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Request_elements",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Request, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Request, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Request_elements" "', argument " "1"" of type '" "blpapi_Request_t *""'"); } @@ -15950,16 +15486,15 @@ SWIGINTERN PyObject *_wrap_blpapi_Request_setPreferredRoute(PyObject *SWIGUNUSED int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Request_setPreferredRoute",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Request, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Request_setPreferredRoute", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Request, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Request_setPreferredRoute" "', argument " "1"" of type '" "blpapi_Request_t *""'"); } arg1 = (blpapi_Request_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Request_setPreferredRoute" "', argument " "2"" of type '" "blpapi_CorrelationId_t *""'"); } @@ -15983,12 +15518,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Request_getRequestId(PyObject *SWIGUNUSEDPARM( void *argp1 = 0 ; int res1 = 0 ; char *temp2 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Request_getRequestId",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Request, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Request, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Request_getRequestId" "', argument " "1"" of type '" "blpapi_Request_t const *""'"); } @@ -16011,11 +15547,12 @@ SWIGINTERN PyObject *_wrap_blpapi_RequestTemplate_release(PyObject *SWIGUNUSEDPA blpapi_RequestTemplate_t *arg1 = (blpapi_RequestTemplate_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_RequestTemplate_release",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_RequestTemplate, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_RequestTemplate, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_RequestTemplate_release" "', argument " "1"" of type '" "blpapi_RequestTemplate_t const *""'"); } @@ -16037,11 +15574,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Operation_name(PyObject *SWIGUNUSEDPARM(self), blpapi_Operation_t *arg1 = (blpapi_Operation_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Operation_name",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Operation, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Operation, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Operation_name" "', argument " "1"" of type '" "blpapi_Operation_t *""'"); } @@ -16063,11 +15601,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Operation_description(PyObject *SWIGUNUSEDPARM blpapi_Operation_t *arg1 = (blpapi_Operation_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Operation_description",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Operation, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Operation, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Operation_description" "', argument " "1"" of type '" "blpapi_Operation_t *""'"); } @@ -16091,12 +15630,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Operation_requestDefinition(PyObject *SWIGUNUS void *argp1 = 0 ; int res1 = 0 ; blpapi_SchemaElementDefinition_t *temp2 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Operation_requestDefinition",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Operation, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Operation, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Operation_requestDefinition" "', argument " "1"" of type '" "blpapi_Operation_t *""'"); } @@ -16119,11 +15659,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Operation_numResponseDefinitions(PyObject *SWI blpapi_Operation_t *arg1 = (blpapi_Operation_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Operation_numResponseDefinitions",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Operation, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Operation, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Operation_numResponseDefinitions" "', argument " "1"" of type '" "blpapi_Operation_t *""'"); } @@ -16150,18 +15691,17 @@ SWIGINTERN PyObject *_wrap_blpapi_Operation_responseDefinition(PyObject *SWIGUNU blpapi_SchemaElementDefinition_t *temp2 = 0 ; size_t val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Operation_responseDefinition",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Operation, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Operation_responseDefinition", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Operation, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Operation_responseDefinition" "', argument " "1"" of type '" "blpapi_Operation_t *""'"); } arg1 = (blpapi_Operation_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); + ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Operation_responseDefinition" "', argument " "3"" of type '" "size_t""'"); } @@ -16189,18 +15729,17 @@ SWIGINTERN PyObject *_wrap_blpapi_Operation_responseDefinitionFromName(PyObject blpapi_SchemaElementDefinition_t *temp2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Operation_responseDefinitionFromName",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Operation, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Operation_responseDefinitionFromName", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Operation, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Operation_responseDefinitionFromName" "', argument " "1"" of type '" "blpapi_Operation_t *""'"); } arg1 = (blpapi_Operation_t *)(argp1); - res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[1], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Operation_responseDefinitionFromName" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); } @@ -16223,11 +15762,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Service_name(PyObject *SWIGUNUSEDPARM(self), P blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_name",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_name" "', argument " "1"" of type '" "blpapi_Service_t *""'"); } @@ -16249,11 +15789,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Service_description(PyObject *SWIGUNUSEDPARM(s blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_description",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_description" "', argument " "1"" of type '" "blpapi_Service_t *""'"); } @@ -16275,11 +15816,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Service_numOperations(PyObject *SWIGUNUSEDPARM blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_numOperations",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_numOperations" "', argument " "1"" of type '" "blpapi_Service_t *""'"); } @@ -16301,11 +15843,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Service_numEventDefinitions(PyObject *SWIGUNUS blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_numEventDefinitions",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_numEventDefinitions" "', argument " "1"" of type '" "blpapi_Service_t *""'"); } @@ -16327,11 +15870,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Service_addRef(PyObject *SWIGUNUSEDPARM(self), blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_addRef",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_addRef" "', argument " "1"" of type '" "blpapi_Service_t *""'"); } @@ -16353,10 +15897,11 @@ SWIGINTERN PyObject *_wrap_blpapi_Service_release(PyObject *SWIGUNUSEDPARM(self) blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_release",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_release" "', argument " "1"" of type '" "blpapi_Service_t *""'"); } @@ -16378,11 +15923,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Service_authorizationServiceName(PyObject *SWI blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_authorizationServiceName",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_authorizationServiceName" "', argument " "1"" of type '" "blpapi_Service_t *""'"); } @@ -16413,24 +15959,22 @@ SWIGINTERN PyObject *_wrap_blpapi_Service_getOperation(PyObject *SWIGUNUSEDPARM( int alloc3 = 0 ; void *argp4 = 0 ; int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Service_getOperation",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Service_getOperation", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_getOperation" "', argument " "1"" of type '" "blpapi_Service_t *""'"); } arg1 = (blpapi_Service_t *)(argp1); - res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); + res3 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf3, NULL, &alloc3); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Service_getOperation" "', argument " "3"" of type '" "char const *""'"); } arg3 = (char *)(buf3); - res4 = SWIG_ConvertPtr(obj2, &argp4,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res4 = SWIG_ConvertPtr(swig_obj[2], &argp4,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Service_getOperation" "', argument " "4"" of type '" "blpapi_Name_t const *""'"); } @@ -16460,18 +16004,17 @@ SWIGINTERN PyObject *_wrap_blpapi_Service_getOperationAt(PyObject *SWIGUNUSEDPAR blpapi_Operation_t *temp2 = 0 ; size_t val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Service_getOperationAt",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Service_getOperationAt", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_getOperationAt" "', argument " "1"" of type '" "blpapi_Service_t *""'"); } arg1 = (blpapi_Service_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); + ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Service_getOperationAt" "', argument " "3"" of type '" "size_t""'"); } @@ -16503,24 +16046,22 @@ SWIGINTERN PyObject *_wrap_blpapi_Service_getEventDefinition(PyObject *SWIGUNUSE int alloc3 = 0 ; void *argp4 = 0 ; int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Service_getEventDefinition",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Service_getEventDefinition", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_getEventDefinition" "', argument " "1"" of type '" "blpapi_Service_t *""'"); } arg1 = (blpapi_Service_t *)(argp1); - res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); + res3 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf3, NULL, &alloc3); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Service_getEventDefinition" "', argument " "3"" of type '" "char const *""'"); } arg3 = (char *)(buf3); - res4 = SWIG_ConvertPtr(obj2, &argp4,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res4 = SWIG_ConvertPtr(swig_obj[2], &argp4,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Service_getEventDefinition" "', argument " "4"" of type '" "blpapi_Name_t const *""'"); } @@ -16550,18 +16091,17 @@ SWIGINTERN PyObject *_wrap_blpapi_Service_getEventDefinitionAt(PyObject *SWIGUNU blpapi_SchemaElementDefinition_t *temp2 = 0 ; size_t val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Service_getEventDefinitionAt",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Service_getEventDefinitionAt", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_getEventDefinitionAt" "', argument " "1"" of type '" "blpapi_Service_t *""'"); } arg1 = (blpapi_Service_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); + ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Service_getEventDefinitionAt" "', argument " "3"" of type '" "size_t""'"); } @@ -16590,18 +16130,17 @@ SWIGINTERN PyObject *_wrap_blpapi_Service_createRequest(PyObject *SWIGUNUSEDPARM int res3 ; char *buf3 = 0 ; int alloc3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Service_createRequest",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Service_createRequest", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_createRequest" "', argument " "1"" of type '" "blpapi_Service_t *""'"); } arg1 = (blpapi_Service_t *)(argp1); - res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); + res3 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf3, NULL, &alloc3); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Service_createRequest" "', argument " "3"" of type '" "char const *""'"); } @@ -16632,18 +16171,17 @@ SWIGINTERN PyObject *_wrap_blpapi_Service_createAuthorizationRequest(PyObject *S int res3 ; char *buf3 = 0 ; int alloc3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Service_createAuthorizationRequest",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Service_createAuthorizationRequest", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_createAuthorizationRequest" "', argument " "1"" of type '" "blpapi_Service_t *""'"); } arg1 = (blpapi_Service_t *)(argp1); - res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); + res3 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf3, NULL, &alloc3); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Service_createAuthorizationRequest" "', argument " "3"" of type '" "char const *""'"); } @@ -16670,12 +16208,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Service_createPublishEvent(PyObject *SWIGUNUSE void *argp1 = 0 ; int res1 = 0 ; blpapi_Event_t *temp2 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_createPublishEvent",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_createPublishEvent" "', argument " "1"" of type '" "blpapi_Service_t *""'"); } @@ -16700,12 +16239,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Service_createAdminEvent(PyObject *SWIGUNUSEDP void *argp1 = 0 ; int res1 = 0 ; blpapi_Event_t *temp2 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Service_createAdminEvent",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_createAdminEvent" "', argument " "1"" of type '" "blpapi_Service_t *""'"); } @@ -16733,18 +16273,17 @@ SWIGINTERN PyObject *_wrap_blpapi_Service_createResponseEvent(PyObject *SWIGUNUS void *argp2 = 0 ; int res2 = 0 ; blpapi_Event_t *temp3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg3 = &temp3; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Service_createResponseEvent",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Service_createResponseEvent", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_createResponseEvent" "', argument " "1"" of type '" "blpapi_Service_t *""'"); } arg1 = (blpapi_Service_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Service_createResponseEvent" "', argument " "2"" of type '" "blpapi_CorrelationId_t const *""'"); } @@ -16767,11 +16306,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Message_messageType(PyObject *SWIGUNUSEDPARM(s blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; blpapi_Name_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_messageType",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_messageType" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); } @@ -16793,11 +16333,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Message_topicName(PyObject *SWIGUNUSEDPARM(sel blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_topicName",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_topicName" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); } @@ -16819,11 +16360,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Message_service(PyObject *SWIGUNUSEDPARM(self) blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; blpapi_Service_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_service",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_service" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); } @@ -16845,11 +16387,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Message_numCorrelationIds(PyObject *SWIGUNUSED blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_numCorrelationIds",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_numCorrelationIds" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); } @@ -16874,17 +16417,16 @@ SWIGINTERN PyObject *_wrap_blpapi_Message_correlationId(PyObject *SWIGUNUSEDPARM int res1 = 0 ; size_t val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; blpapi_CorrelationId_t result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Message_correlationId",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Message_correlationId", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_correlationId" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); } arg1 = (blpapi_Message_t *)(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); + ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Message_correlationId" "', argument " "2"" of type '" "size_t""'"); } @@ -16910,12 +16452,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Message_getRequestId(PyObject *SWIGUNUSEDPARM( void *argp1 = 0 ; int res1 = 0 ; char *temp2 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_getRequestId",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_getRequestId" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); } @@ -16938,11 +16481,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Message_elements(PyObject *SWIGUNUSEDPARM(self blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; blpapi_Element_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_elements",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_elements" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); } @@ -16964,11 +16508,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Message_fragmentType(PyObject *SWIGUNUSEDPARM( blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_fragmentType",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_fragmentType" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); } @@ -16990,11 +16535,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Message_recapType(PyObject *SWIGUNUSEDPARM(sel blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_recapType",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_recapType" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); } @@ -17016,11 +16562,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Message_addRef(PyObject *SWIGUNUSEDPARM(self), blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_addRef",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_addRef" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); } @@ -17042,11 +16589,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Message_release(PyObject *SWIGUNUSEDPARM(self) blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_release",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_release" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); } @@ -17070,12 +16618,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Message_timeReceived(PyObject *SWIGUNUSEDPARM( void *argp1 = 0 ; int res1 = 0 ; blpapi_TimePoint_t temp2 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Message_timeReceived",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_timeReceived" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); } @@ -17102,11 +16651,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Event_eventType(PyObject *SWIGUNUSEDPARM(self) blpapi_Event_t *arg1 = (blpapi_Event_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Event_eventType",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Event, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Event, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Event_eventType" "', argument " "1"" of type '" "blpapi_Event_t const *""'"); } @@ -17128,11 +16678,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Event_release(PyObject *SWIGUNUSEDPARM(self), blpapi_Event_t *arg1 = (blpapi_Event_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Event_release",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Event, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Event, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Event_release" "', argument " "1"" of type '" "blpapi_Event_t const *""'"); } @@ -17153,7 +16704,7 @@ SWIGINTERN PyObject *_wrap_blpapi_EventQueue_create(PyObject *SWIGUNUSEDPARM(sel PyObject *resultobj = 0; blpapi_EventQueue_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)":blpapi_EventQueue_create")) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "blpapi_EventQueue_create", 0, 0, 0)) SWIG_fail; { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (blpapi_EventQueue_t *)blpapi_EventQueue_create(); @@ -17171,11 +16722,12 @@ SWIGINTERN PyObject *_wrap_blpapi_EventQueue_destroy(PyObject *SWIGUNUSEDPARM(se blpapi_EventQueue_t *arg1 = (blpapi_EventQueue_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_EventQueue_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventQueue_destroy" "', argument " "1"" of type '" "blpapi_EventQueue_t *""'"); } @@ -17200,17 +16752,16 @@ SWIGINTERN PyObject *_wrap_blpapi_EventQueue_nextEvent(PyObject *SWIGUNUSEDPARM( int res1 = 0 ; int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; blpapi_Event_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_EventQueue_nextEvent",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_EventQueue_nextEvent", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventQueue_nextEvent" "', argument " "1"" of type '" "blpapi_EventQueue_t *""'"); } arg1 = (blpapi_EventQueue_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_EventQueue_nextEvent" "', argument " "2"" of type '" "int""'"); } @@ -17232,11 +16783,12 @@ SWIGINTERN PyObject *_wrap_blpapi_EventQueue_purge(PyObject *SWIGUNUSEDPARM(self blpapi_EventQueue_t *arg1 = (blpapi_EventQueue_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_EventQueue_purge",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventQueue_purge" "', argument " "1"" of type '" "blpapi_EventQueue_t *""'"); } @@ -17260,12 +16812,13 @@ SWIGINTERN PyObject *_wrap_blpapi_EventQueue_tryNextEvent(PyObject *SWIGUNUSEDPA void *argp1 = 0 ; int res1 = 0 ; blpapi_Event_t *temp2 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_EventQueue_tryNextEvent",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventQueue_tryNextEvent" "', argument " "1"" of type '" "blpapi_EventQueue_t *""'"); } @@ -17288,11 +16841,12 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageIterator_create(PyObject *SWIGUNUSEDPAR blpapi_Event_t *arg1 = (blpapi_Event_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; blpapi_MessageIterator_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_MessageIterator_create",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Event, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Event, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageIterator_create" "', argument " "1"" of type '" "blpapi_Event_t const *""'"); } @@ -17314,10 +16868,11 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageIterator_destroy(PyObject *SWIGUNUSEDPA blpapi_MessageIterator_t *arg1 = (blpapi_MessageIterator_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_MessageIterator_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageIterator, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageIterator_destroy" "', argument " "1"" of type '" "blpapi_MessageIterator_t *""'"); } @@ -17341,12 +16896,13 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageIterator_next(PyObject *SWIGUNUSEDPARM( void *argp1 = 0 ; int res1 = 0 ; blpapi_Message_t *temp2 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_MessageIterator_next",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageIterator, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageIterator_next" "', argument " "1"" of type '" "blpapi_MessageIterator_t *""'"); } @@ -17369,10 +16925,11 @@ SWIGINTERN PyObject *_wrap_blpapi_Identity_release(PyObject *SWIGUNUSEDPARM(self blpapi_Identity_t *arg1 = (blpapi_Identity_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Identity_release",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Identity_release" "', argument " "1"" of type '" "blpapi_Identity_t *""'"); } @@ -17394,11 +16951,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Identity_addRef(PyObject *SWIGUNUSEDPARM(self) blpapi_Identity_t *arg1 = (blpapi_Identity_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Identity_addRef",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Identity_addRef" "', argument " "1"" of type '" "blpapi_Identity_t *""'"); } @@ -17438,47 +16996,41 @@ SWIGINTERN PyObject *_wrap_blpapi_Identity_hasEntitlements(PyObject *SWIGUNUSEDP int res6 = 0 ; void *argp7 = 0 ; int res7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; + PyObject *swig_obj[7] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:blpapi_Identity_hasEntitlements",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Identity_hasEntitlements", 7, 7, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Identity_hasEntitlements" "', argument " "1"" of type '" "blpapi_Identity_t const *""'"); } arg1 = (blpapi_Identity_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Identity_hasEntitlements" "', argument " "2"" of type '" "blpapi_Service_t const *""'"); } arg2 = (blpapi_Service_t *)(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Element, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Identity_hasEntitlements" "', argument " "3"" of type '" "blpapi_Element_t const *""'"); } arg3 = (blpapi_Element_t *)(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_int, 0 | 0 ); + res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_int, 0 | 0 ); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Identity_hasEntitlements" "', argument " "4"" of type '" "int const *""'"); } arg4 = (int *)(argp4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); + ecode5 = SWIG_AsVal_size_t(swig_obj[4], &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_Identity_hasEntitlements" "', argument " "5"" of type '" "size_t""'"); } arg5 = (size_t)(val5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_int, 0 | 0 ); + res6 = SWIG_ConvertPtr(swig_obj[5], &argp6,SWIGTYPE_p_int, 0 | 0 ); if (!SWIG_IsOK(res6)) { SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "blpapi_Identity_hasEntitlements" "', argument " "6"" of type '" "int *""'"); } arg6 = (int *)(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_int, 0 | 0 ); + res7 = SWIG_ConvertPtr(swig_obj[6], &argp7,SWIGTYPE_p_int, 0 | 0 ); if (!SWIG_IsOK(res7)) { SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "blpapi_Identity_hasEntitlements" "', argument " "7"" of type '" "int *""'"); } @@ -17503,17 +17055,16 @@ SWIGINTERN PyObject *_wrap_blpapi_Identity_isAuthorized(PyObject *SWIGUNUSEDPARM int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Identity_isAuthorized",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Identity_isAuthorized", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Identity_isAuthorized" "', argument " "1"" of type '" "blpapi_Identity_t const *""'"); } arg1 = (blpapi_Identity_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Identity_isAuthorized" "', argument " "2"" of type '" "blpapi_Service_t const *""'"); } @@ -17537,12 +17088,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Identity_getSeatType(PyObject *SWIGUNUSEDPARM( void *argp1 = 0 ; int res1 = 0 ; int temp2 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Identity_getSeatType",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Identity_getSeatType" "', argument " "1"" of type '" "blpapi_Identity_t const *""'"); } @@ -17567,7 +17119,7 @@ SWIGINTERN PyObject *_wrap_blpapi_HighResolutionClock_now(PyObject *SWIGUNUSEDPA int result; arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)":blpapi_HighResolutionClock_now")) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "blpapi_HighResolutionClock_now", 0, 0, 0)) SWIG_fail; { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)blpapi_HighResolutionClock_now(arg1); @@ -17594,47 +17146,54 @@ SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_cancel(PyObject *SWIGUNUSEDPAR int arg5 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; PyObject *asAscii4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_AbstractSession_cancel",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_AbstractSession_cancel", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_cancel" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); } arg1 = (blpapi_AbstractSession_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_cancel" "', argument " "2"" of type '" "blpapi_CorrelationId_t const *""'"); + { + int sz = PyList_Size(swig_obj[1]); + int res = 0; + arg2 = 0; + arg3 = sz; + if(sz) { + /* Define loop index at the top because old VisualStudio compilers */ + /* don't like variable declarations inside for-statements. */ + int i = 0; + arg2 = (blpapi_CorrelationId_t*) malloc(sizeof(blpapi_CorrelationId_t) * sz); + /* We are ignoring possible errors for malloc return value. */ + /* There aren't any perfect solutions for failure to allocate here, */ + /* and SWIG also seems to ignore this in its own generated code. */ + for(; i < sz; ++i) { + PyObject * thing = PyList_GetItem(swig_obj[1], i); + void* argp; + res = SWIG_ConvertPtr(thing, &argp, SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + if (!SWIG_IsOK(res)) { + SWIG_exception_fail(SWIG_ArgError(res), "Expected a list of blpapi_CorrelationId_t const * as a 2nd argument"); + } + arg2[i] = *(blpapi_CorrelationId_t*)argp; + } + } } - arg2 = (blpapi_CorrelationId_t *)(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_AbstractSession_cancel" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); { - if (obj3 == Py_None) { + if (swig_obj[2] == Py_None) { arg4 = 0; arg5 = 0; } else { - if(PyUnicode_Check(obj3)) { - asAscii4 = PyUnicode_AsASCIIString(obj3); + if(PyUnicode_Check(swig_obj[2])) { + asAscii4 = PyUnicode_AsASCIIString(swig_obj[2]); arg4 = PyString_AsString(asAscii4); arg5 = PyString_Size(asAscii4); } else { - arg4 = PyString_AsString(obj3); - arg5 = PyString_Size(obj3); + arg4 = PyString_AsString(swig_obj[2]); + arg5 = PyString_Size(swig_obj[2]); } } } @@ -17644,6 +17203,9 @@ SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_cancel(PyObject *SWIGUNUSEDPAR SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); + { + if(arg2) free(arg2); + } { if(asAscii4) { Py_DECREF(asAscii4); @@ -17651,6 +17213,9 @@ SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_cancel(PyObject *SWIGUNUSEDPAR } return resultobj; fail: + { + if(arg2) free(arg2); + } { if(asAscii4) { Py_DECREF(asAscii4); @@ -17680,54 +17245,49 @@ SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_sendAuthorizationRequest(PyObj void *argp5 = 0 ; int res5 = 0 ; PyObject *asAscii6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; + PyObject *swig_obj[6] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:blpapi_AbstractSession_sendAuthorizationRequest",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_AbstractSession_sendAuthorizationRequest", 6, 6, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_sendAuthorizationRequest" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); } arg1 = (blpapi_AbstractSession_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Request, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Request, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_sendAuthorizationRequest" "', argument " "2"" of type '" "blpapi_Request_t const *""'"); } arg2 = (blpapi_Request_t *)(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AbstractSession_sendAuthorizationRequest" "', argument " "3"" of type '" "blpapi_Identity_t *""'"); } arg3 = (blpapi_Identity_t *)(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_AbstractSession_sendAuthorizationRequest" "', argument " "4"" of type '" "blpapi_CorrelationId_t *""'"); } arg4 = (blpapi_CorrelationId_t *)(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); + res5 = SWIG_ConvertPtr(swig_obj[4], &argp5,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); if (!SWIG_IsOK(res5)) { SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "blpapi_AbstractSession_sendAuthorizationRequest" "', argument " "5"" of type '" "blpapi_EventQueue_t *""'"); } arg5 = (blpapi_EventQueue_t *)(argp5); { - if (obj5 == Py_None) { + if (swig_obj[5] == Py_None) { arg6 = 0; arg7 = 0; } else { - if(PyUnicode_Check(obj5)) { - asAscii6 = PyUnicode_AsASCIIString(obj5); + if(PyUnicode_Check(swig_obj[5])) { + asAscii6 = PyUnicode_AsASCIIString(swig_obj[5]); arg6 = PyString_AsString(asAscii6); arg7 = PyString_Size(asAscii6); } else { - arg6 = PyString_AsString(obj5); - arg7 = PyString_Size(obj5); + arg6 = PyString_AsString(swig_obj[5]); + arg7 = PyString_Size(swig_obj[5]); } } } @@ -17762,17 +17322,16 @@ SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_openService(PyObject *SWIGUNUS int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_AbstractSession_openService",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_AbstractSession_openService", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_openService" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); } arg1 = (blpapi_AbstractSession_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_openService" "', argument " "2"" of type '" "char const *""'"); } @@ -17803,23 +17362,21 @@ SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_openServiceAsync(PyObject *SWI int alloc2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_AbstractSession_openServiceAsync",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_AbstractSession_openServiceAsync", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_openServiceAsync" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); } arg1 = (blpapi_AbstractSession_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_openServiceAsync" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AbstractSession_openServiceAsync" "', argument " "3"" of type '" "blpapi_CorrelationId_t *""'"); } @@ -17849,23 +17406,21 @@ SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_generateToken(PyObject *SWIGUN int res2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_AbstractSession_generateToken",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_AbstractSession_generateToken", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_generateToken" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); } arg1 = (blpapi_AbstractSession_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_generateToken" "', argument " "2"" of type '" "blpapi_CorrelationId_t *""'"); } arg2 = (blpapi_CorrelationId_t *)(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AbstractSession_generateToken" "', argument " "3"" of type '" "blpapi_EventQueue_t *""'"); } @@ -17901,35 +17456,31 @@ SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_generateManualToken(PyObject * int alloc4 = 0 ; void *argp5 = 0 ; int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; + PyObject *swig_obj[5] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOOO:blpapi_AbstractSession_generateManualToken",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_AbstractSession_generateManualToken", 5, 5, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_generateManualToken" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); } arg1 = (blpapi_AbstractSession_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_generateManualToken" "', argument " "2"" of type '" "blpapi_CorrelationId_t *""'"); } arg2 = (blpapi_CorrelationId_t *)(argp2); - res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); + res3 = SWIG_AsCharPtrAndSize(swig_obj[2], &buf3, NULL, &alloc3); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AbstractSession_generateManualToken" "', argument " "3"" of type '" "char const *""'"); } arg3 = (char *)(buf3); - res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4); + res4 = SWIG_AsCharPtrAndSize(swig_obj[3], &buf4, NULL, &alloc4); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_AbstractSession_generateManualToken" "', argument " "4"" of type '" "char const *""'"); } arg4 = (char *)(buf4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); + res5 = SWIG_ConvertPtr(swig_obj[4], &argp5,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); if (!SWIG_IsOK(res5)) { SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "blpapi_AbstractSession_generateManualToken" "', argument " "5"" of type '" "blpapi_EventQueue_t *""'"); } @@ -17961,18 +17512,17 @@ SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_getService(PyObject *SWIGUNUSE int res3 ; char *buf3 = 0 ; int alloc3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_AbstractSession_getService",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_AbstractSession_getService", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_getService" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); } arg1 = (blpapi_AbstractSession_t *)(argp1); - res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); + res3 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf3, NULL, &alloc3); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AbstractSession_getService" "', argument " "3"" of type '" "char const *""'"); } @@ -17997,11 +17547,12 @@ SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_createIdentity(PyObject *SWIGU blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; blpapi_Identity_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_AbstractSession_createIdentity",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_createIdentity" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); } @@ -18029,23 +17580,21 @@ SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_generateAuthorizedIdentityAsyn int res2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_AbstractSession_generateAuthorizedIdentityAsync",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_AbstractSession_generateAuthorizedIdentityAsync", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_generateAuthorizedIdentityAsync" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); } arg1 = (blpapi_AbstractSession_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_AuthOptions, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_AuthOptions, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_generateAuthorizedIdentityAsync" "', argument " "2"" of type '" "blpapi_AuthOptions_t const *""'"); } arg2 = (blpapi_AuthOptions_t *)(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AbstractSession_generateAuthorizedIdentityAsync" "', argument " "3"" of type '" "blpapi_CorrelationId_t *""'"); } @@ -18072,18 +17621,17 @@ SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_getAuthorizedIdentity(PyObject void *argp2 = 0 ; int res2 = 0 ; blpapi_Identity_t *temp3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg3 = &temp3; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_AbstractSession_getAuthorizedIdentity",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_AbstractSession_getAuthorizedIdentity", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_getAuthorizedIdentity" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); } arg1 = (blpapi_AbstractSession_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_getAuthorizedIdentity" "', argument " "2"" of type '" "blpapi_CorrelationId_t const *""'"); } @@ -18106,11 +17654,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_start(PyObject *SWIGUNUSEDPARM(self), blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Session_start",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_start" "', argument " "1"" of type '" "blpapi_Session_t *""'"); } @@ -18132,11 +17681,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_startAsync(PyObject *SWIGUNUSEDPARM(se blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Session_startAsync",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_startAsync" "', argument " "1"" of type '" "blpapi_Session_t *""'"); } @@ -18158,11 +17708,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_stop(PyObject *SWIGUNUSEDPARM(self), P blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Session_stop",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_stop" "', argument " "1"" of type '" "blpapi_Session_t *""'"); } @@ -18184,11 +17735,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_stopAsync(PyObject *SWIGUNUSEDPARM(sel blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Session_stopAsync",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_stopAsync" "', argument " "1"" of type '" "blpapi_Session_t *""'"); } @@ -18215,18 +17767,17 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_nextEvent(PyObject *SWIGUNUSEDPARM(sel blpapi_Event_t *temp2 = 0 ; unsigned int val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Session_nextEvent",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Session_nextEvent", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_nextEvent" "', argument " "1"" of type '" "blpapi_Session_t *""'"); } arg1 = (blpapi_Session_t *)(argp1); - ecode3 = SWIG_AsVal_unsigned_SS_int(obj1, &val3); + ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Session_nextEvent" "', argument " "3"" of type '" "unsigned int""'"); } @@ -18251,12 +17802,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_tryNextEvent(PyObject *SWIGUNUSEDPARM( void *argp1 = 0 ; int res1 = 0 ; blpapi_Event_t *temp2 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Session_tryNextEvent",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_tryNextEvent" "', argument " "1"" of type '" "blpapi_Session_t *""'"); } @@ -18288,42 +17840,39 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_subscribe(PyObject *SWIGUNUSEDPARM(sel void *argp3 = 0 ; int res3 = 0 ; PyObject *asAscii4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; + PyObject *swig_obj[4] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Session_subscribe",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Session_subscribe", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_subscribe" "', argument " "1"" of type '" "blpapi_Session_t *""'"); } arg1 = (blpapi_Session_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_subscribe" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); } arg2 = (blpapi_SubscriptionList_t *)(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_subscribe" "', argument " "3"" of type '" "blpapi_Identity_t const *""'"); } arg3 = (blpapi_Identity_t *)(argp3); { - if (obj3 == Py_None) { + if (swig_obj[3] == Py_None) { arg4 = 0; arg5 = 0; } else { - if(PyUnicode_Check(obj3)) { - asAscii4 = PyUnicode_AsASCIIString(obj3); + if(PyUnicode_Check(swig_obj[3])) { + asAscii4 = PyUnicode_AsASCIIString(swig_obj[3]); arg4 = PyString_AsString(asAscii4); arg5 = PyString_Size(asAscii4); } else { - arg4 = PyString_AsString(obj3); - arg5 = PyString_Size(obj3); + arg4 = PyString_AsString(swig_obj[3]); + arg5 = PyString_Size(swig_obj[3]); } } } @@ -18360,36 +17909,34 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_resubscribe(PyObject *SWIGUNUSEDPARM(s void *argp2 = 0 ; int res2 = 0 ; PyObject *asAscii3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Session_resubscribe",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Session_resubscribe", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_resubscribe" "', argument " "1"" of type '" "blpapi_Session_t *""'"); } arg1 = (blpapi_Session_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_resubscribe" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); } arg2 = (blpapi_SubscriptionList_t *)(argp2); { - if (obj2 == Py_None) { + if (swig_obj[2] == Py_None) { arg3 = 0; arg4 = 0; } else { - if(PyUnicode_Check(obj2)) { - asAscii3 = PyUnicode_AsASCIIString(obj2); + if(PyUnicode_Check(swig_obj[2])) { + asAscii3 = PyUnicode_AsASCIIString(swig_obj[2]); arg3 = PyString_AsString(asAscii3); arg4 = PyString_Size(asAscii3); } else { - arg3 = PyString_AsString(obj2); - arg4 = PyString_Size(obj2); + arg3 = PyString_AsString(swig_obj[2]); + arg4 = PyString_Size(swig_obj[2]); } } } @@ -18429,42 +17976,39 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_resubscribeWithId(PyObject *SWIGUNUSED int val3 ; int ecode3 = 0 ; PyObject *asAscii4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; + PyObject *swig_obj[4] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Session_resubscribeWithId",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Session_resubscribeWithId", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_resubscribeWithId" "', argument " "1"" of type '" "blpapi_Session_t *""'"); } arg1 = (blpapi_Session_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_resubscribeWithId" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); } arg2 = (blpapi_SubscriptionList_t *)(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Session_resubscribeWithId" "', argument " "3"" of type '" "int""'"); } arg3 = (int)(val3); { - if (obj3 == Py_None) { + if (swig_obj[3] == Py_None) { arg4 = 0; arg5 = 0; } else { - if(PyUnicode_Check(obj3)) { - asAscii4 = PyUnicode_AsASCIIString(obj3); + if(PyUnicode_Check(swig_obj[3])) { + asAscii4 = PyUnicode_AsASCIIString(swig_obj[3]); arg4 = PyString_AsString(asAscii4); arg5 = PyString_Size(asAscii4); } else { - arg4 = PyString_AsString(obj3); - arg5 = PyString_Size(obj3); + arg4 = PyString_AsString(swig_obj[3]); + arg5 = PyString_Size(swig_obj[3]); } } } @@ -18501,36 +18045,34 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_unsubscribe(PyObject *SWIGUNUSEDPARM(s void *argp2 = 0 ; int res2 = 0 ; PyObject *asAscii3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Session_unsubscribe",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Session_unsubscribe", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_unsubscribe" "', argument " "1"" of type '" "blpapi_Session_t *""'"); } arg1 = (blpapi_Session_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_unsubscribe" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); } arg2 = (blpapi_SubscriptionList_t *)(argp2); { - if (obj2 == Py_None) { + if (swig_obj[2] == Py_None) { arg3 = 0; arg4 = 0; } else { - if(PyUnicode_Check(obj2)) { - asAscii3 = PyUnicode_AsASCIIString(obj2); + if(PyUnicode_Check(swig_obj[2])) { + asAscii3 = PyUnicode_AsASCIIString(swig_obj[2]); arg3 = PyString_AsString(asAscii3); arg4 = PyString_Size(asAscii3); } else { - arg3 = PyString_AsString(obj2); - arg4 = PyString_Size(obj2); + arg3 = PyString_AsString(swig_obj[2]); + arg4 = PyString_Size(swig_obj[2]); } } } @@ -18570,29 +18112,26 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_setStatusCorrelationId(PyObject *SWIGU int res3 = 0 ; void *argp4 = 0 ; int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; + PyObject *swig_obj[4] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Session_setStatusCorrelationId",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Session_setStatusCorrelationId", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_setStatusCorrelationId" "', argument " "1"" of type '" "blpapi_Session_t *""'"); } arg1 = (blpapi_Session_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_setStatusCorrelationId" "', argument " "2"" of type '" "blpapi_Service_t const *""'"); } arg2 = (blpapi_Service_t *)(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_setStatusCorrelationId" "', argument " "3"" of type '" "blpapi_Identity_t const *""'"); } arg3 = (blpapi_Identity_t *)(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Session_setStatusCorrelationId" "', argument " "4"" of type '" "blpapi_CorrelationId_t const *""'"); } @@ -18629,54 +18168,49 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_sendRequest(PyObject *SWIGUNUSEDPARM(s void *argp5 = 0 ; int res5 = 0 ; PyObject *asAscii6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; + PyObject *swig_obj[6] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:blpapi_Session_sendRequest",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Session_sendRequest", 6, 6, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_sendRequest" "', argument " "1"" of type '" "blpapi_Session_t *""'"); } arg1 = (blpapi_Session_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Request, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Request, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_sendRequest" "', argument " "2"" of type '" "blpapi_Request_t const *""'"); } arg2 = (blpapi_Request_t *)(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_sendRequest" "', argument " "3"" of type '" "blpapi_CorrelationId_t *""'"); } arg3 = (blpapi_CorrelationId_t *)(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Session_sendRequest" "', argument " "4"" of type '" "blpapi_Identity_t *""'"); } arg4 = (blpapi_Identity_t *)(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); + res5 = SWIG_ConvertPtr(swig_obj[4], &argp5,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); if (!SWIG_IsOK(res5)) { SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "blpapi_Session_sendRequest" "', argument " "5"" of type '" "blpapi_EventQueue_t *""'"); } arg5 = (blpapi_EventQueue_t *)(argp5); { - if (obj5 == Py_None) { + if (swig_obj[5] == Py_None) { arg6 = 0; arg7 = 0; } else { - if(PyUnicode_Check(obj5)) { - asAscii6 = PyUnicode_AsASCIIString(obj5); + if(PyUnicode_Check(swig_obj[5])) { + asAscii6 = PyUnicode_AsASCIIString(swig_obj[5]); arg6 = PyString_AsString(asAscii6); arg7 = PyString_Size(asAscii6); } else { - arg6 = PyString_AsString(obj5); - arg7 = PyString_Size(obj5); + arg6 = PyString_AsString(swig_obj[5]); + arg7 = PyString_Size(swig_obj[5]); } } } @@ -18713,23 +18247,21 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_sendRequestTemplate(PyObject *SWIGUNUS int res2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_Session_sendRequestTemplate",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Session_sendRequestTemplate", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_sendRequestTemplate" "', argument " "1"" of type '" "blpapi_Session_t *""'"); } arg1 = (blpapi_Session_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_RequestTemplate, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_RequestTemplate, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_sendRequestTemplate" "', argument " "2"" of type '" "blpapi_RequestTemplate_t const *""'"); } arg2 = (blpapi_RequestTemplate_t *)(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_sendRequestTemplate" "', argument " "3"" of type '" "blpapi_CorrelationId_t *""'"); } @@ -18763,30 +18295,27 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_createSnapshotRequestTemplate(PyObject int res4 = 0 ; void *argp5 = 0 ; int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; + PyObject *swig_obj[4] ; int result; arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_Session_createSnapshotRequestTemplate",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Session_createSnapshotRequestTemplate", 4, 4, swig_obj)) SWIG_fail; + res2 = SWIG_ConvertPtr(swig_obj[0], &argp2,SWIGTYPE_p_blpapi_Session, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_createSnapshotRequestTemplate" "', argument " "2"" of type '" "blpapi_Session_t *""'"); } arg2 = (blpapi_Session_t *)(argp2); - res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); + res3 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf3, NULL, &alloc3); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_createSnapshotRequestTemplate" "', argument " "3"" of type '" "char const *""'"); } arg3 = (char *)(buf3); - res4 = SWIG_ConvertPtr(obj2, &argp4,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + res4 = SWIG_ConvertPtr(swig_obj[2], &argp4,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Session_createSnapshotRequestTemplate" "', argument " "4"" of type '" "blpapi_Identity_t const *""'"); } arg4 = (blpapi_Identity_t *)(argp4); - res5 = SWIG_ConvertPtr(obj3, &argp5,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + res5 = SWIG_ConvertPtr(swig_obj[3], &argp5,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); if (!SWIG_IsOK(res5)) { SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "blpapi_Session_createSnapshotRequestTemplate" "', argument " "5"" of type '" "blpapi_CorrelationId_t *""'"); } @@ -18811,11 +18340,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_getAbstractSession(PyObject *SWIGUNUSE blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; blpapi_AbstractSession_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Session_getAbstractSession",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_getAbstractSession" "', argument " "1"" of type '" "blpapi_Session_t *""'"); } @@ -18840,17 +18370,16 @@ SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_extractAttributeFromResolutionS int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; blpapi_Element_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_extractAttributeFromResolutionSuccess",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_ResolutionList_extractAttributeFromResolutionSuccess", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_extractAttributeFromResolutionSuccess" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); } arg1 = (blpapi_Message_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ResolutionList_extractAttributeFromResolutionSuccess" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); } @@ -18872,11 +18401,12 @@ SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_create(PyObject *SWIGUNUSEDPARM blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; blpapi_ResolutionList_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ResolutionList_create",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_create" "', argument " "1"" of type '" "blpapi_ResolutionList_t *""'"); } @@ -18898,10 +18428,11 @@ SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_destroy(PyObject *SWIGUNUSEDPAR blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ResolutionList_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_destroy" "', argument " "1"" of type '" "blpapi_ResolutionList_t *""'"); } @@ -18930,23 +18461,21 @@ SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_add(PyObject *SWIGUNUSEDPARM(se int alloc2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_ResolutionList_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_ResolutionList_add", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_add" "', argument " "1"" of type '" "blpapi_ResolutionList_t *""'"); } arg1 = (blpapi_ResolutionList_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ResolutionList_add" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ResolutionList_add" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); } @@ -18976,23 +18505,21 @@ SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_addFromMessage(PyObject *SWIGUN int res2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_ResolutionList_addFromMessage",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_ResolutionList_addFromMessage", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_addFromMessage" "', argument " "1"" of type '" "blpapi_ResolutionList_t *""'"); } arg1 = (blpapi_ResolutionList_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Message, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ResolutionList_addFromMessage" "', argument " "2"" of type '" "blpapi_Message_t const *""'"); } arg2 = (blpapi_Message_t *)(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ResolutionList_addFromMessage" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); } @@ -19017,17 +18544,16 @@ SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_addAttribute(PyObject *SWIGUNUS int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_addAttribute",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_ResolutionList_addAttribute", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_addAttribute" "', argument " "1"" of type '" "blpapi_ResolutionList_t *""'"); } arg1 = (blpapi_ResolutionList_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ResolutionList_addAttribute" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); } @@ -19054,18 +18580,17 @@ SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_correlationIdAt(PyObject *SWIGU blpapi_CorrelationId_t temp2 ; size_t val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_correlationIdAt",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_ResolutionList_correlationIdAt", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_correlationIdAt" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); } arg1 = (blpapi_ResolutionList_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); + ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ResolutionList_correlationIdAt" "', argument " "3"" of type '" "size_t""'"); } @@ -19097,18 +18622,17 @@ SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_topicString(PyObject *SWIGUNUSE char *temp2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_topicString",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_ResolutionList_topicString", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_topicString" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); } arg1 = (blpapi_ResolutionList_t *)(argp1); - res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[1], &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ResolutionList_topicString" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); } @@ -19136,18 +18660,17 @@ SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_topicStringAt(PyObject *SWIGUNU char *temp2 = 0 ; size_t val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_topicStringAt",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_ResolutionList_topicStringAt", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_topicStringAt" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); } arg1 = (blpapi_ResolutionList_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); + ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ResolutionList_topicStringAt" "', argument " "3"" of type '" "size_t""'"); } @@ -19175,18 +18698,17 @@ SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_status(PyObject *SWIGUNUSEDPARM int temp2 ; void *argp3 = 0 ; int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_status",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_ResolutionList_status", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_status" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); } arg1 = (blpapi_ResolutionList_t *)(argp1); - res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[1], &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ResolutionList_status" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); } @@ -19214,18 +18736,17 @@ SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_statusAt(PyObject *SWIGUNUSEDPA int temp2 ; size_t val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_statusAt",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_ResolutionList_statusAt", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_statusAt" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); } arg1 = (blpapi_ResolutionList_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); + ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ResolutionList_statusAt" "', argument " "3"" of type '" "size_t""'"); } @@ -19256,24 +18777,22 @@ SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_attribute(PyObject *SWIGUNUSEDP int res3 = 0 ; void *argp4 = 0 ; int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_ResolutionList_attribute",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_ResolutionList_attribute", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_attribute" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); } arg1 = (blpapi_ResolutionList_t *)(argp1); - res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[1], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ResolutionList_attribute" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); } arg3 = (blpapi_Name_t *)(argp3); - res4 = SWIG_ConvertPtr(obj2, &argp4,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + res4 = SWIG_ConvertPtr(swig_obj[2], &argp4,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_ResolutionList_attribute" "', argument " "4"" of type '" "blpapi_CorrelationId_t const *""'"); } @@ -19304,24 +18823,22 @@ SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_attributeAt(PyObject *SWIGUNUSE int res3 = 0 ; size_t val4 ; int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_ResolutionList_attributeAt",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_ResolutionList_attributeAt", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_attributeAt" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); } arg1 = (blpapi_ResolutionList_t *)(argp1); - res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[1], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ResolutionList_attributeAt" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); } arg3 = (blpapi_Name_t *)(argp3); - ecode4 = SWIG_AsVal_size_t(obj2, &val4); + ecode4 = SWIG_AsVal_size_t(swig_obj[2], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_ResolutionList_attributeAt" "', argument " "4"" of type '" "size_t""'"); } @@ -19349,18 +18866,17 @@ SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_message(PyObject *SWIGUNUSEDPAR blpapi_Message_t *temp2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_message",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_ResolutionList_message", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_message" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); } arg1 = (blpapi_ResolutionList_t *)(argp1); - res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[1], &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ResolutionList_message" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); } @@ -19388,18 +18904,17 @@ SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_messageAt(PyObject *SWIGUNUSEDP blpapi_Message_t *temp2 = 0 ; size_t val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ResolutionList_messageAt",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_ResolutionList_messageAt", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_messageAt" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); } arg1 = (blpapi_ResolutionList_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); + ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ResolutionList_messageAt" "', argument " "3"" of type '" "size_t""'"); } @@ -19422,11 +18937,12 @@ SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_size(PyObject *SWIGUNUSEDPARM(s blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ResolutionList_size",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_size" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); } @@ -19450,12 +18966,13 @@ SWIGINTERN PyObject *_wrap_blpapi_TestUtil_createEvent(PyObject *SWIGUNUSEDPARM( blpapi_Event_t *temp1 = 0 ; int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_TestUtil_createEvent",&obj0)) SWIG_fail; - ecode2 = SWIG_AsVal_int(obj0, &val2); + if (!args) SWIG_fail; + swig_obj[0] = args; + ecode2 = SWIG_AsVal_int(swig_obj[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_TestUtil_createEvent" "', argument " "2"" of type '" "int""'"); } @@ -19484,18 +19001,17 @@ SWIGINTERN PyObject *_wrap_blpapi_TestUtil_deserializeService(PyObject *SWIGUNUS size_t val2 ; int ecode2 = 0 ; blpapi_Service_t *temp3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg3 = &temp3; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TestUtil_deserializeService",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_Python_UnpackTuple(args, "blpapi_TestUtil_deserializeService", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TestUtil_deserializeService" "', argument " "1"" of type '" "char const *""'"); } arg1 = (char *)(buf1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); + ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_TestUtil_deserializeService" "', argument " "2"" of type '" "size_t""'"); } @@ -19525,14 +19041,12 @@ SWIGINTERN PyObject *_wrap_blpapi_TestUtil_serializeService(PyObject *SWIGUNUSED int res2 ; void *argp3 = 0 ; int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_TestUtil_serializeService",&obj0,&obj1,&obj2)) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "blpapi_TestUtil_serializeService", 3, 3, swig_obj)) SWIG_fail; { - res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_blpapi_StreamWriter_t, 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_blpapi_StreamWriter_t, 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TestUtil_serializeService" "', argument " "1"" of type '" "blpapi_StreamWriter_t""'"); } @@ -19542,11 +19056,11 @@ SWIGINTERN PyObject *_wrap_blpapi_TestUtil_serializeService(PyObject *SWIGUNUSED arg1 = *((blpapi_StreamWriter_t *)(argp1)); } } - res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2), 0, 0); + res2 = SWIG_ConvertPtr(swig_obj[1],SWIG_as_voidptrptr(&arg2), 0, 0); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_TestUtil_serializeService" "', argument " "2"" of type '" "void *""'"); } - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_TestUtil_serializeService" "', argument " "3"" of type '" "blpapi_Service_t const *""'"); } @@ -19576,24 +19090,22 @@ SWIGINTERN PyObject *_wrap_blpapi_TestUtil_appendMessage(PyObject *SWIGUNUSEDPAR int res3 = 0 ; void *argp4 = 0 ; int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_TestUtil_appendMessage",&obj0,&obj1,&obj2)) SWIG_fail; - res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_Event, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_TestUtil_appendMessage", 3, 3, swig_obj)) SWIG_fail; + res2 = SWIG_ConvertPtr(swig_obj[0], &argp2,SWIGTYPE_p_blpapi_Event, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_TestUtil_appendMessage" "', argument " "2"" of type '" "blpapi_Event_t *""'"); } arg2 = (blpapi_Event_t *)(argp2); - res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[1], &argp3,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_TestUtil_appendMessage" "', argument " "3"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); } arg3 = (blpapi_SchemaElementDefinition_t *)(argp3); - res4 = SWIG_ConvertPtr(obj2, &argp4,SWIGTYPE_p_blpapi_MessageProperties, 0 | 0 ); + res4 = SWIG_ConvertPtr(swig_obj[2], &argp4,SWIGTYPE_p_blpapi_MessageProperties, 0 | 0 ); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_TestUtil_appendMessage" "', argument " "4"" of type '" "blpapi_MessageProperties_t const *""'"); } @@ -19621,18 +19133,17 @@ SWIGINTERN PyObject *_wrap_blpapi_TestUtil_createTopic(PyObject *SWIGUNUSEDPARM( int res2 = 0 ; int val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TestUtil_createTopic",&obj0,&obj1)) SWIG_fail; - res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_TestUtil_createTopic", 2, 2, swig_obj)) SWIG_fail; + res2 = SWIG_ConvertPtr(swig_obj[0], &argp2,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_TestUtil_createTopic" "', argument " "2"" of type '" "blpapi_Service_t const *""'"); } arg2 = (blpapi_Service_t *)(argp2); - ecode3 = SWIG_AsVal_int(obj1, &val3); + ecode3 = SWIG_AsVal_int(swig_obj[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_TestUtil_createTopic" "', argument " "3"" of type '" "int""'"); } @@ -19657,12 +19168,13 @@ SWIGINTERN PyObject *_wrap_blpapi_TestUtil_getAdminMessageDefinition(PyObject *S blpapi_SchemaElementDefinition_t *temp1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_TestUtil_getAdminMessageDefinition",&obj0)) SWIG_fail; - res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res2 = SWIG_ConvertPtr(swig_obj[0], &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_TestUtil_getAdminMessageDefinition" "', argument " "2"" of type '" "blpapi_Name_t *""'"); } @@ -19687,7 +19199,7 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageProperties_create(PyObject *SWIGUNUSEDP int result; arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)":blpapi_MessageProperties_create")) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageProperties_create", 0, 0, 0)) SWIG_fail; { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)blpapi_MessageProperties_create(arg1); @@ -19706,10 +19218,11 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageProperties_destroy(PyObject *SWIGUNUSED blpapi_MessageProperties_t *arg1 = (blpapi_MessageProperties_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_MessageProperties_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageProperties, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageProperties, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageProperties_destroy" "', argument " "1"" of type '" "blpapi_MessageProperties_t *""'"); } @@ -19733,12 +19246,13 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageProperties_copy(PyObject *SWIGUNUSEDPAR blpapi_MessageProperties_t *temp1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_MessageProperties_copy",&obj0)) SWIG_fail; - res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_blpapi_MessageProperties, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res2 = SWIG_ConvertPtr(swig_obj[0], &argp2,SWIGTYPE_p_blpapi_MessageProperties, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageProperties_copy" "', argument " "2"" of type '" "blpapi_MessageProperties_t const *""'"); } @@ -19764,17 +19278,16 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageProperties_assign(PyObject *SWIGUNUSEDP int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_MessageProperties_assign",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageProperties, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageProperties_assign", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageProperties, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageProperties_assign" "', argument " "1"" of type '" "blpapi_MessageProperties_t *""'"); } arg1 = (blpapi_MessageProperties_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_MessageProperties, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_MessageProperties, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageProperties_assign" "', argument " "2"" of type '" "blpapi_MessageProperties_t const *""'"); } @@ -19798,18 +19311,17 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageProperties_setCorrelationIds(PyObject * size_t arg3 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_MessageProperties_setCorrelationIds",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageProperties, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageProperties_setCorrelationIds", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageProperties, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageProperties_setCorrelationIds" "', argument " "1"" of type '" "blpapi_MessageProperties_t *""'"); } arg1 = (blpapi_MessageProperties_t *)(argp1); { - int sz = PyList_Size(obj1); + int sz = PyList_Size(swig_obj[1]); int res = 0; arg2 = 0; arg3 = sz; @@ -19822,11 +19334,11 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageProperties_setCorrelationIds(PyObject * /* There aren't any perfect solutions for failure to allocate here, */ /* and SWIG also seems to ignore this in its own generated code. */ for(; i < sz; ++i) { - PyObject * thing = PyList_GetItem(obj1, i); + PyObject * thing = PyList_GetItem(swig_obj[1], i); void* argp; res = SWIG_ConvertPtr(thing, &argp, SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); if (!SWIG_IsOK(res)) { - SWIG_exception_fail(SWIG_ArgError(res), "in method '" "blpapi_MessageProperties_setCorrelationIds" "', argument " "2"" of type '" "blpapi_CorrelationId_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res), "Expected a list of blpapi_CorrelationId_t const * as a 2nd argument"); } arg2[i] = *(blpapi_CorrelationId_t*)argp; } @@ -19861,23 +19373,21 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageProperties_setRecapType(PyObject *SWIGU int ecode2 = 0 ; int val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_MessageProperties_setRecapType",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageProperties, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageProperties_setRecapType", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageProperties, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageProperties_setRecapType" "', argument " "1"" of type '" "blpapi_MessageProperties_t *""'"); } arg1 = (blpapi_MessageProperties_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_MessageProperties_setRecapType" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_MessageProperties_setRecapType" "', argument " "3"" of type '" "int""'"); } @@ -19902,17 +19412,16 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageProperties_setTimeReceived(PyObject *SW int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_MessageProperties_setTimeReceived",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageProperties, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageProperties_setTimeReceived", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageProperties, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageProperties_setTimeReceived" "', argument " "1"" of type '" "blpapi_MessageProperties_t *""'"); } arg1 = (blpapi_MessageProperties_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageProperties_setTimeReceived" "', argument " "2"" of type '" "blpapi_HighPrecisionDatetime_t const *""'"); } @@ -19937,17 +19446,16 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageProperties_setService(PyObject *SWIGUNU int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_MessageProperties_setService",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageProperties, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageProperties_setService", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageProperties, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageProperties_setService" "', argument " "1"" of type '" "blpapi_MessageProperties_t *""'"); } arg1 = (blpapi_MessageProperties_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageProperties_setService" "', argument " "2"" of type '" "blpapi_Service_t const *""'"); } @@ -19973,17 +19481,16 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageProperties_setRequestId(PyObject *SWIGU int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_MessageProperties_setRequestId",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_MessageProperties, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageProperties_setRequestId", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageProperties, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageProperties_setRequestId" "', argument " "1"" of type '" "blpapi_MessageProperties_t *""'"); } arg1 = (blpapi_MessageProperties_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageProperties_setRequestId" "', argument " "2"" of type '" "char const *""'"); } @@ -20007,11 +19514,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Topic_create(PyObject *SWIGUNUSEDPARM(self), P blpapi_Topic_t *arg1 = (blpapi_Topic_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; blpapi_Topic_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Topic_create",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Topic_create" "', argument " "1"" of type '" "blpapi_Topic_t *""'"); } @@ -20033,10 +19541,11 @@ SWIGINTERN PyObject *_wrap_blpapi_Topic_destroy(PyObject *SWIGUNUSEDPARM(self), blpapi_Topic_t *arg1 = (blpapi_Topic_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Topic_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Topic_destroy" "', argument " "1"" of type '" "blpapi_Topic_t *""'"); } @@ -20061,17 +19570,16 @@ SWIGINTERN PyObject *_wrap_blpapi_Topic_compare(PyObject *SWIGUNUSEDPARM(self), int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Topic_compare",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_Topic_compare", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Topic_compare" "', argument " "1"" of type '" "blpapi_Topic_t const *""'"); } arg1 = (blpapi_Topic_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Topic_compare" "', argument " "2"" of type '" "blpapi_Topic_t const *""'"); } @@ -20093,11 +19601,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Topic_service(PyObject *SWIGUNUSEDPARM(self), blpapi_Topic_t *arg1 = (blpapi_Topic_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; blpapi_Service_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Topic_service",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Topic_service" "', argument " "1"" of type '" "blpapi_Topic_t const *""'"); } @@ -20119,11 +19628,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Topic_isActive(PyObject *SWIGUNUSEDPARM(self), blpapi_Topic_t *arg1 = (blpapi_Topic_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_Topic_isActive",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Topic_isActive" "', argument " "1"" of type '" "blpapi_Topic_t const *""'"); } @@ -20145,11 +19655,12 @@ SWIGINTERN PyObject *_wrap_blpapi_TopicList_create(PyObject *SWIGUNUSEDPARM(self blpapi_TopicList_t *arg1 = (blpapi_TopicList_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; blpapi_TopicList_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_TopicList_create",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_create" "', argument " "1"" of type '" "blpapi_TopicList_t *""'"); } @@ -20171,10 +19682,11 @@ SWIGINTERN PyObject *_wrap_blpapi_TopicList_destroy(PyObject *SWIGUNUSEDPARM(sel blpapi_TopicList_t *arg1 = (blpapi_TopicList_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_TopicList_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_destroy" "', argument " "1"" of type '" "blpapi_TopicList_t *""'"); } @@ -20203,23 +19715,21 @@ SWIGINTERN PyObject *_wrap_blpapi_TopicList_add(PyObject *SWIGUNUSEDPARM(self), int alloc2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_TopicList_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_TopicList_add", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_add" "', argument " "1"" of type '" "blpapi_TopicList_t *""'"); } arg1 = (blpapi_TopicList_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_TopicList_add" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_TopicList_add" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); } @@ -20249,23 +19759,21 @@ SWIGINTERN PyObject *_wrap_blpapi_TopicList_addFromMessage(PyObject *SWIGUNUSEDP int res2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_TopicList_addFromMessage",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_TopicList_addFromMessage", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_addFromMessage" "', argument " "1"" of type '" "blpapi_TopicList_t *""'"); } arg1 = (blpapi_TopicList_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Message, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_TopicList_addFromMessage" "', argument " "2"" of type '" "blpapi_Message_t const *""'"); } arg2 = (blpapi_Message_t *)(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_TopicList_addFromMessage" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); } @@ -20292,18 +19800,17 @@ SWIGINTERN PyObject *_wrap_blpapi_TopicList_correlationIdAt(PyObject *SWIGUNUSED blpapi_CorrelationId_t temp2 ; size_t val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TopicList_correlationIdAt",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_TopicList_correlationIdAt", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_correlationIdAt" "', argument " "1"" of type '" "blpapi_TopicList_t const *""'"); } arg1 = (blpapi_TopicList_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); + ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_TopicList_correlationIdAt" "', argument " "3"" of type '" "size_t""'"); } @@ -20335,18 +19842,17 @@ SWIGINTERN PyObject *_wrap_blpapi_TopicList_topicString(PyObject *SWIGUNUSEDPARM char *temp2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TopicList_topicString",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_TopicList_topicString", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_topicString" "', argument " "1"" of type '" "blpapi_TopicList_t const *""'"); } arg1 = (blpapi_TopicList_t *)(argp1); - res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[1], &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_TopicList_topicString" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); } @@ -20374,18 +19880,17 @@ SWIGINTERN PyObject *_wrap_blpapi_TopicList_topicStringAt(PyObject *SWIGUNUSEDPA char *temp2 = 0 ; size_t val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TopicList_topicStringAt",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_TopicList_topicStringAt", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_topicStringAt" "', argument " "1"" of type '" "blpapi_TopicList_t const *""'"); } arg1 = (blpapi_TopicList_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); + ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_TopicList_topicStringAt" "', argument " "3"" of type '" "size_t""'"); } @@ -20413,18 +19918,17 @@ SWIGINTERN PyObject *_wrap_blpapi_TopicList_status(PyObject *SWIGUNUSEDPARM(self int temp2 ; void *argp3 = 0 ; int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TopicList_status",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_TopicList_status", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_status" "', argument " "1"" of type '" "blpapi_TopicList_t const *""'"); } arg1 = (blpapi_TopicList_t *)(argp1); - res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[1], &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_TopicList_status" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); } @@ -20452,18 +19956,17 @@ SWIGINTERN PyObject *_wrap_blpapi_TopicList_statusAt(PyObject *SWIGUNUSEDPARM(se int temp2 ; size_t val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TopicList_statusAt",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_TopicList_statusAt", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_statusAt" "', argument " "1"" of type '" "blpapi_TopicList_t const *""'"); } arg1 = (blpapi_TopicList_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); + ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_TopicList_statusAt" "', argument " "3"" of type '" "size_t""'"); } @@ -20491,18 +19994,17 @@ SWIGINTERN PyObject *_wrap_blpapi_TopicList_message(PyObject *SWIGUNUSEDPARM(sel blpapi_Message_t *temp2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TopicList_message",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_TopicList_message", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_message" "', argument " "1"" of type '" "blpapi_TopicList_t const *""'"); } arg1 = (blpapi_TopicList_t *)(argp1); - res3 = SWIG_ConvertPtr(obj1, &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[1], &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_TopicList_message" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); } @@ -20530,18 +20032,17 @@ SWIGINTERN PyObject *_wrap_blpapi_TopicList_messageAt(PyObject *SWIGUNUSEDPARM(s blpapi_Message_t *temp2 = 0 ; size_t val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_TopicList_messageAt",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_TopicList_messageAt", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_messageAt" "', argument " "1"" of type '" "blpapi_TopicList_t const *""'"); } arg1 = (blpapi_TopicList_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(obj1, &val3); + ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_TopicList_messageAt" "', argument " "3"" of type '" "size_t""'"); } @@ -20564,11 +20065,12 @@ SWIGINTERN PyObject *_wrap_blpapi_TopicList_size(PyObject *SWIGUNUSEDPARM(self), blpapi_TopicList_t *arg1 = (blpapi_TopicList_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_TopicList_size",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_size" "', argument " "1"" of type '" "blpapi_TopicList_t const *""'"); } @@ -20596,30 +20098,27 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_create(PyObject *SWIGUNUSEDPAR void *argp3 = 0 ; int res3 = 0 ; int res4 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; + PyObject *swig_obj[4] ; blpapi_ProviderSession_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_ProviderSession_create",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_ProviderSession_create", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_create" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); { - int res = SWIG_ConvertFunctionPtr(obj1, (void**)(&arg2), SWIGTYPE_p_f_p_struct_blpapi_Event_p_struct_blpapi_ProviderSession_p_void__void); + int res = SWIG_ConvertFunctionPtr(swig_obj[1], (void**)(&arg2), SWIGTYPE_p_f_p_struct_blpapi_Event_p_struct_blpapi_ProviderSession_p_void__void); if (!SWIG_IsOK(res)) { SWIG_exception_fail(SWIG_ArgError(res), "in method '" "blpapi_ProviderSession_create" "', argument " "2"" of type '" "blpapi_ProviderEventHandler_t""'"); } } - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_EventDispatcher, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_EventDispatcher, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ProviderSession_create" "', argument " "3"" of type '" "blpapi_EventDispatcher_t *""'"); } arg3 = (blpapi_EventDispatcher_t *)(argp3); - res4 = SWIG_ConvertPtr(obj3,SWIG_as_voidptrptr(&arg4), 0, 0); + res4 = SWIG_ConvertPtr(swig_obj[3],SWIG_as_voidptrptr(&arg4), 0, 0); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_ProviderSession_create" "', argument " "4"" of type '" "void *""'"); } @@ -20640,10 +20139,11 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_destroy(PyObject *SWIGUNUSEDPA blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ProviderSession_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_destroy" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); } @@ -20665,11 +20165,12 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_start(PyObject *SWIGUNUSEDPARM blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ProviderSession_start",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_start" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); } @@ -20691,11 +20192,12 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_startAsync(PyObject *SWIGUNUSE blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ProviderSession_startAsync",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_startAsync" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); } @@ -20717,11 +20219,12 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_stop(PyObject *SWIGUNUSEDPARM( blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ProviderSession_stop",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_stop" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); } @@ -20743,11 +20246,12 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_stopAsync(PyObject *SWIGUNUSED blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ProviderSession_stopAsync",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_stopAsync" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); } @@ -20774,18 +20278,17 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_nextEvent(PyObject *SWIGUNUSED blpapi_Event_t *temp2 = 0 ; unsigned int val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ProviderSession_nextEvent",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_ProviderSession_nextEvent", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_nextEvent" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); } arg1 = (blpapi_ProviderSession_t *)(argp1); - ecode3 = SWIG_AsVal_unsigned_SS_int(obj1, &val3); + ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_nextEvent" "', argument " "3"" of type '" "unsigned int""'"); } @@ -20810,12 +20313,13 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_tryNextEvent(PyObject *SWIGUNU void *argp1 = 0 ; int res1 = 0 ; blpapi_Event_t *temp2 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ProviderSession_tryNextEvent",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_tryNextEvent" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); } @@ -20848,29 +20352,26 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_registerService(PyObject *SWIG int res3 = 0 ; void *argp4 = 0 ; int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; + PyObject *swig_obj[4] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_ProviderSession_registerService",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_ProviderSession_registerService", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_registerService" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); } arg1 = (blpapi_ProviderSession_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_registerService" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ProviderSession_registerService" "', argument " "3"" of type '" "blpapi_Identity_t const *""'"); } arg3 = (blpapi_Identity_t *)(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); + res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_ProviderSession_registerService" "', argument " "4"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); } @@ -20907,35 +20408,31 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_activateSubServiceCodeRange(Py int ecode4 = 0 ; int val5 ; int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; + PyObject *swig_obj[5] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOOO:blpapi_ProviderSession_activateSubServiceCodeRange",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_ProviderSession_activateSubServiceCodeRange", 5, 5, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_activateSubServiceCodeRange" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); } arg1 = (blpapi_ProviderSession_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_activateSubServiceCodeRange" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); - ecode3 = SWIG_AsVal_int(obj2, &val3); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_activateSubServiceCodeRange" "', argument " "3"" of type '" "int""'"); } arg3 = (int)(val3); - ecode4 = SWIG_AsVal_int(obj3, &val4); + ecode4 = SWIG_AsVal_int(swig_obj[3], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_ProviderSession_activateSubServiceCodeRange" "', argument " "4"" of type '" "int""'"); } arg4 = (int)(val4); - ecode5 = SWIG_AsVal_int(obj4, &val5); + ecode5 = SWIG_AsVal_int(swig_obj[4], &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_ProviderSession_activateSubServiceCodeRange" "', argument " "5"" of type '" "int""'"); } @@ -20969,29 +20466,26 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_deactivateSubServiceCodeRange( int ecode3 = 0 ; int val4 ; int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; + PyObject *swig_obj[4] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_ProviderSession_deactivateSubServiceCodeRange",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_ProviderSession_deactivateSubServiceCodeRange", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_deactivateSubServiceCodeRange" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); } arg1 = (blpapi_ProviderSession_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_deactivateSubServiceCodeRange" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); - ecode3 = SWIG_AsVal_int(obj2, &val3); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_deactivateSubServiceCodeRange" "', argument " "3"" of type '" "int""'"); } arg3 = (int)(val3); - ecode4 = SWIG_AsVal_int(obj3, &val4); + ecode4 = SWIG_AsVal_int(swig_obj[3], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_ProviderSession_deactivateSubServiceCodeRange" "', argument " "4"" of type '" "int""'"); } @@ -21028,35 +20522,31 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_registerServiceAsync(PyObject int res4 = 0 ; void *argp5 = 0 ; int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; + PyObject *swig_obj[5] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOOO:blpapi_ProviderSession_registerServiceAsync",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_ProviderSession_registerServiceAsync", 5, 5, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_registerServiceAsync" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); } arg1 = (blpapi_ProviderSession_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_registerServiceAsync" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ProviderSession_registerServiceAsync" "', argument " "3"" of type '" "blpapi_Identity_t const *""'"); } arg3 = (blpapi_Identity_t *)(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); + res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_ProviderSession_registerServiceAsync" "', argument " "4"" of type '" "blpapi_CorrelationId_t *""'"); } arg4 = (blpapi_CorrelationId_t *)(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); + res5 = SWIG_ConvertPtr(swig_obj[4], &argp5,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); if (!SWIG_IsOK(res5)) { SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "blpapi_ProviderSession_registerServiceAsync" "', argument " "5"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); } @@ -21084,17 +20574,16 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_deregisterService(PyObject *SW int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ProviderSession_deregisterService",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_ProviderSession_deregisterService", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_deregisterService" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); } arg1 = (blpapi_ProviderSession_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_deregisterService" "', argument " "2"" of type '" "char const *""'"); } @@ -21127,29 +20616,26 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_resolve(PyObject *SWIGUNUSEDPA int ecode3 = 0 ; void *argp4 = 0 ; int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; + PyObject *swig_obj[4] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_ProviderSession_resolve",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_ProviderSession_resolve", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_resolve" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); } arg1 = (blpapi_ProviderSession_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_resolve" "', argument " "2"" of type '" "blpapi_ResolutionList_t *""'"); } arg2 = (blpapi_ResolutionList_t *)(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_resolve" "', argument " "3"" of type '" "int""'"); } arg3 = (int)(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_ProviderSession_resolve" "', argument " "4"" of type '" "blpapi_Identity_t const *""'"); } @@ -21180,29 +20666,26 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_resolveAsync(PyObject *SWIGUNU int ecode3 = 0 ; void *argp4 = 0 ; int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; + PyObject *swig_obj[4] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_ProviderSession_resolveAsync",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_ProviderSession_resolveAsync", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_resolveAsync" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); } arg1 = (blpapi_ProviderSession_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_resolveAsync" "', argument " "2"" of type '" "blpapi_ResolutionList_t const *""'"); } arg2 = (blpapi_ResolutionList_t *)(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_resolveAsync" "', argument " "3"" of type '" "int""'"); } arg3 = (int)(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_ProviderSession_resolveAsync" "', argument " "4"" of type '" "blpapi_Identity_t const *""'"); } @@ -21233,29 +20716,26 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_createTopics(PyObject *SWIGUNU int ecode3 = 0 ; void *argp4 = 0 ; int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; + PyObject *swig_obj[4] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_ProviderSession_createTopics",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_ProviderSession_createTopics", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_createTopics" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); } arg1 = (blpapi_ProviderSession_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_createTopics" "', argument " "2"" of type '" "blpapi_TopicList_t *""'"); } arg2 = (blpapi_TopicList_t *)(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_createTopics" "', argument " "3"" of type '" "int""'"); } arg3 = (int)(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_ProviderSession_createTopics" "', argument " "4"" of type '" "blpapi_Identity_t const *""'"); } @@ -21286,29 +20766,26 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_createTopicsAsync(PyObject *SW int ecode3 = 0 ; void *argp4 = 0 ; int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; + PyObject *swig_obj[4] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_ProviderSession_createTopicsAsync",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_ProviderSession_createTopicsAsync", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_createTopicsAsync" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); } arg1 = (blpapi_ProviderSession_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_createTopicsAsync" "', argument " "2"" of type '" "blpapi_TopicList_t const *""'"); } arg2 = (blpapi_TopicList_t *)(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_createTopicsAsync" "', argument " "3"" of type '" "int""'"); } arg3 = (int)(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_ProviderSession_createTopicsAsync" "', argument " "4"" of type '" "blpapi_Identity_t const *""'"); } @@ -21335,18 +20812,17 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_getTopic(PyObject *SWIGUNUSEDP void *argp2 = 0 ; int res2 = 0 ; blpapi_Topic_t *temp3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg3 = &temp3; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ProviderSession_getTopic",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_ProviderSession_getTopic", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_getTopic" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); } arg1 = (blpapi_ProviderSession_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Message, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_getTopic" "', argument " "2"" of type '" "blpapi_Message_t const *""'"); } @@ -21374,18 +20850,17 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_createTopic(PyObject *SWIGUNUS void *argp2 = 0 ; int res2 = 0 ; blpapi_Topic_t *temp3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg3 = &temp3; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ProviderSession_createTopic",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_ProviderSession_createTopic", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_createTopic" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); } arg1 = (blpapi_ProviderSession_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Message, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Message, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_createTopic" "', argument " "2"" of type '" "blpapi_Message_t const *""'"); } @@ -21413,18 +20888,17 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_createServiceStatusTopic(PyObj void *argp2 = 0 ; int res2 = 0 ; blpapi_Topic_t *temp3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg3 = &temp3; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ProviderSession_createServiceStatusTopic",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_ProviderSession_createServiceStatusTopic", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_createServiceStatusTopic" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); } arg1 = (blpapi_ProviderSession_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Service, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Service, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_createServiceStatusTopic" "', argument " "2"" of type '" "blpapi_Service_t const *""'"); } @@ -21453,23 +20927,21 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_deleteTopics(PyObject *SWIGUNU int res2 = 0 ; size_t val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_ProviderSession_deleteTopics",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_ProviderSession_deleteTopics", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_deleteTopics" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); } arg1 = (blpapi_ProviderSession_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_p_blpapi_Topic, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_p_blpapi_Topic, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_deleteTopics" "', argument " "2"" of type '" "blpapi_Topic_t const **""'"); } arg2 = (blpapi_Topic_t **)(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); + ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_deleteTopics" "', argument " "3"" of type '" "size_t""'"); } @@ -21501,29 +20973,26 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_terminateSubscriptionsOnTopics int res4 ; char *buf4 = 0 ; int alloc4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; + PyObject *swig_obj[4] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_ProviderSession_terminateSubscriptionsOnTopics",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_ProviderSession_terminateSubscriptionsOnTopics", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_terminateSubscriptionsOnTopics" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); } arg1 = (blpapi_ProviderSession_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_p_blpapi_Topic, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_p_blpapi_Topic, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_terminateSubscriptionsOnTopics" "', argument " "2"" of type '" "blpapi_Topic_t const **""'"); } arg2 = (blpapi_Topic_t **)(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); + ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_terminateSubscriptionsOnTopics" "', argument " "3"" of type '" "size_t""'"); } arg3 = (size_t)(val3); - res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4); + res4 = SWIG_AsCharPtrAndSize(swig_obj[3], &buf4, NULL, &alloc4); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_ProviderSession_terminateSubscriptionsOnTopics" "', argument " "4"" of type '" "char const *""'"); } @@ -21550,17 +21019,16 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_publish(PyObject *SWIGUNUSEDPA int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ProviderSession_publish",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_ProviderSession_publish", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_publish" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); } arg1 = (blpapi_ProviderSession_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Event, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Event, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_publish" "', argument " "2"" of type '" "blpapi_Event_t *""'"); } @@ -21588,23 +21056,21 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_sendResponse(PyObject *SWIGUNU int res2 = 0 ; int val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_ProviderSession_sendResponse",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_ProviderSession_sendResponse", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_sendResponse" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); } arg1 = (blpapi_ProviderSession_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_Event, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Event, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_sendResponse" "', argument " "2"" of type '" "blpapi_Event_t *""'"); } arg2 = (blpapi_Event_t *)(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_sendResponse" "', argument " "3"" of type '" "int""'"); } @@ -21626,11 +21092,12 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_getAbstractSession(PyObject *S blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; blpapi_AbstractSession_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ProviderSession_getAbstractSession",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_getAbstractSession" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); } @@ -21657,18 +21124,17 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_flushPublishedEvents(PyObject int temp2 ; int val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ProviderSession_flushPublishedEvents",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_ProviderSession_flushPublishedEvents", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_flushPublishedEvents" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); } arg1 = (blpapi_ProviderSession_t *)(argp1); - ecode3 = SWIG_AsVal_int(obj1, &val3); + ecode3 = SWIG_AsVal_int(swig_obj[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_flushPublishedEvents" "', argument " "3"" of type '" "int""'"); } @@ -21690,7 +21156,7 @@ SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_create(PyObject *SW PyObject *resultobj = 0; blpapi_ServiceRegistrationOptions_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)":blpapi_ServiceRegistrationOptions_create")) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "blpapi_ServiceRegistrationOptions_create", 0, 0, 0)) SWIG_fail; { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (blpapi_ServiceRegistrationOptions_t *)blpapi_ServiceRegistrationOptions_create(); @@ -21708,11 +21174,12 @@ SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_duplicate(PyObject blpapi_ServiceRegistrationOptions_t *arg1 = (blpapi_ServiceRegistrationOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; blpapi_ServiceRegistrationOptions_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ServiceRegistrationOptions_duplicate",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_duplicate" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t const *""'"); } @@ -21734,10 +21201,11 @@ SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_destroy(PyObject *S blpapi_ServiceRegistrationOptions_t *arg1 = (blpapi_ServiceRegistrationOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ServiceRegistrationOptions_destroy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_destroy" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); } @@ -21762,16 +21230,15 @@ SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_copy(PyObject *SWIG int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ServiceRegistrationOptions_copy",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_ServiceRegistrationOptions_copy", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_copy" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); } arg1 = (blpapi_ServiceRegistrationOptions_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ServiceRegistrationOptions_copy" "', argument " "2"" of type '" "blpapi_ServiceRegistrationOptions_t const *""'"); } @@ -21802,29 +21269,26 @@ SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_addActiveSubService int ecode3 = 0 ; int val4 ; int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; + PyObject *swig_obj[4] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOOO:blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); } arg1 = (blpapi_ServiceRegistrationOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange" "', argument " "3"" of type '" "int""'"); } arg3 = (int)(val3); - ecode4 = SWIG_AsVal_int(obj3, &val4); + ecode4 = SWIG_AsVal_int(swig_obj[3], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange" "', argument " "4"" of type '" "int""'"); } @@ -21846,10 +21310,11 @@ SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_removeAllActiveSubS blpapi_ServiceRegistrationOptions_t *arg1 = (blpapi_ServiceRegistrationOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); } @@ -21874,29 +21339,28 @@ SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_setGroupId(PyObject void *argp1 = 0 ; int res1 = 0 ; PyObject *asAscii2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ServiceRegistrationOptions_setGroupId",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_ServiceRegistrationOptions_setGroupId", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_setGroupId" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); } arg1 = (blpapi_ServiceRegistrationOptions_t *)(argp1); { - if (obj1 == Py_None) { + if (swig_obj[1] == Py_None) { arg2 = 0; arg3 = 0; } else { - if(PyUnicode_Check(obj1)) { - asAscii2 = PyUnicode_AsASCIIString(obj1); + if(PyUnicode_Check(swig_obj[1])) { + asAscii2 = PyUnicode_AsASCIIString(swig_obj[1]); arg2 = PyString_AsString(asAscii2); arg3 = PyString_Size(asAscii2); } else { - arg2 = PyString_AsString(obj1); - arg3 = PyString_Size(obj1); + arg2 = PyString_AsString(swig_obj[1]); + arg3 = PyString_Size(swig_obj[1]); } } } @@ -21935,17 +21399,16 @@ SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_setServicePriority( int res1 = 0 ; int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ServiceRegistrationOptions_setServicePriority",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_ServiceRegistrationOptions_setServicePriority", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_setServicePriority" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); } arg1 = (blpapi_ServiceRegistrationOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_ServiceRegistrationOptions_setServicePriority" "', argument " "2"" of type '" "int""'"); } @@ -21970,16 +21433,15 @@ SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_setPartsToRegister( int res1 = 0 ; int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_ServiceRegistrationOptions_setPartsToRegister",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_ServiceRegistrationOptions_setPartsToRegister", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_setPartsToRegister" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); } arg1 = (blpapi_ServiceRegistrationOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_ServiceRegistrationOptions_setPartsToRegister" "', argument " "2"" of type '" "int""'"); } @@ -22005,13 +21467,14 @@ SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_getGroupId(PyObject int res1 = 0 ; char temp2[MAX_GROUP_ID_SIZE] ; int len2 = MAX_GROUP_ID_SIZE ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; arg2 = temp2; arg3 = &len2; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ServiceRegistrationOptions_getGroupId",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_getGroupId" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); } @@ -22036,11 +21499,12 @@ SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_getServicePriority( blpapi_ServiceRegistrationOptions_t *arg1 = (blpapi_ServiceRegistrationOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ServiceRegistrationOptions_getServicePriority",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_getServicePriority" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); } @@ -22062,11 +21526,12 @@ SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_getPartsToRegister( blpapi_ServiceRegistrationOptions_t *arg1 = (blpapi_ServiceRegistrationOptions_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:blpapi_ServiceRegistrationOptions_getPartsToRegister",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_getPartsToRegister" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); } @@ -22094,23 +21559,21 @@ SWIGINTERN PyObject *_wrap_blpapi_ZfpUtil_getOptionsForLeasedLines(PyObject *SWI int res2 = 0 ; int val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:blpapi_ZfpUtil_getOptionsForLeasedLines",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "blpapi_ZfpUtil_getOptionsForLeasedLines", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ZfpUtil_getOptionsForLeasedLines" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ZfpUtil_getOptionsForLeasedLines" "', argument " "2"" of type '" "blpapi_TlsOptions_t const *""'"); } arg2 = (blpapi_TlsOptions_t *)(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ZfpUtil_getOptionsForLeasedLines" "', argument " "3"" of type '" "int""'"); } @@ -22128,40 +21591,41 @@ SWIGINTERN PyObject *_wrap_blpapi_ZfpUtil_getOptionsForLeasedLines(PyObject *SWI static PyMethodDef SwigMethods[] = { - { (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL}, - { (char *)"setLoggerCallbackWrapper", _wrap_setLoggerCallbackWrapper, METH_VARARGS, NULL}, - { (char *)"blpapi_HighPrecisionDatetime_fromTimePoint_wrapper", _wrap_blpapi_HighPrecisionDatetime_fromTimePoint_wrapper, METH_VARARGS, NULL}, - { (char *)"blpapi_Logging_registerCallback", _wrap_blpapi_Logging_registerCallback, METH_VARARGS, NULL}, - { (char *)"blpapi_Logging_logTestMessage", _wrap_blpapi_Logging_logTestMessage, METH_VARARGS, NULL}, - { (char *)"blpapi_DiagnosticsUtil_memoryInfo_wrapper", _wrap_blpapi_DiagnosticsUtil_memoryInfo_wrapper, METH_VARARGS, NULL}, - { (char *)"blpapi_EventDispatcher_stop", _wrap_blpapi_EventDispatcher_stop, METH_VARARGS, NULL}, - { (char *)"blpapi_Service_printHelper", _wrap_blpapi_Service_printHelper, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaElementDefinition_printHelper", _wrap_blpapi_SchemaElementDefinition_printHelper, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaTypeDefinition_printHelper", _wrap_blpapi_SchemaTypeDefinition_printHelper, METH_VARARGS, NULL}, - { (char *)"blpapi_Message_printHelper", _wrap_blpapi_Message_printHelper, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_printHelper", _wrap_blpapi_SessionOptions_printHelper, METH_VARARGS, NULL}, - { (char *)"blpapi_TestUtil_serializeServiceHelper", _wrap_blpapi_TestUtil_serializeServiceHelper, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaTypeDefinition_hasElementDefinition", _wrap_blpapi_SchemaTypeDefinition_hasElementDefinition, METH_VARARGS, NULL}, - { (char *)"blpapi_ConstantList_hasConstant", _wrap_blpapi_ConstantList_hasConstant, METH_VARARGS, NULL}, - { (char *)"blpapi_Service_hasEventDefinition", _wrap_blpapi_Service_hasEventDefinition, METH_VARARGS, NULL}, - { (char *)"blpapi_Service_hasOperation", _wrap_blpapi_Service_hasOperation, METH_VARARGS, NULL}, - { (char *)"blpapi_SubscriptionList_addHelper", _wrap_blpapi_SubscriptionList_addHelper, METH_VARARGS, NULL}, - { (char *)"blpapi_Name_hasName", _wrap_blpapi_Name_hasName, METH_VARARGS, NULL}, - { (char *)"blpapi_TopicList_createFromResolutionList", _wrap_blpapi_TopicList_createFromResolutionList, METH_VARARGS, NULL}, - { (char *)"new_intArray", _wrap_new_intArray, METH_VARARGS, NULL}, - { (char *)"delete_intArray", _wrap_delete_intArray, METH_VARARGS, NULL}, - { (char *)"intArray___getitem__", _wrap_intArray___getitem__, METH_VARARGS, NULL}, - { (char *)"intArray___setitem__", _wrap_intArray___setitem__, METH_VARARGS, NULL}, - { (char *)"intArray_cast", _wrap_intArray_cast, METH_VARARGS, NULL}, - { (char *)"intArray_frompointer", _wrap_intArray_frompointer, METH_VARARGS, NULL}, - { (char *)"intArray_swigregister", intArray_swigregister, METH_VARARGS, NULL}, - { (char *)"new_topicPtrArray", _wrap_new_topicPtrArray, METH_VARARGS, NULL}, - { (char *)"delete_topicPtrArray", _wrap_delete_topicPtrArray, METH_VARARGS, NULL}, - { (char *)"topicPtrArray_getitem", _wrap_topicPtrArray_getitem, METH_VARARGS, NULL}, - { (char *)"topicPtrArray_setitem", _wrap_topicPtrArray_setitem, METH_VARARGS, NULL}, - { (char *)"CorrelationId_t_equals", _wrap_CorrelationId_t_equals, METH_VARARGS, NULL}, - { (char *)"CorrelationId_value_get", _wrap_CorrelationId_value_get, METH_VARARGS, NULL}, - { (char *)"new_CorrelationId", _wrap_new_CorrelationId, METH_VARARGS, (char *)"\n" + { "SWIG_PyInstanceMethod_New", SWIG_PyInstanceMethod_New, METH_O, NULL}, + { "setLoggerCallbackWrapper", _wrap_setLoggerCallbackWrapper, METH_VARARGS, NULL}, + { "blpapi_HighPrecisionDatetime_fromTimePoint_wrapper", _wrap_blpapi_HighPrecisionDatetime_fromTimePoint_wrapper, METH_O, NULL}, + { "blpapi_Logging_registerCallback", _wrap_blpapi_Logging_registerCallback, METH_VARARGS, NULL}, + { "blpapi_Logging_logTestMessage", _wrap_blpapi_Logging_logTestMessage, METH_O, NULL}, + { "blpapi_DiagnosticsUtil_memoryInfo_wrapper", _wrap_blpapi_DiagnosticsUtil_memoryInfo_wrapper, METH_NOARGS, NULL}, + { "blpapi_EventDispatcher_stop", _wrap_blpapi_EventDispatcher_stop, METH_VARARGS, NULL}, + { "blpapi_Service_printHelper", _wrap_blpapi_Service_printHelper, METH_VARARGS, NULL}, + { "blpapi_SchemaElementDefinition_printHelper", _wrap_blpapi_SchemaElementDefinition_printHelper, METH_VARARGS, NULL}, + { "blpapi_SchemaTypeDefinition_printHelper", _wrap_blpapi_SchemaTypeDefinition_printHelper, METH_VARARGS, NULL}, + { "blpapi_Message_printHelper", _wrap_blpapi_Message_printHelper, METH_VARARGS, NULL}, + { "blpapi_SessionOptions_printHelper", _wrap_blpapi_SessionOptions_printHelper, METH_VARARGS, NULL}, + { "blpapi_TestUtil_serializeServiceHelper", _wrap_blpapi_TestUtil_serializeServiceHelper, METH_O, NULL}, + { "blpapi_SchemaTypeDefinition_hasElementDefinition", _wrap_blpapi_SchemaTypeDefinition_hasElementDefinition, METH_VARARGS, NULL}, + { "blpapi_ConstantList_hasConstant", _wrap_blpapi_ConstantList_hasConstant, METH_VARARGS, NULL}, + { "blpapi_Service_hasEventDefinition", _wrap_blpapi_Service_hasEventDefinition, METH_VARARGS, NULL}, + { "blpapi_Service_hasOperation", _wrap_blpapi_Service_hasOperation, METH_VARARGS, NULL}, + { "blpapi_SubscriptionList_addHelper", _wrap_blpapi_SubscriptionList_addHelper, METH_VARARGS, NULL}, + { "blpapi_Name_hasName", _wrap_blpapi_Name_hasName, METH_O, NULL}, + { "blpapi_TopicList_createFromResolutionList", _wrap_blpapi_TopicList_createFromResolutionList, METH_O, NULL}, + { "new_intArray", _wrap_new_intArray, METH_O, NULL}, + { "delete_intArray", _wrap_delete_intArray, METH_O, NULL}, + { "intArray___getitem__", _wrap_intArray___getitem__, METH_VARARGS, NULL}, + { "intArray___setitem__", _wrap_intArray___setitem__, METH_VARARGS, NULL}, + { "intArray_cast", _wrap_intArray_cast, METH_O, NULL}, + { "intArray_frompointer", _wrap_intArray_frompointer, METH_O, NULL}, + { "intArray_swigregister", intArray_swigregister, METH_O, NULL}, + { "intArray_swiginit", intArray_swiginit, METH_VARARGS, NULL}, + { "new_topicPtrArray", _wrap_new_topicPtrArray, METH_O, NULL}, + { "delete_topicPtrArray", _wrap_delete_topicPtrArray, METH_O, NULL}, + { "topicPtrArray_getitem", _wrap_topicPtrArray_getitem, METH_VARARGS, NULL}, + { "topicPtrArray_setitem", _wrap_topicPtrArray_setitem, METH_VARARGS, NULL}, + { "CorrelationId_t_equals", _wrap_CorrelationId_t_equals, METH_VARARGS, NULL}, + { "CorrelationId_value_get", _wrap_CorrelationId_value_get, METH_O, NULL}, + { "new_CorrelationId", _wrap_new_CorrelationId, METH_VARARGS, "\n" "``CorrelationId([value[, classId=0]])`` constructs a :class:`CorrelationId`\n" "object.\n" "\n" @@ -22173,472 +21637,481 @@ static PyMethodDef SwigMethods[] = { "\n" "The maximum allowed ``classId`` value is :attr:`MAX_CLASS_ID`.\n" ""}, - { (char *)"delete_CorrelationId", _wrap_delete_CorrelationId, METH_VARARGS, NULL}, - { (char *)"CorrelationId_type", _wrap_CorrelationId_type, METH_VARARGS, (char *)"\n" + { "delete_CorrelationId", _wrap_delete_CorrelationId, METH_O, NULL}, + { "CorrelationId_type", _wrap_CorrelationId_type, METH_O, "\n" "Returns:\n" " int: The type of this CorrelationId object (see the ``xxx_TYPE`` class\n" " attributes)\n" ""}, - { (char *)"CorrelationId_classId", _wrap_CorrelationId_classId, METH_VARARGS, (char *)"\n" + { "CorrelationId_classId", _wrap_CorrelationId_classId, METH_O, "\n" "Returns:\n" " int: The user defined classification of this :class:`CorrelationId`\n" " object\n" ""}, - { (char *)"CorrelationId___asObject", _wrap_CorrelationId___asObject, METH_VARARGS, NULL}, - { (char *)"CorrelationId___asInteger", _wrap_CorrelationId___asInteger, METH_VARARGS, NULL}, - { (char *)"CorrelationId___toInteger", _wrap_CorrelationId___toInteger, METH_VARARGS, NULL}, - { (char *)"CorrelationId_swigregister", CorrelationId_swigregister, METH_VARARGS, NULL}, - { (char *)"new_blpapi_CorrelationId_t__value", _wrap_new_blpapi_CorrelationId_t__value, METH_VARARGS, NULL}, - { (char *)"delete_blpapi_CorrelationId_t__value", _wrap_delete_blpapi_CorrelationId_t__value, METH_VARARGS, NULL}, - { (char *)"blpapi_CorrelationId_t__value_swigregister", blpapi_CorrelationId_t__value_swigregister, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_setElementFloat", _wrap_blpapi_Element_setElementFloat, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_setValueFloat", _wrap_blpapi_Element_setValueFloat, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_printHelper", _wrap_blpapi_Element_printHelper, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_name", _wrap_blpapi_Element_name, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_nameString", _wrap_blpapi_Element_nameString, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_definition", _wrap_blpapi_Element_definition, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_datatype", _wrap_blpapi_Element_datatype, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_isComplexType", _wrap_blpapi_Element_isComplexType, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_isArray", _wrap_blpapi_Element_isArray, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_isReadOnly", _wrap_blpapi_Element_isReadOnly, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_numValues", _wrap_blpapi_Element_numValues, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_numElements", _wrap_blpapi_Element_numElements, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_isNullValue", _wrap_blpapi_Element_isNullValue, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_isNull", _wrap_blpapi_Element_isNull, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_getElementAt", _wrap_blpapi_Element_getElementAt, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_getElement", _wrap_blpapi_Element_getElement, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_hasElementEx", _wrap_blpapi_Element_hasElementEx, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_getValueAsBool", _wrap_blpapi_Element_getValueAsBool, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_getValueAsChar", _wrap_blpapi_Element_getValueAsChar, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_getValueAsInt32", _wrap_blpapi_Element_getValueAsInt32, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_getValueAsInt64", _wrap_blpapi_Element_getValueAsInt64, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_getValueAsFloat64", _wrap_blpapi_Element_getValueAsFloat64, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_getValueAsString", _wrap_blpapi_Element_getValueAsString, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_getValueAsDatetime", _wrap_blpapi_Element_getValueAsDatetime, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_getValueAsHighPrecisionDatetime", _wrap_blpapi_Element_getValueAsHighPrecisionDatetime, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_getValueAsElement", _wrap_blpapi_Element_getValueAsElement, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_getValueAsName", _wrap_blpapi_Element_getValueAsName, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_getChoice", _wrap_blpapi_Element_getChoice, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_setValueBool", _wrap_blpapi_Element_setValueBool, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_setValueInt32", _wrap_blpapi_Element_setValueInt32, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_setValueInt64", _wrap_blpapi_Element_setValueInt64, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_setValueString", _wrap_blpapi_Element_setValueString, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_setValueHighPrecisionDatetime", _wrap_blpapi_Element_setValueHighPrecisionDatetime, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_setValueFromName", _wrap_blpapi_Element_setValueFromName, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_setElementBool", _wrap_blpapi_Element_setElementBool, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_setElementInt32", _wrap_blpapi_Element_setElementInt32, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_setElementInt64", _wrap_blpapi_Element_setElementInt64, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_setElementString", _wrap_blpapi_Element_setElementString, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_setElementHighPrecisionDatetime", _wrap_blpapi_Element_setElementHighPrecisionDatetime, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_setElementFromName", _wrap_blpapi_Element_setElementFromName, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_appendElement", _wrap_blpapi_Element_appendElement, METH_VARARGS, NULL}, - { (char *)"blpapi_Element_setChoice", _wrap_blpapi_Element_setChoice, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_setValueFloat", _wrap_blpapi_EventFormatter_setValueFloat, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_appendValueFloat", _wrap_blpapi_EventFormatter_appendValueFloat, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_create", _wrap_blpapi_EventFormatter_create, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_destroy", _wrap_blpapi_EventFormatter_destroy, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_appendMessage", _wrap_blpapi_EventFormatter_appendMessage, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_appendMessageSeq", _wrap_blpapi_EventFormatter_appendMessageSeq, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_appendResponse", _wrap_blpapi_EventFormatter_appendResponse, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_appendRecapMessage", _wrap_blpapi_EventFormatter_appendRecapMessage, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_appendRecapMessageSeq", _wrap_blpapi_EventFormatter_appendRecapMessageSeq, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_appendFragmentedRecapMessage", _wrap_blpapi_EventFormatter_appendFragmentedRecapMessage, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_appendFragmentedRecapMessageSeq", _wrap_blpapi_EventFormatter_appendFragmentedRecapMessageSeq, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_setValueBool", _wrap_blpapi_EventFormatter_setValueBool, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_setValueChar", _wrap_blpapi_EventFormatter_setValueChar, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_setValueInt32", _wrap_blpapi_EventFormatter_setValueInt32, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_setValueInt64", _wrap_blpapi_EventFormatter_setValueInt64, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_setValueHighPrecisionDatetime", _wrap_blpapi_EventFormatter_setValueHighPrecisionDatetime, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_setValueString", _wrap_blpapi_EventFormatter_setValueString, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_setValueFromName", _wrap_blpapi_EventFormatter_setValueFromName, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_setValueNull", _wrap_blpapi_EventFormatter_setValueNull, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_pushElement", _wrap_blpapi_EventFormatter_pushElement, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_popElement", _wrap_blpapi_EventFormatter_popElement, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_appendValueBool", _wrap_blpapi_EventFormatter_appendValueBool, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_appendValueChar", _wrap_blpapi_EventFormatter_appendValueChar, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_appendValueInt32", _wrap_blpapi_EventFormatter_appendValueInt32, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_appendValueInt64", _wrap_blpapi_EventFormatter_appendValueInt64, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_appendValueHighPrecisionDatetime", _wrap_blpapi_EventFormatter_appendValueHighPrecisionDatetime, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_appendValueString", _wrap_blpapi_EventFormatter_appendValueString, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_appendValueFromName", _wrap_blpapi_EventFormatter_appendValueFromName, METH_VARARGS, NULL}, - { (char *)"blpapi_EventFormatter_appendElement", _wrap_blpapi_EventFormatter_appendElement, METH_VARARGS, NULL}, - { (char *)"Session_createHelper", _wrap_Session_createHelper, METH_VARARGS, NULL}, - { (char *)"Session_destroyHelper", _wrap_Session_destroyHelper, METH_VARARGS, NULL}, - { (char *)"blpapi_EventDispatcher_create", _wrap_blpapi_EventDispatcher_create, METH_VARARGS, NULL}, - { (char *)"blpapi_EventDispatcher_destroy", _wrap_blpapi_EventDispatcher_destroy, METH_VARARGS, NULL}, - { (char *)"blpapi_EventDispatcher_start", _wrap_blpapi_EventDispatcher_start, METH_VARARGS, NULL}, - { (char *)"ProviderSession_createHelper", _wrap_ProviderSession_createHelper, METH_VARARGS, NULL}, - { (char *)"ProviderSession_destroyHelper", _wrap_ProviderSession_destroyHelper, METH_VARARGS, NULL}, - { (char *)"ProviderSession_terminateSubscriptionsOnTopic", _wrap_ProviderSession_terminateSubscriptionsOnTopic, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageFormatter_setValueFloat", _wrap_blpapi_MessageFormatter_setValueFloat, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageFormatter_appendValueFloat", _wrap_blpapi_MessageFormatter_appendValueFloat, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageFormatter_setValueBool", _wrap_blpapi_MessageFormatter_setValueBool, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageFormatter_setValueChar", _wrap_blpapi_MessageFormatter_setValueChar, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageFormatter_setValueInt32", _wrap_blpapi_MessageFormatter_setValueInt32, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageFormatter_setValueInt64", _wrap_blpapi_MessageFormatter_setValueInt64, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageFormatter_setValueFloat32", _wrap_blpapi_MessageFormatter_setValueFloat32, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageFormatter_setValueFloat64", _wrap_blpapi_MessageFormatter_setValueFloat64, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageFormatter_setValueDatetime", _wrap_blpapi_MessageFormatter_setValueDatetime, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageFormatter_setValueHighPrecisionDatetime", _wrap_blpapi_MessageFormatter_setValueHighPrecisionDatetime, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageFormatter_setValueString", _wrap_blpapi_MessageFormatter_setValueString, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageFormatter_setValueFromName", _wrap_blpapi_MessageFormatter_setValueFromName, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageFormatter_setValueNull", _wrap_blpapi_MessageFormatter_setValueNull, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageFormatter_pushElement", _wrap_blpapi_MessageFormatter_pushElement, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageFormatter_popElement", _wrap_blpapi_MessageFormatter_popElement, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageFormatter_appendValueBool", _wrap_blpapi_MessageFormatter_appendValueBool, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageFormatter_appendValueChar", _wrap_blpapi_MessageFormatter_appendValueChar, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageFormatter_appendValueInt32", _wrap_blpapi_MessageFormatter_appendValueInt32, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageFormatter_appendValueInt64", _wrap_blpapi_MessageFormatter_appendValueInt64, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageFormatter_appendValueFloat32", _wrap_blpapi_MessageFormatter_appendValueFloat32, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageFormatter_appendValueFloat64", _wrap_blpapi_MessageFormatter_appendValueFloat64, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageFormatter_appendValueDatetime", _wrap_blpapi_MessageFormatter_appendValueDatetime, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageFormatter_appendValueHighPrecisionDatetime", _wrap_blpapi_MessageFormatter_appendValueHighPrecisionDatetime, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageFormatter_appendValueString", _wrap_blpapi_MessageFormatter_appendValueString, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageFormatter_appendValueFromName", _wrap_blpapi_MessageFormatter_appendValueFromName, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageFormatter_appendElement", _wrap_blpapi_MessageFormatter_appendElement, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageFormatter_FormatMessageJson", _wrap_blpapi_MessageFormatter_FormatMessageJson, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageFormatter_FormatMessageXml", _wrap_blpapi_MessageFormatter_FormatMessageXml, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageFormatter_copy", _wrap_blpapi_MessageFormatter_copy, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageFormatter_assign", _wrap_blpapi_MessageFormatter_assign, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageFormatter_destroy", _wrap_blpapi_MessageFormatter_destroy, METH_VARARGS, NULL}, - { (char *)"blpapi_AuthOptions_create_default", _wrap_blpapi_AuthOptions_create_default, METH_VARARGS, NULL}, - { (char *)"blpapi_AuthOptions_create_forUserMode", _wrap_blpapi_AuthOptions_create_forUserMode, METH_VARARGS, NULL}, - { (char *)"blpapi_AuthOptions_create_forAppMode", _wrap_blpapi_AuthOptions_create_forAppMode, METH_VARARGS, NULL}, - { (char *)"blpapi_AuthOptions_create_forUserAndAppMode", _wrap_blpapi_AuthOptions_create_forUserAndAppMode, METH_VARARGS, NULL}, - { (char *)"blpapi_AuthOptions_create_forToken", _wrap_blpapi_AuthOptions_create_forToken, METH_VARARGS, NULL}, - { (char *)"blpapi_AuthOptions_duplicate", _wrap_blpapi_AuthOptions_duplicate, METH_VARARGS, NULL}, - { (char *)"blpapi_AuthOptions_copy", _wrap_blpapi_AuthOptions_copy, METH_VARARGS, NULL}, - { (char *)"blpapi_AuthOptions_destroy", _wrap_blpapi_AuthOptions_destroy, METH_VARARGS, NULL}, - { (char *)"blpapi_AuthUser_createWithLogonName", _wrap_blpapi_AuthUser_createWithLogonName, METH_VARARGS, NULL}, - { (char *)"blpapi_AuthUser_createWithActiveDirectoryProperty", _wrap_blpapi_AuthUser_createWithActiveDirectoryProperty, METH_VARARGS, NULL}, - { (char *)"blpapi_AuthUser_createWithManualOptions", _wrap_blpapi_AuthUser_createWithManualOptions, METH_VARARGS, NULL}, - { (char *)"blpapi_AuthUser_duplicate", _wrap_blpapi_AuthUser_duplicate, METH_VARARGS, NULL}, - { (char *)"blpapi_AuthUser_copy", _wrap_blpapi_AuthUser_copy, METH_VARARGS, NULL}, - { (char *)"blpapi_AuthUser_destroy", _wrap_blpapi_AuthUser_destroy, METH_VARARGS, NULL}, - { (char *)"blpapi_AuthApplication_create", _wrap_blpapi_AuthApplication_create, METH_VARARGS, NULL}, - { (char *)"blpapi_AuthApplication_duplicate", _wrap_blpapi_AuthApplication_duplicate, METH_VARARGS, NULL}, - { (char *)"blpapi_AuthApplication_copy", _wrap_blpapi_AuthApplication_copy, METH_VARARGS, NULL}, - { (char *)"blpapi_AuthApplication_destroy", _wrap_blpapi_AuthApplication_destroy, METH_VARARGS, NULL}, - { (char *)"blpapi_AuthToken_create", _wrap_blpapi_AuthToken_create, METH_VARARGS, NULL}, - { (char *)"blpapi_AuthToken_duplicate", _wrap_blpapi_AuthToken_duplicate, METH_VARARGS, NULL}, - { (char *)"blpapi_AuthToken_copy", _wrap_blpapi_AuthToken_copy, METH_VARARGS, NULL}, - { (char *)"blpapi_AuthToken_destroy", _wrap_blpapi_AuthToken_destroy, METH_VARARGS, NULL}, - { (char *)"blpapi_getLastErrorDescription", _wrap_blpapi_getLastErrorDescription, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_create", _wrap_blpapi_SessionOptions_create, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_destroy", _wrap_blpapi_SessionOptions_destroy, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setServerHost", _wrap_blpapi_SessionOptions_setServerHost, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setServerPort", _wrap_blpapi_SessionOptions_setServerPort, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setServerAddress", _wrap_blpapi_SessionOptions_setServerAddress, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_removeServerAddress", _wrap_blpapi_SessionOptions_removeServerAddress, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setConnectTimeout", _wrap_blpapi_SessionOptions_setConnectTimeout, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setDefaultServices", _wrap_blpapi_SessionOptions_setDefaultServices, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setDefaultSubscriptionService", _wrap_blpapi_SessionOptions_setDefaultSubscriptionService, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setDefaultTopicPrefix", _wrap_blpapi_SessionOptions_setDefaultTopicPrefix, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg", _wrap_blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setClientMode", _wrap_blpapi_SessionOptions_setClientMode, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setMaxPendingRequests", _wrap_blpapi_SessionOptions_setMaxPendingRequests, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setAutoRestartOnDisconnection", _wrap_blpapi_SessionOptions_setAutoRestartOnDisconnection, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setSessionIdentityOptions", _wrap_blpapi_SessionOptions_setSessionIdentityOptions, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setAuthenticationOptions", _wrap_blpapi_SessionOptions_setAuthenticationOptions, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setNumStartAttempts", _wrap_blpapi_SessionOptions_setNumStartAttempts, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setMaxEventQueueSize", _wrap_blpapi_SessionOptions_setMaxEventQueueSize, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark", _wrap_blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark", _wrap_blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setDefaultKeepAliveInactivityTime", _wrap_blpapi_SessionOptions_setDefaultKeepAliveInactivityTime, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout", _wrap_blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setKeepAliveEnabled", _wrap_blpapi_SessionOptions_setKeepAliveEnabled, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes", _wrap_blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setServiceCheckTimeout", _wrap_blpapi_SessionOptions_setServiceCheckTimeout, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setServiceDownloadTimeout", _wrap_blpapi_SessionOptions_setServiceDownloadTimeout, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setTlsOptions", _wrap_blpapi_SessionOptions_setTlsOptions, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setFlushPublishedEventsTimeout", _wrap_blpapi_SessionOptions_setFlushPublishedEventsTimeout, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_setBandwidthSaveModeDisabled", _wrap_blpapi_SessionOptions_setBandwidthSaveModeDisabled, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_serverHost", _wrap_blpapi_SessionOptions_serverHost, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_serverPort", _wrap_blpapi_SessionOptions_serverPort, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_numServerAddresses", _wrap_blpapi_SessionOptions_numServerAddresses, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_getServerAddress", _wrap_blpapi_SessionOptions_getServerAddress, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_connectTimeout", _wrap_blpapi_SessionOptions_connectTimeout, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_defaultServices", _wrap_blpapi_SessionOptions_defaultServices, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_defaultSubscriptionService", _wrap_blpapi_SessionOptions_defaultSubscriptionService, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_defaultTopicPrefix", _wrap_blpapi_SessionOptions_defaultTopicPrefix, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg", _wrap_blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_clientMode", _wrap_blpapi_SessionOptions_clientMode, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_maxPendingRequests", _wrap_blpapi_SessionOptions_maxPendingRequests, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_autoRestartOnDisconnection", _wrap_blpapi_SessionOptions_autoRestartOnDisconnection, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_authenticationOptions", _wrap_blpapi_SessionOptions_authenticationOptions, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_numStartAttempts", _wrap_blpapi_SessionOptions_numStartAttempts, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_maxEventQueueSize", _wrap_blpapi_SessionOptions_maxEventQueueSize, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_slowConsumerWarningHiWaterMark", _wrap_blpapi_SessionOptions_slowConsumerWarningHiWaterMark, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_slowConsumerWarningLoWaterMark", _wrap_blpapi_SessionOptions_slowConsumerWarningLoWaterMark, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_defaultKeepAliveInactivityTime", _wrap_blpapi_SessionOptions_defaultKeepAliveInactivityTime, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_defaultKeepAliveResponseTimeout", _wrap_blpapi_SessionOptions_defaultKeepAliveResponseTimeout, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_keepAliveEnabled", _wrap_blpapi_SessionOptions_keepAliveEnabled, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_recordSubscriptionDataReceiveTimes", _wrap_blpapi_SessionOptions_recordSubscriptionDataReceiveTimes, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_serviceCheckTimeout", _wrap_blpapi_SessionOptions_serviceCheckTimeout, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_serviceDownloadTimeout", _wrap_blpapi_SessionOptions_serviceDownloadTimeout, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_flushPublishedEventsTimeout", _wrap_blpapi_SessionOptions_flushPublishedEventsTimeout, METH_VARARGS, NULL}, - { (char *)"blpapi_SessionOptions_bandwidthSaveModeDisabled", _wrap_blpapi_SessionOptions_bandwidthSaveModeDisabled, METH_VARARGS, NULL}, - { (char *)"blpapi_TlsOptions_destroy", _wrap_blpapi_TlsOptions_destroy, METH_VARARGS, NULL}, - { (char *)"blpapi_TlsOptions_createFromFiles", _wrap_blpapi_TlsOptions_createFromFiles, METH_VARARGS, NULL}, - { (char *)"blpapi_TlsOptions_createFromBlobs", _wrap_blpapi_TlsOptions_createFromBlobs, METH_VARARGS, NULL}, - { (char *)"blpapi_TlsOptions_setTlsHandshakeTimeoutMs", _wrap_blpapi_TlsOptions_setTlsHandshakeTimeoutMs, METH_VARARGS, NULL}, - { (char *)"blpapi_TlsOptions_setCrlFetchTimeoutMs", _wrap_blpapi_TlsOptions_setCrlFetchTimeoutMs, METH_VARARGS, NULL}, - { (char *)"blpapi_Name_create", _wrap_blpapi_Name_create, METH_VARARGS, NULL}, - { (char *)"blpapi_Name_destroy", _wrap_blpapi_Name_destroy, METH_VARARGS, NULL}, - { (char *)"blpapi_Name_equalsStr", _wrap_blpapi_Name_equalsStr, METH_VARARGS, NULL}, - { (char *)"blpapi_Name_string", _wrap_blpapi_Name_string, METH_VARARGS, NULL}, - { (char *)"blpapi_Name_length", _wrap_blpapi_Name_length, METH_VARARGS, NULL}, - { (char *)"blpapi_Name_findName", _wrap_blpapi_Name_findName, METH_VARARGS, NULL}, - { (char *)"blpapi_SubscriptionList_create", _wrap_blpapi_SubscriptionList_create, METH_VARARGS, NULL}, - { (char *)"blpapi_SubscriptionList_destroy", _wrap_blpapi_SubscriptionList_destroy, METH_VARARGS, NULL}, - { (char *)"blpapi_SubscriptionList_addResolved", _wrap_blpapi_SubscriptionList_addResolved, METH_VARARGS, NULL}, - { (char *)"blpapi_SubscriptionList_clear", _wrap_blpapi_SubscriptionList_clear, METH_VARARGS, NULL}, - { (char *)"blpapi_SubscriptionList_append", _wrap_blpapi_SubscriptionList_append, METH_VARARGS, NULL}, - { (char *)"blpapi_SubscriptionList_size", _wrap_blpapi_SubscriptionList_size, METH_VARARGS, NULL}, - { (char *)"blpapi_SubscriptionList_correlationIdAt", _wrap_blpapi_SubscriptionList_correlationIdAt, METH_VARARGS, NULL}, - { (char *)"blpapi_SubscriptionList_topicStringAt", _wrap_blpapi_SubscriptionList_topicStringAt, METH_VARARGS, NULL}, - { (char *)"blpapi_SubscriptionList_isResolvedAt", _wrap_blpapi_SubscriptionList_isResolvedAt, METH_VARARGS, NULL}, - { (char *)"blpapi_TimePoint_d_value_set", _wrap_blpapi_TimePoint_d_value_set, METH_VARARGS, NULL}, - { (char *)"blpapi_TimePoint_d_value_get", _wrap_blpapi_TimePoint_d_value_get, METH_VARARGS, NULL}, - { (char *)"new_blpapi_TimePoint", _wrap_new_blpapi_TimePoint, METH_VARARGS, NULL}, - { (char *)"delete_blpapi_TimePoint", _wrap_delete_blpapi_TimePoint, METH_VARARGS, NULL}, - { (char *)"blpapi_TimePoint_swigregister", blpapi_TimePoint_swigregister, METH_VARARGS, NULL}, - { (char *)"blpapi_TimePointUtil_nanosecondsBetween", _wrap_blpapi_TimePointUtil_nanosecondsBetween, METH_VARARGS, NULL}, - { (char *)"blpapi_Datetime_tag_parts_set", _wrap_blpapi_Datetime_tag_parts_set, METH_VARARGS, NULL}, - { (char *)"blpapi_Datetime_tag_parts_get", _wrap_blpapi_Datetime_tag_parts_get, METH_VARARGS, NULL}, - { (char *)"blpapi_Datetime_tag_hours_set", _wrap_blpapi_Datetime_tag_hours_set, METH_VARARGS, NULL}, - { (char *)"blpapi_Datetime_tag_hours_get", _wrap_blpapi_Datetime_tag_hours_get, METH_VARARGS, NULL}, - { (char *)"blpapi_Datetime_tag_minutes_set", _wrap_blpapi_Datetime_tag_minutes_set, METH_VARARGS, NULL}, - { (char *)"blpapi_Datetime_tag_minutes_get", _wrap_blpapi_Datetime_tag_minutes_get, METH_VARARGS, NULL}, - { (char *)"blpapi_Datetime_tag_seconds_set", _wrap_blpapi_Datetime_tag_seconds_set, METH_VARARGS, NULL}, - { (char *)"blpapi_Datetime_tag_seconds_get", _wrap_blpapi_Datetime_tag_seconds_get, METH_VARARGS, NULL}, - { (char *)"blpapi_Datetime_tag_milliSeconds_set", _wrap_blpapi_Datetime_tag_milliSeconds_set, METH_VARARGS, NULL}, - { (char *)"blpapi_Datetime_tag_milliSeconds_get", _wrap_blpapi_Datetime_tag_milliSeconds_get, METH_VARARGS, NULL}, - { (char *)"blpapi_Datetime_tag_month_set", _wrap_blpapi_Datetime_tag_month_set, METH_VARARGS, NULL}, - { (char *)"blpapi_Datetime_tag_month_get", _wrap_blpapi_Datetime_tag_month_get, METH_VARARGS, NULL}, - { (char *)"blpapi_Datetime_tag_day_set", _wrap_blpapi_Datetime_tag_day_set, METH_VARARGS, NULL}, - { (char *)"blpapi_Datetime_tag_day_get", _wrap_blpapi_Datetime_tag_day_get, METH_VARARGS, NULL}, - { (char *)"blpapi_Datetime_tag_year_set", _wrap_blpapi_Datetime_tag_year_set, METH_VARARGS, NULL}, - { (char *)"blpapi_Datetime_tag_year_get", _wrap_blpapi_Datetime_tag_year_get, METH_VARARGS, NULL}, - { (char *)"blpapi_Datetime_tag_offset_set", _wrap_blpapi_Datetime_tag_offset_set, METH_VARARGS, NULL}, - { (char *)"blpapi_Datetime_tag_offset_get", _wrap_blpapi_Datetime_tag_offset_get, METH_VARARGS, NULL}, - { (char *)"new_blpapi_Datetime_tag", _wrap_new_blpapi_Datetime_tag, METH_VARARGS, NULL}, - { (char *)"delete_blpapi_Datetime_tag", _wrap_delete_blpapi_Datetime_tag, METH_VARARGS, NULL}, - { (char *)"blpapi_Datetime_tag_swigregister", blpapi_Datetime_tag_swigregister, METH_VARARGS, NULL}, - { (char *)"blpapi_HighPrecisionDatetime_tag_datetime_set", _wrap_blpapi_HighPrecisionDatetime_tag_datetime_set, METH_VARARGS, NULL}, - { (char *)"blpapi_HighPrecisionDatetime_tag_datetime_get", _wrap_blpapi_HighPrecisionDatetime_tag_datetime_get, METH_VARARGS, NULL}, - { (char *)"blpapi_HighPrecisionDatetime_tag_picoseconds_set", _wrap_blpapi_HighPrecisionDatetime_tag_picoseconds_set, METH_VARARGS, NULL}, - { (char *)"blpapi_HighPrecisionDatetime_tag_picoseconds_get", _wrap_blpapi_HighPrecisionDatetime_tag_picoseconds_get, METH_VARARGS, NULL}, - { (char *)"new_blpapi_HighPrecisionDatetime_tag", _wrap_new_blpapi_HighPrecisionDatetime_tag, METH_VARARGS, NULL}, - { (char *)"delete_blpapi_HighPrecisionDatetime_tag", _wrap_delete_blpapi_HighPrecisionDatetime_tag, METH_VARARGS, NULL}, - { (char *)"blpapi_HighPrecisionDatetime_tag_swigregister", blpapi_HighPrecisionDatetime_tag_swigregister, METH_VARARGS, NULL}, - { (char *)"blpapi_HighPrecisionDatetime_compare", _wrap_blpapi_HighPrecisionDatetime_compare, METH_VARARGS, NULL}, - { (char *)"blpapi_HighPrecisionDatetime_print", _wrap_blpapi_HighPrecisionDatetime_print, METH_VARARGS, NULL}, - { (char *)"blpapi_HighPrecisionDatetime_fromTimePoint", _wrap_blpapi_HighPrecisionDatetime_fromTimePoint, METH_VARARGS, NULL}, - { (char *)"blpapi_Constant_name", _wrap_blpapi_Constant_name, METH_VARARGS, NULL}, - { (char *)"blpapi_Constant_description", _wrap_blpapi_Constant_description, METH_VARARGS, NULL}, - { (char *)"blpapi_Constant_status", _wrap_blpapi_Constant_status, METH_VARARGS, NULL}, - { (char *)"blpapi_Constant_datatype", _wrap_blpapi_Constant_datatype, METH_VARARGS, NULL}, - { (char *)"blpapi_Constant_getValueAsChar", _wrap_blpapi_Constant_getValueAsChar, METH_VARARGS, NULL}, - { (char *)"blpapi_Constant_getValueAsInt32", _wrap_blpapi_Constant_getValueAsInt32, METH_VARARGS, NULL}, - { (char *)"blpapi_Constant_getValueAsInt64", _wrap_blpapi_Constant_getValueAsInt64, METH_VARARGS, NULL}, - { (char *)"blpapi_Constant_getValueAsFloat32", _wrap_blpapi_Constant_getValueAsFloat32, METH_VARARGS, NULL}, - { (char *)"blpapi_Constant_getValueAsFloat64", _wrap_blpapi_Constant_getValueAsFloat64, METH_VARARGS, NULL}, - { (char *)"blpapi_Constant_getValueAsDatetime", _wrap_blpapi_Constant_getValueAsDatetime, METH_VARARGS, NULL}, - { (char *)"blpapi_Constant_getValueAsString", _wrap_blpapi_Constant_getValueAsString, METH_VARARGS, NULL}, - { (char *)"blpapi_ConstantList_name", _wrap_blpapi_ConstantList_name, METH_VARARGS, NULL}, - { (char *)"blpapi_ConstantList_description", _wrap_blpapi_ConstantList_description, METH_VARARGS, NULL}, - { (char *)"blpapi_ConstantList_numConstants", _wrap_blpapi_ConstantList_numConstants, METH_VARARGS, NULL}, - { (char *)"blpapi_ConstantList_datatype", _wrap_blpapi_ConstantList_datatype, METH_VARARGS, NULL}, - { (char *)"blpapi_ConstantList_status", _wrap_blpapi_ConstantList_status, METH_VARARGS, NULL}, - { (char *)"blpapi_ConstantList_getConstant", _wrap_blpapi_ConstantList_getConstant, METH_VARARGS, NULL}, - { (char *)"blpapi_ConstantList_getConstantAt", _wrap_blpapi_ConstantList_getConstantAt, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaElementDefinition_name", _wrap_blpapi_SchemaElementDefinition_name, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaElementDefinition_description", _wrap_blpapi_SchemaElementDefinition_description, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaElementDefinition_status", _wrap_blpapi_SchemaElementDefinition_status, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaElementDefinition_type", _wrap_blpapi_SchemaElementDefinition_type, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaElementDefinition_numAlternateNames", _wrap_blpapi_SchemaElementDefinition_numAlternateNames, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaElementDefinition_getAlternateName", _wrap_blpapi_SchemaElementDefinition_getAlternateName, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaElementDefinition_minValues", _wrap_blpapi_SchemaElementDefinition_minValues, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaElementDefinition_maxValues", _wrap_blpapi_SchemaElementDefinition_maxValues, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaTypeDefinition_name", _wrap_blpapi_SchemaTypeDefinition_name, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaTypeDefinition_description", _wrap_blpapi_SchemaTypeDefinition_description, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaTypeDefinition_status", _wrap_blpapi_SchemaTypeDefinition_status, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaTypeDefinition_datatype", _wrap_blpapi_SchemaTypeDefinition_datatype, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaTypeDefinition_isComplexType", _wrap_blpapi_SchemaTypeDefinition_isComplexType, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaTypeDefinition_isSimpleType", _wrap_blpapi_SchemaTypeDefinition_isSimpleType, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaTypeDefinition_isEnumerationType", _wrap_blpapi_SchemaTypeDefinition_isEnumerationType, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaTypeDefinition_numElementDefinitions", _wrap_blpapi_SchemaTypeDefinition_numElementDefinitions, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaTypeDefinition_getElementDefinition", _wrap_blpapi_SchemaTypeDefinition_getElementDefinition, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaTypeDefinition_getElementDefinitionAt", _wrap_blpapi_SchemaTypeDefinition_getElementDefinitionAt, METH_VARARGS, NULL}, - { (char *)"blpapi_SchemaTypeDefinition_enumeration", _wrap_blpapi_SchemaTypeDefinition_enumeration, METH_VARARGS, NULL}, - { (char *)"blpapi_Request_destroy", _wrap_blpapi_Request_destroy, METH_VARARGS, NULL}, - { (char *)"blpapi_Request_elements", _wrap_blpapi_Request_elements, METH_VARARGS, NULL}, - { (char *)"blpapi_Request_setPreferredRoute", _wrap_blpapi_Request_setPreferredRoute, METH_VARARGS, NULL}, - { (char *)"blpapi_Request_getRequestId", _wrap_blpapi_Request_getRequestId, METH_VARARGS, NULL}, - { (char *)"blpapi_RequestTemplate_release", _wrap_blpapi_RequestTemplate_release, METH_VARARGS, NULL}, - { (char *)"blpapi_Operation_name", _wrap_blpapi_Operation_name, METH_VARARGS, NULL}, - { (char *)"blpapi_Operation_description", _wrap_blpapi_Operation_description, METH_VARARGS, NULL}, - { (char *)"blpapi_Operation_requestDefinition", _wrap_blpapi_Operation_requestDefinition, METH_VARARGS, NULL}, - { (char *)"blpapi_Operation_numResponseDefinitions", _wrap_blpapi_Operation_numResponseDefinitions, METH_VARARGS, NULL}, - { (char *)"blpapi_Operation_responseDefinition", _wrap_blpapi_Operation_responseDefinition, METH_VARARGS, NULL}, - { (char *)"blpapi_Operation_responseDefinitionFromName", _wrap_blpapi_Operation_responseDefinitionFromName, METH_VARARGS, NULL}, - { (char *)"blpapi_Service_name", _wrap_blpapi_Service_name, METH_VARARGS, NULL}, - { (char *)"blpapi_Service_description", _wrap_blpapi_Service_description, METH_VARARGS, NULL}, - { (char *)"blpapi_Service_numOperations", _wrap_blpapi_Service_numOperations, METH_VARARGS, NULL}, - { (char *)"blpapi_Service_numEventDefinitions", _wrap_blpapi_Service_numEventDefinitions, METH_VARARGS, NULL}, - { (char *)"blpapi_Service_addRef", _wrap_blpapi_Service_addRef, METH_VARARGS, NULL}, - { (char *)"blpapi_Service_release", _wrap_blpapi_Service_release, METH_VARARGS, NULL}, - { (char *)"blpapi_Service_authorizationServiceName", _wrap_blpapi_Service_authorizationServiceName, METH_VARARGS, NULL}, - { (char *)"blpapi_Service_getOperation", _wrap_blpapi_Service_getOperation, METH_VARARGS, NULL}, - { (char *)"blpapi_Service_getOperationAt", _wrap_blpapi_Service_getOperationAt, METH_VARARGS, NULL}, - { (char *)"blpapi_Service_getEventDefinition", _wrap_blpapi_Service_getEventDefinition, METH_VARARGS, NULL}, - { (char *)"blpapi_Service_getEventDefinitionAt", _wrap_blpapi_Service_getEventDefinitionAt, METH_VARARGS, NULL}, - { (char *)"blpapi_Service_createRequest", _wrap_blpapi_Service_createRequest, METH_VARARGS, NULL}, - { (char *)"blpapi_Service_createAuthorizationRequest", _wrap_blpapi_Service_createAuthorizationRequest, METH_VARARGS, NULL}, - { (char *)"blpapi_Service_createPublishEvent", _wrap_blpapi_Service_createPublishEvent, METH_VARARGS, NULL}, - { (char *)"blpapi_Service_createAdminEvent", _wrap_blpapi_Service_createAdminEvent, METH_VARARGS, NULL}, - { (char *)"blpapi_Service_createResponseEvent", _wrap_blpapi_Service_createResponseEvent, METH_VARARGS, NULL}, - { (char *)"blpapi_Message_messageType", _wrap_blpapi_Message_messageType, METH_VARARGS, NULL}, - { (char *)"blpapi_Message_topicName", _wrap_blpapi_Message_topicName, METH_VARARGS, NULL}, - { (char *)"blpapi_Message_service", _wrap_blpapi_Message_service, METH_VARARGS, NULL}, - { (char *)"blpapi_Message_numCorrelationIds", _wrap_blpapi_Message_numCorrelationIds, METH_VARARGS, NULL}, - { (char *)"blpapi_Message_correlationId", _wrap_blpapi_Message_correlationId, METH_VARARGS, NULL}, - { (char *)"blpapi_Message_getRequestId", _wrap_blpapi_Message_getRequestId, METH_VARARGS, NULL}, - { (char *)"blpapi_Message_elements", _wrap_blpapi_Message_elements, METH_VARARGS, NULL}, - { (char *)"blpapi_Message_fragmentType", _wrap_blpapi_Message_fragmentType, METH_VARARGS, NULL}, - { (char *)"blpapi_Message_recapType", _wrap_blpapi_Message_recapType, METH_VARARGS, NULL}, - { (char *)"blpapi_Message_addRef", _wrap_blpapi_Message_addRef, METH_VARARGS, NULL}, - { (char *)"blpapi_Message_release", _wrap_blpapi_Message_release, METH_VARARGS, NULL}, - { (char *)"blpapi_Message_timeReceived", _wrap_blpapi_Message_timeReceived, METH_VARARGS, NULL}, - { (char *)"blpapi_Event_eventType", _wrap_blpapi_Event_eventType, METH_VARARGS, NULL}, - { (char *)"blpapi_Event_release", _wrap_blpapi_Event_release, METH_VARARGS, NULL}, - { (char *)"blpapi_EventQueue_create", _wrap_blpapi_EventQueue_create, METH_VARARGS, NULL}, - { (char *)"blpapi_EventQueue_destroy", _wrap_blpapi_EventQueue_destroy, METH_VARARGS, NULL}, - { (char *)"blpapi_EventQueue_nextEvent", _wrap_blpapi_EventQueue_nextEvent, METH_VARARGS, NULL}, - { (char *)"blpapi_EventQueue_purge", _wrap_blpapi_EventQueue_purge, METH_VARARGS, NULL}, - { (char *)"blpapi_EventQueue_tryNextEvent", _wrap_blpapi_EventQueue_tryNextEvent, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageIterator_create", _wrap_blpapi_MessageIterator_create, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageIterator_destroy", _wrap_blpapi_MessageIterator_destroy, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageIterator_next", _wrap_blpapi_MessageIterator_next, METH_VARARGS, NULL}, - { (char *)"blpapi_Identity_release", _wrap_blpapi_Identity_release, METH_VARARGS, NULL}, - { (char *)"blpapi_Identity_addRef", _wrap_blpapi_Identity_addRef, METH_VARARGS, NULL}, - { (char *)"blpapi_Identity_hasEntitlements", _wrap_blpapi_Identity_hasEntitlements, METH_VARARGS, NULL}, - { (char *)"blpapi_Identity_isAuthorized", _wrap_blpapi_Identity_isAuthorized, METH_VARARGS, NULL}, - { (char *)"blpapi_Identity_getSeatType", _wrap_blpapi_Identity_getSeatType, METH_VARARGS, NULL}, - { (char *)"blpapi_HighResolutionClock_now", _wrap_blpapi_HighResolutionClock_now, METH_VARARGS, NULL}, - { (char *)"blpapi_AbstractSession_cancel", _wrap_blpapi_AbstractSession_cancel, METH_VARARGS, NULL}, - { (char *)"blpapi_AbstractSession_sendAuthorizationRequest", _wrap_blpapi_AbstractSession_sendAuthorizationRequest, METH_VARARGS, NULL}, - { (char *)"blpapi_AbstractSession_openService", _wrap_blpapi_AbstractSession_openService, METH_VARARGS, NULL}, - { (char *)"blpapi_AbstractSession_openServiceAsync", _wrap_blpapi_AbstractSession_openServiceAsync, METH_VARARGS, NULL}, - { (char *)"blpapi_AbstractSession_generateToken", _wrap_blpapi_AbstractSession_generateToken, METH_VARARGS, NULL}, - { (char *)"blpapi_AbstractSession_generateManualToken", _wrap_blpapi_AbstractSession_generateManualToken, METH_VARARGS, NULL}, - { (char *)"blpapi_AbstractSession_getService", _wrap_blpapi_AbstractSession_getService, METH_VARARGS, NULL}, - { (char *)"blpapi_AbstractSession_createIdentity", _wrap_blpapi_AbstractSession_createIdentity, METH_VARARGS, NULL}, - { (char *)"blpapi_AbstractSession_generateAuthorizedIdentityAsync", _wrap_blpapi_AbstractSession_generateAuthorizedIdentityAsync, METH_VARARGS, NULL}, - { (char *)"blpapi_AbstractSession_getAuthorizedIdentity", _wrap_blpapi_AbstractSession_getAuthorizedIdentity, METH_VARARGS, NULL}, - { (char *)"blpapi_Session_start", _wrap_blpapi_Session_start, METH_VARARGS, NULL}, - { (char *)"blpapi_Session_startAsync", _wrap_blpapi_Session_startAsync, METH_VARARGS, NULL}, - { (char *)"blpapi_Session_stop", _wrap_blpapi_Session_stop, METH_VARARGS, NULL}, - { (char *)"blpapi_Session_stopAsync", _wrap_blpapi_Session_stopAsync, METH_VARARGS, NULL}, - { (char *)"blpapi_Session_nextEvent", _wrap_blpapi_Session_nextEvent, METH_VARARGS, NULL}, - { (char *)"blpapi_Session_tryNextEvent", _wrap_blpapi_Session_tryNextEvent, METH_VARARGS, NULL}, - { (char *)"blpapi_Session_subscribe", _wrap_blpapi_Session_subscribe, METH_VARARGS, NULL}, - { (char *)"blpapi_Session_resubscribe", _wrap_blpapi_Session_resubscribe, METH_VARARGS, NULL}, - { (char *)"blpapi_Session_resubscribeWithId", _wrap_blpapi_Session_resubscribeWithId, METH_VARARGS, NULL}, - { (char *)"blpapi_Session_unsubscribe", _wrap_blpapi_Session_unsubscribe, METH_VARARGS, NULL}, - { (char *)"blpapi_Session_setStatusCorrelationId", _wrap_blpapi_Session_setStatusCorrelationId, METH_VARARGS, NULL}, - { (char *)"blpapi_Session_sendRequest", _wrap_blpapi_Session_sendRequest, METH_VARARGS, NULL}, - { (char *)"blpapi_Session_sendRequestTemplate", _wrap_blpapi_Session_sendRequestTemplate, METH_VARARGS, NULL}, - { (char *)"blpapi_Session_createSnapshotRequestTemplate", _wrap_blpapi_Session_createSnapshotRequestTemplate, METH_VARARGS, NULL}, - { (char *)"blpapi_Session_getAbstractSession", _wrap_blpapi_Session_getAbstractSession, METH_VARARGS, NULL}, - { (char *)"blpapi_ResolutionList_extractAttributeFromResolutionSuccess", _wrap_blpapi_ResolutionList_extractAttributeFromResolutionSuccess, METH_VARARGS, NULL}, - { (char *)"blpapi_ResolutionList_create", _wrap_blpapi_ResolutionList_create, METH_VARARGS, NULL}, - { (char *)"blpapi_ResolutionList_destroy", _wrap_blpapi_ResolutionList_destroy, METH_VARARGS, NULL}, - { (char *)"blpapi_ResolutionList_add", _wrap_blpapi_ResolutionList_add, METH_VARARGS, NULL}, - { (char *)"blpapi_ResolutionList_addFromMessage", _wrap_blpapi_ResolutionList_addFromMessage, METH_VARARGS, NULL}, - { (char *)"blpapi_ResolutionList_addAttribute", _wrap_blpapi_ResolutionList_addAttribute, METH_VARARGS, NULL}, - { (char *)"blpapi_ResolutionList_correlationIdAt", _wrap_blpapi_ResolutionList_correlationIdAt, METH_VARARGS, NULL}, - { (char *)"blpapi_ResolutionList_topicString", _wrap_blpapi_ResolutionList_topicString, METH_VARARGS, NULL}, - { (char *)"blpapi_ResolutionList_topicStringAt", _wrap_blpapi_ResolutionList_topicStringAt, METH_VARARGS, NULL}, - { (char *)"blpapi_ResolutionList_status", _wrap_blpapi_ResolutionList_status, METH_VARARGS, NULL}, - { (char *)"blpapi_ResolutionList_statusAt", _wrap_blpapi_ResolutionList_statusAt, METH_VARARGS, NULL}, - { (char *)"blpapi_ResolutionList_attribute", _wrap_blpapi_ResolutionList_attribute, METH_VARARGS, NULL}, - { (char *)"blpapi_ResolutionList_attributeAt", _wrap_blpapi_ResolutionList_attributeAt, METH_VARARGS, NULL}, - { (char *)"blpapi_ResolutionList_message", _wrap_blpapi_ResolutionList_message, METH_VARARGS, NULL}, - { (char *)"blpapi_ResolutionList_messageAt", _wrap_blpapi_ResolutionList_messageAt, METH_VARARGS, NULL}, - { (char *)"blpapi_ResolutionList_size", _wrap_blpapi_ResolutionList_size, METH_VARARGS, NULL}, - { (char *)"blpapi_TestUtil_createEvent", _wrap_blpapi_TestUtil_createEvent, METH_VARARGS, NULL}, - { (char *)"blpapi_TestUtil_deserializeService", _wrap_blpapi_TestUtil_deserializeService, METH_VARARGS, NULL}, - { (char *)"blpapi_TestUtil_serializeService", _wrap_blpapi_TestUtil_serializeService, METH_VARARGS, NULL}, - { (char *)"blpapi_TestUtil_appendMessage", _wrap_blpapi_TestUtil_appendMessage, METH_VARARGS, NULL}, - { (char *)"blpapi_TestUtil_createTopic", _wrap_blpapi_TestUtil_createTopic, METH_VARARGS, NULL}, - { (char *)"blpapi_TestUtil_getAdminMessageDefinition", _wrap_blpapi_TestUtil_getAdminMessageDefinition, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageProperties_create", _wrap_blpapi_MessageProperties_create, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageProperties_destroy", _wrap_blpapi_MessageProperties_destroy, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageProperties_copy", _wrap_blpapi_MessageProperties_copy, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageProperties_assign", _wrap_blpapi_MessageProperties_assign, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageProperties_setCorrelationIds", _wrap_blpapi_MessageProperties_setCorrelationIds, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageProperties_setRecapType", _wrap_blpapi_MessageProperties_setRecapType, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageProperties_setTimeReceived", _wrap_blpapi_MessageProperties_setTimeReceived, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageProperties_setService", _wrap_blpapi_MessageProperties_setService, METH_VARARGS, NULL}, - { (char *)"blpapi_MessageProperties_setRequestId", _wrap_blpapi_MessageProperties_setRequestId, METH_VARARGS, NULL}, - { (char *)"blpapi_Topic_create", _wrap_blpapi_Topic_create, METH_VARARGS, NULL}, - { (char *)"blpapi_Topic_destroy", _wrap_blpapi_Topic_destroy, METH_VARARGS, NULL}, - { (char *)"blpapi_Topic_compare", _wrap_blpapi_Topic_compare, METH_VARARGS, NULL}, - { (char *)"blpapi_Topic_service", _wrap_blpapi_Topic_service, METH_VARARGS, NULL}, - { (char *)"blpapi_Topic_isActive", _wrap_blpapi_Topic_isActive, METH_VARARGS, NULL}, - { (char *)"blpapi_TopicList_create", _wrap_blpapi_TopicList_create, METH_VARARGS, NULL}, - { (char *)"blpapi_TopicList_destroy", _wrap_blpapi_TopicList_destroy, METH_VARARGS, NULL}, - { (char *)"blpapi_TopicList_add", _wrap_blpapi_TopicList_add, METH_VARARGS, NULL}, - { (char *)"blpapi_TopicList_addFromMessage", _wrap_blpapi_TopicList_addFromMessage, METH_VARARGS, NULL}, - { (char *)"blpapi_TopicList_correlationIdAt", _wrap_blpapi_TopicList_correlationIdAt, METH_VARARGS, NULL}, - { (char *)"blpapi_TopicList_topicString", _wrap_blpapi_TopicList_topicString, METH_VARARGS, NULL}, - { (char *)"blpapi_TopicList_topicStringAt", _wrap_blpapi_TopicList_topicStringAt, METH_VARARGS, NULL}, - { (char *)"blpapi_TopicList_status", _wrap_blpapi_TopicList_status, METH_VARARGS, NULL}, - { (char *)"blpapi_TopicList_statusAt", _wrap_blpapi_TopicList_statusAt, METH_VARARGS, NULL}, - { (char *)"blpapi_TopicList_message", _wrap_blpapi_TopicList_message, METH_VARARGS, NULL}, - { (char *)"blpapi_TopicList_messageAt", _wrap_blpapi_TopicList_messageAt, METH_VARARGS, NULL}, - { (char *)"blpapi_TopicList_size", _wrap_blpapi_TopicList_size, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_create", _wrap_blpapi_ProviderSession_create, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_destroy", _wrap_blpapi_ProviderSession_destroy, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_start", _wrap_blpapi_ProviderSession_start, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_startAsync", _wrap_blpapi_ProviderSession_startAsync, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_stop", _wrap_blpapi_ProviderSession_stop, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_stopAsync", _wrap_blpapi_ProviderSession_stopAsync, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_nextEvent", _wrap_blpapi_ProviderSession_nextEvent, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_tryNextEvent", _wrap_blpapi_ProviderSession_tryNextEvent, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_registerService", _wrap_blpapi_ProviderSession_registerService, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_activateSubServiceCodeRange", _wrap_blpapi_ProviderSession_activateSubServiceCodeRange, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_deactivateSubServiceCodeRange", _wrap_blpapi_ProviderSession_deactivateSubServiceCodeRange, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_registerServiceAsync", _wrap_blpapi_ProviderSession_registerServiceAsync, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_deregisterService", _wrap_blpapi_ProviderSession_deregisterService, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_resolve", _wrap_blpapi_ProviderSession_resolve, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_resolveAsync", _wrap_blpapi_ProviderSession_resolveAsync, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_createTopics", _wrap_blpapi_ProviderSession_createTopics, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_createTopicsAsync", _wrap_blpapi_ProviderSession_createTopicsAsync, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_getTopic", _wrap_blpapi_ProviderSession_getTopic, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_createTopic", _wrap_blpapi_ProviderSession_createTopic, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_createServiceStatusTopic", _wrap_blpapi_ProviderSession_createServiceStatusTopic, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_deleteTopics", _wrap_blpapi_ProviderSession_deleteTopics, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_terminateSubscriptionsOnTopics", _wrap_blpapi_ProviderSession_terminateSubscriptionsOnTopics, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_publish", _wrap_blpapi_ProviderSession_publish, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_sendResponse", _wrap_blpapi_ProviderSession_sendResponse, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_getAbstractSession", _wrap_blpapi_ProviderSession_getAbstractSession, METH_VARARGS, NULL}, - { (char *)"blpapi_ProviderSession_flushPublishedEvents", _wrap_blpapi_ProviderSession_flushPublishedEvents, METH_VARARGS, NULL}, - { (char *)"blpapi_ServiceRegistrationOptions_create", _wrap_blpapi_ServiceRegistrationOptions_create, METH_VARARGS, NULL}, - { (char *)"blpapi_ServiceRegistrationOptions_duplicate", _wrap_blpapi_ServiceRegistrationOptions_duplicate, METH_VARARGS, NULL}, - { (char *)"blpapi_ServiceRegistrationOptions_destroy", _wrap_blpapi_ServiceRegistrationOptions_destroy, METH_VARARGS, NULL}, - { (char *)"blpapi_ServiceRegistrationOptions_copy", _wrap_blpapi_ServiceRegistrationOptions_copy, METH_VARARGS, NULL}, - { (char *)"blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange", _wrap_blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange, METH_VARARGS, NULL}, - { (char *)"blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges", _wrap_blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges, METH_VARARGS, NULL}, - { (char *)"blpapi_ServiceRegistrationOptions_setGroupId", _wrap_blpapi_ServiceRegistrationOptions_setGroupId, METH_VARARGS, NULL}, - { (char *)"blpapi_ServiceRegistrationOptions_setServicePriority", _wrap_blpapi_ServiceRegistrationOptions_setServicePriority, METH_VARARGS, NULL}, - { (char *)"blpapi_ServiceRegistrationOptions_setPartsToRegister", _wrap_blpapi_ServiceRegistrationOptions_setPartsToRegister, METH_VARARGS, NULL}, - { (char *)"blpapi_ServiceRegistrationOptions_getGroupId", _wrap_blpapi_ServiceRegistrationOptions_getGroupId, METH_VARARGS, NULL}, - { (char *)"blpapi_ServiceRegistrationOptions_getServicePriority", _wrap_blpapi_ServiceRegistrationOptions_getServicePriority, METH_VARARGS, NULL}, - { (char *)"blpapi_ServiceRegistrationOptions_getPartsToRegister", _wrap_blpapi_ServiceRegistrationOptions_getPartsToRegister, METH_VARARGS, NULL}, - { (char *)"blpapi_ZfpUtil_getOptionsForLeasedLines", _wrap_blpapi_ZfpUtil_getOptionsForLeasedLines, METH_VARARGS, NULL}, + { "CorrelationId___asObject", _wrap_CorrelationId___asObject, METH_O, NULL}, + { "CorrelationId___asInteger", _wrap_CorrelationId___asInteger, METH_O, NULL}, + { "CorrelationId___toInteger", _wrap_CorrelationId___toInteger, METH_O, NULL}, + { "CorrelationId_swigregister", CorrelationId_swigregister, METH_O, NULL}, + { "CorrelationId_swiginit", CorrelationId_swiginit, METH_VARARGS, NULL}, + { "new_blpapi_CorrelationId_t__value", _wrap_new_blpapi_CorrelationId_t__value, METH_NOARGS, NULL}, + { "delete_blpapi_CorrelationId_t__value", _wrap_delete_blpapi_CorrelationId_t__value, METH_O, NULL}, + { "blpapi_CorrelationId_t__value_swigregister", blpapi_CorrelationId_t__value_swigregister, METH_O, NULL}, + { "blpapi_CorrelationId_t__value_swiginit", blpapi_CorrelationId_t__value_swiginit, METH_VARARGS, NULL}, + { "blpapi_Element_setElementFloat", _wrap_blpapi_Element_setElementFloat, METH_VARARGS, NULL}, + { "blpapi_Element_setValueFloat", _wrap_blpapi_Element_setValueFloat, METH_VARARGS, NULL}, + { "blpapi_Element_printHelper", _wrap_blpapi_Element_printHelper, METH_VARARGS, NULL}, + { "blpapi_Element_name", _wrap_blpapi_Element_name, METH_O, NULL}, + { "blpapi_Element_nameString", _wrap_blpapi_Element_nameString, METH_O, NULL}, + { "blpapi_Element_definition", _wrap_blpapi_Element_definition, METH_O, NULL}, + { "blpapi_Element_datatype", _wrap_blpapi_Element_datatype, METH_O, NULL}, + { "blpapi_Element_isComplexType", _wrap_blpapi_Element_isComplexType, METH_O, NULL}, + { "blpapi_Element_isArray", _wrap_blpapi_Element_isArray, METH_O, NULL}, + { "blpapi_Element_isReadOnly", _wrap_blpapi_Element_isReadOnly, METH_O, NULL}, + { "blpapi_Element_numValues", _wrap_blpapi_Element_numValues, METH_O, NULL}, + { "blpapi_Element_numElements", _wrap_blpapi_Element_numElements, METH_O, NULL}, + { "blpapi_Element_isNullValue", _wrap_blpapi_Element_isNullValue, METH_VARARGS, NULL}, + { "blpapi_Element_isNull", _wrap_blpapi_Element_isNull, METH_O, NULL}, + { "blpapi_Element_getElementAt", _wrap_blpapi_Element_getElementAt, METH_VARARGS, NULL}, + { "blpapi_Element_getElement", _wrap_blpapi_Element_getElement, METH_VARARGS, NULL}, + { "blpapi_Element_hasElementEx", _wrap_blpapi_Element_hasElementEx, METH_VARARGS, NULL}, + { "blpapi_Element_getValueAsBool", _wrap_blpapi_Element_getValueAsBool, METH_VARARGS, NULL}, + { "blpapi_Element_getValueAsChar", _wrap_blpapi_Element_getValueAsChar, METH_VARARGS, NULL}, + { "blpapi_Element_getValueAsInt32", _wrap_blpapi_Element_getValueAsInt32, METH_VARARGS, NULL}, + { "blpapi_Element_getValueAsInt64", _wrap_blpapi_Element_getValueAsInt64, METH_VARARGS, NULL}, + { "blpapi_Element_getValueAsFloat64", _wrap_blpapi_Element_getValueAsFloat64, METH_VARARGS, NULL}, + { "blpapi_Element_getValueAsString", _wrap_blpapi_Element_getValueAsString, METH_VARARGS, NULL}, + { "blpapi_Element_getValueAsDatetime", _wrap_blpapi_Element_getValueAsDatetime, METH_VARARGS, NULL}, + { "blpapi_Element_getValueAsHighPrecisionDatetime", _wrap_blpapi_Element_getValueAsHighPrecisionDatetime, METH_VARARGS, NULL}, + { "blpapi_Element_getValueAsElement", _wrap_blpapi_Element_getValueAsElement, METH_VARARGS, NULL}, + { "blpapi_Element_getValueAsName", _wrap_blpapi_Element_getValueAsName, METH_VARARGS, NULL}, + { "blpapi_Element_getChoice", _wrap_blpapi_Element_getChoice, METH_O, NULL}, + { "blpapi_Element_setValueBool", _wrap_blpapi_Element_setValueBool, METH_VARARGS, NULL}, + { "blpapi_Element_setValueInt32", _wrap_blpapi_Element_setValueInt32, METH_VARARGS, NULL}, + { "blpapi_Element_setValueInt64", _wrap_blpapi_Element_setValueInt64, METH_VARARGS, NULL}, + { "blpapi_Element_setValueString", _wrap_blpapi_Element_setValueString, METH_VARARGS, NULL}, + { "blpapi_Element_setValueHighPrecisionDatetime", _wrap_blpapi_Element_setValueHighPrecisionDatetime, METH_VARARGS, NULL}, + { "blpapi_Element_setValueFromName", _wrap_blpapi_Element_setValueFromName, METH_VARARGS, NULL}, + { "blpapi_Element_setElementBool", _wrap_blpapi_Element_setElementBool, METH_VARARGS, NULL}, + { "blpapi_Element_setElementInt32", _wrap_blpapi_Element_setElementInt32, METH_VARARGS, NULL}, + { "blpapi_Element_setElementInt64", _wrap_blpapi_Element_setElementInt64, METH_VARARGS, NULL}, + { "blpapi_Element_setElementString", _wrap_blpapi_Element_setElementString, METH_VARARGS, NULL}, + { "blpapi_Element_setElementHighPrecisionDatetime", _wrap_blpapi_Element_setElementHighPrecisionDatetime, METH_VARARGS, NULL}, + { "blpapi_Element_setElementFromName", _wrap_blpapi_Element_setElementFromName, METH_VARARGS, NULL}, + { "blpapi_Element_appendElement", _wrap_blpapi_Element_appendElement, METH_O, NULL}, + { "blpapi_Element_setChoice", _wrap_blpapi_Element_setChoice, METH_VARARGS, NULL}, + { "blpapi_EventFormatter_setValueFloat", _wrap_blpapi_EventFormatter_setValueFloat, METH_VARARGS, NULL}, + { "blpapi_EventFormatter_appendValueFloat", _wrap_blpapi_EventFormatter_appendValueFloat, METH_VARARGS, NULL}, + { "blpapi_EventFormatter_create", _wrap_blpapi_EventFormatter_create, METH_O, NULL}, + { "blpapi_EventFormatter_destroy", _wrap_blpapi_EventFormatter_destroy, METH_O, NULL}, + { "blpapi_EventFormatter_appendMessage", _wrap_blpapi_EventFormatter_appendMessage, METH_VARARGS, NULL}, + { "blpapi_EventFormatter_appendMessageSeq", _wrap_blpapi_EventFormatter_appendMessageSeq, METH_VARARGS, NULL}, + { "blpapi_EventFormatter_appendResponse", _wrap_blpapi_EventFormatter_appendResponse, METH_VARARGS, NULL}, + { "blpapi_EventFormatter_appendRecapMessage", _wrap_blpapi_EventFormatter_appendRecapMessage, METH_VARARGS, NULL}, + { "blpapi_EventFormatter_appendRecapMessageSeq", _wrap_blpapi_EventFormatter_appendRecapMessageSeq, METH_VARARGS, NULL}, + { "blpapi_EventFormatter_appendFragmentedRecapMessage", _wrap_blpapi_EventFormatter_appendFragmentedRecapMessage, METH_VARARGS, NULL}, + { "blpapi_EventFormatter_appendFragmentedRecapMessageSeq", _wrap_blpapi_EventFormatter_appendFragmentedRecapMessageSeq, METH_VARARGS, NULL}, + { "blpapi_EventFormatter_setValueBool", _wrap_blpapi_EventFormatter_setValueBool, METH_VARARGS, NULL}, + { "blpapi_EventFormatter_setValueChar", _wrap_blpapi_EventFormatter_setValueChar, METH_VARARGS, NULL}, + { "blpapi_EventFormatter_setValueInt32", _wrap_blpapi_EventFormatter_setValueInt32, METH_VARARGS, NULL}, + { "blpapi_EventFormatter_setValueInt64", _wrap_blpapi_EventFormatter_setValueInt64, METH_VARARGS, NULL}, + { "blpapi_EventFormatter_setValueHighPrecisionDatetime", _wrap_blpapi_EventFormatter_setValueHighPrecisionDatetime, METH_VARARGS, NULL}, + { "blpapi_EventFormatter_setValueString", _wrap_blpapi_EventFormatter_setValueString, METH_VARARGS, NULL}, + { "blpapi_EventFormatter_setValueFromName", _wrap_blpapi_EventFormatter_setValueFromName, METH_VARARGS, NULL}, + { "blpapi_EventFormatter_setValueNull", _wrap_blpapi_EventFormatter_setValueNull, METH_VARARGS, NULL}, + { "blpapi_EventFormatter_pushElement", _wrap_blpapi_EventFormatter_pushElement, METH_VARARGS, NULL}, + { "blpapi_EventFormatter_popElement", _wrap_blpapi_EventFormatter_popElement, METH_O, NULL}, + { "blpapi_EventFormatter_appendValueBool", _wrap_blpapi_EventFormatter_appendValueBool, METH_VARARGS, NULL}, + { "blpapi_EventFormatter_appendValueChar", _wrap_blpapi_EventFormatter_appendValueChar, METH_VARARGS, NULL}, + { "blpapi_EventFormatter_appendValueInt32", _wrap_blpapi_EventFormatter_appendValueInt32, METH_VARARGS, NULL}, + { "blpapi_EventFormatter_appendValueInt64", _wrap_blpapi_EventFormatter_appendValueInt64, METH_VARARGS, NULL}, + { "blpapi_EventFormatter_appendValueHighPrecisionDatetime", _wrap_blpapi_EventFormatter_appendValueHighPrecisionDatetime, METH_VARARGS, NULL}, + { "blpapi_EventFormatter_appendValueString", _wrap_blpapi_EventFormatter_appendValueString, METH_VARARGS, NULL}, + { "blpapi_EventFormatter_appendValueFromName", _wrap_blpapi_EventFormatter_appendValueFromName, METH_VARARGS, NULL}, + { "blpapi_EventFormatter_appendElement", _wrap_blpapi_EventFormatter_appendElement, METH_O, NULL}, + { "Session_createHelper", _wrap_Session_createHelper, METH_VARARGS, NULL}, + { "Session_destroyHelper", _wrap_Session_destroyHelper, METH_VARARGS, NULL}, + { "blpapi_EventDispatcher_create", _wrap_blpapi_EventDispatcher_create, METH_O, NULL}, + { "blpapi_EventDispatcher_destroy", _wrap_blpapi_EventDispatcher_destroy, METH_O, NULL}, + { "blpapi_EventDispatcher_start", _wrap_blpapi_EventDispatcher_start, METH_O, NULL}, + { "ProviderSession_createHelper", _wrap_ProviderSession_createHelper, METH_VARARGS, NULL}, + { "ProviderSession_destroyHelper", _wrap_ProviderSession_destroyHelper, METH_VARARGS, NULL}, + { "ProviderSession_terminateSubscriptionsOnTopic", _wrap_ProviderSession_terminateSubscriptionsOnTopic, METH_VARARGS, NULL}, + { "blpapi_MessageFormatter_setValueFloat", _wrap_blpapi_MessageFormatter_setValueFloat, METH_VARARGS, NULL}, + { "blpapi_MessageFormatter_appendValueFloat", _wrap_blpapi_MessageFormatter_appendValueFloat, METH_VARARGS, NULL}, + { "blpapi_MessageFormatter_setValueBool", _wrap_blpapi_MessageFormatter_setValueBool, METH_VARARGS, NULL}, + { "blpapi_MessageFormatter_setValueChar", _wrap_blpapi_MessageFormatter_setValueChar, METH_VARARGS, NULL}, + { "blpapi_MessageFormatter_setValueInt32", _wrap_blpapi_MessageFormatter_setValueInt32, METH_VARARGS, NULL}, + { "blpapi_MessageFormatter_setValueInt64", _wrap_blpapi_MessageFormatter_setValueInt64, METH_VARARGS, NULL}, + { "blpapi_MessageFormatter_setValueFloat32", _wrap_blpapi_MessageFormatter_setValueFloat32, METH_VARARGS, NULL}, + { "blpapi_MessageFormatter_setValueFloat64", _wrap_blpapi_MessageFormatter_setValueFloat64, METH_VARARGS, NULL}, + { "blpapi_MessageFormatter_setValueDatetime", _wrap_blpapi_MessageFormatter_setValueDatetime, METH_VARARGS, NULL}, + { "blpapi_MessageFormatter_setValueHighPrecisionDatetime", _wrap_blpapi_MessageFormatter_setValueHighPrecisionDatetime, METH_VARARGS, NULL}, + { "blpapi_MessageFormatter_setValueString", _wrap_blpapi_MessageFormatter_setValueString, METH_VARARGS, NULL}, + { "blpapi_MessageFormatter_setValueFromName", _wrap_blpapi_MessageFormatter_setValueFromName, METH_VARARGS, NULL}, + { "blpapi_MessageFormatter_setValueNull", _wrap_blpapi_MessageFormatter_setValueNull, METH_VARARGS, NULL}, + { "blpapi_MessageFormatter_pushElement", _wrap_blpapi_MessageFormatter_pushElement, METH_VARARGS, NULL}, + { "blpapi_MessageFormatter_popElement", _wrap_blpapi_MessageFormatter_popElement, METH_O, NULL}, + { "blpapi_MessageFormatter_appendValueBool", _wrap_blpapi_MessageFormatter_appendValueBool, METH_VARARGS, NULL}, + { "blpapi_MessageFormatter_appendValueChar", _wrap_blpapi_MessageFormatter_appendValueChar, METH_VARARGS, NULL}, + { "blpapi_MessageFormatter_appendValueInt32", _wrap_blpapi_MessageFormatter_appendValueInt32, METH_VARARGS, NULL}, + { "blpapi_MessageFormatter_appendValueInt64", _wrap_blpapi_MessageFormatter_appendValueInt64, METH_VARARGS, NULL}, + { "blpapi_MessageFormatter_appendValueFloat32", _wrap_blpapi_MessageFormatter_appendValueFloat32, METH_VARARGS, NULL}, + { "blpapi_MessageFormatter_appendValueFloat64", _wrap_blpapi_MessageFormatter_appendValueFloat64, METH_VARARGS, NULL}, + { "blpapi_MessageFormatter_appendValueDatetime", _wrap_blpapi_MessageFormatter_appendValueDatetime, METH_VARARGS, NULL}, + { "blpapi_MessageFormatter_appendValueHighPrecisionDatetime", _wrap_blpapi_MessageFormatter_appendValueHighPrecisionDatetime, METH_VARARGS, NULL}, + { "blpapi_MessageFormatter_appendValueString", _wrap_blpapi_MessageFormatter_appendValueString, METH_VARARGS, NULL}, + { "blpapi_MessageFormatter_appendValueFromName", _wrap_blpapi_MessageFormatter_appendValueFromName, METH_VARARGS, NULL}, + { "blpapi_MessageFormatter_appendElement", _wrap_blpapi_MessageFormatter_appendElement, METH_O, NULL}, + { "blpapi_MessageFormatter_FormatMessageJson", _wrap_blpapi_MessageFormatter_FormatMessageJson, METH_VARARGS, NULL}, + { "blpapi_MessageFormatter_FormatMessageXml", _wrap_blpapi_MessageFormatter_FormatMessageXml, METH_VARARGS, NULL}, + { "blpapi_MessageFormatter_copy", _wrap_blpapi_MessageFormatter_copy, METH_O, NULL}, + { "blpapi_MessageFormatter_assign", _wrap_blpapi_MessageFormatter_assign, METH_O, NULL}, + { "blpapi_MessageFormatter_destroy", _wrap_blpapi_MessageFormatter_destroy, METH_O, NULL}, + { "blpapi_AuthOptions_create_default", _wrap_blpapi_AuthOptions_create_default, METH_NOARGS, NULL}, + { "blpapi_AuthOptions_create_forUserMode", _wrap_blpapi_AuthOptions_create_forUserMode, METH_O, NULL}, + { "blpapi_AuthOptions_create_forAppMode", _wrap_blpapi_AuthOptions_create_forAppMode, METH_O, NULL}, + { "blpapi_AuthOptions_create_forUserAndAppMode", _wrap_blpapi_AuthOptions_create_forUserAndAppMode, METH_VARARGS, NULL}, + { "blpapi_AuthOptions_create_forToken", _wrap_blpapi_AuthOptions_create_forToken, METH_O, NULL}, + { "blpapi_AuthOptions_duplicate", _wrap_blpapi_AuthOptions_duplicate, METH_O, NULL}, + { "blpapi_AuthOptions_copy", _wrap_blpapi_AuthOptions_copy, METH_VARARGS, NULL}, + { "blpapi_AuthOptions_destroy", _wrap_blpapi_AuthOptions_destroy, METH_O, NULL}, + { "blpapi_AuthUser_createWithLogonName", _wrap_blpapi_AuthUser_createWithLogonName, METH_NOARGS, NULL}, + { "blpapi_AuthUser_createWithActiveDirectoryProperty", _wrap_blpapi_AuthUser_createWithActiveDirectoryProperty, METH_O, NULL}, + { "blpapi_AuthUser_createWithManualOptions", _wrap_blpapi_AuthUser_createWithManualOptions, METH_VARARGS, NULL}, + { "blpapi_AuthUser_duplicate", _wrap_blpapi_AuthUser_duplicate, METH_O, NULL}, + { "blpapi_AuthUser_copy", _wrap_blpapi_AuthUser_copy, METH_VARARGS, NULL}, + { "blpapi_AuthUser_destroy", _wrap_blpapi_AuthUser_destroy, METH_O, NULL}, + { "blpapi_AuthApplication_create", _wrap_blpapi_AuthApplication_create, METH_O, NULL}, + { "blpapi_AuthApplication_duplicate", _wrap_blpapi_AuthApplication_duplicate, METH_O, NULL}, + { "blpapi_AuthApplication_copy", _wrap_blpapi_AuthApplication_copy, METH_VARARGS, NULL}, + { "blpapi_AuthApplication_destroy", _wrap_blpapi_AuthApplication_destroy, METH_O, NULL}, + { "blpapi_AuthToken_create", _wrap_blpapi_AuthToken_create, METH_O, NULL}, + { "blpapi_AuthToken_duplicate", _wrap_blpapi_AuthToken_duplicate, METH_O, NULL}, + { "blpapi_AuthToken_copy", _wrap_blpapi_AuthToken_copy, METH_VARARGS, NULL}, + { "blpapi_AuthToken_destroy", _wrap_blpapi_AuthToken_destroy, METH_O, NULL}, + { "blpapi_getLastErrorDescription", _wrap_blpapi_getLastErrorDescription, METH_O, NULL}, + { "blpapi_SessionOptions_create", _wrap_blpapi_SessionOptions_create, METH_NOARGS, NULL}, + { "blpapi_SessionOptions_destroy", _wrap_blpapi_SessionOptions_destroy, METH_O, NULL}, + { "blpapi_SessionOptions_setServerHost", _wrap_blpapi_SessionOptions_setServerHost, METH_VARARGS, NULL}, + { "blpapi_SessionOptions_setServerPort", _wrap_blpapi_SessionOptions_setServerPort, METH_VARARGS, NULL}, + { "blpapi_SessionOptions_setServerAddress", _wrap_blpapi_SessionOptions_setServerAddress, METH_VARARGS, NULL}, + { "blpapi_SessionOptions_removeServerAddress", _wrap_blpapi_SessionOptions_removeServerAddress, METH_VARARGS, NULL}, + { "blpapi_SessionOptions_setConnectTimeout", _wrap_blpapi_SessionOptions_setConnectTimeout, METH_VARARGS, NULL}, + { "blpapi_SessionOptions_setDefaultServices", _wrap_blpapi_SessionOptions_setDefaultServices, METH_VARARGS, NULL}, + { "blpapi_SessionOptions_setDefaultSubscriptionService", _wrap_blpapi_SessionOptions_setDefaultSubscriptionService, METH_VARARGS, NULL}, + { "blpapi_SessionOptions_setDefaultTopicPrefix", _wrap_blpapi_SessionOptions_setDefaultTopicPrefix, METH_VARARGS, NULL}, + { "blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg", _wrap_blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg, METH_VARARGS, NULL}, + { "blpapi_SessionOptions_setClientMode", _wrap_blpapi_SessionOptions_setClientMode, METH_VARARGS, NULL}, + { "blpapi_SessionOptions_setMaxPendingRequests", _wrap_blpapi_SessionOptions_setMaxPendingRequests, METH_VARARGS, NULL}, + { "blpapi_SessionOptions_setAutoRestartOnDisconnection", _wrap_blpapi_SessionOptions_setAutoRestartOnDisconnection, METH_VARARGS, NULL}, + { "blpapi_SessionOptions_setSessionIdentityOptions", _wrap_blpapi_SessionOptions_setSessionIdentityOptions, METH_VARARGS, NULL}, + { "blpapi_SessionOptions_setAuthenticationOptions", _wrap_blpapi_SessionOptions_setAuthenticationOptions, METH_VARARGS, NULL}, + { "blpapi_SessionOptions_setNumStartAttempts", _wrap_blpapi_SessionOptions_setNumStartAttempts, METH_VARARGS, NULL}, + { "blpapi_SessionOptions_setMaxEventQueueSize", _wrap_blpapi_SessionOptions_setMaxEventQueueSize, METH_VARARGS, NULL}, + { "blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark", _wrap_blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark, METH_VARARGS, NULL}, + { "blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark", _wrap_blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark, METH_VARARGS, NULL}, + { "blpapi_SessionOptions_setDefaultKeepAliveInactivityTime", _wrap_blpapi_SessionOptions_setDefaultKeepAliveInactivityTime, METH_VARARGS, NULL}, + { "blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout", _wrap_blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout, METH_VARARGS, NULL}, + { "blpapi_SessionOptions_setKeepAliveEnabled", _wrap_blpapi_SessionOptions_setKeepAliveEnabled, METH_VARARGS, NULL}, + { "blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes", _wrap_blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes, METH_VARARGS, NULL}, + { "blpapi_SessionOptions_setServiceCheckTimeout", _wrap_blpapi_SessionOptions_setServiceCheckTimeout, METH_VARARGS, NULL}, + { "blpapi_SessionOptions_setServiceDownloadTimeout", _wrap_blpapi_SessionOptions_setServiceDownloadTimeout, METH_VARARGS, NULL}, + { "blpapi_SessionOptions_setTlsOptions", _wrap_blpapi_SessionOptions_setTlsOptions, METH_VARARGS, NULL}, + { "blpapi_SessionOptions_setFlushPublishedEventsTimeout", _wrap_blpapi_SessionOptions_setFlushPublishedEventsTimeout, METH_VARARGS, NULL}, + { "blpapi_SessionOptions_setBandwidthSaveModeDisabled", _wrap_blpapi_SessionOptions_setBandwidthSaveModeDisabled, METH_VARARGS, NULL}, + { "blpapi_SessionOptions_serverHost", _wrap_blpapi_SessionOptions_serverHost, METH_O, NULL}, + { "blpapi_SessionOptions_serverPort", _wrap_blpapi_SessionOptions_serverPort, METH_O, NULL}, + { "blpapi_SessionOptions_numServerAddresses", _wrap_blpapi_SessionOptions_numServerAddresses, METH_O, NULL}, + { "blpapi_SessionOptions_getServerAddress", _wrap_blpapi_SessionOptions_getServerAddress, METH_VARARGS, NULL}, + { "blpapi_SessionOptions_connectTimeout", _wrap_blpapi_SessionOptions_connectTimeout, METH_O, NULL}, + { "blpapi_SessionOptions_defaultServices", _wrap_blpapi_SessionOptions_defaultServices, METH_O, NULL}, + { "blpapi_SessionOptions_defaultSubscriptionService", _wrap_blpapi_SessionOptions_defaultSubscriptionService, METH_O, NULL}, + { "blpapi_SessionOptions_defaultTopicPrefix", _wrap_blpapi_SessionOptions_defaultTopicPrefix, METH_O, NULL}, + { "blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg", _wrap_blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg, METH_O, NULL}, + { "blpapi_SessionOptions_clientMode", _wrap_blpapi_SessionOptions_clientMode, METH_O, NULL}, + { "blpapi_SessionOptions_maxPendingRequests", _wrap_blpapi_SessionOptions_maxPendingRequests, METH_O, NULL}, + { "blpapi_SessionOptions_autoRestartOnDisconnection", _wrap_blpapi_SessionOptions_autoRestartOnDisconnection, METH_O, NULL}, + { "blpapi_SessionOptions_authenticationOptions", _wrap_blpapi_SessionOptions_authenticationOptions, METH_O, NULL}, + { "blpapi_SessionOptions_numStartAttempts", _wrap_blpapi_SessionOptions_numStartAttempts, METH_O, NULL}, + { "blpapi_SessionOptions_maxEventQueueSize", _wrap_blpapi_SessionOptions_maxEventQueueSize, METH_O, NULL}, + { "blpapi_SessionOptions_slowConsumerWarningHiWaterMark", _wrap_blpapi_SessionOptions_slowConsumerWarningHiWaterMark, METH_O, NULL}, + { "blpapi_SessionOptions_slowConsumerWarningLoWaterMark", _wrap_blpapi_SessionOptions_slowConsumerWarningLoWaterMark, METH_O, NULL}, + { "blpapi_SessionOptions_defaultKeepAliveInactivityTime", _wrap_blpapi_SessionOptions_defaultKeepAliveInactivityTime, METH_O, NULL}, + { "blpapi_SessionOptions_defaultKeepAliveResponseTimeout", _wrap_blpapi_SessionOptions_defaultKeepAliveResponseTimeout, METH_O, NULL}, + { "blpapi_SessionOptions_keepAliveEnabled", _wrap_blpapi_SessionOptions_keepAliveEnabled, METH_O, NULL}, + { "blpapi_SessionOptions_recordSubscriptionDataReceiveTimes", _wrap_blpapi_SessionOptions_recordSubscriptionDataReceiveTimes, METH_O, NULL}, + { "blpapi_SessionOptions_serviceCheckTimeout", _wrap_blpapi_SessionOptions_serviceCheckTimeout, METH_O, NULL}, + { "blpapi_SessionOptions_serviceDownloadTimeout", _wrap_blpapi_SessionOptions_serviceDownloadTimeout, METH_O, NULL}, + { "blpapi_SessionOptions_flushPublishedEventsTimeout", _wrap_blpapi_SessionOptions_flushPublishedEventsTimeout, METH_O, NULL}, + { "blpapi_SessionOptions_bandwidthSaveModeDisabled", _wrap_blpapi_SessionOptions_bandwidthSaveModeDisabled, METH_O, NULL}, + { "blpapi_TlsOptions_destroy", _wrap_blpapi_TlsOptions_destroy, METH_O, NULL}, + { "blpapi_TlsOptions_createFromFiles", _wrap_blpapi_TlsOptions_createFromFiles, METH_VARARGS, NULL}, + { "blpapi_TlsOptions_createFromBlobs", _wrap_blpapi_TlsOptions_createFromBlobs, METH_VARARGS, NULL}, + { "blpapi_TlsOptions_setTlsHandshakeTimeoutMs", _wrap_blpapi_TlsOptions_setTlsHandshakeTimeoutMs, METH_VARARGS, NULL}, + { "blpapi_TlsOptions_setCrlFetchTimeoutMs", _wrap_blpapi_TlsOptions_setCrlFetchTimeoutMs, METH_VARARGS, NULL}, + { "blpapi_Name_create", _wrap_blpapi_Name_create, METH_O, NULL}, + { "blpapi_Name_destroy", _wrap_blpapi_Name_destroy, METH_O, NULL}, + { "blpapi_Name_equalsStr", _wrap_blpapi_Name_equalsStr, METH_VARARGS, NULL}, + { "blpapi_Name_string", _wrap_blpapi_Name_string, METH_O, NULL}, + { "blpapi_Name_length", _wrap_blpapi_Name_length, METH_O, NULL}, + { "blpapi_Name_findName", _wrap_blpapi_Name_findName, METH_O, NULL}, + { "blpapi_SubscriptionList_create", _wrap_blpapi_SubscriptionList_create, METH_NOARGS, NULL}, + { "blpapi_SubscriptionList_destroy", _wrap_blpapi_SubscriptionList_destroy, METH_O, NULL}, + { "blpapi_SubscriptionList_addResolved", _wrap_blpapi_SubscriptionList_addResolved, METH_VARARGS, NULL}, + { "blpapi_SubscriptionList_clear", _wrap_blpapi_SubscriptionList_clear, METH_O, NULL}, + { "blpapi_SubscriptionList_append", _wrap_blpapi_SubscriptionList_append, METH_VARARGS, NULL}, + { "blpapi_SubscriptionList_size", _wrap_blpapi_SubscriptionList_size, METH_O, NULL}, + { "blpapi_SubscriptionList_correlationIdAt", _wrap_blpapi_SubscriptionList_correlationIdAt, METH_VARARGS, NULL}, + { "blpapi_SubscriptionList_topicStringAt", _wrap_blpapi_SubscriptionList_topicStringAt, METH_VARARGS, NULL}, + { "blpapi_SubscriptionList_isResolvedAt", _wrap_blpapi_SubscriptionList_isResolvedAt, METH_VARARGS, NULL}, + { "blpapi_TimePoint_d_value_set", _wrap_blpapi_TimePoint_d_value_set, METH_VARARGS, NULL}, + { "blpapi_TimePoint_d_value_get", _wrap_blpapi_TimePoint_d_value_get, METH_O, NULL}, + { "new_blpapi_TimePoint", _wrap_new_blpapi_TimePoint, METH_NOARGS, NULL}, + { "delete_blpapi_TimePoint", _wrap_delete_blpapi_TimePoint, METH_O, NULL}, + { "blpapi_TimePoint_swigregister", blpapi_TimePoint_swigregister, METH_O, NULL}, + { "blpapi_TimePoint_swiginit", blpapi_TimePoint_swiginit, METH_VARARGS, NULL}, + { "blpapi_TimePointUtil_nanosecondsBetween", _wrap_blpapi_TimePointUtil_nanosecondsBetween, METH_VARARGS, NULL}, + { "blpapi_Datetime_tag_parts_set", _wrap_blpapi_Datetime_tag_parts_set, METH_VARARGS, NULL}, + { "blpapi_Datetime_tag_parts_get", _wrap_blpapi_Datetime_tag_parts_get, METH_O, NULL}, + { "blpapi_Datetime_tag_hours_set", _wrap_blpapi_Datetime_tag_hours_set, METH_VARARGS, NULL}, + { "blpapi_Datetime_tag_hours_get", _wrap_blpapi_Datetime_tag_hours_get, METH_O, NULL}, + { "blpapi_Datetime_tag_minutes_set", _wrap_blpapi_Datetime_tag_minutes_set, METH_VARARGS, NULL}, + { "blpapi_Datetime_tag_minutes_get", _wrap_blpapi_Datetime_tag_minutes_get, METH_O, NULL}, + { "blpapi_Datetime_tag_seconds_set", _wrap_blpapi_Datetime_tag_seconds_set, METH_VARARGS, NULL}, + { "blpapi_Datetime_tag_seconds_get", _wrap_blpapi_Datetime_tag_seconds_get, METH_O, NULL}, + { "blpapi_Datetime_tag_milliSeconds_set", _wrap_blpapi_Datetime_tag_milliSeconds_set, METH_VARARGS, NULL}, + { "blpapi_Datetime_tag_milliSeconds_get", _wrap_blpapi_Datetime_tag_milliSeconds_get, METH_O, NULL}, + { "blpapi_Datetime_tag_month_set", _wrap_blpapi_Datetime_tag_month_set, METH_VARARGS, NULL}, + { "blpapi_Datetime_tag_month_get", _wrap_blpapi_Datetime_tag_month_get, METH_O, NULL}, + { "blpapi_Datetime_tag_day_set", _wrap_blpapi_Datetime_tag_day_set, METH_VARARGS, NULL}, + { "blpapi_Datetime_tag_day_get", _wrap_blpapi_Datetime_tag_day_get, METH_O, NULL}, + { "blpapi_Datetime_tag_year_set", _wrap_blpapi_Datetime_tag_year_set, METH_VARARGS, NULL}, + { "blpapi_Datetime_tag_year_get", _wrap_blpapi_Datetime_tag_year_get, METH_O, NULL}, + { "blpapi_Datetime_tag_offset_set", _wrap_blpapi_Datetime_tag_offset_set, METH_VARARGS, NULL}, + { "blpapi_Datetime_tag_offset_get", _wrap_blpapi_Datetime_tag_offset_get, METH_O, NULL}, + { "new_blpapi_Datetime_tag", _wrap_new_blpapi_Datetime_tag, METH_NOARGS, NULL}, + { "delete_blpapi_Datetime_tag", _wrap_delete_blpapi_Datetime_tag, METH_O, NULL}, + { "blpapi_Datetime_tag_swigregister", blpapi_Datetime_tag_swigregister, METH_O, NULL}, + { "blpapi_Datetime_tag_swiginit", blpapi_Datetime_tag_swiginit, METH_VARARGS, NULL}, + { "blpapi_HighPrecisionDatetime_tag_datetime_set", _wrap_blpapi_HighPrecisionDatetime_tag_datetime_set, METH_VARARGS, NULL}, + { "blpapi_HighPrecisionDatetime_tag_datetime_get", _wrap_blpapi_HighPrecisionDatetime_tag_datetime_get, METH_O, NULL}, + { "blpapi_HighPrecisionDatetime_tag_picoseconds_set", _wrap_blpapi_HighPrecisionDatetime_tag_picoseconds_set, METH_VARARGS, NULL}, + { "blpapi_HighPrecisionDatetime_tag_picoseconds_get", _wrap_blpapi_HighPrecisionDatetime_tag_picoseconds_get, METH_O, NULL}, + { "new_blpapi_HighPrecisionDatetime_tag", _wrap_new_blpapi_HighPrecisionDatetime_tag, METH_NOARGS, NULL}, + { "delete_blpapi_HighPrecisionDatetime_tag", _wrap_delete_blpapi_HighPrecisionDatetime_tag, METH_O, NULL}, + { "blpapi_HighPrecisionDatetime_tag_swigregister", blpapi_HighPrecisionDatetime_tag_swigregister, METH_O, NULL}, + { "blpapi_HighPrecisionDatetime_tag_swiginit", blpapi_HighPrecisionDatetime_tag_swiginit, METH_VARARGS, NULL}, + { "blpapi_HighPrecisionDatetime_compare", _wrap_blpapi_HighPrecisionDatetime_compare, METH_VARARGS, NULL}, + { "blpapi_HighPrecisionDatetime_print", _wrap_blpapi_HighPrecisionDatetime_print, METH_VARARGS, NULL}, + { "blpapi_HighPrecisionDatetime_fromTimePoint", _wrap_blpapi_HighPrecisionDatetime_fromTimePoint, METH_VARARGS, NULL}, + { "blpapi_Constant_name", _wrap_blpapi_Constant_name, METH_O, NULL}, + { "blpapi_Constant_description", _wrap_blpapi_Constant_description, METH_O, NULL}, + { "blpapi_Constant_status", _wrap_blpapi_Constant_status, METH_O, NULL}, + { "blpapi_Constant_datatype", _wrap_blpapi_Constant_datatype, METH_O, NULL}, + { "blpapi_Constant_getValueAsChar", _wrap_blpapi_Constant_getValueAsChar, METH_O, NULL}, + { "blpapi_Constant_getValueAsInt32", _wrap_blpapi_Constant_getValueAsInt32, METH_O, NULL}, + { "blpapi_Constant_getValueAsInt64", _wrap_blpapi_Constant_getValueAsInt64, METH_O, NULL}, + { "blpapi_Constant_getValueAsFloat32", _wrap_blpapi_Constant_getValueAsFloat32, METH_O, NULL}, + { "blpapi_Constant_getValueAsFloat64", _wrap_blpapi_Constant_getValueAsFloat64, METH_O, NULL}, + { "blpapi_Constant_getValueAsDatetime", _wrap_blpapi_Constant_getValueAsDatetime, METH_O, NULL}, + { "blpapi_Constant_getValueAsString", _wrap_blpapi_Constant_getValueAsString, METH_O, NULL}, + { "blpapi_ConstantList_name", _wrap_blpapi_ConstantList_name, METH_O, NULL}, + { "blpapi_ConstantList_description", _wrap_blpapi_ConstantList_description, METH_O, NULL}, + { "blpapi_ConstantList_numConstants", _wrap_blpapi_ConstantList_numConstants, METH_O, NULL}, + { "blpapi_ConstantList_datatype", _wrap_blpapi_ConstantList_datatype, METH_O, NULL}, + { "blpapi_ConstantList_status", _wrap_blpapi_ConstantList_status, METH_O, NULL}, + { "blpapi_ConstantList_getConstant", _wrap_blpapi_ConstantList_getConstant, METH_VARARGS, NULL}, + { "blpapi_ConstantList_getConstantAt", _wrap_blpapi_ConstantList_getConstantAt, METH_VARARGS, NULL}, + { "blpapi_SchemaElementDefinition_name", _wrap_blpapi_SchemaElementDefinition_name, METH_O, NULL}, + { "blpapi_SchemaElementDefinition_description", _wrap_blpapi_SchemaElementDefinition_description, METH_O, NULL}, + { "blpapi_SchemaElementDefinition_status", _wrap_blpapi_SchemaElementDefinition_status, METH_O, NULL}, + { "blpapi_SchemaElementDefinition_type", _wrap_blpapi_SchemaElementDefinition_type, METH_O, NULL}, + { "blpapi_SchemaElementDefinition_numAlternateNames", _wrap_blpapi_SchemaElementDefinition_numAlternateNames, METH_O, NULL}, + { "blpapi_SchemaElementDefinition_getAlternateName", _wrap_blpapi_SchemaElementDefinition_getAlternateName, METH_VARARGS, NULL}, + { "blpapi_SchemaElementDefinition_minValues", _wrap_blpapi_SchemaElementDefinition_minValues, METH_O, NULL}, + { "blpapi_SchemaElementDefinition_maxValues", _wrap_blpapi_SchemaElementDefinition_maxValues, METH_O, NULL}, + { "blpapi_SchemaTypeDefinition_name", _wrap_blpapi_SchemaTypeDefinition_name, METH_O, NULL}, + { "blpapi_SchemaTypeDefinition_description", _wrap_blpapi_SchemaTypeDefinition_description, METH_O, NULL}, + { "blpapi_SchemaTypeDefinition_status", _wrap_blpapi_SchemaTypeDefinition_status, METH_O, NULL}, + { "blpapi_SchemaTypeDefinition_datatype", _wrap_blpapi_SchemaTypeDefinition_datatype, METH_O, NULL}, + { "blpapi_SchemaTypeDefinition_isComplexType", _wrap_blpapi_SchemaTypeDefinition_isComplexType, METH_O, NULL}, + { "blpapi_SchemaTypeDefinition_isSimpleType", _wrap_blpapi_SchemaTypeDefinition_isSimpleType, METH_O, NULL}, + { "blpapi_SchemaTypeDefinition_isEnumerationType", _wrap_blpapi_SchemaTypeDefinition_isEnumerationType, METH_O, NULL}, + { "blpapi_SchemaTypeDefinition_numElementDefinitions", _wrap_blpapi_SchemaTypeDefinition_numElementDefinitions, METH_O, NULL}, + { "blpapi_SchemaTypeDefinition_getElementDefinition", _wrap_blpapi_SchemaTypeDefinition_getElementDefinition, METH_VARARGS, NULL}, + { "blpapi_SchemaTypeDefinition_getElementDefinitionAt", _wrap_blpapi_SchemaTypeDefinition_getElementDefinitionAt, METH_VARARGS, NULL}, + { "blpapi_SchemaTypeDefinition_enumeration", _wrap_blpapi_SchemaTypeDefinition_enumeration, METH_O, NULL}, + { "blpapi_Request_destroy", _wrap_blpapi_Request_destroy, METH_O, NULL}, + { "blpapi_Request_elements", _wrap_blpapi_Request_elements, METH_O, NULL}, + { "blpapi_Request_setPreferredRoute", _wrap_blpapi_Request_setPreferredRoute, METH_VARARGS, NULL}, + { "blpapi_Request_getRequestId", _wrap_blpapi_Request_getRequestId, METH_O, NULL}, + { "blpapi_RequestTemplate_release", _wrap_blpapi_RequestTemplate_release, METH_O, NULL}, + { "blpapi_Operation_name", _wrap_blpapi_Operation_name, METH_O, NULL}, + { "blpapi_Operation_description", _wrap_blpapi_Operation_description, METH_O, NULL}, + { "blpapi_Operation_requestDefinition", _wrap_blpapi_Operation_requestDefinition, METH_O, NULL}, + { "blpapi_Operation_numResponseDefinitions", _wrap_blpapi_Operation_numResponseDefinitions, METH_O, NULL}, + { "blpapi_Operation_responseDefinition", _wrap_blpapi_Operation_responseDefinition, METH_VARARGS, NULL}, + { "blpapi_Operation_responseDefinitionFromName", _wrap_blpapi_Operation_responseDefinitionFromName, METH_VARARGS, NULL}, + { "blpapi_Service_name", _wrap_blpapi_Service_name, METH_O, NULL}, + { "blpapi_Service_description", _wrap_blpapi_Service_description, METH_O, NULL}, + { "blpapi_Service_numOperations", _wrap_blpapi_Service_numOperations, METH_O, NULL}, + { "blpapi_Service_numEventDefinitions", _wrap_blpapi_Service_numEventDefinitions, METH_O, NULL}, + { "blpapi_Service_addRef", _wrap_blpapi_Service_addRef, METH_O, NULL}, + { "blpapi_Service_release", _wrap_blpapi_Service_release, METH_O, NULL}, + { "blpapi_Service_authorizationServiceName", _wrap_blpapi_Service_authorizationServiceName, METH_O, NULL}, + { "blpapi_Service_getOperation", _wrap_blpapi_Service_getOperation, METH_VARARGS, NULL}, + { "blpapi_Service_getOperationAt", _wrap_blpapi_Service_getOperationAt, METH_VARARGS, NULL}, + { "blpapi_Service_getEventDefinition", _wrap_blpapi_Service_getEventDefinition, METH_VARARGS, NULL}, + { "blpapi_Service_getEventDefinitionAt", _wrap_blpapi_Service_getEventDefinitionAt, METH_VARARGS, NULL}, + { "blpapi_Service_createRequest", _wrap_blpapi_Service_createRequest, METH_VARARGS, NULL}, + { "blpapi_Service_createAuthorizationRequest", _wrap_blpapi_Service_createAuthorizationRequest, METH_VARARGS, NULL}, + { "blpapi_Service_createPublishEvent", _wrap_blpapi_Service_createPublishEvent, METH_O, NULL}, + { "blpapi_Service_createAdminEvent", _wrap_blpapi_Service_createAdminEvent, METH_O, NULL}, + { "blpapi_Service_createResponseEvent", _wrap_blpapi_Service_createResponseEvent, METH_VARARGS, NULL}, + { "blpapi_Message_messageType", _wrap_blpapi_Message_messageType, METH_O, NULL}, + { "blpapi_Message_topicName", _wrap_blpapi_Message_topicName, METH_O, NULL}, + { "blpapi_Message_service", _wrap_blpapi_Message_service, METH_O, NULL}, + { "blpapi_Message_numCorrelationIds", _wrap_blpapi_Message_numCorrelationIds, METH_O, NULL}, + { "blpapi_Message_correlationId", _wrap_blpapi_Message_correlationId, METH_VARARGS, NULL}, + { "blpapi_Message_getRequestId", _wrap_blpapi_Message_getRequestId, METH_O, NULL}, + { "blpapi_Message_elements", _wrap_blpapi_Message_elements, METH_O, NULL}, + { "blpapi_Message_fragmentType", _wrap_blpapi_Message_fragmentType, METH_O, NULL}, + { "blpapi_Message_recapType", _wrap_blpapi_Message_recapType, METH_O, NULL}, + { "blpapi_Message_addRef", _wrap_blpapi_Message_addRef, METH_O, NULL}, + { "blpapi_Message_release", _wrap_blpapi_Message_release, METH_O, NULL}, + { "blpapi_Message_timeReceived", _wrap_blpapi_Message_timeReceived, METH_O, NULL}, + { "blpapi_Event_eventType", _wrap_blpapi_Event_eventType, METH_O, NULL}, + { "blpapi_Event_release", _wrap_blpapi_Event_release, METH_O, NULL}, + { "blpapi_EventQueue_create", _wrap_blpapi_EventQueue_create, METH_NOARGS, NULL}, + { "blpapi_EventQueue_destroy", _wrap_blpapi_EventQueue_destroy, METH_O, NULL}, + { "blpapi_EventQueue_nextEvent", _wrap_blpapi_EventQueue_nextEvent, METH_VARARGS, NULL}, + { "blpapi_EventQueue_purge", _wrap_blpapi_EventQueue_purge, METH_O, NULL}, + { "blpapi_EventQueue_tryNextEvent", _wrap_blpapi_EventQueue_tryNextEvent, METH_O, NULL}, + { "blpapi_MessageIterator_create", _wrap_blpapi_MessageIterator_create, METH_O, NULL}, + { "blpapi_MessageIterator_destroy", _wrap_blpapi_MessageIterator_destroy, METH_O, NULL}, + { "blpapi_MessageIterator_next", _wrap_blpapi_MessageIterator_next, METH_O, NULL}, + { "blpapi_Identity_release", _wrap_blpapi_Identity_release, METH_O, NULL}, + { "blpapi_Identity_addRef", _wrap_blpapi_Identity_addRef, METH_O, NULL}, + { "blpapi_Identity_hasEntitlements", _wrap_blpapi_Identity_hasEntitlements, METH_VARARGS, NULL}, + { "blpapi_Identity_isAuthorized", _wrap_blpapi_Identity_isAuthorized, METH_VARARGS, NULL}, + { "blpapi_Identity_getSeatType", _wrap_blpapi_Identity_getSeatType, METH_O, NULL}, + { "blpapi_HighResolutionClock_now", _wrap_blpapi_HighResolutionClock_now, METH_NOARGS, NULL}, + { "blpapi_AbstractSession_cancel", _wrap_blpapi_AbstractSession_cancel, METH_VARARGS, NULL}, + { "blpapi_AbstractSession_sendAuthorizationRequest", _wrap_blpapi_AbstractSession_sendAuthorizationRequest, METH_VARARGS, NULL}, + { "blpapi_AbstractSession_openService", _wrap_blpapi_AbstractSession_openService, METH_VARARGS, NULL}, + { "blpapi_AbstractSession_openServiceAsync", _wrap_blpapi_AbstractSession_openServiceAsync, METH_VARARGS, NULL}, + { "blpapi_AbstractSession_generateToken", _wrap_blpapi_AbstractSession_generateToken, METH_VARARGS, NULL}, + { "blpapi_AbstractSession_generateManualToken", _wrap_blpapi_AbstractSession_generateManualToken, METH_VARARGS, NULL}, + { "blpapi_AbstractSession_getService", _wrap_blpapi_AbstractSession_getService, METH_VARARGS, NULL}, + { "blpapi_AbstractSession_createIdentity", _wrap_blpapi_AbstractSession_createIdentity, METH_O, NULL}, + { "blpapi_AbstractSession_generateAuthorizedIdentityAsync", _wrap_blpapi_AbstractSession_generateAuthorizedIdentityAsync, METH_VARARGS, NULL}, + { "blpapi_AbstractSession_getAuthorizedIdentity", _wrap_blpapi_AbstractSession_getAuthorizedIdentity, METH_VARARGS, NULL}, + { "blpapi_Session_start", _wrap_blpapi_Session_start, METH_O, NULL}, + { "blpapi_Session_startAsync", _wrap_blpapi_Session_startAsync, METH_O, NULL}, + { "blpapi_Session_stop", _wrap_blpapi_Session_stop, METH_O, NULL}, + { "blpapi_Session_stopAsync", _wrap_blpapi_Session_stopAsync, METH_O, NULL}, + { "blpapi_Session_nextEvent", _wrap_blpapi_Session_nextEvent, METH_VARARGS, NULL}, + { "blpapi_Session_tryNextEvent", _wrap_blpapi_Session_tryNextEvent, METH_O, NULL}, + { "blpapi_Session_subscribe", _wrap_blpapi_Session_subscribe, METH_VARARGS, NULL}, + { "blpapi_Session_resubscribe", _wrap_blpapi_Session_resubscribe, METH_VARARGS, NULL}, + { "blpapi_Session_resubscribeWithId", _wrap_blpapi_Session_resubscribeWithId, METH_VARARGS, NULL}, + { "blpapi_Session_unsubscribe", _wrap_blpapi_Session_unsubscribe, METH_VARARGS, NULL}, + { "blpapi_Session_setStatusCorrelationId", _wrap_blpapi_Session_setStatusCorrelationId, METH_VARARGS, NULL}, + { "blpapi_Session_sendRequest", _wrap_blpapi_Session_sendRequest, METH_VARARGS, NULL}, + { "blpapi_Session_sendRequestTemplate", _wrap_blpapi_Session_sendRequestTemplate, METH_VARARGS, NULL}, + { "blpapi_Session_createSnapshotRequestTemplate", _wrap_blpapi_Session_createSnapshotRequestTemplate, METH_VARARGS, NULL}, + { "blpapi_Session_getAbstractSession", _wrap_blpapi_Session_getAbstractSession, METH_O, NULL}, + { "blpapi_ResolutionList_extractAttributeFromResolutionSuccess", _wrap_blpapi_ResolutionList_extractAttributeFromResolutionSuccess, METH_VARARGS, NULL}, + { "blpapi_ResolutionList_create", _wrap_blpapi_ResolutionList_create, METH_O, NULL}, + { "blpapi_ResolutionList_destroy", _wrap_blpapi_ResolutionList_destroy, METH_O, NULL}, + { "blpapi_ResolutionList_add", _wrap_blpapi_ResolutionList_add, METH_VARARGS, NULL}, + { "blpapi_ResolutionList_addFromMessage", _wrap_blpapi_ResolutionList_addFromMessage, METH_VARARGS, NULL}, + { "blpapi_ResolutionList_addAttribute", _wrap_blpapi_ResolutionList_addAttribute, METH_VARARGS, NULL}, + { "blpapi_ResolutionList_correlationIdAt", _wrap_blpapi_ResolutionList_correlationIdAt, METH_VARARGS, NULL}, + { "blpapi_ResolutionList_topicString", _wrap_blpapi_ResolutionList_topicString, METH_VARARGS, NULL}, + { "blpapi_ResolutionList_topicStringAt", _wrap_blpapi_ResolutionList_topicStringAt, METH_VARARGS, NULL}, + { "blpapi_ResolutionList_status", _wrap_blpapi_ResolutionList_status, METH_VARARGS, NULL}, + { "blpapi_ResolutionList_statusAt", _wrap_blpapi_ResolutionList_statusAt, METH_VARARGS, NULL}, + { "blpapi_ResolutionList_attribute", _wrap_blpapi_ResolutionList_attribute, METH_VARARGS, NULL}, + { "blpapi_ResolutionList_attributeAt", _wrap_blpapi_ResolutionList_attributeAt, METH_VARARGS, NULL}, + { "blpapi_ResolutionList_message", _wrap_blpapi_ResolutionList_message, METH_VARARGS, NULL}, + { "blpapi_ResolutionList_messageAt", _wrap_blpapi_ResolutionList_messageAt, METH_VARARGS, NULL}, + { "blpapi_ResolutionList_size", _wrap_blpapi_ResolutionList_size, METH_O, NULL}, + { "blpapi_TestUtil_createEvent", _wrap_blpapi_TestUtil_createEvent, METH_O, NULL}, + { "blpapi_TestUtil_deserializeService", _wrap_blpapi_TestUtil_deserializeService, METH_VARARGS, NULL}, + { "blpapi_TestUtil_serializeService", _wrap_blpapi_TestUtil_serializeService, METH_VARARGS, NULL}, + { "blpapi_TestUtil_appendMessage", _wrap_blpapi_TestUtil_appendMessage, METH_VARARGS, NULL}, + { "blpapi_TestUtil_createTopic", _wrap_blpapi_TestUtil_createTopic, METH_VARARGS, NULL}, + { "blpapi_TestUtil_getAdminMessageDefinition", _wrap_blpapi_TestUtil_getAdminMessageDefinition, METH_O, NULL}, + { "blpapi_MessageProperties_create", _wrap_blpapi_MessageProperties_create, METH_NOARGS, NULL}, + { "blpapi_MessageProperties_destroy", _wrap_blpapi_MessageProperties_destroy, METH_O, NULL}, + { "blpapi_MessageProperties_copy", _wrap_blpapi_MessageProperties_copy, METH_O, NULL}, + { "blpapi_MessageProperties_assign", _wrap_blpapi_MessageProperties_assign, METH_VARARGS, NULL}, + { "blpapi_MessageProperties_setCorrelationIds", _wrap_blpapi_MessageProperties_setCorrelationIds, METH_VARARGS, NULL}, + { "blpapi_MessageProperties_setRecapType", _wrap_blpapi_MessageProperties_setRecapType, METH_VARARGS, NULL}, + { "blpapi_MessageProperties_setTimeReceived", _wrap_blpapi_MessageProperties_setTimeReceived, METH_VARARGS, NULL}, + { "blpapi_MessageProperties_setService", _wrap_blpapi_MessageProperties_setService, METH_VARARGS, NULL}, + { "blpapi_MessageProperties_setRequestId", _wrap_blpapi_MessageProperties_setRequestId, METH_VARARGS, NULL}, + { "blpapi_Topic_create", _wrap_blpapi_Topic_create, METH_O, NULL}, + { "blpapi_Topic_destroy", _wrap_blpapi_Topic_destroy, METH_O, NULL}, + { "blpapi_Topic_compare", _wrap_blpapi_Topic_compare, METH_VARARGS, NULL}, + { "blpapi_Topic_service", _wrap_blpapi_Topic_service, METH_O, NULL}, + { "blpapi_Topic_isActive", _wrap_blpapi_Topic_isActive, METH_O, NULL}, + { "blpapi_TopicList_create", _wrap_blpapi_TopicList_create, METH_O, NULL}, + { "blpapi_TopicList_destroy", _wrap_blpapi_TopicList_destroy, METH_O, NULL}, + { "blpapi_TopicList_add", _wrap_blpapi_TopicList_add, METH_VARARGS, NULL}, + { "blpapi_TopicList_addFromMessage", _wrap_blpapi_TopicList_addFromMessage, METH_VARARGS, NULL}, + { "blpapi_TopicList_correlationIdAt", _wrap_blpapi_TopicList_correlationIdAt, METH_VARARGS, NULL}, + { "blpapi_TopicList_topicString", _wrap_blpapi_TopicList_topicString, METH_VARARGS, NULL}, + { "blpapi_TopicList_topicStringAt", _wrap_blpapi_TopicList_topicStringAt, METH_VARARGS, NULL}, + { "blpapi_TopicList_status", _wrap_blpapi_TopicList_status, METH_VARARGS, NULL}, + { "blpapi_TopicList_statusAt", _wrap_blpapi_TopicList_statusAt, METH_VARARGS, NULL}, + { "blpapi_TopicList_message", _wrap_blpapi_TopicList_message, METH_VARARGS, NULL}, + { "blpapi_TopicList_messageAt", _wrap_blpapi_TopicList_messageAt, METH_VARARGS, NULL}, + { "blpapi_TopicList_size", _wrap_blpapi_TopicList_size, METH_O, NULL}, + { "blpapi_ProviderSession_create", _wrap_blpapi_ProviderSession_create, METH_VARARGS, NULL}, + { "blpapi_ProviderSession_destroy", _wrap_blpapi_ProviderSession_destroy, METH_O, NULL}, + { "blpapi_ProviderSession_start", _wrap_blpapi_ProviderSession_start, METH_O, NULL}, + { "blpapi_ProviderSession_startAsync", _wrap_blpapi_ProviderSession_startAsync, METH_O, NULL}, + { "blpapi_ProviderSession_stop", _wrap_blpapi_ProviderSession_stop, METH_O, NULL}, + { "blpapi_ProviderSession_stopAsync", _wrap_blpapi_ProviderSession_stopAsync, METH_O, NULL}, + { "blpapi_ProviderSession_nextEvent", _wrap_blpapi_ProviderSession_nextEvent, METH_VARARGS, NULL}, + { "blpapi_ProviderSession_tryNextEvent", _wrap_blpapi_ProviderSession_tryNextEvent, METH_O, NULL}, + { "blpapi_ProviderSession_registerService", _wrap_blpapi_ProviderSession_registerService, METH_VARARGS, NULL}, + { "blpapi_ProviderSession_activateSubServiceCodeRange", _wrap_blpapi_ProviderSession_activateSubServiceCodeRange, METH_VARARGS, NULL}, + { "blpapi_ProviderSession_deactivateSubServiceCodeRange", _wrap_blpapi_ProviderSession_deactivateSubServiceCodeRange, METH_VARARGS, NULL}, + { "blpapi_ProviderSession_registerServiceAsync", _wrap_blpapi_ProviderSession_registerServiceAsync, METH_VARARGS, NULL}, + { "blpapi_ProviderSession_deregisterService", _wrap_blpapi_ProviderSession_deregisterService, METH_VARARGS, NULL}, + { "blpapi_ProviderSession_resolve", _wrap_blpapi_ProviderSession_resolve, METH_VARARGS, NULL}, + { "blpapi_ProviderSession_resolveAsync", _wrap_blpapi_ProviderSession_resolveAsync, METH_VARARGS, NULL}, + { "blpapi_ProviderSession_createTopics", _wrap_blpapi_ProviderSession_createTopics, METH_VARARGS, NULL}, + { "blpapi_ProviderSession_createTopicsAsync", _wrap_blpapi_ProviderSession_createTopicsAsync, METH_VARARGS, NULL}, + { "blpapi_ProviderSession_getTopic", _wrap_blpapi_ProviderSession_getTopic, METH_VARARGS, NULL}, + { "blpapi_ProviderSession_createTopic", _wrap_blpapi_ProviderSession_createTopic, METH_VARARGS, NULL}, + { "blpapi_ProviderSession_createServiceStatusTopic", _wrap_blpapi_ProviderSession_createServiceStatusTopic, METH_VARARGS, NULL}, + { "blpapi_ProviderSession_deleteTopics", _wrap_blpapi_ProviderSession_deleteTopics, METH_VARARGS, NULL}, + { "blpapi_ProviderSession_terminateSubscriptionsOnTopics", _wrap_blpapi_ProviderSession_terminateSubscriptionsOnTopics, METH_VARARGS, NULL}, + { "blpapi_ProviderSession_publish", _wrap_blpapi_ProviderSession_publish, METH_VARARGS, NULL}, + { "blpapi_ProviderSession_sendResponse", _wrap_blpapi_ProviderSession_sendResponse, METH_VARARGS, NULL}, + { "blpapi_ProviderSession_getAbstractSession", _wrap_blpapi_ProviderSession_getAbstractSession, METH_O, NULL}, + { "blpapi_ProviderSession_flushPublishedEvents", _wrap_blpapi_ProviderSession_flushPublishedEvents, METH_VARARGS, NULL}, + { "blpapi_ServiceRegistrationOptions_create", _wrap_blpapi_ServiceRegistrationOptions_create, METH_NOARGS, NULL}, + { "blpapi_ServiceRegistrationOptions_duplicate", _wrap_blpapi_ServiceRegistrationOptions_duplicate, METH_O, NULL}, + { "blpapi_ServiceRegistrationOptions_destroy", _wrap_blpapi_ServiceRegistrationOptions_destroy, METH_O, NULL}, + { "blpapi_ServiceRegistrationOptions_copy", _wrap_blpapi_ServiceRegistrationOptions_copy, METH_VARARGS, NULL}, + { "blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange", _wrap_blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange, METH_VARARGS, NULL}, + { "blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges", _wrap_blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges, METH_O, NULL}, + { "blpapi_ServiceRegistrationOptions_setGroupId", _wrap_blpapi_ServiceRegistrationOptions_setGroupId, METH_VARARGS, NULL}, + { "blpapi_ServiceRegistrationOptions_setServicePriority", _wrap_blpapi_ServiceRegistrationOptions_setServicePriority, METH_VARARGS, NULL}, + { "blpapi_ServiceRegistrationOptions_setPartsToRegister", _wrap_blpapi_ServiceRegistrationOptions_setPartsToRegister, METH_VARARGS, NULL}, + { "blpapi_ServiceRegistrationOptions_getGroupId", _wrap_blpapi_ServiceRegistrationOptions_getGroupId, METH_O, NULL}, + { "blpapi_ServiceRegistrationOptions_getServicePriority", _wrap_blpapi_ServiceRegistrationOptions_getServicePriority, METH_O, NULL}, + { "blpapi_ServiceRegistrationOptions_getPartsToRegister", _wrap_blpapi_ServiceRegistrationOptions_getPartsToRegister, METH_O, NULL}, + { "blpapi_ZfpUtil_getOptionsForLeasedLines", _wrap_blpapi_ZfpUtil_getOptionsForLeasedLines, METH_VARARGS, NULL}, + { NULL, NULL, 0, NULL } +}; + +static PyMethodDef SwigMethods_proxydocs[] = { { NULL, NULL, 0, NULL } }; @@ -23057,7 +22530,7 @@ SWIG_InitializeModule(void *clientdata) { /* Now work on filling in swig_module.types */ #ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: size %d\n", swig_module.size); + printf("SWIG_InitializeModule: size %lu\n", (unsigned long)swig_module.size); #endif for (i = 0; i < swig_module.size; ++i) { swig_type_info *type = 0; @@ -23065,7 +22538,7 @@ SWIG_InitializeModule(void *clientdata) { swig_cast_info *cast; #ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); + printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name); #endif /* if there is another module already loaded */ @@ -23140,7 +22613,7 @@ SWIG_InitializeModule(void *clientdata) { for (i = 0; i < swig_module.size; ++i) { int j = 0; swig_cast_info *cast = swig_module.cast_initial[i]; - printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); + printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name); while (cast->type) { printf("SWIG_InitializeModule: cast type %s\n", cast->type->name); cast++; @@ -23262,17 +22735,6 @@ extern "C" { return str; } - SWIGINTERN int - swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { - char *tmp; - PyObject *str = swig_varlink_str(v); - fprintf(fp,"Swig global variables "); - fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str)); - SWIG_Python_str_DelForPy3(tmp); - Py_DECREF(str); - return 0; - } - SWIGINTERN void swig_varlink_dealloc(swig_varlinkobject *v) { swig_globalvar *var = v->vars; @@ -23331,11 +22793,11 @@ extern "C" { PyObject_HEAD_INIT(NULL) 0, /* ob_size */ #endif - (char *)"swigvarlink", /* tp_name */ + "swigvarlink", /* tp_name */ sizeof(swig_varlinkobject), /* tp_basicsize */ 0, /* tp_itemsize */ (destructor) swig_varlink_dealloc, /* tp_dealloc */ - (printfunc) swig_varlink_print, /* tp_print */ + 0, /* tp_print */ (getattrfunc) swig_varlink_getattr, /* tp_getattr */ (setattrfunc) swig_varlink_setattr, /* tp_setattr */ 0, /* tp_compare */ @@ -23355,15 +22817,9 @@ extern "C" { 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ -#if PY_VERSION_HEX >= 0x02020000 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */ -#endif -#if PY_VERSION_HEX >= 0x02030000 0, /* tp_del */ -#endif -#if PY_VERSION_HEX >= 0x02060000 0, /* tp_version_tag */ -#endif #if PY_VERSION_HEX >= 0x03040000 0, /* tp_finalize */ #endif @@ -23371,20 +22827,14 @@ extern "C" { 0, /* tp_allocs */ 0, /* tp_frees */ 0, /* tp_maxalloc */ -#if PY_VERSION_HEX >= 0x02050000 0, /* tp_prev */ -#endif 0 /* tp_next */ #endif }; varlink_type = tmp; type_init = 1; -#if PY_VERSION_HEX < 0x02020000 - varlink_type.ob_type = &PyType_Type; -#else if (PyType_Ready(&varlink_type) < 0) return NULL; -#endif } return &varlink_type; } @@ -23400,14 +22850,14 @@ extern "C" { } SWIGINTERN void - SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) { + 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) { - strncpy(gv->name,name,size); + memcpy(gv->name, name, size); gv->get_attr = get_attr; gv->set_attr = set_attr; gv->next = v->vars; @@ -23418,9 +22868,11 @@ extern "C" { SWIGINTERN PyObject * SWIG_globals(void) { - static PyObject *_SWIG_globals = 0; - if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink(); - return _SWIG_globals; + static PyObject *globals = 0; + if (!globals) { + globals = SWIG_newvarlink(); + } + return globals; } /* ----------------------------------------------------------------------------- @@ -23486,9 +22938,9 @@ extern "C" { char *ndoc = (char*)malloc(ldoc + lptr + 10); if (ndoc) { char *buff = ndoc; - strncpy(buff, methods[i].ml_doc, ldoc); + memcpy(buff, methods[i].ml_doc, ldoc); buff += ldoc; - strncpy(buff, "swig_ptr: ", 10); + memcpy(buff, "swig_ptr: ", 10); buff += 10; SWIG_PackVoidPtr(buff, ptr, ty->name, lptr); methods[i].ml_doc = ndoc; @@ -23499,6 +22951,64 @@ 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 @@ -23518,20 +23028,12 @@ PyObject* void #endif SWIG_init(void) { - PyObject *m, *d, *md; + PyObject *m, *d, *md, *globals; + #if PY_VERSION_HEX >= 0x03000000 static struct PyModuleDef SWIG_module = { -# if PY_VERSION_HEX >= 0x03020000 PyModuleDef_HEAD_INIT, -# else - { - PyObject_HEAD_INIT(NULL) - NULL, /* m_init */ - 0, /* m_index */ - NULL, /* m_copy */ - }, -# endif - (char *) SWIG_name, + SWIG_name, NULL, -1, SwigMethods, @@ -23550,8 +23052,8 @@ SWIG_init(void) { (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL }; static SwigPyGetSet thisown_getset_closure = { - (PyCFunction) SwigPyObject_own, - (PyCFunction) SwigPyObject_own + SwigPyObject_own, + SwigPyObject_own }; static PyGetSetDef thisown_getset_def = { (char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure @@ -23582,13 +23084,23 @@ SWIG_init(void) { assert(metatype); #endif + (void)globals; + + /* Create singletons now to avoid potential deadlocks with multi-threaded usage after module initialization */ + SWIG_This(); + SWIG_Python_TypeCache(); + SwigPyPacked_type(); +#ifndef SWIGPYTHON_BUILTIN + SwigPyObject_type(); +#endif + /* Fix SwigMethods to carry the callback ptrs when needed */ SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial); #if PY_VERSION_HEX >= 0x03000000 m = PyModule_Create(&SWIG_module); #else - m = Py_InitModule((char *) SWIG_name, SwigMethods); + m = Py_InitModule(SWIG_name, SwigMethods); #endif md = d = PyModule_GetDict(m); @@ -23754,7 +23266,7 @@ SWIG_init(void) { SWIG_Python_SetConstant(d, "UNSUPPORTED_CLASS",SWIG_From_int((int)(0x80000))); SWIG_Python_SetConstant(d, "ERROR_UNKNOWN",SWIG_From_int((int)((0x00000|1)))); SWIG_Python_SetConstant(d, "ERROR_ILLEGAL_ARG",SWIG_From_int((int)((0x20000|2)))); - SWIG_Python_SetConstant(d, "ERROR_ILLEGAL_ACCESS",SWIG_From_int((int)((0x00000|3)))); + SWIG_Python_SetConstant(d, "ERROR_ILLEGAL_ACCESS",SWIG_From_int((int)((0x80000|3)))); SWIG_Python_SetConstant(d, "ERROR_INVALID_SESSION",SWIG_From_int((int)((0x20000|4)))); SWIG_Python_SetConstant(d, "ERROR_DUPLICATE_CORRELATIONID",SWIG_From_int((int)((0x20000|5)))); SWIG_Python_SetConstant(d, "ERROR_INTERNAL_ERROR",SWIG_From_int((int)((0x00000|6)))); diff --git a/blpapi/logging.py b/src/blpapi/logging.py similarity index 100% rename from blpapi/logging.py rename to src/blpapi/logging.py diff --git a/blpapi/message.py b/src/blpapi/message.py similarity index 96% rename from blpapi/message.py rename to src/blpapi/message.py index 5bdc13b..7a130dc 100644 --- a/blpapi/message.py +++ b/src/blpapi/message.py @@ -18,8 +18,7 @@ from . import internals from .utils import deprecated, MetaClassForClassesWithEnums from .compat import with_metaclass - -# pylint: disable=useless-object-inheritance,protected-access +from .chandle import CHandle # Handling a circular dependancy between modules: # service->event->message->service @@ -27,9 +26,10 @@ if service is None: from . import service +# pylint: disable=protected-access @with_metaclass(MetaClassForClassesWithEnums) -class Message(object): +class Message(CHandle): """A handle to a single message. :class:`Message` objects are obtained by iterating an :class:`Event`. Each @@ -55,8 +55,6 @@ class Message(object): the application. """ - __handle = None - FRAGMENT_NONE = internals.MESSAGE_FRAGMENT_NONE """Unfragmented message""" FRAGMENT_START = internals.MESSAGE_FRAGMENT_START @@ -81,6 +79,7 @@ def __init__(self, handle, event=None, sessions=None): sessions: Sessions that this object is associated with """ internals.blpapi_Message_addRef(handle) + super(Message, self).__init__(handle, internals.blpapi_Message_release) self.__handle = handle if event is None: if sessions is None: @@ -92,17 +91,6 @@ def __init__(self, handle, event=None, sessions=None): self.__element = None - def __del__(self): - try: - self.destroy() - except (NameError, AttributeError): - pass - - def destroy(self): - if self.__handle is not None: - internals.blpapi_Message_release(self.__handle) - self.__handle = None - def __str__(self): """x.__str__() <==> str(x) @@ -322,9 +310,6 @@ def timeReceived(self, tzinfo=UTC): native = _DatetimeUtil.convertToNative(original) return native.astimezone(tzinfo) - def _handle(self): - return self.__handle - def _sessions(self): """Return session(s) this Message related to. For internal use.""" return self.__sessions diff --git a/blpapi/name.py b/src/blpapi/name.py similarity index 90% rename from blpapi/name.py rename to src/blpapi/name.py index fa2e7f9..25900c4 100644 --- a/blpapi/name.py +++ b/src/blpapi/name.py @@ -10,10 +10,11 @@ from . import internals from .compat import conv2str, tolong, isstr from .utils import get_handle +from .chandle import CHandle -# pylint: disable=useless-object-inheritance,broad-except +# pylint: disable=broad-except -class Name(object): +class Name(CHandle): """:class:`Name` represents a string in a form which is efficient for comparison. @@ -47,8 +48,6 @@ class Name(object): an unbounded manner. """ - __handle = None - @staticmethod def findName(nameString): """ @@ -80,21 +79,11 @@ def _createInternally(handle): return Name(None, handle) def __init__(self, nameString, internalHandle=None): - if internalHandle is not None: - self.__handle = internalHandle - else: - self.__handle = internals.blpapi_Name_create(nameString) - - def __del__(self): - try: - self.destroy() - except (NameError, AttributeError): - pass - - def destroy(self): - if self.__handle: - internals.blpapi_Name_destroy(self.__handle) - self.__handle = None + selfhandle = internalHandle + if selfhandle is None: + selfhandle = internals.blpapi_Name_create(nameString) + super(Name, self).__init__(selfhandle, internals.blpapi_Name_destroy) + self.__handle = selfhandle def __len__(self): """Return the length of the string that this Name represents. @@ -131,9 +120,6 @@ def __hash__(self): """x.__hash__() <==> hash(x)""" return tolong(self.__handle) - def _handle(self): - return self.__handle - def getNamePair(name): """Create a tuple that contains a name string and blpapi_Name_t*. diff --git a/blpapi/providersession.py b/src/blpapi/providersession.py similarity index 97% rename from blpapi/providersession.py rename to src/blpapi/providersession.py index 48212b2..171af8e 100644 --- a/blpapi/providersession.py +++ b/src/blpapi/providersession.py @@ -64,6 +64,7 @@ import traceback import os import functools +import atexit from .abstractsession import AbstractSession from .event import Event from . import exception @@ -75,12 +76,13 @@ from . import utils from .utils import get_handle from .compat import with_metaclass +from .chandle import CHandle -# pylint: disable=line-too-long,useless-object-inheritance,too-many-lines +# pylint: disable=line-too-long,too-many-lines # pylint: disable=protected-access,too-many-public-methods,bare-except,too-many-function-args @with_metaclass(utils.MetaClassForClassesWithEnums) -class ServiceRegistrationOptions(object): +class ServiceRegistrationOptions(CHandle): """Contains the options which can be specified when registering a service. To use non-default options to :meth:`~ProviderSession.registerService()`, @@ -134,19 +136,11 @@ class ServiceRegistrationOptions(object): def __init__(self): """Create :class:`ServiceRegistrationOptions` with default options.""" - self.__handle = internals.blpapi_ServiceRegistrationOptions_create() - - def __del__(self): - try: - self.destroy() - except (NameError, AttributeError): - pass - - def destroy(self): - """Destroy this :class:`ServiceRegistrationOptions`.""" - if self.__handle: - internals.blpapi_ServiceRegistrationOptions_destroy(self.__handle) - self.__handle = None + selfhandle = internals.blpapi_ServiceRegistrationOptions_create() + super(ServiceRegistrationOptions, self).__init__( + selfhandle, + internals.blpapi_ServiceRegistrationOptions_destroy) + self.__handle = selfhandle def setGroupId(self, groupId): """Set the Group ID for the service to be registered. @@ -256,10 +250,6 @@ def getPartsToRegister(self): return internals.blpapi_ServiceRegistrationOptions_getPartsToRegister( self.__handle) - def _handle(self): - """Return the internal implementation.""" - return self.__handle - @with_metaclass(utils.MetaClassForClassesWithEnums) class ProviderSession(AbstractSession): @@ -371,23 +361,16 @@ def __init__(self, options=None, eventHandler=None, eventDispatcher=None): get_handle(options), self.__handlerProxy, get_handle(eventDispatcher)) + + _destroy = internals.ProviderSession_destroyHelper + # note: AbstractSession destroy passes AbstractSession handle + _dtor = lambda hndl: _destroy(self.__handle, self.__handlerProxy) + + atexit.register(self.stop) # we must stop session before shutdown AbstractSession.__init__( self, - internals.blpapi_ProviderSession_getAbstractSession(self.__handle)) - - def __del__(self): - try: - self.destroy() - except (NameError, AttributeError): - pass - - def destroy(self): - """Destructor.""" - if self.__handle: - internals.ProviderSession_destroyHelper( - self.__handle, - self.__handlerProxy) - self.__handle = None + internals.blpapi_ProviderSession_getAbstractSession(self.__handle), + _dtor) def start(self): """Start this :class:`Session` in synchronous mode. @@ -461,6 +444,8 @@ def stop(self): deadlock. Once a :class:`Session` has been stopped it can only be destroyed. """ + if sys.version_info >= (3, 6): + atexit.unregister(self.stop) return internals.blpapi_ProviderSession_stop(self.__handle) == 0 def stopAsync(self): @@ -997,10 +982,6 @@ def deleteTopics(self, topics): finally: internals.delete_topicPtrArray(topicsCArray) - def _handle(self): - """Return the internal implementation.""" - return self.__handle - __copyright__ = """ Copyright 2012. Bloomberg Finance L.P. diff --git a/blpapi/request.py b/src/blpapi/request.py similarity index 91% rename from blpapi/request.py rename to src/blpapi/request.py index aeed537..6b20f13 100644 --- a/blpapi/request.py +++ b/src/blpapi/request.py @@ -11,10 +11,9 @@ from .element import Element from .exception import _ExceptionUtil from . import internals +from .chandle import CHandle -# pylint: disable=useless-object-inheritance - -class Request(object): +class Request(CHandle): """A single request to a single service. :class:`Request` objects are created using :meth:`Service.createRequest()` @@ -33,22 +32,11 @@ class Request(object): """ def __init__(self, handle, sessions): + super(Request, self).__init__(handle, internals.blpapi_Request_destroy) self.__handle = handle self.__sessions = sessions self.__element = None - def __del__(self): - try: - self.destroy() - except (NameError, AttributeError): - pass - - def destroy(self): - """Destructor.""" - if self.__handle: - internals.blpapi_Request_destroy(self.__handle) - self.__handle = None - def __str__(self): """x.__str__() <==> str(x) @@ -111,9 +99,6 @@ def toString(self, level=0, spacesPerLevel=4): `.""" return self.asElement().toString(level, spacesPerLevel) - def _handle(self): - return self.__handle - def _sessions(self): """Return session(s) this Request related to. For internal use.""" return self.__sessions diff --git a/blpapi/requesttemplate.py b/src/blpapi/requesttemplate.py similarity index 80% rename from blpapi/requesttemplate.py rename to src/blpapi/requesttemplate.py index 3f40c9c..bfbf583 100644 --- a/blpapi/requesttemplate.py +++ b/src/blpapi/requesttemplate.py @@ -18,31 +18,16 @@ """ from . import internals +from .chandle import CHandle -# pylint: disable=useless-object-inheritance - -class RequestTemplate(object): +class RequestTemplate(CHandle): """Request templates cache the necessary information to make a request and eliminate the need to create new requests for snapshot services. """ def __init__(self, handle): - self.__handle = handle - - def __del__(self): - try: - self.destroy() - except (NameError, AttributeError): - pass - - def destroy(self): - if self.__handle: - internals.blpapi_RequestTemplate_release(self.__handle) - self.__handle = None - - def _handle(self): - """Return the internal implementation.""" - return self.__handle + super(RequestTemplate, self).__init__( + handle, internals.blpapi_RequestTemplate_release) __copyright__ = """ Copyright 2018. Bloomberg Finance L.P. diff --git a/blpapi/resolutionlist.py b/src/blpapi/resolutionlist.py similarity index 94% rename from blpapi/resolutionlist.py rename to src/blpapi/resolutionlist.py index 8d4c25b..4283745 100644 --- a/blpapi/resolutionlist.py +++ b/src/blpapi/resolutionlist.py @@ -12,11 +12,11 @@ from .utils import deprecated, get_handle from .internals import CorrelationId from .compat import with_metaclass +from .chandle import CHandle -# pylint: disable=useless-object-inheritance @with_metaclass(utils.MetaClassForClassesWithEnums) -class ResolutionList(object): +class ResolutionList(CHandle): """Contains a list of topics that require resolution. Created from topic strings or from ``SUBSCRIPTION_STARTED`` messages. This @@ -55,22 +55,13 @@ def extractAttributeFromResolutionSuccess(message, attribute): def __init__(self): """Create an empty :class:`ResolutionList`.""" - self.__handle = internals.blpapi_ResolutionList_create(None) + selfhandle = internals.blpapi_ResolutionList_create(None) + super(ResolutionList, self).__init__( + selfhandle, + internals.blpapi_ResolutionList_destroy) + self.__handle = selfhandle self.__sessions = set() - def __del__(self): - """Destroy this :class:`ResolutionList`.""" - try: - self.destroy() - except (NameError, AttributeError): - pass - - def destroy(self): - """Destroy resolutionlist""" - if self.__handle: - internals.blpapi_ResolutionList_destroy(self.__handle) - self.__handle = None - def add(self, topicOrMessage, correlationId=None): """Add the specified topic or topic from message to this list. @@ -302,10 +293,6 @@ def size(self): """ return internals.blpapi_ResolutionList_size(self.__handle) - def _handle(self): - """Return the internal implementation.""" - return self.__handle - def _sessions(self): """Return session(s) that this 'ResolutionList' is related to. diff --git a/blpapi/schema.py b/src/blpapi/schema.py similarity index 96% rename from blpapi/schema.py rename to src/blpapi/schema.py index 4957175..ae7594a 100644 --- a/blpapi/schema.py +++ b/src/blpapi/schema.py @@ -210,12 +210,12 @@ class SchemaTypeDefinition(object): """Representation of a "type" that can be used within a schema. This class implements a representation of a "type" that can be used within - a schema, including both simple atomic types (integers, dates, strings, - etc.) as well as "complex" types defined a sequences of or choice among a - collection (named) elements, each of which is in turn described by another - type. In addition to accessors for the type's structure, this class also - offers access to metadata providing a description and deprecation status - for the type. + a schema, including both plain types (integers, dates, strings, etc.) + and "complex" types. The latter may be a "sequence" or a "choice" allowing + either all or one of the named elements respectively. Those elements + in turn are each described by a type. In addition to accessors + for the type's structure, this class also offers access to metadata + providing a description and deprecation status for the type. Each :class:`SchemaElementDefinition` object is associated with a single :class:`SchemaTypeDefinition`; one :class:`SchemaTypeDefinition` may be @@ -223,7 +223,7 @@ class SchemaTypeDefinition(object): :class:`SchemaTypeDefinition` objects are read-only. - Application clients need never create fresh :class:`SchemaTypeDefinition` + Application clients need never create :class:`SchemaTypeDefinition` objects directly; applications will typically work with objects returned by other blpapi components. """ diff --git a/blpapi/service.py b/src/blpapi/service.py similarity index 97% rename from blpapi/service.py rename to src/blpapi/service.py index 6603def..7594482 100644 --- a/blpapi/service.py +++ b/src/blpapi/service.py @@ -16,8 +16,8 @@ from . import utils from .utils import get_handle from . import internals +from .chandle import CHandle -# pylint: disable=useless-object-inheritance class Operation(object): """Defines an operation which can be performed by a :class:`Service`. @@ -104,7 +104,7 @@ def _sessions(self): return self.__sessions -class Service(object): +class Service(CHandle): """Defines a service which provides access to API data. A :class:`Service` object is obtained from a :class:`Session` and contains @@ -123,21 +123,11 @@ class Service(object): """ def __init__(self, handle, sessions): + super(Service, self).__init__(handle, internals.blpapi_Service_release) self.__handle = handle self.__sessions = sessions internals.blpapi_Service_addRef(self.__handle) - def __del__(self): - try: - self.destroy() - except (NameError, AttributeError): - pass - - def destroy(self): - if self.__handle: - internals.blpapi_Service_release(self.__handle) - self.__handle = None - def __str__(self): """Convert the service schema to a string.""" return self.toString() @@ -418,10 +408,6 @@ def createAuthorizationRequest(self, authorizationOperation=None): _ExceptionUtil.raiseOnError(errCode) return Request(request, self.__sessions) - def _handle(self): - """Return the internal implementation.""" - return self.__handle - def _sessions(self): """Return session(s) this object is related to. For internal use.""" return self.__sessions diff --git a/blpapi/session.py b/src/blpapi/session.py similarity index 98% rename from blpapi/session.py rename to src/blpapi/session.py index 71ddc82..3a984ab 100644 --- a/blpapi/session.py +++ b/src/blpapi/session.py @@ -12,6 +12,7 @@ import traceback import os import functools +import atexit from .abstractsession import AbstractSession from .event import Event from . import exception @@ -98,7 +99,7 @@ class Session(AbstractSession): __handlerProxy = None @staticmethod - def __dispatchEvent(sessionRef, eventHandle): + def __dispatchEvent(sessionRef, eventHandle): # pragma: no cover """ event dispatcher """ try: session = sessionRef() @@ -163,20 +164,16 @@ def __init__(self, options=None, eventHandler=None, eventDispatcher=None): get_handle(options), self.__handlerProxy, get_handle(eventDispatcher)) - AbstractSession.__init__( - self, - internals.blpapi_Session_getAbstractSession(self.__handle)) - def __del__(self): - try: - self.destroy() - except (NameError, AttributeError): - pass + _destroy = internals.Session_destroyHelper + # note: AbstractSession destroy passes AbstractSession handle + _dtor = lambda hndl: _destroy(self.__handle, self.__handlerProxy) + atexit.register(self.stop) # we must stop session before shutdown - def destroy(self): - if self.__handle: - internals.Session_destroyHelper(self.__handle, self.__handlerProxy) - self.__handle = None + AbstractSession.__init__( + self, + internals.blpapi_Session_getAbstractSession(self.__handle), + _dtor) def start(self): """Start this :class:`Session` in synchronous mode. @@ -226,6 +223,8 @@ def stop(self): deadlock. Once a :class:`Session` has been stopped it can only be destroyed. """ + if sys.version_info >= (3, 6): + atexit.unregister(self.stop) return internals.blpapi_Session_stop(self.__handle) == 0 def stopAsync(self): diff --git a/blpapi/sessionoptions.py b/src/blpapi/sessionoptions.py similarity index 97% rename from blpapi/sessionoptions.py rename to src/blpapi/sessionoptions.py index 4588c7d..a36d694 100644 --- a/blpapi/sessionoptions.py +++ b/src/blpapi/sessionoptions.py @@ -28,11 +28,12 @@ from . import utils from .utils import get_handle from .compat import with_metaclass +from .chandle import CHandle -# pylint: disable=useless-object-inheritance,too-many-public-methods,line-too-long +# pylint: disable=too-many-public-methods @with_metaclass(utils.MetaClassForClassesWithEnums) -class SessionOptions(object): +class SessionOptions(CHandle): """Options which the user can specify when creating a session. To use non-default options on a :class:`Session`, create a @@ -53,13 +54,11 @@ class SessionOptions(object): def __init__(self): """Create a :class:`SessionOptions` with all options set to the defaults""" - self.__handle = internals.blpapi_SessionOptions_create() - - def __del__(self): - try: - self.destroy() - except (NameError, AttributeError): - pass + selfhandle = internals.blpapi_SessionOptions_create() + super(SessionOptions, self).__init__( + selfhandle, + internals.blpapi_SessionOptions_destroy) + self.__handle = selfhandle def __str__(self): """x.__str__() <==> str(x) @@ -71,12 +70,6 @@ def __str__(self): """ return self.toString() - def destroy(self): - """Destroy this :class:`SessionOptions`.""" - if self.__handle: - internals.blpapi_SessionOptions_destroy(self.__handle) - self.__handle = None - def setServerHost(self, serverHost): """Set the API server host to connect to when using the server API. @@ -767,10 +760,6 @@ def bandwidthSaveModeDisabled(self): return bool(internals.blpapi_SessionOptions_bandwidthSaveModeDisabled( self.__handle)) - def _handle(self): - """Return the internal implementation.""" - return self.__handle - def toString(self, level=0, spacesPerLevel=4): """Format this :class:`SessionOptions` to the string. @@ -791,7 +780,7 @@ def toString(self, level=0, spacesPerLevel=4): level, spacesPerLevel) -class TlsOptions(object): +class TlsOptions(CHandle): """SSL configuration options :class:`TlsOptions` instances maintain client credentials and trust @@ -807,23 +796,10 @@ class TlsOptions(object): """ def __init__(self, handle): + super(TlsOptions, self).__init__( + handle, internals.blpapi_TlsOptions_destroy) self.__handle = handle - def __del__(self): - try: - self.destroy() - except (NameError, AttributeError): - pass - - def destroy(self): - """Destructor.""" - if self.__handle: - internals.blpapi_TlsOptions_destroy(self.__handle) - self.__handle = None - - def _handle(self): - return self.__handle - def setTlsHandshakeTimeoutMs(self, timeoutMs): """ Args: diff --git a/blpapi/subscriptionlist.py b/src/blpapi/subscriptionlist.py similarity index 95% rename from blpapi/subscriptionlist.py rename to src/blpapi/subscriptionlist.py index dd68f95..1a04cc7 100644 --- a/blpapi/subscriptionlist.py +++ b/src/blpapi/subscriptionlist.py @@ -88,10 +88,10 @@ from .internals import CorrelationId from .compat import conv2str, isstr from .utils import get_handle +from .chandle import CHandle -# pylint: disable=useless-object-inheritance -class SubscriptionList(object): +class SubscriptionList(CHandle): """A list of subscriptions. Contains a list of subscriptions used when subscribing and unsubscribing. @@ -135,19 +135,11 @@ class SubscriptionList(object): """ def __init__(self): """Create an empty :class:`SubscriptionList`.""" - self.__handle = internals.blpapi_SubscriptionList_create() - - def __del__(self): - try: - self.destroy() - except (NameError, AttributeError): - pass - - def destroy(self): - """Destroy this :class:`SubscriptionList`.""" - if self.__handle: - internals.blpapi_SubscriptionList_destroy(self.__handle) - self.__handle = None + selfhandle = internals.blpapi_SubscriptionList_create() + super(SubscriptionList, self).__init__( + selfhandle, + internals.blpapi_SubscriptionList_destroy) + self.__handle = selfhandle def add(self, topic, fields=None, options=None, correlationId=None): """Add the specified ``topic`` to this :class:`SubscriptionList`. @@ -296,10 +288,6 @@ def isResolvedTopicAt(self, index): _ExceptionUtil.raiseOnError(err) return res - def _handle(self): - """Return the internal implementation.""" - return self.__handle - __copyright__ = """ Copyright 2012. Bloomberg Finance L.P. diff --git a/blpapi/test/__init__.py b/src/blpapi/test/__init__.py similarity index 100% rename from blpapi/test/__init__.py rename to src/blpapi/test/__init__.py diff --git a/blpapi/test/messageformatter.py b/src/blpapi/test/messageformatter.py similarity index 100% rename from blpapi/test/messageformatter.py rename to src/blpapi/test/messageformatter.py diff --git a/blpapi/test/messageproperties.py b/src/blpapi/test/messageproperties.py similarity index 100% rename from blpapi/test/messageproperties.py rename to src/blpapi/test/messageproperties.py diff --git a/blpapi/test/testutil.py b/src/blpapi/test/testutil.py similarity index 100% rename from blpapi/test/testutil.py rename to src/blpapi/test/testutil.py diff --git a/blpapi/topic.py b/src/blpapi/topic.py similarity index 85% rename from blpapi/topic.py rename to src/blpapi/topic.py index 4ae1901..1c648c1 100644 --- a/blpapi/topic.py +++ b/src/blpapi/topic.py @@ -8,10 +8,10 @@ from . import internals from .service import Service from .utils import get_handle +from .chandle import CHandle -# pylint: disable=useless-object-inheritance -class Topic(object): +class Topic(CHandle): """Used to identify the stream on which a message is published. Topic objects are obtained from :meth:`~ProviderSession.createTopics()` on @@ -30,23 +30,13 @@ def __init__(self, handle=None, sessions=None): A :class:`Topic` created with ``handle`` set to ``None`` is not a valid topic and must be assigned to from a valid topic before it can be used. """ - self.__handle = handle + selfhandle = handle if handle is not None: - self.__handle = internals.blpapi_Topic_create(handle) + selfhandle = internals.blpapi_Topic_create(handle) + super(Topic, self).__init__(selfhandle, internals.blpapi_Topic_destroy) + self.__handle = selfhandle self.__sessions = sessions - def __del__(self): - try: - self.destroy() - except (NameError, AttributeError): - pass - - def destroy(self): - """Destroy this :class:`Topic` object.""" - if self.__handle: - internals.blpapi_Topic_destroy(self.__handle) - self.__handle = None - def isValid(self): """ Returns: @@ -87,10 +77,6 @@ def __eq__(self, other): return internals.blpapi_Topic_compare( self.__handle, get_handle(other)) == 0 - def _handle(self): - """Return the internal implementation.""" - return self.__handle - __copyright__ = """ Copyright 2012. Bloomberg Finance L.P. diff --git a/blpapi/topiclist.py b/src/blpapi/topiclist.py similarity index 93% rename from blpapi/topiclist.py rename to src/blpapi/topiclist.py index 0e2ed8c..ac7ea27 100644 --- a/blpapi/topiclist.py +++ b/src/blpapi/topiclist.py @@ -13,11 +13,12 @@ from .utils import get_handle from .internals import CorrelationId from .compat import with_metaclass +from .chandle import CHandle -# pylint: disable=useless-object-inheritance,protected-access +# pylint: disable=protected-access @with_metaclass(utils.MetaClassForClassesWithEnums) -class TopicList(object): +class TopicList(CHandle): """A list of topics which require creation. Contains a list of topics which require creation. @@ -45,25 +46,16 @@ def __init__(self, original=None): Otherwise create a :class:`TopicList` from ``original``. """ if isinstance(original, ResolutionList): - self.__handle = \ + selfhandle = \ internals.blpapi_TopicList_createFromResolutionList( get_handle(original)) self.__sessions = original._sessions() else: - self.__handle = internals.blpapi_TopicList_create(None) + selfhandle = internals.blpapi_TopicList_create(None) self.__sessions = set() - - def __del__(self): - try: - self.destroy() - except (NameError, AttributeError): - pass - - def destroy(self): - """Destroy this :class:`TopicList`.""" - if self.__handle: - internals.blpapi_TopicList_destroy(self.__handle) - self.__handle = None + super(TopicList, self).__init__( + selfhandle, internals.blpapi_TopicList_destroy) + self.__handle = selfhandle def add(self, topicOrMessage, correlationId=None): """Add the specified topic or topic from message to this @@ -250,10 +242,6 @@ def size(self): """Return the number of entries in this :class:`TopicList`.""" return internals.blpapi_TopicList_size(self.__handle) - def _handle(self): - """Return the internal implementation.""" - return self.__handle - def _sessions(self): """Return session(s) that this 'ResolutionList' is related to. diff --git a/blpapi/utils.py b/src/blpapi/utils.py similarity index 100% rename from blpapi/utils.py rename to src/blpapi/utils.py diff --git a/blpapi/version.py b/src/blpapi/version.py similarity index 97% rename from blpapi/version.py rename to src/blpapi/version.py index 54a7b49..0a65d8f 100644 --- a/blpapi/version.py +++ b/src/blpapi/version.py @@ -5,7 +5,7 @@ from __future__ import print_function from . import versionhelper -__version__ = "3.16.1" +__version__ = "3.16.2" def print_version(): """Print version information of BLPAPI python module and blpapi C++ SDK""" diff --git a/src/blpapi/versionhelper.py b/src/blpapi/versionhelper.py new file mode 100644 index 0000000..04988d4 --- /dev/null +++ b/src/blpapi/versionhelper.py @@ -0,0 +1,73 @@ +# This file was automatically generated by SWIG (http://www.swig.org). +# Version 4.0.1 +# +# Do not make changes to this file unless you know what you are doing--modify +# the SWIG interface file instead. + +"""blpapi version helper""" + +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 _versionhelper +else: + import _versionhelper + +try: + import builtins as __builtin__ +except ImportError: + import __builtin__ + +def _swig_repr(self): + try: + strthis = "proxy of " + self.this.__repr__() + except __builtin__.Exception: + strthis = "" + return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) + + +def _swig_setattr_nondynamic_instance_variable(set): + def set_instance_attr(self, name, value): + if name == "thisown": + self.this.own(value) + elif name == "this": + set(self, name, value) + elif hasattr(self, name) and isinstance(getattr(type(self), name), property): + set(self, name, value) + else: + raise AttributeError("You cannot add instance attributes to %s" % self) + return set_instance_attr + + +def _swig_setattr_nondynamic_class_variable(set): + def set_class_attr(cls, name, value): + if hasattr(cls, name) and not isinstance(getattr(cls, name), property): + set(cls, name, value) + else: + raise AttributeError("You cannot add class attributes to %s" % cls) + return set_class_attr + + +def _swig_add_metaclass(metaclass): + """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass""" + def wrapper(cls): + return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy()) + return wrapper + + +class _SwigNonDynamicMeta(type): + """Meta class to enforce nondynamic attributes (no new attributes) for a class""" + __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__) + + + +def blpapi_getVersionInfo(): + return _versionhelper.blpapi_getVersionInfo() + +def blpapi_getVersionIdentifier(): + return _versionhelper.blpapi_getVersionIdentifier() + + diff --git a/blpapi/versionhelper_wrap.c b/src/blpapi/versionhelper_wrap.c similarity index 84% rename from blpapi/versionhelper_wrap.c rename to src/blpapi/versionhelper_wrap.c index ce020cf..8cc702d 100644 --- a/blpapi/versionhelper_wrap.c +++ b/src/blpapi/versionhelper_wrap.c @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 3.0.12 + * Version 4.0.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 @@ -141,11 +141,16 @@ #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(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG) /* Use debug wrappers with the Python release dll */ # undef _DEBUG # include -# define _DEBUG +# define _DEBUG 1 #else # include #endif @@ -195,6 +200,7 @@ /* Flags for pointer conversions */ #define SWIG_POINTER_DISOWN 0x1 #define SWIG_CAST_NEW_MEMORY 0x2 +#define SWIG_POINTER_NO_NULL 0x4 /* Flags for new pointer objects */ #define SWIG_POINTER_OWN 0x1 @@ -419,7 +425,7 @@ SWIG_TypeCheck(const char *c, swig_type_info *ty) { swig_cast_info *iter = ty->cast; while (iter) { if (strcmp(iter->type->name, c) == 0) { -#if 0 + #if 0 if (iter == ty->cast) return iter; /* Move iter to the top of the linked list */ @@ -430,7 +436,7 @@ SWIG_TypeCheck(const char *c, swig_type_info *ty) { iter->prev = 0; if (ty->cast) ty->cast->prev = iter; ty->cast = iter; -#endif + #endif return iter; } iter = iter->next; @@ -448,7 +454,7 @@ SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) { swig_cast_info *iter = ty->cast; while (iter) { if (iter->type == from) { -#if 0 + #if 0 if (iter == ty->cast) return iter; /* Move iter to the top of the linked list */ @@ -459,7 +465,7 @@ SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) { iter->prev = 0; if (ty->cast) ty->cast->prev = iter; ty->cast = iter; -#endif + #endif return iter; } iter = iter->next; @@ -784,14 +790,16 @@ SWIGINTERN char* SWIG_Python_str_AsChar(PyObject *str) { #if PY_VERSION_HEX >= 0x03000000 - char *cstr; - char *newstr; - Py_ssize_t len; + char *newstr = 0; str = PyUnicode_AsUTF8String(str); - PyBytes_AsStringAndSize(str, &cstr, &len); - newstr = (char *) malloc(len+1); - memcpy(newstr, cstr, len+1); - Py_XDECREF(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; #else return PyString_AsString(str); @@ -815,144 +823,14 @@ SWIG_Python_str_FromChar(const char *c) #endif } -/* Add PyOS_snprintf for old Pythons */ -#if PY_VERSION_HEX < 0x02020000 -# if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM) -# define PyOS_snprintf _snprintf -# else -# define PyOS_snprintf snprintf -# endif -#endif - -/* A crude PyString_FromFormat implementation for old Pythons */ -#if PY_VERSION_HEX < 0x02020000 - -#ifndef SWIG_PYBUFFER_SIZE -# define SWIG_PYBUFFER_SIZE 1024 -#endif - -static PyObject * -PyString_FromFormat(const char *fmt, ...) { - va_list ap; - char buf[SWIG_PYBUFFER_SIZE * 2]; - int res; - va_start(ap, fmt); - res = vsnprintf(buf, sizeof(buf), fmt, ap); - va_end(ap); - return (res < 0 || res >= (int)sizeof(buf)) ? 0 : PyString_FromString(buf); -} -#endif - #ifndef PyObject_DEL # define PyObject_DEL PyObject_Del #endif -/* A crude PyExc_StopIteration exception for old Pythons */ -#if PY_VERSION_HEX < 0x02020000 -# ifndef PyExc_StopIteration -# define PyExc_StopIteration PyExc_RuntimeError -# endif -# ifndef PyObject_GenericGetAttr -# define PyObject_GenericGetAttr 0 -# endif -#endif - -/* Py_NotImplemented is defined in 2.1 and up. */ -#if PY_VERSION_HEX < 0x02010000 -# ifndef Py_NotImplemented -# define Py_NotImplemented PyExc_RuntimeError -# endif -#endif - -/* A crude PyString_AsStringAndSize implementation for old Pythons */ -#if PY_VERSION_HEX < 0x02010000 -# ifndef PyString_AsStringAndSize -# define PyString_AsStringAndSize(obj, s, len) {*s = PyString_AsString(obj); *len = *s ? strlen(*s) : 0;} -# endif -#endif - -/* PySequence_Size for old Pythons */ -#if PY_VERSION_HEX < 0x02000000 -# ifndef PySequence_Size -# define PySequence_Size PySequence_Length -# endif -#endif - -/* PyBool_FromLong for old Pythons */ -#if PY_VERSION_HEX < 0x02030000 -static -PyObject *PyBool_FromLong(long ok) -{ - PyObject *result = ok ? Py_True : Py_False; - Py_INCREF(result); - return result; -} -#endif - -/* Py_ssize_t for old Pythons */ -/* This code is as recommended by: */ -/* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */ -#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) -typedef int Py_ssize_t; -# define PY_SSIZE_T_MAX INT_MAX -# define PY_SSIZE_T_MIN INT_MIN -typedef inquiry lenfunc; -typedef intargfunc ssizeargfunc; -typedef intintargfunc ssizessizeargfunc; -typedef intobjargproc ssizeobjargproc; -typedef intintobjargproc ssizessizeobjargproc; -typedef getreadbufferproc readbufferproc; -typedef getwritebufferproc writebufferproc; -typedef getsegcountproc segcountproc; -typedef getcharbufferproc charbufferproc; -static long PyNumber_AsSsize_t (PyObject *x, void *SWIGUNUSEDPARM(exc)) -{ - long result = 0; - PyObject *i = PyNumber_Int(x); - if (i) { - result = PyInt_AsLong(i); - Py_DECREF(i); - } - return result; -} -#endif - -#if PY_VERSION_HEX < 0x02050000 -#define PyInt_FromSize_t(x) PyInt_FromLong((long)x) -#endif - -#if PY_VERSION_HEX < 0x02040000 -#define Py_VISIT(op) \ - do { \ - if (op) { \ - int vret = visit((op), arg); \ - if (vret) \ - return vret; \ - } \ - } while (0) -#endif - -#if PY_VERSION_HEX < 0x02030000 -typedef struct { - PyTypeObject type; - PyNumberMethods as_number; - PyMappingMethods as_mapping; - PySequenceMethods as_sequence; - PyBufferProcs as_buffer; - PyObject *name, *slots; -} PyHeapTypeObject; -#endif - -#if PY_VERSION_HEX < 0x02030000 -typedef destructor freefunc; -#endif - -#if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION > 6) || \ - (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION > 0) || \ - (PY_MAJOR_VERSION > 3)) +// 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 ((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME) -#endif +# define SWIGPY_CAPSULE_NAME ("swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME) #if PY_VERSION_HEX < 0x03020000 #define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type) @@ -1015,14 +893,17 @@ SWIG_Python_AddErrorMsg(const char* mesg) PyObject *value = 0; PyObject *traceback = 0; - if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback); + if (PyErr_Occurred()) + PyErr_Fetch(&type, &value, &traceback); if (value) { - char *tmp; PyObject *old_str = PyObject_Str(value); + const char *tmp = SWIG_Python_str_AsChar(old_str); PyErr_Clear(); Py_XINCREF(type); - - PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); + if (tmp) + 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); @@ -1031,6 +912,37 @@ SWIG_Python_AddErrorMsg(const char* mesg) } } +SWIGRUNTIME int +SWIG_Python_TypeErrorOccurred(PyObject *obj) +{ + PyObject *error; + if (obj) + return 0; + error = PyErr_Occurred(); + return error && PyErr_GivenExceptionMatches(error, PyExc_TypeError); +} + +SWIGRUNTIME void +SWIG_Python_RaiseOrModifyTypeError(const char *message) +{ + if (SWIG_Python_TypeErrorOccurred(NULL)) { + /* Use existing TypeError to preserve stacktrace and enhance with given message */ + PyObject *newvalue; + PyObject *type = NULL, *value = NULL, *traceback = NULL; + PyErr_Fetch(&type, &value, &traceback); +#if PY_VERSION_HEX >= 0x03000000 + newvalue = PyUnicode_FromFormat("%S\nAdditional information:\n%s", value, message); +#else + newvalue = PyString_FromFormat("%s\nAdditional information:\n%s", PyString_AsString(value), message); +#endif + Py_XDECREF(value); + PyErr_Restore(type, newvalue, traceback); + } else { + /* Raise TypeError using given message */ + PyErr_SetString(PyExc_TypeError, message); + } +} + #if defined(SWIG_PYTHON_NO_THREADS) # if defined(SWIG_PYTHON_THREADS) # undef SWIG_PYTHON_THREADS @@ -1038,9 +950,7 @@ SWIG_Python_AddErrorMsg(const char* mesg) #endif #if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */ # if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL) -# if (PY_VERSION_HEX >= 0x02030000) /* For 2.3 or later, use the PyGILState calls */ -# define SWIG_PYTHON_USE_GIL -# endif +# define SWIG_PYTHON_USE_GIL # endif # if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */ # ifndef SWIG_PYTHON_INITIALIZE_THREADS @@ -1117,30 +1027,13 @@ extern "C" { /* Constant information structure */ typedef struct swig_const_info { int type; - char *name; + const char *name; long lvalue; double dvalue; void *pvalue; swig_type_info **ptype; } swig_const_info; - -/* ----------------------------------------------------------------------------- - * Wrapper of PyInstanceMethod_New() used in Python 3 - * It is exported to the generated module, used for -fastproxy - * ----------------------------------------------------------------------------- */ -#if PY_VERSION_HEX >= 0x03000000 -SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) -{ - return PyInstanceMethod_New(func); -} -#else -SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *SWIGUNUSEDPARM(func)) -{ - return NULL; -} -#endif - #ifdef __cplusplus } #endif @@ -1155,6 +1048,14 @@ SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), * * ----------------------------------------------------------------------------- */ +#if PY_VERSION_HEX < 0x02070000 /* 2.7.0 */ +# 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" +#endif + /* Common SWIG API */ /* for raw pointers */ @@ -1238,11 +1139,7 @@ SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) { SWIGINTERN void SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) { -#if PY_VERSION_HEX < 0x02030000 - PyDict_SetItemString(d, (char *)name, obj); -#else PyDict_SetItemString(d, name, obj); -#endif Py_DECREF(obj); if (public_interface) SwigPyBuiltin_AddPublicSymbol(public_interface, name); @@ -1252,11 +1149,7 @@ SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *nam SWIGINTERN void SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) { -#if PY_VERSION_HEX < 0x02030000 - PyDict_SetItemString(d, (char *)name, obj); -#else PyDict_SetItemString(d, name, obj); -#endif Py_DECREF(obj); } @@ -1266,7 +1159,6 @@ SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) { SWIGINTERN PyObject* SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) { -#if !defined(SWIG_PYTHON_OUTPUT_TUPLE) if (!result) { result = obj; } else if (result == Py_None) { @@ -1282,29 +1174,6 @@ SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) { Py_DECREF(obj); } return result; -#else - PyObject* o2; - PyObject* o3; - if (!result) { - result = obj; - } else if (result == Py_None) { - Py_DECREF(result); - result = obj; - } else { - if (!PyTuple_Check(result)) { - o2 = result; - result = PyTuple_New(1); - PyTuple_SET_ITEM(result, 0, o2); - } - o3 = PyTuple_New(1); - PyTuple_SET_ITEM(o3, 0, obj); - o2 = result; - result = PySequence_Concat(o2, o3); - Py_DECREF(o2); - Py_DECREF(o3); - } - return result; -#endif } /* Unpack the argument tuple */ @@ -1356,11 +1225,7 @@ SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssi } /* A functor is a function object with one single object argument */ -#if PY_VERSION_HEX >= 0x02020000 #define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL); -#else -#define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunction(functor, "O", obj); -#endif /* Helper for static pointer initialization for both C and C++ code, for example @@ -1389,35 +1254,6 @@ SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssi extern "C" { #endif -/* How to access Py_None */ -#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) -# ifndef SWIG_PYTHON_NO_BUILD_NONE -# ifndef SWIG_PYTHON_BUILD_NONE -# define SWIG_PYTHON_BUILD_NONE -# endif -# endif -#endif - -#ifdef SWIG_PYTHON_BUILD_NONE -# ifdef Py_None -# undef Py_None -# define Py_None SWIG_Py_None() -# endif -SWIGRUNTIMEINLINE PyObject * -_SWIG_Py_None(void) -{ - PyObject *none = Py_BuildValue((char*)""); - Py_DECREF(none); - return none; -} -SWIGRUNTIME PyObject * -SWIG_Py_None(void) -{ - static PyObject *SWIG_STATIC_POINTER(none) = _SWIG_Py_None(); - return none; -} -#endif - /* The python void return value */ SWIGRUNTIMEINLINE PyObject * @@ -1444,7 +1280,10 @@ SWIGRUNTIMEINLINE int SWIG_Python_CheckImplicit(swig_type_info *ty) { SwigPyClientData *data = (SwigPyClientData *)ty->clientdata; - return data ? data->implicitconv : 0; + int fail = data ? data->implicitconv : 0; + if (fail) + PyErr_SetString(PyExc_TypeError, "Implicit conversion is prohibited for explicit constructors."); + return fail; } SWIGRUNTIMEINLINE PyObject * @@ -1471,11 +1310,7 @@ SwigPyClientData_New(PyObject* obj) data->newargs = obj; Py_INCREF(obj); } else { -#if (PY_VERSION_HEX < 0x02020000) - data->newraw = 0; -#else - data->newraw = PyObject_GetAttrString(data->klass, (char *)"__new__"); -#endif + data->newraw = PyObject_GetAttrString(data->klass, "__new__"); if (data->newraw) { Py_INCREF(data->newraw); data->newargs = PyTuple_New(1); @@ -1486,7 +1321,7 @@ SwigPyClientData_New(PyObject* obj) Py_INCREF(data->newargs); } /* the destroy method, aka as the C++ delete method */ - data->destroy = PyObject_GetAttrString(data->klass, (char *)"__swig_destroy__"); + data->destroy = PyObject_GetAttrString(data->klass, "__swig_destroy__"); if (PyErr_Occurred()) { PyErr_Clear(); data->destroy = 0; @@ -1495,11 +1330,7 @@ SwigPyClientData_New(PyObject* obj) int flags; Py_INCREF(data->destroy); flags = PyCFunction_GET_FLAGS(data->destroy); -#ifdef METH_O data->delargs = !(flags & (METH_O)); -#else - data->delargs = 0; -#endif } else { data->delargs = 0; } @@ -1587,20 +1418,12 @@ SwigPyObject_hex(SwigPyObject *v) } SWIGRUNTIME PyObject * -#ifdef METH_NOARGS SwigPyObject_repr(SwigPyObject *v) -#else -SwigPyObject_repr(SwigPyObject *v, PyObject *args) -#endif { const char *name = SWIG_TypePrettyName(v->ty); PyObject *repr = SWIG_Python_str_FromFormat("", (name ? name : "unknown"), (void *)v); if (v->next) { -# ifdef METH_NOARGS PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next); -# else - PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args); -# endif # if PY_VERSION_HEX >= 0x03000000 PyObject *joined = PyUnicode_Concat(repr, nrep); Py_DecRef(repr); @@ -1613,6 +1436,14 @@ SwigPyObject_repr(SwigPyObject *v, PyObject *args) return repr; } +/* We need a version taking two PyObject* parameters so it's a valid + * PyCFunction to use in swigobject_methods[]. */ +SWIGRUNTIME PyObject * +SwigPyObject_repr2(PyObject *v, PyObject *SWIGUNUSEDPARM(args)) +{ + return SwigPyObject_repr((SwigPyObject*)v); +} + SWIGRUNTIME int SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w) { @@ -1686,14 +1517,14 @@ SwigPyObject_dealloc(PyObject *v) PyObject *res; /* PyObject_CallFunction() has the potential to silently drop - the active active exception. In cases of unnamed temporary + the active exception. In cases of unnamed temporary variable or where we just finished iterating over a generator StopIteration will be active right now, and this needs to remain true upon return from SwigPyObject_dealloc. So save and restore. */ - PyObject *val = NULL, *type = NULL, *tb = NULL; - PyErr_Fetch(&val, &type, &tb); + PyObject *type = NULL, *value = NULL, *traceback = NULL; + PyErr_Fetch(&type, &value, &traceback); if (data->delargs) { /* we need to create a temporary object to carry the destroy operation */ @@ -1708,7 +1539,7 @@ SwigPyObject_dealloc(PyObject *v) if (!res) PyErr_WriteUnraisable(destroy); - PyErr_Restore(val, type, tb); + PyErr_Restore(type, value, traceback); Py_XDECREF(res); } @@ -1727,11 +1558,6 @@ SWIGRUNTIME PyObject* SwigPyObject_append(PyObject* v, PyObject* next) { SwigPyObject *sobj = (SwigPyObject *) v; -#ifndef METH_O - PyObject *tmp = 0; - if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL; - next = tmp; -#endif if (!SwigPyObject_Check(next)) { PyErr_SetString(PyExc_TypeError, "Attempt to append a non SwigPyObject"); return NULL; @@ -1742,11 +1568,7 @@ SwigPyObject_append(PyObject* v, PyObject* next) } SWIGRUNTIME PyObject* -#ifdef METH_NOARGS -SwigPyObject_next(PyObject* v) -#else SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) -#endif { SwigPyObject *sobj = (SwigPyObject *) v; if (sobj->next) { @@ -1758,11 +1580,7 @@ SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) } SWIGINTERN PyObject* -#ifdef METH_NOARGS -SwigPyObject_disown(PyObject *v) -#else SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) -#endif { SwigPyObject *sobj = (SwigPyObject *)v; sobj->own = 0; @@ -1770,11 +1588,7 @@ SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) } SWIGINTERN PyObject* -#ifdef METH_NOARGS -SwigPyObject_acquire(PyObject *v) -#else SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) -#endif { SwigPyObject *sobj = (SwigPyObject *)v; sobj->own = SWIG_POINTER_OWN; @@ -1785,70 +1599,32 @@ SWIGINTERN PyObject* SwigPyObject_own(PyObject *v, PyObject *args) { PyObject *val = 0; -#if (PY_VERSION_HEX < 0x02020000) - if (!PyArg_ParseTuple(args,(char *)"|O:own",&val)) -#elif (PY_VERSION_HEX < 0x02050000) - if (!PyArg_UnpackTuple(args, (char *)"own", 0, 1, &val)) -#else - if (!PyArg_UnpackTuple(args, "own", 0, 1, &val)) -#endif - { - return NULL; + if (!PyArg_UnpackTuple(args, "own", 0, 1, &val)) { + return NULL; + } else { + SwigPyObject *sobj = (SwigPyObject *)v; + PyObject *obj = PyBool_FromLong(sobj->own); + if (val) { + if (PyObject_IsTrue(val)) { + SwigPyObject_acquire(v,args); + } else { + SwigPyObject_disown(v,args); + } } - else - { - SwigPyObject *sobj = (SwigPyObject *)v; - PyObject *obj = PyBool_FromLong(sobj->own); - if (val) { -#ifdef METH_NOARGS - if (PyObject_IsTrue(val)) { - SwigPyObject_acquire(v); - } else { - SwigPyObject_disown(v); - } -#else - if (PyObject_IsTrue(val)) { - SwigPyObject_acquire(v,args); - } else { - SwigPyObject_disown(v,args); - } -#endif - } - return obj; - } + return obj; + } } -#ifdef METH_O static PyMethodDef swigobject_methods[] = { - {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"}, - {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS, (char *)"acquires ownership of the pointer"}, - {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, - {(char *)"append", (PyCFunction)SwigPyObject_append, METH_O, (char *)"appends another 'this' object"}, - {(char *)"next", (PyCFunction)SwigPyObject_next, METH_NOARGS, (char *)"returns the next 'this' object"}, - {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_NOARGS, (char *)"returns object representation"}, + {"disown", SwigPyObject_disown, METH_NOARGS, "releases ownership of the pointer"}, + {"acquire", SwigPyObject_acquire, METH_NOARGS, "acquires ownership of the pointer"}, + {"own", SwigPyObject_own, METH_VARARGS, "returns/sets ownership of the pointer"}, + {"append", SwigPyObject_append, METH_O, "appends another 'this' object"}, + {"next", SwigPyObject_next, METH_NOARGS, "returns the next 'this' object"}, + {"__repr__",SwigPyObject_repr2, METH_NOARGS, "returns object representation"}, {0, 0, 0, 0} }; -#else -static PyMethodDef -swigobject_methods[] = { - {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"}, - {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS, (char *)"acquires ownership of the pointer"}, - {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, - {(char *)"append", (PyCFunction)SwigPyObject_append, METH_VARARGS, (char *)"appends another 'this' object"}, - {(char *)"next", (PyCFunction)SwigPyObject_next, METH_VARARGS, (char *)"returns the next 'this' object"}, - {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_VARARGS, (char *)"returns object representation"}, - {0, 0, 0, 0} -}; -#endif - -#if PY_VERSION_HEX < 0x02020000 -SWIGINTERN PyObject * -SwigPyObject_getattr(SwigPyObject *sobj,char *name) -{ - return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name); -} -#endif SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void) { @@ -1893,12 +1669,8 @@ SwigPyObject_TypeOnce(void) { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_matrix_multiply */ #elif PY_VERSION_HEX >= 0x03000000 /* 3.0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */ -#elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */ +#else 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */ -#elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */ -#elif PY_VERSION_HEX >= 0x02000000 /* 2.0.0 */ - 0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_or */ #endif }; @@ -1912,16 +1684,12 @@ SwigPyObject_TypeOnce(void) { PyObject_HEAD_INIT(NULL) 0, /* ob_size */ #endif - (char *)"SwigPyObject", /* tp_name */ + "SwigPyObject", /* tp_name */ sizeof(SwigPyObject), /* tp_basicsize */ 0, /* tp_itemsize */ (destructor)SwigPyObject_dealloc, /* tp_dealloc */ 0, /* tp_print */ -#if PY_VERSION_HEX < 0x02020000 - (getattrfunc)SwigPyObject_getattr, /* tp_getattr */ -#else (getattrfunc)0, /* tp_getattr */ -#endif (setattrfunc)0, /* tp_setattr */ #if PY_VERSION_HEX >= 0x03000000 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */ @@ -1944,7 +1712,6 @@ SwigPyObject_TypeOnce(void) { 0, /* tp_clear */ (richcmpfunc)SwigPyObject_richcompare,/* tp_richcompare */ 0, /* tp_weaklistoffset */ -#if PY_VERSION_HEX >= 0x02020000 0, /* tp_iter */ 0, /* tp_iternext */ swigobject_methods, /* tp_methods */ @@ -1965,13 +1732,8 @@ SwigPyObject_TypeOnce(void) { 0, /* tp_cache */ 0, /* tp_subclasses */ 0, /* tp_weaklist */ -#endif -#if PY_VERSION_HEX >= 0x02030000 0, /* tp_del */ -#endif -#if PY_VERSION_HEX >= 0x02060000 0, /* tp_version_tag */ -#endif #if PY_VERSION_HEX >= 0x03040000 0, /* tp_finalize */ #endif @@ -1979,20 +1741,14 @@ SwigPyObject_TypeOnce(void) { 0, /* tp_allocs */ 0, /* tp_frees */ 0, /* tp_maxalloc */ -#if PY_VERSION_HEX >= 0x02050000 0, /* tp_prev */ -#endif 0 /* tp_next */ #endif }; swigpyobject_type = tmp; type_init = 1; -#if PY_VERSION_HEX < 0x02020000 - swigpyobject_type.ob_type = &PyType_Type; -#else if (PyType_Ready(&swigpyobject_type) < 0) return NULL; -#endif } return &swigpyobject_type; } @@ -2021,20 +1777,6 @@ typedef struct { size_t size; } SwigPyPacked; -SWIGRUNTIME int -SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags)) -{ - char result[SWIG_BUFFER_SIZE]; - fputs("pack, v->size, 0, sizeof(result))) { - fputs("at ", fp); - fputs(result, fp); - } - fputs(v->ty->name,fp); - fputs(">", fp); - return 0; -} - SWIGRUNTIME PyObject * SwigPyPacked_repr(SwigPyPacked *v) { @@ -2063,7 +1805,7 @@ SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w) size_t i = v->size; size_t j = w->size; int s = (i < j) ? -1 : ((i > j) ? 1 : 0); - return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size); + return s ? s : strncmp((const char *)v->pack, (const char *)w->pack, 2*v->size); } SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void); @@ -2103,11 +1845,11 @@ SwigPyPacked_TypeOnce(void) { PyObject_HEAD_INIT(NULL) 0, /* ob_size */ #endif - (char *)"SwigPyPacked", /* tp_name */ + "SwigPyPacked", /* tp_name */ sizeof(SwigPyPacked), /* tp_basicsize */ 0, /* tp_itemsize */ (destructor)SwigPyPacked_dealloc, /* tp_dealloc */ - (printfunc)SwigPyPacked_print, /* tp_print */ + 0, /* tp_print */ (getattrfunc)0, /* tp_getattr */ (setattrfunc)0, /* tp_setattr */ #if PY_VERSION_HEX>=0x03000000 @@ -2131,7 +1873,6 @@ SwigPyPacked_TypeOnce(void) { 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ -#if PY_VERSION_HEX >= 0x02020000 0, /* tp_iter */ 0, /* tp_iternext */ 0, /* tp_methods */ @@ -2152,13 +1893,8 @@ SwigPyPacked_TypeOnce(void) { 0, /* tp_cache */ 0, /* tp_subclasses */ 0, /* tp_weaklist */ -#endif -#if PY_VERSION_HEX >= 0x02030000 0, /* tp_del */ -#endif -#if PY_VERSION_HEX >= 0x02060000 0, /* tp_version_tag */ -#endif #if PY_VERSION_HEX >= 0x03040000 0, /* tp_finalize */ #endif @@ -2166,20 +1902,14 @@ SwigPyPacked_TypeOnce(void) { 0, /* tp_allocs */ 0, /* tp_frees */ 0, /* tp_maxalloc */ -#if PY_VERSION_HEX >= 0x02050000 0, /* tp_prev */ -#endif 0 /* tp_next */ #endif }; swigpypacked_type = tmp; type_init = 1; -#if PY_VERSION_HEX < 0x02020000 - swigpypacked_type.ob_type = &PyType_Type; -#else if (PyType_Ready(&swigpypacked_type) < 0) return NULL; -#endif } return &swigpypacked_type; } @@ -2220,20 +1950,14 @@ SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size) * pointers/data manipulation * ----------------------------------------------------------------------------- */ -SWIGRUNTIMEINLINE PyObject * -_SWIG_This(void) -{ - return SWIG_Python_str_FromChar("this"); -} - -static PyObject *swig_this = NULL; +static PyObject *Swig_This_global = NULL; SWIGRUNTIME PyObject * SWIG_This(void) { - if (swig_this == NULL) - swig_this = _SWIG_This(); - return swig_this; + if (Swig_This_global == NULL) + Swig_This_global = SWIG_Python_str_FromChar("this"); + return Swig_This_global; } /* #define SWIG_PYTHON_SLOW_GETSET_THIS */ @@ -2265,7 +1989,7 @@ SWIG_Python_GetSwigThis(PyObject *pyobj) obj = 0; -#if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000)) +#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS) if (PyInstance_Check(pyobj)) { obj = _PyInstance_Lookup(pyobj, SWIG_This()); } else { @@ -2335,7 +2059,7 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int if (obj == Py_None && !implicit_conv) { if (ptr) *ptr = 0; - return SWIG_OK; + return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; } res = SWIG_ERROR; @@ -2415,13 +2139,13 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int } } } - } - if (!SWIG_IsOK(res) && obj == Py_None) { - if (ptr) - *ptr = 0; - if (PyErr_Occurred()) - PyErr_Clear(); - res = SWIG_OK; + if (!SWIG_IsOK(res) && obj == Py_None) { + if (ptr) + *ptr = 0; + if (PyErr_Occurred()) + PyErr_Clear(); + res = SWIG_OK; + } } } return res; @@ -2435,31 +2159,28 @@ SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) { return SWIG_ConvertPtr(obj, ptr, ty, 0); } else { void *vptr = 0; - + swig_cast_info *tc; + /* here we get the method pointer for callbacks */ const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0; if (desc) desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0; - if (!desc) + if (!desc) return SWIG_ERROR; - if (ty) { - swig_cast_info *tc = SWIG_TypeCheck(desc,ty); - if (tc) { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc,vptr,&newmemory); - assert(!newmemory); /* newmemory handling not yet implemented */ - } else { - return SWIG_ERROR; - } + tc = SWIG_TypeCheck(desc,ty); + if (tc) { + int newmemory = 0; + *ptr = SWIG_TypeCast(tc,vptr,&newmemory); + assert(!newmemory); /* newmemory handling not yet implemented */ } else { - *ptr = vptr; + return SWIG_ERROR; } return SWIG_OK; } } -/* Convert a packed value value */ +/* Convert a packed pointer value */ SWIGRUNTIME int SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) { @@ -2487,7 +2208,6 @@ SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *t SWIGRUNTIME PyObject* SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) { -#if (PY_VERSION_HEX >= 0x02020000) PyObject *inst = 0; PyObject *newraw = data->newraw; if (newraw) { @@ -2510,10 +2230,18 @@ SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) } } else { #if PY_VERSION_HEX >= 0x03000000 - inst = ((PyTypeObject*) data->newargs)->tp_new((PyTypeObject*) data->newargs, Py_None, Py_None); - if (inst) { - PyObject_SetAttr(inst, SWIG_This(), swig_this); - Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG; + PyObject *empty_args = PyTuple_New(0); + if (empty_args) { + PyObject *empty_kwargs = PyDict_New(); + if (empty_kwargs) { + inst = ((PyTypeObject *)data->newargs)->tp_new((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; + } + } + Py_DECREF(empty_args); } #else PyObject *dict = PyDict_New(); @@ -2525,45 +2253,13 @@ SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) #endif } return inst; -#else -#if (PY_VERSION_HEX >= 0x02010000) - PyObject *inst = 0; - PyObject *dict = PyDict_New(); - if (dict) { - PyDict_SetItem(dict, SWIG_This(), swig_this); - inst = PyInstance_NewRaw(data->newargs, dict); - Py_DECREF(dict); - } - return (PyObject *) inst; -#else - PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type); - if (inst == NULL) { - return NULL; - } - inst->in_class = (PyClassObject *)data->newargs; - Py_INCREF(inst->in_class); - inst->in_dict = PyDict_New(); - if (inst->in_dict == NULL) { - Py_DECREF(inst); - return NULL; - } -#ifdef Py_TPFLAGS_HAVE_WEAKREFS - inst->in_weakreflist = NULL; -#endif -#ifdef Py_TPFLAGS_GC - PyObject_GC_Init(inst); -#endif - PyDict_SetItem(inst->in_dict, SWIG_This(), swig_this); - return (PyObject *) inst; -#endif -#endif } SWIGRUNTIME void SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this) { PyObject *dict; -#if (PY_VERSION_HEX >= 0x02020000) && !defined(SWIG_PYTHON_SLOW_GETSET_THIS) +#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS) PyObject **dictptr = _PyObject_GetDictPtr(inst); if (dictptr != NULL) { dict = *dictptr; @@ -2575,7 +2271,7 @@ SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this) return; } #endif - dict = PyObject_GetAttrString(inst, (char*)"__dict__"); + dict = PyObject_GetAttrString(inst, "__dict__"); PyDict_SetItem(dict, SWIG_This(), swig_this); Py_DECREF(dict); } @@ -2674,12 +2370,7 @@ SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata)) { #ifdef SWIG_LINK_RUNTIME type_pointer = SWIG_ReturnGlobalTypeList((void *)0); #else -# ifdef SWIGPY_USE_CAPSULE type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0); -# else - type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, - (char*)"type_pointer" SWIG_TYPE_TABLE_NAME); -# endif if (PyErr_Occurred()) { PyErr_Clear(); type_pointer = (void *)0; @@ -2689,48 +2380,10 @@ SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata)) { return (swig_module_info *) type_pointer; } -#if PY_MAJOR_VERSION < 2 -/* PyModule_AddObject function was introduced in Python 2.0. The following function - is copied out of Python/modsupport.c in python version 2.3.4 */ -SWIGINTERN int -PyModule_AddObject(PyObject *m, char *name, PyObject *o) -{ - PyObject *dict; - if (!PyModule_Check(m)) { - PyErr_SetString(PyExc_TypeError, "PyModule_AddObject() needs module as first arg"); - return SWIG_ERROR; - } - if (!o) { - PyErr_SetString(PyExc_TypeError, "PyModule_AddObject() needs non-NULL value"); - return SWIG_ERROR; - } - - dict = PyModule_GetDict(m); - if (dict == NULL) { - /* Internal error -- modules must have a dict! */ - PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__", - PyModule_GetName(m)); - return SWIG_ERROR; - } - if (PyDict_SetItemString(dict, name, o)) - return SWIG_ERROR; - Py_DECREF(o); - return SWIG_OK; -} -#endif - SWIGRUNTIME void -#ifdef SWIGPY_USE_CAPSULE SWIG_Python_DestroyModule(PyObject *obj) -#else -SWIG_Python_DestroyModule(void *vptr) -#endif { -#ifdef SWIGPY_USE_CAPSULE swig_module_info *swig_module = (swig_module_info *) PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME); -#else - swig_module_info *swig_module = (swig_module_info *) vptr; -#endif swig_type_info **types = swig_module->types; size_t i; for (i =0; i < swig_module->size; ++i) { @@ -2741,33 +2394,24 @@ SWIG_Python_DestroyModule(void *vptr) } } Py_DECREF(SWIG_This()); - swig_this = NULL; + Swig_This_global = NULL; } SWIGRUNTIME void SWIG_Python_SetModule(swig_module_info *swig_module) { #if PY_VERSION_HEX >= 0x03000000 /* Add a dummy module object into sys.modules */ - PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION); + PyObject *module = PyImport_AddModule("swig_runtime_data" SWIG_RUNTIME_VERSION); #else static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} }; /* Sentinel */ - PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table); + PyObject *module = Py_InitModule("swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table); #endif -#ifdef SWIGPY_USE_CAPSULE PyObject *pointer = PyCapsule_New((void *) swig_module, SWIGPY_CAPSULE_NAME, SWIG_Python_DestroyModule); if (pointer && module) { - PyModule_AddObject(module, (char*)"type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer); - } else { - Py_XDECREF(pointer); - } -#else - PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule); - if (pointer && module) { - PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer); + PyModule_AddObject(module, "type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer); } else { Py_XDECREF(pointer); } -#endif } /* The python cached type query */ @@ -2785,20 +2429,12 @@ SWIG_Python_TypeQuery(const char *type) PyObject *obj = PyDict_GetItem(cache, key); swig_type_info *descriptor; if (obj) { -#ifdef SWIGPY_USE_CAPSULE descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, NULL); -#else - descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj); -#endif } else { swig_module_info *swig_module = SWIG_GetModule(0); descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type); if (descriptor) { -#ifdef SWIGPY_USE_CAPSULE obj = PyCapsule_New((void*) descriptor, NULL, NULL); -#else - obj = PyCObject_FromVoidPtr(descriptor, NULL); -#endif PyDict_SetItem(cache, key, obj); Py_DECREF(obj); } @@ -2823,14 +2459,15 @@ SWIG_Python_AddErrMesg(const char* mesg, int infront) PyObject *traceback = 0; PyErr_Fetch(&type, &value, &traceback); if (value) { - char *tmp; PyObject *old_str = PyObject_Str(value); + const char *tmp = SWIG_Python_str_AsChar(old_str); + const char *errmesg = tmp ? tmp : "Invalid error message"; Py_XINCREF(type); PyErr_Clear(); if (infront) { - PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str)); + PyErr_Format(type, "%s %s", mesg, errmesg); } else { - PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); + PyErr_Format(type, "%s %s", errmesg, mesg); } SWIG_Python_str_DelForPy3(tmp); Py_DECREF(old_str); @@ -2956,6 +2593,8 @@ SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { Py_INCREF(name); } else { encoded_name = PyUnicode_AsUTF8String(name); + if (!encoded_name) + return -1; } PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name)); Py_DECREF(encoded_name); @@ -2982,6 +2621,21 @@ SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { +#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); + +#ifdef __cplusplus +} +#endif + + /* -------- TYPES TABLE (BEGIN) -------- */ #define SWIGTYPE_p_char swig_types[0] @@ -2993,11 +2647,10 @@ static swig_module_info swig_module = {swig_types, 2, 0, 0, 0, 0}; /* -------- TYPES TABLE (END) -------- */ -#if (PY_VERSION_HEX <= 0x02000000) -# if !defined(SWIG_PYTHON_CLASSIC) -# error "This python version requires swig to be run with the '-classic' option" -# endif +#ifdef SWIG_TypeQuery +# undef SWIG_TypeQuery #endif +#define SWIG_TypeQuery SWIG_Python_TypeQuery /*----------------------------------------------- @(target):= _versionhelper.so @@ -3011,7 +2664,7 @@ static swig_module_info swig_module = {swig_types, 2, 0, 0, 0, 0}; #endif #define SWIG_name "_versionhelper" -#define SWIGVERSION 0x030012 +#define SWIGVERSION 0x040001 #define SWIG_VERSION SWIGVERSION @@ -3055,11 +2708,7 @@ SWIG_FromCharPtrAndSize(const char* carray, size_t size) #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) return PyBytes_FromStringAndSize(carray, (Py_ssize_t)(size)); #else -#if PY_VERSION_HEX >= 0x03010000 return PyUnicode_DecodeUTF8(carray, (Py_ssize_t)(size), "surrogateescape"); -#else - return PyUnicode_FromStringAndSize(carray, (Py_ssize_t)(size)); -#endif #endif #else return PyString_FromStringAndSize(carray, (Py_ssize_t)(size)); @@ -3099,7 +2748,7 @@ SWIGINTERN PyObject *_wrap_blpapi_getVersionInfo(PyObject *SWIGUNUSEDPARM(self), arg2 = &temp2; arg3 = &temp3; arg4 = &temp4; - if (!PyArg_ParseTuple(args,(char *)":blpapi_getVersionInfo")) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "blpapi_getVersionInfo", 0, 0, 0)) SWIG_fail; { SWIG_PYTHON_THREAD_BEGIN_ALLOW; blpapi_getVersionInfo(arg1,arg2,arg3,arg4); @@ -3140,7 +2789,7 @@ SWIGINTERN PyObject *_wrap_blpapi_getVersionIdentifier(PyObject *SWIGUNUSEDPARM( PyObject *resultobj = 0; char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)":blpapi_getVersionIdentifier")) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "blpapi_getVersionIdentifier", 0, 0, 0)) SWIG_fail; { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (char *)blpapi_getVersionIdentifier(); @@ -3154,9 +2803,13 @@ SWIGINTERN PyObject *_wrap_blpapi_getVersionIdentifier(PyObject *SWIGUNUSEDPARM( static PyMethodDef SwigMethods[] = { - { (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL}, - { (char *)"blpapi_getVersionInfo", _wrap_blpapi_getVersionInfo, METH_VARARGS, NULL}, - { (char *)"blpapi_getVersionIdentifier", _wrap_blpapi_getVersionIdentifier, METH_VARARGS, NULL}, + { "SWIG_PyInstanceMethod_New", SWIG_PyInstanceMethod_New, METH_O, NULL}, + { "blpapi_getVersionInfo", _wrap_blpapi_getVersionInfo, METH_NOARGS, NULL}, + { "blpapi_getVersionIdentifier", _wrap_blpapi_getVersionIdentifier, METH_NOARGS, NULL}, + { NULL, NULL, 0, NULL } +}; + +static PyMethodDef SwigMethods_proxydocs[] = { { NULL, NULL, 0, NULL } }; @@ -3288,7 +2941,7 @@ SWIG_InitializeModule(void *clientdata) { /* Now work on filling in swig_module.types */ #ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: size %d\n", swig_module.size); + printf("SWIG_InitializeModule: size %lu\n", (unsigned long)swig_module.size); #endif for (i = 0; i < swig_module.size; ++i) { swig_type_info *type = 0; @@ -3296,7 +2949,7 @@ SWIG_InitializeModule(void *clientdata) { swig_cast_info *cast; #ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); + printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name); #endif /* if there is another module already loaded */ @@ -3371,7 +3024,7 @@ SWIG_InitializeModule(void *clientdata) { for (i = 0; i < swig_module.size; ++i) { int j = 0; swig_cast_info *cast = swig_module.cast_initial[i]; - printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); + printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name); while (cast->type) { printf("SWIG_InitializeModule: cast type %s\n", cast->type->name); cast++; @@ -3493,17 +3146,6 @@ extern "C" { return str; } - SWIGINTERN int - swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { - char *tmp; - PyObject *str = swig_varlink_str(v); - fprintf(fp,"Swig global variables "); - fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str)); - SWIG_Python_str_DelForPy3(tmp); - Py_DECREF(str); - return 0; - } - SWIGINTERN void swig_varlink_dealloc(swig_varlinkobject *v) { swig_globalvar *var = v->vars; @@ -3562,11 +3204,11 @@ extern "C" { PyObject_HEAD_INIT(NULL) 0, /* ob_size */ #endif - (char *)"swigvarlink", /* tp_name */ + "swigvarlink", /* tp_name */ sizeof(swig_varlinkobject), /* tp_basicsize */ 0, /* tp_itemsize */ (destructor) swig_varlink_dealloc, /* tp_dealloc */ - (printfunc) swig_varlink_print, /* tp_print */ + 0, /* tp_print */ (getattrfunc) swig_varlink_getattr, /* tp_getattr */ (setattrfunc) swig_varlink_setattr, /* tp_setattr */ 0, /* tp_compare */ @@ -3586,15 +3228,9 @@ extern "C" { 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ -#if PY_VERSION_HEX >= 0x02020000 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */ -#endif -#if PY_VERSION_HEX >= 0x02030000 0, /* tp_del */ -#endif -#if PY_VERSION_HEX >= 0x02060000 0, /* tp_version_tag */ -#endif #if PY_VERSION_HEX >= 0x03040000 0, /* tp_finalize */ #endif @@ -3602,20 +3238,14 @@ extern "C" { 0, /* tp_allocs */ 0, /* tp_frees */ 0, /* tp_maxalloc */ -#if PY_VERSION_HEX >= 0x02050000 0, /* tp_prev */ -#endif 0 /* tp_next */ #endif }; varlink_type = tmp; type_init = 1; -#if PY_VERSION_HEX < 0x02020000 - varlink_type.ob_type = &PyType_Type; -#else if (PyType_Ready(&varlink_type) < 0) return NULL; -#endif } return &varlink_type; } @@ -3631,14 +3261,14 @@ extern "C" { } SWIGINTERN void - SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) { + 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) { - strncpy(gv->name,name,size); + memcpy(gv->name, name, size); gv->get_attr = get_attr; gv->set_attr = set_attr; gv->next = v->vars; @@ -3649,9 +3279,11 @@ extern "C" { SWIGINTERN PyObject * SWIG_globals(void) { - static PyObject *_SWIG_globals = 0; - if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink(); - return _SWIG_globals; + static PyObject *globals = 0; + if (!globals) { + globals = SWIG_newvarlink(); + } + return globals; } /* ----------------------------------------------------------------------------- @@ -3717,9 +3349,9 @@ extern "C" { char *ndoc = (char*)malloc(ldoc + lptr + 10); if (ndoc) { char *buff = ndoc; - strncpy(buff, methods[i].ml_doc, ldoc); + memcpy(buff, methods[i].ml_doc, ldoc); buff += ldoc; - strncpy(buff, "swig_ptr: ", 10); + memcpy(buff, "swig_ptr: ", 10); buff += 10; SWIG_PackVoidPtr(buff, ptr, ty->name, lptr); methods[i].ml_doc = ndoc; @@ -3730,6 +3362,64 @@ 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 @@ -3749,20 +3439,12 @@ PyObject* void #endif SWIG_init(void) { - PyObject *m, *d, *md; + PyObject *m, *d, *md, *globals; + #if PY_VERSION_HEX >= 0x03000000 static struct PyModuleDef SWIG_module = { -# if PY_VERSION_HEX >= 0x03020000 PyModuleDef_HEAD_INIT, -# else - { - PyObject_HEAD_INIT(NULL) - NULL, /* m_init */ - 0, /* m_index */ - NULL, /* m_copy */ - }, -# endif - (char *) SWIG_name, + SWIG_name, NULL, -1, SwigMethods, @@ -3781,8 +3463,8 @@ SWIG_init(void) { (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL }; static SwigPyGetSet thisown_getset_closure = { - (PyCFunction) SwigPyObject_own, - (PyCFunction) SwigPyObject_own + SwigPyObject_own, + SwigPyObject_own }; static PyGetSetDef thisown_getset_def = { (char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure @@ -3813,13 +3495,23 @@ SWIG_init(void) { assert(metatype); #endif + (void)globals; + + /* Create singletons now to avoid potential deadlocks with multi-threaded usage after module initialization */ + SWIG_This(); + SWIG_Python_TypeCache(); + SwigPyPacked_type(); +#ifndef SWIGPYTHON_BUILTIN + SwigPyObject_type(); +#endif + /* Fix SwigMethods to carry the callback ptrs when needed */ SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial); #if PY_VERSION_HEX >= 0x03000000 m = PyModule_Create(&SWIG_module); #else - m = Py_InitModule((char *) SWIG_name, SwigMethods); + m = Py_InitModule(SWIG_name, SwigMethods); #endif md = d = PyModule_GetDict(m); diff --git a/blpapi/zfputil.py b/src/blpapi/zfputil.py similarity index 100% rename from blpapi/zfputil.py rename to src/blpapi/zfputil.py From eb493619a478e6e4ce99da288997c3aeafd249c1 Mon Sep 17 00:00:00 2001 From: Marland Sitt Date: Tue, 27 Jul 2021 07:46:12 -0700 Subject: [PATCH 08/23] Bump to v3.16.5 --- MANIFEST.in | 5 ----- PKG-INFO | 2 +- changelog.txt | 12 ++++++++++++ examples/RequestServiceExample.py | 2 +- setup.py | 4 ---- src/blpapi/session.py | 2 +- src/blpapi/topiclist.py | 16 +++++++++++++--- src/blpapi/version.py | 2 +- 8 files changed, 29 insertions(+), 16 deletions(-) delete mode 100644 MANIFEST.in diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 8676bcb..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,5 +0,0 @@ -include README changelog.txt NOTES License.txt - -recursive-include examples *.py - -prune cpp-licenses diff --git a/PKG-INFO b/PKG-INFO index f1f3af1..8e013a1 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: blpapi -Version: 3.16.2 +Version: 3.16.5 Summary: Python SDK for Bloomberg BLPAPI Home-page: http://www.bloomberglabs.com/api/ Author: Bloomberg L.P. diff --git a/changelog.txt b/changelog.txt index 6f5668a..e2b4ab7 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,15 @@ +Version 3.16.5: +=============== +- Stability and performance improvements + +Version 3.16.4: +=============== +- Stability and performance improvements + +Version 3.16.3: +=============== +- Stability and performance improvements + Version 3.16.2: =============== - Stability and performance improvements diff --git a/examples/RequestServiceExample.py b/examples/RequestServiceExample.py index 52c9123..ef288eb 100644 --- a/examples/RequestServiceExample.py +++ b/examples/RequestServiceExample.py @@ -248,7 +248,7 @@ def clientRun(session, options): request.set("timestamp", time.time()) - print("Sendind Request:", request) + print("Sending Request:", request) eventQueue = blpapi.EventQueue() session.sendRequest( diff --git a/setup.py b/setup.py index 1877049..d56d61b 100644 --- a/setup.py +++ b/setup.py @@ -34,10 +34,6 @@ def lib_in_release(): return 'lib' if platform == 'linux': return 'Linux' - if platform == 'sunos': - return "lib64" if is64bit else "lib" - if platform == 'aix': - return "lib64" if is64bit else "lib" if platform == 'darwin': return 'Darwin' raise Exception("Platform '" + platform + "' isn't supported") diff --git a/src/blpapi/session.py b/src/blpapi/session.py index 3a984ab..544fb4a 100644 --- a/src/blpapi/session.py +++ b/src/blpapi/session.py @@ -393,7 +393,7 @@ def setStatusCorrelationId(self, service, correlationId, identity=None): received. Args: - service (Service): The service which from which the status messages + service (Service): The service from which the status messages are received correlationId (CorrelationId): Correlation id to associate with the service status messages diff --git a/src/blpapi/topiclist.py b/src/blpapi/topiclist.py index ac7ea27..c5cb510 100644 --- a/src/blpapi/topiclist.py +++ b/src/blpapi/topiclist.py @@ -37,19 +37,29 @@ class TopicList(CHandle): def __init__(self, original=None): """Create an empty :class:`TopicList`, or a :class:`TopicList` based on - ``original``. + ``original`` :class:`ResolutionList`. Args: - original (TopicList): Original topiclist to copy off of + ``original`` (:class:`ResolutionList`): Original resolution list to use. + + Raises: + TypeError: If ``original`` is not an instance of + :class:`ResolutionList`. If ``original`` is ``None`` - create empty :class:`TopicList`. Otherwise create a :class:`TopicList` from ``original``. + In this case ``original`` is used by handle, so if the caller + modifies original resolution list after the call, + :class:`TopicList` also changes because owns the same handle. """ if isinstance(original, ResolutionList): selfhandle = \ internals.blpapi_TopicList_createFromResolutionList( get_handle(original)) self.__sessions = original._sessions() + elif original is not None: + raise TypeError( + "'original' should be an instance of 'ResolutionList'") else: selfhandle = internals.blpapi_TopicList_create(None) self.__sessions = set() @@ -243,7 +253,7 @@ def size(self): return internals.blpapi_TopicList_size(self.__handle) def _sessions(self): - """Return session(s) that this 'ResolutionList' is related to. + """Return session(s) that this 'TopicList' is related to. For internal use.""" return self.__sessions diff --git a/src/blpapi/version.py b/src/blpapi/version.py index 0a65d8f..108ab83 100644 --- a/src/blpapi/version.py +++ b/src/blpapi/version.py @@ -5,7 +5,7 @@ from __future__ import print_function from . import versionhelper -__version__ = "3.16.2" +__version__ = "3.16.5" def print_version(): """Print version information of BLPAPI python module and blpapi C++ SDK""" From bebcf43668c9e5f5467b1f685f9baebbfc45bc87 Mon Sep 17 00:00:00 2001 From: Marland Sitt Date: Sun, 12 Dec 2021 21:02:37 -0800 Subject: [PATCH 09/23] Bump to v3.17.1 --- MANIFEST.in | 6 + PKG-INFO | 10 +- README => README.md | 57 +- changelog.txt | 43 ++ examples/ConnectionAndAuthExample.py | 254 -------- examples/ContributionsMktdataExample.py | 328 ---------- examples/ContributionsPageExample.py | 389 ------------ examples/CorrelationExample.py | 131 ---- .../EntitlementsVerificationTokenExample.py | 258 -------- examples/GenerateTokenExample.py | 208 ------- examples/GenerateTokenSubscriptionExample.py | 209 ------- examples/IntradayBarExample.py | 261 -------- examples/IntradayTickExample.py | 320 ---------- examples/LocalMktdataSubscriptionExample.py | 380 ------------ examples/LocalPageSubscriptionExample.py | 186 ------ examples/MktdataBroadcastPublisherExample.py | 271 -------- examples/MktdataPublisher.py | 584 ------------------ examples/PagePublisherExample.py | 423 ------------- examples/RefDataTableOverrideExample.py | 188 ------ examples/RequestServiceExample.py | 341 ---------- examples/ServiceSchema.py | 288 --------- examples/SessionIdentityExample.py | 157 ----- examples/SimpleAsyncSubscription.py | 259 -------- examples/SimpleBlockingRequestExample.py | 141 ----- .../SimpleCategorizedFieldSearchExample.py | 173 ------ examples/SimpleFieldInfoExample.py | 157 ----- examples/SimpleFieldSearchExample.py | 156 ----- examples/SimpleHistoryExample.py | 119 ---- examples/SimpleIntradayBarExample.py | 133 ---- examples/SimpleIntradayTickExample.py | 134 ---- examples/SimpleRefDataExample.py | 113 ---- examples/SimpleRefDataOverrideExample.py | 157 ----- examples/SimpleSubscriptionExample.py | 126 ---- examples/SimpleSubscriptionIntervalExample.py | 127 ---- examples/SnapshotRequestTemplateExample.py | 242 -------- examples/SubscriptionCorrelationExample.py | 131 ---- .../SubscriptionWithEventHandlerExample.py | 206 ------ examples/ZfpOverLeasedLinesSessionExample.py | 222 ------- examples/demoapps/ApiFieldsExample.py | 137 ++++ .../demoapps/BroadcastPublisherExample.py | 234 +++++++ examples/demoapps/ContributionsExample.py | 248 ++++++++ ...mentsVerificationRequestResponseExample.py | 297 +++++++++ ...tlementsVerificationSubscriptionExample.py | 262 ++++++++ examples/demoapps/GenerateTokenExample.py | 135 ++++ .../demoapps/InteractivePublisherExample.py | 446 +++++++++++++ .../MultipleRequestsOverrideExample.py | 119 ++++ examples/demoapps/README.md | 234 +++++++ examples/demoapps/RequestResponseExample.py | 210 +++++++ .../demoapps/RequestServiceConsumerExample.py | 104 ++++ .../demoapps/RequestServiceProviderExample.py | 142 +++++ examples/demoapps/SecurityLookupExample.py | 207 +++++++ .../SnapshotRequestTemplateExample.py | 242 ++++++++ examples/demoapps/SubscriptionExample.py | 160 +++++ .../SubscriptionWithEventPollingExample.py | 174 ++++++ examples/demoapps/UserModeExample.py | 274 ++++++++ .../demoapps/blpapi_import_helper/__init__.py | 41 ++ .../snippets/apiflds/ApiFieldsRequestUtils.py | 52 ++ .../apiflds/CategorizedFieldSearchRequests.py | 57 ++ .../snippets/apiflds/FieldInfoRequests.py | 50 ++ .../snippets/apiflds/FieldListRequests.py | 45 ++ .../snippets/apiflds/FieldSearchRequests.py | 46 ++ .../snippets/instruments/CurveListRequests.py | 69 +++ .../snippets/instruments/GovtListRequests.py | 59 ++ .../instruments/InstrumentListRequests.py | 57 ++ .../requestresponse/HistoricalDataRequest.py | 48 ++ .../requestresponse/IntradayBarRequests.py | 93 +++ .../requestresponse/IntradayTickRequests.py | 86 +++ .../requestresponse/ReferenceDataRequests.py | 157 +++++ .../demoapps/util/ConnectionAndAuthOptions.py | 291 +++++++++ examples/demoapps/util/MaxEventsOption.py | 36 ++ examples/demoapps/util/RequestOptions.py | 230 +++++++ examples/demoapps/util/SubscriptionOptions.py | 140 +++++ .../demoapps/util/events/SessionRouter.py | 104 ++++ .../unittests/market-data-notifier/README.md | 43 ++ .../market-data-notifier/diagram.png | Bin 0 -> 38345 bytes .../market-data-notifier/src/__init__.py | 0 .../market-data-notifier/src/appconfig.py | 0 .../market-data-notifier/src/application.py | 0 .../market-data-notifier/src/authorizer.py | 0 .../src/compute_engine.py | 0 .../src/event_processor.py | 0 .../market-data-notifier/src/main.py | 0 .../market-data-notifier/src/notifier.py | 0 .../market-data-notifier/src/subscriber.py | 0 .../src/token_generator.py | 0 .../tests/test_application.py | 0 .../tests/test_authorizer.py | 0 .../tests/test_eventprocessor.py | 0 .../tests/test_tokengenerator.py | 0 .../snippets/resolver/resolverutils.py | 0 .../snippets/resolver/test_resolverutils.py | 0 .../snippets/test_events.py} | 74 +++ .../snippets/test_refdata.py} | 0 setup.cfg | 2 +- setup.py | 7 +- src/blpapi.egg-info/PKG-INFO | 19 + src/blpapi.egg-info/SOURCES.txt | 110 ++++ src/blpapi.egg-info/dependency_links.txt | 1 + src/blpapi.egg-info/top_level.txt | 1 + src/blpapi/__init__.py | 2 + src/blpapi/auth.py | 2 +- src/blpapi/compat.py | 9 + src/blpapi/datetime.py | 92 ++- src/blpapi/debug.py | 3 +- src/blpapi/debug_environment.py | 3 +- src/blpapi/element.py | 474 +++++++++++++- src/blpapi/eventdispatcher.py | 2 +- src/blpapi/eventformatter.py | 263 +++++++- src/blpapi/identity.py | 5 +- src/blpapi/internals.py | 3 + src/blpapi/internals_wrap.c | 286 +++++++++ src/blpapi/message.py | 75 ++- src/blpapi/names.py | 79 +++ src/blpapi/providersession.py | 8 +- src/blpapi/request.py | 26 + src/blpapi/session.py | 6 +- src/blpapi/test/messageformatter.py | 23 +- src/blpapi/test/messageproperties.py | 5 +- src/blpapi/test/testutil.py | 31 +- src/blpapi/utils.py | 14 +- src/blpapi/version.py | 3 +- 121 files changed, 6915 insertions(+), 7930 deletions(-) create mode 100644 MANIFEST.in rename README => README.md (87%) delete mode 100644 examples/ConnectionAndAuthExample.py delete mode 100644 examples/ContributionsMktdataExample.py delete mode 100644 examples/ContributionsPageExample.py delete mode 100644 examples/CorrelationExample.py delete mode 100644 examples/EntitlementsVerificationTokenExample.py delete mode 100644 examples/GenerateTokenExample.py delete mode 100644 examples/GenerateTokenSubscriptionExample.py delete mode 100644 examples/IntradayBarExample.py delete mode 100644 examples/IntradayTickExample.py delete mode 100644 examples/LocalMktdataSubscriptionExample.py delete mode 100644 examples/LocalPageSubscriptionExample.py delete mode 100644 examples/MktdataBroadcastPublisherExample.py delete mode 100644 examples/MktdataPublisher.py delete mode 100644 examples/PagePublisherExample.py delete mode 100644 examples/RefDataTableOverrideExample.py delete mode 100644 examples/RequestServiceExample.py delete mode 100644 examples/ServiceSchema.py delete mode 100644 examples/SessionIdentityExample.py delete mode 100644 examples/SimpleAsyncSubscription.py delete mode 100644 examples/SimpleBlockingRequestExample.py delete mode 100644 examples/SimpleCategorizedFieldSearchExample.py delete mode 100644 examples/SimpleFieldInfoExample.py delete mode 100644 examples/SimpleFieldSearchExample.py delete mode 100644 examples/SimpleHistoryExample.py delete mode 100644 examples/SimpleIntradayBarExample.py delete mode 100644 examples/SimpleIntradayTickExample.py delete mode 100644 examples/SimpleRefDataExample.py delete mode 100644 examples/SimpleRefDataOverrideExample.py delete mode 100644 examples/SimpleSubscriptionExample.py delete mode 100644 examples/SimpleSubscriptionIntervalExample.py delete mode 100644 examples/SnapshotRequestTemplateExample.py delete mode 100644 examples/SubscriptionCorrelationExample.py delete mode 100644 examples/SubscriptionWithEventHandlerExample.py delete mode 100644 examples/ZfpOverLeasedLinesSessionExample.py create mode 100644 examples/demoapps/ApiFieldsExample.py create mode 100644 examples/demoapps/BroadcastPublisherExample.py create mode 100644 examples/demoapps/ContributionsExample.py create mode 100644 examples/demoapps/EntitlementsVerificationRequestResponseExample.py create mode 100644 examples/demoapps/EntitlementsVerificationSubscriptionExample.py create mode 100644 examples/demoapps/GenerateTokenExample.py create mode 100644 examples/demoapps/InteractivePublisherExample.py create mode 100644 examples/demoapps/MultipleRequestsOverrideExample.py create mode 100644 examples/demoapps/README.md create mode 100644 examples/demoapps/RequestResponseExample.py create mode 100644 examples/demoapps/RequestServiceConsumerExample.py create mode 100644 examples/demoapps/RequestServiceProviderExample.py create mode 100644 examples/demoapps/SecurityLookupExample.py create mode 100644 examples/demoapps/SnapshotRequestTemplateExample.py create mode 100644 examples/demoapps/SubscriptionExample.py create mode 100644 examples/demoapps/SubscriptionWithEventPollingExample.py create mode 100644 examples/demoapps/UserModeExample.py create mode 100644 examples/demoapps/blpapi_import_helper/__init__.py create mode 100644 examples/demoapps/snippets/apiflds/ApiFieldsRequestUtils.py create mode 100644 examples/demoapps/snippets/apiflds/CategorizedFieldSearchRequests.py create mode 100644 examples/demoapps/snippets/apiflds/FieldInfoRequests.py create mode 100644 examples/demoapps/snippets/apiflds/FieldListRequests.py create mode 100644 examples/demoapps/snippets/apiflds/FieldSearchRequests.py create mode 100644 examples/demoapps/snippets/instruments/CurveListRequests.py create mode 100644 examples/demoapps/snippets/instruments/GovtListRequests.py create mode 100644 examples/demoapps/snippets/instruments/InstrumentListRequests.py create mode 100644 examples/demoapps/snippets/requestresponse/HistoricalDataRequest.py create mode 100644 examples/demoapps/snippets/requestresponse/IntradayBarRequests.py create mode 100644 examples/demoapps/snippets/requestresponse/IntradayTickRequests.py create mode 100644 examples/demoapps/snippets/requestresponse/ReferenceDataRequests.py create mode 100644 examples/demoapps/util/ConnectionAndAuthOptions.py create mode 100644 examples/demoapps/util/MaxEventsOption.py create mode 100644 examples/demoapps/util/RequestOptions.py create mode 100644 examples/demoapps/util/SubscriptionOptions.py create mode 100644 examples/demoapps/util/events/SessionRouter.py create mode 100644 examples/unittests/market-data-notifier/README.md create mode 100644 examples/unittests/market-data-notifier/diagram.png rename examples/{mock-test-examples => unittests}/market-data-notifier/src/__init__.py (100%) rename examples/{mock-test-examples => unittests}/market-data-notifier/src/appconfig.py (100%) rename examples/{mock-test-examples => unittests}/market-data-notifier/src/application.py (100%) rename examples/{mock-test-examples => unittests}/market-data-notifier/src/authorizer.py (100%) rename examples/{mock-test-examples => unittests}/market-data-notifier/src/compute_engine.py (100%) rename examples/{mock-test-examples => unittests}/market-data-notifier/src/event_processor.py (100%) rename examples/{mock-test-examples => unittests}/market-data-notifier/src/main.py (100%) rename examples/{mock-test-examples => unittests}/market-data-notifier/src/notifier.py (100%) rename examples/{mock-test-examples => unittests}/market-data-notifier/src/subscriber.py (100%) rename examples/{mock-test-examples => unittests}/market-data-notifier/src/token_generator.py (100%) rename examples/{mock-test-examples => unittests}/market-data-notifier/tests/test_application.py (100%) rename examples/{mock-test-examples => unittests}/market-data-notifier/tests/test_authorizer.py (100%) rename examples/{mock-test-examples => unittests}/market-data-notifier/tests/test_eventprocessor.py (100%) rename examples/{mock-test-examples => unittests}/market-data-notifier/tests/test_tokengenerator.py (100%) rename examples/{mock-test-examples => unittests}/snippets/resolver/resolverutils.py (100%) rename examples/{mock-test-examples => unittests}/snippets/resolver/test_resolverutils.py (100%) rename examples/{mock-test-examples/snippets/events.py => unittests/snippets/test_events.py} (90%) rename examples/{mock-test-examples/snippets/refdata.py => unittests/snippets/test_refdata.py} (100%) create mode 100644 src/blpapi.egg-info/PKG-INFO create mode 100644 src/blpapi.egg-info/SOURCES.txt create mode 100644 src/blpapi.egg-info/dependency_links.txt create mode 100644 src/blpapi.egg-info/top_level.txt create mode 100644 src/blpapi/names.py diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..9e96a53 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,6 @@ +include README.md changelog.txt NOTES License.txt + +recursive-include examples *.py README.md diagram.png +recursive-exclude examples/demoapps-internal * + +prune cpp-licenses diff --git a/PKG-INFO b/PKG-INFO index 8e013a1..7968b1a 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,15 +1,19 @@ -Metadata-Version: 1.1 +Metadata-Version: 2.1 Name: blpapi -Version: 3.16.5 +Version: 3.17.1 Summary: Python SDK for Bloomberg BLPAPI Home-page: http://www.bloomberglabs.com/api/ Author: Bloomberg L.P. Author-email: open-tech@bloomberg.net License: UNKNOWN -Description: UNKNOWN Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: Intended Audience :: Financial and Insurance Industry Classifier: License :: Other/Proprietary License Classifier: Topic :: Office/Business :: Financial +Requires-Python: >=3 +License-File: License.txt + +UNKNOWN + diff --git a/README b/README.md similarity index 87% rename from README rename to README.md index 0b0f265..6b1d500 100644 --- a/README +++ b/README.md @@ -1,5 +1,4 @@ -Bloomberg Python API -==================== +# Bloomberg Python API This directory contains an interface for interacting with Bloomberg API services using the Python programming language. This package is the source @@ -9,8 +8,7 @@ Python's `setuptools` package. Users are encouraged to install using `pip` directly, as documented in -Dependencies ------------- +## Dependencies This SDK requires the following products: @@ -29,15 +27,9 @@ unsupported versions of CPython. On Windows, the VS redistributable package for the compiler used in the target CPython installation is needed. You can find the compiler version for a -CPython version in [1] and the VC redistributable package in [2]. +CPython version [here](https://wiki.python.org/moin/WindowsCompilers) and the VC redistributable package [here](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads). -[1] https://wiki.python.org/moin/WindowsCompilers - -[2] https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads - - -Installation from sources -------------------------- +## Installation from sources Installation using pip is strongly recommended, and can handle installing from sources by building the Python SDK binaries locally. The C++ SDK and setting @@ -57,12 +49,16 @@ distributed as part of the Bloomberg C++ SDK. 2. To compile and install the `blpapi` Python package for all users, run - > python setup.py install + ```bash + > python setup.py install + ``` To compile and install the `blpapi` Python package for only the current user, run - > python setup.py install --user + ```bash + > python setup.py install --user + ``` (Note that the former command requires root/administrator access, while the latter does not.) @@ -70,7 +66,9 @@ distributed as part of the Bloomberg C++ SDK. Documentation on additional build and installation options is available by running - > python setup.py --help + ```bash + > python setup.py --help + ``` 3. (optional) Copy the C++ SDK shared library/DLL to a standard library location (e.g. `/usr/lib` on Linux), or update the system-wide library path @@ -82,8 +80,7 @@ distributed as part of the Bloomberg C++ SDK. installed. -Writing Bloomberg API Programs in Python ----------------------------------------- +## Writing Bloomberg API Programs in Python In order for python scripts to call Bloomberg API functions, the libraries distributed as part of the Bloomberg C++ SDK must be available to the Python @@ -99,12 +96,14 @@ these libraries in their `PATH`.) After installation, the `blpapi` module can be imported by a Python script or within the CPython interpreter: - >>> import blpapi - >>> options = blpapi.SessionOptions() - >>> options.setServerHost('localhost') - >>> options.setServerPort(8194) - >>> session = blpapi.Session(options) - >>> session.start() +```python +>>> import blpapi +>>> options = blpapi.SessionOptions() +>>> options.setServerHost('localhost') +>>> options.setServerPort(8194) +>>> session = blpapi.Session(options) +>>> session.start() +``` Note that many Python installations add the current directory to the module search path. If the Python interpreter is invoked from the installer directory, @@ -121,19 +120,17 @@ Developer's Guide, available at . -Examples --------- +## Examples A collection of complete Python programs covering a wide range of typical API -usage is available in the `examples` directory, located in the same directory +usage is available in the [`examples` directory](examples/), located in the same directory as this `README` file. Note that many examples make use of command-line arguments to specify server and authentication configuration; in most cases usage information can be obtained by passing the `--help` option on the command line. -Implementation Notes --------------------- +## Implementation Notes - The Bloomberg SDK for Python 2 does not provide direct support for Python `unicode` objects. Clients can pass unicode data to SDK functions accepting @@ -145,8 +142,7 @@ Implementation Notes `pickle` modules. -Copyright and License ---------------------- +## Copyright and License All files Copyright 2012 Bloomberg Finance L.P. @@ -168,4 +164,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/changelog.txt b/changelog.txt index e2b4ab7..444f5b2 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,46 @@ +Version 3.17.1: +=============== +- Stability and performance improvements + +Version 3.17.0: +=============== +- Native-type formatting and message consumption + Add ability to format 'Event's and 'Request's from native Python types + using methods 'EventFormatter.fromPy' and 'Request.fromPy'. Add ability + to convert a 'Message' to 'dict' with 'Message.toPy'. 'Message's and + 'Request's have 'dict'-like behavior with '__getitem__' and + '__setitem__'. + +- A new method 'correlationId()' is added to 'blpapi.Message' + A new method 'Message.correlationId()' is added to return the + single CorrelationId associated with the message or None if the + message has no CorrelationIds. If the message has multiple + CorrelationIds, the first one is returned. + +- Constants for common used `Names` + A new utility class `blpapi.Names` has been added with common + message names. + +- Revamped examples + The 'examples' directory now contains 'demoapps' and 'unittests' + subdirectories. The 'demoapps' directory contains a consolidated set of + example applications. Within 'demoapps', the 'snippets' directory contains + sample code for creating and sending requests, and for processing + responses. Also within 'demoapps', the 'util' directory contains common + code shared between examples. The 'unittests' directory has been renamed + from 'mock-test-examples' and contains sample code for using the mock + testing interface. + +- End of Python 2 support + Installation and use of BLPAPI Python now requires a Python 3.6+ + runtime. + +- Stability and performance improvements + +Version 3.16.6: +=============== +- Stability and performance improvements + Version 3.16.5: =============== - Stability and performance improvements diff --git a/examples/ConnectionAndAuthExample.py b/examples/ConnectionAndAuthExample.py deleted file mode 100644 index 9a55501..0000000 --- a/examples/ConnectionAndAuthExample.py +++ /dev/null @@ -1,254 +0,0 @@ -# ConnectionAndAuthExample.py - -"""This example shows how to configure the library to establish connections -using different host and ports, with a session identity. -""" - -from __future__ import print_function -from argparse import ArgumentParser, Action, RawTextHelpFormatter -import os -import sys -import platform as plat -if sys.version_info >= (3, 8) and plat.system().lower() == "windows": - # pylint: disable=no-member - with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): - import blpapi - from blpapi import AuthOptions, AuthUser -else: - import blpapi - from blpapi import AuthOptions, AuthUser - -NONE = "none" -USER = "user" -APP = "app" -USERAPP = "userapp" -DIR = "dir" - - -class AuthOptionsAction(Action): # pylint: disable=too-few-public-methods - """Parse authorization args from user input""" - - def __call__(self, parser, args, values, option_string=None): - vals = values.split("=", 1) - - auth = None - if vals[0] == NONE: - auth = None - elif vals[0] == USER: - user = AuthUser.createWithLogonName() - auth = AuthOptions.createWithUser(user) - elif vals[0] == APP and len(vals) == 2: - appName = vals[1] - auth = AuthOptions.createWithApp(appName) - elif vals[0] == USERAPP and len(vals) == 2: - appName = vals[1] - user = AuthUser.createWithLogonName() - auth = AuthOptions.createWithUserAndApp(user, appName) - elif vals[0] == DIR and len(vals) == 2: - dirProperty = vals[1] - user = AuthUser.createWithActiveDirectoryProperty(dirProperty) - auth = AuthOptions.createWithUser(user) - elif vals[0] == "manual": - parts = [] - if len(vals) == 2: - parts = vals[1].split(",") - - if len(parts) != 3: - raise ValueError("Invalid auth option '%s'" % values) - - appName, ipAddress, userId = parts - user = AuthUser.createWithManualOptions(userId, ipAddress) - auth = AuthOptions.createWithUserAndApp(user, appName) - else: - raise ValueError("Invalid auth option '%s'" % values) - - setattr(args, self.dest, auth) - - -class HostAction(Action): # pylint: disable=too-few-public-methods - """ Helper class to parse host arguments """ - - def __call__(self, parser, namespace, values, option_string=None): - host = values.split(":") - if len(host) != 2: - raise ValueError("Invalid host:port '%s'" % values) - host[1] = int(host[1]) - hosts = getattr(namespace, self.dest) - if not hosts: - setattr(namespace, self.dest, [host]) - else: - hosts.append(host) - - -def getTlsOptions(args): - """Create TlsOptions from user input""" - - if (args.tls_client_credentials is None or - args.tls_trust_material is None): - return None - - print("TlsOptions enabled") - if args.read_certificate_files: - credential_blob = None - trust_blob = None - with open(args.tls_client_credentials, 'rb') as credentialfile: - credential_blob = credentialfile.read() - with open(args.tls_trust_material, 'rb') as trustfile: - trust_blob = trustfile.read() - return blpapi.TlsOptions.createFromBlobs( - credential_blob, - args.tls_client_credentials_password, - trust_blob) - - return blpapi.TlsOptions.createFromFiles( - args.tls_client_credentials, - args.tls_client_credentials_password, - args.tls_trust_material) - - -def parseCmdLine(): - """Parse command line arguments""" - - parser = ArgumentParser(description="Connection and Auth example", - formatter_class=lambda prog: RawTextHelpFormatter( - prog, width=99)) - defaultUser = AuthUser.createWithLogonName() - defaultAuthOptions = AuthOptions.createWithUser(defaultUser) - - parser.add_argument("--auth", - dest="auth", - help="authentication option: " - "user|none|app=|userapp=|dir=|" - "manual=" - " (default: user)\n" - "'none' is applicable to Desktop API product " - "that requires Bloomberg Professional service " - "to be installed locally.", - metavar="option", - action=AuthOptionsAction, - default=defaultAuthOptions) - - parser.add_argument("--host", - dest="host", - help="server name or IP, and port " - "(default 'localhost:8194')", - metavar="", - action=HostAction) - - parser.add_argument("--retries", - dest="retries", - help="number of connection retries " - "(default: number of hosts)", - metavar="option", - type=int) - - # TLS Options - parser.add_argument("--tls-client-credentials", - dest="tls_client_credentials", - help="name a PKCS#12 file to use as a source of " - "client credentials", - metavar="option") - parser.add_argument("--tls-client-credentials-password", - dest="tls_client_credentials_password", - help="specify password for accessing" - " client credentials", - metavar="option", - default="") - parser.add_argument("--tls-trust-material", - dest="tls_trust_material", - help="name a PKCS#7 file to use as a source of trusted" - " certificates", - metavar="option") - parser.add_argument("--read-certificate-files", - dest="read_certificate_files", - help="(optional) read the TLS files and pass the blobs", - action="store_true") - - args = parser.parse_args() - - args.tlsOptions = getTlsOptions(args) - - if not args.host: - args.host = [["localhost", 8194]] - - if args.retries is None: - args.retries = len(args.host) - - return args - - -class ConnectionAndAuthExample: # pylint: disable=too-few-public-methods - """This example shows how to configure the library to establish - connections using different host and ports, with a session identity. - """ - - def __init__(self, options): - self.config = options - - def run(self): - """ Execute the example """ - - sessionOptions = blpapi.SessionOptions() - for i, host in enumerate(self.config.host): - sessionOptions.setServerAddress(host[0], host[1], i) - - sessionOptions.setSessionIdentityOptions(self.config.auth) - sessionOptions.setAutoRestartOnDisconnection(True) - sessionOptions.setNumStartAttempts(self.config.retries) - - if self.config.tlsOptions: - sessionOptions.setTlsOptions(self.config.tlsOptions) - - session = blpapi.Session(sessionOptions) - if not session.start(): - print("Failed to start session.") - return - print("Session started") - - while True: - event = session.nextEvent(1000) - if event: - for message in event: - print(message) - - -def main(): - """ Main function. """ - print("ConnectionAndAuthExample. Press Ctrl+C to stop.") - - options = parseCmdLine() - - example = ConnectionAndAuthExample(options) - - try: - example.run() - except blpapi.Exception as err: - print("Exception caught: {}".format(err)) - - -if __name__ == "__main__": - try: - main() - except KeyboardInterrupt: - print("Ctrl+C pressed. Stopping...") - -__copyright__ = """ -Copyright 2020. Bloomberg Finance L.P. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: The above -copyright notice and this permission notice shall be included in all copies -or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/examples/ContributionsMktdataExample.py b/examples/ContributionsMktdataExample.py deleted file mode 100644 index 6e4c250..0000000 --- a/examples/ContributionsMktdataExample.py +++ /dev/null @@ -1,328 +0,0 @@ -# ContributionsMktdataExample.py -from __future__ import print_function -from __future__ import absolute_import - -import time -from optparse import OptionParser, OptionValueError -from threading import Event -import os -import platform as plat -import sys -if sys.version_info >= (3, 8) and plat.system().lower() == "windows": - # pylint: disable=no-member - with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): - import blpapi -else: - import blpapi - -MARKET_DATA = blpapi.Name("MarketData") -SESSION_TERMINATED = blpapi.Name("SessionTerminated") - -class MyStream(object): # pylint: disable=too-few-public-methods - - def __init__(self, sid=""): - self.id = sid - -class MyEventHandler(object): # pylint: disable=too-few-public-methods - """Event handler for the session""" - - def __init__(self, stop): - """ Construct a handler """ - self.stop = stop - - def processEvent(self, event, _sesssion): - """Process session event""" - - for msg in event: - print(msg) - if event.eventType() == blpapi.Event.SESSION_STATUS: - if msg.messageType() == SESSION_TERMINATED: - self.stop.set() - continue - -def authOptionCallback(_option, _opt, value, parser): - """Parse authorization options from user input""" - - vals = value.split('=', 1) - - if value == "user": - authUser = blpapi.AuthUser.createWithLogonName() - authOptions = blpapi.AuthOptions.createWithUser(authUser) - elif value == "none": - authOptions = None - elif vals[0] == "app" and len(vals) == 2: - appName = vals[1] - authOptions = blpapi.AuthOptions.createWithApp(appName) - elif vals[0] == "userapp" and len(vals) == 2: - appName = vals[1] - authUser = blpapi.AuthUser.createWithLogonName() - authOptions = blpapi.AuthOptions\ - .createWithUserAndApp(authUser, appName) - elif vals[0] == "dir" and len(vals) == 2: - activeDirectoryProperty = vals[1] - authUser = blpapi.AuthUser\ - .createWithActiveDirectoryProperty(activeDirectoryProperty) - authOptions = blpapi.AuthOptions.createWithUser(authUser) - elif vals[0] == "manual": - parts = [] - if len(vals) == 2: - parts = vals[1].split(',') - - if len(parts) != 3: - raise OptionValueError("Invalid auth option {}".format(value)) - - appName, ip, userId = parts - - authUser = blpapi.AuthUser.createWithManualOptions(userId, ip) - authOptions = blpapi.AuthOptions.createWithUserAndApp(authUser, appName) - else: - raise OptionValueError("Invalid auth option '{}'".format(value)) - - parser.values.auth = {'option' : authOptions} - -def parseCmdLine(): - """Parse command line arguments""" - - parser = OptionParser(description="Market data contribution.") - parser.add_option("-a", - "--ip", - dest="hosts", - help="server name or IP (default: localhost)", - metavar="ipAddress", - action="append", - default=[]) - parser.add_option("-p", - dest="port", - type="int", - help="server port (default: %default)", - metavar="tcpPort", - default=8194) - parser.add_option("-s", - dest="service", - help="service name (default: %default)", - metavar="service", - default="//blp/mpfbapi") - parser.add_option("-t", - dest="topic", - help="topic (default: %default)", - metavar="topic", - default="/ticker/AUDEUR Curncy") - parser.add_option("--auth", - dest="auth", - help="authentication option: " - "user|none|app=|userapp=|dir=" - "|manual=" - " (default: user)\n" - "'none' is applicable to Desktop API product " - "that requires Bloomberg Professional service " - "to be installed locally.", - metavar="option", - action="callback", - callback=authOptionCallback, - type="string", - default={"option" : - blpapi.AuthOptions.createWithUser( - blpapi.AuthUser.createWithLogonName())}) - - # TLS Options - parser.add_option("--tls-client-credentials", - dest="tls_client_credentials", - help="name a PKCS#12 file to use as a source of " - "client credentials", - metavar="option", - type="string") - parser.add_option("--tls-client-credentials-password", - dest="tls_client_credentials_password", - help="specify password for accessing client credentials", - metavar="option", - type="string", - default="") - parser.add_option("--tls-trust-material", - dest="tls_trust_material", - help="name a PKCS#7 file to use as a source of " - "trusted certificates", - metavar="option", - type="string") - parser.add_option("--read-certificate-files", - dest="read_certificate_files", - help="(optional) read the TLS files and pass the blobs", - metavar="option", - action="store_true") - - # ZFP Options - parser.add_option("--zfp-over-leased-line", - dest="zfpPort", - help="enable ZFP connections over leased lines on the" - " specified port (8194 or 8196)" - " (When this option is enabled, '-ip' and '-p' " - "arguments will be ignored.)", - metavar="port", - type="int") - - (options, _) = parser.parse_args() - - if not options.hosts: - options.hosts = ["localhost"] - - options.tlsOptions = getTlsOptions(options) - - options.remote = None - if options.zfpPort: - if not options.tlsOptions: - raise RuntimeError("ZFP connections require TLS parameters") - - if options.zfpPort == 8194: - options.remote = blpapi.ZfpUtil.REMOTE_8194 - elif options.zfpPort == 8196: - options.remote = blpapi.ZfpUtil.REMOTE_8196 - else: - raise RuntimeError("Invalid ZFP port: " + options.product) - - return options - -def getTlsOptions(options): - """Parse TlsOptions from user input""" - - if (options.tls_client_credentials is None or - options.tls_trust_material is None): - return None - - print("TlsOptions enabled") - if options.read_certificate_files: - credential_blob = None - trust_blob = None - with open(options.tls_client_credentials, 'rb') as credentialfile: - credential_blob = credentialfile.read() - with open(options.tls_trust_material, 'rb') as trustfile: - trust_blob = trustfile.read() - - return blpapi.TlsOptions.createFromBlobs( - credential_blob, - options.tls_client_credentials_password, - trust_blob) - - return blpapi.TlsOptions.createFromFiles( - options.tls_client_credentials, - options.tls_client_credentials_password, - options.tls_trust_material) - -def prepareStandardSessionOptions(options): - """Prepare SessionOptions for a regular session""" - - sessionOptions = blpapi.SessionOptions() - for idx, host in enumerate(options.hosts): - sessionOptions.setServerAddress(host, options.port, idx) - sessionOptions.setNumStartAttempts(len(options.hosts)) - - if options.tlsOptions: - sessionOptions.setTlsOptions(options.tlsOptions) - - return sessionOptions - -def prepareZfpSessionOptions(options): - """Prepare SessionOptions for a ZFP session""" - - print("Creating a ZFP connection for leased lines.") - sessionOptions = blpapi.ZfpUtil.getZfpOptionsForLeasedLines( - options.remote, - options.tlsOptions) - return sessionOptions - -def main(): - """Main function""" - - options = parseCmdLine() - - # Fill SessionOptions - sessionOptions = prepareZfpSessionOptions(options) \ - if options.remote \ - else prepareStandardSessionOptions(options) - sessionOptions.setSessionIdentityOptions(options.auth['option']) - sessionOptions.setAutoRestartOnDisconnection(True) - - stop = Event() - myEventHandler = MyEventHandler(stop) - - # Create a Session - session = blpapi.ProviderSession(sessionOptions, - myEventHandler.processEvent) - - # Start a Session - if not session.start(): - print("Failed to start session.") - return - - topicList = blpapi.TopicList() - topicList.add(options.service + options.topic, - blpapi.CorrelationId(MyStream(options.topic))) - - # Create topics - session.createTopics(topicList, - blpapi.ProviderSession.AUTO_REGISTER_SERVICES) - # createTopics() is synchronous, topicList will be updated - # with the results of topic creation (resolution will happen - # under the covers) - - streams = [] - for i in range(topicList.size()): - stream = topicList.correlationIdAt(i).value() - status = topicList.statusAt(i) - - if status == blpapi.TopicList.CREATED: - stream.topic = session.getTopic(topicList.messageAt(i)) - streams.append(stream) - else: - print("Stream '%s': topic not resolved, status = %d" % ( - stream.id, status)) - - service = session.getService(options.service) - - try: - # Now we will start publishing - value = 1 - while streams and not stop.is_set(): - event = service.createPublishEvent() - eventFormatter = blpapi.EventFormatter(event) - - for stream in streams: - value += 1 - eventFormatter.appendMessage(MARKET_DATA, stream.topic) - eventFormatter.setElement("BID", 0.5 * value) - eventFormatter.setElement("ASK", value) - - for msg in event: - print(msg) - - session.publish(event) - time.sleep(10) - finally: - # Stop the session - session.stop() - -if __name__ == "__main__": - print("ContributionsMktdataExample") - try: - main() - except KeyboardInterrupt: - print("Ctrl+C pressed. Stopping...") - -__copyright__ = """ -Copyright 2012. Bloomberg Finance L.P. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: The above -copyright notice and this permission notice shall be included in all copies -or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/examples/ContributionsPageExample.py b/examples/ContributionsPageExample.py deleted file mode 100644 index 1bfc030..0000000 --- a/examples/ContributionsPageExample.py +++ /dev/null @@ -1,389 +0,0 @@ -# ContributionsPageExample.py -from __future__ import print_function -from __future__ import absolute_import - -from optparse import OptionParser, OptionValueError -from threading import Event -import time -import os -import sys -import platform as plat -if sys.version_info >= (3, 8) and plat.system().lower() == "windows": - # pylint: disable=no-member - with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): - import blpapi -else: - import blpapi - -SESSION_TERMINATED = blpapi.Name("SessionTerminated") - -class MyStream(object): # pylint: disable=too-few-public-methods - - def __init__(self, sid=""): - self.id = sid - -class MyEventHandler(object): # pylint: disable=too-few-public-methods - """Event handler for the session""" - - def __init__(self, stop): - """Construct an event handler""" - self.stop = stop - - def processEvent(self, event, _session): - """Process session event""" - for msg in event: - print(msg) - if event.eventType() == blpapi.Event.SESSION_STATUS: - if msg.messageType() == SESSION_TERMINATED: - self.stop.set() - continue - - -def authOptionCallback(_option, _opt, value, parser): - """Parse authorization options from user input""" - - vals = value.split('=', 1) - - if value == "user": - authUser = blpapi.AuthUser.createWithLogonName() - authOptions = blpapi.AuthOptions.createWithUser(authUser) - elif value == "none": - authOptions = None - elif vals[0] == "app" and len(vals) == 2: - appName = vals[1] - authOptions = blpapi.AuthOptions.createWithApp(appName) - elif vals[0] == "userapp" and len(vals) == 2: - appName = vals[1] - authUser = blpapi.AuthUser.createWithLogonName() - authOptions = blpapi.AuthOptions\ - .createWithUserAndApp(authUser, appName) - elif vals[0] == "dir" and len(vals) == 2: - activeDirectoryProperty = vals[1] - authUser = blpapi.AuthUser\ - .createWithActiveDirectoryProperty(activeDirectoryProperty) - authOptions = blpapi.AuthOptions.createWithUser(authUser) - elif vals[0] == "manual": - parts = [] - if len(vals) == 2: - parts = vals[1].split(',') - - if len(parts) != 3: - raise OptionValueError("Invalid auth option {}".format(value)) - - appName, ip, userId = parts - - authUser = blpapi.AuthUser.createWithManualOptions(userId, ip) - authOptions = blpapi.AuthOptions.createWithUserAndApp(authUser, appName) - else: - raise OptionValueError("Invalid auth option '{}'".format(value)) - - parser.values.auth = {'option' : authOptions} - -def parseCmdLine(): - """Parse command line arguments""" - - parser = OptionParser(description="Publish on a topic.") - parser.add_option("-a", - "--ip", - dest="hosts", - help="server name or IP (default: localhost)", - metavar="ipAddress", - action="append", - default=[]) - parser.add_option("-p", - dest="port", - type="int", - help="server port (default: %default)", - metavar="tcpPort", - default=8194) - parser.add_option("-s", - dest="service", - help="service name (default: %default)", - metavar="service", - default="//blp/mpfbapi") - parser.add_option("-t", - dest="topic", - help="topic (default: %default)", - metavar="topic", - default="220/660/1") - parser.add_option("-c", - dest="contributorId", - type="int", - help="contributor id (default: %default)", - metavar="contributorId", - default=8563) - parser.add_option("--auth", - dest="auth", - help="authentication option: " - "user|none|app=|userapp=|dir=" - "|manual=" - " (default: none)\n" - "'none' is applicable to Desktop API product " - "that requires Bloomberg Professional service " - "to be installed locally.", - metavar="option", - action="callback", - callback=authOptionCallback, - type="string", - default={"option" : None}) - - # TLS Options - parser.add_option("--tls-client-credentials", - dest="tls_client_credentials", - help="name a PKCS#12 file to use as a source " - "of client credentials", - metavar="option", - type="string") - parser.add_option("--tls-client-credentials-password", - dest="tls_client_credentials_password", - help="specify password for accessing client credentials", - metavar="option", - type="string", - default="") - parser.add_option("--tls-trust-material", - dest="tls_trust_material", - help="name a PKCS#7 file to use as a source of" - " trusted certificates", - metavar="option", - type="string") - parser.add_option("--read-certificate-files", - dest="read_certificate_files", - help="(optional) read the TLS files and pass the blobs", - metavar="option", - action="store_true") - - # ZFP Options - parser.add_option("--zfp-over-leased-line", - dest="zfpPort", - help="enable ZFP connections over leased lines on the " - "specified port (8194 or 8196)" - " (When this option is enabled, '-ip' and '-p' " - "arguments will be ignored.)", - metavar="port", - type="int") - - (options, _) = parser.parse_args() - - if not options.hosts: - options.hosts = ["localhost"] - - options.tlsOptions = getTlsOptions(options) - - options.remote = None - if options.zfpPort: - if not options.tlsOptions: - raise RuntimeError("ZFP connections require TLS parameters") - - if options.zfpPort == 8194: - options.remote = blpapi.ZfpUtil.REMOTE_8194 - elif options.zfpPort == 8196: - options.remote = blpapi.ZfpUtil.REMOTE_8196 - else: - raise RuntimeError("Invalid ZFP port: " + options.product) - - return options - -def getTlsOptions(options): - """Parse TlsOptions from user input""" - - if (options.tls_client_credentials is None or - options.tls_trust_material is None): - return None - - print("TlsOptions enabled") - if options.read_certificate_files: - credential_blob = None - trust_blob = None - with open(options.tls_client_credentials, 'rb') as credentialfile: - credential_blob = credentialfile.read() - with open(options.tls_trust_material, 'rb') as trustfile: - trust_blob = trustfile.read() - - return blpapi.TlsOptions.createFromBlobs( - credential_blob, - options.tls_client_credentials_password, - trust_blob) - - return blpapi.TlsOptions.createFromFiles( - options.tls_client_credentials, - options.tls_client_credentials_password, - options.tls_trust_material) - -def prepareStandardSessionOptions(options): - """Prepare SessionOptions for a regular session""" - - sessionOptions = blpapi.SessionOptions() - for idx, host in enumerate(options.hosts): - sessionOptions.setServerAddress(host, options.port, idx) - sessionOptions.setNumStartAttempts(len(options.hosts)) - - if options.tlsOptions: - sessionOptions.setTlsOptions(options.tlsOptions) - - return sessionOptions - -def prepareZfpSessionOptions(options): - """Prepare SessionOptions for a ZFP session""" - - print("Creating a ZFP connection for leased lines.") - sessionOptions = blpapi.ZfpUtil.getZfpOptionsForLeasedLines( - options.remote, - options.tlsOptions) - return sessionOptions - -def main(): - """Main function""" - - options = parseCmdLine() - - # Fill SessionOptions - sessionOptions = prepareZfpSessionOptions(options) \ - if options.remote \ - else prepareStandardSessionOptions(options) - sessionOptions.setSessionIdentityOptions(options.auth['option']) - sessionOptions.setAutoRestartOnDisconnection(True) - - stop = Event() - myEventHandler = MyEventHandler(stop) - - # Create a Session - session = blpapi.ProviderSession(sessionOptions, - myEventHandler.processEvent) - - # Start a Session - if not session.start(): - print("Failed to start session.") - return - - topicList = blpapi.TopicList() - topicList.add(options.service + options.topic, - blpapi.CorrelationId(MyStream(options.topic))) - - # Create topics - session.createTopics(topicList, - blpapi.ProviderSession.AUTO_REGISTER_SERVICES) - # createTopics() is synchronous, topicList will be updated - # with the results of topic creation (resolution will happen - # under the covers) - - streams = [] - for i in range(topicList.size()): - stream = topicList.correlationIdAt(i).value() - status = topicList.statusAt(i) - - if status == blpapi.TopicList.CREATED: - stream.topic = session.getTopic(topicList.messageAt(i)) - streams.append(stream) - else: - print("Stream '%s': topic not resolved, status = %d" % ( - stream.id, status)) - - service = session.getService(options.service) - - try: - # Now we will start publishing - while streams and not stop.is_set(): - event = service.createPublishEvent() - eventFormatter = blpapi.EventFormatter(event) - - for stream in streams: - eventFormatter.appendMessage("PageData", stream.topic) - eventFormatter.pushElement("rowUpdate") - - eventFormatter.appendElement() - eventFormatter.setElement("rowNum", 1) - eventFormatter.pushElement("spanUpdate") - - eventFormatter.appendElement() - eventFormatter.setElement("startCol", 20) - eventFormatter.setElement("length", 4) - eventFormatter.setElement("text", "TEST") - eventFormatter.popElement() - - eventFormatter.appendElement() - eventFormatter.setElement("startCol", 25) - eventFormatter.setElement("length", 4) - eventFormatter.setElement("text", "PAGE") - eventFormatter.popElement() - - tm = time.strftime("%X") - eventFormatter.appendElement() - eventFormatter.setElement("startCol", 30) - eventFormatter.setElement("length", len(tm)) - eventFormatter.setElement("text", tm) - eventFormatter.setElement("attr", "BLINK") - eventFormatter.popElement() - - eventFormatter.popElement() - eventFormatter.popElement() - - eventFormatter.appendElement() - eventFormatter.setElement("rowNum", 2) - eventFormatter.pushElement("spanUpdate") - eventFormatter.appendElement() - eventFormatter.setElement("startCol", 20) - eventFormatter.setElement("length", 9) - eventFormatter.setElement("text", "---------") - eventFormatter.setElement("attr", "UNDERLINE") - eventFormatter.popElement() - eventFormatter.popElement() - eventFormatter.popElement() - - eventFormatter.appendElement() - eventFormatter.setElement("rowNum", 3) - eventFormatter.pushElement("spanUpdate") - eventFormatter.appendElement() - eventFormatter.setElement("startCol", 10) - eventFormatter.setElement("length", 9) - eventFormatter.setElement("text", "TEST LINE") - eventFormatter.popElement() - eventFormatter.appendElement() - eventFormatter.setElement("startCol", 23) - eventFormatter.setElement("length", 5) - eventFormatter.setElement("text", "THREE") - eventFormatter.popElement() - eventFormatter.popElement() - eventFormatter.popElement() - eventFormatter.popElement() - - eventFormatter.setElement("contributorId", - options.contributorId) - eventFormatter.setElement("productCode", 1) - eventFormatter.setElement("pageNumber", 1) - - for msg in event: - print(msg) - - session.publish(event) - time.sleep(10) - finally: - # Stop the session - session.stop() - -if __name__ == "__main__": - print("ContributionsPageExample") - try: - main() - except KeyboardInterrupt: - print("Ctrl+C pressed. Stopping...") - -__copyright__ = """ -Copyright 2012. Bloomberg Finance L.P. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: The above -copyright notice and this permission notice shall be included in all copies -or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/examples/CorrelationExample.py b/examples/CorrelationExample.py deleted file mode 100644 index 014d8fb..0000000 --- a/examples/CorrelationExample.py +++ /dev/null @@ -1,131 +0,0 @@ -# CorrelationExample.py -from __future__ import print_function -from __future__ import absolute_import - -from optparse import OptionParser - -import os -import platform as plat -import sys -if sys.version_info >= (3, 8) and plat.system().lower() == "windows": - # pylint: disable=no-member - with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): - import blpapi -else: - import blpapi - -class Window(object): - def __init__(self, name): - self.name = name - - def displaySecurityInfo(self, msg): - print("%s: %s" % (self.name, msg)) - - -def parseCmdLine(): - parser = OptionParser(description="Retrieve reference data.") - parser.add_option("-a", - "--ip", - dest="host", - help="server name or IP (default: %default)", - metavar="ipAddress", - default="localhost") - parser.add_option("-p", - dest="port", - type="int", - help="server port (default: %default)", - metavar="tcpPort", - default=8194) - - poptions,_ = parser.parse_args() - - return poptions - - -def startSession(session): - if not session.start(): - print("Failed to connect!") - return False - - if not session.openService("//blp/refdata"): - print("Failed to open //blp/refdata") - session.stop() - return False - - return True - - -def main(): - options = parseCmdLine() - - # Fill SessionOptions - sessionOptions = blpapi.SessionOptions() - sessionOptions.setServerHost(options.host) - sessionOptions.setServerPort(options.port) - - print("Connecting to %s:%d" % (options.host, options.port)) - - # Create a Session - session = blpapi.Session(sessionOptions) - - # Start a Session - if not startSession(session): - return - - refDataService = session.getService("//blp/refdata") - request = refDataService.createRequest("ReferenceDataRequest") - request.append("securities", "IBM US Equity") - request.append("fields", "PX_LAST") - request.append("fields", "DS002") - - secInfoWindow = Window("SecurityInfo") - cid = blpapi.CorrelationId(secInfoWindow) - - print("Sending Request:", request) - session.sendRequest(request, correlationId=cid) - - try: - # Process received events - while(True): - # We provide timeout to give the chance to Ctrl+C handling: - event = session.nextEvent(500) - for msg in event: - if event.eventType() == blpapi.Event.RESPONSE or \ - event.eventType() == blpapi.Event.PARTIAL_RESPONSE: - window = msg.correlationIds()[0].value() - window.displaySecurityInfo(msg) - - # Response completely received, so we could exit - if event.eventType() == blpapi.Event.RESPONSE: - break - finally: - # Stop the session - session.stop() - -if __name__ == "__main__": - print("CorrelationExample") - try: - main() - except KeyboardInterrupt: - print("Ctrl+C pressed. Stopping...") - -__copyright__ = """ -Copyright 2012. Bloomberg Finance L.P. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: The above -copyright notice and this permission notice shall be included in all copies -or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/examples/EntitlementsVerificationTokenExample.py b/examples/EntitlementsVerificationTokenExample.py deleted file mode 100644 index 0fae7f0..0000000 --- a/examples/EntitlementsVerificationTokenExample.py +++ /dev/null @@ -1,258 +0,0 @@ -# EntitlementsVerificationTokenExample.py -from __future__ import print_function -from __future__ import absolute_import - -from optparse import OptionParser - -import os -import platform as plat -import sys -if sys.version_info >= (3, 8) and plat.system().lower() == "windows": - # pylint: disable=no-member - with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): - import blpapi -else: - import blpapi - -SECURITY_DATA = blpapi.Name("securityData") -SECURITY = blpapi.Name("security") -EID_DATA = blpapi.Name("eidData") -AUTHORIZATION_SUCCESS = blpapi.Name("AuthorizationSuccess") - -REFRENCEDATA_REQUEST = "ReferenceDataRequest" -APIAUTH_SVC = "//blp/apiauth" -REFDATA_SVC = "//blp/refdata" - - -def printEvent(event): - for msg in event: - corrId = msg.correlationIds()[0] - if corrId.value(): - print("Correlator:", corrId.value()) - print(msg) - - -class SessionEventHandler(object): - def __init__(self, identities, tokens): - self.identities = identities - self.tokens = tokens - - def printFailedEntitlements(self, listOfFailedEIDs): - print(listOfFailedEIDs) - - def distributeMessage(self, msg): - service = msg.service() - securities = msg.getElement(SECURITY_DATA) - numSecurities = securities.numValues() - print("Processing %s securities" % numSecurities) - for i in range(numSecurities): - security = securities.getValueAsElement(i) - ticker = security.getElementAsString(SECURITY) - entitlements = None - if security.hasElement(EID_DATA): - entitlements = security.getElement(EID_DATA) - if (entitlements is not None and - entitlements.isValid() and - entitlements.numValues() > 0): - for j, identity in enumerate(self.identities): - if identity.hasEntitlements(service, entitlements): - print("User: %s is entitled to get data for: %s" % \ - (j + 1, ticker)) - else: - print("User: %s is NOT entitled to get data for: %s " \ - "- Failed eids:" % (j + 1, ticker)) - self.printFailedEntitlements( - identity.getFailedEntitlements(service, - entitlements)[1]) - else: - for token in self.tokens: - print("User: %s is entitled to get data for: %s" % \ - (token, ticker)) - # Now Distribute message to the user. - - def processResponseEvent(self, event): - for msg in event: - if msg.hasElement("RESPONSE_ERROR") or msg.hasElement("responseError"): - print(msg) - continue - self.distributeMessage(msg) - - def processEvent(self, event, _session): - if (event.eventType() == blpapi.Event.SESSION_STATUS or - event.eventType() == blpapi.Event.SERVICE_STATUS or - event.eventType() == blpapi.Event.REQUEST_STATUS or - event.eventType() == blpapi.Event.AUTHORIZATION_STATUS): - printEvent(event) - elif (event.eventType() == blpapi.Event.RESPONSE or - event.eventType() == blpapi.Event.PARTIAL_RESPONSE): - try: - self.processResponseEvent(event) - except blpapi.Exception as e: - print("Library Exception !!! %s" % e.description()) - return True - - -def parseCmdLine(): - # Parse command-line parameters - parser = OptionParser( - description="Entitlements verification token example") - parser.add_option("-s", - dest="securities", - help="security (default: IBM US Equity)", - metavar="security", - action="append", - default=[]) - parser.add_option("-t", - "--token", - dest="tokens", - help="token value returned in generateToken response", - metavar="token", - action="append", - default=[]) - parser.add_option("-a", - "--ip", - dest="host", - help="server name or IP (default: %default)", - metavar="ipAddress", - default="localhost") - parser.add_option("-p", - dest="port", - type="int", - help="server port (default: %default)", - metavar="tcpPort", - default=8194) - - options,_ = parser.parse_args() - - if not options.securities: - options.securities = ["MSFT US Equity"] - - return options - - -def authorizeUsers(session, tokens, identities): - authService = session.getService(APIAUTH_SVC) - is_any_user_authorized = False - - # Authorize each of the users - for index, token in enumerate(tokens): - identity = session.createIdentity() - identities.append(identity) - authRequest = authService.createAuthorizationRequest() - authRequest.set("token", token) - correlator = blpapi.CorrelationId(token) - eventQueue = blpapi.EventQueue() - session.sendAuthorizationRequest(authRequest, - identity, - correlator, - eventQueue) - event = eventQueue.nextEvent() - if (event.eventType() == blpapi.Event.RESPONSE or - event.eventType() == blpapi.Event.REQUEST_STATUS): - for msg in event: - if msg.messageType() == AUTHORIZATION_SUCCESS: - print("User %s authorization success" % (index + 1)) - is_any_user_authorized = True - else: - print("User %s authorization failed" % (index + 1)) - printEvent(event) - return is_any_user_authorized - - -def sendRefDataRequest(session, securities): - refDataService = session.getService(REFDATA_SVC) - request = refDataService.createRequest(REFRENCEDATA_REQUEST) - - # Add securities to the request - securitiesEl = request.getElement("securities") - for security in securities: - securitiesEl.appendValue(security) - - # Add fields to the request - fields = request.getElement("fields") - fields.appendValue("PX_LAST") - fields.appendValue("DS002") - - request.set("returnEids", True) - - # Send the request using the server's credentials - print("Sending RefDataRequest using server credentials...") - session.sendRequest(request) - - -def main(): - options = parseCmdLine() - - # Create SessionOptions object and populate it with data - sessionOptions = blpapi.SessionOptions() - sessionOptions.setServerHost(options.host) - sessionOptions.setServerPort(options.port) - - securities = options.securities - if not options.tokens: - print("No tokens were specified") - return - - tokens = options.tokens - print(tokens) - - identities = [] - - # Create Session object and connect to Bloomberg services - print("Connecting to %s:%s" % (options.host, options.port)) - eventHandler = SessionEventHandler(identities, tokens) - session = blpapi.Session(sessionOptions, eventHandler.processEvent) - if not session.start(): - print("Failed to start session.") - return - - # Open authorization service - if not session.openService("//blp/apiauth"): - print("Failed to open //blp/apiauth") - return - - # Open reference data service - if not session.openService("//blp/refdata"): - print("Failed to open //blp/refdata") - return - - # Authorize all the users that are interested in receiving data - if authorizeUsers(session, tokens, identities): - # Make the various requests that we need to make - sendRefDataRequest(session, securities) - - try: - # Wait for enter key to exit application - print("Press ENTER to quit") - input() - finally: - # Stop the session - session.stop() - -if __name__ == "__main__": - print("EntitlementsVerificationTokenExample") - try: - main() - except KeyboardInterrupt: - print("Ctrl+C pressed. Stopping...") - -__copyright__ = """ -Copyright 2012. Bloomberg Finance L.P. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: The above -copyright notice and this permission notice shall be included in all copies -or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/examples/GenerateTokenExample.py b/examples/GenerateTokenExample.py deleted file mode 100644 index fddf0a3..0000000 --- a/examples/GenerateTokenExample.py +++ /dev/null @@ -1,208 +0,0 @@ -# GenerateTokenExample.py -from __future__ import print_function -from __future__ import absolute_import - -from optparse import OptionParser - -import os -import platform as plat -import sys -if sys.version_info >= (3, 8) and plat.system().lower() == "windows": - # pylint: disable=no-member - with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): - import blpapi -else: - import blpapi - -AUTHORIZATION_SUCCESS = blpapi.Name("AuthorizationSuccess") -AUTHORIZATION_FAILURE = blpapi.Name("AuthorizationFailure") -TOKEN_SUCCESS = blpapi.Name("TokenGenerationSuccess") -TOKEN_FAILURE = blpapi.Name("TokenGenerationFailure") - -def parseCmdLine(): - # Parse command-line parameters - parser = OptionParser(description="Generate a token for authorization") - parser.add_option("-a", - "--ip", - dest="host", - help="server name or IP (default: %default)", - metavar="ipAddress", - default="localhost") - parser.add_option("-p", - dest="port", - type="int", - help="server port (default: %default)", - metavar="tcpPort", - default=8194) - parser.add_option("-s", - dest="securities", - help="security (default: IBM US Equity)", - metavar="security", - action="append", - default=[]) - parser.add_option("-f", - dest="fields", - help="field to subscribe to (default: PX_LAST)", - metavar="field", - action="append", - default=[]) - parser.add_option("-d", - dest="dirSvcProperty", - help="dirSvcProperty", - metavar="dirSvcProperty") - - options,_ = parser.parse_args() - - if not options.securities: - options.securities = ["IBM US Equity"] - - if not options.fields: - options.fields = ["PX_LAST"] - - return options - - -def sendRequest(session, identity, securities, fields): - refDataService = session.getService("//blp/refdata") - request = refDataService.createRequest("ReferenceDataRequest") - - # Add securities to the request - securitiesEl = request.getElement("securities") - for security in securities: - securitiesEl.appendValue(security) - - # Add fields to the request - fieldsEl = request.getElement("fields") - for field in fields: - fieldsEl.appendValue(field) - - print("Sending request: %s" % request) - session.sendRequest(request, identity) - - -def processTokenStatus(event, session): - print("processTokenEvents") - - # Handle response to token generation request - for msg in event: - if msg.messageType() == TOKEN_SUCCESS: - print(msg) - - # Authentication phase has passed; send authorization request - authService = session.getService("//blp/apiauth") - authRequest = authService.createAuthorizationRequest() - authRequest.set("token", - msg.getElementAsString("token")) - - identity = session.createIdentity() - session.sendAuthorizationRequest( - authRequest, - identity, - blpapi.CorrelationId(1)) - elif msg.messageType() == TOKEN_FAILURE: - # Token generation failure - print(msg) - return None - return identity - - -def processEvent(event, session, identity, securities, fields): - print("processEvent") - - # Handle response to authorization request; handle reference data - for msg in event: - if msg.messageType() == AUTHORIZATION_SUCCESS: - # Authorization phase has passed; request data - print("Authorization SUCCESS") - sendRequest(session, identity, securities, fields) - elif msg.messageType() == AUTHORIZATION_FAILURE: - # Authorization failure - print("Authorization FAILED") - print(msg) - return False - else: - # Handle reference data. RESPONSE event indicates end-of-data - print(msg) - if event.eventType() == blpapi.Event.RESPONSE: - print("Got Final Response") - return False - return True - - -def main(): - options = parseCmdLine() - - # Create SessionOptions object and populate it with data - sessionOptions = blpapi.SessionOptions() - sessionOptions.setServerHost(options.host) - sessionOptions.setServerPort(options.port) - authOptions = "AuthenticationType=OS_LOGON" - if options.dirSvcProperty: - authOptions = "AuthenticationType=DIRECTORY_SERVICE;" + \ - "DirSvcPropertyName=" + options.dirSvcProperty - print("authOptions = %s" % authOptions) - sessionOptions.setAuthenticationOptions(authOptions) - - securities = options.securities - fields = options.fields - - # Create Session object and connect to Bloomberg services - print("Connecting to %s:%s" % (options.host, options.port)) - session = blpapi.Session(sessionOptions) - if not session.start(): - print("Failed to start session.") - return - - # Open reference data service - if not session.openService("//blp/refdata"): - print("Failed to open //blp/refdata") - return - - # Open authorization service - if not session.openService("//blp/apiauth"): - print("Failed to open //blp/apiauth") - return - - # Submit a token generation request - tokenReqId = blpapi.CorrelationId(99) - session.generateToken(tokenReqId) - identity = None - - while True: - event = session.nextEvent() - if event.eventType() == blpapi.Event.TOKEN_STATUS: - identity = processTokenStatus(event, session) - if identity is None: - break - else: - if not processEvent(event, session, identity, securities, fields): - break - - -if __name__ == "__main__": - print("GenerateTokenExample") - try: - main() - except KeyboardInterrupt: - print("Ctrl+C pressed. Stopping...") - -__copyright__ = """ -Copyright 2012. Bloomberg Finance L.P. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: The above -copyright notice and this permission notice shall be included in all copies -or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/examples/GenerateTokenSubscriptionExample.py b/examples/GenerateTokenSubscriptionExample.py deleted file mode 100644 index 4fa1ca9..0000000 --- a/examples/GenerateTokenSubscriptionExample.py +++ /dev/null @@ -1,209 +0,0 @@ -# GenerateTokenSubscriptionExample.py -from __future__ import print_function -from __future__ import absolute_import - -from optparse import OptionParser - -import os -import platform as plat -import sys -if sys.version_info >= (3, 8) and plat.system().lower() == "windows": - # pylint: disable=no-member - with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): - import blpapi -else: - import blpapi - -AUTHORIZATION_SUCCESS = blpapi.Name("AuthorizationSuccess") -AUTHORIZATION_FAILURE = blpapi.Name("AuthorizationFailure") -TOKEN_SUCCESS = blpapi.Name("TokenGenerationSuccess") -TOKEN_FAILURE = blpapi.Name("TokenGenerationFailure") - -def parseCmdLine(): - parser = OptionParser(description="Generate a token for authorization") - parser.add_option("-a", - "--ip", - dest="host", - help="server name or IP (default: %default)", - metavar="ipAddress", - default="localhost") - parser.add_option("-p", - dest="port", - type="int", - help="server port (default: %default)", - metavar="tcpPort", - default=8194) - parser.add_option("-s", - dest="securities", - help="security (default: IBM US Equity)", - metavar="security", - action="append", - default=[]) - parser.add_option("-f", - dest="fields", - help="field to subscribe to (default: LAST_PRICE)", - metavar="field", - action="append", - default=[]) - parser.add_option("-o", - dest="options", - help="subscribtion options", - metavar="options", - action="append", - default=[]) - parser.add_option("-d", - dest="dirSvcProperty", - help="dirSvcProperty", - metavar="dirSvcProperty") - - options,_ = parser.parse_args() - - if not options.securities: - options.securities = ["IBM US Equity"] - - if not options.fields: - options.fields = ["LAST_PRICE"] - - return options - - -def subscribe(session, identity, securities, fields, soptions = None): - # Create a SubscriptionList and populate it with securities, fields etc - subscriptions = blpapi.SubscriptionList() - - for i, security in enumerate(securities): - subscriptions.add(security, - fields, - soptions, - blpapi.CorrelationId(i)) - - print("Subscribing...") - session.subscribe(subscriptions, identity) - - -def processTokenStatus(event, session): - print("processTokenEvents") - - for msg in event: - if msg.messageType() == TOKEN_SUCCESS: - print(msg) - - # Authentication phase has passed; send authorization request - authService = session.getService("//blp/apiauth") - authRequest = authService.createAuthorizationRequest() - authRequest.set("token", msg.getElementAsString("token")) - identity = session.createIdentity() - session.sendAuthorizationRequest( - authRequest, - identity, - blpapi.CorrelationId(1)) - elif msg.messageType() == TOKEN_FAILURE: - # Token generation failure - print(msg) - return None - return identity - - -def processEvent(event, session, identity, securities, fields): - print("processEvent") - - for msg in event: - if msg.messageType() == AUTHORIZATION_SUCCESS: - # Authorization phase has passed; subscribe to market data - print("Authorization SUCCESS") - subscribe(session, identity, securities, fields) - elif msg.messageType() == AUTHORIZATION_FAILURE: - # Authorization failure - print("Authorization FAILED") - print(msg) - return False - else: - print(msg) - return True - - -def main(): - - print("GenerateTokenSubscriptionExample") - options = parseCmdLine() - - # Create SessionOptions object and populate it with data - sessionOptions = blpapi.SessionOptions() - sessionOptions.setServerHost(options.host) - sessionOptions.setServerPort(options.port) - authOptions = "AuthenticationType=OS_LOGON" - if options.dirSvcProperty: - authOptions = "AuthenticationType=DIRECTORY_SERVICE;" + \ - "DirSvcPropertyName=" + options.dirSvcProperty - print("authOptions = %s" % authOptions) - sessionOptions.setAuthenticationOptions(authOptions) - - securities = options.securities - fields = options.fields - - print("Connecting to %s:%s" % (options.host, options.port)) - session = blpapi.Session(sessionOptions) - if not session.start(): - print("Failed to start session.") - return - - # Open market data service - if not session.openService("//blp/mktdata"): - print("Failed to open //blp/mktdata") - return - - # Open authorization service - if not session.openService("//blp/apiauth"): - print("Failed to open //blp/apiauth") - return - - # Submit a token generation request - tokenReqId = blpapi.CorrelationId(99) - session.generateToken(tokenReqId) - - identity = None - - # Handle and respond to incoming events - while True: - # nextEvent() method below is called with a timeout to let - # the program catch Ctrl-C between arrivals of new events - event = session.nextEvent(1000) - if event.eventType() != blpapi.Event.TIMEOUT: - if event.eventType() == blpapi.Event.TOKEN_STATUS: - # Handle response to token generation request - identity = processTokenStatus(event, session) - if identity is None: - break - else: - # Handle all other events - if not processEvent(event, session, identity, securities, fields): - break - - -if __name__ == "__main__": - print("GenerateTokenSubscriptionExample") - try: - main() - except KeyboardInterrupt: - print("Ctrl+C pressed. Stopping...") - -__copyright__ = """ -Copyright 2012. Bloomberg Finance L.P. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: The above -copyright notice and this permission notice shall be included in all copies -or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/examples/IntradayBarExample.py b/examples/IntradayBarExample.py deleted file mode 100644 index 79cfadc..0000000 --- a/examples/IntradayBarExample.py +++ /dev/null @@ -1,261 +0,0 @@ -# IntradayBarExample.py -from __future__ import print_function -from __future__ import absolute_import - -import copy -import datetime -from optparse import OptionParser, Option, OptionValueError - -import os -import platform as plat -import sys -if sys.version_info >= (3, 8) and plat.system().lower() == "windows": - # pylint: disable=no-member - with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): - import blpapi -else: - import blpapi - -BAR_DATA = blpapi.Name("barData") -BAR_TICK_DATA = blpapi.Name("barTickData") -OPEN = blpapi.Name("open") -HIGH = blpapi.Name("high") -LOW = blpapi.Name("low") -CLOSE = blpapi.Name("close") -VOLUME = blpapi.Name("volume") -NUM_EVENTS = blpapi.Name("numEvents") -TIME = blpapi.Name("time") -RESPONSE_ERROR = blpapi.Name("responseError") -SESSION_TERMINATED = blpapi.Name("SessionTerminated") -CATEGORY = blpapi.Name("category") -MESSAGE = blpapi.Name("message") - - -def checkDateTime(_option, opt, value): - try: - return datetime.datetime.strptime(value, "%Y-%m-%d %H:%M:%S") - except ValueError as ex: - raise OptionValueError( - "option {0}: invalid datetime value: {1} ({2})".format( - opt, value, ex)) - - -class ExampleOption(Option): - TYPES = Option.TYPES + ("datetime",) - TYPE_CHECKER = copy.copy(Option.TYPE_CHECKER) - TYPE_CHECKER["datetime"] = checkDateTime - - -def parseCmdLine(): - parser = OptionParser(description="Retrieve intraday bars.", - epilog="Notes: " + - "1) All times are in GMT. " + - "2) Only one security can be specified. " + - "3) Only one event can be specified.", - option_class=ExampleOption) - parser.add_option("-a", - "--ip", - dest="host", - help="server name or IP (default: %default)", - metavar="ipAddress", - default="localhost") - parser.add_option("-p", - dest="port", - type="int", - help="server port (default: %default)", - metavar="tcpPort", - default=8194) - parser.add_option("-s", - dest="security", - help="security (default: %default)", - metavar="security", - default="IBM US Equity") - parser.add_option("-e", - dest="event", - help="event (default: %default)", - metavar="event", - default="TRADE") - parser.add_option("-b", - dest="barInterval", - type="int", - help="bar interval (default: %default)", - metavar="barInterval", - default=60) - parser.add_option("--sd", - dest="startDateTime", - type="datetime", - help="start date/time (default: %default)", - metavar="startDateTime", - default=datetime.datetime(2008, 8, 11, 15, 30, 0)) - parser.add_option("--ed", - dest="endDateTime", - type="datetime", - help="end date/time (default: %default)", - metavar="endDateTime", - default=datetime.datetime(2008, 8, 11, 15, 35, 0)) - parser.add_option("-g", - dest="gapFillInitialBar", - help="gapFillInitialBar", - action="store_true", - default=False) - - options,_ = parser.parse_args() - - return options - - -def printErrorInfo(leadingStr, errorInfo): - print("%s%s (%s)" % (leadingStr, errorInfo.getElementAsString(CATEGORY), - errorInfo.getElementAsString(MESSAGE))) - - -def processMessage(msg): - data = msg.getElement(BAR_DATA).getElement(BAR_TICK_DATA) - print("Datetime\t\tOpen\t\tHigh\t\tLow\t\tClose\t\tNumEvents\tVolume") - - for bar in data.values(): - time = bar.getElementAsDatetime(TIME) - open_ = bar.getElementAsFloat(OPEN) - high = bar.getElementAsFloat(HIGH) - low = bar.getElementAsFloat(LOW) - close = bar.getElementAsFloat(CLOSE) - numEvents = bar.getElementAsInteger(NUM_EVENTS) - volume = bar.getElementAsInteger(VOLUME) - - print("%s\t\t%.3f\t\t%.3f\t\t%.3f\t\t%.3f\t\t%d\t\t%d" % \ - (time.strftime("%m/%d/%y %H:%M"), open_, high, low, close, - numEvents, volume)) - - -def processResponseEvent(event): - for msg in event: - print(msg) - if msg.hasElement(RESPONSE_ERROR): - printErrorInfo("REQUEST FAILED: ", msg.getElement(RESPONSE_ERROR)) - continue - processMessage(msg) - - -def sendIntradayBarRequest(session, options): - refDataService = session.getService("//blp/refdata") - request = refDataService.createRequest("IntradayBarRequest") - - # only one security/eventType per request - request.set("security", options.security) - request.set("eventType", options.event) - request.set("interval", options.barInterval) - - # All times are in GMT - if not options.startDateTime or not options.endDateTime: - tradedOn = getPreviousTradingDate() - if tradedOn: - startTime = datetime.datetime.combine(tradedOn, - datetime.time(15, 30)) - request.set("startDateTime", startTime) - endTime = datetime.datetime.combine(tradedOn, - datetime.time(15, 35)) - request.set("endDateTime", endTime) - else: - if options.startDateTime and options.endDateTime: - request.set("startDateTime", options.startDateTime) - request.set("endDateTime", options.endDateTime) - - if options.gapFillInitialBar: - request.set("gapFillInitialBar", True) - - print("Sending Request:", request) - session.sendRequest(request) - - -def eventLoop(session): - done = False - while not done: - # nextEvent() method below is called with a timeout to let - # the program catch Ctrl-C between arrivals of new events - event = session.nextEvent(500) - if event.eventType() == blpapi.Event.PARTIAL_RESPONSE: - print("Processing Partial Response") - processResponseEvent(event) - elif event.eventType() == blpapi.Event.RESPONSE: - print("Processing Response") - processResponseEvent(event) - done = True - else: - for msg in event: - if event.eventType() == blpapi.Event.SESSION_STATUS: - if msg.messageType() == SESSION_TERMINATED: - done = True - - -def getPreviousTradingDate(): - tradedOn = datetime.date.today() - - while True: - try: - tradedOn -= datetime.timedelta(days=1) - except OverflowError: - return None - - if tradedOn.weekday() not in [5, 6]: - return tradedOn - - -def main(): - options = parseCmdLine() - - # Fill SessionOptions - sessionOptions = blpapi.SessionOptions() - sessionOptions.setServerHost(options.host) - sessionOptions.setServerPort(options.port) - - print("Connecting to %s:%s" % (options.host, options.port)) - # Create a Session - session = blpapi.Session(sessionOptions) - - # Start a Session - if not session.start(): - print("Failed to start session.") - return - - try: - # Open service to get historical data from - if not session.openService("//blp/refdata"): - print("Failed to open //blp/refdata") - return - - sendIntradayBarRequest(session, options) - - # wait for events from session. - eventLoop(session) - - finally: - # Stop the session - session.stop() - -if __name__ == "__main__": - print("IntradayBarExample") - try: - main() - except KeyboardInterrupt: - print("Ctrl+C pressed. Stopping...") - -__copyright__ = """ -Copyright 2012. Bloomberg Finance L.P. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: The above -copyright notice and this permission notice shall be included in all copies -or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/examples/IntradayTickExample.py b/examples/IntradayTickExample.py deleted file mode 100644 index 1a82762..0000000 --- a/examples/IntradayTickExample.py +++ /dev/null @@ -1,320 +0,0 @@ -# IntradayTickExample.py -from __future__ import print_function -from __future__ import absolute_import - -import copy -import datetime -from optparse import OptionParser, Option, OptionValueError - -import os -import platform as plat -import sys -if sys.version_info >= (3, 8) and plat.system().lower() == "windows": - # pylint: disable=no-member - with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): - import blpapi -else: - import blpapi - -TICK_DATA = blpapi.Name("tickData") -COND_CODE = blpapi.Name("conditionCodes") -TICK_SIZE = blpapi.Name("size") -TIME = blpapi.Name("time") -TYPE = blpapi.Name("type") -VALUE = blpapi.Name("value") -RESPONSE_ERROR = blpapi.Name("responseError") -CATEGORY = blpapi.Name("category") -MESSAGE = blpapi.Name("message") -SESSION_TERMINATED = blpapi.Name("SessionTerminated") - -def authOptionCallback(_option, _opt, value, parser): - """Parse authorization options from user input""" - - vals = value.split('=', 1) - - if value == "user": - authUser = blpapi.AuthUser.createWithLogonName() - authOptions = blpapi.AuthOptions.createWithUser(authUser) - elif value == "none": - authOptions = None - elif vals[0] == "app" and len(vals) == 2: - appName = vals[1] - authOptions = blpapi.AuthOptions.createWithApp(appName) - elif vals[0] == "userapp" and len(vals) == 2: - appName = vals[1] - authUser = blpapi.AuthUser.createWithLogonName() - authOptions = blpapi.AuthOptions\ - .createWithUserAndApp(authUser, appName) - elif vals[0] == "dir" and len(vals) == 2: - activeDirectoryProperty = vals[1] - authUser = blpapi.AuthUser\ - .createWithActiveDirectoryProperty(activeDirectoryProperty) - authOptions = blpapi.AuthOptions.createWithUser(authUser) - elif vals[0] == "manual": - parts = [] - if len(vals) == 2: - parts = vals[1].split(',') - - if len(parts) != 3: - raise OptionValueError("Invalid auth option {}".format(value)) - - appName, ip, userId = parts - - authUser = blpapi.AuthUser.createWithManualOptions(userId, ip) - authOptions = blpapi.AuthOptions.createWithUserAndApp(authUser, appName) - else: - raise OptionValueError("Invalid auth option '{}'".format(value)) - - parser.values.auth = {'option' : authOptions} - - -def checkDateTime(_option, opt, value): - try: - return datetime.datetime.strptime(value, "%Y-%m-%d %H:%M:%S") - except ValueError as ex: - raise OptionValueError( - "option {0}: invalid datetime value: {1} ({2})".format( - opt, value, ex)) - - -class ExampleOption(Option): - TYPES = Option.TYPES + ("datetime",) - TYPE_CHECKER = copy.copy(Option.TYPE_CHECKER) - TYPE_CHECKER["datetime"] = checkDateTime - - -def parseCmdLine(): - parser = OptionParser(description="Retrieve intraday rawticks.", - epilog="Notes: " + - "1) All times are in GMT. " + - "2) Only one security can be specified.", - option_class=ExampleOption) - parser.add_option("-a", - "--ip", - dest="host", - help="server name or IP (default: %default)", - metavar="ipAddress", - default="localhost") - parser.add_option("-p", - dest="port", - type="int", - help="server port (default: %default)", - metavar="tcpPort", - default=8194) - parser.add_option("-s", - dest="security", - help="security (default: %default)", - metavar="security", - default="IBM US Equity") - parser.add_option("-e", - dest="events", - help="events (default: TRADE)", - metavar="event", - action="append", - default=[]) - parser.add_option("--sd", - dest="startDateTime", - type="datetime", - help="start date/time (default: %default)", - metavar="startDateTime", - default=None) - parser.add_option("--ed", - dest="endDateTime", - type="datetime", - help="end date/time (default: %default)", - metavar="endDateTime", - default=None) - parser.add_option("--cc", - dest="conditionCodes", - help="include condition codes", - action="store_true", - default=False) - parser.add_option("--auth", - dest="auth", - help="authentication option: " - "user|none|app=|userapp=|dir=" - "|manual=" - " (default: user)\n" - "'none' is applicable to Desktop API product " - "that requires Bloomberg Professional service " - "to be installed locally.", - metavar="option", - action="callback", - callback=authOptionCallback, - type="string", - default={"option" : - blpapi.AuthOptions.createWithUser( - blpapi.AuthUser.createWithLogonName())}) - - - (options, _) = parser.parse_args() - - if not options.host: - options.host = ["localhost"] - - if not options.events: - options.events = ["TRADE"] - - return options - - -def printErrorInfo(leadingStr, errorInfo): - print("%s%s (%s)" % (leadingStr, errorInfo.getElementAsString(CATEGORY), - errorInfo.getElementAsString(MESSAGE))) - - -def processMessage(msg): - data = msg.getElement(TICK_DATA).getElement(TICK_DATA) - print("TIME\t\t\t\tTYPE\tVALUE\t\tSIZE\tCC") - print("----\t\t\t\t----\t-----\t\t----\t--") - - for item in data.values(): - item.getElementAsDatetime(TIME) - timeString = item.getElementAsString(TIME) - type_ = item.getElementAsString(TYPE) - value = item.getElementAsFloat(VALUE) - size = item.getElementAsInteger(TICK_SIZE) - if item.hasElement(COND_CODE): - cc = item.getElementAsString(COND_CODE) - else: - cc = "" - - print("%s\t%s\t%.3f\t\t%d\t%s" % (timeString, type_, value, size, cc)) - - -def processResponseEvent(event): - for msg in event: - print(msg) - if msg.hasElement(RESPONSE_ERROR): - printErrorInfo("REQUEST FAILED: ", msg.getElement(RESPONSE_ERROR)) - continue - processMessage(msg) - - -def sendIntradayTickRequest(session, options, identity = None): - refDataService = session.getService("//blp/refdata") - request = refDataService.createRequest("IntradayTickRequest") - - # only one security/eventType per request - request.set("security", options.security) - - # Add fields to request - eventTypes = request.getElement("eventTypes") - for event in options.events: - eventTypes.appendValue(event) - - # All times are in GMT - if not options.startDateTime or not options.endDateTime: - tradedOn = getPreviousTradingDate() - if tradedOn: - startTime = datetime.datetime.combine(tradedOn, - datetime.time(15, 30)) - request.set("startDateTime", startTime) - endTime = datetime.datetime.combine(tradedOn, - datetime.time(15, 35)) - request.set("endDateTime", endTime) - else: - if options.startDateTime and options.endDateTime: - request.set("startDateTime", options.startDateTime) - request.set("endDateTime", options.endDateTime) - - if options.conditionCodes: - request.set("includeConditionCodes", True) - - print("Sending Request:", request) - session.sendRequest(request, identity) - - -def eventLoop(session): - done = False - while not done: - # nextEvent() method below is called with a timeout to let - # the program catch Ctrl-C between arrivals of new events - event = session.nextEvent(500) - if event.eventType() == blpapi.Event.PARTIAL_RESPONSE: - print("Processing Partial Response") - processResponseEvent(event) - elif event.eventType() == blpapi.Event.RESPONSE: - print("Processing Response") - processResponseEvent(event) - done = True - else: - for msg in event: - if event.eventType() == blpapi.Event.SESSION_STATUS: - if msg.messageType() == SESSION_TERMINATED: - done = True - - -def getPreviousTradingDate(): - tradedOn = datetime.date.today() - - while True: - try: - tradedOn -= datetime.timedelta(days=1) - except OverflowError: - return None - - if tradedOn.weekday() not in [5, 6]: - return tradedOn - - -def main(): - options = parseCmdLine() - - # Fill SessionOptions - sessionOptions = blpapi.SessionOptions() - sessionOptions.setServerHost(options.host) - sessionOptions.setServerPort(options.port) - sessionOptions.setSessionIdentityOptions(options.auth['option']) - - print("Connecting to %s:%s" % (options.host, options.port)) - # Create a Session - session = blpapi.Session(sessionOptions) - - # Start a Session - if not session.start(): - print("Failed to start session.") - return - - try: - # Open service to get historical data from - if not session.openService("//blp/refdata"): - print("Failed to open //blp/refdata") - return - - sendIntradayTickRequest(session, options) - - # wait for events from session. - eventLoop(session) - - finally: - # Stop the session - session.stop() - -if __name__ == "__main__": - print("IntradayTickExample") - try: - main() - except KeyboardInterrupt: - print("Ctrl+C pressed. Stopping...") - -__copyright__ = """ -Copyright 2012. Bloomberg Finance L.P. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: The above -copyright notice and this permission notice shall be included in all copies -or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/examples/LocalMktdataSubscriptionExample.py b/examples/LocalMktdataSubscriptionExample.py deleted file mode 100644 index f081b77..0000000 --- a/examples/LocalMktdataSubscriptionExample.py +++ /dev/null @@ -1,380 +0,0 @@ -# LocalMktdataSubscriptionExample.py -from __future__ import print_function -from __future__ import absolute_import - -from optparse import OptionParser, OptionValueError - -import os -import platform as plat -import sys -if sys.version_info >= (3, 8) and plat.system().lower() == "windows": - # pylint: disable=no-member - with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): - import blpapi -else: - import blpapi - -SUBSCRIPTION_FAILURE = blpapi.Name("SubscriptionFailure") -SUBSCRIPTION_TERMINATED = blpapi.Name("SubscriptionTerminated") -SESSION_STARTUP_FAILURE = blpapi.Name("SessionStartupFailure") -SESSION_TERMINATED = blpapi.Name("SessionTerminated") -SERVICE_OPEN_FAILURE = blpapi.Name("ServiceOpenFailure") - -def authOptionCallback(_option, _opt, value, parser): - """Parse authorization options from user input""" - - vals = value.split('=', 1) - - if value == "user": - authUser = blpapi.AuthUser.createWithLogonName() - authOptions = blpapi.AuthOptions.createWithUser(authUser) - elif value == "none": - authOptions = None - elif vals[0] == "app" and len(vals) == 2: - appName = vals[1] - authOptions = blpapi.AuthOptions.createWithApp(appName) - elif vals[0] == "userapp" and len(vals) == 2: - appName = vals[1] - authUser = blpapi.AuthUser.createWithLogonName() - authOptions = blpapi.AuthOptions\ - .createWithUserAndApp(authUser, appName) - elif vals[0] == "dir" and len(vals) == 2: - activeDirectoryProperty = vals[1] - authUser = blpapi.AuthUser\ - .createWithActiveDirectoryProperty(activeDirectoryProperty) - authOptions = blpapi.AuthOptions.createWithUser(authUser) - elif vals[0] == "manual": - parts = [] - if len(vals) == 2: - parts = vals[1].split(',') - - if len(parts) != 3: - raise OptionValueError("Invalid auth option {}".format(value)) - - appName, ip, userId = parts - - authUser = blpapi.AuthUser.createWithManualOptions(userId, ip) - authOptions = blpapi.AuthOptions.createWithUserAndApp(authUser, appName) - else: - raise OptionValueError("Invalid auth option '{}'".format(value)) - - parser.values.auth = {'option' : authOptions} - -def parseCmdLine(): - """Parse command line arguments""" - - parser = OptionParser(description="Retrieve realtime data.") - parser.add_option("-a", - "--ip", - dest="hosts", - help="server name or IP (default: localhost)", - metavar="ipAddress", - action="append", - default=[]) - parser.add_option("-p", - dest="port", - type="int", - help="server port (default: %default)", - metavar="tcpPort", - default=8194) - parser.add_option("-s", - dest="service", - help="service name (default: %default)", - metavar="service", - default="//viper/mktdata") - parser.add_option("-t", - dest="topics", - help="topic name (default: /ticker/IBM Equity)", - metavar="topic", - action="append", - default=[]) - parser.add_option("-f", - dest="fields", - help="field to subscribe to (default: empty)", - metavar="field", - action="append", - default=[]) - parser.add_option("-o", - dest="options", - help="subscription options (default: empty)", - metavar="option", - action="append", - default=[]) - parser.add_option("--me", - dest="maxEvents", - type="int", - help="stop after this many events (default: %default)", - metavar="maxEvents", - default=1000000) - parser.add_option("--auth", - dest="auth", - help="authentication option: " - "user|none|app=|userapp=|dir=" - "|manual=" - " (default: none)\n" - "'none' is applicable to Desktop API product " - "that requires Bloomberg Professional service " - "to be installed locally.", - metavar="option", - action="callback", - callback=authOptionCallback, - type="string", - default={"option" : None}) - - # TLS Options - parser.add_option("--tls-client-credentials", - dest="tls_client_credentials", - help="name a PKCS#12 file to use as a source of " - "client credentials", - metavar="option", - type="string") - parser.add_option("--tls-client-credentials-password", - dest="tls_client_credentials_password", - help="specify password for accessing client credentials", - metavar="option", - type="string", - default="") - parser.add_option("--tls-trust-material", - dest="tls_trust_material", - help="name a PKCS#7 file to use as a source of " - "trusted certificates", - metavar="option", - type="string") - parser.add_option("--read-certificate-files", - dest="read_certificate_files", - help="(optional) read the TLS files and pass the blobs", - metavar="option", - action="store_true") - - # ZFP Options - parser.add_option("--zfp-over-leased-line", - dest="zfpPort", - help="enable ZFP connections over leased lines on the " - "specified port (8194 or 8196)" - " (When this option is enabled, '-ip' and '-p'" - " arguments will be ignored.)", - metavar="port", - type="int") - - options,_ = parser.parse_args() - - if not options.hosts: - options.hosts = ["localhost"] - - if not options.topics: - options.topics = ["/ticker/IBM Equity"] - - options.tlsOptions = getTlsOptions(options) - - options.remote = None - if options.zfpPort: - if not options.tlsOptions: - raise RuntimeError("ZFP connections require TLS parameters") - - if options.zfpPort == 8194: - options.remote = blpapi.ZfpUtil.REMOTE_8194 - elif options.zfpPort == 8196: - options.remote = blpapi.ZfpUtil.REMOTE_8196 - else: - raise RuntimeError("Invalid ZFP port: {}".format(options.zfpPort)) - - return options - -def getTlsOptions(options): - """Parse TlsOptions from user input""" - - if (options.tls_client_credentials is None or - options.tls_trust_material is None): - return None - - print("TlsOptions enabled") - if options.read_certificate_files: - credential_blob = None - trust_blob = None - with open(options.tls_client_credentials, 'rb') as credentialfile: - credential_blob = credentialfile.read() - with open(options.tls_trust_material, 'rb') as trustfile: - trust_blob = trustfile.read() - return blpapi.TlsOptions.createFromBlobs( - credential_blob, - options.tls_client_credentials_password, - trust_blob) - - return blpapi.TlsOptions.createFromFiles( - options.tls_client_credentials, - options.tls_client_credentials_password, - options.tls_trust_material) - -def prepareStandardSessionOptions(options): - """Prepares SessionOptions for connections other than ZFP Leased Line connections.""" - - sessionOptions = blpapi.SessionOptions() - for idx, host in enumerate(options.hosts): - sessionOptions.setServerAddress(host, options.port, idx) - - print("Connecting to port {} on {}".format(options.port, ", ".join(options.hosts) )) - - if options.tlsOptions: - sessionOptions.setTlsOptions(options.tlsOptions) - - return sessionOptions - -def prepareZfpSessionOptions(options): - """Prepares SessionOptions for ZFP Leased Line connections.""" - - print("Creating a ZFP connection for leased lines.") - sessionOptions = blpapi.ZfpUtil.getZfpOptionsForLeasedLines( - options.remote, - options.tlsOptions) - return sessionOptions - -def checkFailures(session): - """Checks failure events published by the session.""" - - # Note that the loop uses 'session.tryNextEvent' as all events have - # been produced before calling this function, but there could be no events - # at all in the queue if the OS fails to allocate resources. - while True: - event = session.tryNextEvent() - if event is None: - return - - eventType = event.eventType() - for msg in event: - print(msg) - if processGenericMessage(eventType, msg): - return - -def processSubscriptionEvents(session, maxEvents): - eventCount = 0 - while True: - # Specify timeout to give a chance for Ctrl-C - event = session.nextEvent(1000) - eventType = event.eventType() - for msg in event: - print(msg) - messageType = msg.messageType() - if eventType == blpapi.Event.SUBSCRIPTION_STATUS: - if messageType == SUBSCRIPTION_FAILURE \ - or messageType == SUBSCRIPTION_TERMINATED: - print("Subscription failed") - printContactSupportMessage(msg) - elif eventType == blpapi.Event.SUBSCRIPTION_DATA: - if msg.recapType() == blpapi.Message.RECAPTYPE_SOLICITED: - if msg.getRequestId() is not None: - # An init paint tick can have an associated - # RequestId that is used to identify the - # source of the data and can be used when - # contacting support - print("Received init paint with RequestId {}".format(msg.getRequestId())) - else: - - # SESSION_STATUS events can happen at any time and - # should be handled as the session can be terminated, - # e.g. session identity can be revoked at a later - # time, which terminates the session. - if processGenericMessage(eventType, msg): - return - - if event.eventType() == blpapi.Event.SUBSCRIPTION_DATA: - eventCount += 1 - if eventCount >= maxEvents: - break - -def processGenericMessage(eventType, message): - """Prints error information if the 'message' is a failure message.""" - - messageType = message.messageType() - - # When using a session identity, i.e. - # 'SessionOptions.setSessionIdentityOptions(AuthOptions)', token - # generation failure, authorization failure or revocation terminates the - # session, in which case, applications only need to check session status - # messages. Applications don't need to handle token or authorization messages - if eventType == blpapi.Event.SESSION_STATUS: - if messageType == SESSION_TERMINATED or \ - messageType == SESSION_STARTUP_FAILURE: - print("Session failed to start or terminated") - printContactSupportMessage(message) - # Session failed to start/terminated - return True - elif eventType == blpapi.Event.SERVICE_STATUS: - if messageType == SERVICE_OPEN_FAILURE: - serviceName = message.getElementAsString("serviceName") - print("Failed to open {}".format(serviceName)) - printContactSupportMessage(message) - - # Session OK - return False - -def printContactSupportMessage(msg): - """Prints contact support message.""" - - # Messages can have associated RequestIds which - # identify operations (related to them) through the network. - requestId = msg.getRequestId() - if requestId is not None: - print("When contacting support, please provide RequestId {}".format(requestId)) - -def main(): - """Main function""" - - options = parseCmdLine() - - # Fill SessionOptions - sessionOptions = prepareZfpSessionOptions(options) \ - if options.remote \ - else prepareStandardSessionOptions(options) - sessionOptions.setSessionIdentityOptions(options.auth['option']) - - session = blpapi.Session(sessionOptions) - try: - if not session.start(): - checkFailures(session) - print("Failed to start session.") - return - - if not session.openService(options.service): - checkFailures(session) - return - - subscriptions = blpapi.SubscriptionList() - for t in options.topics: - topic = options.service + t - subscriptions.add(topic, - options.fields, - options.options, - blpapi.CorrelationId(topic)) - session.subscribe(subscriptions) - - processSubscriptionEvents(session, options.maxEvents) - finally: - session.stop() - -if __name__ == "__main__": - print("LocalMktdataSubscriptionExample") - try: - main() - except KeyboardInterrupt: - print("Ctrl+C pressed. Stopping...") - -__copyright__ = """ -Copyright 2012. Bloomberg Finance L.P. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: The above -copyright notice and this permission notice shall be included in all copies -or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/examples/LocalPageSubscriptionExample.py b/examples/LocalPageSubscriptionExample.py deleted file mode 100644 index 71eb05c..0000000 --- a/examples/LocalPageSubscriptionExample.py +++ /dev/null @@ -1,186 +0,0 @@ -# LocalPageSubscriptionExample.py -from __future__ import print_function -from __future__ import absolute_import - -from optparse import OptionParser, OptionValueError - -import os -import platform as plat -import sys -if sys.version_info >= (3, 8) and plat.system().lower() == "windows": - # pylint: disable=no-member - with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): - import blpapi -else: - import blpapi - - -def authOptionCallback(_option, _opt, value, parser): - vals = value.split('=', 1) - - if value == "user": - authUser = blpapi.AuthUser.createWithLogonName() - authOptions = blpapi.AuthOptions.createWithUser(authUser) - elif value == "none": - authOptions = None - elif vals[0] == "app" and len(vals) == 2: - appName = vals[1] - authOptions = blpapi.AuthOptions.createWithApp(appName) - elif vals[0] == "userapp" and len(vals) == 2: - appName = vals[1] - authUser = blpapi.AuthUser.createWithLogonName() - authOptions = blpapi.AuthOptions\ - .createWithUserAndApp(authUser, appName) - elif vals[0] == "dir" and len(vals) == 2: - activeDirectoryProperty = vals[1] - authUser = blpapi.AuthUser\ - .createWithActiveDirectoryProperty(activeDirectoryProperty) - authOptions = blpapi.AuthOptions.createWithUser(authUser) - elif vals[0] == "manual": - parts = [] - if len(vals) == 2: - parts = vals[1].split(',') - - if len(parts) != 3: - raise OptionValueError("Invalid auth option {}".format(value)) - - appName, ip, userId = parts - - authUser = blpapi.AuthUser.createWithManualOptions(userId, ip) - authOptions = blpapi.AuthOptions.createWithUserAndApp(authUser, appName) - else: - raise OptionValueError("Invalid auth option '{}'".format(value)) - - parser.values.auth = {'option' : authOptions} - -def parseCmdLine(): - parser = OptionParser(description="Page monitor.") - parser.add_option("-a", - "--ip", - dest="hosts", - help="server name or IP (default: localhost)", - metavar="ipAddress", - action="append", - default=[]) - parser.add_option("-p", - dest="port", - type="int", - help="server port (default: %default)", - metavar="tcpPort", - default=8194) - parser.add_option("-s", - dest="service", - help="service name (default: %default)", - metavar="service", - default="//viper/page") - parser.add_option("--me", - dest="maxEvents", - type="int", - help="number of events to retrieve (default: %default)", - metavar="maxEvents", - default=1000000) - parser.add_option("--auth", - dest="auth", - help="authentication option: " - "user|none|app=|userapp=|dir=" - " (default: user)\n" - "'none' is applicable to Desktop API product " - "that requires Bloomberg Professional service " - "to be installed locally.", - metavar="option", - action="callback", - callback=authOptionCallback, - type="string", - default={"option" : - blpapi.AuthOptions.createWithUser( - blpapi.AuthUser.createWithLogonName())}) - - (options, _) = parser.parse_args() - - if not options.hosts: - options.hosts = ["localhost"] - - return options - -def main(): - options = parseCmdLine() - - # Fill SessionOptions - sessionOptions = blpapi.SessionOptions() - for idx, host in enumerate(options.hosts): - sessionOptions.setServerAddress(host, options.port, idx) - sessionOptions.setSessionIdentityOptions(options.auth['option']) - sessionOptions.setAutoRestartOnDisconnection(True) - - # NOTE: If running without a backup server, make many attempts to - # connect/reconnect to give that host a chance to come back up (the - # larger the number, the longer it will take for SessionStartupFailure - # to come on startup, or SessionTerminated due to inability to fail - # over). We don't have to do that in a redundant configuration - it's - # expected at least one server is up and reachable at any given time, - # so only try to connect to each server once. - sessionOptions.setNumStartAttempts(1 if len(options.hosts) > 1 else 1000) - - print("Connecting to port %d on %s" % ( - options.port, ", ".join(options.hosts))) - - session = blpapi.Session(sessionOptions) - - if not session.start(): - print("Failed to start session.") - return - - topic = options.service + "/1245/4/5" - topic2 = options.service + "/330/1/1" - subscriptions = blpapi.SubscriptionList() - subscriptions.add(topic, correlationId=blpapi.CorrelationId(topic)) - subscriptions.add(topic2, correlationId=blpapi.CorrelationId(topic2)) - - session.subscribe(subscriptions) - - try: - eventCount = 0 - while True: - # Specify timeout to give a chance for Ctrl-C - event = session.nextEvent(1000) - for msg in event: - if event.eventType() == blpapi.Event.SUBSCRIPTION_STATUS or \ - event.eventType() == blpapi.Event.SUBSCRIPTION_DATA: - print("%s - %s" % (msg.correlationIds()[0].value(), msg)) - else: - print(msg) - if event.eventType() == blpapi.Event.SUBSCRIPTION_DATA: - eventCount += 1 - if eventCount >= options.maxEvents: - break - finally: - session.stop() - - -if __name__ == "__main__": - print("LocalPageSubscriptionExample") - try: - main() - except KeyboardInterrupt: - print("Ctrl+C pressed. Stopping...") - -__copyright__ = """ -Copyright 2012. Bloomberg Finance L.P. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: The above -copyright notice and this permission notice shall be included in all copies -or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/examples/MktdataBroadcastPublisherExample.py b/examples/MktdataBroadcastPublisherExample.py deleted file mode 100644 index c40e904..0000000 --- a/examples/MktdataBroadcastPublisherExample.py +++ /dev/null @@ -1,271 +0,0 @@ -# MktdataBroadcastPublisherExample.py -from __future__ import print_function -from __future__ import absolute_import - -import time -from optparse import OptionParser, OptionValueError -from threading import Event -import os -import platform as plat -import sys -if sys.version_info >= (3, 8) and plat.system().lower() == "windows": - # pylint: disable=no-member - with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): - import blpapi -else: - import blpapi - -SESSION_TERMINATED = blpapi.Name("SessionTerminated") - - -class MyStream(object): - def __init__(self, sid=""): - self.id = sid - - -class MyEventHandler(object): - def __init__(self, stop): - self.stop = stop - - def processEvent(self, event, _session): - for msg in event: - print(msg) - if event.eventType() == blpapi.Event.SESSION_STATUS: - if msg.messageType() == SESSION_TERMINATED: - self.stop.set() - continue - - -def authOptionCallback(_option, _opt, value, parser): - """Parse authorization options from user input""" - - vals = value.split('=', 1) - - if value == "user": - authUser = blpapi.AuthUser.createWithLogonName() - authOptions = blpapi.AuthOptions.createWithUser(authUser) - elif value == "none": - authOptions = None - elif vals[0] == "app" and len(vals) == 2: - appName = vals[1] - authOptions = blpapi.AuthOptions.createWithApp(appName) - elif vals[0] == "userapp" and len(vals) == 2: - appName = vals[1] - authUser = blpapi.AuthUser.createWithLogonName() - authOptions = blpapi.AuthOptions\ - .createWithUserAndApp(authUser, appName) - elif vals[0] == "dir" and len(vals) == 2: - activeDirectoryProperty = vals[1] - authUser = blpapi.AuthUser\ - .createWithActiveDirectoryProperty(activeDirectoryProperty) - authOptions = blpapi.AuthOptions.createWithUser(authUser) - elif vals[0] == "manual": - parts = [] - if len(vals) == 2: - parts = vals[1].split(',') - - if len(parts) != 3: - raise OptionValueError("Invalid auth option {}".format(value)) - - appName, ip, userId = parts - - authUser = blpapi.AuthUser.createWithManualOptions(userId, ip) - authOptions = blpapi.AuthOptions.createWithUserAndApp(authUser, appName) - else: - raise OptionValueError("Invalid auth option '{}'".format(value)) - - parser.values.auth = {'option' : authOptions} - -def parseCmdLine(): - parser = OptionParser(description="Publish market data.") - parser.add_option("-a", - "--ip", - dest="hosts", - help="server name or IP (default: localhost)", - metavar="ipAddress", - action="append", - default=[]) - parser.add_option("-p", - dest="port", - type="int", - help="server port (default: %default)", - metavar="tcpPort", - default=8194) - parser.add_option("-s", - dest="service", - help="service name (default: %default)", - metavar="service", - default="//viper/mktdata") - parser.add_option("-f", - dest="fields", - help="fields (default: LAST_PRICE)", - metavar="field", - action="append", - default=[]) - parser.add_option("-m", - dest="messageType", - help="type of published event (default: %default)", - metavar="messageType", - default="MarketDataEvents") - parser.add_option("-t", - dest="topic", - help="topic (default: %default)", - metavar="topic", - default="IBM Equity") - parser.add_option("-g", - dest="groupId", - help="publisher groupId (defaults to unique value)") - parser.add_option("--auth", - dest="auth", - help="authentication option: " - "user|none|app=|userapp=|dir=" - "|manual=" - " (default: user)\n" - "'none' is applicable to Desktop API product " - "that requires Bloomberg Professional service " - "to be installed locally.", - metavar="option", - action="callback", - callback=authOptionCallback, - type="string", - default={"option" : - blpapi.AuthOptions.createWithUser( - blpapi.AuthUser.createWithLogonName())}) - - (options, _) = parser.parse_args() - - if not options.hosts: - options.hosts = ["localhost"] - - if not options.fields: - options.fields = ["BID", "ASK"] - - return options - - -def main(): - options = parseCmdLine() - - # Fill SessionOptions - sessionOptions = blpapi.SessionOptions() - for idx, host in enumerate(options.hosts): - sessionOptions.setServerAddress(host, options.port, idx) - sessionOptions.setSessionIdentityOptions(options.auth['option']) - sessionOptions.setAutoRestartOnDisconnection(True) - - # NOTE: If running without a backup server, make many attempts to - # connect/reconnect to give that host a chance to come back up (the - # larger the number, the longer it will take for SessionStartupFailure - # to come on startup, or SessionTerminated due to inability to fail - # over). We don't have to do that in a redundant configuration - it's - # expected at least one server is up and reachable at any given time, - # so only try to connect to each server once. - sessionOptions.setNumStartAttempts(1 if len(options.hosts) > 1 else 1000) - - stop = Event() - myEventHandler = MyEventHandler(stop) - - # Create a Session - session = blpapi.ProviderSession(sessionOptions, - myEventHandler.processEvent) - - # Start a Session - if not session.start(): - print("Failed to start session.") - return - - if options.groupId is not None: - # NOTE: will perform explicit service registration here, instead - # of letting createTopics do it, as the latter approach doesn't - # allow for custom ServiceRegistrationOptions. - serviceOptions = blpapi.ServiceRegistrationOptions() - serviceOptions.setGroupId(options.groupId) - if not session.registerService(options.service, - session.getAuthorizedIdentity(), - serviceOptions): - print("Failed to register %s" % options.service) - session.stop() - return - - topicList = blpapi.TopicList() - topicList.add(options.service + "/ticker/" + options.topic, - blpapi.CorrelationId(MyStream(options.topic))) - - # Create topics - session.createTopics(topicList, - blpapi.ProviderSession.AUTO_REGISTER_SERVICES) - # createTopics() is synchronous, topicList will be updated - # with the results of topic creation (resolution will happen - # under the covers) - - streams = [] - for i in range(topicList.size()): - stream = topicList.correlationIdAt(i).value() - status = topicList.statusAt(i) - topicString = topicList.topicStringAt(i) - - if (status == blpapi.TopicList.CREATED): - print("Start publishing on topic: %s" % topicString) - stream.topic = session.getTopic(topicList.messageAt(i)) - streams.append(stream) - else: - print("Stream '%s': topic not created, status = %d" % ( - stream.id, status)) - - service = session.getService(options.service) - PUBLISH_MESSAGE_TYPE = blpapi.Name(options.messageType) - - try: - # Now we will start publishing - tickCount = 1 - while streams and not stop.is_set(): - event = service.createPublishEvent() - eventFormatter = blpapi.EventFormatter(event) - - for stream in streams: - topic = stream.topic - if not topic.isActive(): - print("[WARN] Publishing on an inactive topic.") - eventFormatter.appendMessage(PUBLISH_MESSAGE_TYPE, topic) - - for i, f in enumerate(options.fields): - eventFormatter.setElement(f, tickCount + i + 1.0) - - tickCount += 1 - - for msg in event: - print(msg) - - session.publish(event) - time.sleep(10) - finally: - # Stop the session - session.stop() - -if __name__ == "__main__": - print("MktdataBroadcastPublisherExample") - try: - main() - except KeyboardInterrupt: - print("Ctrl+C pressed. Stopping...") - -__copyright__ = """ -Copyright 2012. Bloomberg Finance L.P. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: The above -copyright notice and this permission notice shall be included in all copies -or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/examples/MktdataPublisher.py b/examples/MktdataPublisher.py deleted file mode 100644 index 0a044ef..0000000 --- a/examples/MktdataPublisher.py +++ /dev/null @@ -1,584 +0,0 @@ -# MktdataPublisher.py -from __future__ import print_function -from __future__ import absolute_import - -import time -from optparse import OptionParser, OptionValueError -import datetime -import threading - -import os -import platform as plat -import sys -if sys.version_info >= (3, 8) and plat.system().lower() == "windows": - # pylint: disable=no-member - with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): - import blpapi -else: - import blpapi - -PERMISSION_REQUEST = blpapi.Name("PermissionRequest") -RESOLUTION_SUCCESS = blpapi.Name("ResolutionSuccess") -SESSION_TERMINATED = blpapi.Name("SessionTerminated") -TOPICS = blpapi.Name("topics") -TOPIC_CREATED = blpapi.Name("TopicCreated") -TOPIC_SUBSCRIBED = blpapi.Name("TopicSubscribed") -TOPIC_UNSUBSCRIBED = blpapi.Name("TopicUnsubscribed") -TOPIC_RECAP = blpapi.Name("TopicRecap") - - -class MyStream(object): - def __init__(self, sid="", fields=None): - self.id = sid - self.fields = fields if fields else [] - self.lastValue = 0 - self.topic = blpapi.Topic() - self.isSubscribed = False - - def fillData(self, eventFormatter, elementDef): - for i, f in enumerate(self.fields): - if not elementDef.typeDefinition().hasElementDefinition(f): - print("Invalid field '%s'" % f) - continue - - fieldDef = elementDef.typeDefinition().getElementDefinition(f) - fieldType = fieldDef.typeDefinition().datatype() - value = None - - if fieldType == blpapi.DataType.BOOL: - value = bool((self.lastValue + i) % 2 == 0) - elif fieldType == blpapi.DataType.CHAR: - value = chr((self.lastValue + i) % 100 + 32) - elif fieldType == blpapi.DataType.INT32 or \ - fieldType == blpapi.DataType.INT64: - value = self.lastValue + i - elif fieldType == blpapi.DataType.FLOAT32 or \ - fieldType == blpapi.DataType.FLOAT64: - value = (self.lastValue + i) * 1.1 - elif fieldType == blpapi.DataType.STRING: - value = "S%d" % (self.lastValue + i) - elif fieldType == blpapi.DataType.DATE or \ - fieldType == blpapi.DataType.TIME or \ - fieldType == blpapi.DataType.DATETIME: - value = datetime.datetime.today() - value.replace(day=(self.lastValue / 100) % 28 + 1) - value.replace(microsecond=i * 1000) - - eventFormatter.setElement(f, value) - - def fillDataNull(self, eventFormatter, elementDef): - for f in self.fields: - if not elementDef.typeDefinition().hasElementDefinition(f): - print("Invalid field '%s'" % f) - continue - - fieldDef = elementDef.typeDefinition().getElementDefinition(f) - if fieldDef.typeDefinition().isSimpleType(): - # Publishing NULL value - eventFormatter.setElementNull(f) - - def next(self): - self.lastValue += 1 - - def isAvailable(self): - return self.topic.isValid() and self.isSubscribed - - -class MyEventHandler(object): - def __init__(self, - serviceName, - messageType, - fields, - eids, - resolveSubServiceCode, - mutex, - stop, - condition): - self.serviceName = serviceName - self.messageType = messageType - self.fields = fields - self.eids = eids - self.resolveSubServiceCode = resolveSubServiceCode - self.mutex = mutex - self.stop = stop - self.condition = condition - self.streams = dict() - self.availableTopicCount = 0 - - def processEvent(self, event, session): - if event.eventType() == blpapi.Event.SESSION_STATUS: - for msg in event: - print(msg) - if msg.messageType() == SESSION_TERMINATED: - self.stop.set() - - elif event.eventType() == blpapi.Event.TOPIC_STATUS: - topicList = blpapi.TopicList() - - for msg in event: - print(msg) - if msg.messageType() == TOPIC_SUBSCRIBED: - topicStr = msg.getElementAsString("topic") - with self.mutex: - if topicStr not in self.streams: - # TopicList knows how to add an entry based on a - # TOPIC_SUBSCRIBED message. - topicList.add(msg) - self.streams[topicStr] = MyStream(topicStr, - self.fields) - stream = self.streams[topicStr] - stream.isSubscribed = True - if stream.isAvailable(): - self.availableTopicCount += 1 - self.condition.notifyAll() - - elif msg.messageType() == TOPIC_UNSUBSCRIBED: - topicStr = msg.getElementAsString("topic") - with self.mutex: - if topicStr not in self.streams: - # We should never be coming here. - # TOPIC_UNSUBSCRIBED can not come before - # a TOPIC_SUBSCRIBED or TOPIC_CREATED - continue - stream = self.streams[topicStr] - if stream.isAvailable(): - self.availableTopicCount -= 1 - self.condition.notifyAll() - stream.isSubscribed = False - - elif msg.messageType() == TOPIC_CREATED: - topicStr = msg.getElementAsString("topic") - with self.mutex: - if topicStr not in self.streams: - self.streams[topicStr] = MyStream(topicStr, - self.fields) - stream = self.streams[topicStr] - try: - stream.topic = session.getTopic(msg) - except blpapi.Exception as e: - print("Exception while processing " \ - "TOPIC_CREATED: %s" % e) - continue - - if stream.isAvailable(): - self.availableTopicCount += 1 - self.condition.notifyAll() - - elif msg.messageType() == TOPIC_RECAP: - # Here we send a recap in response to a Recap request. - try: - topicStr = msg.getElementAsString("topic") - recapEvent = None - - with self.mutex: - if topicStr not in self.streams: - continue - stream = self.streams[topicStr] - if not stream.isAvailable(): - continue - - topic = session.getTopic(msg) - service = topic.service() - recapCid = msg.correlationIds()[0] - - recapEvent = service.createPublishEvent() - elementDef = \ - service.getEventDefinition(self.messageType) - - eventFormatter = blpapi.EventFormatter(recapEvent) - eventFormatter.appendRecapMessage(topic, recapCid) - - stream.fillData(eventFormatter, elementDef) - - session.publish(recapEvent) - - except blpapi.Exception as e: - print("Exception while processing TOPIC_RECAP: %s" % e) - continue - - if topicList.size() > 0: - # createTopicsAsync will result in RESOLUTION_STATUS, - # TOPIC_CREATED events. - session.createTopicsAsync(topicList) - - elif event.eventType() == blpapi.Event.RESOLUTION_STATUS: - for msg in event: - print(msg) - - elif event.eventType() == blpapi.Event.REQUEST: - service = session.getService(self.serviceName) - for msg in event: - print(msg) - - if msg.messageType() == PERMISSION_REQUEST: - # Similar to createPublishEvent. We assume just one - # service - self.serviceName. A responseEvent can only be - # for single request so we can specify the correlationId - - # which establishes context - when we create the Event. - - response = \ - service.createResponseEvent(msg.correlationIds()[0]) - permission = 1 # ALLOWED: 0, DENIED: 1 - ef = blpapi.EventFormatter(response) - if msg.hasElement("uuid"): - msg.getElementAsInteger("uuid") - permission = 0 - if msg.hasElement("applicationId"): - msg.getElementAsInteger("applicationId") - permission = 0 - - # In appendResponse the string is the name of the - # operation, the correlationId indicates which request we - # are responding to. - ef.appendResponse("PermissionResponse") - ef.pushElement("topicPermissions") - - # For each of the topics in the request, add an entry to - # the response. - topicsElement = msg.getElement(TOPICS).values() - for topic in topicsElement: - ef.appendElement() - ef.setElement("topic", topic) - if self.resolveSubServiceCode: - try: - ef.setElement("subServiceCode", - self.resolveSubServiceCode) - print(("Mapping topic %s to subServiceCode %s" % - (topic, self.resolveSubServiceCode))) - except blpapi.Exception: - print("subServiceCode could not be set." - " Resolving without subServiceCode") - ef.setElement("result", permission) - if permission == 1: # DENIED - ef.pushElement("reason") - ef.setElement("source", "My Publisher Name") - ef.setElement("category", "NOT_AUTHORIZED") - ef.setElement("subcategory", - "Publisher Controlled") - ef.setElement( - "description", - "Permission denied by My Publisher Name") - ef.popElement() - elif self.eids: - ef.pushElement("permissions") - ef.appendElement() - ef.setElement("permissionService", "//blp/blpperm") - ef.pushElement("eids") - for e in self.eids: - ef.appendValue(e) - ef.popElement() - ef.popElement() - ef.popElement() - ef.popElement() - ef.popElement() - - # Service is implicit in the Event. sendResponse has a - # second parameter - partialResponse - that defaults to - # false. - session.sendResponse(response) - - else: - for msg in event: - print(msg) - - return True - - -def authOptionCallback(_option, _opt, value, parser): - """Parse authorization options from user input""" - - vals = value.split('=', 1) - - if value == "user": - authUser = blpapi.AuthUser.createWithLogonName() - authOptions = blpapi.AuthOptions.createWithUser(authUser) - elif value == "none": - authOptions = None - elif vals[0] == "app" and len(vals) == 2: - appName = vals[1] - authOptions = blpapi.AuthOptions.createWithApp(appName) - elif vals[0] == "userapp" and len(vals) == 2: - appName = vals[1] - authUser = blpapi.AuthUser.createWithLogonName() - authOptions = blpapi.AuthOptions\ - .createWithUserAndApp(authUser, appName) - elif vals[0] == "dir" and len(vals) == 2: - activeDirectoryProperty = vals[1] - authUser = blpapi.AuthUser\ - .createWithActiveDirectoryProperty(activeDirectoryProperty) - authOptions = blpapi.AuthOptions.createWithUser(authUser) - elif vals[0] == "manual": - parts = [] - if len(vals) == 2: - parts = vals[1].split(',') - - if len(parts) != 3: - raise OptionValueError("Invalid auth option {}".format(value)) - - appName, ip, userId = parts - - authUser = blpapi.AuthUser.createWithManualOptions(userId, ip) - authOptions = blpapi.AuthOptions.createWithUserAndApp(authUser, appName) - else: - raise OptionValueError("Invalid auth option '{}'".format(value)) - - parser.values.auth = {'option' : authOptions} - -def parseCmdLine(): - parser = OptionParser(description="Publish market data.") - parser.add_option("-a", - "--ip", - dest="hosts", - help="server name or IP (default: localhost)", - metavar="ipAddress", - action="append", - default=[]) - parser.add_option("-p", - dest="port", - type="int", - help="server port (default: %default)", - metavar="tcpPort", - default=8194) - parser.add_option("-s", - dest="service", - help="service name (default: %default)", - metavar="service", - default="//viper/mktdata") - parser.add_option("-f", - dest="fields", - help="field to subscribe to (default: LAST_PRICE)", - metavar="field", - action="append", - default=[]) - parser.add_option("-m", - dest="messageType", - help="type of published event (default: %default)", - metavar="messageType", - default="MarketDataEvents") - parser.add_option("-e", - dest="eids", - help="permission eid for all subscriptions", - metavar="EID", - action="append", - default=[]) - parser.add_option("-g", - dest="groupId", - help="publisher groupId (defaults to unique value)", - metavar="groupId") - parser.add_option("-r", - "--pri", - type="int", - dest="priority", - help="set publisher priority level (default: %default)", - metavar="priority", - default=10) - parser.add_option("-c", - type="int", - dest="clearInterval", - help="number of events after which cache will be " - "cleared (default: 0 i.e cache never cleared)", - metavar="clearInterval", - default=0) - parser.add_option("--auth", - dest="auth", - help="authentication option: " - "user|none|app=|userapp=|dir=" - "|manual=" - " (default: user)\n" - "'none' is applicable to Desktop API product " - "that requires Bloomberg Professional service " - "to be installed locally.", - metavar="option", - action="callback", - callback=authOptionCallback, - type="string", - default={"option" : - blpapi.AuthOptions.createWithUser( - blpapi.AuthUser.createWithLogonName())}) - parser.add_option("--ssc", - dest="ssc", - help="active sub-service code option: " - ",,", - metavar="ssc", - default="") - parser.add_option("--rssc", - dest="rssc", - help="sub-service code to be used in resolves", - metavar="rssc", - default="") - - (options, _) = parser.parse_args() - - if not options.hosts: - options.hosts = ["localhost"] - - if not options.fields: - options.fields = ["LAST_PRICE"] - - return options - - -def activate(options, session): - if options.ssc: - sscBegin, sscEnd, sscPriority = map(int, options.ssc.split(",")) - print(("Activating sub service code range [%s, %s] @ %s" % - (sscBegin, sscEnd, sscPriority))) - session.activateSubServiceCodeRange(options.service, - sscBegin, - sscEnd, - sscPriority) - - -def deactivate(options, session): - if options.ssc: - sscBegin, sscEnd, sscPriority = map(int, options.ssc.split(",")) - print(("DeActivating sub service code range [%s, %s] @ %s" % - (sscBegin, sscEnd, sscPriority))) - session.deactivateSubServiceCodeRange(options.service, - sscBegin, - sscEnd) - - -def main(): - options = parseCmdLine() - - # Fill SessionOptions - sessionOptions = blpapi.SessionOptions() - for idx, host in enumerate(options.hosts): - sessionOptions.setServerAddress(host, options.port, idx) - sessionOptions.setSessionIdentityOptions(options.auth['option']) - sessionOptions.setAutoRestartOnDisconnection(True) - - # NOTE: If running without a backup server, make many attempts to - # connect/reconnect to give that host a chance to come back up (the - # larger the number, the longer it will take for SessionStartupFailure - # to come on startup, or SessionTerminated due to inability to fail - # over). We don't have to do that in a redundant configuration - it's - # expected at least one server is up and reachable at any given time, - # so only try to connect to each server once. - sessionOptions.setNumStartAttempts(1 if len(options.hosts) > 1 else 1000) - - print("Connecting to port %d on %s" % ( - options.port, " ".join(options.hosts))) - - PUBLISH_MESSAGE_TYPE = blpapi.Name(options.messageType) - mutex = threading.Lock() - stop = threading.Event() - condition = threading.Condition(mutex) - - myEventHandler = MyEventHandler(options.service, - PUBLISH_MESSAGE_TYPE, - options.fields, - options.eids, - options.rssc, - mutex, - stop, - condition) - - # Create a Session - session = blpapi.ProviderSession(sessionOptions, - myEventHandler.processEvent) - - # Start a Session - if not session.start(): - print("Failed to start session.") - return - - serviceOptions = blpapi.ServiceRegistrationOptions() - if options.groupId is not None: - serviceOptions.setGroupId(options.groupId) - serviceOptions.setServicePriority(options.priority) - - if options.ssc: - sscBegin, sscEnd, sscPriority = map(int, options.ssc.split(",")) - print(("Adding active sub service code range [%s, %s] @ %s" % - (sscBegin, sscEnd, sscPriority))) - try: - serviceOptions.addActiveSubServiceCodeRange(sscBegin, - sscEnd, - sscPriority) - except blpapi.Exception as e: - print(("FAILED to add active sub service codes." - " Exception %s" % e.description())) - - try: - if not session.registerService(options.service, - session.getAuthorizedIdentity(), - serviceOptions): - print("Failed to register '%s'" % options.service) - return - - service = session.getService(options.service) - elementDef = service.getEventDefinition(PUBLISH_MESSAGE_TYPE) - eventCount = 0 - numPublished = 0 - while not stop.is_set(): - event = service.createPublishEvent() - - with condition: - while myEventHandler.availableTopicCount == 0: - # Set timeout to 1 - give a chance for CTRL-C - condition.wait(1) - if stop.is_set(): - return - - publishNull = False - if (options.clearInterval > 0 and - eventCount == options.clearInterval): - eventCount = 0 - publishNull = True - eventFormatter = blpapi.EventFormatter(event) - for _,stream in myEventHandler.streams.items(): - if not stream.isAvailable(): - continue - eventFormatter.appendMessage(PUBLISH_MESSAGE_TYPE, - stream.topic) - if publishNull: - stream.fillDataNull(eventFormatter, elementDef) - else: - eventCount += 1 - stream.next() - stream.fillData(eventFormatter, elementDef) - - for msg in event: - print(msg) - - session.publish(event) - time.sleep(1) - numPublished += 1 - if numPublished % 10 == 0: - deactivate(options, session) - time.sleep(30) - activate(options, session) - - finally: - # Stop the session - session.stop() - -if __name__ == "__main__": - print("MktdataPublisher") - try: - main() - except KeyboardInterrupt: - print("Ctrl+C pressed. Stopping...") - -__copyright__ = """ -Copyright 2012. Bloomberg Finance L.P. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: The above -copyright notice and this permission notice shall be included in all copies -or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/examples/PagePublisherExample.py b/examples/PagePublisherExample.py deleted file mode 100644 index ccb0b43..0000000 --- a/examples/PagePublisherExample.py +++ /dev/null @@ -1,423 +0,0 @@ -# PagePublisherExample.py -from __future__ import print_function -from __future__ import absolute_import - -import time -from optparse import OptionParser, OptionValueError -import threading - -import os -import platform as plat -import sys -if sys.version_info >= (3, 8) and plat.system().lower() == "windows": - # pylint: disable=no-member - with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): - import blpapi -else: - import blpapi - -RESOLUTION_SUCCESS = blpapi.Name("ResolutionSuccess") -PERMISSION_REQUEST = blpapi.Name("PermissionRequest") -SESSION_TERMINATED = blpapi.Name("SessionTerminated") -TOPICS = blpapi.Name("topics") -TOPIC_CREATED = blpapi.Name("TopicCreated") -TOPIC_RECAP = blpapi.Name("TopicRecap") -TOPIC_SUBSCRIBED = blpapi.Name("TopicSubscribed") -TOPIC_UNSUBSCRIBED = blpapi.Name("TopicUnsubscribed") - - - - -class MyStream(object): - def __init__(self, sid=""): - self.id = sid - self.isInitialPaintSent = False - self.topic = blpapi.Topic() - self.isSubscribed = False - - def isAvailable(self): - return self.topic.isValid() and self.isSubscribed - - -class MyEventHandler(object): - def __init__(self, serviceName, mutex, stop, condition): - self.serviceName = serviceName - self.mutex = mutex - self.stop = stop - self.condition = condition - self.streams = dict() - self.availableTopicCount = 0 - - def processEvent(self, event, session): - - if event.eventType() == blpapi.Event.SESSION_STATUS: - for msg in event: - print(msg) - if msg.messageType() == SESSION_TERMINATED: - self.stop.set() - - elif event.eventType() == blpapi.Event.TOPIC_STATUS: - topicList = blpapi.TopicList() - - for msg in event: - print(msg) - if msg.messageType() == TOPIC_SUBSCRIBED: - topicStr = msg.getElementAsString("topic") - with self.mutex: - if topicStr not in self.streams: - # TopicList knows how to add an entry based on a - # TOPIC_SUBSCRIBED message. - topicList.add(msg) - self.streams[topicStr] = MyStream(topicStr) - stream = self.streams[topicStr] - stream.isSubscribed = True - if stream.isAvailable(): - self.availableTopicCount += 1 - self.condition.notifyAll() - - elif msg.messageType() == TOPIC_UNSUBSCRIBED: - topicStr = msg.getElementAsString("topic") - with self.mutex: - if topicStr not in self.streams: - # We should never be coming here. - # TOPIC_UNSUBSCRIBED can not come before - # a TOPIC_SUBSCRIBED or TOPIC_CREATED - continue - stream = self.streams[topicStr] - if stream.isAvailable(): - self.availableTopicCount -= 1 - self.condition.notifyAll() - stream.isSubscribed = False - - elif msg.messageType() == TOPIC_CREATED: - topicStr = msg.getElementAsString("topic") - with self.mutex: - if topicStr not in self.streams: - self.streams[topicStr] = MyStream(topicStr) - stream = self.streams[topicStr] - try: - stream.topic = session.getTopic(msg) - except blpapi.Exception as e: - print("Exception while processing " \ - "TOPIC_CREATED: %s" % e) - continue - - if stream.isAvailable(): - self.availableTopicCount += 1 - self.condition.notifyAll() - - elif msg.messageType() == TOPIC_RECAP: - # Here we send a recap in response to a Recap request. - try: - topicStr = msg.getElementAsString("topic") - recapEvent = None - - with self.mutex: - if topicStr not in self.streams: - continue - stream = self.streams[topicStr] - if not stream.isAvailable(): - continue - - topic = session.getTopic(msg) - service = topic.service() - recapCid = msg.correlationIds()[0] - - recapEvent = service.createPublishEvent() - evFormatter = blpapi.EventFormatter(recapEvent) - evFormatter.appendRecapMessage(topic, recapCid) - evFormatter.setElement("numRows", 25) - evFormatter.setElement("numCols", 80) - evFormatter.pushElement("rowUpdate") - - for i in range(1, 6): - evFormatter.appendElement() - evFormatter.setElement("rowNum", i) - evFormatter.pushElement("spanUpdate") - evFormatter.appendElement() - evFormatter.setElement("startCol", 1) - evFormatter.setElement("length", 10) - evFormatter.setElement("text", "RECAP") - evFormatter.popElement() - evFormatter.popElement() - evFormatter.popElement() - - evFormatter.popElement() - - session.publish(recapEvent) - - except blpapi.Exception as e: - print("Exception while processing TOPIC_RECAP: %s" % e) - continue - - if topicList.size() > 0: - # createTopicsAsync will result in RESOLUTION_STATUS, - # TOPIC_CREATED events. - session.createTopicsAsync(topicList) - - elif event.eventType() == blpapi.Event.RESOLUTION_STATUS: - for msg in event: - print(msg) - - elif event.eventType() == blpapi.Event.REQUEST: - service = session.getService(self.serviceName) - for msg in event: - print(msg) - - if msg.messageType() == PERMISSION_REQUEST: - # This example always sends a 'PERMISSIONED' response. - # See 'MktdataPublisherExample' on how to parse a - # Permission request and send an appropriate - # 'PermissionResponse'. - - response = \ - service.createResponseEvent(msg.correlationIds()[0]) - permission = 0 # ALLOWED: 0, DENIED: 1 - ef = blpapi.EventFormatter(response) - ef.appendResponse("PermissionResponse") - ef.pushElement("topicPermissions") - - # For each of the topics in the request, add an entry to - # the response. - topicsElement = msg.getElement(TOPICS).values() - for topic in topicsElement: - ef.appendElement() - ef.setElement("topic", topic) - ef.setElement("result", permission) - ef.popElement() - ef.popElement() - - session.sendResponse(response) - - else: - for msg in event: - print(msg) - return True - - -def authOptionCallback(_option, _opt, value, parser): - """Parse authorization options from user input""" - - vals = value.split('=', 1) - - if value == "user": - authUser = blpapi.AuthUser.createWithLogonName() - authOptions = blpapi.AuthOptions.createWithUser(authUser) - elif value == "none": - authOptions = None - elif vals[0] == "app" and len(vals) == 2: - appName = vals[1] - authOptions = blpapi.AuthOptions.createWithApp(appName) - elif vals[0] == "userapp" and len(vals) == 2: - appName = vals[1] - authUser = blpapi.AuthUser.createWithLogonName() - authOptions = blpapi.AuthOptions\ - .createWithUserAndApp(authUser, appName) - elif vals[0] == "dir" and len(vals) == 2: - activeDirectoryProperty = vals[1] - authUser = blpapi.AuthUser\ - .createWithActiveDirectoryProperty(activeDirectoryProperty) - authOptions = blpapi.AuthOptions.createWithUser(authUser) - elif vals[0] == "manual": - parts = [] - if len(vals) == 2: - parts = vals[1].split(',') - - if len(parts) != 3: - raise OptionValueError("Invalid auth option {}".format(value)) - - appName, ip, userId = parts - - authUser = blpapi.AuthUser.createWithManualOptions(userId, ip) - authOptions = blpapi.AuthOptions.createWithUserAndApp(authUser, appName) - else: - raise OptionValueError("Invalid auth option '{}'".format(value)) - - parser.values.auth = {'option' : authOptions} - -def parseCmdLine(): - parser = OptionParser(description="Publish on a topic.") - parser.add_option("-a", - "--ip", - dest="hosts", - help="server name or IP (default: localhost)", - metavar="ipAddress", - action="append", - default=[]) - parser.add_option("-p", - dest="port", - type="int", - help="server port (default: %default)", - metavar="tcpPort", - default=8194) - parser.add_option("-s", - dest="service", - help="service name (default: %default)", - metavar="service", - default="//viper/page") - parser.add_option("-g", - dest="groupId", - help="publisher groupId (defaults to unique value)", - metavar="groupId") - parser.add_option("-r", - "--pri", - type="int", - dest="priority", - help="set publisher priority level (default: %default)", - metavar="priority", - default=10) - parser.add_option("--auth", - dest="auth", - help="authentication option: " - "user|none|app=|userapp=|dir=" - "|manual=" - " (default: user)\n" - "'none' is applicable to Desktop API product " - "that requires Bloomberg Professional service " - "to be installed locally.", - metavar="option", - action="callback", - callback=authOptionCallback, - type="string", - default={"option" : - blpapi.AuthOptions.createWithUser( - blpapi.AuthUser.createWithLogonName())}) - - (options, _) = parser.parse_args() - - if not options.hosts: - options.hosts = ["localhost"] - - return options - - -def main(): - options = parseCmdLine() - - # Fill SessionOptions - sessionOptions = blpapi.SessionOptions() - for idx, host in enumerate(options.hosts): - sessionOptions.setServerAddress(host, options.port, idx) - sessionOptions.setSessionIdentityOptions(options.auth['option']) - sessionOptions.setAutoRestartOnDisconnection(True) - sessionOptions.setNumStartAttempts(len(options.hosts)) - - print("Connecting to port %d on %s" % ( - options.port, " ".join(options.hosts))) - - mutex = threading.Lock() - stop = threading.Event() - condition = threading.Condition(mutex) - myEventHandler = MyEventHandler(options.service, mutex, stop, condition) - - # Create a Session - session = blpapi.ProviderSession(sessionOptions, - myEventHandler.processEvent) - - # Start a Session - if not session.start(): - print("Failed to start session.") - return - - serviceOptions = blpapi.ServiceRegistrationOptions() - if options.groupId is not None: - serviceOptions.setGroupId(options.groupId) - serviceOptions.setServicePriority(options.priority) - - try: - if not session.registerService(options.service, - session.getAuthorizedIdentity(), - serviceOptions): - print("Failed to register '%s'" % options.service) - return - - service = session.getService(options.service) - - # Now we will start publishing - value = 1 - while not stop.is_set(): - event = service.createPublishEvent() - - with condition: - while myEventHandler.availableTopicCount == 0: - # Set timeout to 1 - give a chance for CTRL-C - condition.wait(1) - if stop.is_set(): - return - - eventFormatter = blpapi.EventFormatter(event) - for _, stream in myEventHandler.streams.items(): - if not stream.isAvailable(): - continue - - value += 1 - - if not stream.isInitialPaintSent: - eventFormatter.appendRecapMessage(stream.topic) - eventFormatter.setElement("numRows", 25) - eventFormatter.setElement("numCols", 80) - eventFormatter.pushElement("rowUpdate") - for i in range(1, 6): - eventFormatter.appendElement() - eventFormatter.setElement("rowNum", i) - eventFormatter.pushElement("spanUpdate") - eventFormatter.appendElement() - eventFormatter.setElement("startCol", 1) - eventFormatter.setElement("length", 10) - eventFormatter.setElement("text", "INITIAL") - eventFormatter.setElement("fgColor", "RED") - eventFormatter.popElement() - eventFormatter.popElement() - eventFormatter.popElement() - eventFormatter.popElement() - stream.isInitialPaintSent = True - - eventFormatter.appendMessage("RowUpdate", stream.topic) - eventFormatter.setElement("rowNum", 1) - eventFormatter.pushElement("spanUpdate") - eventFormatter.appendElement() - START_COL = blpapi.Name("startCol") - eventFormatter.setElement(START_COL, 1) - strValue = str(value) - eventFormatter.setElement("length", len(strValue)) - eventFormatter.setElement("text", strValue) - eventFormatter.popElement() - eventFormatter.popElement() - - for msg in event: - print(msg) - - session.publish(event) - time.sleep(10) - - finally: - # Stop the session - session.stop() - -if __name__ == "__main__": - print("PagePublisherExample") - try: - main() - except KeyboardInterrupt: - print("Ctrl+C pressed. Stopping...") - -__copyright__ = """ -Copyright 2012. Bloomberg Finance L.P. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: The above -copyright notice and this permission notice shall be included in all copies -or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/examples/RefDataTableOverrideExample.py b/examples/RefDataTableOverrideExample.py deleted file mode 100644 index c9471ca..0000000 --- a/examples/RefDataTableOverrideExample.py +++ /dev/null @@ -1,188 +0,0 @@ -# RefDataTableOverrideExample.py -from __future__ import print_function -from __future__ import absolute_import - -from optparse import OptionParser - -import os -import platform as plat -import sys -if sys.version_info >= (3, 8) and plat.system().lower() == "windows": - # pylint: disable=no-member - with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): - import blpapi -else: - import blpapi - -SECURITY_DATA = blpapi.Name("securityData") -SECURITY = blpapi.Name("security") -FIELD_DATA = blpapi.Name("fieldData") -FIELD_EXCEPTIONS = blpapi.Name("fieldExceptions") -FIELD_ID = blpapi.Name("fieldId") -ERROR_INFO = blpapi.Name("errorInfo") - - -def parseCmdLine(): - parser = OptionParser(description="Retrieve reference data.") - parser.add_option("-a", - "--ip", - dest="host", - help="server name or IP (default: %default)", - metavar="ipAddress", - default="localhost") - parser.add_option("-p", - dest="port", - type="int", - help="server port (default: %default)", - metavar="tcpPort", - default=8194) - - poptions,_ = parser.parse_args() - - return poptions - - -def processMessage(msg): - securityDataArray = msg.getElement(SECURITY_DATA) - for securityData in securityDataArray.values(): - print(securityData.getElementAsString(SECURITY)) - fieldData = securityData.getElement(FIELD_DATA) - for field in fieldData.elements(): - if not field.isValid(): - print(field.name(), "is NULL.") - elif field.isArray(): - # The following illustrates how to iterate over complex - # data returns. - for i, row in enumerate(field.values()): - print("Row %d: %s" % (i, row)) - else: - print("%s = %s" % (field.name(), field.getValueAsString())) - - fieldExceptionArray = securityData.getElement(FIELD_EXCEPTIONS) - for fieldException in fieldExceptionArray.values(): - errorInfo = fieldException.getElement(ERROR_INFO) - print("%s: %s" % (errorInfo.getElementAsString("category"), - fieldException.getElementAsString(FIELD_ID))) - - -def main(): - options = parseCmdLine() - - # Fill SessionOptions - sessionOptions = blpapi.SessionOptions() - sessionOptions.setServerHost(options.host) - sessionOptions.setServerPort(options.port) - - print("Connecting to %s:%d" % (options.host, options.port)) - - # Create a Session - session = blpapi.Session(sessionOptions) - - # Start a Session - if not session.start(): - print("Failed to start session.") - return - - if not session.openService("//blp/refdata"): - print("Failed to open //blp/refdata") - return - - refDataService = session.getService("//blp/refdata") - request = refDataService.createRequest("ReferenceDataRequest") - - # Add securities to request. - request.append("securities", "CWHL 2006-20 1A1 Mtge") - # ... - - # Add fields to request. Cash flow is a table (data set) field. - - request.append("fields", "MTG_CASH_FLOW") - request.append("fields", "SETTLE_DT") - - # Add scalar overrides to request. - - overrides = request.getElement("overrides") - override1 = overrides.appendElement() - override1.setElement("fieldId", "ALLOW_DYNAMIC_CASHFLOW_CALCS") - override1.setElement("value", "Y") - override2 = overrides.appendElement() - override2.setElement("fieldId", "LOSS_SEVERITY") - override2.setElement("value", 31) - - # Add table overrides to request. - - tableOverrides = request.getElement("tableOverrides") - tableOverride = tableOverrides.appendElement() - tableOverride.setElement("fieldId", "DEFAULT_VECTOR") - rows = tableOverride.getElement("row") - - # Layout of input table is specified by the definition of - # 'DEFAULT_VECTOR'. Attributes are specified in the first rows. - # Subsequent rows include rate, duration, and transition. - - row = rows.appendElement() - cols = row.getElement("value") - cols.appendValue("Anchor") # Anchor type - cols.appendValue("PROJ") # PROJ = Projected - row = rows.appendElement() - cols = row.getElement("value") - cols.appendValue("Type") # Type of default - cols.appendValue("CDR") # CDR = Conditional Default Rate - - rateVectors = [ - [1.0, 12, "S"], # S = Step - [2.0, 12, "R"] # R = Ramp - ] - - for rateVector in rateVectors: - row = rows.appendElement() - cols = row.getElement("value") - for value in rateVector: - cols.appendValue(value) - - print("Sending Request:", request) - cid = session.sendRequest(request) - - try: - # Process received events - while(True): - # We provide timeout to give the chance to Ctrl+C handling: - ev = session.nextEvent(500) - for msg in ev: - if cid in msg.correlationIds(): - # Process the response generically. - processMessage(msg) - # Response completly received, so we could exit - if ev.eventType() == blpapi.Event.RESPONSE: - break - finally: - # Stop the session - session.stop() - -if __name__ == "__main__": - print("RefDataTableOverrideExample") - try: - main() - except KeyboardInterrupt: - print("Ctrl+C pressed. Stopping...") - -__copyright__ = """ -Copyright 2012. Bloomberg Finance L.P. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: The above -copyright notice and this permission notice shall be included in all copies -or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/examples/RequestServiceExample.py b/examples/RequestServiceExample.py deleted file mode 100644 index ef288eb..0000000 --- a/examples/RequestServiceExample.py +++ /dev/null @@ -1,341 +0,0 @@ -# RequestServiceExample.py -from __future__ import print_function -from __future__ import absolute_import - -import time -from optparse import OptionParser, OptionValueError - -import os -import platform as plat -import sys -if sys.version_info >= (3, 8) and plat.system().lower() == "windows": - # pylint: disable=no-member - with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): - import blpapi -else: - import blpapi - -RESOLUTION_SUCCESS = blpapi.Name("ResolutionSuccess") -SESSION_TERMINATED = blpapi.Name("SessionTerminated") - - -class MyProviderEventHandler(object): - def __init__(self, serviceName): - self.serviceName = serviceName - - def processEvent(self, event, session): - - print("Server received an event") - if event.eventType() == blpapi.Event.SESSION_STATUS: - for msg in event: - print(msg) - if msg.messageType() == SESSION_TERMINATED: - pass - - elif event.eventType() == blpapi.Event.RESOLUTION_STATUS: - for msg in event: - print(msg) - - elif event.eventType() == blpapi.Event.REQUEST: - service = session.getService(self.serviceName) - for msg in event: - print(msg) - - if msg.messageType() == blpapi.Name("ReferenceDataRequest"): - # Similar to createPublishEvent. We assume just one - # service - self.serviceName. A responseEvent can only be - # for single request so we can specify the correlationId - - # which establishes context - when we create the Event. - - if msg.hasElement("timestamp"): - requestTime = msg.getElementAsFloat("timestamp") - latency = time.time() - requestTime - print("Response latency =", latency) - - response = \ - service.createResponseEvent(msg.correlationIds()[0]) - ef = blpapi.EventFormatter(response) - - # In appendResponse the string is the name of the - # operation, the correlationId indicates which request we - # are responding to. - ef.appendResponse("ReferenceDataRequest") - securities = msg.getElement("securities") - fields = msg.getElement("fields") - ef.setElement("timestamp", time.time()) - ef.pushElement("securityData") - for security in securities.values(): - ef.appendElement() - ef.setElement("security", security) - ef.pushElement("fieldData") - - for field in fields.values(): - ef.appendElement() - ef.setElement("fieldId", field) - ef.pushElement("data") - ef.setElement("doubleValue", time.time()) - ef.popElement() - ef.popElement() - - ef.popElement() - ef.popElement() - - # Service is implicit in the Event. sendResponse has a - # second parameter - partialResponse - that defaults to - # false. - session.sendResponse(response) - - else: - for msg in event: - print(msg) - return True - - -class MyRequesterEventHandler(object): - def processEvent(self, event, _session): - print("Client received an event") - for msg in event: - print(msg) - - -def authOptionCallback(_option, _opt, value, parser): - """Parse authorization options from user input""" - - vals = value.split('=', 1) - - if value == "user": - authUser = blpapi.AuthUser.createWithLogonName() - authOptions = blpapi.AuthOptions.createWithUser(authUser) - elif value == "none": - authOptions = None - elif vals[0] == "app" and len(vals) == 2: - appName = vals[1] - authOptions = blpapi.AuthOptions.createWithApp(appName) - elif vals[0] == "userapp" and len(vals) == 2: - appName = vals[1] - authUser = blpapi.AuthUser.createWithLogonName() - authOptions = blpapi.AuthOptions\ - .createWithUserAndApp(authUser, appName) - elif vals[0] == "dir" and len(vals) == 2: - activeDirectoryProperty = vals[1] - authUser = blpapi.AuthUser\ - .createWithActiveDirectoryProperty(activeDirectoryProperty) - authOptions = blpapi.AuthOptions.createWithUser(authUser) - elif vals[0] == "manual": - parts = [] - if len(vals) == 2: - parts = vals[1].split(',') - - if len(parts) != 3: - raise OptionValueError("Invalid auth option {}".format(value)) - - appName, ip, userId = parts - - authUser = blpapi.AuthUser.createWithManualOptions(userId, ip) - authOptions = blpapi.AuthOptions.createWithUserAndApp(authUser, appName) - else: - raise OptionValueError("Invalid auth option '{}'".format(value)) - - parser.values.auth = {'option' : authOptions} - -def parseCmdLine(): - parser = OptionParser() - parser.add_option("-a", - "--ip", - dest="hosts", - help="server name or IP (default: localhost)", - metavar="ipAddress", - action="append", - default=[]) - parser.add_option("-p", - dest="port", - type="int", - help="server port (default: %default)", - metavar="tcpPort", - default=8194) - parser.add_option("--service", - dest="service", - help="service name (default: %default)", - metavar="service", - default="//example/refdata") - parser.add_option("-s", - dest="securities", - help="request security (default: IBM US Equity)", - metavar="security", - action="append", - default=[]) - parser.add_option("-f", - dest="fields", - help="request field (default: PX_LAST)", - metavar="field", - action="append", - default=[]) - parser.add_option("-r", - dest="role", - type="choice", - choices=["server", "client", "both"], - help="service role option: server|client|both " + - "(default: %default)", - metavar="option", - default="both") - parser.add_option("--auth", - dest="auth", - help="authentication option: " - "user|none|app=|userapp=|dir=" - "|manual=" - " (default: user)\n" - "'none' is applicable to Desktop API product " - "that requires Bloomberg Professional service " - "to be installed locally.", - metavar="option", - action="callback", - callback=authOptionCallback, - type="string", - default={"option" : - blpapi.AuthOptions.createWithUser( - blpapi.AuthUser.createWithLogonName())}) - - (options, _) = parser.parse_args() - - if not options.hosts: - options.hosts = ["localhost"] - - if not options.securities: - options.securities = ["IBM US Equity"] - - if not options.fields: - options.fields = ["PX_LAST"] - - return options - - -def serverRun(session, options): - print("Server is starting------") - - if not session.start(): - print("Failed to start server session.") - return - - if not session.registerService(options.service): - print("Failed to register", options.service) - return - - -def clientRun(session, options): - print("Client is starting------") - - if not session.start(): - print("Failed to start client session.") - return - - if not session.openService(options.service): - print("Failed to open", options.service) - return - - service = session.getService(options.service) - request = service.createRequest("ReferenceDataRequest") - - # append securities to request - # Add securities to request - securities = request.getElement("securities") - for security in options.securities: - securities.appendValue(security) - - # Add fields to request - fields = request.getElement("fields") - for field in options.fields: - fields.appendValue(field) - - request.set("timestamp", time.time()) - - print("Sending Request:", request) - - eventQueue = blpapi.EventQueue() - session.sendRequest( - request, None, blpapi.CorrelationId("AddRequest"), eventQueue) - - while True: - # Specify timeout to give a chance for Ctrl-C - event = eventQueue.nextEvent(500) - - if event.eventType() == blpapi.Event.TIMEOUT: - continue - - print("Client received an event") - for msg in event: - if event.eventType() == blpapi.Event.RESPONSE: - if msg.hasElement("timestamp"): - responseTime = msg.getElementAsFloat("timestamp") - print("Response latency =", time.time() - responseTime) - print(msg) - - if event.eventType() == blpapi.Event.RESPONSE: - break - - -def main(): - options = parseCmdLine() - - # Fill SessionOptions - sessionOptions = blpapi.SessionOptions() - for idx, host in enumerate(options.hosts): - sessionOptions.setServerAddress(host, options.port, idx) - sessionOptions.setSessionIdentityOptions(options.auth['option']) - sessionOptions.setAutoRestartOnDisconnection(True) - sessionOptions.setNumStartAttempts(len(options.hosts)) - - print("Connecting to port %d on %s" % ( - options.port, ", ".join(options.hosts))) - - providerEventHandler = MyProviderEventHandler(options.service) - providerSession = blpapi.ProviderSession(sessionOptions, - providerEventHandler.processEvent) - - requesterEventHandler = MyRequesterEventHandler() - requesterSession = blpapi.Session(sessionOptions, - requesterEventHandler.processEvent) - - if options.role in ["server", "both"]: - serverRun(providerSession, options) - - if options.role in ["client", "both"]: - clientRun(requesterSession, options) - - # wait for enter key to exit application - print("Press ENTER to quit") - input() - - if options.role in ["server", "both"]: - providerSession.stop() - - if options.role in ["client", "both"]: - requesterSession.stop() - - -if __name__ == "__main__": - print("RequestServiceExample") - try: - main() - except KeyboardInterrupt: - print("Ctrl+C pressed. Stopping...") - -__copyright__ = """ -Copyright 2012. Bloomberg Finance L.P. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: The above -copyright notice and this permission notice shall be included in all copies -or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/examples/ServiceSchema.py b/examples/ServiceSchema.py deleted file mode 100644 index 686b1bb..0000000 --- a/examples/ServiceSchema.py +++ /dev/null @@ -1,288 +0,0 @@ -# ServiceSchema.py -from __future__ import print_function -from __future__ import absolute_import - -from optparse import OptionParser, OptionValueError - -import os -import platform as plat -import sys -if sys.version_info >= (3, 8) and plat.system().lower() == "windows": - # pylint: disable=no-member - with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): - import blpapi -else: - import blpapi - -REFERENCE_DATA_RESPONSE = blpapi.Name("ReferenceDataResponse") - -ELEMENT_DATATYPE_NAMES = { - blpapi.DataType.BOOL: "BOOL", - blpapi.DataType.CHAR: "CHAR", - blpapi.DataType.BYTE: "BYTE", - blpapi.DataType.INT32: "INT32", - blpapi.DataType.INT64: "INT64", - blpapi.DataType.FLOAT32: "FLOAT32", - blpapi.DataType.FLOAT64: "FLOAT64", - blpapi.DataType.STRING: "STRING", - blpapi.DataType.BYTEARRAY: "BYTEARRAY", - blpapi.DataType.DATE: "DATE", - blpapi.DataType.TIME: "TIME", - blpapi.DataType.DECIMAL: "DECIMAL", - blpapi.DataType.DATETIME: "DATETIME", - blpapi.DataType.ENUMERATION: "ENUMERATION", - blpapi.DataType.SEQUENCE: "SEQUENCE", - blpapi.DataType.CHOICE: "CHOICE", - blpapi.DataType.CORRELATION_ID: "CORRELATION_ID" -} - - -SCHEMA_STATUS_NAMES = { - blpapi.SchemaStatus.ACTIVE: "ACTIVE", - blpapi.SchemaStatus.DEPRECATED: "DEPRECATED", - blpapi.SchemaStatus.INACTIVE: "INACTIVE", - blpapi.SchemaStatus.PENDING_DEPRECATION: "PENDING" -} - - -def authOptionCallback(_option, _opt, value, parser): - """Parse authorization options from user input""" - - vals = value.split('=', 1) - - if value == "user": - authUser = blpapi.AuthUser.createWithLogonName() - authOptions = blpapi.AuthOptions.createWithUser(authUser) - elif value == "none": - authOptions = None - elif vals[0] == "app" and len(vals) == 2: - appName = vals[1] - authOptions = blpapi.AuthOptions.createWithApp(appName) - elif vals[0] == "userapp" and len(vals) == 2: - appName = vals[1] - authUser = blpapi.AuthUser.createWithLogonName() - authOptions = blpapi.AuthOptions\ - .createWithUserAndApp(authUser, appName) - elif vals[0] == "dir" and len(vals) == 2: - activeDirectoryProperty = vals[1] - authUser = blpapi.AuthUser\ - .createWithActiveDirectoryProperty(activeDirectoryProperty) - authOptions = blpapi.AuthOptions.createWithUser(authUser) - elif vals[0] == "manual": - parts = [] - if len(vals) == 2: - parts = vals[1].split(',') - - if len(parts) != 3: - raise OptionValueError("Invalid auth option {}".format(value)) - - appName, ip, userId = parts - - authUser = blpapi.AuthUser.createWithManualOptions(userId, ip) - authOptions = blpapi.AuthOptions.createWithUserAndApp(authUser, appName) - else: - raise OptionValueError("Invalid auth option '{}'".format(value)) - - parser.values.auth = {'option' : authOptions} - -def parseCmdLine(): - parser = OptionParser() - parser.add_option("-a", - "--host", - dest="host", - help="HOST address to connect to", - metavar="HOST", - default="localhost") - parser.add_option("-p", - "--port", - dest="port", - type="int", - help="PORT to connect to (%default)", - metavar="PORT", - default=8194) - parser.add_option("-s", - "--service", - default="//blp/apiflds", - help="SERVICE to print the schema of " - "('//blp/apiflds' by default)") - parser.add_option("--auth", - dest="auth", - help="authentication option: " - "user|none|app=|userapp=|dir=" - "|manual=" - " (default: user)\n" - "'none' is applicable to Desktop API product " - "that requires Bloomberg Professional service " - "to be installed locally.", - metavar="option", - action="callback", - callback=authOptionCallback, - type="string", - default={"option" : - blpapi.AuthOptions.createWithUser( - blpapi.AuthUser.createWithLogonName())}) - (options, _) = parser.parse_args() - return options - - -def printMessage(msg): - print("[{0}]: {1}".format(", ".join(map(str, msg.correlationIds())), msg)) - - -def getIndent(level): - return "" if level == 0 else " ".ljust(level * 2) - - -# Print enumeration (constant list) -def printEnumeration(cl, level): - indent = getIndent(level + 1) - print(indent + " {0} {1} {2} \"{3}\" possible values:".format( - cl.name(), - SCHEMA_STATUS_NAMES[cl.status()], - ELEMENT_DATATYPE_NAMES[cl.datatype()], - cl.description())) - - # Enumerate and print all constant list's values (constants) - for i in cl: - print(indent + " {0} {1} {2} \"{3}\" = {4!s}".format( - i.name(), - SCHEMA_STATUS_NAMES[i.status()], - ELEMENT_DATATYPE_NAMES[i.datatype()], - i.description(), - i.getValue())) - - -# Recursively print element definition -def printElementDefinition(ed, level=0): - indent = getIndent(level) - - maxValues = ed.maxValues() - if maxValues == blpapi.SchemaElementDefinition.UNBOUNDED: - valuesRange = "[{0}, INF)".format(ed.minValues()) - else: - valuesRange = "[{0}, {1}]".format(ed.minValues(), maxValues) - - # Get and print alternate element names - alternateNames = ed.alternateNames() - if alternateNames: - alternateNames = "[{0}]".format(",".join(map(str, alternateNames))) - else: - alternateNames = "" - - print(indent + "* {0} {1} {2} {3} \"{4}\"".format( - ed.name(), - SCHEMA_STATUS_NAMES[ed.status()], - valuesRange, - alternateNames, - ed.description())) - - # Get and print related type definition - td = ed.typeDefinition() - - print(indent + " {0} {1} {2} {3}{4}{5}\"{6}\"".format( - td.name(), - SCHEMA_STATUS_NAMES[td.status()], - ELEMENT_DATATYPE_NAMES[td.datatype()], - "complex " if td.isComplexType() else "", - "simple " if td.isSimpleType() else "", - "enum " if td.isEnumerationType() else "", - td.description())) - - # Get and print all possible values for enumeration type - enumeration = td.enumeration() - if not enumeration is None: - printEnumeration(enumeration, level) - - if td.numElementDefinitions(): - print(indent + " Elements[{0}]:".format( - td.numElementDefinitions())) - # Enumerate and print all sub-element definitions - for i in td.elementDefinitions(): - printElementDefinition(i, level + 1) - - -def printOperation(operation, _service): - print("{0} \"{1}\" Request:".format( - operation.name(), - operation.description())) - - # Print operation's request definition - printElementDefinition(operation.requestDefinition(), 1) - print("Responses[{0}]:".format(operation.numResponseDefinitions())) - - # Enumerate and print all operation's response definitions - for r in operation.responseDefinitions(): - printElementDefinition(r, 1) - print() - - -def main(): - options = parseCmdLine() - - # Fill SessionOptions - sessionOptions = blpapi.SessionOptions() - sessionOptions.setServerHost(options.host) - sessionOptions.setServerPort(options.port) - sessionOptions.setSessionIdentityOptions(options.auth['option']) - - # Create a Session - session = blpapi.Session(sessionOptions) - - # Start a Session - if not session.start(): - raise Exception("Can't start session.") - - try: - print("Session started.") - - # Open service to get reference data from - if not session.openService(options.service): - raise Exception("Can't open '{0}' service.".format( - options.service)) - - # Obtain previously opened service - service = session.getService(options.service) - print("Service {0}:".format(options.service)) - - print("Service event definitions[{0}]:".format( - service.numEventDefinitions())) - # Enumerate and print all service's event definitions - for ed in service.eventDefinitions(): - printElementDefinition(ed) - print() - - print("Operations[{0}]:".format(service.numOperations())) - # Enumerate and print all service's operations - for operation in service.operations(): - printOperation(operation, service) - finally: - # Stop the session - session.stop() - -if __name__ == "__main__": - print("ServiceSchema") - try: - main() - except KeyboardInterrupt: - print("Ctrl+C pressed. Stopping...") - -__copyright__ = """ -Copyright 2012. Bloomberg Finance L.P. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: The above -copyright notice and this permission notice shall be included in all copies -or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/examples/SessionIdentityExample.py b/examples/SessionIdentityExample.py deleted file mode 100644 index be3c7c2..0000000 --- a/examples/SessionIdentityExample.py +++ /dev/null @@ -1,157 +0,0 @@ -""" SessionIdentityExample """ -from __future__ import print_function - -# pylint: disable=deprecated-module -from optparse import OptionParser, OptionValueError - -import os -import platform as plat -import sys -if sys.version_info >= (3, 8) and plat.system().lower() == "windows": - # pylint: disable=no-member - with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): - import blpapi - from blpapi import AuthOptions, AuthUser -else: - import blpapi - from blpapi import AuthOptions, AuthUser - -NONE = "none" -USER = "user" -APP = "app" -USERAPP = "userapp" - -def authOptionCallback(_option, _opt, value, parser): - """Parse authorization options from user input""" - - vals = value.split('=', 1) - - parser.values.authType = vals[0] - if value == NONE: - parser.values.appName = None - elif value == USER: - parser.values.appName = None - elif vals[0] == APP and len(vals) == 2: - parser.values.appName = vals[1] - elif vals[0] == USERAPP and len(vals) == 2: - parser.values.appName = vals[1] - else: - raise OptionValueError("Invalid auth option '%s'" % value) - -def parseCmdLine(): - """Parse command line arguments""" - - parser = OptionParser(description="Example of session identity" - " authorization mechanisms.") - parser.add_option("-a", - "--ip", - dest="host", - help="server name or IP (default: localhost)", - default="localhost") - parser.add_option("-p", - dest="port", - type="int", - help="server port (default: %default)", - default=8194) - parser.add_option("--auth", - dest="authType", - help="authentication option: " - "user|none|app=|userapp=" - " (default: user)\n" - "'none' is applicable to Desktop API product " - "that requires Bloomberg Professional service " - "to be installed locally.", - metavar="option", - action="callback", - callback=authOptionCallback, - type="string", - default=USER) - - options, _ = parser.parse_args() - - return options - - -class SessionIdentityExample: # pylint: disable=too-few-public-methods - """This example shows how to authorize the session identity.""" - - def __init__(self, options): - self.host = options.host - self.port = options.port - self.authOptionsType = options.authType - if hasattr(options, "appName"): - self.appName = options.appName - - def run(self): - """ Start a session using the session identity. """ - - if self.authOptionsType == USER: - authOptions = AuthOptions \ - .createWithUser(AuthUser.createWithLogonName()) - elif self.authOptionsType == APP: - authOptions = AuthOptions.createWithApp(self.appName) - elif self.authOptionsType == USERAPP: - authOptions = AuthOptions \ - .createWithUserAndApp(AuthUser.createWithLogonName(), - self.appName) - else: - authOptions = None - - sessionOptions = blpapi.SessionOptions() - sessionOptions.setServerAddress(self.host, self.port, 0) - sessionOptions.setSessionIdentityOptions(authOptions) - sessionOptions.setAutoRestartOnDisconnection(True) - - session = blpapi.Session(sessionOptions) - if not session.start(): - print("Failed to start session.") - return - - while True: - event = session.tryNextEvent() - if event is None: - break - for msg in event: - print(msg) - - -def main(): - """ Main function. """ - print("SessionIdentityExample") - - options = parseCmdLine() - - example = SessionIdentityExample(options) - - try: - example.run() - except blpapi.Exception as e: - print("Blpapi exception: {}".format(e)) - - -if __name__ == "__main__": - try: - main() - except KeyboardInterrupt: - print("Ctrl+C pressed. Stopping...") - -__copyright__ = """ -Copyright 2020. Bloomberg Finance L.P. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: The above -copyright notice and this permission notice shall be included in all copies -or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/examples/SimpleAsyncSubscription.py b/examples/SimpleAsyncSubscription.py deleted file mode 100644 index 14cd8e6..0000000 --- a/examples/SimpleAsyncSubscription.py +++ /dev/null @@ -1,259 +0,0 @@ -# SimpleAsyncSubscription.py -from __future__ import print_function -from __future__ import absolute_import - -import time -try: - import thread -except ImportError: - import _thread as thread -from optparse import OptionParser, OptionValueError - -import os -import platform as plat -import sys -if sys.version_info >= (3, 8) and plat.system().lower() == "windows": - # pylint: disable=no-member - with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): - import blpapi - from blpapi import Event as EventType -else: - import blpapi - from blpapi import Event as EventType - - -SESSION_STARTED = blpapi.Name("SessionStarted") -SESSION_STARTUP_FAILURE = blpapi.Name("SessionStartupFailure") - -EVENT_TYPE_NAMES = { - EventType.ADMIN: "ADMIN", - EventType.SESSION_STATUS: "SESSION_STATUS", - EventType.SUBSCRIPTION_STATUS: "SUBSCRIPTION_STATUS", - EventType.REQUEST_STATUS: "REQUEST_STATUS", - EventType.RESPONSE: "RESPONSE", - EventType.PARTIAL_RESPONSE: "PARTIAL_RESPONSE", - EventType.SUBSCRIPTION_DATA: "SUBSCRIPTION_DATA", - EventType.SERVICE_STATUS: "SERVICE_STATUS", - EventType.TIMEOUT: "TIMEOUT", - EventType.AUTHORIZATION_STATUS: "AUTHORIZATION_STATUS", - EventType.RESOLUTION_STATUS: "RESOLUTION_STATUS", - EventType.TOPIC_STATUS: "TOPIC_STATUS", - EventType.TOKEN_STATUS: "TOKEN_STATUS", - EventType.REQUEST: "REQUEST" -} - - -class Error(Exception): - pass - - -def topicName(security): - if security.startswith("//"): - return security - else: - return "//blp/mktdata/" + security - - -def printMessage(msg, eventType): - print("#{0} msg received: [{1}] => {2}/{3}".format( - thread.get_ident(), - ", ".join(map(str, msg.correlationIds())), - EVENT_TYPE_NAMES[eventType], - msg)) - -def authOptionCallback(_option, _opt, value, parser): - """Parse authorization options from user input""" - - vals = value.split('=', 1) - - if value == "user": - authUser = blpapi.AuthUser.createWithLogonName() - authOptions = blpapi.AuthOptions.createWithUser(authUser) - elif value == "none": - authOptions = None - elif vals[0] == "app" and len(vals) == 2: - appName = vals[1] - authOptions = blpapi.AuthOptions.createWithApp(appName) - elif vals[0] == "userapp" and len(vals) == 2: - appName = vals[1] - authUser = blpapi.AuthUser.createWithLogonName() - authOptions = blpapi.AuthOptions\ - .createWithUserAndApp(authUser, appName) - elif vals[0] == "dir" and len(vals) == 2: - activeDirectoryProperty = vals[1] - authUser = blpapi.AuthUser\ - .createWithActiveDirectoryProperty(activeDirectoryProperty) - authOptions = blpapi.AuthOptions.createWithUser(authUser) - elif vals[0] == "manual": - parts = [] - if len(vals) == 2: - parts = vals[1].split(',') - - if len(parts) != 3: - raise OptionValueError("Invalid auth option {}".format(value)) - - appName, ip, userId = parts - - authUser = blpapi.AuthUser.createWithManualOptions(userId, ip) - authOptions = blpapi.AuthOptions.createWithUserAndApp(authUser, appName) - else: - raise OptionValueError("Invalid auth option '{}'".format(value)) - - parser.values.auth = {'option' : authOptions} - -def parseCmdLine(): - parser = OptionParser() - parser.add_option("-a", - "--host", - dest="host", - help="HOST address to connect to", - metavar="HOST", - default="localhost") - parser.add_option("-p", - "--port", - dest="port", - type="int", - help="PORT to connect to (%default)", - metavar="PORT", - default=8194) - parser.add_option("-s", - "--security", - dest="securities", - help="security to subscribe to " - "('IBM US Equity' by default)", - metavar="SECURITY", - action="append", - default=[]) - parser.add_option("-f", - "--fields", - dest="fields", - help="comma " - "separated list of FIELDS to subscribe to " - "('LAST_PRICE,BID,ASK' by default)", - metavar="FIELDS", - default="LAST_PRICE,BID,ASK") - parser.add_option("--auth", - dest="auth", - help="authentication option: " - "user|none|app=|userapp=|dir=" - "|manual=" - " (default: user)\n" - "'none' is applicable to Desktop API product " - "that requires Bloomberg Professional service " - "to be installed locally.", - metavar="option", - action="callback", - callback=authOptionCallback, - type="string", - default={"option" : - blpapi.AuthOptions.createWithUser( - blpapi.AuthUser.createWithLogonName())}) - - poptions,_ = parser.parse_args() - - if not poptions.securities: - poptions.securities = ["IBM US Equity"] - return poptions - - -# Subscribe 'session' for the securities and fields specified in 'options' -def subscribe(session, poptions, identity=None): - sl = blpapi.SubscriptionList() - for s in poptions.securities: - topic = topicName(s) - cid = blpapi.CorrelationId(s) - print("Subscribing {0} => {1}".format(cid, topic)) - sl.add(topic, poptions.fields, correlationId=cid) - session.subscribe(sl, identity) - - -# Event handler -class MyEventHandler(object): - def __init__(self, poptions): - self.options = poptions - - def processEvent(self, event, session): - try: - eventType = event.eventType() - for msg in event: - # Print all aincoming messages including the SubscriptionData - printMessage(msg, eventType) - - if eventType == EventType.SESSION_STATUS: - if msg.messageType() == SESSION_STARTED: - # Session.startAsync completed successfully - # Subscribe for the specified securities/fields - subscribe(session, self.options) - elif msg.messageType() == SESSION_STARTUP_FAILURE: - # Session.startAsync failed, raise exception to exit - raise Error("Can't start session") - except Error as ex: - print("Error in event handler:", ex) - # Interrupt a "sleep loop" in main thread - thread.interrupt_main() - - -def main(): - options = parseCmdLine() - - # Fill SessionOptions - sessionOptions = blpapi.SessionOptions() - sessionOptions.setServerHost(options.host) - sessionOptions.setServerPort(options.port) - sessionOptions.setSessionIdentityOptions(options.auth['option']) - - # Create a handler - handler = MyEventHandler(options) - - # Create an EventDispatcher with 2 processing threads - dispatcher = blpapi.EventDispatcher(2) - - # Create a Session - session = blpapi.Session(sessionOptions, handler.processEvent, dispatcher) - - # Start dispatcher to "pump" the received events - dispatcher.start() - - # Start session asynchronously - if not session.startAsync(): - raise Exception("Can't initiate session start.") - - # Sleep until application will be interrupted by user (Ctrl+C pressed) - # or because of the exception in event handler - try: - # Note that: 'thread.interrupt_main()' could be used to - # correctly stop the application from 'processEvent' - while True: - time.sleep(1) - finally: - session.stop() - dispatcher.stop() - - -if __name__ == "__main__": - print("SimpleAsyncSubscription") - try: - main() - except KeyboardInterrupt: - print("Ctrl+C pressed. Stopping...") - -__copyright__ = """ -Copyright 2012. Bloomberg Finance L.P. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: The above -copyright notice and this permission notice shall be included in all copies -or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/examples/SimpleBlockingRequestExample.py b/examples/SimpleBlockingRequestExample.py deleted file mode 100644 index dc146ea..0000000 --- a/examples/SimpleBlockingRequestExample.py +++ /dev/null @@ -1,141 +0,0 @@ -# SimpleBlockingRequestExample.py -from __future__ import print_function -from __future__ import absolute_import - -from optparse import OptionParser - -import os -import platform as plat -import sys -if sys.version_info >= (3, 8) and plat.system().lower() == "windows": - # pylint: disable=no-member - with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): - import blpapi -else: - import blpapi - -LAST_PRICE = blpapi.Name("LAST_PRICE") - - -class MyEventHandler(object): - def processEvent(self, event, _session): - try: - if event.eventType() == blpapi.Event.SUBSCRIPTION_DATA: - for msg in event: - if msg.hasElement(LAST_PRICE): - field = msg.getElement(LAST_PRICE) - print(field.name(), "=", field.getValueAsString()) - return True - except blpapi.Exception as e: - print("Exception:", e) - return False - - -def parseCmdLine(): - parser = OptionParser(description="Retrieve reference data.") - parser.add_option("-a", - "--ip", - dest="host", - help="server name or IP (default: %default)", - metavar="ipAddress", - default="localhost") - parser.add_option("-p", - dest="port", - type="int", - help="server port (default: %default)", - metavar="tcpPort", - default=8194) - - poptions,_ = parser.parse_args() - - return poptions - - -def main(): - options = parseCmdLine() - - # Fill SessionOptions - sessionOptions = blpapi.SessionOptions() - sessionOptions.setServerHost(options.host) - sessionOptions.setServerPort(options.port) - - print("Connecting to %s:%d" % (options.host, options.port)) - - myEventHandler = MyEventHandler() - # Create a Session - session = blpapi.Session(sessionOptions, myEventHandler.processEvent) - - # Start a Session - if not session.start(): - print("Failed to start session.") - return - - if not session.openService("//blp/mktdata"): - print("Failed to open //blp/mktdata") - return - - if not session.openService("//blp/refdata"): - print("Failed to open //blp/refdata") - return - - print("Subscribing to IBM US Equity") - cid = blpapi.CorrelationId(1) - subscriptions = blpapi.SubscriptionList() - subscriptions.add("IBM US Equity", "LAST_PRICE", "", cid) - session.subscribe(subscriptions) - - print("Requesting reference data IBM US Equity") - refDataService = session.getService("//blp/refdata") - request = refDataService.createRequest("ReferenceDataRequest") - request.append("securities", "IBM US Equity") - request.append("fields", "DS002") - - cid2 = blpapi.CorrelationId(2) - eventQueue = blpapi.EventQueue() - session.sendRequest(request, correlationId=cid2, eventQueue=eventQueue) - - try: - # Process received events - while(True): - # We provide timeout to give the chance to Ctrl+C handling: - ev = eventQueue.nextEvent(500) - for msg in ev: - print(msg) - # Response completly received, so we could exit - if ev.eventType() == blpapi.Event.RESPONSE: - break - - # Wait for enter key to exit application - print("Press ENTER to quit") - input() - finally: - # Stop the session - session.stop() - -if __name__ == "__main__": - print("SimpleBlockingRequestExample") - try: - main() - except KeyboardInterrupt: - print("Ctrl+C pressed. Stopping...") - -__copyright__ = """ -Copyright 2012. Bloomberg Finance L.P. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: The above -copyright notice and this permission notice shall be included in all copies -or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/examples/SimpleCategorizedFieldSearchExample.py b/examples/SimpleCategorizedFieldSearchExample.py deleted file mode 100644 index d62cd9a..0000000 --- a/examples/SimpleCategorizedFieldSearchExample.py +++ /dev/null @@ -1,173 +0,0 @@ -# SimpleCategorizedFieldSearchExample.py -from __future__ import print_function -from __future__ import absolute_import - -from optparse import OptionParser - -import os -import platform as plat -import sys -if sys.version_info >= (3, 8) and plat.system().lower() == "windows": - # pylint: disable=no-member - with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): - import blpapi -else: - import blpapi - -APIFLDS_SVC = "//blp/apiflds" -PADDING = " " - -FIELD_ID = blpapi.Name("id") -FIELD_MNEMONIC = blpapi.Name("mnemonic") -FIELD_DATA = blpapi.Name("fieldData") -FIELD_DESC = blpapi.Name("description") -FIELD_INFO = blpapi.Name("fieldInfo") -FIELD_ERROR = blpapi.Name("fieldError") -FIELD_MSG = blpapi.Name("message") -CATEGORY = blpapi.Name("category") -CATEGORY_NAME = blpapi.Name("categoryName") -CATEGORY_ID = blpapi.Name("categoryId") -FIELD_SEARCH_ERROR = blpapi.Name("fieldSearchError") - -ID_LEN = 13 -MNEMONIC_LEN = 36 -DESC_LEN = 40 -CAT_NAME_LEN = 40 - - -def parseCmdLine(): - parser = OptionParser(description="Retrieve reference data.") - parser.add_option("-a", - "--ip", - dest="host", - help="server name or IP (default: %default)", - metavar="ipAddress", - default="localhost") - parser.add_option("-p", - dest="port", - type="int", - help="server port (default: %default)", - metavar="tcpPort", - default=8194) - - poptions,_ = parser.parse_args() - - return poptions - - -def printField(field): - fldId = field.getElementAsString(FIELD_ID) - if field.hasElement(FIELD_INFO): - fldInfo = field.getElement(FIELD_INFO) - fldMnemonic = fldInfo.getElementAsString(FIELD_MNEMONIC) - fldDesc = fldInfo.getElementAsString(FIELD_DESC) - - print("%s%s%s" % (fldId.ljust(ID_LEN), fldMnemonic.ljust(MNEMONIC_LEN), - fldDesc.ljust(DESC_LEN))) - else: - fldError = field.getElement(FIELD_ERROR) - errorMsg = fldError.getElementAsString(FIELD_MSG) - - print() - print(" ERROR: %s - %s" % (fldId, errorMsg)) - - -def printHeader(): - print("%s%s%s" % ("FIELD ID".ljust(ID_LEN), "MNEMONIC".ljust(MNEMONIC_LEN), - "DESCRIPTION".ljust(DESC_LEN))) - print("%s%s%s" % ("-----------".ljust(ID_LEN), "-----------".ljust(MNEMONIC_LEN), - "-----------".ljust(DESC_LEN))) - - -def main(): - options = parseCmdLine() - - # Fill SessionOptions - sessionOptions = blpapi.SessionOptions() - sessionOptions.setServerHost(options.host) - sessionOptions.setServerPort(options.port) - - print("Connecting to %s:%d" % (options.host, options.port)) - - # Create a Session - session = blpapi.Session(sessionOptions) - - # Start a Session - if not session.start(): - print("Failed to start session.") - return - - if not session.openService(APIFLDS_SVC): - print("Failed to open", APIFLDS_SVC) - return - - fieldInfoService = session.getService(APIFLDS_SVC) - request = fieldInfoService.createRequest("CategorizedFieldSearchRequest") - request.set("searchSpec", "last price") - exclude = request.getElement("exclude") - exclude.setElement("fieldType", "Static") - request.set("returnFieldDocumentation", False) - - print("Sending Request:", request) - session.sendRequest(request) - - try: - # Process received events - while(True): - # We provide timeout to give the chance to Ctrl+C handling: - event = session.nextEvent(500) - if event.eventType() != blpapi.Event.RESPONSE and \ - event.eventType() != blpapi.Event.PARTIAL_RESPONSE: - continue - for msg in event: - if msg.hasElement(FIELD_SEARCH_ERROR): - print(msg) - continue - - categories = msg.getElement("category") - for category in categories.values(): - Name = category.getElementAsString("categoryName") - Id = category.getElementAsString("categoryId") - print("\n Category Name:%s\tId:%s" % \ - (Name.ljust(CAT_NAME_LEN), Id)) - - printHeader() - fields = category.getElement("fieldData") - for field in fields.values(): - printField(field) - print() - - # Response completly received, so we could exit - if event.eventType() == blpapi.Event.RESPONSE: - break - finally: - # Stop the session - session.stop() - -if __name__ == "__main__": - print("SimpleCategorizedFieldSearchExample") - try: - main() - except KeyboardInterrupt: - print("Ctrl+C pressed. Stopping...") - -__copyright__ = """ -Copyright 2012. Bloomberg Finance L.P. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: The above -copyright notice and this permission notice shall be included in all copies -or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/examples/SimpleFieldInfoExample.py b/examples/SimpleFieldInfoExample.py deleted file mode 100644 index e71b971..0000000 --- a/examples/SimpleFieldInfoExample.py +++ /dev/null @@ -1,157 +0,0 @@ -# SimpleFieldInfoExample.py -from __future__ import print_function -from __future__ import absolute_import - -from optparse import OptionParser - -import os -import platform as plat -import sys -if sys.version_info >= (3, 8) and plat.system().lower() == "windows": - # pylint: disable=no-member - with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): - import blpapi -else: - import blpapi - -APIFLDS_SVC = "//blp/apiflds" -PADDING = " " - -FIELD_ID = blpapi.Name("id") -FIELD_MNEMONIC = blpapi.Name("mnemonic") -FIELD_DATA = blpapi.Name("fieldData") -FIELD_DESC = blpapi.Name("description") -FIELD_INFO = blpapi.Name("fieldInfo") -FIELD_ERROR = blpapi.Name("fieldError") -FIELD_MSG = blpapi.Name("message") - -ID_LEN = 13 -MNEMONIC_LEN = 36 -DESC_LEN = 40 - - -def parseCmdLine(): - parser = OptionParser(description="Retrieve reference data.") - parser.add_option("-a", - "--ip", - dest="host", - help="server name or IP (default: %default)", - metavar="ipAddress", - default="localhost") - parser.add_option("-p", - dest="port", - type="int", - help="server port (default: %default)", - metavar="tcpPort", - default=8194) - - poptions,_ = parser.parse_args() - - return poptions - - -def printField(field): - fldId = field.getElementAsString(FIELD_ID) - if field.hasElement(FIELD_INFO): - fldInfo = field.getElement(FIELD_INFO) - fldMnemonic = fldInfo.getElementAsString(FIELD_MNEMONIC) - fldDesc = fldInfo.getElementAsString(FIELD_DESC) - - print("%s%s%s" % (fldId.ljust(ID_LEN), fldMnemonic.ljust(MNEMONIC_LEN), - fldDesc.ljust(DESC_LEN))) - else: - fldError = field.getElement(FIELD_ERROR) - errorMsg = fldError.getElementAsString(FIELD_MSG) - - print() - print(" ERROR: %s - %s" % (fldId, errorMsg)) - - -def printHeader(): - print("%s%s%s" % ("FIELD ID".ljust(ID_LEN), "MNEMONIC".ljust(MNEMONIC_LEN), - "DESCRIPTION".ljust(DESC_LEN))) - print("%s%s%s" % ("-----------".ljust(ID_LEN), "-----------".ljust(MNEMONIC_LEN), - "-----------".ljust(DESC_LEN))) - - -def main(): - options = parseCmdLine() - - # Fill SessionOptions - sessionOptions = blpapi.SessionOptions() - sessionOptions.setServerHost(options.host) - sessionOptions.setServerPort(options.port) - - print("Connecting to %s:%d" % (options.host, options.port)) - - # Create a Session - session = blpapi.Session(sessionOptions) - - # Start a Session - if not session.start(): - print("Failed to start session.") - return - - if not session.openService(APIFLDS_SVC): - print("Failed to open", APIFLDS_SVC) - return - - fieldInfoService = session.getService(APIFLDS_SVC) - request = fieldInfoService.createRequest("FieldInfoRequest") - request.append("id", "LAST_PRICE") - request.append("id", "pq005") - request.append("id", "zz0002") - - request.set("returnFieldDocumentation", True) - - print("Sending Request:", request) - session.sendRequest(request) - - try: - # Process received events - while(True): - # We provide timeout to give the chance to Ctrl+C handling: - event = session.nextEvent(500) - if event.eventType() != blpapi.Event.RESPONSE and \ - event.eventType() != blpapi.Event.PARTIAL_RESPONSE: - continue - for msg in event: - fields = msg.getElement("fieldData") - printHeader() - for field in fields.values(): - printField(field) - print() - # Response completly received, so we could exit - if event.eventType() == blpapi.Event.RESPONSE: - break - finally: - # Stop the session - session.stop() - -if __name__ == "__main__": - print("SimpleFieldInfoExample") - try: - main() - except KeyboardInterrupt: - print("Ctrl+C pressed. Stopping...") - -__copyright__ = """ -Copyright 2012. Bloomberg Finance L.P. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: The above -copyright notice and this permission notice shall be included in all copies -or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/examples/SimpleFieldSearchExample.py b/examples/SimpleFieldSearchExample.py deleted file mode 100644 index 409d7d3..0000000 --- a/examples/SimpleFieldSearchExample.py +++ /dev/null @@ -1,156 +0,0 @@ -# SimpleFieldSearchExample.py -from __future__ import print_function -from __future__ import absolute_import - -from optparse import OptionParser - -import os -import platform as plat -import sys -if sys.version_info >= (3, 8) and plat.system().lower() == "windows": - # pylint: disable=no-member - with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): - import blpapi -else: - import blpapi - -APIFLDS_SVC = "//blp/apiflds" -PADDING = " " - -FIELD_ID = blpapi.Name("id") -FIELD_MNEMONIC = blpapi.Name("mnemonic") -FIELD_DATA = blpapi.Name("fieldData") -FIELD_DESC = blpapi.Name("description") -FIELD_INFO = blpapi.Name("fieldInfo") -FIELD_ERROR = blpapi.Name("fieldError") -FIELD_MSG = blpapi.Name("message") - -ID_LEN = 13 -MNEMONIC_LEN = 36 -DESC_LEN = 40 - - -def parseCmdLine(): - parser = OptionParser(description="Retrieve reference data.") - parser.add_option("-a", - "--ip", - dest="host", - help="server name or IP (default: %default)", - metavar="ipAddress", - default="localhost") - parser.add_option("-p", - dest="port", - type="int", - help="server port (default: %default)", - metavar="tcpPort", - default=8194) - - poptions,_ = parser.parse_args() - - return poptions - - -def printField(field): - fldId = field.getElementAsString(FIELD_ID) - if field.hasElement(FIELD_INFO): - fldInfo = field.getElement(FIELD_INFO) - fldMnemonic = fldInfo.getElementAsString(FIELD_MNEMONIC) - fldDesc = fldInfo.getElementAsString(FIELD_DESC) - - print("%s%s%s" % (fldId.ljust(ID_LEN), fldMnemonic.ljust(MNEMONIC_LEN), - fldDesc.ljust(DESC_LEN))) - else: - fldError = field.getElement(FIELD_ERROR) - errorMsg = fldError.getElementAsString(FIELD_MSG) - - print() - print(" ERROR: %s - %s" % (fldId, errorMsg)) - - -def printHeader(): - print("%s%s%s" % ("FIELD ID".ljust(ID_LEN), "MNEMONIC".ljust(MNEMONIC_LEN), - "DESCRIPTION".ljust(DESC_LEN))) - print("%s%s%s" % ("-----------".ljust(ID_LEN), "-----------".ljust(MNEMONIC_LEN), - "-----------".ljust(DESC_LEN))) - - -def main(): - options = parseCmdLine() - - # Fill SessionOptions - sessionOptions = blpapi.SessionOptions() - sessionOptions.setServerHost(options.host) - sessionOptions.setServerPort(options.port) - - print("Connecting to %s:%d" % (options.host, options.port)) - - # Create a Session - session = blpapi.Session(sessionOptions) - - # Start a Session - if not session.start(): - print("Failed to start session.") - return - - if not session.openService(APIFLDS_SVC): - print("Failed to open", APIFLDS_SVC) - return - - fieldInfoService = session.getService(APIFLDS_SVC) - request = fieldInfoService.createRequest("FieldSearchRequest") - request.set("searchSpec", "last price") - exclude = request.getElement("exclude") - exclude.setElement("fieldType", "Static") - request.set("returnFieldDocumentation", False) - - print("Sending Request:", request) - session.sendRequest(request) - - printHeader() - try: - # Process received events - while(True): - # We provide timeout to give the chance to Ctrl+C handling: - event = session.nextEvent(500) - if event.eventType() != blpapi.Event.RESPONSE and \ - event.eventType() != blpapi.Event.PARTIAL_RESPONSE: - continue - for msg in event: - fields = msg.getElement("fieldData") - for field in fields.values(): - printField(field) - print() - # Response completly received, so we could exit - if event.eventType() == blpapi.Event.RESPONSE: - break - finally: - # Stop the session - session.stop() - -if __name__ == "__main__": - print("SimpleFieldSearchExample") - try: - main() - except KeyboardInterrupt: - print("Ctrl+C pressed. Stopping...") - -__copyright__ = """ -Copyright 2012. Bloomberg Finance L.P. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: The above -copyright notice and this permission notice shall be included in all copies -or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/examples/SimpleHistoryExample.py b/examples/SimpleHistoryExample.py deleted file mode 100644 index 46adc1d..0000000 --- a/examples/SimpleHistoryExample.py +++ /dev/null @@ -1,119 +0,0 @@ -# SimpleHistoryExample.py -from __future__ import print_function -from __future__ import absolute_import - -from optparse import OptionParser - -import os -import platform as plat -import sys -if sys.version_info >= (3, 8) and plat.system().lower() == "windows": - # pylint: disable=no-member - with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): - import blpapi -else: - import blpapi - -def parseCmdLine(): - parser = OptionParser(description="Retrieve reference data.") - parser.add_option("-a", - "--ip", - dest="host", - help="server name or IP (default: %default)", - metavar="ipAddress", - default="localhost") - parser.add_option("-p", - dest="port", - type="int", - help="server port (default: %default)", - metavar="tcpPort", - default=8194) - - options,_ = parser.parse_args() - - return options - - -def main(): - options = parseCmdLine() - - # Fill SessionOptions - sessionOptions = blpapi.SessionOptions() - sessionOptions.setServerHost(options.host) - sessionOptions.setServerPort(options.port) - - print("Connecting to %s:%s" % (options.host, options.port)) - # Create a Session - session = blpapi.Session(sessionOptions) - - # Start a Session - if not session.start(): - print("Failed to start session.") - return - - try: - # Open service to get historical data from - if not session.openService("//blp/refdata"): - print("Failed to open //blp/refdata") - return - - # Obtain previously opened service - refDataService = session.getService("//blp/refdata") - - # Create and fill the request for the historical data - request = refDataService.createRequest("HistoricalDataRequest") - request.getElement("securities").appendValue("IBM US Equity") - request.getElement("securities").appendValue("MSFT US Equity") - request.getElement("fields").appendValue("PX_LAST") - request.getElement("fields").appendValue("OPEN") - request.set("periodicityAdjustment", "ACTUAL") - request.set("periodicitySelection", "MONTHLY") - request.set("startDate", "20060101") - request.set("endDate", "20061231") - request.set("maxDataPoints", 100) - - print("Sending Request:", request) - # Send the request - session.sendRequest(request) - - # Process received events - while(True): - # We provide timeout to give the chance for Ctrl+C handling: - ev = session.nextEvent(500) - for msg in ev: - print(msg) - - if ev.eventType() == blpapi.Event.RESPONSE: - # Response completly received, so we could exit - break - finally: - # Stop the session - session.stop() - -if __name__ == "__main__": - print("SimpleHistoryExample") - try: - main() - except KeyboardInterrupt: - print("Ctrl+C pressed. Stopping...") - -__copyright__ = """ -Copyright 2012. Bloomberg Finance L.P. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: The above -copyright notice and this permission notice shall be included in all copies -or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/examples/SimpleIntradayBarExample.py b/examples/SimpleIntradayBarExample.py deleted file mode 100644 index e1725af..0000000 --- a/examples/SimpleIntradayBarExample.py +++ /dev/null @@ -1,133 +0,0 @@ -# SimpleIntradayBarExample.py -from __future__ import print_function -from __future__ import absolute_import - -import datetime -from optparse import OptionParser - -import os -import platform as plat -import sys -if sys.version_info >= (3, 8) and plat.system().lower() == "windows": - # pylint: disable=no-member - with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): - import blpapi -else: - import blpapi - -def parseCmdLine(): - parser = OptionParser(description="Retrieve reference data.") - parser.add_option("-a", - "--ip", - dest="host", - help="server name or IP (default: %default)", - metavar="ipAddress", - default="localhost") - parser.add_option("-p", - dest="port", - type="int", - help="server port (default: %default)", - metavar="tcpPort", - default=8194) - - poptions,_ = parser.parse_args() - - return poptions - - -def getPreviousTradingDate(): - tradedOn = datetime.date.today() - - while True: - try: - tradedOn -= datetime.timedelta(days=1) - except OverflowError: - return None - - if tradedOn.weekday() not in [5, 6]: - return tradedOn - - -def main(): - options = parseCmdLine() - - # Fill SessionOptions - sessionOptions = blpapi.SessionOptions() - sessionOptions.setServerHost(options.host) - sessionOptions.setServerPort(options.port) - - print("Connecting to %s:%d" % (options.host, options.port)) - - # Create a Session - session = blpapi.Session(sessionOptions) - - # Start a Session - if not session.start(): - print("Failed to start session.") - return - - if not session.openService("//blp/refdata"): - print("Failed to open //blp/refdata") - return - - refDataService = session.getService("//blp/refdata") - request = refDataService.createRequest("IntradayBarRequest") - request.set("security", "IBM US Equity") - request.set("eventType", "TRADE") - request.set("interval", 60) # bar interval in minutes - - tradedOn = getPreviousTradingDate() - if not tradedOn: - print("unable to get previous trading date") - return - - startTime = datetime.datetime.combine(tradedOn, datetime.time(13, 30)) - request.set("startDateTime", startTime) - - endTime = datetime.datetime.combine(tradedOn, datetime.time(21, 30)) - request.set("endDateTime", endTime) - - print("Sending Request:", request) - session.sendRequest(request) - - try: - # Process received events - while(True): - # We provide timeout to give the chance to Ctrl+C handling: - ev = session.nextEvent(500) - for msg in ev: - print(msg.messageType(), msg) - # Response completly received, so we could exit - if ev.eventType() == blpapi.Event.RESPONSE: - break - finally: - # Stop the session - session.stop() - -if __name__ == "__main__": - print("SimpleIntradayBarExample") - try: - main() - except KeyboardInterrupt: - print("Ctrl+C pressed. Stopping...") - -__copyright__ = """ -Copyright 2012. Bloomberg Finance L.P. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: The above -copyright notice and this permission notice shall be included in all copies -or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/examples/SimpleIntradayTickExample.py b/examples/SimpleIntradayTickExample.py deleted file mode 100644 index 19660e0..0000000 --- a/examples/SimpleIntradayTickExample.py +++ /dev/null @@ -1,134 +0,0 @@ -# SimpleIntradayTickExample.py -from __future__ import print_function -from __future__ import absolute_import - -import datetime -from optparse import OptionParser - -import os -import platform as plat -import sys -if sys.version_info >= (3, 8) and plat.system().lower() == "windows": - # pylint: disable=no-member - with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): - import blpapi -else: - import blpapi - -def parseCmdLine(): - parser = OptionParser(description="Retrieve reference data.") - parser.add_option("-a", - "--ip", - dest="host", - help="server name or IP (default: %default)", - metavar="ipAddress", - default="localhost") - parser.add_option("-p", - dest="port", - type="int", - help="server port (default: %default)", - metavar="tcpPort", - default=8194) - - poptions,_ = parser.parse_args() - - return poptions - - -def getPreviousTradingDate(): - tradedOn = datetime.date.today() - - while True: - try: - tradedOn -= datetime.timedelta(days=1) - except OverflowError: - return None - - if tradedOn.weekday() not in [5, 6]: - return tradedOn - - -def main(): - options = parseCmdLine() - - # Fill SessionOptions - sessionOptions = blpapi.SessionOptions() - sessionOptions.setServerHost(options.host) - sessionOptions.setServerPort(options.port) - - print("Connecting to %s:%d" % (options.host, options.port)) - - # Create a Session - session = blpapi.Session(sessionOptions) - - # Start a Session - if not session.start(): - print("Failed to start session.") - return - - if not session.openService("//blp/refdata"): - print("Failed to open //blp/refdata") - return - - refDataService = session.getService("//blp/refdata") - request = refDataService.createRequest("IntradayTickRequest") - request.set("security", "VOD LN Equity") - request.getElement("eventTypes").appendValue("TRADE") - request.getElement("eventTypes").appendValue("AT_TRADE") - request.set("includeConditionCodes", True) - - tradedOn = getPreviousTradingDate() - if not tradedOn: - print("unable to get previous trading date") - return - - startTime = datetime.datetime.combine(tradedOn, datetime.time(13, 30)) - request.set("startDateTime", startTime) - - endTime = datetime.datetime.combine(tradedOn, datetime.time(13, 35)) - request.set("endDateTime", endTime) - - print("Sending Request:", request) - session.sendRequest(request) - - try: - # Process received events - while(True): - # We provide timeout to give the chance to Ctrl+C handling: - ev = session.nextEvent(500) - for msg in ev: - print(msg) - # Response completly received, so we could exit - if ev.eventType() == blpapi.Event.RESPONSE: - break - finally: - # Stop the session - session.stop() - -if __name__ == "__main__": - print("SimpleIntradayTickExample") - try: - main() - except KeyboardInterrupt: - print("Ctrl+C pressed. Stopping...") - -__copyright__ = """ -Copyright 2012. Bloomberg Finance L.P. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: The above -copyright notice and this permission notice shall be included in all copies -or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/examples/SimpleRefDataExample.py b/examples/SimpleRefDataExample.py deleted file mode 100644 index d336d7e..0000000 --- a/examples/SimpleRefDataExample.py +++ /dev/null @@ -1,113 +0,0 @@ -# SimpleRefDataExample.py -from __future__ import print_function -from __future__ import absolute_import - -from optparse import OptionParser - -import os -import platform as plat -import sys -if sys.version_info >= (3, 8) and plat.system().lower() == "windows": - # pylint: disable=no-member - with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): - import blpapi -else: - import blpapi - -def parseCmdLine(): - parser = OptionParser(description="Retrieve reference data.") - parser.add_option("-a", - "--ip", - dest="host", - help="server name or IP (default: %default)", - metavar="ipAddress", - default="localhost") - parser.add_option("-p", - dest="port", - type="int", - help="server port (default: %default)", - metavar="tcpPort", - default=8194) - - poptions,_ = parser.parse_args() - - return poptions - - -def main(): - options = parseCmdLine() - - # Fill SessionOptions - sessionOptions = blpapi.SessionOptions() - sessionOptions.setServerHost(options.host) - sessionOptions.setServerPort(options.port) - - print("Connecting to %s:%d" % (options.host, options.port)) - - # Create a Session - session = blpapi.Session(sessionOptions) - - # Start a Session - if not session.start(): - print("Failed to start session.") - return - - if not session.openService("//blp/refdata"): - print("Failed to open //blp/refdata") - return - - refDataService = session.getService("//blp/refdata") - request = refDataService.createRequest("ReferenceDataRequest") - - # append securities to request - request.append("securities", "IBM US Equity") - request.append("securities", "MSFT US Equity") - - # append fields to request - request.append("fields", "PX_LAST") - request.append("fields", "DS002") - - print("Sending Request:", request) - session.sendRequest(request) - - try: - # Process received events - while(True): - # We provide timeout to give the chance to Ctrl+C handling: - ev = session.nextEvent(500) - for msg in ev: - print(msg) - # Response completly received, so we could exit - if ev.eventType() == blpapi.Event.RESPONSE: - break - finally: - # Stop the session - session.stop() - -if __name__ == "__main__": - print("SimpleRefDataExample") - try: - main() - except KeyboardInterrupt: - print("Ctrl+C pressed. Stopping...") - -__copyright__ = """ -Copyright 2012. Bloomberg Finance L.P. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: The above -copyright notice and this permission notice shall be included in all copies -or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/examples/SimpleRefDataOverrideExample.py b/examples/SimpleRefDataOverrideExample.py deleted file mode 100644 index 766196b..0000000 --- a/examples/SimpleRefDataOverrideExample.py +++ /dev/null @@ -1,157 +0,0 @@ -# SimpleRefDataOverrideExample.py -from __future__ import print_function -from __future__ import absolute_import - -from optparse import OptionParser - -import os -import platform as plat -import sys -if sys.version_info >= (3, 8) and plat.system().lower() == "windows": - # pylint: disable=no-member - with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): - import blpapi -else: - import blpapi - -SECURITY_DATA = blpapi.Name("securityData") -SECURITY = blpapi.Name("security") -FIELD_DATA = blpapi.Name("fieldData") -FIELD_EXCEPTIONS = blpapi.Name("fieldExceptions") -FIELD_ID = blpapi.Name("fieldId") -ERROR_INFO = blpapi.Name("errorInfo") - - -def parseCmdLine(): - parser = OptionParser(description="Retrieve reference data.") - parser.add_option("-a", - "--ip", - dest="host", - help="server name or IP (default: %default)", - metavar="ipAddress", - default="localhost") - parser.add_option("-p", - dest="port", - type="int", - help="server port (default: %default)", - metavar="tcpPort", - default=8194) - - poptions,_ = parser.parse_args() - - return poptions - - -def processMessage(msg): - if not msg.hasElement(SECURITY_DATA): - print("Unexpected message:") - print(msg) - return - - securityDataArray = msg.getElement(SECURITY_DATA) - for securityData in securityDataArray.values(): - print(securityData.getElementAsString(SECURITY)) - fieldData = securityData.getElement(FIELD_DATA) - for field in fieldData.elements(): - if field.isValid(): - print(field.name(), "=", field.getValueAsString()) - else: - print(field.name(), " is NULL") - - fieldExceptionArray = securityData.getElement(FIELD_EXCEPTIONS) - for fieldException in fieldExceptionArray.values(): - errorInfo = fieldException.getElement(ERROR_INFO) - print(errorInfo.getElementAsString("category"), ":", \ - fieldException.getElementAsString(FIELD_ID)) - - print() - - -def main(): - options = parseCmdLine() - - # Fill SessionOptions - sessionOptions = blpapi.SessionOptions() - sessionOptions.setServerHost(options.host) - sessionOptions.setServerPort(options.port) - - print("Connecting to %s:%d" % (options.host, options.port)) - - # Create a Session - session = blpapi.Session(sessionOptions) - - # Start a Session - if not session.start(): - print("Failed to start session.") - return - - if not session.openService("//blp/refdata"): - print("Failed to open //blp/refdata") - return - - refDataService = session.getService("//blp/refdata") - request = refDataService.createRequest("ReferenceDataRequest") - - # append securities to request - request.append("securities", "IBM US Equity") - request.append("securities", "MSFT US Equity") - - # append fields to request - request.append("fields", "PX_LAST") - request.append("fields", "DS002") - request.append("fields", "EQY_WEIGHTED_AVG_PX") - - # add overrides - overrides = request.getElement("overrides") - override1 = overrides.appendElement() - override1.setElement("fieldId", "VWAP_START_TIME") - override1.setElement("value", "9:30") - override2 = overrides.appendElement() - override2.setElement("fieldId", "VWAP_END_TIME") - override2.setElement("value", "11:30") - - print("Sending Request:", request) - cid = session.sendRequest(request) - - try: - # Process received events - while(True): - # We provide timeout to give the chance to Ctrl+C handling: - ev = session.nextEvent(500) - for msg in ev: - if cid in msg.correlationIds(): - processMessage(msg) - # Response completly received, so we could exit - if ev.eventType() == blpapi.Event.RESPONSE: - break - finally: - # Stop the session - session.stop() - -if __name__ == "__main__": - print("SimpleRefDataOverrideExample") - try: - main() - except KeyboardInterrupt: - print("Ctrl+C pressed. Stopping...") - -__copyright__ = """ -Copyright 2012. Bloomberg Finance L.P. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: The above -copyright notice and this permission notice shall be included in all copies -or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/examples/SimpleSubscriptionExample.py b/examples/SimpleSubscriptionExample.py deleted file mode 100644 index ac2faf7..0000000 --- a/examples/SimpleSubscriptionExample.py +++ /dev/null @@ -1,126 +0,0 @@ -# SimpleSubscriptionExample.py -from __future__ import print_function -from __future__ import absolute_import - -from optparse import OptionParser - -import os -import platform as plat -import sys -if sys.version_info >= (3, 8) and plat.system().lower() == "windows": - # pylint: disable=no-member - with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): - import blpapi -else: - import blpapi - -def parseCmdLine(): - parser = OptionParser(description="Retrieve realtime data.") - parser.add_option("-a", - "--ip", - dest="host", - help="server name or IP (default: %default)", - metavar="ipAddress", - default="localhost") - parser.add_option("-p", - dest="port", - type="int", - help="server port (default: %default)", - metavar="tcpPort", - default=8194) - parser.add_option("--me", - dest="maxEvents", - type="int", - help="stop after this many events (default: %default)", - metavar="maxEvents", - default=1000000) - - options,_ = parser.parse_args() - - return options - - -def main(): - options = parseCmdLine() - - # Fill SessionOptions - sessionOptions = blpapi.SessionOptions() - sessionOptions.setServerHost(options.host) - sessionOptions.setServerPort(options.port) - - print("Connecting to %s:%d" % (options.host, options.port)) - - # Create a Session - session = blpapi.Session(sessionOptions) - - # Start a Session - if not session.start(): - print("Failed to start session.") - return - - if not session.openService("//blp/mktdata"): - print("Failed to open //blp/mktdata") - return - - security1 = "IBM US Equity" - security2 = "/cusip/912828GM6@BGN" - - subscriptions = blpapi.SubscriptionList() - subscriptions.add(security1, - "LAST_PRICE,BID,ASK", - "", - blpapi.CorrelationId(security1)) - subscriptions.add(security2, - "LAST_PRICE,BID,ASK,BID_YIELD,ASK_YIELD", - "", - blpapi.CorrelationId(security2)) - - session.subscribe(subscriptions) - - try: - # Process received events - eventCount = 0 - while(True): - # We provide timeout to give the chance to Ctrl+C handling: - event = session.nextEvent(500) - for msg in event: - if event.eventType() == blpapi.Event.SUBSCRIPTION_STATUS or \ - event.eventType() == blpapi.Event.SUBSCRIPTION_DATA: - print("%s - %s" % (msg.correlationIds()[0].value(), msg)) - else: - print(msg) - if event.eventType() == blpapi.Event.SUBSCRIPTION_DATA: - eventCount += 1 - if eventCount >= options.maxEvents: - break - finally: - # Stop the session - session.stop() - -if __name__ == "__main__": - print("SimpleSubscriptionExample") - try: - main() - except KeyboardInterrupt: - print("Ctrl+C pressed. Stopping...") - -__copyright__ = """ -Copyright 2012. Bloomberg Finance L.P. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: The above -copyright notice and this permission notice shall be included in all copies -or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/examples/SimpleSubscriptionIntervalExample.py b/examples/SimpleSubscriptionIntervalExample.py deleted file mode 100644 index 72b477d..0000000 --- a/examples/SimpleSubscriptionIntervalExample.py +++ /dev/null @@ -1,127 +0,0 @@ -# SimpleSubscriptionIntervalExample.py -from __future__ import print_function -from __future__ import absolute_import - -from optparse import OptionParser - -import os -import platform as plat -import sys -if sys.version_info >= (3, 8) and plat.system().lower() == "windows": - # pylint: disable=no-member - with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): - import blpapi -else: - import blpapi - - -def parseCmdLine(): - parser = OptionParser(description="Retrieve realtime data.") - parser.add_option("-a", - "--ip", - dest="host", - help="server name or IP (default: %default)", - metavar="ipAddress", - default="localhost") - parser.add_option("-p", - dest="port", - type="int", - help="server port (default: %default)", - metavar="tcpPort", - default=8194) - parser.add_option("--me", - dest="maxEvents", - type="int", - help="stop after this many events (default: %default)", - metavar="maxEvents", - default=1000000) - - options,_ = parser.parse_args() - - return options - - -def main(): - options = parseCmdLine() - - # Fill SessionOptions - sessionOptions = blpapi.SessionOptions() - sessionOptions.setServerHost(options.host) - sessionOptions.setServerPort(options.port) - - print("Connecting to %s:%d" % (options.host, options.port)) - - # Create a Session - session = blpapi.Session(sessionOptions) - - # Start a Session - if not session.start(): - print("Failed to start session.") - return - - if not session.openService("//blp/mktdata"): - print("Failed to open //blp/mktdata") - return - - security1 = "IBM US Equity" - security2 = "/cusip/912828GM6@BGN" - - subscriptions = blpapi.SubscriptionList() - subscriptions.add(security1, - "LAST_PRICE,BID,ASK", - "interval=1.0", - blpapi.CorrelationId(security1)) - subscriptions.add(security2, - "LAST_PRICE,BID,ASK,BID_YIELD,ASK_YIELD", - "interval=1.0", - blpapi.CorrelationId(security2)) - - session.subscribe(subscriptions) - - try: - # Process received events - eventCount = 0 - while(True): - # We provide timeout to give the chance to Ctrl+C handling: - event = session.nextEvent(500) - for msg in event: - if event.eventType() == blpapi.Event.SUBSCRIPTION_STATUS or \ - event.eventType() == blpapi.Event.SUBSCRIPTION_DATA: - print("%s - %s" % (msg.correlationIds()[0].value(), msg)) - else: - print(msg) - if event.eventType() == blpapi.Event.SUBSCRIPTION_DATA: - eventCount += 1 - if eventCount >= options.maxEvents: - break - finally: - # Stop the session - session.stop() - -if __name__ == "__main__": - print("SimpleSubscriptionIntervalExample") - try: - main() - except KeyboardInterrupt: - print("Ctrl+C pressed. Stopping...") - -__copyright__ = """ -Copyright 2012. Bloomberg Finance L.P. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: The above -copyright notice and this permission notice shall be included in all copies -or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/examples/SnapshotRequestTemplateExample.py b/examples/SnapshotRequestTemplateExample.py deleted file mode 100644 index 1206662..0000000 --- a/examples/SnapshotRequestTemplateExample.py +++ /dev/null @@ -1,242 +0,0 @@ -"""SnapshotRequestTemplateExample.py""" -from __future__ import print_function -from __future__ import absolute_import - -from optparse import OptionParser, OptionValueError - -import os -import platform as plat -import sys -if sys.version_info >= (3, 8) and plat.system().lower() == "windows": - # pylint: disable=no-member - with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): - import blpapi -else: - import blpapi - -def authOptionCallback(_option, _opt, value, parser): - """Parse authorization options from user input""" - - vals = value.split('=', 1) - - if value == "user": - authUser = blpapi.AuthUser.createWithLogonName() - authOptions = blpapi.AuthOptions.createWithUser(authUser) - elif value == "none": - authOptions = None - elif vals[0] == "app" and len(vals) == 2: - appName = vals[1] - authOptions = blpapi.AuthOptions.createWithApp(appName) - elif vals[0] == "userapp" and len(vals) == 2: - appName = vals[1] - authUser = blpapi.AuthUser.createWithLogonName() - authOptions = blpapi.AuthOptions\ - .createWithUserAndApp(authUser, appName) - elif vals[0] == "dir" and len(vals) == 2: - activeDirectoryProperty = vals[1] - authUser = blpapi.AuthUser\ - .createWithActiveDirectoryProperty(activeDirectoryProperty) - authOptions = blpapi.AuthOptions.createWithUser(authUser) - elif vals[0] == "manual": - parts = [] - if len(vals) == 2: - parts = vals[1].split(',') - - if len(parts) != 3: - raise OptionValueError("Invalid auth option {}".format(value)) - - appName, ip, userId = parts - - authUser = blpapi.AuthUser.createWithManualOptions(userId, ip) - authOptions = blpapi.AuthOptions.createWithUserAndApp(authUser, appName) - else: - raise OptionValueError("Invalid auth option '{}'".format(value)) - - parser.values.auth = {'option' : authOptions} - -def parseCmdLine(): - """parse cli arguments""" - parser = OptionParser(description="Retrieve realtime data.") - parser.add_option("-a", - "--ip", - dest="hosts", - help="server name or IP (default: localhost)", - metavar="ipAddress", - action="append", - default=[]) - parser.add_option("-p", - dest="port", - type="int", - help="server port (default: %default)", - metavar="tcpPort", - default=8194) - parser.add_option("-s", - dest="service", - help="service name (default: %default)", - metavar="service", - default="//viper/mktdata") - parser.add_option("-t", - dest="topics", - help="topic name (default: /ticker/IBM Equity)", - metavar="topic", - action="append", - default=[]) - parser.add_option("-f", - dest="fields", - help="field to subscribe to (default: empty)", - metavar="field", - action="append", - default=[]) - parser.add_option("-o", - dest="options", - help="subscription options (default: empty)", - metavar="option", - action="append", - default=[]) - parser.add_option("--me", - dest="maxEvents", - type="int", - help="stop after this many events (default: %default)", - metavar="maxEvents", - default=1000000) - parser.add_option("--auth", - dest="auth", - help="authentication option: " - "user|none|app=|userapp=|dir=" - "|manual=" - " (default: user)\n" - "'none' is applicable to Desktop API product " - "that requires Bloomberg Professional service " - "to be installed locally.", - metavar="option", - action="callback", - callback=authOptionCallback, - type="string", - default={"option" : - blpapi.AuthOptions.createWithUser( - blpapi.AuthUser.createWithLogonName())}) - - (opts, _) = parser.parse_args() - - if not opts.hosts: - opts.hosts = ["localhost"] - - if not opts.topics: - opts.topics = ["/ticker/IBM US Equity"] - - return opts - - -def main(): - """main entry point""" - options = parseCmdLine() - - # Fill SessionOptions - sessionOptions = blpapi.SessionOptions() - for idx, host in enumerate(options.hosts): - sessionOptions.setServerAddress(host, options.port, idx) - sessionOptions.setSessionIdentityOptions(options.auth['option']) - sessionOptions.setAutoRestartOnDisconnection(True) - - # NOTE: If running without a backup server, make many attempts to - # connect/reconnect to give that host a chance to come back up (the - # larger the number, the longer it will take for SessionStartupFailure - # to come on startup, or SessionTerminated due to inability to fail - # over). We don't have to do that in a redundant configuration - it's - # expected at least one server is up and reachable at any given time, - # so only try to connect to each server once. - sessionOptions.setNumStartAttempts(1 if len(options.hosts) > 1 else 1000) - - print("Connecting to port %d on %s" % ( - options.port, ", ".join(options.hosts))) - - session = blpapi.Session(sessionOptions) - - if not session.start(): - print("Failed to start session.") - return - - fieldStr = "?fields=" + ",".join(options.fields) - - snapshots = [] - nextCorrelationId = 0 - for i, topic in enumerate(options.topics): - subscriptionString = options.service + topic + fieldStr - snapshots.append(session.createSnapshotRequestTemplate( - subscriptionString, - blpapi.CorrelationId(i))) - nextCorrelationId += 1 - - requestTemplateAvailable = blpapi.Name('RequestTemplateAvailable') - eventCount = 0 - try: - while True: - # Specify timeout to give a chance for Ctrl-C - event = session.nextEvent(1000) - for msg in event: - if event.eventType() == blpapi.Event.ADMIN and \ - msg.messageType() == requestTemplateAvailable: - - for requestTemplate in snapshots: - try: - session.sendRequestTemplate( - requestTemplate, - blpapi.CorrelationId(nextCorrelationId)) - except blpapi.Exception as err: - print("Failed to send due to: ", err) - snapshots.remove(requestTemplate) - nextCorrelationId += 1 - - elif event.eventType() == blpapi.Event.RESPONSE or \ - event.eventType() == blpapi.Event.PARTIAL_RESPONSE: - - cid = msg.correlationIds()[0].value() - print("%s - %s" % (cid, msg)) - else: - print(msg) - if event.eventType() == blpapi.Event.RESPONSE: - eventCount += 1 - if eventCount >= options.maxEvents: - print("%d events processed, terminating." % eventCount) - break - elif event.eventType() == blpapi.Event.TIMEOUT: - for requestTemplate in snapshots: - try: - session.sendRequestTemplate( - requestTemplate, - blpapi.CorrelationId(nextCorrelationId)) - except blpapi.Exception as err: - print("Failed to send due to: ", err) - snapshots.remove(requestTemplate) - nextCorrelationId += 1 - - finally: - session.stop() - -if __name__ == "__main__": - print("SnapshotRequestTemplateExample") - try: - main() - except KeyboardInterrupt: - print("Ctrl+C pressed. Stopping...") - -__copyright__ = """ -Copyright 2018. Bloomberg Finance L.P. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: The above -copyright notice and this permission notice shall be included in all copies -or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/examples/SubscriptionCorrelationExample.py b/examples/SubscriptionCorrelationExample.py deleted file mode 100644 index 82925b3..0000000 --- a/examples/SubscriptionCorrelationExample.py +++ /dev/null @@ -1,131 +0,0 @@ -# SubscriptionCorrelationExample.py -from __future__ import print_function -from __future__ import absolute_import - -from optparse import OptionParser - -import os -import platform as plat -import sys -if sys.version_info >= (3, 8) and plat.system().lower() == "windows": - # pylint: disable=no-member - with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): - import blpapi -else: - import blpapi - -class GridWindow(object): - def __init__(self, name, securities): - self.name = name - self.securities = securities - - def processSecurityUpdate(self, _msg, row): - topicName = self.securities[row] - print("%s:%s,%s" % (self.name, row, topicName)) - - -def parseCmdLine(): - parser = OptionParser(description="Retrieve realtime data.") - parser.add_option("-a", - "--ip", - dest="host", - help="server name or IP (default: %default)", - metavar="ipAddress", - default="localhost") - parser.add_option("-p", - dest="port", - type="int", - help="server port (default: %default)", - metavar="tcpPort", - default=8194) - parser.add_option("--me", - dest="maxEvents", - type="int", - help="stop after this many events (default: %default)", - metavar="maxEvents", - default=1000000) - - options,_ = parser.parse_args() - - return options - - -def main(): - options = parseCmdLine() - - # Fill SessionOptions - sessionOptions = blpapi.SessionOptions() - sessionOptions.setServerHost(options.host) - sessionOptions.setServerPort(options.port) - - print("Connecting to %s:%d" % (options.host, options.port)) - - # Create a Session - session = blpapi.Session(sessionOptions) - - # Start a Session - if not session.start(): - print("Failed to start session.") - return - - if not session.openService("//blp/mktdata"): - print("Failed to open //blp/mktdata") - return - - securities = ["IBM US Equity", "VOD LN Equity"] - gridWindow = GridWindow("SecurityInfo", securities) - - subscriptions = blpapi.SubscriptionList() - for i, security in enumerate(securities): - subscriptions.add(security, - "LAST_PRICE", - "", - blpapi.CorrelationId(i)) - - session.subscribe(subscriptions) - - try: - # Process received events - eventCount = 0 - while(True): - # We provide timeout to give the chance to Ctrl+C handling: - event = session.nextEvent(500) - if event.eventType() == blpapi.Event.SUBSCRIPTION_DATA: - for msg in event: - row = msg.correlationIds()[0].value() - gridWindow.processSecurityUpdate(msg, row) - - eventCount += 1 - if eventCount >= options.maxEvents: - break - finally: - # Stop the session - session.stop() - -if __name__ == "__main__": - print("SubscriptionCorrelationExample") - try: - main() - except KeyboardInterrupt: - print("Ctrl+C pressed. Stopping...") - -__copyright__ = """ -Copyright 2012. Bloomberg Finance L.P. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: The above -copyright notice and this permission notice shall be included in all copies -or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/examples/SubscriptionWithEventHandlerExample.py b/examples/SubscriptionWithEventHandlerExample.py deleted file mode 100644 index f9754a4..0000000 --- a/examples/SubscriptionWithEventHandlerExample.py +++ /dev/null @@ -1,206 +0,0 @@ -# SubscriptionWithEventHandlerExample.py -from __future__ import print_function -from __future__ import absolute_import - -from optparse import OptionParser -import time - -import os -import platform as plat -import sys -if sys.version_info >= (3, 8) and plat.system().lower() == "windows": - # pylint: disable=no-member - with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): - import blpapi -else: - import blpapi - - -EXCEPTIONS = blpapi.Name("exceptions") -FIELD_ID = blpapi.Name("fieldId") -REASON = blpapi.Name("reason") -CATEGORY = blpapi.Name("category") -DESCRIPTION = blpapi.Name("description") -ERROR_INFO = blpapi.Name("ErrorInfo") - -class SubscriptionEventHandler(object): - def getTimeStamp(self): - return time.strftime("%Y/%m/%d %X") - - def processSubscriptionStatus(self, event): - timeStamp = self.getTimeStamp() - print("Processing SUBSCRIPTION_STATUS") - for msg in event: - topic = msg.correlationIds()[0].value() - print("%s: %s - %s" % (timeStamp, topic, msg.messageType())) - - if msg.hasElement(REASON): - # This can occur on SubscriptionFailure. - reason = msg.getElement(REASON) - if reason.elementDefinition().name() == ERROR_INFO: - print(" %s: %s" % ( - reason.getElement(CATEGORY).getValueAsString(), - reason.getElement(DESCRIPTION).getValueAsString())) - - if msg.hasElement(EXCEPTIONS): - # This can occur on SubscriptionStarted if at least - # one field is good while the rest are bad. - exceptions = msg.getElement(EXCEPTIONS) - for exInfo in exceptions.values(): - fieldId = exInfo.getElement(FIELD_ID) - reason = exInfo.getElement(REASON) - print(" %s: %s" % ( - fieldId.getValueAsString(), - reason.getElement(CATEGORY).getValueAsString())) - - def processSubscriptionDataEvent(self, event): - timeStamp = self.getTimeStamp() - print() - print("Processing SUBSCRIPTION_DATA") - for msg in event: - topic = msg.correlationIds()[0].value() - print("%s: %s - %s" % (timeStamp, topic, msg.messageType())) - for field in msg.asElement().elements(): - if field.numValues() < 1: - print(" %s is NULL" % field.name()) - continue - - # Assume all values are scalar. - print(" %s = %s" % (field.name(), - field.getValueAsString())) - - def processMiscEvents(self, event): - timeStamp = self.getTimeStamp() - for msg in event: - print("%s: %s" % (timeStamp, msg.messageType())) - - def processEvent(self, event, _session): - try: - if event.eventType() == blpapi.Event.SUBSCRIPTION_DATA: - return self.processSubscriptionDataEvent(event) - elif event.eventType() == blpapi.Event.SUBSCRIPTION_STATUS: - return self.processSubscriptionStatus(event) - else: - return self.processMiscEvents(event) - except blpapi.Exception as e: - print("Library Exception !!! %s" % e.description()) - return False - - -def parseCmdLine(): - parser = OptionParser(description="Retrieve realtime data.") - parser.add_option("-a", - "--ip", - dest="host", - help="server name or IP (default: %default)", - metavar="ipAddress", - default="localhost") - parser.add_option("-p", - dest="port", - type="int", - help="server port (default: %default)", - metavar="tcpPort", - default=8194) - parser.add_option("-t", - dest="topics", - help="topic name (default: IBM US Equity)", - metavar="topic", - action="append", - default=[]) - parser.add_option("-f", - dest="fields", - help="field to subscribe to (default: LAST_PRICE)", - metavar="field", - action="append", - default=[]) - parser.add_option("-o", - dest="options", - help="subscription options (default: empty)", - metavar="option", - action="append", - default=[]) - - options,_ = parser.parse_args() - - if not options.topics: - options.topics = ["IBM US Equity"] - - if not options.fields: - options.fields = ["LAST_PRICE"] - - return options - - -def main(): - options = parseCmdLine() - - # Fill SessionOptions - sessionOptions = blpapi.SessionOptions() - sessionOptions.setServerHost(options.host) - sessionOptions.setServerPort(options.port) - - print("Connecting to %s:%d" % (options.host, options.port)) - - eventHandler = SubscriptionEventHandler() - # Create a Session - session = blpapi.Session(sessionOptions, eventHandler.processEvent) - - # Start a Session - if not session.start(): - print("Failed to start session.") - return - - print("Connected successfully") - - service = "//blp/mktdata" - if not session.openService(service): - print("Failed to open %s service" % service) - return - - subscriptions = blpapi.SubscriptionList() - for t in options.topics: - topic = service - if not t.startswith("/"): - topic += "/" - topic += t - subscriptions.add(topic, options.fields, options.options, - blpapi.CorrelationId(t)) - - print("Subscribing...") - session.subscribe(subscriptions) - - try: - # Wait for enter key to exit application - print("Press ENTER to quit") - input() - finally: - # Stop the session - session.stop() - -if __name__ == "__main__": - print("SubscriptionWithEventHandlerExample") - try: - main() - except KeyboardInterrupt: - print("Ctrl+C pressed. Stopping...") - -__copyright__ = """ -Copyright 2012. Bloomberg Finance L.P. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: The above -copyright notice and this permission notice shall be included in all copies -or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/examples/ZfpOverLeasedLinesSessionExample.py b/examples/ZfpOverLeasedLinesSessionExample.py deleted file mode 100644 index 1183d14..0000000 --- a/examples/ZfpOverLeasedLinesSessionExample.py +++ /dev/null @@ -1,222 +0,0 @@ -# ZfpOverLeasedLinesSessionExample.py - -"""The example demonstrates how to establish a ZFP session that leverages -private leased line connectivity. To see how to use the resulting session -(authorizing a session, establishing subscriptions or making requests etc.), - please refer to the other examples. -""" - -from __future__ import absolute_import -from __future__ import print_function - -from argparse import ArgumentParser, Action - -import os -import platform as plat -import sys -if sys.version_info >= (3, 8) and plat.system().lower() == "windows": - # pylint: disable=no-member - with os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')): - import blpapi - from blpapi import AuthOptions, AuthUser -else: - import blpapi - from blpapi import AuthOptions, AuthUser - -class AuthOptionsAction(Action): # pylint: disable=too-few-public-methods - """Parse authorization args from user input""" - - def __call__(self, parser, args, values, option_string=None): - vals = values.split("=", 1) - - auth = None - if vals[0] == "none": - auth = None - elif vals[0] == "user": - user = AuthUser.createWithLogonName() - auth = AuthOptions.createWithUser(user) - elif vals[0] == "app" and len(vals) == 2: - appName = vals[1] - auth = AuthOptions.createWithApp(appName) - elif vals[0] == "userapp" and len(vals) == 2: - appName = vals[1] - user = AuthUser.createWithLogonName() - auth = AuthOptions.createWithUserAndApp(user, appName) - elif vals[0] == "dir" and len(vals) == 2: - dirProperty = vals[1] - user = AuthUser.createWithActiveDirectoryProperty(dirProperty) - auth = AuthOptions.createWithUser(user) - elif vals[0] == "manual": - parts = [] - if len(vals) == 2: - parts = vals[1].split(",") - - if len(parts) != 3: - raise ValueError("Invalid auth option '%s'" % values) - - appName, ipAddress, userId = parts - user = AuthUser.createWithManualOptions(userId, ipAddress) - auth = AuthOptions.createWithUserAndApp(user, appName) - else: - raise ValueError("Invalid auth option '%s'" % values) - - setattr(args, self.dest, auth) - -def parseCmdLine(): - """Parse command line arguments""" - - parser = ArgumentParser(description="Create a ZFP session.") - parser.add_argument("--zfp-over-leased-line", - dest="zfpPort", - help="enable ZFP connections over leased lines on the" - " specified port (8194 or 8196) " - "(default: %(default)s)", - type=int, - default=8194, - metavar="port") - parser.add_argument("--auth", - dest="auth", - help="authentication option: " - "user|none|app=|userapp=|dir=|" - "manual=" - " (default: none)\n" - "'none' is applicable to Desktop API product " - "that requires Bloomberg Professional service " - "to be installed locally.", - metavar="option", - action=AuthOptionsAction, - default=None) - - # TLS Options - parser.add_argument("--tls-client-credentials", - dest="tls_client_credentials", - help="name a PKCS#12 file to use as a source of " - "client credentials", - metavar="option") - parser.add_argument("--tls-client-credentials-password", - dest="tls_client_credentials_password", - help="specify password for accessing" - " client credentials", - metavar="option", - default="") - parser.add_argument("--tls-trust-material", - dest="tls_trust_material", - help="name a PKCS#7 file to use as a source of trusted" - " certificates", - metavar="option") - parser.add_argument("--read-certificate-files", - dest="read_certificate_files", - help="(optional) read the TLS files and pass the blobs", - action="store_true") - - args = parser.parse_args() - - args.tlsOptions = getTlsOptions(args) - - if not args.tlsOptions: - raise RuntimeError("ZFP connections require TLS parameters") - - if args.zfpPort == 8194: - args.remote = blpapi.ZfpUtil.REMOTE_8194 - elif args.zfpPort == 8196: - args.remote = blpapi.ZfpUtil.REMOTE_8196 - else: - raise RuntimeError("Invalid ZFP port: " + args.zfpPort) - - return args - -def getTlsOptions(args): - """Create TlsOptions from user input""" - - if (args.tls_client_credentials is None or - args.tls_trust_material is None): - return None - - print("TlsOptions enabled") - if args.read_certificate_files: - credential_blob = None - trust_blob = None - with open(args.tls_client_credentials, 'rb') as credentialfile: - credential_blob = credentialfile.read() - with open(args.tls_trust_material, 'rb') as trustfile: - trust_blob = trustfile.read() - return blpapi.TlsOptions.createFromBlobs( - credential_blob, - args.tls_client_credentials_password, - trust_blob) - - return blpapi.TlsOptions.createFromFiles( - args.tls_client_credentials, - args.tls_client_credentials_password, - args.tls_trust_material) - -def prepareZfpSessionOptions(args): - """Prepare SessionOptions for ZFP session""" - - print("Creating a ZFP connection for leased lines.") - sessionOptions = blpapi.ZfpUtil.getZfpOptionsForLeasedLines( - args.remote, - args.tlsOptions) - return sessionOptions - -def main(): - """Main function""" - - args = parseCmdLine() - - # Fill SessionOptions - sessionOptions = prepareZfpSessionOptions(args) - sessionOptions.setSessionIdentityOptions(args.auth) - sessionOptions.setAutoRestartOnDisconnection(True) - - numHosts = sessionOptions.numServerAddresses() - for i in range(0, numHosts): - (host, port) = sessionOptions.getServerAddress(i) - print("Connecting to port %d on %s" % (port, host)) - - session = blpapi.Session(sessionOptions) - - if not session.start(): - print("Failed to start session.") - while True: - event = session.tryNextEvent() - if not event: - break - - for msg in event: - print(msg) - return - - print("Session started successfully.") - - # Note: ZFP solution requires authorization, which should be done here - # before any subscriptions or requests can be made. For examples of - # how to authorize or get data, please refer to the specific examples. - -if __name__ == "__main__": - print("ZfpOverLeasedLinesSessionExample") - try: - main() - except KeyboardInterrupt: - print("Ctrl+C pressed. Stopping...") - -__copyright__ = """ -Copyright 2019. Bloomberg Finance L.P. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: The above -copyright notice and this permission notice shall be included in all copies -or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/examples/demoapps/ApiFieldsExample.py b/examples/demoapps/ApiFieldsExample.py new file mode 100644 index 0000000..0f64e41 --- /dev/null +++ b/examples/demoapps/ApiFieldsExample.py @@ -0,0 +1,137 @@ +from argparse import ArgumentParser, RawTextHelpFormatter + +from blpapi_import_helper import blpapi +from util.ConnectionAndAuthOptions import addConnectionAndAuthOptions, createSessionOptions + +from snippets.apiflds import CategorizedFieldSearchRequests +from snippets.apiflds import FieldInfoRequests +from snippets.apiflds import FieldListRequests +from snippets.apiflds import FieldSearchRequests + +APIFLDS_SVC = "//blp/apiflds" + +CATEGORIZED_FIELD_SEARCH_REQUEST = "CategorizedFieldSearchRequest" +FIELD_INFO_REQUEST = "FieldInfoRequest" +FIELD_LIST_REQUEST = "FieldListRequest" +FIELD_SEARCH_REQUEST = "FieldSearchRequest" + + +def createRequest(requestType, session): + """Sends a request based on the request type.""" + + apifldsService = session.getService(APIFLDS_SVC) + if requestType == CATEGORIZED_FIELD_SEARCH_REQUEST: + return CategorizedFieldSearchRequests.createRequest(apifldsService) + + if requestType == FIELD_INFO_REQUEST: + return FieldInfoRequests.createRequest(apifldsService) + + if requestType == FIELD_LIST_REQUEST: + return FieldListRequests.createRequest(apifldsService) + + if requestType == FIELD_SEARCH_REQUEST: + return FieldSearchRequests.createRequest(apifldsService) + + +def processResponse(requestType, event): + """Processes a response to the request.""" + + if requestType == CATEGORIZED_FIELD_SEARCH_REQUEST: + return CategorizedFieldSearchRequests.processResponse(event) + + if requestType == FIELD_INFO_REQUEST: + return FieldInfoRequests.processResponse(event) + + if requestType == FIELD_LIST_REQUEST: + return FieldListRequests.processResponse(event) + + if requestType == FIELD_SEARCH_REQUEST: + return FieldSearchRequests.processResponse(event) + + +def main(): + parser = ArgumentParser( + description="Retrieve API data fields", + formatter_class=RawTextHelpFormatter) + addConnectionAndAuthOptions(parser) + parser.add_argument("-r", + "--request", + dest="requestType", + help="API fields request type, choices are: %(choices)s", + required=True, + choices=[CATEGORIZED_FIELD_SEARCH_REQUEST, + FIELD_INFO_REQUEST, + FIELD_LIST_REQUEST, + FIELD_SEARCH_REQUEST], + metavar="requestType") + + options = parser.parse_args() + + sessionOptions = createSessionOptions(options) + + session = blpapi.Session(sessionOptions) + + try: + if not session.start(): + print("Failed to start session.") + return + + if not session.openService(APIFLDS_SVC): + print(f"Failed to open {APIFLDS_SVC}.") + return + + request = createRequest(options.requestType, session) + print(f"Sending Request: {request}") + session.sendRequest(request) + + done = False + while not done: + event = session.nextEvent() + eventType = event.eventType() + if eventType == blpapi.Event.REQUEST_STATUS: + for msg in event: + if msg.messageType() == blpapi.Names.REQUEST_FAILURE: + + # Request has failed, exit + print(msg) + done = True + break + elif eventType in [blpapi.Event.RESPONSE, + blpapi.Event.PARTIAL_RESPONSE]: + + processResponse(options.requestType, event) + + # Received the final response, no further response events are + # expected. + if eventType == blpapi.Event.RESPONSE: + done = True + finally: + session.stop() + + +if __name__ == "__main__": + try: + main() + except Exception as e: # pylint: disable=broad-except + print(e) + +__copyright__ = """ +Copyright 2021, Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above +copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/demoapps/BroadcastPublisherExample.py b/examples/demoapps/BroadcastPublisherExample.py new file mode 100644 index 0000000..b8b63ba --- /dev/null +++ b/examples/demoapps/BroadcastPublisherExample.py @@ -0,0 +1,234 @@ +from argparse import ArgumentParser, RawTextHelpFormatter + +from blpapi_import_helper import blpapi +from util.ConnectionAndAuthOptions import addConnectionAndAuthOptions, createSessionOptions +from util.MaxEventsOption import addMaxEventsOption + +from threading import Event +import time + +DEFAULT_MARKET_DATA_TOPIC = "IBM Equity" +DEFAULT_PAGE_TOPIC = "1245/4/5" + +class MyStream(object): + def __init__(self, sid=""): + self.id = sid + + +class MyEventHandler(object): + def __init__(self, stop): + self.stop = stop + + def processEvent(self, event, _session): + for msg in event: + print(msg) + if event.eventType() == blpapi.Event.SESSION_STATUS: + if msg.messageType() == blpapi.Names.SESSION_TERMINATED: + print("Received session terminated, stopping session") + self.stop.set() + continue + + +def parseCmdLine(): + parser = ArgumentParser(formatter_class=RawTextHelpFormatter, + description="Broadcast data publisher.") + + addConnectionAndAuthOptions(parser) + + publisher_group = parser.add_argument_group("Broadcast Publisher Options") + publisher_group.add_argument("-s", "--service", + dest="service", + help="the service name", + required=True, + metavar="service") + publisher_group.add_argument("-t", "--topic", + dest="topics", + help="topic to publish (default: " + f"{DEFAULT_MARKET_DATA_TOPIC}; or for page " + f"data {DEFAULT_PAGE_TOPIC})." + "Can be specified multiple times.", + metavar="topic", + action="append", + default=[]) + publisher_group.add_argument("-g", "--group-id", + dest="groupId", + metavar="groupId", + help="publisher groupId (default to an " + "automatically generated unique value)") + publisher_group.add_argument("-p", "--priority", + dest="priority", + metavar="priority", + type=int, + help="publisher's priority (default: %(default)d)", + default=blpapi.ServiceRegistrationOptions.PRIORITY_HIGH) + publisher_group.add_argument("--page", + dest="isPageData", + help="publish as page data", + action="store_true", + default=False) + + addMaxEventsOption(parser) + + options = parser.parse_args() + + if not options.topics: + options.topics = [DEFAULT_PAGE_TOPIC] if options.isPageData \ + else [DEFAULT_MARKET_DATA_TOPIC] + + return options + + +def formatMarketData(eventFormatter, topic): + # NOTE: This function demonstrates how to use `EventFormatter.fromPy` to + # format an `Event`. For an example of formatting an `Event` using the + # `Element`-based` interface of `EventFormatter`, see + # `InteractivePublisherExample.formatMarketDataEvent`. + MARKET_DATA_EVENTS = blpapi.Name("MarketDataEvents") + HIGH = blpapi.Name("HIGH") + LOW = blpapi.Name("LOW") + + eventFormatter.appendMessage(MARKET_DATA_EVENTS, topic) + + secondsStr = time.strftime("%S", time.localtime()) + seconds = int(secondsStr) + messageDict = { + HIGH: seconds * 1.0, + LOW: seconds * 0.5 + } + + eventFormatter.fromPy(messageDict) + +def formatPageData(eventFormatter, topic): + # NOTE: This function demonstrates how to use the `Element`-based interface + # of `EventFormatter` to format an `Event`. For an example of formatting an + # `Event` using `EventFormatter.fromPy`, see + # `InteractivePublisherExample.formatPageEvent`. + numRows = 5 + for i in range(1, numRows + 1): + eventFormatter.appendMessage("RowUpdate", topic) + eventFormatter.setElement("rowNum", i) + eventFormatter.pushElement("spanUpdate") + eventFormatter.appendElement() + eventFormatter.setElement("startCol", 1) + secondsStr = time.strftime("%S", time.localtime()) + eventFormatter.setElement("length", len(secondsStr)) + eventFormatter.setElement("text", secondsStr) + eventFormatter.popElement() + + eventFormatter.popElement() + +def main(): + options = parseCmdLine() + + stop = Event() + myEventHandler = MyEventHandler(stop) + + # Create a Session + sessionOptions = createSessionOptions(options) + session = blpapi.ProviderSession(sessionOptions, + myEventHandler.processEvent) + + # Start a Session + if not session.start(): + print("Failed to start session.") + return + + if options.groupId is not None: + # NOTE: perform explicit service registration here, instead + # of letting createTopics() do it, as the latter approach doesn't + # allow for custom ServiceRegistrationOptions. + serviceOptions = blpapi.ServiceRegistrationOptions() + serviceOptions.setGroupId(options.groupId) + serviceOptions.setServicePriority(options.priority) + if not session.registerService(options.service, + session.getAuthorizedIdentity(), + serviceOptions): + print(f"Failed to register {options.service}") + session.stop() + return + + topicList = blpapi.TopicList() + for topic in options.topics: + userTopic = topic + if userTopic and not userTopic.startswith("/"): + userTopic = "/" + userTopic + topicList.add(f"{options.service}{userTopic}", + blpapi.CorrelationId(MyStream(topic))) + + # createTopics() is synchronous, topicList will be updated with the + # results of topic creation (resolution will happen under the covers) + session.createTopics(topicList, + blpapi.ProviderSession.AUTO_REGISTER_SERVICES) + + streams = [] + for i in range(topicList.size()): + stream = topicList.correlationIdAt(i).value() + status = topicList.statusAt(i) + topicString = topicList.topicStringAt(i) + + if (status == blpapi.TopicList.CREATED): + print(f"Start publishing on topic: {topicString}") + stream.topic = session.getTopic(topicList.messageAt(i)) + streams.append(stream) + else: + print(f"Stream '{stream.id}': topic not created, status = {status}") + + service = session.getService(options.service) + + if not streams: + return + + try: + eventCount = 0 + + # Now we will start publishing + while not stop.is_set() and eventCount < options.maxEvents: + event = service.createPublishEvent() + eventFormatter = blpapi.EventFormatter(event) + + for stream in streams: + topic = stream.topic + if options.isPageData: + formatPageData(eventFormatter, topic) + else: + formatMarketData(eventFormatter, topic) + + print("Publishing event:") + for msg in event: + print(msg) + + session.publish(event) + eventCount += 1 + time.sleep(10) + finally: + # Stop the session + print("Stopping the session") + session.stop() + +if __name__ == "__main__": + print("BroadcastPublisherExample") + try: + main() + except Exception as e: # pylint: disable=broad-except + print(e) + +__copyright__ = """ +Copyright 2021, Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above +copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/demoapps/ContributionsExample.py b/examples/demoapps/ContributionsExample.py new file mode 100644 index 0000000..3b74e71 --- /dev/null +++ b/examples/demoapps/ContributionsExample.py @@ -0,0 +1,248 @@ +import time +from threading import Event +from argparse import ArgumentParser, RawTextHelpFormatter +from blpapi_import_helper import blpapi +from util.ConnectionAndAuthOptions import addConnectionAndAuthOptions, createSessionOptions +from util.MaxEventsOption import addMaxEventsOption + +MARKET_DATA = blpapi.Name("MarketData") +PAGE_DATA = blpapi.Name("PageData") +SESSION_TERMINATED = blpapi.Name("SessionTerminated") +BID = blpapi.Name("BID") +ASK = blpapi.Name("ASK") +ROW_UPDATE = blpapi.Name("rowUpdate") +ROW_NUM = blpapi.Name("rowNum") +SPAN_UPDATE = blpapi.Name("spanUpdate") +START_COL = blpapi.Name("startCol") +LENGTH = blpapi.Name("length") +TEXT = blpapi.Name("text") +ATTR = blpapi.Name("attr") +CONTRIBUTION_ID = blpapi.Name("contributorId") +PRODUCT_CODE = blpapi.Name("productCode") +PAGE_NUMBER = blpapi.Name("pageNumber") +DEFAULT_MKT_DATA_TOPIC = "/ticker/AUDEUR Curncy" +DEFAULT_PAGE_DATA_TOPIC = "/page/220/660/1" +DATETIME_FORMAT = "%m/%d/%Y %H:%M" + +class MyEventHandler(object): + """Event handler for the session""" + + def __init__(self, stop): + """ Construct a handler """ + self.stop = stop + + def processEvent(self, event, _sesssion): + """Process session event""" + + for msg in event: + print(msg) + if event.eventType() == blpapi.Event.SESSION_STATUS: + if msg.messageType() == SESSION_TERMINATED: + self.stop.set() + continue + +def parseCmdLine(): + """Parse command line arguments""" + + parser = ArgumentParser( + description="Contribute market or page data to a topic", + formatter_class=RawTextHelpFormatter) + addConnectionAndAuthOptions(parser) + addMaxEventsOption(parser) + + parser.add_argument("-s", + "--service", + dest="service", + help="service name (default: %(default)s)", + metavar="service", + default="//blp/mpfbapi") + parser.add_argument("-t", + "--topic", + dest="topic", + help=f"topic to contribute (mktdata default: '{DEFAULT_MKT_DATA_TOPIC}'" + f", page default: '{DEFAULT_PAGE_DATA_TOPIC}')", + metavar="topic") + + # Page contributions options + parser.add_argument("-P", + "--page", + dest="page_enabled", + action='store_true', + help="enable page contributions") + parser.add_argument("-C", + "--contribution-id", + dest="contributionId", + help="contributor id (default: %(default)d), ignored unless page is enabled", + metavar="contributionId", + type=int, + default=8563) + + options = parser.parse_args() + + if not options.topic: + options.topic = DEFAULT_MKT_DATA_TOPIC + if options.page_enabled: + options.topic = DEFAULT_PAGE_DATA_TOPIC + elif options.topic[0] != '/': + options.topic = f"/{options.topic}" + + return options + +def formatMktDataEvent(eventFormatter, topic, value): + """Format a Mktdata event. """ + eventFormatter.appendMessage(MARKET_DATA, topic) + eventFormatter.setElement(BID, 0.5 * value) + eventFormatter.setElement(ASK, value) + +def formatPageDataEvent(eventFormatter, topic, contributorId): + """Format a PageData event. """ + tm = time.strftime("%X") + messageDict = { + ROW_UPDATE: [ + { + ROW_NUM: 1, + SPAN_UPDATE: [ + { + START_COL: 20, + LENGTH: 4, + TEXT: "TEST" + }, + { + START_COL: 25, + LENGTH: 4, + TEXT: "PAGE" + }, + { + START_COL: 30, + LENGTH: len(tm), + TEXT: tm, + ATTR: "BLINK" + } + ] + }, + { + ROW_NUM: 2, + SPAN_UPDATE: [ + { + START_COL: 20, + LENGTH: 9, + TEXT: "---------", + ATTR: "UNDERLINE" + }, + ] + }, + { + ROW_NUM: 3, + SPAN_UPDATE: [ + { + START_COL: 10, + LENGTH: 9, + TEXT: "TEST LINE", + }, + { + START_COL: 23, + LENGTH: 5, + TEXT: "THREE", + }, + ] + } + ], + CONTRIBUTION_ID: contributorId, + PRODUCT_CODE: 1, + PAGE_NUMBER: 1, + } + + eventFormatter.appendMessage(PAGE_DATA, topic) + eventFormatter.fromPy(messageDict) + +def main(): + """Main function""" + + options = parseCmdLine() + + sessionOptions = createSessionOptions(options) + + stop = Event() + myEventHandler = MyEventHandler(stop) + + # Create a Session + session = blpapi.ProviderSession(sessionOptions, + myEventHandler.processEvent) + + try: + # Start a Session + if not session.start(): + print("Failed to start session.") + return + + topicList = blpapi.TopicList() + topicList.add(options.service + options.topic, + blpapi.CorrelationId(options.topic)) + + # Create topics + session.createTopics(topicList, + blpapi.ProviderSession.AUTO_REGISTER_SERVICES) + # createTopics() is synchronous, topicList will be updated + # with the results of topic creation (resolution will happen + # under the covers) + + status = topicList.statusAt(0) + + if status == blpapi.TopicList.CREATED: + topic = session.getTopic(topicList.messageAt(0)) + else: + print(f"Topic not resolved, status = {status}") + return + + service = session.getService(options.service) + + for i in range(int(options.maxEvents)): + if stop.is_set(): + break + + # Now we will start publishing + event = service.createPublishEvent() + eventFormatter = blpapi.EventFormatter(event) + + if options.page_enabled: + formatPageDataEvent( + eventFormatter, topic, options.contributionId) + else: + formatMktDataEvent(eventFormatter, topic, i) + + print(time.strftime("%X") + " -\nPublishing event: ") + for msg in event: + print(msg) + + session.publish(event) + time.sleep(10) + finally: + # Stop the session + session.stop() + +if __name__ == "__main__": + try: + main() + except Exception as e: # pylint: disable=broad-except + print(e) + +__copyright__ = """ +Copyright 2021, Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above +copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/demoapps/EntitlementsVerificationRequestResponseExample.py b/examples/demoapps/EntitlementsVerificationRequestResponseExample.py new file mode 100644 index 0000000..58de1ff --- /dev/null +++ b/examples/demoapps/EntitlementsVerificationRequestResponseExample.py @@ -0,0 +1,297 @@ +from argparse import ArgumentParser, RawTextHelpFormatter + +from blpapi_import_helper import blpapi +from blpapi import CorrelationId, Event, Name, Names, Session +from util.ConnectionAndAuthOptions import \ + addConnectionAndAuthOptions, \ + createClientServerSetupAuthOptions, \ + createSessionOptions +from util.events.SessionRouter import SessionRouter +from threading import Event as ThreadingEvent +from time import sleep + +REFDATA_SVC_NAME = "//blp/refdata" + +RESPONSE_ERROR = Name("responseError") +SECURITY_DATA = Name("securityData") +SECURITY = Name("security") +EID_DATA = Name("eidData") +ENTITLEMENT_CHANGED = Name("EntitlementChanged") + + +class EntitlementsVerificationRequestResponseExample: + + def __init__(self, options): + self._options = options + self._router = SessionRouter() + self._exampleStoppedThreadingEvent = ThreadingEvent() + self._identitiesByCorrelationId = {} + self._responses = [] + self._finalResponseReceived = False + + self._router.addExceptionHandler(self._handleException) + + self._router.addMessageHandlerByMessageType( + Names.SESSION_STARTED, self._handleSessionStarted) + self._router.addMessageHandlerByMessageType( + Names.SESSION_STARTUP_FAILURE, + self._handleSessionStartupFailure) + self._router.addMessageHandlerByMessageType( + Names.SESSION_TERMINATED, self._handleSessionTerminated) + + self._router.addMessageHandlerByMessageType( + Names.SERVICE_OPENED, self._handleServiceOpened) + self._router.addMessageHandlerByMessageType( + Names.SERVICE_OPEN_FAILURE, self._handleServiceOpenFailure) + self._router.addMessageHandlerByMessageType( + ENTITLEMENT_CHANGED, self._handleEntitlementChanged) + + @property + def stopped(self): + return self._exampleStoppedThreadingEvent.is_set() + + def createAndStartSession(self): + # Use the specified application as the session identity to + # authorize. This may cause the session to stop and the example + # to terminate if the identity is revoked. + sessionOptions = createSessionOptions(self._options) + session = Session(sessionOptions, self._router.processEvent) + session.startAsync() + + def _stop(self, session): + # Cancel all the authorized identities + session.cancel(self._identitiesByCorrelationId.keys()) + session.stopAsync() + + def _handleException(self, session, _2, exception): + print(exception) + self._stop(session) + + def _handleSessionStarted(self, session, _1, _2): + + # Add the authorization message handlers after the session + # started to only react to the authorization messages of users, + # i.e., avoid those of the session identity. + self._router.addMessageHandlerByMessageType( + Names.AUTHORIZATION_SUCCESS, + self._handleAuthorizationSuccess) + self._router.addMessageHandlerByMessageType( + Names.AUTHORIZATION_FAILURE, + self._handleAuthorizationFailure) + self._router.addMessageHandlerByMessageType( + Names.AUTHORIZATION_REVOKED, + self._handleAuthorizationRevoked) + + self._authorizeUsers(session) + self._openServices(session) + + def _handleSessionStartupFailure(self, _1, _2, _3): + print("Failed to start session. Exiting...") + self._exampleStoppedThreadingEvent.set() + + def _handleSessionTerminated(self, _1, _2, _3): + print("Session terminated. Exiting...") + self._exampleStoppedThreadingEvent.set() + + @staticmethod + def _openServices(session): + session.openServiceAsync(REFDATA_SVC_NAME) + + def _handleServiceOpened(self, session, _1, message): + serviceName = message["serviceName"] + service = session.getService(serviceName) + + if serviceName == REFDATA_SVC_NAME: + self._sendRefDataRequest(session, service) + return + + def _handleServiceOpenFailure(self, session, _1, message): + serviceName = message["serviceName"] + if serviceName == REFDATA_SVC_NAME: + print(f"Failed to open service '{serviceName}', stopping...") + self._stop(session) + return + + raise RuntimeError(f"A unknown service failed to open: {serviceName}") + + def _sendRefDataRequest(self, session, refDataService): + request = refDataService.createRequest("ReferenceDataRequest") + requestDict = { + "securities": self._options.securities, + "fields": ["PX_LAST", "DS002"], + "returnEids": True + } + + request.fromPy(requestDict) + + print(f"Sending RefDataRequest {request}") + correlationId = CorrelationId("example") + self._router.addMessageHandlerByCorrelationId( + correlationId, self._processResponseMessage) + session.sendRequest(request, correlationId=correlationId) + + def _processResponseMessage(self, session, event, message): + if message.messageType() == Names.REQUEST_FAILURE: + print("Request failed, stopping...") + self._stop(session) + return + + if event.eventType() == Event.PARTIAL_RESPONSE: + print("Received partial response") + + # Save the response + self._responses.append(event) + elif event.eventType() == Event.RESPONSE: + print("Received final response") + self._finalResponseReceived = True + + # Save the response + self._responses.append(event) + + # Distributes all the cached responses to the identities that have + # been authorized so far. + for correlationId, identity in self._identitiesByCorrelationId.items(): + userIdentifier = correlationId.value() + self._distributeResponses(userIdentifier, identity) + + def _authorizeUsers(self, session): + # Authorize each of the users + authOptionsByIdentifier = createClientServerSetupAuthOptions( + self._options) + for userIdentifier, authOptions in authOptionsByIdentifier.items(): + correlationId = blpapi.CorrelationId(userIdentifier) + session.generateAuthorizedIdentity(authOptions, correlationId) + + def _handleAuthorizationSuccess(self, session, _1, message): + correlationId = message.correlationId() + userIdentifier = correlationId.value() + print(f"Successfully authorized {userIdentifier}") + identity = session.getAuthorizedIdentity(correlationId) + self._identitiesByCorrelationId[correlationId] = identity + + if self._finalResponseReceived: + self._distributeResponses(userIdentifier, identity) + + def _handleAuthorizationFailure(self, _1, _2, message): + correlationId = message.correlationId() + self._router.removeMessageHandlerByCorrelationId(correlationId) + + userIdentifier = correlationId.value() + print(f"Failed to authorize {userIdentifier}") + + def _handleAuthorizationRevoked(self, _1, _2, message): + correlationId = message.correlationId() + self._router.removeMessageHandlerByCorrelationId(correlationId) + + userIdentifier = correlationId.value() + print(f"Authorization revoked for {userIdentifier}") + + # Remove the identity + self._identitiesByCorrelationId.pop(correlationId, None) + + def _handleEntitlementChanged(self, _1, _2, message): + # This is just informational. Continue to use existing identity. + correlationId = message.correlationId() + userIdentifier = correlationId.value() + print(f"Entitlements updated for {userIdentifier}") + + def _distributeResponses(self, userIdentifier, identity): + for event in self._responses: + self._distributeResponse(event, userIdentifier, identity) + + def _distributeResponse(self, event, userIdentifier, identity): + + for msg in event: + if msg.hasElement(RESPONSE_ERROR, excludeNullElements=True): + continue + + service = msg.service() + securityDataElement = msg[SECURITY_DATA] + + print(f"Processing {securityDataElement.numValues()} securities:") + for securityData in securityDataElement: + ticker = securityData[SECURITY] + + if securityData.hasElement(EID_DATA, excludeNullElements=True): + # Entitlements are required to access this data + entitlements = securityData[EID_DATA] + + entitled, failedEntitlements = identity.getFailedEntitlements( + service, + entitlements) + if entitled: + print(f"{userIdentifier} is entitled to get data " + f"for: {ticker}") + + # Now Distribute message to the user. + else: + print(f"{userIdentifier} is NOT entitled to get " + f"data for: {ticker} - Failed EIDs: {failedEntitlements}") + else: + print(f"No entitlements are required for: {ticker}") + + # Now Distribute message to the user. + + +def parseCmdLine(): + parser = ArgumentParser( + description="Entitlements Verification Request/Response Example", + formatter_class=RawTextHelpFormatter) + addConnectionAndAuthOptions(parser, forClientServerSetup=True) + + parser.add_argument("-S", "--security", + dest="securities", + help="security used in ReferenceDataRequest (default:" + " IBM US Equity). Can be specified multiple times", + metavar="security", + action="append", + default=[]) + + options = parser.parse_args() + + if not options.securities: + options.securities.append("IBM US Equity") + + if not options.userIdAndIps and not options.tokens: + parser.error("No userId:IP or token specified") + + return options + + +def main(): + options = parseCmdLine() + + example = EntitlementsVerificationRequestResponseExample(options) + example.createAndStartSession() + + # The main thread is not blocked and the example is running asynchronously. + while not example.stopped: + sleep(1) + + +if __name__ == "__main__": + try: + main() + except Exception as e: # pylint: disable=broad-except + print(e) + +__copyright__ = """ +Copyright 2021, Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above +copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/demoapps/EntitlementsVerificationSubscriptionExample.py b/examples/demoapps/EntitlementsVerificationSubscriptionExample.py new file mode 100644 index 0000000..33a040a --- /dev/null +++ b/examples/demoapps/EntitlementsVerificationSubscriptionExample.py @@ -0,0 +1,262 @@ +from argparse import ArgumentParser, RawTextHelpFormatter +from threading import Event as ThreadingEvent +import time + +from blpapi_import_helper import blpapi +from blpapi import AbstractSession, Message, Name, Names, Session +from util.ConnectionAndAuthOptions import \ + addConnectionAndAuthOptions, \ + createClientServerSetupAuthOptions, \ + createSessionOptions +from util.SubscriptionOptions import \ + addSubscriptionOptions, \ + createSubscriptionList +from util.events.SessionRouter import SessionRouter + + +EID = Name("EID") +ENTITLEMENT_CHANGED = Name("EntitlementChanged") + + +def parseCmdLine(): + parser = ArgumentParser( + formatter_class=RawTextHelpFormatter, + description="Entitlements verification subscription example") + addConnectionAndAuthOptions(parser, forClientServerSetup=True) + addSubscriptionOptions(parser) + + options = parser.parse_args() + + if not options.userIdAndIps and not options.tokens: + parser.error("No userId:IP or token specified") + + if str(EID) not in options.fields: + options.fields.append(str(EID)) + + return options + + +class EntitlementsVerificationSubscriptionExample: + + def __init__(self, options): + self._options = options + self._router = SessionRouter() + self._exampleStoppedThreadingEvent = ThreadingEvent() + self._identitiesByCorrelationId = {} + self._session = None + + self._router.addExceptionHandler(self._handleException) + + self._router.addMessageHandlerByMessageType(Names.SESSION_STARTED, + self._handleSessionStarted) + self._router.addMessageHandlerByMessageType(Names.SESSION_STARTUP_FAILURE, + self._handleSessionStartupFailure) + self._router.addMessageHandlerByMessageType(Names.SESSION_TERMINATED, + self._handleSessionTerminated) + self._router.addMessageHandlerByMessageType(Names.SERVICE_OPENED, + self._handleServiceOpened) + self._router.addMessageHandlerByMessageType(Names.SERVICE_OPEN_FAILURE, + self._handleServiceOpenFailure) + self._router.addMessageHandlerByMessageType(Name("EntitlementChanged"), + self._handleEntitlementChanged) + + @property + def stopped(self): + return self._exampleStoppedThreadingEvent.is_set() + + def run(self): + self._createAndStartSession() + + def _createAndStartSession(self): + # Use the specified application as the session identity to authorize. + # This may cause the session to stop and the example to terminate if + # the identity is revoked. + sessionOptions = createSessionOptions(self._options) + self._session = Session(sessionOptions, self._router.processEvent) + self._session.startAsync() + + def _openServices(self): + self._session.openServiceAsync(self._options.service) + + def _authorizeUsers(self): + # Authorize each of the users + authOptionsByIdentifier = \ + createClientServerSetupAuthOptions(self._options) + + for identifier, authOptions in authOptionsByIdentifier.items(): + cid = blpapi.CorrelationId(identifier) + self._session.generateAuthorizedIdentity(authOptions, cid) + + def _subscribe(self): + self._router.addMessageHandlerByEventType(blpapi.Event.SUBSCRIPTION_DATA, + self._handleSubscriptionData) + self._router.addMessageHandlerByMessageType(Names.SUBSCRIPTION_FAILURE, + self._handleSubscriptionFailure) + self._router.addMessageHandlerByMessageType(Names.SUBSCRIPTION_TERMINATED, + self._handleSubscriptionTerminated) + + print("Subscribing...") + subscriptionList = createSubscriptionList(self._options) + self._session.subscribe(subscriptionList) + + def _handleException(self, _1, _2, exception: Exception): + print(exception) + self._stop() + + def _handleSessionStarted(self, *_): + # Add the authorization messages handlers after the session + # started to only react to the authorization messages of users, + # i.e., avoid those of the session identity. + self._router.addMessageHandlerByMessageType(Names.AUTHORIZATION_SUCCESS, + self._handleAuthorizationSuccess) + self._router.addMessageHandlerByMessageType(Names.AUTHORIZATION_FAILURE, + self._handleAuthorizationFailure) + self._router.addMessageHandlerByMessageType(Names.AUTHORIZATION_REVOKED, + self._handleAuthorizationRevoked) + + self._authorizeUsers() + self._openServices() + + def _handleSessionStartupFailure(self, *_): + print("Failed to start session. Exiting...") + self._exampleStoppedThreadingEvent.set() + + def _handleSessionTerminated(self, *_): + print("Session terminated. Exiting...") + self._exampleStoppedThreadingEvent.set() + + def _handleServiceOpened(self, _1, _2, message: Message): + serviceName = message.getElementAsString("serviceName") + if serviceName == self._options.service: + self._subscribe() + else: + print(f"A service was opened: {serviceName}") + + def _stop(self): + # Cancel all the authorized identities + self._session.cancel(list(self._identitiesByCorrelationId.keys())) + + try: + self._session.stopAsync() + except InterruptedError as exc: + print(exc) + + def _handleServiceOpenFailure(self, _1, _2, message: Message): + serviceName = message.getElementAsString("serviceName") + if serviceName == self._options.service: + self._stop() + else: + raise Exception(f"A service which is unknown failed to open: {serviceName}") + + @staticmethod + def _handleEntitlementChanged(_1, _2, message: Message): + # This is just informational. Continue to use existing identity. + correlationId = message.correlationId() + userIdentifier = correlationId.value() + print(f"Entitlements updated for {userIdentifier}") + + def _handleSubscriptionData(self, _1, _2, message: Message): + topic = message.correlationId().value() + + service = message.service() + + if message.hasElement(EID, excludeNullElements=True): + entitlements = message.getElement(EID) + + for cid, identity in self._identitiesByCorrelationId.items(): + userIdentifier = cid.value() + isAuthorizedForAllEntitlements, failedEntitlements = \ + identity.getFailedEntitlements(service, entitlements) + if isAuthorizedForAllEntitlements: + print(f"{userIdentifier} is entitled to get data for: {topic}") + + # Now distribute the message to the user. + else: + print(f"{userIdentifier} is NOT entitled to get data for: " + f"{topic} - Failed eids: {failedEntitlements}") + + else: + print(f"No entitlements are required for: {topic}") + + # Now distribute the message to the authorized users. + + print() + + @staticmethod + def _handleSubscriptionFailure(_1, _2, message: Message): + topic = message.correlationId().value() + print(f"Subscription failed: {topic}") + + @staticmethod + def _handleSubscriptionTerminated(_1, _2, message: Message): + topic = message.correlationId().value() + print(f"Subscription terminated: {topic}") + + def _handleAuthorizationSuccess(self, + session: AbstractSession, + _, + message: Message): + correlationId = message.correlationId() + userIdentifier = correlationId.value() + print(f"Successfully authorized {userIdentifier}") + identity = session.getAuthorizedIdentity(correlationId) + self._identitiesByCorrelationId[correlationId] = identity + + # Deliver init paint to the user. For the purpose of simplicity, + # this example doesn't maintain an init paint cache. + + def _handleAuthorizationFailure(self, _1, _2, message: Message): + correlationId = message.correlationId() + self._router.removeMessageHandlerByCorrelationId(correlationId) + + userIdentifier = correlationId.value() + print(f"Failed to authorize {userIdentifier}") + + def _handleAuthorizationRevoked(self, _1, _2, message: Message): + correlationId = message.correlationId() + self._router.removeMessageHandlerByCorrelationId(correlationId) + + userIdentifier = correlationId.value() + print(f"Authorization revoked for {userIdentifier}: {message}") + + # Remove the identity + del self._identitiesByCorrelationId[correlationId] + + +def main(): + options = parseCmdLine() + + example = EntitlementsVerificationSubscriptionExample(options) + example.run() + + # The main thread is not blocked while the example runs asynchronously. + while not example.stopped: + time.sleep(1) + + +if __name__ == "__main__": + try: + main() + except Exception as e: # pylint: disable=broad-except + print(e) + +__copyright__ = """ +Copyright 2021, Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above +copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/demoapps/GenerateTokenExample.py b/examples/demoapps/GenerateTokenExample.py new file mode 100644 index 0000000..6cecae5 --- /dev/null +++ b/examples/demoapps/GenerateTokenExample.py @@ -0,0 +1,135 @@ +from argparse import Action, ArgumentParser, RawTextHelpFormatter + +from blpapi_import_helper import blpapi + +AUTH_USER = "AuthenticationType=OS_LOGON" +AUTH_APP_PREFIX = "AuthenticationMode=APPLICATION_ONLY;ApplicationAuthenticationType=APPNAME_AND_KEY;ApplicationName=" +AUTH_USER_APP_PREFIX = "AuthenticationMode=USER_AND_APPLICATION;AuthenticationType=OS_LOGON;ApplicationAuthenticationType=APPNAME_AND_KEY;ApplicationName=" +AUTH_DIR_PREFIX = "AuthenticationType=DIRECTORY_SERVICE;DirSvcPropertyName=" + +AUTH_OPTION_USER = "user" +AUTH_OPTION_APP = "app" +AUTH_OPTION_USER_APP = "userapp" +AUTH_OPTION_DIR = "dir" + + +class AuthOptionsAction(Action): + """The action that parses authorization options from user input""" + + def __call__(self, parser, args, values, option_string=None): + vals = values.split('=', 1) + + if vals[0] == AUTH_OPTION_USER: + authOptions = AUTH_USER + elif vals[0] == AUTH_OPTION_APP and len(vals) == 2: + appName = vals[1] + authOptions = f"{AUTH_APP_PREFIX}{appName}" + elif vals[0] == AUTH_OPTION_USER_APP and len(vals) == 2: + appName = vals[1] + authOptions = f"{AUTH_USER_APP_PREFIX}{appName}" + elif vals[0] == AUTH_OPTION_DIR and len(vals) == 2: + dirProperty = vals[1] + authOptions = f"{AUTH_DIR_PREFIX}{dirProperty}" + else: + parser.error(f"Invalid auth option '{values}'") + + setattr(args, self.dest, authOptions) + + +def parseCmdLine(): + """Parse command line arguments""" + + parser = ArgumentParser( + description="Generate a token for a user to be used on the server side", + formatter_class=RawTextHelpFormatter) + parser.add_argument("-H", + "--host", + required=True, + dest="ipAndPort", + help="Server name or IP and port separated by ':'", + metavar="host:port") + parser.add_argument("-a", + "--auth", + required=True, + dest="authOptions", + help="Authentication option: \n" + " user as a user using OS logon information\n" + " dir= as a user using directory services\n" + " app= as the specified application\n" + " userapp= as user and application using logon information for the user\n", + metavar="option", + action=AuthOptionsAction) + + options = parser.parse_args() + + ipAndPort = options.ipAndPort.split(':') + if len(ipAndPort) != 2: + parser.error(f"Invalid host '{options.ipAndPort}'") + + options.host = ipAndPort[0] + options.port = ipAndPort[1] + + return options + + +def main(): + options = parseCmdLine() + + sessionOptions = blpapi.SessionOptions() + sessionOptions.setServerHost(options.host) + sessionOptions.setServerPort(int(options.port)) + sessionOptions.setAuthenticationOptions(options.authOptions) + + print(f"Connecting to {options.host}:{options.port}") + session = blpapi.Session(sessionOptions) + try: + if not session.start(): + print("Failed to start session.") + return + + session.generateToken() + + while True: + event = session.nextEvent() + if event.eventType() != blpapi.Event.TOKEN_STATUS: + continue + + for msg in event: + msgType = msg.messageType() + if msgType == blpapi.Names.TOKEN_GENERATION_SUCCESS: + token = msg.getElementAsString("token") + print(f"Token is successfully generated: {token}") + elif msgType == blpapi.Names.TOKEN_GENERATION_FAILURE: + print(f"Failed to generate token: {msg}") + + break + finally: + session.stop() + + +if __name__ == "__main__": + try: + main() + except Exception as e: # pylint: disable=broad-except + print(e) + +__copyright__ = """ +Copyright 2021, Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above +copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/demoapps/InteractivePublisherExample.py b/examples/demoapps/InteractivePublisherExample.py new file mode 100644 index 0000000..685fb80 --- /dev/null +++ b/examples/demoapps/InteractivePublisherExample.py @@ -0,0 +1,446 @@ +from argparse import ArgumentParser, RawTextHelpFormatter + +from blpapi_import_helper import blpapi +from util.ConnectionAndAuthOptions import addConnectionAndAuthOptions, \ + createSessionOptions +import threading +import time + +RESOLVED_TOPIC = blpapi.Name("resolvedTopic") +TOPICS = blpapi.Name("topics") + + +class MyEventHandler(object): + def __init__(self, + serviceName, + eids, + resolveSubServiceCode, + mutex, + stop, + condition, + isPageData): + self.serviceName = serviceName + self.eids = eids + self.resolveSubServiceCode = resolveSubServiceCode + self.mutex = mutex + self.stop = stop + self.condition = condition + self.activeTopics = [] + self.isPageData = isPageData + + def processEvent(self, event, session): + eventType = event.eventType() + if eventType == blpapi.Event.SESSION_STATUS: + for msg in event: + print(msg) + if msg.messageType() == blpapi.Names.SESSION_TERMINATED: + print("Received session terminated, stopping session") + self.stop.set() + break + + elif eventType == blpapi.Event.TOPIC_STATUS: + self.processTopicStatusEvent(session, event) + + elif eventType == blpapi.Event.RESOLUTION_STATUS: + for msg in event: + print(msg) + + if msg.messageType() == blpapi.Names.RESOLUTION_SUCCESS: + resolvedTopic = msg.getElementAsString(RESOLVED_TOPIC) + print(f"ResolvedTopic: {resolvedTopic}") + elif msg.messageType() == blpapi.Names.RESOLUTION_FAILURE: + print("Topic resolution failed " + f"(CorrelationId = {msg.correlationId()})") + + elif eventType == blpapi.Event.REQUEST: + for msg in event: + print(msg) + + if msg.messageType() == blpapi.Names.PERMISSION_REQUEST: + self.processPermissionRequest(session, msg) + else: + for msg in event: + print(msg) + + return True + + def processTopicStatusEvent(self, session, event): + topicsToCreate = blpapi.TopicList() + unsubscribedTopics = [] + for msg in event: + print(msg) + msgType = msg.messageType() + topic = session.getTopic(msg) + + if msgType == blpapi.Names.TOPIC_SUBSCRIBED: + if not topic.isValid(): + # Add the topic contained in the message to TopicList + topicsToCreate.add(msg) + + elif msgType == blpapi.Names.TOPIC_UNSUBSCRIBED: + unsubscribedTopics.append(topic) + with self.mutex: + self.activeTopics.remove(topic) + + elif msgType == blpapi.Names.TOPIC_ACTIVATED: + with self.mutex: + self.activeTopics.append(topic) + self.condition.notifyAll() + + elif msgType == blpapi.Names.TOPIC_RECAP: + # Here we send a recap in response to a Recap request. + service = topic.service() + correlationId = msg.correlationId() + recapEvent = service.createPublishEvent() + eventFormatter = blpapi.EventFormatter(recapEvent) + eventFormatter.appendRecapMessage(topic, correlationId) + + if self.isPageData: + formatPageRecapEvent(eventFormatter) + else: + formatMarketDataRecapEvent(eventFormatter) + + session.publish(recapEvent) + print("Published recap event:") + for recapMsg in recapEvent: + print(recapMsg) + + if topicsToCreate.size() > 0: + # createTopicsAsync will result in RESOLUTION_SUCCESS and + # TOPIC_CREATED messages. + session.createTopicsAsync(topicsToCreate) + + # Delete all the unsubscribed topics. + if len(unsubscribedTopics) > 0: + session.deleteTopics(unsubscribedTopics) + + + def processPermissionRequest(self, session, msg): + service = session.getService(self.serviceName) + + # Similar to createPublishEvent. We assume just one + # service - self.serviceName. A responseEvent can only be + # for single request so we can specify the correlationId - + # which establishes context - when we create the Event. + response = service.createResponseEvent(msg.correlationId()) + permission = 1 # ALLOWED: 0, DENIED: 1 + ef = blpapi.EventFormatter(response) + if msg.hasElement("uuid"): + msg.getElementAsInteger("uuid") + permission = 0 + if msg.hasElement("applicationId"): + msg.getElementAsInteger("applicationId") + permission = 0 + + # In appendResponse the string is the name of the + # operation, the correlationId indicates which request we + # are responding to. + ef.appendResponse("PermissionResponse") + ef.pushElement("topicPermissions") + + # For each of the topics in the request, add an entry to + # the response. + topicsElement = msg.getElement(TOPICS).values() + for topic in topicsElement: + ef.appendElement() + ef.setElement("topic", topic) + if self.resolveSubServiceCode: + try: + ef.setElement("subServiceCode", + self.resolveSubServiceCode) + print(f"Mapping topic {topic} to subServiceCode" + f" {self.resolveSubServiceCode}") + except blpapi.Exception: + print("subServiceCode could not be set." + " Resolving without subServiceCode") + ef.setElement("result", permission) + if permission == 1: # DENIED + ef.pushElement("reason") + ef.setElement("source", "My Publisher Name") + ef.setElement("category", "NOT_AUTHORIZED") + ef.setElement("subcategory", "Publisher Controlled") + ef.setElement("description", + "Permission denied by My Publisher Name") + ef.popElement() + elif self.eids: + ef.pushElement("permissions") + ef.appendElement() + ef.setElement("permissionService", "//blp/blpperm") + ef.pushElement("eids") + for eid in self.eids: + ef.appendValue(eid) + ef.popElement() + ef.popElement() + ef.popElement() + ef.popElement() + ef.popElement() + + # Service is implicit in the Event. sendResponse has a second parameter + # - partialResponse - that defaults to false. + session.sendResponse(response) + +def formatPageRecapEvent(eventFormatter): + numRows = 5 + eventFormatter.setElement("numRows", numRows) + eventFormatter.setElement("numCols", 80) + eventFormatter.pushElement("rowUpdate") + + for i in range(1, numRows + 1): + eventFormatter.appendElement() + eventFormatter.setElement("rowNum", i) + eventFormatter.pushElement("spanUpdate") + eventFormatter.appendElement() + eventFormatter.setElement("startCol", 1) + eventFormatter.setElement("length", 10) + eventFormatter.setElement("text", "RECAP") + eventFormatter.popElement() + eventFormatter.popElement() + eventFormatter.popElement() + + eventFormatter.popElement() + +def formatMarketDataRecapEvent(eventFormatter): + eventFormatter.setElement("OPEN", 100.0) + + +def parseCmdLine(): + parser = ArgumentParser(formatter_class=RawTextHelpFormatter, + description="Interactive data publisher.") + addConnectionAndAuthOptions(parser) + + publisher_group = parser.add_argument_group("Publisher Options") + publisher_group.add_argument("-s", "--service", + dest="service", + help="the service name", + required=True, + metavar="service") + publisher_group.add_argument("-g", "--group-id", + dest="groupId", + help="the group ID of the service, default to an " + "automatically generated unique value", + metavar="groupId") + publisher_group.add_argument("-p", "--priority", + type=int, + dest="priority", + help="the service priority (default: %(default)s)", + metavar="priority", + default=blpapi.ServiceRegistrationOptions.PRIORITY_HIGH) + publisher_group.add_argument("--register-ssc", + dest="ssc", + help="specify active sub-service code range and " + "priority separated by ','", + metavar="begin,end,priority") + publisher_group.add_argument("--clear-cache", + type=int, + dest="clearInterval", + help="number of events after which cache will be " + "cleared (default: 0 i.e cache never cleared)", + metavar="eventCount", + default=0) + publisher_group.add_argument("--resolve-ssc", + dest="rssc", + type=int, + help="sub-service code to be used in permission response", + metavar="subServiceCode") + publisher_group.add_argument("-E", "--eid", + dest="eids", + type=int, + help="EIDs that are used in permission response. Can be specified multiple times.", + metavar="eid", + action="append", + default=[]) + publisher_group.add_argument("-P", "--page", + dest="isPageData", + help="publish as page data", + action="store_true", + default=False) + + options = parser.parse_args() + + # Parse sub-service code range and priority + if options.ssc: + options.sscBegin, options.sscEnd, options.sscPriority = map( + int, options.ssc.split(",")) + + return options + + +def activate(options, session): + if options.ssc: + print("Activating sub service code range [" + f"{options.sscBegin}, {options.sscEnd}] @ {options.sscPriority}") + session.activateSubServiceCodeRange(options.service, + options.sscBegin, + options.sscEnd, + options.sscPriority) + + +def deactivate(options, session): + if options.ssc: + print("Deactivating sub service code range [" + f"{options.sscBegin}, {options.sscEnd}] @ {options.sscPriority}") + session.deactivateSubServiceCodeRange(options.service, + options.sscBegin, + options.sscEnd) + + +def main(): + options = parseCmdLine() + + mutex = threading.Lock() + stop = threading.Event() + condition = threading.Condition(mutex) + + myEventHandler = MyEventHandler(options.service, + options.eids, + options.rssc, + mutex, + stop, + condition, + options.isPageData) + + sessionOptions = createSessionOptions(options) + session = blpapi.ProviderSession(sessionOptions, + myEventHandler.processEvent) + + if not session.start(): + print("Failed to start session.") + return + + serviceOptions = blpapi.ServiceRegistrationOptions() + if options.groupId is not None: + serviceOptions.setGroupId(options.groupId) + serviceOptions.setServicePriority(options.priority) + + if options.ssc: + print("Adding active sub-service code range [" + f"{options.sscBegin}, {options.sscEnd}] @ {options.sscPriority}") + try: + serviceOptions.addActiveSubServiceCodeRange(options.sscBegin, + options.sscEnd, + options.sscPriority) + except blpapi.Exception as exception: + print("FAILED to add active sub-service codes." + f" Exception {exception.description()}") + + try: + if not session.registerService(options.service, + session.getAuthorizedIdentity(), + serviceOptions): + print(f"Failed to register '{options.service}'") + return + + service = session.getService(options.service) + eventCount = 0 + while not stop.is_set(): + with condition: + if not condition.wait_for( + lambda: len(myEventHandler.activeTopics) > 0, + timeout=1): + continue + + publishNull = False + if options.clearInterval > 0 \ + and eventCount == options.clearInterval: + eventCount = 0 + publishNull = True + + event = service.createPublishEvent() + eventFormatter = blpapi.EventFormatter(event) + + with mutex: + for topic in myEventHandler.activeTopics: + if options.isPageData: + formatPageEvent(eventFormatter, topic, publishNull) + else: + formatMarketDataEvent(eventFormatter, topic, publishNull) + + print("Publishing event:") + for msg in event: + print(msg) + + session.publish(event) + time.sleep(10) + eventCount += 1 + if eventCount % 10 == 0: + deactivate(options, session) + time.sleep(30) + activate(options, session) + + finally: + print("Stopping the session") + session.stop() + +def formatMarketDataEvent(eventFormatter, topic, publishNull): + # NOTE: This function demonstrates how to use the `Element`-based interface + # of `EventFormatter` to format an `Event`. For an example of formatting an + # `Event` using `EventFormatter.fromPy`, see + # `BroadcastPublisherExample.formatMarketData`. + MARKET_DATA_EVENTS = blpapi.Name("MarketDataEvents") + HIGH = blpapi.Name("HIGH") + LOW = blpapi.Name("LOW") + + eventFormatter.appendMessage(MARKET_DATA_EVENTS, topic) + if publishNull: + eventFormatter.setElementNull(HIGH) + eventFormatter.setElementNull(LOW) + else: + secondsStr = time.strftime("%S", time.localtime()) + seconds = int(secondsStr) + eventFormatter.setElement(HIGH, seconds * 1.0) + eventFormatter.setElement(LOW, seconds * 0.5) + + +def formatPageEvent(eventFormatter, topic, publishNull): + # NOTE: This function demonstrates how to use `EventFormatter.fromPy` to + # format an `Event`. For an example of formatting an `Event` using the + # `Element`-based` interface of `EventFormatter`, see + # `BroadcastPublisherExample.formatPageData`. + numRows = 5 + for i in range(1, numRows + 1): + eventFormatter.appendMessage("RowUpdate", topic) + + secondsStr = time.strftime("%S", time.localtime()) + messageDict = { + "rowNum": i + } + if publishNull: + messageDict["spanUpdate"] = {} + else: + messageDict["spanUpdate"] = [ + { + "startCol": 1, + "length": len(secondsStr), + "text": secondsStr, + } + ] + + eventFormatter.fromPy(messageDict) + + +if __name__ == "__main__": + try: + main() + except Exception as e: # pylint: disable=broad-except + print(e) + +__copyright__ = """ +Copyright 2021, Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above +copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/demoapps/MultipleRequestsOverrideExample.py b/examples/demoapps/MultipleRequestsOverrideExample.py new file mode 100644 index 0000000..3ca9536 --- /dev/null +++ b/examples/demoapps/MultipleRequestsOverrideExample.py @@ -0,0 +1,119 @@ +from blpapi_import_helper import blpapi + +from util.ConnectionAndAuthOptions import addConnectionAndAuthOptions, createSessionOptions +from snippets.requestresponse import ReferenceDataRequests +from util.RequestOptions import Override, REFDATA_SERVICE +from collections import namedtuple +from argparse import ArgumentParser, RawTextHelpFormatter + + +def main(): + + parser = ArgumentParser(formatter_class=RawTextHelpFormatter, + description="Multiple requests with override example") + addConnectionAndAuthOptions(parser) + options = parser.parse_args() + + sessionOptions = createSessionOptions(options) + session = blpapi.Session(sessionOptions) + + try: + if not session.start(): + print("Failed to connect!") + return + + if not session.openService(REFDATA_SERVICE): + print(f"Failed to open {REFDATA_SERVICE}") + return + + service = session.getService(REFDATA_SERVICE) + + fieldIdVwapStartTime = "VWAP_START_TIME" + fieldIdVwapEndTime = "VWAP_END_TIME" + + Options = namedtuple('Options', ['securities', 'fields', 'overrides']) + + # Request 1 + startTime1 = "9:30" + endTime1 = "11:30" + + options = Options(["IBM US Equity", "MSFT US Equity"], + ["PX_LAST", "DS002"], + [Override(fieldIdVwapStartTime, startTime1), + Override(fieldIdVwapEndTime, endTime1)]) + + request1 = ReferenceDataRequests.createRequest(service, options) + + print(f"Sending request 1: {request1}") + correlationId1 = blpapi.CorrelationId("request 1") + session.sendRequest(request1, correlationId=correlationId1) + + # Request 2 + startTime2 = "11:30" + endTime2 = "13:30" + + options.overrides.clear() + options.overrides.append(Override(fieldIdVwapStartTime, startTime2)) + options.overrides.append(Override(fieldIdVwapEndTime, endTime2)) + request2 = ReferenceDataRequests.createRequest(service, options) + + print(f"Sending request 2: {request2}") + correlationId2 = blpapi.CorrelationId("request 2") + session.sendRequest(request2, correlationId=correlationId2) + + # Wait for responses for both requests, expect 2 final responses + # either failure or success. + finalResponseCount = 0 + while finalResponseCount < 2: + event = session.nextEvent() + eventType = event.eventType() + for msg in event: + msgCorrelationId = msg.correlationId() + if eventType == blpapi.Event.REQUEST_STATUS: + if msg.messageType() == blpapi.Names.REQUEST_FAILURE: + if correlationId1 == msgCorrelationId: + print("Request 1 failed.") + elif correlationId2 == msgCorrelationId: + print("Request 2 failed.") + + finalResponseCount += 1 + elif eventType in [blpapi.Event.RESPONSE, blpapi.Event.PARTIAL_RESPONSE]: + if correlationId1 == msgCorrelationId: + print("Received response for request 1") + elif correlationId2 == msgCorrelationId: + print("Received response for request 2") + + if eventType == blpapi.Event.RESPONSE: + finalResponseCount += 1 + + print(msg) + finally: + session.stop() + + +if __name__ == "__main__": + try: + main() + except Exception as e: # pylint: disable=broad-except + print(e) + +__copyright__ = """ +Copyright 2021, Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above +copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/demoapps/README.md b/examples/demoapps/README.md new file mode 100644 index 0000000..ed21474 --- /dev/null +++ b/examples/demoapps/README.md @@ -0,0 +1,234 @@ +# BLPAPI Examples +| Example | Keywords | +|---------|----------| +| [ApiFieldsExample](#apifieldsexample) | `apiflds`, `fields`, `request` | +| [BroadcastPublisherExample](#broadcastpublisherexample) | `publisher` | +| [ContributionsExample](#contributionsexample) | `contributions` | +| [EntitlementsVerificationSubscriptionExample](#entitlementsverificationsubscriptionexample) | `asynchronous`, `subscription`, `client-server` | +| [EntitlementsVerificationRequestResponseExample](#entitlementsverificationrequestresponseexample) | `asynchronous`, `request`, `client-server` | +| [GenerateTokenExample](#generatetokenexample) | `token`, `client-server` | +| [InteractivePublisherExample](#interactivepublisherexample) | `publisher` | +| [MultipleRequestsOverrideExample](#multiplerequestsoverrideexample) | `request`, `overrides` | +| [RequestResponseExample](#requestresponseexample) | `request`, `refdata`, `overrides`, `historical`, `intraday` | +| [RequestServiceConsumerExample](#requestserviceconsumerexample) | `request`, `custom service` | +| [RequestServiceProviderExample](#requestserviceproviderexample) | `response`, `custom service` | +| [SecurityLookupExample](#securitylookupexample) | `request`, `instruments` | +| [SnapshotRequestTemplateExample](#snapshotrequesttemplateexample) | `snapshot`, `subscription` | +| [SubscriptionExample](#subscriptionexample) | `asynchronous`, `subscription` | +| [SubscriptionWithEventPollingExample](#subscriptionwitheventpollingexample) | `synchronous`, `subscription` | +| [UserModeExample](#usermodeexample) | `asynchronous`, `request`, `client-server` | + + +## ApiFieldsExample +--- +Sends a request for the fields available for accessing market data and reference data. + +#### Useful for + +- Discovering available fields when subscribing to market data or making requests for reference data. + +#### Sample Arguments + +`-H : --auth --request ` + +There are 4 types of requests: CategorizedFieldSearchRequest, FieldInfoRequest, FieldListRequest, and FieldSearchRequest. + +## BroadcastPublisherExample +--- +Demonstrates a broadcast publisher that publishes data regardless of whether there are active subscriptions or not. By default, market data is published. Page data can be published with the `--page` option. + +#### Useful for + +- Creating services that publish data regardless of whether there are active subscriptions, e.g. alerting + +#### Sample Arguments +`-H : -s --auth ` + +`-H : -s --auth --page --max-events ` + +## ContributionsExample +--- +Demonstrates contributing your own data to Bloomberg. + +#### Sample Arguments +`-H -s --auth ` + +Contribute page data by adding the flag `--page` + +## EntitlementsVerificationSubscriptionExample +--- +Subscribes to data and redistributes it to entitled users, all in an asychronous manner. + +#### Useful for + +- Using the SDK asynchronously (with an Event Handler) +- Creating a client-server setup +- Getting data once and fanning it out to other users + +#### Sample Arguments +`-H --auth -u -u --token= -f BID -f ASK` + +## EntitlementsVerificationRequestResponseExample +--- +An asynchronous redistribution example where an app requests data and redistributes the response to entitled users. + +#### Useful for + +- Using the SDK asynchronously (with an Event Handler) +- Creating a client-server setup +- Getting data once and fanning it out to other users + +#### Sample Arguments +`-H --auth -S -u -S -u -u -T ` + +## GenerateTokenExample +--- +Generates a token for a user. This token can be used for authorization. For example, once generated, the token can be used in the above Entitlements examples. + +#### Useful for + +- Generating a token that can be used to authorize a user on the server side + + +#### Sample Arguments +`--host --auth ` + +## InteractivePublisherExample +--- +Demonstrates a publisher that only publishes data when there are active subscriptions. By default, publishes market data. Pass the `--page` option to publish page data. + + +#### Sample Arguments +`-H -s --auth --register-ssc 0,5,1` + +Publish page data with the `--page` flag + +## MultipleRequestsOverrideExample +--- +Demonstrates how to send requests with different overrides and correlate them to responses using `CorrelationId`. + +#### Useful for + +- Keeping track of multiple requests sent at the same time. + +#### Sample Arguments +Note: Can be run with no arguments + +`-H --auth ` + +## RequestResponseExample +--- +Demonstrates how to make a request and process a response. By default, the service used is `//blp/refdata`, but can be set to any variation of `//blp/refdata`, such as `//blp/staticmktdata`. + + +#### Sample Arguments +Note: Can be run without arguments + +`-r ` + +There are 4 request types: `ReferenceDataRequest`, `ReferenceDataRequestOverride`, `ReferenceDataRequestTableOverride`, and `HistoricalDataRequest`. + +## RequestServiceConsumerExample +--- +Demonstrates the client side of a request/response setup. Works in conjunction with `RequestServiceProviderExample`. + + +#### Sample Arguments +`-H --auth ` + + +## RequestServiceProviderExample +--- +Demonstrates the server side of a request/response setup. A ProviderSession registers as a service and responds to client requests. This is in contrast with a pub-sub model. Works in conjunction with `RequestServiceConsumerExample`. + + +#### Sample Arguments +`-H --auth ` + +## SecurityLookupExample +--- +Demonstrates how to use the Bloomberg Instruments service to look up details about securities. + + +#### Sample Arguments +There are 3 request types: `instrumentListRequest`, `curveListRequest`, `govtListRequest`. For each request type, the user can specify filters i.e., search conditions. + +Instrument List (Default): + +`-S AAPL -F yellowKeyFilter=YK_FILTER_EQTY` + +Curve List: + +`-r curveListRequest -S GOOG -F countryCode=US` + +Govt List: + +`-r govtListRequest -S GOOG -F countryCode=US` + + +## SnapshotRequestTemplateExample +--- +Demonstrates how to make snapshot requests. Snapshots are made by first creating a snapshot template, then sending requests using the template. +This example also batch processes the snapshot templates (batch size is set to 50) because requests are throttled in the infrastructure. + +#### Useful for + +- Getting a "snapshot" of subscription data without having to process real-time ticks + +#### Sample Arguments +`-H -s //blp/mktdata --auth -t "/ticker/SPY US Equity" -f ASK -f BID -f LAST_PRICE -t "/ticker/MSFT US Equity` + +## SubscriptionExample +--- +Demonstrates how to make subscriptions. Handles data asynchronously, using a session with an event handler. Also demonstrates various subscription-related messages, e.g., `SlowConsumerWarning`, `SlowConsumerWarningCleared`, and `DataLoss`. + +Can be used to subscribe to data published by other examples, like `InteractivePublisherExample`. + +#### Useful for +- Using BLPAPI asynchronously, processing events with an event handler (see `SubscriptionWithEventPollingExample` for synchronous usage) + + +#### Sample Arguments +Note: Can be run without arguments + +`-H -a -t "/ticker/IBM US Equity` + +## SubscriptionWithEventPollingExample +--- +Demonstrates how to make subscriptions. Handles data synchronously. + +Can be used to subscribe to data published by other examples, like `InteractivePublisherExample`. + +#### Useful for +- Using the BLPAPI synchronously, processing events with `session.nextEvent()` (see `SubscriptionExample` for the recommended asynchronous usage) + + +#### Sample Arguments +Note: Can be run without arguments + +`-H -s //blp/mktdata -f LAST_PRICE -f BID -t "/ticker/SPY US Equity" -t "/ticker/IBM US Equity" --auth --max-events 2` + +## UserModeExample +--- +An asynchronous identity pass-through example where an app requests data on behalf of users. + +#### Useful for + +- Creating a client-server setup +- Relying on Bloomberg's backend to check entitlements, rather than using an application to check entitlements + +#### Sample Arguments +`-H --auth -u -T -u -u -S "IBM US Equity"` + +## Examples Subdirectories +The above examples have some shared code refactored into the subdirectories `Snippets` and `Util`. These subdirectories contain code with the following functionality: + +#### Snippets +- Creating and sending requests +- Processing responses + +#### Util +- Creating `SessionOptions` +- Creating `SubscriptionList`s +- Creating subscription strings for snapshot request templates +- Handling command-line arguments diff --git a/examples/demoapps/RequestResponseExample.py b/examples/demoapps/RequestResponseExample.py new file mode 100644 index 0000000..977037f --- /dev/null +++ b/examples/demoapps/RequestResponseExample.py @@ -0,0 +1,210 @@ +from argparse import ArgumentParser, RawTextHelpFormatter + +from blpapi_import_helper import blpapi + +from snippets.requestresponse import IntradayTickRequests +from snippets.requestresponse import IntradayBarRequests +from snippets.requestresponse import ReferenceDataRequests +from snippets.requestresponse import HistoricalDataRequest +from util.ConnectionAndAuthOptions import addConnectionAndAuthOptions, createSessionOptions +from util.RequestOptions import addRequestOptions, setDefaultValues, \ + REFERENCE_DATA_REQUEST_TABLE_OVERRIDE, REFERENCE_DATA_REQUEST_OVERRIDE, INTRADAY_BAR_REQUEST, \ + INTRADAY_TICK_REQUEST, REFERENCE_DATA_REQUEST, HISTORICAL_DATA_REQUEST + + +def parseCmdLine(): + """Parse command line arguments""" + + parser = ArgumentParser(formatter_class=RawTextHelpFormatter, + description="Request/Response Example") + addConnectionAndAuthOptions(parser) + addRequestOptions(parser) + + options = parser.parse_args() + setDefaultValues(options) + + return options + + +def processGenericEvent(event): + """Prints the messages in the event.""" + + # When using a session identity, token generation + # failure, authorization failure or revocation terminates + # the session, in which case, applications only need to + # check session status messages. Applications don't need + # to handle token or authorization messages, which are + # still printed. Will return True if session has failed + # to start or is terminated. False will be returned if otherwise. + + eventType = event.eventType() + for msg in event: + print(msg) + messageType = msg.messageType() + if eventType == blpapi.Event.SESSION_STATUS: + if messageType == blpapi.Names.SESSION_TERMINATED \ + or messageType == blpapi.Names.SESSION_STARTUP_FAILURE: + print("Session failed to start or terminated.") + printContactSupportMessage(msg) + return True + elif eventType == blpapi.Event.SERVICE_STATUS: + if messageType == blpapi.Names.SERVICE_OPEN_FAILURE: + serviceName = msg.getElementAsString("serviceName") + print(f"Failed to open {serviceName}") + printContactSupportMessage(msg) + + return False + + +def checkFailures(session): + """Checks failure events published by the session.""" + + # Note that the loop uses `Session.tryNextEvent()` as all events have + # been produced before calling this function, but there could be no events + # at all in the queue if the OS fails to allocate resources. + + while True: + event = session.tryNextEvent() + if event is None: + break + if processGenericEvent(event): + break + + +def printContactSupportMessage(msg): + """Prints RequestId associated with a Message""" + + # Messages can have an associated RequestId + # that is used to identify operations (related to them) + # through the network. + + requestId = msg.getRequestId() + if requestId is not None: + print(f"When contacting support, please provide RequestId {requestId}") + + +def sendRequest(options, session): + """Sends a request based on the request type.""" + service = session.getService(options.service) + requestType = options.requestType + if requestType == INTRADAY_BAR_REQUEST: + request = IntradayBarRequests.createRequest(service, options) + elif requestType == INTRADAY_TICK_REQUEST: + request = IntradayTickRequests.createRequest(service, options) + elif requestType in [REFERENCE_DATA_REQUEST, REFERENCE_DATA_REQUEST_OVERRIDE]: + request = ReferenceDataRequests.createRequest(service, options) + elif requestType == REFERENCE_DATA_REQUEST_TABLE_OVERRIDE: + request = ReferenceDataRequests.createTableOverrideRequest( + service, options) + elif requestType == HISTORICAL_DATA_REQUEST: + request = HistoricalDataRequest.createRequest(service, options) + + # Every request has a RequestId, which is automatically generated, and + # used to identify the operation through the network and also present + # in the response messages. The RequestId should be provided when + # contacting support. + print(f"Sending Request {request.getRequestId()}: {request}") + session.sendRequest(request, + None) # correlationId + + +def waitForResponse(session, requestType): + """Waits for response after sending the request""" + + # Success response can come with a number of + # PARTIAL_RESPONSE events followed by a RESPONSE event. + # Failures will be delivered in a REQUEST_STATUS event + # holding a REQUEST_FAILURE message. + + done = False + while not done: + event = session.nextEvent() + eventType = event.eventType() + if eventType == blpapi.Event.PARTIAL_RESPONSE: + print("Processing Partial Response") + processResponseEvent(event, requestType) + elif eventType == blpapi.Event.RESPONSE: + print("Processing Response") + processResponseEvent(event, requestType) + done = True + elif eventType == blpapi.Event.REQUEST_STATUS: + for msg in event: + print(msg) + if msg.messageType == blpapi.Names.REQUEST_FAILURE: + reason = msg.getElement("reason") + print(f"Request failed: {reason}") + printContactSupportMessage(msg) + done = True + else: + # SESSION_STATUS events can happen at any time and should be + # handled as the session can be terminated, e.g. + # session identity can be revoked at a later time, which + # terminates the session. + done = processGenericEvent(event) + + +def processResponseEvent(event, requestType): + """Processes a response to the request.""" + if requestType == INTRADAY_BAR_REQUEST: + IntradayBarRequests.processResponseEvent(event) + elif requestType == INTRADAY_TICK_REQUEST: + IntradayTickRequests.processResponseEvent(event) + elif requestType in [REFERENCE_DATA_REQUEST, + REFERENCE_DATA_REQUEST_OVERRIDE, + REFERENCE_DATA_REQUEST_TABLE_OVERRIDE]: + ReferenceDataRequests.processResponseEvent(event) + elif requestType == HISTORICAL_DATA_REQUEST: + HistoricalDataRequest.processResponseEvent(event) + + +def main(): + """Main function""" + + options = parseCmdLine() + + sessionOptions = createSessionOptions(options) + session = blpapi.Session(sessionOptions) + + try: + if not session.start(): + checkFailures(session) + print("Failed to start session.") + return + + if not session.openService(options.service): + checkFailures(session) + return + + sendRequest(options, session) + waitForResponse(session, options.requestType) + + finally: + session.stop() + + +if __name__ == "__main__": + try: + main() + except Exception as e: # pylint: disable=broad-except + print(e) + +__copyright__ = """ +Copyright 2021, Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above copyright +notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/demoapps/RequestServiceConsumerExample.py b/examples/demoapps/RequestServiceConsumerExample.py new file mode 100644 index 0000000..0e0075e --- /dev/null +++ b/examples/demoapps/RequestServiceConsumerExample.py @@ -0,0 +1,104 @@ +from blpapi_import_helper import blpapi +from util.ConnectionAndAuthOptions import addConnectionAndAuthOptions, createSessionOptions +from argparse import ArgumentParser, RawTextHelpFormatter +import time + +SERVICE = "//example/refdata" +TIMESTAMP = blpapi.Name("timestamp") +FIELDS = blpapi.Name("fields") +SECURITIES = blpapi.Name("securities") + + +def parseCmdLine(): + """Parse command line arguments""" + + parser = ArgumentParser(formatter_class=RawTextHelpFormatter, + description="Request service consumer example, to be used in " + "conjunction with RequestServiceProviderExample") + addConnectionAndAuthOptions(parser) + options = parser.parse_args() + return options + + +def main(): + options = parseCmdLine() + sessionOptions = createSessionOptions(options) + session = blpapi.Session(sessionOptions) + + try: + if not session.start(): + print("Failed to start session.") + return + + if not session.openService(SERVICE): + print(f"Failed to open {SERVICE}") + return + + service = session.getService(SERVICE) + request = service.createRequest("ReferenceDataRequest") + + # Add securities to request + securitiesElement = request.getElement(SECURITIES) + securitiesElement.appendValue("IBM US Equity") + securitiesElement.appendValue("MSFT US Equity") + + # Add fields to request + fieldsElement = request.getElement(FIELDS) + fieldsElement.appendValue("PX_LAST") + fieldsElement.appendValue("DS002") + + # Set time stamp + request.set("timestamp", time.time()) + + print(f"Sending Request: {request}") + + session.sendRequest(request) + + done = True + while done: + event = session.nextEvent() + + for msg in event: + if msg.messageType() == blpapi.Names.REQUEST_FAILURE: + print("Request failed!") + done = False + break + if msg.hasElement(TIMESTAMP): + responseTime = msg.getElementAsFloat(TIMESTAMP) + print(f"Response latency = {time.time() - responseTime}") + print(msg) + + if event.eventType() == blpapi.Event.RESPONSE: + break + + finally: + session.stop() + + +if __name__ == "__main__": + try: + main() + except Exception as e: # pylint: disable=broad-except + print(e) + + +__copyright__ = """ +Copyright 2021, Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above +copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/demoapps/RequestServiceProviderExample.py b/examples/demoapps/RequestServiceProviderExample.py new file mode 100644 index 0000000..6c1286d --- /dev/null +++ b/examples/demoapps/RequestServiceProviderExample.py @@ -0,0 +1,142 @@ +from argparse import ArgumentParser, RawTextHelpFormatter + +from blpapi_import_helper import blpapi +from util.ConnectionAndAuthOptions import addConnectionAndAuthOptions, createSessionOptions + +import time + +SERVICE = "//example/refdata" +SESSION_TERMINATED = blpapi.Name("SessionTerminated") +REFERENCE_DATA_REQUEST = blpapi.Name("ReferenceDataRequest") +TIMESTAMP = blpapi.Name("timestamp") +FIELD_DATA = blpapi.Name("fieldData") +FIELD_ID = blpapi.Name("fieldId") +FIELDS = blpapi.Name("fields") +SECURITY = blpapi.Name("security") +SECURITIES = blpapi.Name("securities") +SECURITY_DATA = blpapi.Name("securityData") +DATA = blpapi.Name("data") +DOUBLE_VALUE = blpapi.Name("doubleValue") + + +def parseCmdLine(): + """Parse command line arguments""" + + parser = ArgumentParser(formatter_class=RawTextHelpFormatter, + description="Request service provider example, to be used in " + "conjunction with RequestServiceConsumerExample") + addConnectionAndAuthOptions(parser) + options = parser.parse_args() + return options + + +def processEvent(event, session): + + print("Server received an event") + + if event.eventType() == blpapi.Event.REQUEST: + service = session.getService(SERVICE) + for msg in event: + print(msg) + + if msg.messageType() == REFERENCE_DATA_REQUEST: + if msg.hasElement(TIMESTAMP): + requestTime = msg.getElementAsFloat(TIMESTAMP) + latency = time.time() - requestTime + print(f"Request latency = {latency}") + + # A response event must contain only one response + # message and attach the correlation ID of the request + # message. + response = service.createResponseEvent(msg.correlationId()) + ef = blpapi.EventFormatter(response) + + # The parameter of EventFormatter.appendResponse(Name) + # is the name of the operation instead of the response. + ef.appendResponse(REFERENCE_DATA_REQUEST) + securities = msg.getElement(SECURITIES) + fields = msg.getElement(FIELDS) + ef.setElement(TIMESTAMP, time.time()) + ef.pushElement(SECURITY_DATA) + for security in securities.values(): + ef.appendElement() + ef.setElement(SECURITY, security) + ef.pushElement(FIELD_DATA) + + for field in fields.values(): + ef.appendElement() + ef.setElement(FIELD_ID, field) + ef.pushElement(DATA) + ef.setElement(DOUBLE_VALUE, time.time()) + ef.popElement() + ef.popElement() + + ef.popElement() + ef.popElement() + + ef.popElement() + + print("Publishing Response") + for responseMsg in response: + print(responseMsg) + session.sendResponse(response) + + print("Waiting for requests..., Press ENTER to quit") + + else: + for msg in event: + print(msg) + + return True + + +def main(): + options = parseCmdLine() + sessionOptions = createSessionOptions(options) + + providerSession = blpapi.ProviderSession(sessionOptions, processEvent) + + try: + if not providerSession.start(): + print("Failed to start session.") + return + + if not providerSession.registerService(SERVICE): + print(f"Failed to register {SERVICE}") + return + + # wait for enter key to exit application + print("Press ENTER to quit") + input() + + finally: + providerSession.stop() + + +if __name__ == "__main__": + try: + main() + except Exception as e: # pylint: disable=broad-except + print(e) + + +__copyright__ = """ +Copyright 2021, Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above +copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/demoapps/SecurityLookupExample.py b/examples/demoapps/SecurityLookupExample.py new file mode 100644 index 0000000..494c8bc --- /dev/null +++ b/examples/demoapps/SecurityLookupExample.py @@ -0,0 +1,207 @@ +from argparse import Action, ArgumentParser, RawTextHelpFormatter + +from blpapi_import_helper import blpapi + +from snippets.instruments import CurveListRequests +from snippets.instruments import GovtListRequests +from snippets.instruments import InstrumentListRequests +from util.ConnectionAndAuthOptions import addConnectionAndAuthOptions, createSessionOptions +from collections import namedtuple + +INSTRUMENT_SERVICE = "//blp/instruments" + +INSTRUMENT_LIST_REQUEST = "instrumentListRequest" +CURVE_LIST_REQUEST = "curveListRequest" +GOVT_LIST_REQUEST = "govtListRequest" + +FILTERS_INSTRUMENTS = ["yellowKeyFilter", "languageOverride"] +FILTERS_GOVT = ["ticker", "partialMatch"] +FILTERS_CURVE = [ + "countryCode", + "currencyCode", + "type", + "subtype", + "curveid", + "bbgid" +] + +REQUEST_FAILURE = blpapi.Name("RequestFailure") +SESSION_TERMINATED = blpapi.Name("SessionTerminated") +SESSION_STARTUP_FAILURE = blpapi.Name("SessionStartupFailure") +SERVICE_OPEN_FAILURE = blpapi.Name("ServiceOpenFailure") + +# Defines a filter that is used in a //blp/instruments request. +InstrumentsFilter = namedtuple('InstrumentsFilter', ['name', 'value']) + + +class FilterAction(Action): + """The action that parses filter options from user input""" + + def __call__(self, parser, args, values, option_string=None): + vals = values.split('=', 1) + if len(vals) != 2: + parser.error(f"Invalid filter option '{values}'") + + filters = getattr(args, self.dest) + filters.append(InstrumentsFilter(vals[0], vals[1])) + + +def parseCmdLine(): + """Parse command line arguments""" + + parser = ArgumentParser(formatter_class=RawTextHelpFormatter, + description="Security Lookup Example") + + addConnectionAndAuthOptions(parser) + + lookup_group = parser.add_argument_group("Security Lookup Options") + lookup_group.add_argument("-r", "--request", + dest="requestType", + choices=[INSTRUMENT_LIST_REQUEST, + CURVE_LIST_REQUEST, + GOVT_LIST_REQUEST], + help="specify the request type (default: %(default)s)", + metavar="requestType", + default=INSTRUMENT_LIST_REQUEST) + lookup_group.add_argument("-S", "--security", + dest="query", + help="security query string", + metavar="security") + lookup_group.add_argument("--max-results", + dest="maxResults", + help="max results returned in the response (default: %(default)d)", + metavar="maxResults", + type=int, + default=10) + lookup_group.add_argument("-F", "--filter", + dest="filters", + help=f'''filter and value separated by '=', e.g., countryCode=US. Can be specified multiple times. +The applicable filters for each request: +{INSTRUMENT_LIST_REQUEST}: {FILTERS_INSTRUMENTS} +{CURVE_LIST_REQUEST} : {FILTERS_CURVE} +{GOVT_LIST_REQUEST} : {FILTERS_GOVT}''', + metavar="=", + action=FilterAction, + default=[]) + + options = parser.parse_args() + + return options + + +def sendRequest(options, session): + """Sends a request based on the request type.""" + instrumentsService = session.getService(INSTRUMENT_SERVICE) + requestType = options.requestType + if requestType == CURVE_LIST_REQUEST: + request = CurveListRequests.createRequest( + instrumentsService, + options.query, + options.maxResults, + options.filters) + elif requestType == GOVT_LIST_REQUEST: + request = GovtListRequests.createRequest( + instrumentsService, + options.query, + options.maxResults, + options.filters) + elif requestType == INSTRUMENT_LIST_REQUEST: + request = InstrumentListRequests.createRequest( + instrumentsService, + options.query, + options.maxResults, + options.filters) + + print(f"Sending Request {request}") + session.sendRequest(request) + + +def waitForResponse(session, requestType): + """Waits for response after sending the request""" + + # Success response can come with a number of PARTIAL_RESPONSE events + # followed by a RESPONSE event. + # Failures will be delivered in a REQUEST_STATUS event holding a + # REQUEST_FAILURE message. + + done = False + while not done: + event = session.nextEvent() + eventType = event.eventType() + if eventType == blpapi.Event.PARTIAL_RESPONSE: + print("Processing Partial Response") + processResponseEvent(event, requestType) + elif eventType == blpapi.Event.RESPONSE: + print("Processing Response") + processResponseEvent(event, requestType) + done = True + else: + for msg in event: + if eventType == blpapi.Event.REQUEST_STATUS: + if msg.messageType() == REQUEST_FAILURE: + print(f"Request failed: {msg}") + done = True + if eventType == blpapi.Event.SESSION_STATUS: + if msg.messageType() == SESSION_TERMINATED: + print(f"Session terminated: {msg}") + done = True + + +def processResponseEvent(event, requestType): + """Processes a response to the request.""" + if requestType == CURVE_LIST_REQUEST: + CurveListRequests.processResponse(event) + elif requestType == GOVT_LIST_REQUEST: + GovtListRequests.processResponse(event) + elif requestType == INSTRUMENT_LIST_REQUEST: + InstrumentListRequests.processResponse(event) + + +def main(): + """Main function""" + + options = parseCmdLine() + sessionOptions = createSessionOptions(options) + + session = blpapi.Session(sessionOptions) + try: + if not session.start(): + print("Failed to start session.") + return + + if not session.openService(INSTRUMENT_SERVICE): + print(f"Failed to open {INSTRUMENT_SERVICE}") + return + + sendRequest(options, session) + waitForResponse(session, options.requestType) + finally: + session.stop() + + +if __name__ == "__main__": + try: + main() + except Exception as e: # pylint: disable=broad-except + print(e) + +__copyright__ = """ +Copyright 2021, Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above copyright +notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/demoapps/SnapshotRequestTemplateExample.py b/examples/demoapps/SnapshotRequestTemplateExample.py new file mode 100644 index 0000000..d9851ba --- /dev/null +++ b/examples/demoapps/SnapshotRequestTemplateExample.py @@ -0,0 +1,242 @@ +from argparse import ArgumentParser, RawTextHelpFormatter +from threading import Condition, Lock +from blpapi_import_helper import blpapi +from blpapi import Names +from util.ConnectionAndAuthOptions import \ + addConnectionAndAuthOptions, \ + createSessionOptions +from util.SubscriptionOptions import \ + addSubscriptionOptionsForSnapshot, \ + setSubscriptionSessionOptions, \ + createSubscriptionStrings +import time + +# Requests are throttled in the infrastructure. Snapshot request templates send +# one resolution request per topic (unlike normal subscriptions where multiple +# topics are resolved at once), which is likely to cause request throttling. +# It is therefore recommended to create request templates in batches. +TEMPLATE_BATCH_SIZE = 50 + + +class MyCorrelation: + """The object that stores the topic of a snapshot. + Used to avoid duplicate correlation id exception. + """ + + # To be able to retrieve the topic associated with a + # response message, the correlationId of the request + # is created with the topic string. This will eventually + # lead to `DuplicateCorrelationIdException` for requests + # having the same topic strings. + # + # This class therefore encapsulates the topic string inside + # an object which will be different (by reference) each time + # it is instantiated, regardless of the topic string saved + # within it. When the response is received, the topic string + # is extracted from it. + + def __init__(self, topic): + self.topic = topic + + def __str__(self): + return self.topic + + +def parseCmdLine(): + """Parse command line arguments""" + + parser = ArgumentParser(formatter_class=RawTextHelpFormatter, + description="Retrieve Snapshots") + addConnectionAndAuthOptions(parser) + addSubscriptionOptionsForSnapshot(parser) + + options = parser.parse_args() + + return options + + +class SnapshotRequestTemplateExample: + + def __init__(self): + self._snapshots = {} + + # Lock and conditions are used to synchronize requests and responses, + # i.e., the next requests are only sent after all the responses + # of the current requests have been received. + self._lock = Lock() + self._responseCount = 0 + self._responseCondition = Condition(self._lock) + + self._templateCount = 0 + self.d_templateBatchingCondition = Condition(self._lock) + + self._running = True + + def _createTemplates(self, session, options): + # NOTE: resources used by a snapshot request template are released + # only when a 'RequestTemplateTerminated' message is received or when + # the session is destroyed. In order to release resources when a + # request template is not needed anymore, the user should call + # 'Session.cancel' and pass the correlation id used when creating the + # request template, or call 'RequestTemplate.close'. If 'Session.cancel' + # is used, all outstanding requests are canceled and the underlying + # subscription is closed immediately. If the handle is closed with + # 'RequestTemplate.close', the underlying subscription is closed + # only when all outstanding requests are served. + + subscriptionStrings = createSubscriptionStrings(options) + with self._lock: + self._responseCount = len(subscriptionStrings) + for userTopic, subscriptionString in subscriptionStrings.items(): + self.d_templateBatchingCondition.wait_for( + lambda: not self._running or self._templateCount < TEMPLATE_BATCH_SIZE) + + if not self._running: + break + + # Create the template + print(f"Creating snapshot request template for {userTopic}") + + statusCid = blpapi.CorrelationId(MyCorrelation(userTopic)) + requestTemplate = session.createSnapshotRequestTemplate( + subscriptionString, + statusCid) + self._snapshots[statusCid] = requestTemplate + + # Wait until all the request templates have finished, either + # success or failure. + self._responseCondition.wait_for( + lambda: not self._running or self._responseCount == 0) + + def _sendRequests(self, session): + while True: + print("Sending requests using the request templates") + + with self._lock: + if not self._running: + break + + self._responseCount = len(self._snapshots) + for cid, template in self._snapshots.items(): + userTopic = cid.value().topic + print(f"Sending request for {userTopic}") + session.sendRequestTemplate( + template, + blpapi.CorrelationId(MyCorrelation(userTopic))) + + print("Waiting for the responses..., Press [Ctrl-C] to exit\n") + self._responseCondition.wait_for( + lambda: not self._running or self._responseCount == 0) + + print("Received all the responses, will send next request in 5 seconds\n") + time.sleep(5) + + def run(self): + """main entry point""" + options = parseCmdLine() + + sessionOptions = createSessionOptions(options) + setSubscriptionSessionOptions(sessionOptions, options) + session = blpapi.Session(sessionOptions, self.processEvent) + + try: + if not session.start(): + print("Failed to start session.") + return + + if not session.openService(options.service): + print(f"Failed to open service '{options.service}'.") + return + + self._createTemplates(session, options) + + if self._snapshots: + self._sendRequests(session) + else: + print("Failed to create all the request templates, stopping...") + finally: + session.stop() + + def processEvent(self, event, _): + """Process session event""" + + eventType = event.eventType() + + for msg in event: + messageType = msg.messageType() + cid = msg.correlationId() + myCorrelation = cid.value() + if messageType == Names.REQUEST_TEMPLATE_AVAILABLE: + print("Request template is successfully created for topic" + f" {myCorrelation}") + print(msg) + + with self._lock: + # Decrease template count + self._templateCount -= 1 + self.d_templateBatchingCondition.notify_all() + + # Decrease response count + self._responseCount -= 1 + self._responseCondition.notify_all() + elif messageType == Names.REQUEST_TEMPLATE_TERMINATED: + # Will also receive a 'RequestFailure' message preceding + # 'RequestTemplateTerminated' for every pending request. + print(f"Request template terminated for topic {myCorrelation}") + print(msg) + + with self._lock: + # Remove the template + del self._snapshots[myCorrelation] + + # Decrease template count + self._templateCount -= 1 + self.d_templateBatchingCondition.notify_all() + + # Decrease response count + self._responseCount -= 1 + self._responseCondition.notify_all() + elif eventType == blpapi.Event.PARTIAL_RESPONSE: + print(f"Received partial response for topic {myCorrelation}") + print(msg) + elif eventType == blpapi.Event.RESPONSE: + print(f"Received response for topic {myCorrelation}") + print(msg) + + with self._lock: + self._responseCount -= 1 + self._responseCondition.notify_all() + elif msg.messageType() == Names.SESSION_TERMINATED: + with self._lock: + self._running = False + self.d_templateBatchingCondition.notify_all() + self._responseCondition.notify_all() + + +if __name__ == "__main__": + try: + example = SnapshotRequestTemplateExample() + example.run() + except Exception as e: # pylint: disable=broad-except + print(e) + +__copyright__ = """ +Copyright 2021, Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above +copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/demoapps/SubscriptionExample.py b/examples/demoapps/SubscriptionExample.py new file mode 100644 index 0000000..af354f1 --- /dev/null +++ b/examples/demoapps/SubscriptionExample.py @@ -0,0 +1,160 @@ +import time + +from argparse import ArgumentParser, RawTextHelpFormatter + +from blpapi_import_helper import blpapi + +from util.SubscriptionOptions import \ + addSubscriptionOptions, \ + setSubscriptionSessionOptions, \ + createSubscriptionList +from util.ConnectionAndAuthOptions import \ + addConnectionAndAuthOptions, \ + createSessionOptions + +DEFAULT_QUEUE_SIZE = 10000 + + +class SubscriptionEventHandler(object): + def getTimeStamp(self): + return time.strftime("%Y/%m/%d %X") + + def processSubscriptionStatus(self, event): + timeStamp = self.getTimeStamp() + for msg in event: + topic = msg.correlationId().value() + print(f"{timeStamp}: {topic}") + print(msg) + if msg.messageType() == blpapi.Names.SUBSCRIPTION_FAILURE: + print(f"Subscription for {topic} failed") + elif msg.messageType() == blpapi.Names.SUBSCRIPTION_TERMINATED: + # Subscription can be terminated if the session identity + # is revoked. + print(f"Subscription for {topic} TERMINATED") + + def processSubscriptionDataEvent(self, event): + timeStamp = self.getTimeStamp() + for msg in event: + topic = msg.correlationId().value() + print(f"{timeStamp}: {topic}") + print(msg) + + def processMiscEvents(self, event): + for msg in event: + if msg.messageType() == blpapi.Names.SLOW_CONSUMER_WARNING: + print(f"{blpapi.Names.SLOW_CONSUMER_WARNING} - The event queue is " + + "beginning to approach its maximum capacity and " + + "the application is not processing the data fast " + + "enough. This could lead to ticks being dropped" + + " (DataLoss).\n") + elif msg.messageType() == blpapi.Names.SLOW_CONSUMER_WARNING_CLEARED: + print(f"{blpapi.Names.SLOW_CONSUMER_WARNING_CLEARED} - the event " + + "queue has shrunk enough that there is no " + + "longer any immediate danger of overflowing the " + + "queue. If any precautionary actions were taken " + + "when SlowConsumerWarning message was delivered, " + + "it is now safe to continue as normal.\n") + elif msg.messageType() == blpapi.Names.DATA_LOSS: + print(msg) + topic = msg.correlationId().value() + print(f"{blpapi.Names.DATA_LOSS} - The application is too slow to " + + "process events and the event queue is overflowing. " + + f"Data is lost for topic {topic}.\n") + elif event.eventType() == blpapi.Event.SESSION_STATUS: + # SESSION_STATUS events can happen at any time and + # should be handled as the session can be terminated, + # e.g. session identity can be revoked at a later + # time, which terminates the session. + if msg.messageType() == blpapi.Names.SESSION_TERMINATED: + print("Session terminated") + return + + def processEvent(self, event, _session): + try: + if event.eventType() == blpapi.Event.SUBSCRIPTION_DATA: + self.processSubscriptionDataEvent(event) + elif event.eventType() == blpapi.Event.SUBSCRIPTION_STATUS: + self.processSubscriptionStatus(event) + else: + self.processMiscEvents(event) + except blpapi.Exception as exception: + print(f"Failed to process event {event}: {exception}") + return False + + +def parseCmdLine(): + """Parse command line arguments""" + + parser = ArgumentParser(formatter_class=RawTextHelpFormatter, + description="Asynchronous subscription with event handler") + addConnectionAndAuthOptions(parser) + addSubscriptionOptions(parser) + + parser.add_argument( + "-q", + "--event-queue-size", + dest="eventQueueSize", + help="The maximum number of events that is buffered by the session (default: %(default)d)", + type=int, + metavar="eventQueueSize", + default=DEFAULT_QUEUE_SIZE) + + options = parser.parse_args() + + return options + + +def main(): + options = parseCmdLine() + + sessionOptions = createSessionOptions(options) + setSubscriptionSessionOptions(sessionOptions, options) + sessionOptions.setMaxEventQueueSize(options.eventQueueSize) + handler = SubscriptionEventHandler() + session = blpapi.Session(sessionOptions, handler.processEvent) + + try: + if not session.start(): + print("Failed to start session.") + return + + if not session.openService(options.service): + print("Failed to open service.") + return + + subscriptions = createSubscriptionList(options) + session.subscribe(subscriptions) + + print("Press ENTER to quit") + input() + + finally: + session.stop() + + +if __name__ == "__main__": + try: + main() + except Exception as e: # pylint: disable=broad-except + print(e) + +__copyright__ = """ +Copyright 2021, Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above +copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/demoapps/SubscriptionWithEventPollingExample.py b/examples/demoapps/SubscriptionWithEventPollingExample.py new file mode 100644 index 0000000..58f7509 --- /dev/null +++ b/examples/demoapps/SubscriptionWithEventPollingExample.py @@ -0,0 +1,174 @@ +from argparse import ArgumentParser, RawTextHelpFormatter + +from blpapi_import_helper import blpapi +from blpapi import Names + +from util.SubscriptionOptions import \ + addSubscriptionOptions, \ + setSubscriptionSessionOptions, \ + createSubscriptionList +from util.ConnectionAndAuthOptions import \ + addConnectionAndAuthOptions, \ + createSessionOptions +from util.MaxEventsOption import addMaxEventsOption + + +def parseCmdLine(): + """Parse command line arguments""" + + parser = ArgumentParser(formatter_class=RawTextHelpFormatter, + description="Subscription example with event polling") + addSubscriptionOptions(parser) + addConnectionAndAuthOptions(parser) + addMaxEventsOption(parser) + + options = parser.parse_args() + + return options + +def checkFailures(session): + """Checks failure events published by the session.""" + + # Note that the loop uses 'session.tryNextEvent' as all events have + # been produced before calling this function, but there could be no events + # at all in the queue if the OS fails to allocate resources. + while True: + event = session.tryNextEvent() + if event is None: + return + + eventType = event.eventType() + for msg in event: + print(msg) + if processGenericMessage(eventType, msg): + return + +def processSubscriptionEvents(session, maxEvents): + eventCount = 0 + while True: + # Specify timeout to give a chance for Ctrl-C + event = session.nextEvent(1000) + eventType = event.eventType() + for msg in event: + print(msg) + messageType = msg.messageType() + messageCorrelationId = msg.correlationId() + if eventType == blpapi.Event.SUBSCRIPTION_STATUS: + if messageType == Names.SUBSCRIPTION_FAILURE \ + or messageType == Names.SUBSCRIPTION_TERMINATED: + topic = messageCorrelationId.value() + print(f"Subscription failed for topic {topic}") + printContactSupportMessage(msg) + elif eventType == blpapi.Event.SUBSCRIPTION_DATA: + topic = messageCorrelationId.value() + print(f"Received subscription data for topic {topic}") + + if msg.recapType() == blpapi.Message.RECAPTYPE_SOLICITED: + if msg.getRequestId() is not None: + # An init paint tick can have an associated + # RequestId that is used to identify the + # source of the data and can be used when + # contacting support + print(f"Received init paint with RequestId {msg.getRequestId()}") + else: + + # SESSION_STATUS events can happen at any time and + # should be handled as the session can be terminated, + # e.g. session identity can be revoked at a later + # time, which terminates the session. + if processGenericMessage(eventType, msg): + return + + if event.eventType() == blpapi.Event.SUBSCRIPTION_DATA: + eventCount += 1 + if eventCount >= maxEvents: + break + +def processGenericMessage(eventType, message): + """Prints error information if the 'message' is a failure message.""" + + messageType = message.messageType() + + # When using a session identity, i.e. + # 'SessionOptions.setSessionIdentityOptions(AuthOptions)', token + # generation failure, authorization failure or revocation terminates the + # session, in which case, applications only need to check session status + # messages. Applications don't need to handle token or authorization messages + if eventType == blpapi.Event.SESSION_STATUS: + if messageType == Names.SESSION_TERMINATED or \ + messageType == Names.SESSION_STARTUP_FAILURE: + print("Session failed to start or terminated") + printContactSupportMessage(message) + # Session failed to start/terminated + return True + elif eventType == blpapi.Event.SERVICE_STATUS: + if messageType == Names.SERVICE_OPEN_FAILURE: + serviceName = message.getElementAsString("serviceName") + print(f"Failed to open {serviceName}") + printContactSupportMessage(message) + + # Session OK + return False + +def printContactSupportMessage(msg): + """Prints contact support message.""" + + # Messages can have associated RequestIds which + # identify operations (related to them) through the network. + requestId = msg.getRequestId() + if requestId is not None: + print(f"When contacting support, please provide RequestId {requestId}") + + +def main(): + """Main function""" + + options = parseCmdLine() + + sessionOptions = createSessionOptions(options) + setSubscriptionSessionOptions(sessionOptions, options) + session = blpapi.Session(sessionOptions) + + try: + if not session.start(): + checkFailures(session) + print("Failed to start session.") + return + + if not session.openService(options.service): + checkFailures(session) + return + + subscriptions = createSubscriptionList(options) + session.subscribe(subscriptions) + + processSubscriptionEvents(session, options.maxEvents) + finally: + session.stop() + +if __name__ == "__main__": + try: + main() + except Exception as e: # pylint: disable=broad-except + print(e) + +__copyright__ = """ +Copyright 2021, Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above +copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/demoapps/UserModeExample.py b/examples/demoapps/UserModeExample.py new file mode 100644 index 0000000..980d9ea --- /dev/null +++ b/examples/demoapps/UserModeExample.py @@ -0,0 +1,274 @@ +from argparse import ArgumentParser, RawTextHelpFormatter + +from blpapi_import_helper import blpapi +from blpapi import Session, Names, CorrelationId +from util.ConnectionAndAuthOptions import \ + addConnectionAndAuthOptions, \ + createClientServerSetupAuthOptions, \ + createSessionOptions +from util.events.SessionRouter import SessionRouter + +from functools import partial +from threading import Event as ThreadingEvent +from time import sleep + +REFDATA_SVC_NAME = "//blp/refdata" + + +class UserModeExample: + """User Mode Example""" + + def __init__(self, options): + self._sessionTerminatedSignal = ThreadingEvent() + self._router = SessionRouter() + self._session = None + self._options = options + self._refDataService = None + self._identitiesByCorrelationId = {} + + self._router.addExceptionHandler(self._handleException) + + self._router.addMessageHandlerByMessageType( + Names.SESSION_STARTED, self._handleSessionStarted) + self._router.addMessageHandlerByMessageType( + Names.SESSION_STARTUP_FAILURE, self._handleSessionStartupFailure) + self._router.addMessageHandlerByMessageType( + Names.SESSION_TERMINATED, self._handleSessionTerminated) + + self._router.addMessageHandlerByMessageType( + Names.SERVICE_OPENED, self._handleServiceOpened) + self._router.addMessageHandlerByMessageType( + Names.SERVICE_OPEN_FAILURE, self._handleServiceOpenFailure) + + @property + def stopped(self): + return self._sessionTerminatedSignal.is_set() + + def createAndStartSession(self): + # Use the specified application as the session identity to + # authorize. This may cause the session to stop and the example + # to terminate, if the identity is revoked. + sessionOptions = createSessionOptions(self._options) + self._session = Session(sessionOptions, self._router.processEvent) + self._session.startAsync() + + def _stop(self): + # Cancel all the authorized identities + self._session.cancel(self._identitiesByCorrelationId.keys()) + self._session.stopAsync() + + def _handleException(self, _session, _event, exception): + print(exception) + self._stop() + + def _handleSessionStarted(self, + _session: blpapi.AbstractSession, + _event: blpapi.Event, + _msg: blpapi.Message): + + # Add the authorization messages handlers after the session + # started to only react to the authorization messages of users, + # i.e., avoid those of the session identity. + self._router.addMessageHandlerByMessageType( + Names.AUTHORIZATION_SUCCESS, self._handleAuthorizationSuccess) + self._router.addMessageHandlerByMessageType( + Names.AUTHORIZATION_FAILURE, self._handleAuthorizationFailure) + self._router.addMessageHandlerByMessageType( + Names.AUTHORIZATION_REVOKED, self._handleAuthorizationRevoked) + + # both actions will run concurrently + self._openServices() + self._authorizeUsers() + + def _handleSessionStartupFailure(self, + _session: blpapi.AbstractSession, + _event: blpapi.Event, + _msg: blpapi.Message): + print("Failed to start session. Exiting...") + self._sessionTerminatedSignal.set() + + def _handleSessionTerminated(self, + _session: blpapi.AbstractSession, + _event: blpapi.Event, + _msg: blpapi.Message): + print("Session terminated. Exiting...") + self._sessionTerminatedSignal.set() + + def _handleServiceOpened(self, + session: blpapi.AbstractSession, + _event: blpapi.Event, + message: blpapi.Message): + serviceName = message["serviceName"] + self._refDataService = session.getService(serviceName) + + if serviceName == REFDATA_SVC_NAME: + # it is possible that by now some identities are already authorised + # we are sending a request on their behalf here + for cid, identity in self._identitiesByCorrelationId.items(): + userIdentifier = cid.value() + self._sendRefDataRequest(identity, userIdentifier) + print(f"A service was opened: {serviceName}") + + def _handleServiceOpenFailure(self, + _session: blpapi.AbstractSession, + _event: blpapi.Event, + message: blpapi.Message): + serviceName = message["serviceName"] + if serviceName == REFDATA_SVC_NAME: + print(f"Failed to open service '{serviceName}', stopping...") + self._stop() + return + + raise RuntimeError(f"An unknown service failed to open: {serviceName}") + + def _handleAuthorizationSuccess(self, + session: blpapi.AbstractSession, + _event: blpapi.Event, + message: blpapi.Message): + correlationId = message.correlationId() + userIdentifier = correlationId.value() + print(f"Successfully authorized {userIdentifier}") + + identity = session.getAuthorizedIdentity(correlationId) + self._identitiesByCorrelationId[correlationId] = identity + + if self._refDataService: + # it is possible that the service is already open by now + # in this case we must send the request on behalf of the identity + userIdentifier = correlationId.value() + self._sendRefDataRequest(identity, userIdentifier) + else: + pass # the request will be sent by open service handler + + def _handleAuthorizationFailure(self, + _session: blpapi.AbstractSession, + _event: blpapi.Event, + message: blpapi.Message): + correlationId = message.correlationId() + self._router.removeMessageHandlerByCorrelationId(correlationId) + + userIdentifier = correlationId.value() + print(f"Failed to authorize {userIdentifier}") + + def _handleAuthorizationRevoked(self, + _session: blpapi.AbstractSession, + _event: blpapi.Event, + message: blpapi.Message): + correlationId = message.correlationId() + self._router.removeMessageHandlerByCorrelationId(correlationId) + + userIdentifier = correlationId.value() + print(f"Authorization revoked for {userIdentifier}") + + # Remove the identity + self._identitiesByCorrelationId.pop(correlationId, None) + + def _authorizeUsers(self): + # Authorize each of the users + authOptionsByIdentifier = createClientServerSetupAuthOptions( + self._options) + for userIdentifier, authOptions in authOptionsByIdentifier.items(): + correlationId = blpapi.CorrelationId(userIdentifier) + self._session.generateAuthorizedIdentity( + authOptions, correlationId) + + def _openServices(self): + self._session.openServiceAsync(REFDATA_SVC_NAME) + + def _sendRefDataRequest(self, identity, userId): + # To send a reference data request on behalf of a user + # we need 1) the identity to be authorised 2) the service be opened. + # Due to asynchronous nature of this example the messages + # for successful service opening and successful authorization + # may arrive in any possible order. + # Hence, we call this method in both handlers. + # For open service handler to cover the identities authorised (before), + # and in authorization handler if the service is open (after). + request = self._refDataService.createRequest("ReferenceDataRequest") + requestDict = { + "securities": self._options.securities, + "fields": ["PX_LAST", "DS002"], + "returnEids": True + } + + request.fromPy(requestDict) + + print(f"Sending RefDataRequest on behalf of {userId}:\n{request}") + correlationId = CorrelationId("example") + self._router.addMessageHandlerByCorrelationId( + correlationId, + partial(UserModeExample._processResponseMessage, userId)) + self._session.sendRequest(request, identity, correlationId) + + @staticmethod + def _processResponseMessage(userId, + _session: blpapi.Session, + _event: blpapi.Event, + message: blpapi.Message): + if message.messageType() == Names.REQUEST_FAILURE: + print(f"Request failed for {userId}.") + else: + print(f"Received response for {userId}.") + + +def parseCmdLine(): + """Parse command line arguments""" + parser = ArgumentParser( + description="User Mode Example", + formatter_class=RawTextHelpFormatter) + addConnectionAndAuthOptions(parser, forClientServerSetup=True) + + parser.add_argument("-S", "--security", + dest="securities", + help="security used in ReferenceDataRequest (default:" + " IBM US Equity). Can be specified multiple times", + metavar="security", + action="append", + default=[]) + + options = parser.parse_args() + + if not options.securities: + options.securities.append("IBM US Equity") + + if not options.userIdAndIps and not options.tokens: + parser.error("No userId:IP or token specified") + + return options + + +def main(): + options = parseCmdLine() + + example = UserModeExample(options) + example.createAndStartSession() + + # The main thread is not blocked and the example is running asynchronously. + while not example.stopped: + sleep(0.1) + + +if __name__ == "__main__": + try: + main() + except Exception as e: # pylint: disable=broad-except + print(e) + +__copyright__ = """ +Copyright 2021, Bloomberg Finance L.P. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above +copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/demoapps/blpapi_import_helper/__init__.py b/examples/demoapps/blpapi_import_helper/__init__.py new file mode 100644 index 0000000..7b93bf5 --- /dev/null +++ b/examples/demoapps/blpapi_import_helper/__init__.py @@ -0,0 +1,41 @@ +# __init__.py + +# pylint: disable=no-member + +import os +import platform as plat +import sys +import contextlib + +@contextlib.contextmanager +def _libdir(): + if sys.version_info >= (3, 8) and plat.system().lower() == "windows" \ + and os.getenv('BLPAPI_LIBDIR') is not None: + yield os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')) + else: + yield None + + +with _libdir(): + import blpapi + +__copyright__ = """ +Copyright 2021, Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above copyright +notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/demoapps/snippets/apiflds/ApiFieldsRequestUtils.py b/examples/demoapps/snippets/apiflds/ApiFieldsRequestUtils.py new file mode 100644 index 0000000..b65fd1a --- /dev/null +++ b/examples/demoapps/snippets/apiflds/ApiFieldsRequestUtils.py @@ -0,0 +1,52 @@ +ID_LEN = 13 +MNEMONIC_LEN = 36 +DESC_LEN = 40 +CAT_NAME_LEN = 40 + + +def printHeader(): + print(f'{"FIELD ID".ljust(ID_LEN)}' + f'{"MNEMONIC".ljust(MNEMONIC_LEN)}' + f'{"DESCRIPTION".ljust(DESC_LEN)}') + print(f'{"-----------".ljust(ID_LEN)}' + f'{"-----------".ljust(MNEMONIC_LEN)}' + f'{"-----------".ljust(DESC_LEN)}') + + +def printField(field): + fieldId = field["id"] + if "fieldInfo" in field: + fieldInfo = field["fieldInfo"] + fieldMnemonic = fieldInfo["mnemonic"] + fieldDesc = fieldInfo["description"] + + print(f"{fieldId.ljust(ID_LEN)}" + f"{fieldMnemonic.ljust(MNEMONIC_LEN)}" + f"{fieldDesc.ljust(DESC_LEN)}") + else: + errorMsg = field["fieldError"]["message"] + + print() + print(f" ERROR: {fieldId} - {errorMsg}") + + +__copyright__ = """ +Copyright 2021, Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above copyright +notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/demoapps/snippets/apiflds/CategorizedFieldSearchRequests.py b/examples/demoapps/snippets/apiflds/CategorizedFieldSearchRequests.py new file mode 100644 index 0000000..7fa5cc3 --- /dev/null +++ b/examples/demoapps/snippets/apiflds/CategorizedFieldSearchRequests.py @@ -0,0 +1,57 @@ +from snippets.apiflds import ApiFieldsRequestUtils + + +def createRequest(apifldsService): + request = apifldsService.createRequest("CategorizedFieldSearchRequest") + request.set("searchSpec", "last price") + + exclude = request.getElement("exclude") + exclude.setElement("fieldType", "Static") + + request.set("returnFieldDocumentation", False) + + return request + + +def processResponse(event): + for msg in event: + if "fieldSearchError" in msg: + print(msg) + continue + + categories = msg["category"] + for category in categories: + category_name = category["categoryName"] + category_id = category["categoryId"] + print(f"\nCategory Name: {category_name.ljust(ApiFieldsRequestUtils.CAT_NAME_LEN)}" + f"\tId: {category_id}") + + ApiFieldsRequestUtils.printHeader() + + fields = category["fieldData"] + for field in fields: + ApiFieldsRequestUtils.printField(field) + + print() + + +__copyright__ = """ +Copyright 2021, Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above copyright +notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/demoapps/snippets/apiflds/FieldInfoRequests.py b/examples/demoapps/snippets/apiflds/FieldInfoRequests.py new file mode 100644 index 0000000..52b1d39 --- /dev/null +++ b/examples/demoapps/snippets/apiflds/FieldInfoRequests.py @@ -0,0 +1,50 @@ +from snippets.apiflds import ApiFieldsRequestUtils + + +def createRequest(apifldsService): + request = apifldsService.createRequest("FieldInfoRequest") + + idElement = request.getElement("id") + idElement.appendValue("LAST_PRICE") + idElement.appendValue("pq005") + idElement.appendValue("zz0002") + + request.set("returnFieldDocumentation", True) + + return request + + +def processResponse(event): + # NOTE: this function uses the dictionary-like interface to read a + # `Message`. See `FieldListRequests.processResponse` for the method-based + # interface. + for msg in event: + ApiFieldsRequestUtils.printHeader() + + fields = msg["fieldData"] + for field in fields: + ApiFieldsRequestUtils.printField(field) + + print() + + +__copyright__ = """ +Copyright 2021, Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above copyright +notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/demoapps/snippets/apiflds/FieldListRequests.py b/examples/demoapps/snippets/apiflds/FieldListRequests.py new file mode 100644 index 0000000..ed35403 --- /dev/null +++ b/examples/demoapps/snippets/apiflds/FieldListRequests.py @@ -0,0 +1,45 @@ +from snippets.apiflds import ApiFieldsRequestUtils + + +def createRequest(apifldsService): + request = apifldsService.createRequest("FieldListRequest") + request["fieldType"] = "Static" + request["returnFieldDocumentation"] = False + + return request + + +def processResponse(event): + # NOTE: this function uses the method-based interface to read a + # `Message`. See `FieldInfoRequests.processResponse` for the + # dictionary-like interface. + for msg in event: + ApiFieldsRequestUtils.printHeader() + + fields = msg.getElement("fieldData") + for i in range(fields.numValues()): + ApiFieldsRequestUtils.printField(fields.getValueAsElement(i)) + + print() + + +__copyright__ = """ +Copyright 2021, Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above copyright +notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/demoapps/snippets/apiflds/FieldSearchRequests.py b/examples/demoapps/snippets/apiflds/FieldSearchRequests.py new file mode 100644 index 0000000..64f7499 --- /dev/null +++ b/examples/demoapps/snippets/apiflds/FieldSearchRequests.py @@ -0,0 +1,46 @@ +from snippets.apiflds import ApiFieldsRequestUtils + + +def createRequest(apifldsService): + request = apifldsService.createRequest("FieldSearchRequest") + request.set("searchSpec", "last price") + + exclude = request.getElement("exclude") + exclude.setElement("fieldType", "Static") + + request.set("returnFieldDocumentation", False) + + return request + + +def processResponse(event): + for msg in event: + ApiFieldsRequestUtils.printHeader() + + fields = msg["fieldData"] + for field in fields: + ApiFieldsRequestUtils.printField(field) + + print() + + +__copyright__ = """ +Copyright 2021, Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above copyright +notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/demoapps/snippets/instruments/CurveListRequests.py b/examples/demoapps/snippets/instruments/CurveListRequests.py new file mode 100644 index 0000000..a9b3b8e --- /dev/null +++ b/examples/demoapps/snippets/instruments/CurveListRequests.py @@ -0,0 +1,69 @@ +from blpapi import Name + +NAME_DESCRIPTION = Name("description") +NAME_QUERY = Name("query") +NAME_RESULTS = Name("results") +NAME_MAX_RESULTS = Name("maxResults") +NAME_CURVE = Name("curve") +ERROR_RESPONSE = Name("ErrorResponse") + +CURVE_RESPONSE_ELEMENTS = [ + Name("country"), + Name("currency"), + Name("curveid"), + Name("type"), + Name("subtype"), + Name("publisher"), + Name("bbgid")] + + +def createRequest(instrumentsService, query, maxResults, filters): + request = instrumentsService.createRequest("curveListRequest") + request[NAME_QUERY] = query + request[NAME_MAX_RESULTS] = maxResults + + for f in filters: + request[f.name] = f.value + + return request + + +def processResponse(event): + for msg in event: + if msg.messageType() == ERROR_RESPONSE: + print(f"Received error: {msg}") + continue + + results = msg[NAME_RESULTS] + print(f"Processing {len(results)} results:") + + for i, result in enumerate(results): + elements_values = [f"{n}={result[n]}" + for n in CURVE_RESPONSE_ELEMENTS] + + curve = result[NAME_CURVE] + description = result[NAME_DESCRIPTION] + print( + f" {i + 1} {curve} - {description}, {' '.join(elements_values)}") + + +__copyright__ = """ +Copyright 2021, Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above copyright +notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/demoapps/snippets/instruments/GovtListRequests.py b/examples/demoapps/snippets/instruments/GovtListRequests.py new file mode 100644 index 0000000..8cbd01f --- /dev/null +++ b/examples/demoapps/snippets/instruments/GovtListRequests.py @@ -0,0 +1,59 @@ +from blpapi import Name + +NAME_QUERY = Name("query") +NAME_RESULTS = Name("results") +NAME_MAX_RESULTS = Name("maxResults") + +NAME_PARSEKY = Name("parseky") +NAME_NAME = Name("name") +NAME_TICKER = Name("ticker") +ERROR_RESPONSE = Name("ErrorResponse") + + +def createRequest(instrumentsService, query, maxResults, filters): + request = instrumentsService.createRequest("govtListRequest") + request[NAME_QUERY] = query + request[NAME_MAX_RESULTS] = maxResults + + for f in filters: + request[f.name] = f.value + + return request + + +def processResponse(event): + for msg in event: + if msg.messageType() == ERROR_RESPONSE: + print(f"Received error: {msg}") + continue + + results = msg.getElement(NAME_RESULTS) + print(f"Processing {len(results)} results:") + + for i, result in enumerate(results): + parsekey = result[NAME_PARSEKY] + name = result[NAME_NAME] + ticker = result[NAME_TICKER] + print(f" {i + 1} {parsekey}, {name} - {ticker}") + + +__copyright__ = """ +Copyright 2021, Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above copyright +notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/demoapps/snippets/instruments/InstrumentListRequests.py b/examples/demoapps/snippets/instruments/InstrumentListRequests.py new file mode 100644 index 0000000..bd9cccd --- /dev/null +++ b/examples/demoapps/snippets/instruments/InstrumentListRequests.py @@ -0,0 +1,57 @@ +from blpapi import Name + +NAME_DESCRIPTION = Name("description") +NAME_QUERY = Name("query") +NAME_RESULTS = Name("results") +NAME_MAX_RESULTS = Name("maxResults") + +NAME_SECURITY = Name("security") +ERROR_RESPONSE = Name("ErrorResponse") + + +def createRequest(instrumentsService, query, maxResults, filters): + request = instrumentsService.createRequest("instrumentListRequest") + request[NAME_QUERY] = query + request[NAME_MAX_RESULTS] = maxResults + + for f in filters: + request[f.name] = f.value + + return request + + +def processResponse(event): + for msg in event: + if msg.messageType() == ERROR_RESPONSE: + print(f"Received error: {msg}") + continue + + results = msg[NAME_RESULTS] + print(f"Processing {len(results)} results:") + + for i, result in enumerate(results): + security = result[NAME_SECURITY] + description = result[NAME_DESCRIPTION] + print(f" {i + 1} {security} - {description}") + + +__copyright__ = """ +Copyright 2021, Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above copyright +notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/demoapps/snippets/requestresponse/HistoricalDataRequest.py b/examples/demoapps/snippets/requestresponse/HistoricalDataRequest.py new file mode 100644 index 0000000..66b1a5f --- /dev/null +++ b/examples/demoapps/snippets/requestresponse/HistoricalDataRequest.py @@ -0,0 +1,48 @@ +# HistoricalDataRequest.py + + +def createRequest(service, options): + # NOTE: this function uses `Request.__setitem__` to format a `Request`. See + # the other `createRequest` functions in this `requestresponse` directory + # for examples of alternative interfaces for formatting a `Request`. + request = service.createRequest("HistoricalDataRequest") + + request["securities"] = options.securities + request["fields"] = options.fields + + request["periodicityAdjustment"] = "ACTUAL" + request["periodicitySelection"] = "MONTHLY" + request["startDate"] = "20200101" + request["endDate"] = "20201231" + request["maxDataPoints"] = 100 + request["returnEids"] = True + + return request + + +def processResponseEvent(event): + for msg in event: + print(f"Received response to request {msg.getRequestId()}") + print(msg) + + +__copyright__ = """ +Copyright 2021, Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above copyright +notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/demoapps/snippets/requestresponse/IntradayBarRequests.py b/examples/demoapps/snippets/requestresponse/IntradayBarRequests.py new file mode 100644 index 0000000..8cd67a6 --- /dev/null +++ b/examples/demoapps/snippets/requestresponse/IntradayBarRequests.py @@ -0,0 +1,93 @@ +# IntradayBarRequests.py + +BAR_DATA = "barData" +BAR_TICK_DATA = "barTickData" +OPEN = "open" +HIGH = "high" +LOW = "low" +CLOSE = "close" +VOLUME = "volume" +NUM_EVENTS = "numEvents" +TIME = "time" +RESPONSE_ERROR = "responseError" +CATEGORY = "category" +MESSAGE = "message" + +DATETIME_FORMAT = "%m/%d/%Y %H:%M" + + +def createRequest(service, options): + # NOTE: this function uses `Request.set` to format a `Request`. See + # the other `createRequest` functions in this `requestresponse` directory + # for examples of alternative interfaces for formatting a `Request`. + request = service.createRequest("IntradayBarRequest") + + # Only one security / eventType per request + request.set("security", options.securities[0]) + request.set("eventType", options.eventTypes[0]) + request.set("interval", options.barInterval) + + request.set("startDateTime", options.startDateTime) + request.set("endDateTime", options.endDateTime) + + if options.gapFillInitialBar: + request.set("gapFillInitialBar", options.gapFillInitialBar) + + return request + + +def processResponseEvent(response): + # NOTE: This function demonstrates the use of `Message.toPy` for accessing + # the contents of a `Message`. Here, the contents of the `Message` get + # converted to a `dict`. See `IntradayTickRequests.processResponseEvent` + # for an example of accessing the contents of a `Message` using + # `Message.__getitem__`, without having to convert to a `dict`. + + for msg in response: + print(f"Received response to request {msg.getRequestId()}") + + msgDict = msg.toPy() + + if RESPONSE_ERROR in msgDict: + responseError = msg[RESPONSE_ERROR] + print(f"REQUEST FAILED: {responseError}") + continue + + data = msgDict[BAR_DATA][BAR_TICK_DATA] + print(f"Response contains {len(data)} bar(s)") + spaces = "\t\t\t\t" + print(f"Datetime{spaces}Open{spaces}High{spaces}Low{spaces}Close{spaces}NumEvents{spaces}Volume") + for bar in data: + barTime = bar[TIME] + barOpen = bar[OPEN] + barHigh = bar[HIGH] + barLow = bar[LOW] + barClose = bar[CLOSE] + barNumEvents = bar[NUM_EVENTS] + barVolume = bar[VOLUME] + + print(f"{barTime.strftime(DATETIME_FORMAT)}{spaces}{barOpen:.2f}" + f"{spaces}{barHigh:.2f}{spaces}{barLow:.2f}{spaces}" + f"{barClose:.2f}{spaces}{barNumEvents}{spaces}{barVolume}") + + +__copyright__ = """ +Copyright 2021, Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above copyright +notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/demoapps/snippets/requestresponse/IntradayTickRequests.py b/examples/demoapps/snippets/requestresponse/IntradayTickRequests.py new file mode 100644 index 0000000..e12c3e2 --- /dev/null +++ b/examples/demoapps/snippets/requestresponse/IntradayTickRequests.py @@ -0,0 +1,86 @@ +# IntradayTickRequests.py + +import blpapi + +TICK_DATA = blpapi.Name("tickData") +CONDITION_CODES = blpapi.Name("conditionCodes") +SIZE = blpapi.Name("size") +TIME = blpapi.Name("time") +TYPE = blpapi.Name("type") +VALUE = blpapi.Name("value") +RESPONSE_ERROR = blpapi.Name("responseError") + +DATETIME_FORMAT = "%m/%d/%Y %H:%M" + + +def createRequest(service, options): + # NOTE: this function uses `Request.fromPy` to format a `Request`. See + # the other `createRequest` functions in this `requestresponse` directory + # for examples of alternative interfaces for formatting a `Request`. + request = service.createRequest("IntradayTickRequest") + + requestDict = { + "security": options.securities[0], + "eventTypes": options.eventTypes, + # All times are in GMT + "startDateTime": options.startDateTime, + "endDateTime": options.endDateTime, + } + if options.conditionCodes: + requestDict["includeConditionCodes"] = True + + request.fromPy(requestDict) + + return request + + +def processResponseEvent(response): + # NOTE: This function demonstrates the `dict`-like interface for accessing + # the contents of a `Message`. For an example of explicitly converting a + # `Message` to a `dict`, see the use of `Message.toPy` in + # `IntradayBarRequests.processResponseEvent`. + + for msg in response: + print(f"Received response to request {msg.getRequestId()}") + + if RESPONSE_ERROR in msg: + responseError = msg[RESPONSE_ERROR] + print(f"REQUEST FAILED: {responseError}") + continue + + data = msg[TICK_DATA][TICK_DATA] + print("TIME\t\t\tTYPE\t\tVALUE\t\tSIZE\tCONDITION_CODES") + print("----\t\t\t----\t\t-----\t\t----\t----") + for item in data: + itemTime = item[TIME] + itemType = item[TYPE] + itemValue = item[VALUE] + itemSize = item[SIZE] + itemConditionCodes = "" + if CONDITION_CODES in item: + itemConditionCodes = item[CONDITION_CODES] + + print(f"{itemTime.strftime(DATETIME_FORMAT)}\t{itemType}\t" + f"{itemValue:.2f}\t\t{itemSize}\t{itemConditionCodes}") + + +__copyright__ = """ +Copyright 2021, Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above copyright +notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/demoapps/snippets/requestresponse/ReferenceDataRequests.py b/examples/demoapps/snippets/requestresponse/ReferenceDataRequests.py new file mode 100644 index 0000000..8f9e158 --- /dev/null +++ b/examples/demoapps/snippets/requestresponse/ReferenceDataRequests.py @@ -0,0 +1,157 @@ +# ReferenceDataRequests.py + +import blpapi + +SECURITY_DATA = blpapi.Name("securityData") +SECURITY = blpapi.Name("security") +FIELD_DATA = blpapi.Name("fieldData") +RESPONSE_ERROR = blpapi.Name("responseError") +SECURITY_ERROR = blpapi.Name("securityError") +FIELD_EXCEPTIONS = blpapi.Name("fieldExceptions") +FIELD_ID = blpapi.Name("fieldId") +ERROR_INFO = blpapi.Name("errorInfo") + + +def createRequest(service, options): + # NOTE: This function shows the `Element`-based interface of formatting + # a `Request`. See `createTableOverrideRequest` for an example of + # formatting a `Request` using `Request.fromPy`. See the other + # `createRequest` functions in this `requestresponse` directory for + # examples of alternative interfaces for formatting a `Request`. + + request = service.createRequest("ReferenceDataRequest") + securitiesElement = request.getElement("securities") + + for security in options.securities: + securitiesElement.appendValue(security) + + fieldsElement = request.getElement("fields") + for field in options.fields: + fieldsElement.appendValue(field) + + if options.overrides: + # Add overrides + overridesElement = request.getElement("overrides") + for override in options.overrides: + overrideElement = overridesElement.appendElement() + overrideElement.setElement("fieldId", override.fieldId) + overrideElement.setElement("value", override.value) + + return request + + +def createTableOverrideRequest(service, options): + # NOTE: This function shows how to format a `Request` using + # `Request.fromPy`. See `createRequest` for an example of formatting a + # `Request` using the `Element`-based interface. + + request = service.createRequest("ReferenceDataRequest") + + # (rate, duration, transition) + rate1 = (1.0, 12, 'S') # S = Step + rate2 = (2.0, 12, 'R') # R = Ramp + + requestDict = { + "securities": options.securities, + "fields": options.fields, + "overrides": [ + { + "fieldId": "ALLOW_DYNAMIC_CASHFLOW_CALCS", + "value": "Y" + }, + { + "fieldId": "LOSS_SEVERITY", + "value": 31 + } + ], + "tableOverrides": [ + { + "fieldId": "DEFAULT_VECTOR", + "row": [ + { + "value": ["Anchor", "PROJ"] + }, + { + "value": ["Type", "CDR"] + }, + { + "value": rate1 + }, + { + "value": rate2 + }, + ] + } + ] + } + request.fromPy(requestDict) + + return request + + +def processResponseEvent(event): + # NOTE: This function shows the `Element` method interface for accessing + # the contents of a `Message`. For examples of the `dict`-like interface, + # see `IntradayTickRequests.processResponseEvent` and + # `IntradayBarRequests.processResponseEvent` + + for msg in event: + print(f"Received response to request {msg.getRequestId()}") + + if msg.hasElement(RESPONSE_ERROR): + print(f"REQUEST FAILED: {msg.getElement(RESPONSE_ERROR)}") + continue + + securities = msg.getElement(SECURITY_DATA) + numSecurities = securities.numValues() + print(f"Processing {numSecurities} securities:") + + for i in range(numSecurities): + security = securities.getValueAsElement(i) + ticker = security.getElementAsString(SECURITY) + print(f"\nTicker: {ticker}") + + if security.hasElement(SECURITY_ERROR): + print(f"SECURITY FAILED: {security.getElement(SECURITY_ERROR)}") + continue + + if security.hasElement(FIELD_DATA): + fields = security.getElement(FIELD_DATA) + if fields.numElements() > 0: + print("FIELD\t\tVALUE") + print("-----\t\t-----") + numElements = fields.numElements() + for j in range(numElements): + field = fields.getElement(j) + print(f"{field.name()} \t\t {field} ") + + fieldExceptions = security.getElement(FIELD_EXCEPTIONS) + if fieldExceptions.numValues() > 0: + print("FIELD\t\tEXCEPTION") + print("-----\t\t---------") + for k in range(fieldExceptions.numValues()): + fieldException = fieldExceptions.getValueAsElement(k) + print(f"{fieldException.getElementAsString(FIELD_ID)} " + f"\t\t {fieldException.getElement(ERROR_INFO)}") + + +__copyright__ = """ +Copyright 2021, Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above copyright +notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/demoapps/util/ConnectionAndAuthOptions.py b/examples/demoapps/util/ConnectionAndAuthOptions.py new file mode 100644 index 0000000..b3ac6f1 --- /dev/null +++ b/examples/demoapps/util/ConnectionAndAuthOptions.py @@ -0,0 +1,291 @@ +from blpapi_import_helper import blpapi +from argparse import Action + + +_SESSION_IDENTITY_AUTH_OPTIONS = "sessionIdentityAuthOptions" + + +class AuthOptionsAction(Action): + """The action that parses authorization options from user input""" + + def __call__(self, parser, args, values, option_string=None): + vals = values.split('=', 1) + + auth_type = vals[0] + if auth_type == "user": + authUser = blpapi.AuthUser.createWithLogonName() + authOptions = blpapi.AuthOptions.createWithUser(authUser) + elif auth_type == "none": + authOptions = None + else: + if len(vals) != 2: + parser.error(f"Invalid auth option '{values}'") + + if auth_type == "app": + appName = vals[1] + authOptions = blpapi.AuthOptions.createWithApp(appName) + elif auth_type == "userapp": + appName = vals[1] + authUser = blpapi.AuthUser.createWithLogonName() + authOptions = blpapi.AuthOptions.createWithUserAndApp( + authUser, appName) + elif auth_type == "dir": + dirProperty = vals[1] + authUser = blpapi.AuthUser.createWithActiveDirectoryProperty( + dirProperty) + authOptions = blpapi.AuthOptions.createWithUser(authUser) + elif auth_type == "manual": + parts = vals[1].split(',') + if len(parts) != 3: + parser.error(f"Invalid auth option '{values}'") + + appName, ip, userId = parts + authUser = blpapi.AuthUser.createWithManualOptions(userId, ip) + authOptions = blpapi.AuthOptions.createWithUserAndApp( + authUser, appName) + else: + parser.error(f"Invalid auth option '{values}'") + + setattr(args, self.dest, authOptions) + + +class AppAuthAction(Action): + """The action that parses app authorization options from user input""" + + def __call__(self, parser, args, values, option_string=None): + vals = values.split('=', 1) + if len(vals) != 2: + parser.error(f"Invalid auth option '{values}'") + + authType, appName = vals + if authType != "app": + parser.error(f"Invalid auth option '{values}'") + + setattr(args, self.dest, appName) + authOptions = blpapi.AuthOptions.createWithApp(appName) + setattr(args, _SESSION_IDENTITY_AUTH_OPTIONS, authOptions) + + +class HostAction(Action): + """The action that parses host options from user input""" + + def __call__(self, parser, args, values, option_string=None): + vals = values.split(':', 1) + if len(vals) != 2: + parser.error(f"Invalid host option '{values}'") + + hosts = getattr(args, self.dest) + hosts.append((vals[0], int(vals[1]))) + + +class UserIdIpAction(Action): + """The action that parses userId and IP authorization options from user + input + """ + + def __call__(self, parser, args, values, option_string=None): + vals = values.split(":") + if len(vals) != 2: + parser.error(f"Invalid auth option '{values}'") + + userId, ip = vals + getattr(args, self.dest).append((userId, ip)) + + +def addConnectionAndAuthOptions(parser, forClientServerSetup=False): + """ + Helper function that adds the options for connection and authorization to + the argument parser. + """ + # Server options + server_group = parser.add_argument_group("Connections") + server_group.add_argument("-H", "--host", + dest="hosts", + help="server name or IP (default: 127.0.0.1:8194). Can be specified multiple times.", + metavar="host:port", + action=HostAction, + default=[]) + + # Auth options + if forClientServerSetup: + _addArgGroupsAuthAndEntitlementsClientServerSetup(parser) + else: + _addArgGroupAuth(parser) + + # TLS Options + tls_group = parser.add_argument_group("TLS (specify all or none)") + tls_group.add_argument("--tls-client-credentials", + dest="tls_client_credentials", + help="name a PKCS#12 file to use as a source of " + "client credentials", + metavar="file") + tls_group.add_argument("--tls-client-credentials-password", + dest="tls_client_credentials_password", + help="specify password for accessing client credentials", + metavar="password", + default="") + tls_group.add_argument("--tls-trust-material", + dest="tls_trust_material", + help="name a PKCS#7 file to use as a source of " + "trusted certificates", + metavar="file") + tls_group.add_argument("--read-certificate-files", + dest="read_certificate_files", + help="Enable reading the TLS files and pass the blobs", + action="store_true") + + # ZFP Options + zfp_group = parser.add_argument_group( + "ZFP connections over leased lines (requires TLS)") + zfp_group.add_argument("-z", "--zfp-over-leased-line", + dest="remote", + help="enable ZFP connections over leased lines on the " + "specified port (8194 or 8196)" + "\n(When this option is enabled, option -H/--host is ignored.)", + metavar="port", + type=int) + + +def _addArgGroupAuth(parser): + auth_group = parser.add_argument_group("Authorization") + auth_group.add_argument("-a", "--auth", + dest=_SESSION_IDENTITY_AUTH_OPTIONS, + help='''authorization option (default: none) +none applicable to Desktop API product that requires + Bloomberg Professional service to be installed locally +user as a user using OS logon information +dir= as a user using directory services +app= as the specified application +userapp= as user and application using logon information for the user +manual= as user and application, with manually provided + IP address and EMRS user''', + metavar="option", + action=AuthOptionsAction) + + +def _addArgGroupsAuthAndEntitlementsClientServerSetup(parser): + """Adds the auth and entitlements options for the entitlement examples to + the argument parser. + """ + auth_group = parser.add_argument_group("Authorization") + auth_group.add_argument("-a", "--auth", + dest="authAppName", + required=True, + help="authorize this application using the specified application", + metavar="app=", + action=AppAuthAction) + + entitlements_group = parser.add_argument_group("User Authorization/Entitlements") + entitlements_group.add_argument("-u", "--userid-ip", + dest="userIdAndIps", + help="authorize a user using userId and IP separated by ':'. Can be specified multiple times.", + metavar="userId:IP", + action=UserIdIpAction, + default=[]) + + entitlements_group.add_argument("-T", "--token", + dest="tokens", + help="authorize a user using the specified token. Can be specified multiple times.\n" + "If the token starts with '-', use " + "either -T or --token=.", + metavar="token", + action="append", + default=[]) + + +def _getTlsOptions(options): + """Parse TlsOptions from user input""" + + if (options.tls_client_credentials is None or + options.tls_trust_material is None): + return None + + print("TlsOptions enabled") + if options.read_certificate_files: + with open(options.tls_client_credentials, 'rb') as credentialfile: + credential_blob = credentialfile.read() + with open(options.tls_trust_material, 'rb') as trustfile: + trust_blob = trustfile.read() + return blpapi.TlsOptions.createFromBlobs( + credential_blob, + options.tls_client_credentials_password, + trust_blob) + + return blpapi.TlsOptions.createFromFiles( + options.tls_client_credentials, + options.tls_client_credentials_password, + options.tls_trust_material) + + +def createClientServerSetupAuthOptions(options): + """Creates a dictionary whose keys are the identifier representing a user, + either userId:IP or token, and whose values are the AuthOptions, either + manual option (userId + IP + App) or token. + """ + authOptionsByIdentifier = {} + for userId, ip in options.userIdAndIps: + authUser = blpapi.AuthUser.createWithManualOptions(userId, ip) + authOptions = blpapi.AuthOptions.createWithUserAndApp( + authUser, options.authAppName) + authOptionsByIdentifier[f"{userId}:{ip}"] = authOptions + + for i, token in enumerate(options.tokens): + authOptions = blpapi.AuthOptions.createWithToken(token) + authOptionsByIdentifier[f"token #{i + 1}"] = authOptions + + return authOptionsByIdentifier + + +def createSessionOptions(options): + """ + Creates SessionOptions from the following command line arguments: + - connections where servers, TLS and ZFP over Leased lines are specified. + - TLS options + - authorization options that are used as session identity options. + """ + + tlsOptions = _getTlsOptions(options) + if options.remote: + if tlsOptions is None: + raise RuntimeError("ZFP connections require TLS parameters") + + print("Creating a ZFP connection for leased lines.") + sessionOptions = blpapi.ZfpUtil.getZfpOptionsForLeasedLines( + options.remote, + tlsOptions) + else: + sessionOptions = blpapi.SessionOptions() + for idx, host in enumerate(options.hosts): + sessionOptions.setServerAddress(host[0], host[1], idx) + + if tlsOptions: + sessionOptions.setTlsOptions(tlsOptions) + + sessionOptions.setSessionIdentityOptions( + options.sessionIdentityAuthOptions) + print(f"Connecting to " + f"{', '.join([h[0] + ':' + str(h[1]) for h in sessionOptions.serverAddresses()])}") + + return sessionOptions + + +__copyright__ = """ +Copyright 2021, Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above copyright +notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/demoapps/util/MaxEventsOption.py b/examples/demoapps/util/MaxEventsOption.py new file mode 100644 index 0000000..58c389b --- /dev/null +++ b/examples/demoapps/util/MaxEventsOption.py @@ -0,0 +1,36 @@ +import sys + +def addMaxEventsOption(argparser): + ''' + Helper function that adds the option for the maximum number of events + before stopping to the argument parser and parses the command line + argument to an integer as the maximum number of events. + ''' + argparser.add_argument("--max-events", + dest="maxEvents", + help="number of events to process before stopping (default: %(default)d).", + metavar="maxEvents", + type=int, + default=sys.maxsize) + + +__copyright__ = """ +Copyright 2021, Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above copyright +notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/demoapps/util/RequestOptions.py b/examples/demoapps/util/RequestOptions.py new file mode 100644 index 0000000..2540f4c --- /dev/null +++ b/examples/demoapps/util/RequestOptions.py @@ -0,0 +1,230 @@ +from argparse import Action +from collections import namedtuple +import datetime + +REFDATA_SERVICE = "//blp/refdata" +INTRADAY_BAR_REQUEST = "IntradayBarRequest" +INTRADAY_TICK_REQUEST = "IntradayTickRequest" +REFERENCE_DATA_REQUEST = "ReferenceDataRequest" +REFERENCE_DATA_REQUEST_OVERRIDE = "ReferenceDataRequestOverride" +REFERENCE_DATA_REQUEST_TABLE_OVERRIDE = "ReferenceDataRequestTableOverride" +HISTORICAL_DATA_REQUEST = "HistoricalDataRequest" + +# Defines a parameter override in a reference data request. +Override = namedtuple('Override', ['fieldId', 'value']) + + +class OverridesAction(Action): + """The action that parses overrides options from user input""" + + def __call__(self, parser, args, values, option_string=None): + vals = values.split('=', 1) + overrides = getattr(args, self.dest) + overrides.append(Override(vals[0], vals[1])) + + +def parseDatetime(value): + return datetime.datetime.strptime(value, "%Y-%m-%dT%H:%M:%S") + + +def addRequestOptions(parser): + """ + Helper function that adds the options that are used to + create a blpapi request to the argument parser. + """ + + # Compute default start/end datetime + defaultStartDateTime, defaultEndDateTime = computeDefaultStartAndEndDateTime() + formattedDefaultStartDateTime = defaultStartDateTime.isoformat( + timespec="seconds") + formattedDefaultEndDateTime = defaultEndDateTime.isoformat( + timespec="seconds") + + isoDatetimeFormat = "YYYY-MM-DDTHH:MM:SS" + + # Request options + argGroupRequest = parser.add_argument_group("Request Options") + argGroupRequest.add_argument("-s", + "--service", + dest="service", + help="The service name (default: %(default)s)", + metavar="service", + default=REFDATA_SERVICE) + argGroupRequest.add_argument("-S", + "--security", + dest="securities", + help="Security to request. Can be specified multiple times.", + metavar="security", + action="append", + default=[]) + argGroupRequest.add_argument("-f", + "--field", + dest="fields", + help="Field to request. Can be specified multiple times.", + metavar="field", + action="append", + default=[]) + argGroupRequest.add_argument("-e", + "--event", + dest="eventTypes", + help="Event Type (default: ['TRADE']). Can be specified multiple times.", + metavar="eventType", + action="append", + default=[]) + argGroupRequest.add_argument("-i", + "--interval", + dest="barInterval", + type=int, + help="Bar interval (default: %(default)d)", + metavar="barInterval", + default=60) + argGroupRequest.add_argument("-I", + "--include-condition-codes", + dest="conditionCodes", + help="Include condition codes", + action='store_true', + default=False) + argGroupRequest.add_argument("-G", + "--gap-fill-initial-bar", + dest="gapFillInitialBar", + help="Gap fill initial bar", + action='store_true', + default=False) + argGroupRequest.add_argument("--start-date", + dest="startDateTime", + help="Start datetime in the format of " + f"{isoDatetimeFormat} (default: {formattedDefaultStartDateTime})", + metavar="startDateTime", + type=parseDatetime, + default=defaultStartDateTime) + argGroupRequest.add_argument("--end-date", + dest="endDateTime", + help="End datetime in the format of " + f"{isoDatetimeFormat} (default: {formattedDefaultEndDateTime})", + metavar="endDateTime", + type=parseDatetime, + default=defaultEndDateTime) + argGroupRequest.add_argument("-O", + "--override", + dest="overrides", + help="Field to override. Can be specified multiple times.", + metavar="=", + action=OverridesAction, + default=[]) + argGroupRequest.add_argument("-r", + "--request", + dest="requestType", + choices=[REFERENCE_DATA_REQUEST, + REFERENCE_DATA_REQUEST_OVERRIDE, + REFERENCE_DATA_REQUEST_TABLE_OVERRIDE, + INTRADAY_BAR_REQUEST, + INTRADAY_TICK_REQUEST, + HISTORICAL_DATA_REQUEST], + help=f"""Request Type (default: %(default)s) +To retrieve reference data: + -r, --request {REFERENCE_DATA_REQUEST} + [-S, --security ] + [-f, --field ] +To retrieve reference data with overrides: + -r, --request {REFERENCE_DATA_REQUEST_OVERRIDE} + [-S, --security ] + [-f, --field ] + [-O, --override <= = {{VWAP_START_TIME=9:30, VWAP_END_TIME=11:30}}] +To retrieve reference data with table overrides: + -r, --request {REFERENCE_DATA_REQUEST_TABLE_OVERRIDE} + [-S, --security ] + [-f, --field ] +To retrieve intraday bars: + -r, --request {INTRADAY_BAR_REQUEST} + [-S, --security ] + [-e, --event ] + [-i, --interval ] + [--start-date ] + [--end-date ] + [-G, --gap-fill-initial-bar] + 1) All times are in GMT. + 2) Only one security can be specified. + 3) Only one event can be specified. +To retrieve intraday raw ticks: + -r, --request {INTRADAY_TICK_REQUEST} + [-S, --security ] + [-e, --event ] + [-i, --interval ] + [--start-date ] + [--end-date ] + [--include-condition-codes ] + 1) All times are in GMT. + 2) Only one security can be specified. +To retrieve historical data: + -r, --request {HISTORICAL_DATA_REQUEST} + [-S, --security ] + [-f, --field ]""", + metavar="requestType", + default=REFERENCE_DATA_REQUEST) + + +def setDefaultValues(options): + if not options.eventTypes: + options.eventTypes = ["TRADE"] + + if not options.securities: + if options.requestType == REFERENCE_DATA_REQUEST_TABLE_OVERRIDE: + options.securities = ["FHR 3709 FA Mtge"] + else: + options.securities = ["IBM US Equity", "MSFT US Equity"] + + if not options.fields: + if options.requestType == REFERENCE_DATA_REQUEST_TABLE_OVERRIDE: + options.fields = ["MTG_CASH_FLOW", "SETTLE_DT"] + else: + options.fields = ["PX_LAST"] + if options.requestType == REFERENCE_DATA_REQUEST_OVERRIDE: + options.fields += ["DS002", "EQY_WEIGHTED_AVG_PX"] + + if not options.overrides and options.requestType is REFERENCE_DATA_REQUEST_OVERRIDE: + options.overrides = [Override("VWAP_START_TIME", "9:30"), + Override("VWAP_END_TIME", "11:30")] + + startDatetime, endDatetime = computeDefaultStartAndEndDateTime() + if not options.startDateTime: + options.startDateTime = startDatetime + + if not options.endDateTime: + options.endDateTime = endDatetime + + +def computeDefaultStartAndEndDateTime(): + today = datetime.datetime.today() + previousTradingDate = today - datetime.timedelta(days=1) + if datetime.date.weekday(previousTradingDate.date()) == 5: # if Saturday + previousTradingDate = previousTradingDate - datetime.timedelta(days=1) + elif datetime.date.weekday(previousTradingDate.date()) == 6: # if Sunday + previousTradingDate = previousTradingDate - datetime.timedelta(days=2) + + previousTradingDate = previousTradingDate.replace( + hour=13, minute=30, second=0) + nextFiveMinutes = previousTradingDate + datetime.timedelta(minutes=5) + + return previousTradingDate, nextFiveMinutes + + +__copyright__ = """ +Copyright 2021, Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above copyright +notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/demoapps/util/SubscriptionOptions.py b/examples/demoapps/util/SubscriptionOptions.py new file mode 100644 index 0000000..b67baf4 --- /dev/null +++ b/examples/demoapps/util/SubscriptionOptions.py @@ -0,0 +1,140 @@ +from blpapi_import_helper import blpapi + +DEFAULT_SERVICE = "//blp/mktdata" +DEFAULT_TOPIC_PREFIX = "/ticker/" +DEFAULT_TOPIC = "IBM US Equity" + + +def addSubscriptionOptionsForSnapshot(parser): + """ + Creates an instance for snapshot requests, which + does not include interval option. + """ + addSubscriptionOptions(parser, True) + + +def addSubscriptionOptions(parser, isSnapshot=False): + """ + Helper function that adds the options for subscriptions to the argument + parser. + """ + subscription_group = parser.add_argument_group("Subscription Options") + subscription_group.add_argument("-s", + "--service", + dest="service", + help="service name (default: %(default)s)", + metavar="service", + default=DEFAULT_SERVICE) + subscription_group.add_argument("-t", + "--topic", + dest="topics", + help=f"""topic name (default: {DEFAULT_TOPIC}). Can be specified multiple times. +Can be one of the following: +* Instrument +* Instrument qualified with a prefix +* Instrument qualified with a service and a prefix + """, + metavar="topic", + action="append", + default=[]) + subscription_group.add_argument("-f", + "--field", + dest="fields", + help="field to subscribe. Can be specified multiple times.", + metavar="field", + action="append", + default=[]) + subscription_group.add_argument("-o", + "--option", + dest="options", + help="subscription options. Can be specified multiple times.", + metavar="option", + action="append", + default=[]) + subscription_group.add_argument("-x", + "--topic-prefix", + dest="topicPrefix", + help="The topic prefix to be used for subscriptions (default: %(default)s)", + metavar="prefix", + default=DEFAULT_TOPIC_PREFIX) + + if not isSnapshot: + subscription_group.add_argument("-i", + "--interval", + dest="interval", + type=float, + help="subscription option that specifies a time in seconds to " + "intervalize the subscriptions", + metavar="interval") + + +def setSubscriptionSessionOptions(sessionOptions, options): + sessionOptions.setDefaultSubscriptionService(options.service) + sessionOptions.setDefaultTopicPrefix(options.topicPrefix) + + +def createSubscriptionList(options): + """ + Creates a SubscriptionList from the following command line arguments: + - topic names + - service name + - fields to subscribe to + - subscription options + - subscription interval + """ + if not options.topics: + options.topics = [DEFAULT_TOPIC] + + if options.interval: + options.options.append(f"interval={options.interval}") + + subscriptions = blpapi.SubscriptionList() + for topic in options.topics: + subscriptions.add(topic, + options.fields, + options.options, + blpapi.CorrelationId(topic)) + return subscriptions + + +def createSubscriptionStrings(options): + """ + Creates a dict from the topics provided on the command line to their + corresponding subscription strings. + """ + if not options.topics: + options.topics = [DEFAULT_TOPIC] + + subscriptionStrings = {} + + # Use SubscriptionList to help construct the subscription string + subscriptionList = blpapi.SubscriptionList() + for i, userTopic in enumerate(options.topics): + subscriptionList.add(userTopic, options.fields, options.options) + subscriptionStrings[userTopic] = subscriptionList.topicStringAt(i) + print(f"topic: {userTopic} -> subscription string: " + f"{subscriptionStrings[userTopic]}") + + return subscriptionStrings + + +__copyright__ = """ +Copyright 2021, Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above copyright +notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/demoapps/util/events/SessionRouter.py b/examples/demoapps/util/events/SessionRouter.py new file mode 100644 index 0000000..ad4a908 --- /dev/null +++ b/examples/demoapps/util/events/SessionRouter.py @@ -0,0 +1,104 @@ +from typing import Callable +from blpapi_import_helper import blpapi + + +def printEvent(event: blpapi.Event): + for message in event: + service = message.service() + if service: + print(f"Service: {service.name()}") + print(message) + + +class SessionRouter: + + EventHandler = Callable[[blpapi.AbstractSession, blpapi.Event], None] + MessageHandler = Callable[[blpapi.AbstractSession, blpapi.Event, blpapi.Message], None] + ExceptionHandler = Callable[[blpapi.AbstractSession, blpapi.Event, Exception], None] + + def __init__(self): + super(SessionRouter, self).__init__() + self._eventHandlersByEventType = {} + self._messageHandlersByEventType = {} + self._messageHandlersByMessageType = {} + self._messageHandlersByCorrelationId = {} + self._exceptionHandlers = [] + + def processEvent(self, + event: blpapi.Event, + session: blpapi.AbstractSession): + try: + printEvent(event) + + eventHandler = self._eventHandlersByEventType.get(event.eventType()) + if eventHandler is not None: + eventHandler(session, event) + + eventTypeMessageHandler = \ + self._messageHandlersByEventType.get(event.eventType()) + + for message in event: + for cid in message.correlationIds(): + cidMessageHandler = self._messageHandlersByCorrelationId.get(cid) + if cidMessageHandler is not None: + cidMessageHandler(session, event, message) + + if eventTypeMessageHandler is not None: + eventTypeMessageHandler(session, event, message) + + messageTypeMessageHandler = \ + self._messageHandlersByMessageType.get(message.messageType()) + if messageTypeMessageHandler is not None: + messageTypeMessageHandler(session, event, message) + except Exception as exception: # pylint: disable=broad-except + for exceptionHandler in self._exceptionHandlers: + exceptionHandler(session, event, exception) + + def addEventHandlerByEventType(self, + eventType: int, + eventHandler: EventHandler): + self._eventHandlersByEventType[eventType] = eventHandler + + def addMessageHandlerByEventType(self, + eventType: int, + messageHandler: MessageHandler): + self._messageHandlersByEventType[eventType] = messageHandler + + def addMessageHandlerByMessageType(self, + messageType: blpapi.Name, + messageHandler: MessageHandler): + self._messageHandlersByMessageType[messageType] = messageHandler + + def addMessageHandlerByCorrelationId(self, + correlationId: blpapi.CorrelationId, + messageHandler: MessageHandler): + self._messageHandlersByCorrelationId[correlationId] = messageHandler + + def addExceptionHandler(self, exceptionHandler: ExceptionHandler): + self._exceptionHandlers.append(exceptionHandler) + + def removeMessageHandlerByCorrelationId(self, + correlationId: blpapi.CorrelationId): + self._messageHandlersByCorrelationId.pop(correlationId, None) + + +__copyright__ = """ +Copyright 2021, Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above copyright +notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/examples/unittests/market-data-notifier/README.md b/examples/unittests/market-data-notifier/README.md new file mode 100644 index 0000000..b5222ca --- /dev/null +++ b/examples/unittests/market-data-notifier/README.md @@ -0,0 +1,43 @@ +# MarketDataNotifier + +This example includes an application and the unit tests for the application. + +The MarketDataNotifier is an example of how a BLPAPI application can be +structured and unit tested. + +The application source code is in `src/` and unit tests in `tests/`. + +## Description of the example + +The example provided will test the application by mocking the essential objects. + +The interfaces in the diagram give us the ability to create mock objects by +implementing these interfaces. + +![](./diagram.png) + +The Authorizer is responsible for setting up the authorization of the +application. This includes creating and sending the auth request and awaiting a +successful reply. + +The Subscriber is responsible for setting up the subscriptions for given +topics. + +The EventProcessor handles all the incoming events and triggers business logic +(ComputeEngine or Notifier). + +The Notifier fires notifications within the system such as sending alerts to +the terminal. + +The ComputeEngine does complex computations on incoming data and passes it off +to the Notifier. + +The actual application does the following: + + * Sets up the necessary objects (Notifier, ComputeEngine, Session, + TokenGenerator, Authorizer, Subscriber) + * Starts the session + * Authorizes the application + * Subscribes to topics + * Allows the EventProcessor to process the incoming events + * Calls either methods from Notifier or ComputeEngine diff --git a/examples/unittests/market-data-notifier/diagram.png b/examples/unittests/market-data-notifier/diagram.png new file mode 100644 index 0000000000000000000000000000000000000000..6a9f703a9c48ca6c66dfaac5ca2375e8e3e8e948 GIT binary patch literal 38345 zcmagGWmHw&_clyQw@5cgOG&46cQ=w!(p`s??vfT1q(izvIt~re-QCTz&mF)2{eF7K zSmO*h?7h}pG3%PwB3xNf3JsYM843ytO-5Q=6$%Qb4+;vp1MwB`jUrJG3KSGMl#KWX zbr0ynEF=$giJ2RWiiiLvB-R!Y?QVwMAqH{~p7IAX$Ix8LjF@kjZ#s(t0!<=w$s@^| zVY=ULz+6NWMcJ}rBE*w?P*?-%M+vF;NXxG-saOmcDmipd3h`}j*@Oz7sP=G0~gp)2Er62_&Ba9@2o<6PD*HOa%cpc+?~13M6qee+LGhL4I66p3;W*xx;$AiGH`t96Mk0l%p~Hp zrapzE%0t`VW!G21yA$-fRAxCE7*VuzCOfqkdnYjB(RmP+dhKNs``&Dw^lt2+`J}Dp zu$O5;(SIrDJCp^m)Z&7W6@Ed)1Xe@j7gmvOZE>c6rz$}`K0oT}#CJJ45DdK8W`F!d zqqAkB$JsX~?Mji}C<4=|g%;16mb>kYVpP&S_hnBh&mTL(=~N!AkLN=|dE)#_eO0D? zo4e!r)uw&u)7M=gD5^!u6w`gzM+;l6H_K}Goro{{B^8^gMtBweodr_oLvgI=K(*#4<5M!h3Xx|ULvqN*WhSsKGjtj;&_x^JxTVIEBqEB$f;xi zTi^0-WfVjbefbW(VK!7{{LJ~tC`M6iU}m&igULhe`^dNqbg*xh&5Z=gZ&v)<&yT+z zeC?(pCq5Z@Rm0`B#u<8MpDYkvu6D&gX#Z0pH2 za;GjVI@RKy^?7*5f@*Y^H;0KQGQe`jLPc-%XQ;(|flT=|G&s%lH%W$jQb1=o-zg;( z1?tD!)3w1#+D&Yn`&#Nh z24mF_=6%c(zxx!hZhzT0$R~LRuz(2obUpF^u?-EWP|>D0qa>WP|LYNujTKNE=vT6i z|Fsy$G$I>wt8{Oc@{L+@a%B6*Hx;8=@8)+!#iRVhkQ&zj57&cyv@(Hd>Gc~b^&1>M z5DZ+B^7~8_kph1ka~=-+d&=aiaKC2pL)ldGL_>B3(Rs{~se#3M1??3R^dXrYvM%I< zNNKITgz&9>U*Rf%Q51n~tV*;DYl5tK01A?aSM(L;uHX!{2jF2G*nu~*1o)?-|I#?= zjzOE!un#9yZ#x-*ht-hAoDZkc^9&&qTNQ^SoaxTH(N0`V29_%vZkN|>y;PYNvMml2pu?74FX>BC8|)UqCi27s+NhX`yZ_h5 zyrW)?oYlsNTsBn*)B+wa!~#t7Ck|2Hzt%kj&gY8oAaC5eROVC`km5bCy!>{OMHrA% z*$@{X49Fw^$P~WY`lEaow>8N9u3v3_#OV(4aJqfE?F$V=cA&)xLi@M&>VEs<{n&-V zvTJLYA0^V~eJ}Or%aZWo_Z4}^7xI=Uz(L~iF#RaL6Kd$r!&pKdCmm*$pJpDy7V>_e9!FixLHE z!BKwy{$0k}+L~Nk7V;+XDM?;N;Jzh0kh$BwXd-;U2CJY0D3teVo8XP zH_;n~!FFH(*=5uZMTK*;7Q0^$>k#l-C9Up%4m|uybE100Vrh6?&wCIC0?Y}kh-E57 zx>Ze>)BU$JG%^+zKfKobwujRPC;4sXSi3h+SZb~XY*;Go7n)pcG=6Lazz@1S)!NJw zdW>oAcwgufp?QeG_+b|<d;I4qit(T-)tB3cYe}fJs`HNC9> ztEj0dQwtjr4*G~Ul!D)63hpYf5U&DPP7Cpzww+BvNc$8d@MML->$6&UPJVN^C^s$B z(w;vU^o}kl%+q*6WbbT_BY}@cV_PwY_UP*`yvrb`soC=pQk%;VpBjOFaef1`>OEid z-=*HEA2#Or$x54j<-*<>%rT3qQxQ= zDtfK*%uR5P(fazjx*mQHr}b2v^>p#i8^Gb^G`(Rl)OS0Y{~mP-Opg)674WO}`>_Pn zm~=1%1bE*?I{D4OKR+keyWfQkZS`G}nRg65ZB@~dCN`3d#;ZDhPpW!6r8?4RMXKo? zx;&eVj*GlBr7Zx<`I?O)oX8H&z4mMZtI29cH=iWI*WeA7RJ2?7ue5n)u&0^4uP~}L zoVd1E-(pOCF+fAQLP!w1k&eQwL(G z)+__F?yvq+Vk&!rY;%7c)U{+rEryCJ^yZG_a5yJXC{isC!?nDgp~G6vA)C2^JTDZg z2Hj{Iqq*TN))bCWqqw)sUyBYSk{M-vre&RWJ4~+Hq~)=~nF(#|za3+#g2s@89m(_1 z_bHG5G)fJ8p(o5AbWKAzKX_lnxC@Kq`|Pq$YyPF%AvEm1zmp1vg-c*q9z-Fs!NW>S z9|BRfZ=q14448`0L3pGFVD&svc%24^JS-ScgURQ!uIUo3)K>2sU&t);dZV@cHpA;JQAW+5TlT;*~lWw(+ZaF1AP1C~y(W#!TL@`e4CS zx$LRdl4IO0HM?thB9@7q*G<9;{C>K>!oeSC5}GF;{-#-`D|yIq?vf)*_d)?phSX8g z^q8--nI~MQDY=Ow*zC<|T!WJ_R$65%*dh@kMZO4K;YPCHX&0LHZgnjLE9xFGuSlI{ z*~>88ibnm2ZT3{;f#Z$$s+Gg(kQ zZdH4b6#8I1D9Qol_uFn9v>^Q6-MO`mf+wn@Rgn_WP#Q2;hvUlDB#8rsV}w@fHx8%sNo_exMIB~`9uDpC zj%H)o02cM{){xl&Ye%XaO5H{FXfXE!P4Q4O4{x^<5@z+Cgxtz&veZlE^9!>a_{LxgVpPId165s zf~S7VK|vsxDr+m=F?>h!zk%Zdv|xTRddUEO#k;IqbO%fOe&n^xC+;E72zY5KuNYXk zgpYs652Z+H8(+$7SW_W~I1{3N&f9@s|F0t`q~LUjC0BxK{%=&|fDYK((R37R(f_y~ zObfvMbPGTqW==_?16jX z`$Z0!mYt*7FGbehj$H=rAD+a?u$H*0%HC~HQ$Rd_zqm5mzu_VD4(6?KC&GR%24nQ) zC--~p9l&B2SvRaV?EG^56et*fbM%MylyJj!f0N!*a0~5EyJdTEP>TW)m-!iScTlPM zSHWpMBkx*Ab7WFr`kkh71OM~A@2Hi_EI4JXmbFQEj|gNzH$nI4DSS6mDt&w``fbXu zZhUpJG{bN%R&f=r;>n$bGpTUb8S(RD!=vN1RE^&BOOkjbT`c=GtDsk~qeFE%j`Muw zE4R(uavbCF()G@Y?rlM$g9M^IGA92U)1FqjMcmQz5gf~i!5ZVqMN52w3U=szi>ARP z%0lYB&gQzw@iD^r>-FJc{@3*)tIYl|wa1Cr!V(^HX0@B2D;I>skRSqGOBM*g{tlrX z*g#Ea`wSQ-i+dLZw`39Fn*;fhK^ui@PtjU;>yU6j%|4H+~?8SZ9B7GURaB+R7%{Jx^3Jq35$i?J2-K`j?khklvh7 zT;s1{@+u$}iimnh{A^HVce~}e@;mMSz>7QJ#!KCiwm}?dS~G^#KRlc?HKoq$d+)N# zXRh?mI+K5^GwX)o&-xhA+u!iXblS~sPUqW0_foP6su%&1W9Jtc#iDU>H`_lyGt9k1 zD4zEZDvEo2uNY>u&U#@Dk8>D<_!ks)Iuk^)OMs-OmdWHTQgAp_*V|Q+wpK+!b4>T6 zd5uri9%movHA~YT>wIm}-ka8g$f3Y&-3%}vCIs2fHwUO5)i$#4kiY-U*fUR)5+?QxaP8)UN%X3DUC~Dlh++RKV*p&B1d!EsQpz=^ zz{L>remnPNbGz69v(VGiqZU?D56E-lq@7J*bC;adAKRTA(T#I$FK_TajL_>6b)XE0 z!zfY$u0y5bDzg-c4VLG=J3Lf9L+swYxsj-OmDl=%-luc%!S@C-) z>lo8A>NyLQS@F&#_{H1=p@w4%*0>h+H>FFFP6_I_*Hae#UmjMf0i1|{ z$00Y9*IDwo{l%~Gr0v0MuF^!c&Bt@dq+{H9tqXpOx3089UJEnV@o?uo5Z@|XpRBMT zpcBWD0g47304gKDyYD%wl+Ao;tHKF#sqgLtl<~)hQkd2BrIP5=zmwE`&fs;nND*kG z_*?%$#@PKC+!a1gSF@@$77BO3Jbm`90T77cS6AU+>83U?ty4#9OugV%KBa5{dW~ZB z_?>KTMWL5RXPtWctoe2vZ;x}=Xz2BFY#f~L%6Xzf6Sx|9cF%WU|NF&I+<&rV@-#Tf z7-D)Lf=ih-@?R>nw<3NB9ym+h<-InE*q^On0nnU{x7R|I6B?MLpyVclCKoIw{mKhU zJUV3&2909slh&K;Mb}w_CSFKh32Cc{Fs8jxSj3Vc?P|9f7O9nE#0OSsi%Nj?;BrRn z#@CAjpeN>xuT0m}P^Neb3rqk4Qu$>~_~kBEH#p3ze#Ni({5P@e z75?asVvUjlAZt)mi@XO64O|+Oo2IO^v~uKGB~FM&;H<~<)0xV2(^0j2P6y zqA?qlVS^aRL@P_i##!|V8S$wMbl4vrDighLH zMUQD|_^$I*(PmN#k@?Av3mnH*X%wpH&8j9ULhG?NM+=2-_V&uphIXaMe5sWL&VonR zr?&uU7v#xXGHB#1mQ;s-Fw{^biEM8TO?y!A(Zv1F5g z1TI|8;Rs|4^{f&spp8OBnKgdo!GRnp%Ti|Cg^<~ET_G4!{d9cO8E zR&D$w%JHZDDsKEF=9gf##gjE?ZP+DRgj#4LQxE%#3uFf@@DY5Bg-w6#(p0*hxKEVd zy~yri(`-go*dMl|f>{LWP8oJe^o-_jd=&}6^NIYHd+f=v)igQ2emEjEJNSkxuVUR* zu0~u(?&4riI5#nJxD1vJn&e4k_o(slh}gAp%M?=auNJ_$U_WJXyUuyEh&wuJ>1m1O)6(ajOxt zID-6)fKVOtxe`QE>0u(WQ&y@6q4RYHm0gTfAD)l+=4PdslUC@&9McxgT6y$35584CIz{<>G+(RH z04qv*iNY^8NAoNF{a&wSS9vzeopx^O*RT6>8Z(XrkUhi+ZP50Lv0D}Yz$MW0X`x=O z78$qTPVj14FiI`!?K^F9gZaAnp@q7lgHjA(Rf!!Ii~eihht1gvF4_C}>GQi#v^o=v zIBxSZ@AH|VAa#Sw!fqNDq0JNB>v(pDwE@yU^|1nzY$`%IyavT-F)Sf$Xt0E?wTi3- zwWAsC{){-U+KL8`%M9dxwRs8TwQ|JrC8d_E#48NQqxvb1!hq+1jdbR?tqw4sAM4nhl>i zo*ykQRomW4!JM$SERLC8x7g4ci3+)Z@c1@VLrseEiLaE&j<#9S3kSzA1g0!>7`6O= z43?gom}T@eyY;+E7jRA(kJSMKDEY&qyjKan0@x$+4RgWAo`}E$H6=lse5qLUKi}p7 zqx5qrZaB=rMCoJmhlZxp1O$U3o zJ3y8^UJ`}@TdR1rzi(I4dt->w+F-xiX(ibYJ1;c#>nD&cB^w`RgZq`wRowT-D2mbM z*Gbp#r0E!S8!D3#sW5zV+t8~56yu_W;s_UgQqr&$oFN+r9M0@0nw41prb2ZC%MdoSLY5AVXteX!$megR1l{N)EqA+Q>KSZ8Xta z>HF9{CyI^0_cjxvTUy21I-WkRt$elnvid)HG(zv)K8ekH{nTVx-hF6uQ!p1%trj6w zO>d|k#OxEi4~0g}ikq*qXAvg8H$*2BEGT!MEu~?V4{J&LHs3uN=`RN$CMAc8O2P*|J(8h+?R;5F06}hL#6Hd|H02zt3=Yv+ue?IH)KBOWu1&T z+r3|n&WAwdmzTC5p{nE8v&x&; zc15CoX2*`|pGV?E>vrp!a&%hXbkukiG>?Z-Y&py(&~nOput{GizgOKPt^3Q4lFa{} z`_r|uscX-J6Q{jEO_9g(q7JCDteX~d#_{l$jg!lx*>WT+Z}2h|8h=akE>5G^>{GXL z--DC+5J8j2{-@WQ>u(9O9XUvCKZmmZ1iU|(-Q(1l*Xy!KS4sJsIMUr&AK8cotk+8q zo>5Uq^E_)0?kgtr!vIj5?H~55F2Sh9q@>pboYqNA-l!lw4>Zxcw!$SUSVKRo&e zJq=y$l`quUB~BJ9l^FR~>cQ_H1S_LGR);j5%731#{4hPe)zSpiSxj$62sqK%p<6LA z@~{w9#`4e}&`H?eY@5VqqwBDi1XV^DJ!-eOuNxI^CeZ7{R%7adZjJGqcZt>rrWq~T zcaJMSnR@jH+ZNK|w>G<m0|7+)O`0I={rB41Zuv(9niQHKh*L>bMQ5`kI#Jp$52fViiL( zJME1QmLoL#siJt~wJvl%$5|2#)`+tgVv#WHF?i;@{Bf!X9#dOC>3?j#YVpZC8nsNqmAdHk;j! zun*sG_&s_c*m#L?(&G1Iv-Kg0v7X#Rb^p>4b*3tSp}>JfXeo`-n37m@2=YR!2^L?( zUyJ6)&qK6h9cokAe?nh-^M!XNkGKdes6i|Yy;tc^e^7jh7>Acoa)Iav7j5{#wWUyZ z{IfpYnWXf@0`DDKy9>d-0|KHWgNu%orZWOCGlzQ}-P+5hEfG2*;LFv=-dtz$Jr zYL%bFUJckv1Ex(K8)yv|)+`{VXWH z22ft<%&m|ekpl?BzVnl^R&dyxv%YL^+-|*0KIgi}J0*+-!ryr_)8S9PyxW|f0KUPi z!rAWH1x*8lP;ZDCBPHD1eh{!Q$JZ$t>7nk}WJs6Xghfb9;gLVG2W)Isbwdj{^j-4_ z6Vo*}-nty~?FqIyyG>J8`%D*WoL_*2OW^Cbp<{@+6$$c8`(ijPOT2wzSZ@&HPiZ^p zdM;|5cWNcRHrW9MQ@G}kOdiLsQ@HL^33*2VkJZSCA>l7($L|KP4fa0DZmV8Af?$nY zW>GrKa_Crx#J37j_YI&kI~pmCb>VVqhZ4rx9~0D=YjE}zYG9|}cDohpbh4shhbtnw zCoyIO|FNpEm;rwnRz73(T?gbBn#vFyq+hmwR4aWcT6(nQOD412m+4PhE@J#_^v{M+ z+Kjh1orC9$N~KO|{=#B0j{{SAI}v9bhx)neCEAiVhGk=P-kvN;1eo9+e`T>gfP!(O zU8D%^JffZ9g{mk~Kb@W2D(+O#!S1JkeoO#fHlZLwe>{`dbQL@}6+{aD3Sf`QIF|m@ zs|e8G9$CNlBO22VR~d}o|D*wR9xS+5sQ9^c2JgLt7=g6#yIkt%x@*X+$8w9OUkEkt z#{hN8b-?$<+|qADEy;FRSE$vr1ekRR=#6t4Lg!RJ7-{YsU|T!IJsSQBdvXL#+O(zFNFPSP&*f-9( zLR>b4xZ5L}r^&DX6zY|E$Z`vZc@d5?;2_QtGiM$l1T*g)6>n;^Vcbiom(_*m`63tC7DL3>1%sQ+}D9Pk9;djcg+ zSc*_~=?-$Bx(o{B{u>YgQA1U*eUy)P2)XgNIbH%C23G5f<|^d~op)mhBbI~Yw}w(v zaTzt?RH@D512!8Y0$6`!Ag;b9`__mgC(Zu+Y!w!F*{#?mwc3gC@}_O{kFzu)gb+g@ z3V=B8@0&Mb_|0ZYb*#OasS>$kXev*ZhzkGkstkO}`Ql>5q{{beq4Oc++daqosz;dZ zxIrM%dmH#yWeXumq~Q%?NXbe-S3av04g_vNE<9B~zh3y9I+V)dZE?{Gi`2nWzU&qW z%jp~@`yf=t0?-%Ow6b;Cx91WOR}w`Kk<#!OLn`&Q8Yd$QME|fnM4-cbfo|PO(PKhD z=@WBusx~L!_^S?z1ROez_0AHM@?o}5S=5+vktnrmF4!+*khzT$gh!0WUr z{d!_84tQlz1SkLyS%mXRQbU&jn}=`JaF5nAHz#$A1mP*1Kb*9CYivSL6Y|5rzlzM6 z0KuyY$1;RZLI9dclh5nYD#ejh$cJb5p(C_pg$Z^mpzz8RXv(WcYw`I z0gB6dxE!$%WU@;!0Oj2F2jruJm7g50t5%y{|LGMRVMs%S2mr4zi!maG0!qd}n;w+X=)8lBYT_Ib9a~(|R;~tk;9U(w5e*rBr z56W99>!~K>s6fSL-m1J&P)H^zSxy`!(IvVYmr2bZWd_pLMwz?gv?m^A@w;+JbO zjYxgE?0q5w&?u(*9eTXqVizgbCA}~9PW3q*u-3yrW$MO>(wbOhOGx+B@yrNo6P-Yb2^$A>kEo!4wd(B`IM6A_+wCMfi+$^6I2gwS+7a$A?a=3pMH57`z z*?|=VFr#Dv@KoIcz8t6xJ5<)GGbh0r?*7r3X#4XiSUT+?biDaAAH13RS!-xIQIERZ z42eM4Io?IVM_Lk1J^?UzGLR|5^n8qz9=s5wzAEDltt#f%&Zv_h_%(0rTlxfBee)p3Jw17K zRNgnCG|+fKFwu0^S}a>Th+7~z?eWK5Ff-pu-h^H;e-7P9eP_~{czP1t85a4E`Z+jS zw2zWI05lg%I#Fg~2`IL1q?@UPy$j(cnF?fcSprX1Xxf`k zPTQsDP#HtMt)Hh$tb9TpWbT=zGv9h?t5jrM%qQ;k`_{)x>T#LFT?9kA(rCXrl=u-%Km1J;zxQoTnmtc zA4a1ONt1v1SDUbCB!H57Lz>7^bBSEVadX-er_Rh3(V)JSM_uB^+- z*f~+yUx+}kA(s7Dm7WAhR-xciHy_NMJoRcclv009UN_EPinKlyi(Xg9a)mpw!ck8eY2I0gIG3czhLBI185w$sEvAaKV3#5j4n6%j$K zy*LzTdn7}ugN_FdAS+oxD(kuyUpD|s5jltzs{x=R`do}~o9t&TL6{H${&4nJ6?`^- z(*z*DLQrG9I@@^fnIB zZ0H|oTFi1wX26OQlfx&71Ryf${*qqyI$$R3hhCRqgV2E%%eu-qq+0(z3ox>|KwqjA zhJxvW-fkjWs`$VbHzSTY1EOCR{|PX0>p%)V&_U5^henVFQDYjzJleuRxO)LZz(a@C zNcl~Fd;LxtRAk#l-8s-Ce2UrR-SCty6 zAsAqty-TMn{x4S=(+4mD|DSp{WL1NKRZW$DJq=NWe;c9@NH1tb!t5rl>6?}r25X>H z>V&-}T+hm| zADnKTEqzs0)x-}4qVVwW0nJgs=@z)3EIR?!H`{}1Kp6mjChPWpD3VSx#=pN{1*WnL z;q;Gs%U4uI(xw(C zil76BF%#BG(dL_AAFJ7#LN|&bON%CxL0*eZ;z}AN8Plyuw%@O?^We^)#Tw^|j26?= zgwAdO)=#;Y9)|=nB$*7(h2TUtg?UB{;=whA$-nqu=391?hCE3h+}xIh3eUa^jZzt3 z6K~vgIe*Ww)Iamt@XX}1FLv>7Xm0AGyX1(lR1t2@&dK<>@nc}Mjin^DJgCHPdt}+{ zVh0+4>>hmfoD8$1Iv|Nh`h}!uG_dkcask;Ji`XvO4^dH(5E{}S=Y2hMxOSk9tqSm9 z2u{yykG35~QiXG(NQ4wg{R&!#4cXVV)Up!GH=&0K?T;FQrU2z2E>wZAcn4SV@;p{Z1#Bfhj&Dx9;pvk* z0viZc0N7*GJFoB=)EO$QI-H~2gtP8t>PVNr3Gv6p?mYZl_D=zLXvjhsXUUAnZ2?@L z#>J;QTc>wWp4fR41F~+?3{5RZ@oFi7(r4}tPnruX6HzFGfZ1(OOzO3@ryHy(6jHBk zE#b64B!mq|v+)Rj6-FF#8_w5eO=CW_?i-&*iLLkk`iC29aab&o1%O8V%OUF^^AGmu zV4b;hC7j|EWj7Y+7z?mOljIbbl0qj{F%-t90DP(p6qqmj!FT0Y4UCda0#+|EWWH*l zG7^5tc5Pd}t!3A)1 z#YyyCg|c0#FLqFxHq!gFFD-R|oIi%#c#EQL&^fqTJrFPlRzRAFPB`CzV)*pOdJDIg z>`Y1MUi?)ov5OilJjyafm5@gv`m=*HwzdAlMp?*etk8T4lfeWloJ;y0az3%J7L`Vc zXZP)lWKiR~V->C0Svx<$ixPH1KH(*aZLlsm3#vj2ui6eBMkbe`z}BhnB~}L>-6Q3= zyRlLF_4fO{3so}nfb}~z+DF}Q(OS-JJFV!cV|Pf**qimkE7Z+kv`dewS-HV9$pycl zdwMLl9NcCw9;#gwboBic{@5L?3n$ zu9h+WkCz4tLq%Gy5L+Qrf5ox6N^9CL@qCVvO5`}emjn}vfxS;T{LQI$a8Rts^qU67 zOSm=6E&N*YRI2&F;>};YJaAY&%jZ9xq76O6G91$!5ly|$UV^1v<$?hId!37st%pA- zeM^kXq%R#pMM1WPJ;nm8{eA~g44a89K9xUnRX*9hk4NkdIH!WIx2+fO7(Tnn#<766 zGy&M~Jf*i!2gE30#?l`%=$S~ny10xIuWe20k$;PKA@-1YmUdKVRkbA`z%J@dR3#$z zi8K$(r3Y$*0rn4PiwT|gQS$6&c=l5A4W3$? zNqEtcf%ODm+SrfGC3Y2J{RGu{0-rx_p`Zod?=CT1;>kZfb}4Hb^`09<($pn}&6yp} z1@7RrX9_%<(O&V2`wHxMEK}et8}CMfzb*lK0$`S=ooOya&28yqq%f!WT0d2Lb`meT z@@XKKo)F*sb4`J1%|0cAR*Ccs9_?eqZB6)t1)*?8!LN)h#2#PY8JIF#`}-|tvfV$3 z(E_xBH+ck(qh5_pTM@w3sG;BCI5eM^TX=E0G*y%WUX+?HusU86qj=qR7FBE@F8zxx z%){~s&Slk23A2+`=dauw9C{LU|4=`!!VwzLzRDj`C#2@z$^1sTW)g2}hgOX2uht*? zvOVPOFmwI$>h}BWJOSU#Wjgg2flpebxPD0#8J(i?Wbz(;JlHx7i9Cs^*+ItH*Z;Wc z2VH^^*nGH3SPAw35=Q^s0#E>u3-#n3s!n$H!AkHr&vh)`zmYW%m12Q__@L46*IZsP zKn|Xw&jq~WH@EnS$P27DpfZN4$rzy}oQ2x;DHSI2naEs6uXk^zz;~+#G6WfvN;jUe zS$=vO$NbTgqT}f2^`Do2xSfnQU#wp0XTFV?l!%Y3Py$O3`EwH>UIzn_3fG$cU>|If zhrg67Wwy@iHnfjd0_D%tK0)F{0*4KKDK=gUoc^2I(>?X-yTOb&NSna{(-$$8wU#@E z`+v@N(lL52tY)~!atbp~O^JYDtpl3}sO`AyO-Ot+H8lr_R3KbZ@=y0Kq=%g`saXcO zN*Ezn!;{Xf-Gz>aS+P`dCQP<3+h3t0N}e@$BCF?~73#0Pw+XvqE(CuL=!|eYm%^Kg zCWeuFKGzCoB%;;B_>4tN7c}`M>l_|cubx@2Mt$DZ7LT`s7aJIx3GTRI1D)6Bw$h7t zT$(E$icNak3es1r%u99}64cxDr{}find_{mrcj4w$ zevDw}X1_$QS-A6YNX!3_xJ=2u{C$kG7>m3e1_=+-r-O+pth$EvRz(Y?H|N9496tHK zgJQVmPHy}2sET!Z?@$sFGQSBSo{puHi83n*cg)j`-+eI+v?N;I0Vs_G*``Ys_F;_o z+y}t|&i+l&&jEjYA2dX7mDDiZ28oVbq0LJ7A6OosX zYPp)xi{VH(bH}lKvnv*INdU`B6E-Qh_NC*c=015T)&I$#CCd2M2SkbQ3}>Op_u?v4 z8~13LBuyClYgPf>&`64P*ferxyn=WyTA>W%Jm|Q4P}f1i*MR$&3WL^axuIEuKH)CP zv5vg`hJ1#r&f(K7MvS!{?02_^*E!%WeG3~c#*e8LjDUy1jxNCZvL;E46O%_OWS_R# z`s5~tb|ldo2FIsaqN9+N5>^)nt#b?2MfC-r792+Uby=HNX_8UD~GnC^XyeHXU4 zP7`5dli{i3t3tAPV-C_!`c9?HdE2+jH@b&C2uOh}{#A*2)3Y3HXQd3?rb# zR)-tS1;GE+%r}MP%*+a^YHGgr>+h)u{B1nF%E6O6&Ju)uLitXT5`_dt@ zxKqKDUot#3s$vFcV^s zjl(xtP^fDma>9vn2;74JE;Z%aJ-g6@^s2fd-wJ?K@`QT>W(RMUQ$9+V`ryWYHw1tn zv&E7p8h^hNT2YHnufK7Z>DEG6a6g0U9d6$k8Z^7r9z8*BB}PS|E}SdB<{6OQ-fINq zI1=`OED6=a`3gi|I{T(MesvkaueR2*JD5=0bpJ6*FREyDX0>&IW5G7FW+C^R2z7+{ z%()(wCfyMMWpc>lI&@VmHS+9;Tgbs2Qhms zHOP$6Sh(8opHuEKEM42c@X#KbCWx`5i+!wcCYW!97bG-G=Z!rKP3UZ5Z2u5=3^=+^fpwI zBW1FCV^m$1U!2}qY;RiP3a)KOvQu@{H@n1e)66l<0Oy4jVg_x$ycFH3eA z3r9dV>02~>kcZP0-H7Vj%6p-(1r_{GH^v?>f)S|xD5EQrotFEZkJHK$3RnSwIV1M@ z$nva+OZaWxB7XTPYd5B(_A631>i*!WC`|Mc3<>hfA5r~Oxi7GN&Otl0n6FBo!Nex$ z(ug%3cuk8!H=36~ecKIJ7y-;F%5Yf|`*Iuk`%RT~R|_%rocrp$ZUhV|sj7!!>M(x3 zKn3gV8^6o+$MYlWt@vn09noH}eu0+&0J=S2T@WO(6zxDT$JeDh}Sf*W6lhgFO zQ_5eiTY5-x$8$3F=!UA512D|~O%;~G4k4xfmF*V#_Do*J{I{))56@@u2}{3BNW>8M z3AP^<7TPq|M6Ef)1^r6_m;5H>&RtL^x% zy6RhT9O1A<4aQSR5&Etg5@opE6+HsX1!>?WZ&Z^NEG!oV#fPt4b_@{8C(B}Yzk-ZR zyh^_0PsV)`K9~MezP`S`lDfF&Pm^zJyWv_Ur2pYA3;}mJ%~#rdi=!DjQX`%owtzdm zgF$HE%TP2T^(ElWYkyB9o-5}<30H#q@ghAyA=c`PUC^`uZ9s@7kFS@MF;NmuahTUb zugJ9Y&kSE&B2N*Wt%57g`nkOt9SghZUFhKa{6ecrTRXU|mwgbZOs5M=roeNzyn3`X z^7t3G;fpId1GP+sR5?)DR7}K zeoV4Zm6BgSr>yb{y|w$;J;h|DvB1EUY4lo-@nDh>e_(9&6keI(&$tBrKa%fSKQW9 z(!j-1TA+xR+R(r=4JYXsO~_fGTWgc23%UC>$YR*ia5!HpM*uJ{l(b0q0i+#i)3iR~ z5V-Qall0+H_~kS3QoccamdGqH zlr8fD>Q!pyuRFYC8a*dnHnfF7k0mr)i@2Fb$^2g3M^sjFXK9At`DOaI9m4J=Mb|n-> zFRNk0Y znu=s~1h1luUoYn8D|jfowYwQ4FERfTvuV;RKSB2o#V;pRp@vKM-_7nsjcFLuJQ06N z130W?@imn9b-mR%WjA6N8#=hU9Vzq_*amn*QxZ3jjhhTn4^V5wYZ=WJWCU`imd%k2 z?&cp%?yMj^l2RfK9FFxpi-Ruw1d4{s*~1 zz(#)qi{#HUus0SYF8ulp6F* z%E6fe58SC#7NZ=0u0GlC{0TjIqRMS;No8lTJR_yrH2EF;hu!s(oaVGYoQx*#gPkiz z{`uk^k>qz4!7fCJW}9azBi%)P%ke4oy|1@p3h>Ka9QMVwg8?cS`3AJCJlTG-?N@uc zdA9Vpit&>n{z9(nQZ&Kp(};PU2jU@lipUgBfJ)fy zQl4oc(Xy#WJXU1n7(x;iDl}W4m)Xz$ckGEZAxa1h&4bmmS4vpPlRz zcnWmsIJ@g@>${@n)o!I|4@3OlS>70IE)!Rejg-SMz7%f=k8Sj4 zXoH=0dqVkG#$%8g{oYr^lb(KO5!5*r!KEm%qcqFDjJ8@?;T#QL7yS{4WHkoQM9eU}?hW z>t0F=E!vvYH>9S&iK&vHe`?)`r@vo^HvmlN_1L~prH4`i4L@hEr| z%!omj?z78eQ}(!#g+B%>H!Y*QYOOVsZz@>ugQW=B`sV(0Wx9|!XWto~437W2!32R~ z9RKtXXDpO08 z?7(TX|Df7;G0SH(zgeJ|U81QZtw=4QP2`gwW$}J4^vCCwHg>!D_l-w&3zW8QS)7>; zf;MaWvpSbG))y!KFM8SD$Gle;N6ht$3AJ%2#A3!P&7K8b3(O{y2+QkhI2LlTePmpy z>y`8y-%UO8cOG3EqkO6?Q!sH@6r9w50eQ0OQ+h`92r-hgc0NFFl?7-u@cuYhk|2+d zMr!*Jh7)Jm&neR;R{LUgl}cy8ok8{1PAY^y<(-|P%O89ZN{;kYbciPS+UK)0;1Qfn zR9I0b`*IGc!B2O(FHPmgc(iNZ%U)#5w7R&`ceMuI?|~#Pb}_uG-JdTubnb!83@+&m zio7C_)PHOX^l0SY1*9beV^#8H<7G70F?YA%- zQ4Z2whXz4JQjtzcl~PKOMwIUEmIgsU2^E#@?oLSo>F$(n@U9K`d*APV_x=ahan#{( zu+QFWul3}d^C=r?&+nHz0Cqw-fCu6uW2YHC+#x2EEBx>1@!akG_50_D!rIBKXB zre0XkGAV@%!y0Tx!I}JWDAck^v_;+Md01i-5F9{`H<;gs^#$SlMAits$|BEN& zb?h(lTi_ZB4NQKm>Z#{bZn;EAna_EKzPI}qlMmiaW;fVZiK)mDnjo@s8{wx6KF?<- zZDGbR16)dSzO)M#x$^H%z|G#M=01 z9$3Uoiw?yQFY$0rSZ>WphV!Pj%SJI1Id8xkHZsX49y7TB#iM@iI6GXfkmq}Q@0|Hn zs+V{ue0VQ(+FMj?X5^eRWvexm0nPYD(#vAyh5hH;x;%}6q4&vBLe$Jm_1B*CeEV6H zkgaXOCAYShWpX%qFwnEc-yG+VDK^egvf#V)lCj$D#~@J=dqaNqovPm6L5-a|sFW+8 z5TUN7v)I49F~tgm&fVv=apt&BrDkZq0?TMszt z6~}HLFSl7(Nlmuj4ou^NT7ft`P6Dq;tJqx=BXG#J`_q$O1O`l&;5pZmNW|BaqGyVf z3ni)!sfOnKO~KT%Nt&pRNm$?eX@06k)@omr!b5ed0VtdhBAc-Q_|hyY?QQ=swK>pk zy&dKxNycZJ20&R+E%`o6lvX(az=MX8_g5GT-TM&W)>Qm8Rtl_`g^q@}j21?n3TG&I zZJQ`}lJXn8e#s_xqsu$WDVgu5SS8@E;*LwYgrXC(W=X08#g;FJJl>26;?GfVQLCw z&)SQ9wx7E7E+KieWUU_@<1Sl@$c&#IdV49~+9HYbrf#?LDn=yflNV?-Y6-bZ~!#)7L;4Ch@d7Y{q#L#$FTTu&$Z0p5qJ%whlB2a=mL#R_{R!wr}6RJ7u?u zUG^`%+NkTqMQHUYZ64n4pS8cr(;tn zx`c4L3V^2y8S*$E@@NO$_isA&-jYeIe}UrD0suk9f@VD58~PWQ)PHH}UeH!4p&@&w zRSa73!wPvltj`x03r9Ch3Y*BiuG|$l`iFmbzA}&{mBb^HVR7rkQCPxeoPReATGSyc zQD0YNQ6i9t=WpV?{`QWH*V^D4=DWFfBCtTJoL7}4b;FNpfr5i6|I4C!u>leKb-l=s zAIac~(E!c}y)Y!usHI>>lT$`U^#HgMa(I#Ppe#Ts&;#b_!^?_?^8Zvktck7)z>nDg z?x2tV5W$P~SOD44?tN4gJr~#WYD;08#it7^6x^n9GuwW#>Mn`J#A>BxK+i zu;OC0*aS1|Up1iWibH6L09On9gtx?m!iK;{EAy%&)^?@2d7FS8<2gwhyAD1c-nX~? zKMMYjczTR*8&}sVtLfGs&psJ|YHi0oOsxOPNe8(t7kl7h5Az0T1ct8>^>#OeSEVl> z-qHu4Hpy8Wf%ea|5==#xkUb<4M+4F?YP_;=>Tk4yg0Cp>F>`a2UlzTIoZ0AlKSWV*;km0e`s0t&&B%W_-fu^TE}f zlmq%SkLuAdKrT~9!A&Qt)P+vh3#G~MTCYSDrWwI&bcgBNf#yLQ!`9!6slV?5wfdno zYFp%$?J#)a>2b3_qUkocV4v7$@XD0ZmA=0rWo^Ael7L4|(nn|NtdK-v9OsZ=y~I>) zPFwR7fXa>R+V5^HySY7yX2PAu zRs1Kn1!S=VTQ?K=jpbnFv`BMD+J8?}a||B8oGU7N0Bo$?H_YIT;9_2A1cv!`U6Bn5FKv(SIp^lju9)OHi%j0_+~^pZ7~qo(L>l^{mP~!JS*y(<@2sF*4Ja5veh5yA%-U8cN|7U>#J%dv zKwhcb>w<9In{oYZUb(^D-r4!WMY zGx>oBc}xq4zmI3LZoPR5gcNY3QG=aMR#FXTo8HMb0@|z-;BQ4Ul1>`8@eQy!5}-|F)On*AQXnG{aLjW( z+iqPQr~>K*LGHR=CIMlAO(KXOvc~O{jH5$WHSYHHAr--a9t<`hjr(qbIqqw09jGeN z^YW@+6TrGZJ+hGga^`#xBG6Y@7@eywTkRi$ppRuUk}W4=xUc=P{QemC&uG&3dt;uj z`VQmJ(yh0)kOApx=USVR7BcW{ajl<2yg6D$>sKAW*h^aR5CrH7=qPBfBuBGI9iF9W zVXi)mR@85F5P4SPdTiJhd{-%bwpcK-vEI+^YX6`>LU+^o-wp6A36U8|o5{xGwR-?X zkVEP2g+I+`mJE7%gq5hO;^~9bA3r)ksZ2R((cM9s=J%Y5a{QJzir^QdG}RV z?;HI(@#5w*syCH!vkT#DnMyeGufyp{W~+txO^#VJ)&5qMLK{y~*!H}*x9&9d`i1EF zNOhFDIQ%SFpfX%RZQ(rO_{oK`eW}L?(JjEn*CC_b|CT3BLHq-ec@Y2j1B*H>Ky=$D zC}u6)qQMx=tImD(Jn{Y$Vs{pgv|*(m^2w}#J(2&4{z&0xiR94@j8`O807CHo2C7HI zKKW34@~B<(MfLj_O-I+6NdH(eNv;!#U)xQFvat_O9!))X_U4YmV3~&D%t>=a?GwP! z+!-8t8+EirCrfl&H@ddg^xXps>*Nd*#vYbWhgW9y3u9egP%oEJIQ=vU47hFl>fUY+ zS#>5Dok}Yr_f@{=ot^}Gs74B?eDx$}GK3wfFDB>JZH&eVZYu)5;KJR5Xw^I&ns=f1 zSK|{mPLX|1(}i%tkmuZ|E~=xBHGa&$&?=#TFm6y?DhD{G1QTBZ5!fa}FF?#m-3w>G z2{bDmh&%LX#s%%jj3vIyvX;aYmCWAxV1==DHb6x45HtJKlHt8nLP%3n9m4PiAq7-C4f-{kuV+nng@U z^Wp}_ufQ1dady!koe2heH^l#ra@)oVN&v>qMpV4J*0#ym<8Yyly%|OfiFc{g60)8{wgjowxgt2p}-cmek0URAyXv z{m_X&?Csg!eX-m^^)fSKxQix=I7dB{7jGxQHYDeHSondFR^rz991afsx*CV=vI41~ zb5W46P|0Dmu=u--3OVP^l-mNRKsk1r8Hn7J#IusLf_>NXo2TS$w<++jIJkA*Rqb^ zDhJ|gg1+}X_1E$JWrS$J05;*8K!xoJt=VXiVgOB@bPf<)g{tqXgPE~0B#;|qf(c0b zVP9_~dH_{5{W$o~Yj{D~t*nw#R1iNUyN+i%kp(dDVorMpKuhd9$gv9C&zS1u+$3SyU0+2UR7z67?>_0}Ht&MO+ z0b}?!`9i;D~uTO&*8 zwB;k!ZBn1~T*&_f=k~?>cl|Ayjp&rJuGGP(BvPxZ;>00yEfk~XK20kEi{T96~Z=;6`chqG!p4=jj+GA`ZWZUATltd*1D4% z%&626UFazYv(>>I3){m~dkSUBoxYqk{fY1D?}<95lK>e%3)rie#<-z^-lNASR(7ya zVC@Ie_5ACYDrVk>{C;1pQx7Xcox7fKmsFW)arW0tZ z7yEq44xcz*U3*}+em`te!Wg(3rW>s_`2=y(&*bP4c(guNfIYAj6a11?Q{(&+HVi}qh7{^=t~tYjK5 zNT(x8m(OpiH+3g)J*ys)I%v3uVPX3{Xeh*-KuopDHbXJ{N5b*`M=Oln2YRs^Q9`uC zg_?&;@qbzlAq^WyFNayRroJ}e7Bx}Q98oULWiK=##Mh7n^J%YFu`JDwVYQZ zf2^2qP1oYMC8UzHt}N66&iGm}7W#GE zNzDk1#iumh5hnkSi++xGiU+g9&?VuITLY*fPe&gr^FJnF(;5$CkQ}KwcPU&~nYoMl zXXf~s>k)2xqQdib&(w;g=Q5JYBu$_*9RU&xI*SoTs`Os8>U%eHh66}v2yaA1VY;1E z$IlZYa0UYV1J41+VnxSR zKK?2)P?V$YQAP+i(+`(mqPt0kkbEJUI1VysdGh4jM*n@+?9CHrk2JN%kb)H;cPXLc z>826fQ+eu5cmt7jVYz3;B=7XoeAcKZ={}$j!-}M*FGXq)rY5)y@Dp&o zqJ1_ZzT~U@3{njOplh4^-q&l%H*QwsnQ7iUB+aR$q!cZR$P((b7N1Bi|D!N@xIXfn zw3TPwdxZ=+Gx2U-561!j>#OV@916hVa7|>9YtX0lvcwxMFbw81{Q)XEGcOuB+&~9j zJ+Es5BzVzsKpa~&f8=QJikb(^I1v2OD8CuZvJeH(>2)HKff7jqP6lleG)jO6QQS-} zhW6De^O0k?E`|qaAgtO7tSbRY%B$6?rw6Lb>?=y#X!D*(Vk~(CNa)>pf49dhYVTtU z?nOYl&ZJ%J3E5gad7xaw-H|p~^!7QHv%S`PkdNJ#!}0YB*#>otcR1olSOP@;fVDhfQO>sg8gL29c;o_w~lhti15a^kf|GIK~+TektUK zRw_^l=xhc4de>t<4Aw-slF}AvS5;;p-<8iA<|_M#1(21E0)(G*x~dzr5n>oHwNA&a zY0){s|AZ{-P@T~TznEe8HfUZ5y$8BQZK=ub%%En2!Hm9F>a_d1zOQ{a`O)zCO*?ih z0<9lUN$q|m+)z%Dy?*Rz9;lx9h+#$*t~F<~)O}aN60_v63=loM-}gp<*gi*23|-i- zt&f_ORqj`RKb?^X0`2mJ0j;b^5G_$R*rhDrL?>zkC!{bfOz<^e&n7UiDOmJs1Md5G z;I?E9uHBaC8k>T1r3_YxK0>(b-yVd-l3Ck+CMmucyk^QG_BKkVSYz3=4?4T|Px&{? z#N98BjUcICnl%7Zf%$BLik>8;g|$@O2KwlDj>qQf@a!uaB_;#vGYY@#9kl^gE>^?5 zyjkf931fSE`v*hbE(EAlhah-4gLN^~hn-EAd%x@e$>XIL561oz)`^5c3=cZf$RT(o z=|Hx|P-bZfs0$ak9Ga&Ct+O2D&$U3EpzY%P)XWgL6&XMf#*er#<$o6iD|OMD$nl64 zc#XINt?f9$ z7v-M>ORfk{a0YPe;xc15-MSL_4}aXWX4i?N3h_M;or&a51!-y8d03ZI)qk`?y%Zpd z`xB>~Ow*IpLhm>CurRukCU~&%Sz}1I+xes^XQ$lu^*b>mU+{Xg(zxY+Um^8F;}o?X_xeCWE8hrb&uY-c7rR#UzskO# zRK)6NxbU)G35CYcCjh*T^*ppMeE+$;2y6!8xVo;7aQ*k&Y=qwCu&)Bdv-|h)+QNlb zS_$aSJ{>7>s#Jv;0pZn1A4#;Fi#u((>N~817uJi09-j(@{_8>_1h@(s<$g9*fU$M^ z<)76vQ~=;THuvKxCl*Y^hx1%1DVa{S-aH-wO- znp1>}{pR;o`pGH91zkRcTiCmG-@Ja!=q=;CYsYLmtr0eT`;P7duEeQ6a5>q?!k^l%LeDMEA8`;8oJg0&&=k z37}cd4ETT?^Nl)^|2uJQ>rIO3ViT$V66vkIDpC(c!`IbL@__fL2?MY$Y;)9Tx$Cnx zgy!4H_dh<5yGSuesHJ}P@`0iuJT@@* zr3`6tzJ&g_D_wGz=lmptjjfnmJBmQ10Fv-EXd(zz^ydmOO4LpjeMLuq!>u7Wba*NB zZ*8@WSMEy3;n9@YAlK}}a%pji2Tet9nEEYcPzQq!+?lGA`cr-1RHu{uF%BS7M$?lV zOzC?1PQEpzsEEl~1Fu;#7dJfUv#h|_8@Jci!nNN`#$>vAd1dUo^^>PgT*In+M%Ruf z`Yv{MwN1<>?#A6{seH3Z8y_R^Tp<~BSLNP|ANS3K`wp=w|$1D5a{#u^{ zPTokR=G{769dlJJ0;=W;MjkEh>Q;IL%TSgsFqyakQp zhoSj|*V~cF+f%BEW7d8sM~g9Bcu-ks>Qvzt7TL5?9TCUtcPm?g1_@79XNckTbyC5~ zMs_m?v~r}hBn!A=eQ8!@iU`)clm}cu80|!T*XiR7{h`x=#|s|G#|FNdJRYLW()`9g zPT)Bi7?GBEXlcLBW9D6Yb+9i9e4y`bAehcEKRdm%vg@j?UgIe7j<^Kyy7JpCzeeKZ zc==gNn4zMUKH@3+h#TgW2j4)@ciAXKd?>6E9AB_Ex>ARJHM;?QR-3bPhQn%e2mCo zqug+h3Cj{iM%{Ux;<1}2WQ4*m{X;0f>ILWXV58~MlAvosL}=u-%b7?~adB_l8cidw zdteA0rblKIpR1CxE&kk^ndU8YjTRYAaxm1>l#LI|0ZJ}Wv9YQ@+~UX&Z9NuiHr)T@ znu6gA419bqZ())d9I7@QUj;lzaO7~_Rv}JpEFZAJwSJkIjhC#yApMlx*xHq{3Zsm=y~Ev-Dwom7Z8IEmgI|4XPe4kTqO%a)YqHwq2{gY5gfN^sbx3bVi_#yw z{nf!jf06?RZ%G_`@6Da395yCuohvVOm#^Nxo*KyLcYYeacS z*s|VtLhsOqXlm_QZv#m z?A__$U*O?y(mt`;N=%X5Xz@<@F=N|v+FyArw^(`9$WU+9E8dEwjOrw^T=5(`Q8&p) z>JEI-xBu^66-^)qTiN;>;yG7~K|H%&xNp9FWnx$9X|5TeU7E}nG%g<$fu}k^7HEl+V==IN_J(4$Q{(Ho*ubwS9`)SEi6~VP z(*U8iQ(Ale%paR-Gn*#wU!2E;4>NB?RIUoHRdUH<45g_zDs$|cPORGD?Tb9O!_G%{ zAZg`ZL-9(x$%0an!cFsGCP~ZtwXT=Sh$|Ofu|;d|!$~Q`Y-!Jsy4lC|%W~lIo;I$uyWjHjp0T~*V&*IJ!topCZhg3> zru%AK;Le_(pZVfV%L>hU6RXwun`|d_RS66f+}>b7gxYkW{XXByc(x7A_GT95;(O0r z00rFn_P}&`UG=#(DMRZOR7V8X%m|*>oTN{Ix9HD(wG8{0b%T-m=w5-nH+*RjC#|{* zl=}4uF;vkBXcv3~0^8S~ESt|1=+F}K#<-ytxe9pA8<-;({BoSgg~D1Yte zt51@4@9l3p)NFO}>AwjU3=Z(~yPe?FwIhg2Q+Ik-5 zzfF*8_5sS9yhQF;mcCNGH3cjWP%CG+>Qqy;{fV;y>E9L%+4Sx^d3E~r%!~d|D#P<` zyK%;97No*w;3qxr=#1qBefvh=-qscYGHKL3^u>8#N~^??x;e&Q!AC~=UuVh}^3^Jz z7UarnEWTv1iqP^R!*x z!(q>7i79vN5!Dahng|PXY_qRPtbe+ZWhTG0LG!Mp>vmC0D`Uo@?>?UgaKc}p>_*CK z{cWkeKnhyPqnNr-a$#BNL>ykni@(tkZoA#@^W2OQ`ut{bUVUf2f5OnpIEcA) zdgCVNOek8$(}NW*&Wru+j=TQTIqH=^_Lj%QSN(qz4m5s|vdo}~?i0$99(!aF`zpXb zFF~nMqqGICW3*Te4 zqIhiq=awXzisvyCch^i%6U>bY`@Ac zw}w$$8;Muk2G5~n;VG!m$xuuG`ZVcbJA6ijG+KhM?C)pe8{3^Y-Fz3M$M>n++u-dY z$;92-3f&KVxe%+*TjlQ(lVfpRO<}}?Zpt#Wu%KYTrAhEH=fs@IN&cdyOq~tN|HP<< zz~~uUY1U7I@mI7D$JHzy&W6$KimJ-p)qGr(C;0YP%QS6MiI=~a8x-=-lJ8S6uq-x8 zF%Cd+DcYh?&tZ(=-Jgc@zPJVSZ{PV!JzzQT7M)CRvAH_#It)p8tI~}IA8f`Q={BSE=#gv z&0OIz4AhC1f=i^d%t$6?{plt-T>KQ@?$I&S^RcHNgOQY#t3iY_{IzUAH^o30nPuB$ zCyyEjJ}if5yxY>6fLMr6-n|^oA}fYOi^tJG{boBb$%wp(^PR)pVqhGJ(Z=cP##!(f0NjZVTno0-+bpmtpCn@H{#{+qB&I{v1Efe zA<$NZ`{9SaqW?->qO>9ESt-lM&3h*!F(dZ$dCr4ybJkd!941DRZnmUqp$ogl5y?c~ zNS{G-;$@Q;XKzS3oda(tdMfy%Uj!U^aT>K~GMofgq84Uu?~pF1^*p(MH3s_WK+pRL`VN}|hP!=LAcue)5Qwgs4(WjD*0C?Vl{QKGZUO!NbOUAogSE-aa{ z_Rm|>y#t*Q3v8=BO#$0AxLAYruf;9HEx>P4U zORZ8Yk@FF^Rl+E`(`B&9(u7N9dh9PQa*fK7m8$!bIQQ#Waxr9@KCi=da%WOd!#f`F z*DAWe+2o!@win(ZZ5Uo>Uc14^P8Mif);Vg$U0J`#=X27Oc|%Ac^|MWue0RUuXUZrc zO_cMlByNp;U2`eISt{tUaq3W9Wf4?@&MyF}l4e+Z@C=$tkx)ZBQ12~p?-u~W7=RwG z%7bQZC`zuQj(BjdohMPwNUSsLiK}vX2hR>K|2+)~YS?zr`vc1e)UYT@KKnG5kCoEz zbT%H(EgKDp%DVl{t&o|!t&0&`VYoJC&Y57cXGk=1%60H0yhhLfSbpp628sH1=W7fP ztq?=lwiwjf7e3#6&*ut5RhaJ2)fP_uvkFG+S!3Vp{A<~T@tn~X2jejdpjT^Z+{7~TUgif572>rCp?C{7F&rE3C zU3q!=s?VuJFwxyq2cWm-KZhQxUfDf*^S2!k^36zEvF{~LTG`Qd-S+DfTwQfl?JidI zy422`_C#vBm!Oe24fF6gaAEMJ(b>=Mv5cLee3B%6m|B@R`%+;o0v&NWUan!Zj{zg4 z!RONyD-FLFRuE=NboZgL$|IwtN^DH@hYkEYg44v%7K2;Dgc!qwPuIE9HOmWVp3*4L z=;-U|eRDfKD0tmPwqGy!coR?#4M&UKt_E3y4l%pt($DBg!CU?Lu2qLO#-fe5c`nXT^cSIZN61u~d(K0?#LmwmeSK8>AN zv`xqsoaI}i6n|5NKvMlHf9c7ccA|$Ufo9Qz-sI>PIOe)?pgy6T#if^Y4SWcas#|Kx zPszIthZL?w&cw0~z;xT*r;tpVWn}T(SgnUgpSdLfCV#&|U^3XrQZkDZ=$n+bwMh^D zP6-#v$N_fc185{OMb>~0{er>}Ko%=_T)rq|RTQFb^%rkWxhc9mBT#u-;a& z;R->%xTTGEs2#h4H*MSe&3gpGwgUZSU(ng!Sm_nUy61%{RRJ3Oi(jwH>r5hbxh2-( z(h~OeB_b$|PF}tD<5Y4q)tMwo!>q0Fe78VfE?NUa6f3{lW=U>Ai#U}6ihSUvFkp5O zR+^P#x_EHAxWt{3AS(Z|=7tI=o{zx657{BSrwrv+F^bzMH@^@`TP7${wriqJ%}{@u zi;N8TQy68GA>jnC?p^4;MRW!!JODe(!#J%vO9H0IrIG-^N?o6Xv>z`7r3R&p{AQf8 zKyt}9H+Lw$1HdM{ff+{<`B1I0^QZ;@LE^!bQ@nOQ`w>O*PH6BcvJnckZN443P?(Zt z4^Mrnj+p5-@Nc(YXa4D46*>BN$m=g687Eo)t@YdP_JktuIT*zV?Xm|jA!3yoCTN}= zXoM)!5L#N>T`~4(fdT@W?z}h;9kw}JRAwS8^=HstWX5T)5LgvqdSo#<9_S{SwE6sD zhcIMCKKr7$A1@HgI5A2n#a<|LXN^$v3r*3S{yJ=br_VS)i%q-`o9uB{_h**mWwlS| zCh#!B_d?&HAaLr~Fp|!;w`@JIewdE2WRAR?NE)0@%?&TDkoh^ve>5mFQs7$pz?hQx zk;j>YwZ)n1(#e{jdugs(al?jujLSE?&CGGSS~Fr+Tx`GgiG@D}rUEs;dz;D{%u91a zBO#n^-Xr87eV5uPrLOLNSX=*j%GZhf z?}f{8mxcRWL6}8nND5?TkpD93m@JW?uilYQTK{X&{)B6*h<|zIqRMyh-o(qU->U~z zu;$=ItxEf64Gj(RAf=ZGgK4PB#j%TmZs||jp9NR-TagvC;g^V5N_m~q>9@%9D;Kbp zjmsa0t-M+;$3pNZ@HuQ|5#g>?c@KeLQpVP{2uvy|nWl5U>di3G!3bInQGR1}Iln}5 zsu1R{qH|c%fxNbj1EoFlVb`OnwmjX&ftAGWMP;D6NT{UvU6#;DA`Vn*fm_kxK-OqQ z&}Ch9%3a?fm1HIWC~nc)e#wjdTn`yAb+U1$7${#;2tC$a$HBhT)BW5DA0FlXQK?*! zOfJ8>YwPhnWlp;|`?ZOk%Y{UtK}vIa(y%ZEDt;FbbOwPQ!=Ku}HDH?0tBpBx^J37i z-|6J)Y3r94HtSxz2HK&5yv7Bopw@ooat+S*tD_CZRSJtMs-rsFsa6pJjtXL8Vgqvc zL%G_jGQ3WTG zH?-n{(bS<=s);dSK{+#xwJsl01kBl6(8#t09n!XKBSXXVxfS7~=^N%FD)je>pdA8g zaUxcl2O;MrsPgF4Af75^`+;(!6xyIMI{VVC$L1a)EE2EDuQU~CDbw;mjJ_aK(nGT|z$ z%0UA!)n3p}=(3r1h}N0F`+T(2BKI+eF9)7q{^^-o6jU}i^Ajm=^!Om)L27E%8eb(x zpYLL20!qYp*gkAz28V{mWNVZ^(o` zk#+p>gsYS7ck;1F%xu{q5!_-hKz;#mAta(_^{*BH`ZJFhG;4>~++K2j0hMPGo>$TF*o%G6_#@YEM0BjwYSyr(uh$HMCtGp0pTBt6#LS`0%9R)aOj_;8)CwzTT>S+*1)9#>|+Od-O;BC~* zQG?;{oI-mqy9o%pY*azfiP~d(%vN*M5J&s}i9JMM?h@b@bG1~rQ8OhtI%7?i8b+MutJ6;4gACM{s`Nq~YX&+Kw^tyN4#f;X=cTFj@xyzK8h2b`p>- zDoL1)qhnb{u&xJ~X=WU*SN2O9aMNRee~SGBs?6ThoikmK#;A)FwK+&Yal_JA;hW0 z$rND}g&R+v?2E-e;O3lVpfIe+*m^&6Grm`JPP|DY@As&K|4y>|}Ts^<# zv?tyQ4=ov1@#ODph19Dc0dMOGteL2_f9XP^W6(r-xxe_&PwTr&LE`XA`#<;tg`8iW z?eb{uC+AL8^wEY19p8>QLnomRacR68996om)%7b-Z!gb!K^Ce|i2B?rAEJ2@>4}Xa z!gCcYn4p$T=WP|5g{k@%YL27OQ~?bTFO#fBR!hSx)KMO`mtOGPJ36iCs=}3>{_RB0 z*KH!aI}679Zv6qf-&ML+DQR}=KZbIiCo))X|1C+Y;YfPds2$-h&glFs+Sy>1mG5pg zlVrbT$duC(g^YaZ(rhqVfgWu)aGR-S#V;_LObKN;cf zKYljGzp8Z#=={XZoJwZDW7hyh@~%bPLz1s(Wkw;e>C%8#v>x|{sTs- zxq6$BXO)XgJ_o%ylvGK&x4BB)8M>)`*!sYFBqLg@_7f;_vVdL(RrG{Kn%h_gIAPxdD6uofNo1u7d zP3=2G8K9w7>4fQ7jE>hbG4gWG3Nbj-5G=`&zI}lGg~#bYk91o}Ta+|#g)mcC5sO{Z z2>vv%l`_1wqj>EReUV(CwSV8iJ^ZN;D%jjH!Mv*UWiOS}sb03eQJtzAl>9|&SJy8O zN0<#HbGqcycahvHUJb%)I`Ie*_s8H^T|aNd4VYUQnzNelBf}o0;xG)O?;*K|v*7Fs z2GB&2&Y716WG1~&LPcR8-#FdOzE^Cb68k>2r=zl8>K>6KYIB*))2GqUP;C$wM@##= ztjnzq=cn*Z-#8`FujD?%rusYH`50CsizJ+Kdaz*wq(3atY$(nWhdln+iQ|;Kwlc{H zc9rsALlmcs0V#1PN~`;ernZPkrQ%`PpfuNoSLaZ8FskNGMD&j=Vai&ty}T=Lcg&X3 zNnH8sCQKzjUqo|L*!HQl#YNVt0GZ7x0S|m;v1{|usMl~7An2Z$+Xv2ci)p6F?}c(u ziv~(fP~~VE^0XWo4S^6=bxS^bao$#-{E>40)~!zt*o4!O6HD_x3|H3Tcj-gCw=C`i8<*vh@I_r#$+ZeoROy& z@;U%S2?17!OlZ^7(_vD-6$>f^rQFyrmGQwtx`uih&XVBw&*C1&fRLR1eI@@&w!}_y zZTj8HLyFGU&wqR0Nxl(#|JV5?7J~1N@WN!Yv8Zz5?bh{O;%NR5e`=l?EV@lc!(WN` zSy)C%QKPjR21TJ4@`=2uD&HC@tVJ5!yDtbcvQx&v|7n%e!F1bf|~Tl!n*+df|i&bNe@Gbe}e=9+|q3DpuXab0Srsw3WQ?vLDZMB>4X0DaFxUHtA&PPg7DxQ*5Y6L7m zTL+5q=}}nlTLV!i%UzO#YMVv4%}%ug^6TLoN2f;G%uB?&_``NEJ$y8dHnnd*8krH# z;Br=)O9z~$zf4n-a?po}(R4`y)wK$(GEZ`do4>fJwy!w4V`lc+(b$`yppxp6$7Rwj zk?2eCv`Vd+Q;mc;(YCw{2wpzOs#2oYkm>(BN(OkfEE*+GgRH|rb(m%h5ZGSH{Q|L; z{cC5(lfAda-#>Rd1I=?NT(T|;$Y;H#g&?7+iPmvig_KRo&}k9)N>U#X)8YjGvNg@4 zWa)SqZk*+NkEoF5mTG{o2va5>;l1TqtXxaae2ts-zP*(q^m1|EiEhl2o;>C!xsjx5 zJ|H(*`u1%ToZplnvpX>~Rb<&GO!xQP#dfOZ+tXf)81bw|dO&?o!9PK75MjrPZguUG zS7!{GFSxT_xluVcUGZG9r#G=+GrDi1ydnuu(kdMOB^vy8&Sm9-JS>i*hXo4?Ahd5J@ZxH=*W9QG$4SR%Em zoz=Oq?vXcqP!F?5%_|5Od7CL2N(O15r)!-bc*}EXl(k@zJz)Cvin|aT9hbf2~rVL1t! zsyzwMT9qllU&R4ujRDx16DpLhTcRn$`r(3-x~9F;m{6!3;rR%Tl4YX_FX>906WiUd z$0)2^@oC(xq=}!<>MEhn$xkX9+^}2j6+JoF$dr3M;I<`u9SKg}!O82+FRd^1z+*Cj zg&|%^Ic4qwv>7IrSWL<3X6au4)HD}Lw9PtK%8W>m#AhCk)@I}3 zCw}_+`ZrOd+0~^)Dyz%%P=jY%$cPa#GNWU8x;_{necGrG;qllNtMuO3<-fdV@De`N zP1xhBkuee3&m^18$ju~2$GavY*)xN|$1kK_o?g5;*Y|yGG~}xNtMAho`xLP$ws#rm z^)Ocgpyq1Zfw$q&l>#_0Opzkx0-wyWaR5?R_~Iz#MfOYO`&GLVM~LU{FlY#96-f4= zIlN0Abr#=gKfjuro}Sj*P?*VjuDVfuvYNRnZOzkk^bg+XS&N%z*trcTg$AI^Qvl+Y zqLonOr;y?>#T?G=K4&IXfd625F@2}L&m;toM7~>M*!)fo0S2eC9X?S>eUp4h^ z>)$}T#=oA0c;0W`27391U?|k8GBmrzAA@w(D3^gffSi={F5m){4$gakmbh0xpT(p= zZWp@nU!Z`Vzy8O|9Q*IGEui{8QBnE8@yL`^EnSIWj{hI9wr&bO%$lVKjN{JnQgSAp z?f%c@soL6;)DsXkudryjMSD(KcS;4Qe$~~bL5!;))*7P{ecOY$UFrR15b!*HmK~V1>@`{H+hu=yQiarmFi-saQKw+Cg=-ic5Mnqy*jc*(eEA0^tD?h3#Rb~piacbmQ2qnv2QFwXE zYRz#R`UYSG!Lct#9cVzLH;byVG|i8p0NlklfRt(8_+ZI5!~dr$CCsj+uX_@!G>=@n z``_&7ENUHcD_1ZqL%q^I8}PJ8X=1JBTH2wJ1OTv!mCV)e00%Q`@8Q0qkXnypirP3* z;k|}LSK{P_@_+(F)p(Ut|AI^XE;ORSkW^?76Nb~)*VktpZoKZw?s4HdQf8HsZC_}4 zC(2@?Vu75^>#E)W?jMO>Co^si=%Jt=SlbZ@ap<>Tw0CvIfZ4%`d*N`=01+XnE(U)FMvXcK3`IpDdOXS(?PYs7Sz5pHng~S|G5hz%; zLH)on=q{K)6^oMaPA@h_b{nU`ad`N#6N9d=tHV~pi2!0k@<&&KX}O5`esAMW$29JD zlKYw0kU38WG|&jTkvbyy!(@Geiv7Snz%x}Mf0K8~It&F>HCA#4m+uK*QE<%KqnsxP z<)$&HtwWKSn!Q$%y!1xLua}0^vAO9KI##EOcFHFY2L;R>)xyk;_oHxmkI8D#Ws$$!iOd&ve(I?hUoWK;ZcnJp&2 zmhUv5Q21w7Ij+zuyGg8au58cuGgI}%erHu~7*?;@#HS&*=sJB~Q?V=_JZ*9KCq{VB zNv@du@0pHzfouK(YY8R#HPWA60Rbx^Xhi}igWly}U2$j@Nmm^&FG|GN*!WAF-n}u0 z)a)R_d+p@!jnE!1r&w)Z2B=lm{pBgsep%|OhGtlVs(O6pXCsR;clxn7b5PLt0m?() z;!IZoA397UGBcVltS2Jc(zu~yf##z|(*t~-N+5)NW|{c`8+`}I{tNLK z@6Sg)`R0kvO6htGbeZmIZgVx$Tyx0(V|sp~nBEVo?))(E-V=x#H?I+NTGctTkG5C4 z@=6(YeTp}L8wD zJpl=~kv1l(B&S5a-Cg89c(P%Qi|R?8fQllG)*|g$VT$ z{|h3HIFZK^BaHlCfq7ExKYwx=Z6~3edDk`cr3=vH5?BN=&d0zgFL%3$C;n#}#I!I{ z!atJ=y`MS?P&0H;+X}mefk1H}bsd@l0`&+RDfOx_c-4lp45*uMFyC-+7<%O}Vxg3v zScfAr&hqa*B0P=IhMh&VKnZIBbOyYANaCca70@6E(|-X8(nxqLu0vtVU{3&Iq@|;a z;js@!L67u&hBnQ#52ZtZtYF3`E*E@#M_F{BxO!B+l=L2pg0BsbHcTiuN*=@9C8>FM z)Ijm%j;N^U>Z(!Wk|oq^1E0DSlx2hq!6SY;SE>q zhE`-TrS-ZqPPc!k^=+i54Q%vbj!O2&+iV%2nbRw1-yJM}9aAHrm~J4}R5fee-DI9T zc@KnR*C0E3fKp^q1;{2cU?3J?ul@wJ7QfB>4Q)ZjE8!M}+c1Y`V1$b7-PKcxK`@RS z(jkR3M}aJ*Q7s7iSvp7`!|!!}dRY0wrCDrVA$6(}7{1inBDdv<*186^LB=X?c`9{AO@F$}HQV7FR!29aU+J<8iTnpP!dx@dIWD)uYAO?vBq>0S)@Ng<&R)Bm3 zJ=h-yUiTjdkkU`jq43$SGl3G5GWsTt#yD^QfM23GMa-f`Ju@?dWyB8D8wj;Hz{ItH zp7?*`U%X_gr<<%k*SzWGw}daN=?5Abz1z&^;=GnWg4@DMCbMaKwON;_98o&?UzB|m z#6p?rCd`3vUv{`7L_Xtz?Ve_lv|GY}40VpJ{=0K*8GzKh{l6wFwnv$9zuE@iz@KRT zo!#a6+n;X)uEbp#x7Vt?uyD2nH>8rdF&DV{=I(ui=dhJ*pyK_38SqSr-Mw9`&_oAL zdT;!I1;@Mm8K1#ZHn4;~8>s#EiU`<|DBvXejzy#I?Y}lld#EDt2=8`awi^mY{;@au W?{3=3 +License-File: License.txt + +UNKNOWN + diff --git a/src/blpapi.egg-info/SOURCES.txt b/src/blpapi.egg-info/SOURCES.txt new file mode 100644 index 0000000..f43efbf --- /dev/null +++ b/src/blpapi.egg-info/SOURCES.txt @@ -0,0 +1,110 @@ +License.txt +MANIFEST.in +NOTES +README.md +changelog.txt +setup.cfg +setup.py +examples/demoapps/ApiFieldsExample.py +examples/demoapps/BroadcastPublisherExample.py +examples/demoapps/ContributionsExample.py +examples/demoapps/EntitlementsVerificationRequestResponseExample.py +examples/demoapps/EntitlementsVerificationSubscriptionExample.py +examples/demoapps/GenerateTokenExample.py +examples/demoapps/InteractivePublisherExample.py +examples/demoapps/MultipleRequestsOverrideExample.py +examples/demoapps/README.md +examples/demoapps/RequestResponseExample.py +examples/demoapps/RequestServiceConsumerExample.py +examples/demoapps/RequestServiceProviderExample.py +examples/demoapps/SecurityLookupExample.py +examples/demoapps/SnapshotRequestTemplateExample.py +examples/demoapps/SubscriptionExample.py +examples/demoapps/SubscriptionWithEventPollingExample.py +examples/demoapps/UserModeExample.py +examples/demoapps/blpapi_import_helper/__init__.py +examples/demoapps/snippets/apiflds/ApiFieldsRequestUtils.py +examples/demoapps/snippets/apiflds/CategorizedFieldSearchRequests.py +examples/demoapps/snippets/apiflds/FieldInfoRequests.py +examples/demoapps/snippets/apiflds/FieldListRequests.py +examples/demoapps/snippets/apiflds/FieldSearchRequests.py +examples/demoapps/snippets/instruments/CurveListRequests.py +examples/demoapps/snippets/instruments/GovtListRequests.py +examples/demoapps/snippets/instruments/InstrumentListRequests.py +examples/demoapps/snippets/requestresponse/HistoricalDataRequest.py +examples/demoapps/snippets/requestresponse/IntradayBarRequests.py +examples/demoapps/snippets/requestresponse/IntradayTickRequests.py +examples/demoapps/snippets/requestresponse/ReferenceDataRequests.py +examples/demoapps/util/ConnectionAndAuthOptions.py +examples/demoapps/util/MaxEventsOption.py +examples/demoapps/util/RequestOptions.py +examples/demoapps/util/SubscriptionOptions.py +examples/demoapps/util/events/SessionRouter.py +examples/unittests/market-data-notifier/README.md +examples/unittests/market-data-notifier/diagram.png +examples/unittests/market-data-notifier/src/__init__.py +examples/unittests/market-data-notifier/src/appconfig.py +examples/unittests/market-data-notifier/src/application.py +examples/unittests/market-data-notifier/src/authorizer.py +examples/unittests/market-data-notifier/src/compute_engine.py +examples/unittests/market-data-notifier/src/event_processor.py +examples/unittests/market-data-notifier/src/main.py +examples/unittests/market-data-notifier/src/notifier.py +examples/unittests/market-data-notifier/src/subscriber.py +examples/unittests/market-data-notifier/src/token_generator.py +examples/unittests/market-data-notifier/tests/test_application.py +examples/unittests/market-data-notifier/tests/test_authorizer.py +examples/unittests/market-data-notifier/tests/test_eventprocessor.py +examples/unittests/market-data-notifier/tests/test_tokengenerator.py +examples/unittests/snippets/test_events.py +examples/unittests/snippets/test_refdata.py +examples/unittests/snippets/resolver/resolverutils.py +examples/unittests/snippets/resolver/test_resolverutils.py +src/blpapi/internals_wrap.c +src/blpapi/versionhelper_wrap.c +src/blpapi/__init__.py +src/blpapi/abstractsession.py +src/blpapi/auth.py +src/blpapi/chandle.py +src/blpapi/compat.py +src/blpapi/constant.py +src/blpapi/datatype.py +src/blpapi/datetime.py +src/blpapi/debug.py +src/blpapi/debug_environment.py +src/blpapi/diagnosticsutil.py +src/blpapi/element.py +src/blpapi/event.py +src/blpapi/eventdispatcher.py +src/blpapi/eventformatter.py +src/blpapi/exception.py +src/blpapi/highresclock.py +src/blpapi/identity.py +src/blpapi/internals.py +src/blpapi/logging.py +src/blpapi/message.py +src/blpapi/name.py +src/blpapi/names.py +src/blpapi/providersession.py +src/blpapi/request.py +src/blpapi/requesttemplate.py +src/blpapi/resolutionlist.py +src/blpapi/schema.py +src/blpapi/service.py +src/blpapi/session.py +src/blpapi/sessionoptions.py +src/blpapi/subscriptionlist.py +src/blpapi/topic.py +src/blpapi/topiclist.py +src/blpapi/utils.py +src/blpapi/version.py +src/blpapi/versionhelper.py +src/blpapi/zfputil.py +src/blpapi.egg-info/PKG-INFO +src/blpapi.egg-info/SOURCES.txt +src/blpapi.egg-info/dependency_links.txt +src/blpapi.egg-info/top_level.txt +src/blpapi/test/__init__.py +src/blpapi/test/messageformatter.py +src/blpapi/test/messageproperties.py +src/blpapi/test/testutil.py \ No newline at end of file diff --git a/src/blpapi.egg-info/dependency_links.txt b/src/blpapi.egg-info/dependency_links.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/src/blpapi.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/src/blpapi.egg-info/top_level.txt b/src/blpapi.egg-info/top_level.txt new file mode 100644 index 0000000..6205a9d --- /dev/null +++ b/src/blpapi.egg-info/top_level.txt @@ -0,0 +1 @@ +blpapi diff --git a/src/blpapi/__init__.py b/src/blpapi/__init__.py index aa09425..0d5f652 100644 --- a/src/blpapi/__init__.py +++ b/src/blpapi/__init__.py @@ -40,8 +40,10 @@ from .eventformatter import EventFormatter from .exception import * from .identity import Identity +from .logging import Logger from .message import Message from .name import Name +from .names import Names from .providersession import ProviderSession, ServiceRegistrationOptions from .request import Request from .requesttemplate import RequestTemplate diff --git a/src/blpapi/auth.py b/src/blpapi/auth.py index e430fa5..ecd27d3 100644 --- a/src/blpapi/auth.py +++ b/src/blpapi/auth.py @@ -137,7 +137,7 @@ def __init__(self, handle): """For internal use only.""" super(AuthUser, self).__init__( handle, internals.blpapi_AuthUser_destroy) - self.__handle = handle + self.__handle = handle # pylint: disable=unused-private-member @classmethod def createWithLogonName(cls): diff --git a/src/blpapi/compat.py b/src/blpapi/compat.py index 25d622c..e38c71e 100644 --- a/src/blpapi/compat.py +++ b/src/blpapi/compat.py @@ -80,3 +80,12 @@ def isstr(s): str_typelist = (str, unicode) else: str_typelist = (bytes, str) + +# Helper import +# pylint: disable=deprecated-class,no-name-in-module +if sys.version.startswith('2'): + from collections import Mapping as _Mapping, Sequence as _Sequence +else: + from collections.abc import Mapping as _Mapping, Sequence as _Sequence +Mapping = _Mapping +Sequence = _Sequence diff --git a/src/blpapi/datetime.py b/src/blpapi/datetime.py index 414ec30..4efc29e 100644 --- a/src/blpapi/datetime.py +++ b/src/blpapi/datetime.py @@ -9,7 +9,7 @@ from . import internals from . import utils -from .compat import with_metaclass +from .compat import with_metaclass, tolong # pylint: disable=no-member,useless-object-inheritance @@ -124,33 +124,12 @@ def convertToNative(blpapiDatetimeObj): microsecs = (blpapiDatetime.milliSeconds * 1000 + blpapiDatetimeObj.picoseconds // 1000 // 1000) \ if parts & internals.DATETIME_FRACSECONDS_PART else 0 - tzinfo = FixedOffset(blpapiDatetime.offset) if parts & \ - internals.DATETIME_OFFSET_PART else None - if hasDate: - if hasTime: - return _dt.datetime(blpapiDatetime.year, - blpapiDatetime.month, - blpapiDatetime.day, - blpapiDatetime.hours, - blpapiDatetime.minutes, - blpapiDatetime.seconds, - microsecs, - tzinfo) - # Skip an offset, because it's not informative in case of - # there is a date without the time - return _dt.date(blpapiDatetime.year, - blpapiDatetime.month, - blpapiDatetime.day) - if not hasTime: - raise ValueError( - "Datetime object misses both time and date parts", - blpapiDatetime) - return _dt.time(blpapiDatetime.hours, - blpapiDatetime.minutes, - blpapiDatetime.seconds, - microsecs, - tzinfo) + return _DatetimeUtil._convertToNativeTypeHelper(hasDate, + hasTime, + blpapiDatetime, + microsecs) + @staticmethod def convertToNativeNotHighPrecision(blpapiDatetime): """Convert BLPAPI Datetime object to a suitable Python object. @@ -164,33 +143,45 @@ def convertToNativeNotHighPrecision(blpapiDatetime): internals.DATETIME_TIME_PART microsecs = blpapiDatetime.milliSeconds * 1000 if parts & \ internals.DATETIME_MILLISECONDS_PART else 0 + return _DatetimeUtil._convertToNativeTypeHelper(hasDate, + hasTime, + blpapiDatetime, + microsecs) + + @staticmethod + def _convertToNativeTypeHelper(hasDate, + hasTime, + blpapiDatetime, + microsecs): + parts = blpapiDatetime.parts tzinfo = FixedOffset(blpapiDatetime.offset) if parts & \ internals.DATETIME_OFFSET_PART else None - if hasDate: - if hasTime: - return _dt.datetime(blpapiDatetime.year, - blpapiDatetime.month, - blpapiDatetime.day, - blpapiDatetime.hours, - blpapiDatetime.minutes, - blpapiDatetime.seconds, - microsecs, - tzinfo) - # Skip an offset, because it's not informative in case of - # there is a date without the time + + if hasDate and hasTime: + return _dt.datetime(blpapiDatetime.year, + blpapiDatetime.month, + blpapiDatetime.day, + blpapiDatetime.hours, + blpapiDatetime.minutes, + blpapiDatetime.seconds, + microsecs, + tzinfo) + elif hasDate: + # Skip an offset, because it's not informative if there is a + # date without time return _dt.date(blpapiDatetime.year, blpapiDatetime.month, blpapiDatetime.day) + elif hasTime: + return _dt.time(blpapiDatetime.hours, + blpapiDatetime.minutes, + blpapiDatetime.seconds, + microsecs, + tzinfo) + + raise ValueError("Blpapi datetime object is invalid: missing" + " both date and time parts") - if not hasTime: - raise ValueError( - "Datetime object misses both time and date parts", - blpapiDatetime) - return _dt.time(blpapiDatetime.hours, - blpapiDatetime.minutes, - blpapiDatetime.seconds, - microsecs, - tzinfo) @staticmethod def isDatetime(dtime): @@ -231,10 +222,11 @@ def convertToBlpapi(dtime): highPrecDatetime.picoseconds *= 1000 * 1000 res.parts = internals.DATETIME_TIMEFRACSECONDS_PART else: - raise TypeError("Datetime could be created only from \ + raise TypeError("Datetime can be created only from \ datetime.datetime, datetime.date or datetime.time") if offset is not None: - res.offset = offset.seconds // 60 + offsetInMinutes = tolong(offset.total_seconds() // 60) + res.offset = offsetInMinutes res.parts |= internals.DATETIME_OFFSET_PART return highPrecDatetime diff --git a/src/blpapi/debug.py b/src/blpapi/debug.py index 735a74c..3e16b1a 100644 --- a/src/blpapi/debug.py +++ b/src/blpapi/debug.py @@ -4,6 +4,7 @@ import platform import os +from locale import getpreferredencoding from .debug_environment import get_env_diagnostics @@ -43,7 +44,7 @@ def debug_load_error(error): if diagnostics_path_env_var in os.environ: diagnostics_path = os.environ[diagnostics_path_env_var] try: - with open(diagnostics_path, "w") as f: + with open(diagnostics_path, "w", encoding=getpreferredencoding()) as f: f.write(full_error_msg) except IOError: print("Failed to write to path defined by %s: \"%s\"" \ diff --git a/src/blpapi/debug_environment.py b/src/blpapi/debug_environment.py index e107b78..8200041 100644 --- a/src/blpapi/debug_environment.py +++ b/src/blpapi/debug_environment.py @@ -9,6 +9,7 @@ import os import pkgutil import functools +from locale import getpreferredencoding from ctypes import util @@ -90,7 +91,7 @@ def get_env_diagnostics(): env_diagnostics = get_env_diagnostics() if len(sys.argv) > 1: - with open(sys.argv[1], "w") as f: + with open(sys.argv[1], "w", encoding=getpreferredencoding()) as f: print(env_diagnostics, file=f) else: print(env_diagnostics) diff --git a/src/blpapi/element.py b/src/blpapi/element.py index 348985c..bddb2dd 100644 --- a/src/blpapi/element.py +++ b/src/blpapi/element.py @@ -13,11 +13,38 @@ from .datatype import DataType from .name import Name, getNamePair from .schema import SchemaElementDefinition -from .compat import conv2str, isstr, int_typelist -from . import utils +from .compat import conv2str, isstr, int_typelist, Mapping +from .utils import Iterator, isNonScalarSequence from . import internals # pylint: disable=useless-object-inheritance,protected-access,too-many-return-statements,too-many-public-methods +class ElementIterator: + """An iterator over the objects within an :class:`Element`. + + If the :class:`Element` is a sequence or choice, this iterates over its + sub-:class:`Element`\ s. Otherwise, iterate over the :class:`Element`\ 's + value(s). + """ + + def __init__(self, element): + self._element = element + self._index = 0 + + def __next__(self): + i = self._index + self._index += 1 + + if self._element.isComplexType(): + if self._element.numElements() > i: + return self._element.getElement(i) + # for array and scalar elements + elif self._element.numValues() > i: + return self._element.getValue(i) + + raise StopIteration() + + next = __next__ # Python 2 compatibility + class Element(object): """Represents an item in a message. @@ -191,6 +218,128 @@ def __str__(self): return self.toString() + def __getitem__(self, nameOrIndex): + """ + Args: + nameOrIndex (Name or str or int): The :class:`Name` identifying the + :class:`Element` to retrieve from this :class:`Element`\ , or + the index to retrieve the value from this :class:`Element`\ . + + Returns: + If a :class:`Name` or :py:class:`str` is used, and the + :class:`Element` whose name is ``nameOrIndex`` is a sequence, + choice, array, or is null, that :class:`Element` is returned. + Otherwise, if a :class:`Name` or :py:class:`str` is used, return + the value of the :class:`Element`. If ``nameOrIndex`` is an + :py:class:`int`, return the value at index ``nameOrIndex`` in this + :class:`Element`. + + Raises: + KeyError: + If ``nameOrIndex`` is a :class:`Name` or :py:class:`str` and + this :class:`Element` does not contain a sub-:class:`Element` + with name ``nameOrIndex``. + InvalidConversionException: + If ``nameOrIndex`` is an :py:class:`int` and the data type of + this :class:`Element` is either a sequence or a choice. + IndexOutOfRangeException: + If ``nameOrIndex`` is an :py:class:`int` and + ``nameOrIndex`` >= :meth:`numValues`. + """ + # is index + if isinstance(nameOrIndex, int_typelist): + return self.getValue(nameOrIndex) + + # is name + if not self.hasElement(nameOrIndex): + raise KeyError("Element {} does not contain element {}" + .format(self.name(), nameOrIndex)) + + element = self.getElement(nameOrIndex) + + if element.isComplexType() or element.isArray(): + return element + elif element.isNull(): + # Scalar element with a null value + return None + + return element.getValue() + + def __setitem__(self, name, value): + """ + Args: + name (Name or str): The :class:`Name` identifying one of this + :class:`Element`\ 's sub-:class:`Element`\ s. + value: Used to format the :class:`Element`. See :meth:`fromPy` for + more details. + + Raises: + Exception: + If ``name`` does not identify one of this :class:`Element`\ 's + sub-:class:`Element`\ s. + Exception: + If the :class:`Element` identified by ``name`` is has been + previously formatted. + Exception: + If the :class:`Element` identified by ``name`` cannot be + formatted by ``value`` (See :meth:`fromPy` for more details). + + Format this :class:`Element`\ 's sub-:class:`Element` identified by + ``name`` with ``value``. See :meth:`fromPy` for more details. + + Note: + :class:`Element`\ s that have been previously formatted in any way + cannot be formatted further with this method. To further format an + :class:`Element`\ , use the get/set/append Element/Value methods. + Note: + :class:`Element`\ s cannot be modified by index. + """ + if isinstance(name, int_typelist): + raise Exception("Elements cannot be formatted by index") + + self.getElement(name).fromPy(value) + + def __iter__(self): + """ + Returns: + An iterator over the contents of this :class:`Element`. If this + :class:`Element` is a complex type (see :meth:`isComplexType`), + return an iterator over the :class:`Element`\ s in this + :class:`Element`. Otherwise, return an iterator over this + :class:`Element`\ 's value(s). + """ + return ElementIterator(self) + + def __len__(self): + """ + Returns: + int: if this :class:`Element` is a complex type + (see :meth:`isComplexType`), return the number of + :class:`Element`\ s in this :class:`Element`. Otherwise, return the + number of values in this :class:`Element`. + """ + if self.isComplexType(): + return self.numElements() + + return self.numValues() + + def __contains__(self, item): + """ + Args: + item (str or blpapi.Name or bool or int or float or datetime.date \ + or datetime.time or datetime.datetime or None): + item to check for existence in this :class:`Element`. + + Returns: + bool: If this :class:`Element` is a complex type, return whether + this :class:`Element` contains an :class:`Element` with the + specified :class:`Name` ``item``. Otherwise, return whether + ``item`` is a value in this :class:`Element`. + """ + if self.isComplexType(): + return self.hasElement(item) + return item in self.values() + def name(self): """ Returns: @@ -326,6 +475,75 @@ def isNullValue(self, position=0): _ExceptionUtil.raiseOnError(res) return None # unreachable + def toPy(self): + """ + Returns: + A :py:class:`dict`, :py:class:`list`, or value representation of + this :class:`Element`. This is a deep copy containing only native + python datatypes, like :py:class:`list`, :py:class:`dict`, + :py:class:`str`, and :py:class:`int`. + + If an :class:`Element` is + + * a complex type, it is converted to a :py:class:`dict` whose keys are + the :py:class:`str` names of its sub-:class:`Element`\ s. + * an array, it is converted to a :py:class:`list` of the + :class:`Element`'s values. + * null, it is converted an empty :py:class:`dict`. + + Otherwise, the :class:`Element` is converted to its associated value. + If that value was a :class:`Name`, it will be converted to a + :py:class:`str`. + + For example, the following ``exampleElement`` has the following BLPAPI + representation: + + >>> exampleElement + + .. code-block:: none + + exampleElement = { + complexElement = { + nullElement = { + } + } + arrayElement[] = { + arrayElement = { + id = 2 + endpoint = { + address = "127.0.0.1:8000" + } + } + } + valueElement = "Sample value" + nullValueElement = + } + + ``exampleElement`` produces the following Python representation: + + >>> exampleElement.toPy() + + .. code-block:: python + + { + "complexElement": { + "nullElement": {} + }, + "arrayElement": [ + { + "id": 2 + "endpoint": { + "address": "127.0.0.1:8000" + } + } + ], + "valueElement": "Sample value", + "nullValueElement": None + } + + """ + return internals.blpapi_Element_toPy(self.__handle) + def toString(self, level=0, spacesPerLevel=4): """Format this :class:`Element` to the string at the specified indentation level. @@ -389,7 +607,7 @@ def elements(self): if self.datatype() != DataType.SEQUENCE: raise UnsupportedOperationException( description="Only sequences are supported", errorCode=None) - return utils.Iterator(self, Element.numElements, Element.getElement) + return Iterator(self, Element.numElements, Element.getElement) def hasElement(self, name, excludeNullElements=False): """ @@ -599,7 +817,7 @@ def values(self): datatype = self.datatype() valueGetter = _ELEMENT_VALUE_GETTER.get(datatype, Element.getValueAsString) - return utils.Iterator(self, Element.numValues, valueGetter) + return Iterator(self, Element.numValues, valueGetter) def getElementAsBool(self, name): """ @@ -864,10 +1082,258 @@ def setChoice(self, selectionName): _ExceptionUtil.raiseOnError(res[0]) return Element(res[1], self._getDataHolder()) + def fromPy(self, value): + """Format this :class:`Element` with the provided native Python value. + + Args: + value: Used to format this :class:`Element` + + Raises: + Exception: + If the provided value does not properly represent the structure + of this :class:`Element`. + Exception: + If this method is used to format an :class:`Element` that has + already been formatted. + + If the :class:`Element` is + + * a complex type, it is formatted using a + :py:class:`collections.abc.Mapping` (e.g. :py:class:`dict`) whose + keys are the :py:class:`str` names of its sub-:class:`Element`\ s. + * an array, it is formatted using a + :py:class:`collections.abc.Sequence` (e.g. :py:class:`list`) of the + :class:`Element`\ 's values (see note below for more detais). + * null, it is formatted using an empty + :py:class:`collections.abc.Mapping`. + + Otherwise, the :class:`Element` is formatted using its associated + value (e.g :py:class:`str` or :py:class:`int`). + + Note: + Although :py:class:`str`, :py:class:`bytes`, :py:class:`bytearray`, + and :py:class:`memoryview` are sub-types of + :py:class:`collections.abc.Sequence`, :meth:`fromPy` treats them as + scalars of type string and will use them to format scalar + :class:`Element`\ s. If you wish to format an array + :class:`Element` with instances of the aforementioned types, put + them in a different :py:class:`collections.abc.Sequence`, like + :py:class:`list`. + + Note: + Using :meth:`fromPy` to format an :class:`Element` or one of its + sub-:class:`Element`\ s that has already been formatted is not + supported. To further format an :class:`Element`, use the + get/set/append Element/Value methods. + + For example, the following ``exampleElement`` has the following BLPAPI + representation: + + .. code-block:: none + + exampleElement = { + complexElement = { + nullElement = { + } + } + arrayElement[] = { + arrayElement = { + id = 2 + endpoint = { + address = "127.0.0.1:8000" + } + } + } + valueElement = "Sample value" + nullValueElement = + } + + ``exampleElement`` can be created with the following code: + + .. code-block:: python + + exampleRequest = service.createRequest("ExampleRequest") + exampleElement = exampleRequest.asElement() + + complexElement = exampleElement.getElement("complexElement") + complexElement.getElement("nullElement") + + arrayElement = exampleElement.getElement("arrayElement") + array = arrayElement.appendElement() + arrayValue.setElement("id", 2) + endpointElement = arrayValue.getElement("endpoint") + endpointElement.setElement("address", "127.0.0.1:8000") + + exampleElement.setElement("valueElement", "Sample value") + + :meth:`fromPy` can be used to format ``exampleElement`` the same way: + + .. code-block:: python + + exampleRequest = service.createRequest("ExampleRequest") + exampleElement = exampleRequest.asElement() + exampleElementAsDict = { + "complexElement": { + "nullElement": {} + }, + "arrayElement": [ + { + "id": 2, + "endpoint": { + "address": "127.0.0.1:8000" + } + } + ], + "valueElement": "Sample value", + "nullValueElement": None + } + exampleElement.fromPy(exampleElementAsDict) + + :meth:`fromPy` can also be called with + :class:`collections.abc.Sequence`\ s and scalar values to format array + :class:`Element`\ s and scalar :class:`Element`\ s, respectively. + + .. code-block:: python + + arrayElementAsList = [{ + "id": 2, + "endpoint": { "address": "127.0.0.1:8000" } + }] + arrayElement = exampleElement.getElement("arrayElement") + arrayElement.fromPy(arrayElementAsList) + + exampleElement.getElement("valueElement").fromPy("Sample value") + + Calling :meth:`toPy` on an :class:`Element` formatted by :meth:`fromPy` + with a given value will return an equal value. Continuing from the + preceding example: + + .. code-block:: python + + exampleElement.fromPy(exampleElementAsDict) + print(exampleElementAsDict == exampleElement.toPy()) # True + + """ + self._fromPyHelper(value) + + def _fromPyHelper(self, value, name=None, path=None): + """Helper method for `fromPy`. + + Args: + value: Used to format this `Element` or the `Element` specified + by ``name``. + name (Name or str): If ``name`` is ``None``, format this `Element` + with ``value``. Otherwise, ``name`` refers to this `Element`'s + sub-`Element` that will be formatted with ``value``. + path (str): The path uniquely identifying this `Element`, starting + from the root `Element`. + """ + # Note, the double exception throwing has no good solution in Python 2, + # but Python 3 has exception chaining that we should use when we can + + activeElement = self + + def getActivePathMessage(isArrayEntry=False): + elementType = "scalar" + if activeElement.isArray(): + elementType = "array" + elif activeElement.isComplexType(): + elementType = "complex" + + arrayEntryText = "an entry in " if isArrayEntry else "" + return "While operating on {}{} Element `{}`, ".format( + arrayEntryText, elementType, path) + + if path is None: + path = str(activeElement.name()) + if name is not None: + try: + activeElement = self.getElement(name) + path += "/" + str(activeElement.name()) + except Exception as exc: + errorMsg = "encountered error: {}".format(exc) + raise Exception(getActivePathMessage() + errorMsg) + + if activeElement.numElements() or activeElement.numValues(): + errorMsg = "this Element has already been formatted" + raise Exception(getActivePathMessage() + errorMsg) + + if isinstance(value, Mapping): + if not activeElement.isComplexType(): + errorMsg = "encountered a `Mapping` instance while" \ + " formatting a non-complex Element" + raise Exception(getActivePathMessage() + errorMsg) + + complexElement = activeElement + for subName in value: + subValue = value[subName] + complexElement._fromPyHelper(subValue, subName, path) + + elif isNonScalarSequence(value): + if not activeElement.isArray(): + errorMsg = "encountered a `Sequence` while formatting a" \ + " non-array Element" + raise Exception(getActivePathMessage() + errorMsg) + + arrayElement = activeElement + typeDef = arrayElement.elementDefinition().typeDefinition() + arrayValuesAreScalar = not typeDef.isComplexType() + for index, val in enumerate(value): + if isinstance(val, Mapping): + if arrayValuesAreScalar: + path += "[{}]".format(index) + errorMsg = "encountered a `Mapping` where a scalar" \ + " value was expected." + raise Exception(getActivePathMessage(isArrayEntry=True) + + errorMsg) + + appendedElement = arrayElement.appendElement() + arrayEntryPath = path + "[{}]".format(index) + appendedElement._fromPyHelper(val, path=arrayEntryPath) + elif isNonScalarSequence(val): + path += "[{}]".format(index) + expectedObject = "scalar value" if arrayValuesAreScalar \ + else "`Mapping`" + errorMsg = "encountered a nested `Sequence` where a {}" \ + " was expected.".format(expectedObject) + raise Exception(getActivePathMessage(isArrayEntry=True) + + errorMsg) + + else: + if not arrayValuesAreScalar: + path += "[{}]".format(index) + errorMsg = "encountered a scalar value where a" \ + " `Mapping` was expected." + raise Exception(getActivePathMessage(isArrayEntry=True) + + errorMsg) + + try: + arrayElement.appendValue(val) + except Exception as exc: + path += "[{}]".format(index) + errorMsg = "encountered error: {}".format(exc) + raise Exception(getActivePathMessage(isArrayEntry=True) + + errorMsg) + else: + if value is None: + return + + if activeElement.isComplexType() or activeElement.isArray(): + errorMsg = "encountered an incompatible type, {}, for a" \ + " non-scalar Element".format(type(value)) + raise Exception(getActivePathMessage() + errorMsg) + + try: + activeElement.setValue(value) + except Exception as exc: + errorMsg = "encountered error: {}".format(exc) + raise Exception(getActivePathMessage() + errorMsg) + def _handle(self): """Return the internal implementation.""" return self.__handle + _ELEMENT_VALUE_GETTER = { DataType.BOOL: Element.getValueAsBool, DataType.CHAR: Element.getValueAsString, diff --git a/src/blpapi/eventdispatcher.py b/src/blpapi/eventdispatcher.py index a1a1f9e..0e533b9 100644 --- a/src/blpapi/eventdispatcher.py +++ b/src/blpapi/eventdispatcher.py @@ -21,7 +21,7 @@ class EventDispatcher(CHandle): callbacks from one or more internal threads for one or more sessions. """ - __handle = None + __handle = None # pylint: disable=unused-private-member def __init__(self, numDispatcherThreads=1): """Construct an :class:`EventDispatcher`. diff --git a/src/blpapi/eventformatter.py b/src/blpapi/eventformatter.py index f866430..ff0b269 100644 --- a/src/blpapi/eventformatter.py +++ b/src/blpapi/eventformatter.py @@ -5,13 +5,17 @@ This component adds messages to an Event which can be later published. """ -from .exception import _ExceptionUtil, InvalidConversionException +from .exception import _ExceptionUtil, InvalidConversionException, \ + IndexOutOfRangeException, InvalidArgumentException, NotFoundException from .datetime import _DatetimeUtil from .message import Message from .name import Name, getNamePair from . import internals -from .utils import get_handle, invoke_if_valid +from .utils import get_handle, invoke_if_valid, isNonScalarSequence from .chandle import CHandle +from .compat import Mapping + +from collections import deque class EventFormatter(CHandle): """:class:`EventFormatter` is used to populate :class:`Event`\ s for @@ -116,6 +120,7 @@ def __init__(self, event): selfhandle, internals.blpapi_EventFormatter_destroy) self.__handle = selfhandle + self.latestMessageName = None def appendMessage(self, messageType, topic, sequenceNumber=None): """Append an (empty) message to the :class:`Event` referenced by this @@ -154,6 +159,8 @@ def appendMessage(self, messageType, topic, sequenceNumber=None): sequenceNumber, 0)) + self.latestMessageName = messageType + def appendResponse(self, operationName): """Append an (empty) response message for the specified ``operationName``. @@ -183,6 +190,8 @@ def appendResponse(self, operationName): name[0], name[1])) + self.latestMessageName = "" + def appendRecapMessage(self, topic, correlationId=None, sequenceNumber=None, fragmentType=Message.FRAGMENT_NONE): @@ -252,6 +261,8 @@ def appendRecapMessage(self, topic, correlationId=None, fragmentType, sequenceNumber)) + self.latestMessageName = "" + def setElement(self, name, value): """Set an element in the :class:`Event` referenced by this :class:`EventFormatter`. @@ -333,14 +344,12 @@ def pushElement(self, name): name[1])) def popElement(self): - """Undo the most recent call to :meth:`pushElement()` on this - :class:`EventFormatter`. - - Undo the most recent call to :meth:`pushElement()` on this - :class:`EventFormatter` and return the context of the - :class:`EventFormatter` to where it was before the call to - :meth:`pushElement()`. Once :meth:`popElement()` has been called it is - invalid to attempt to re-visit the same context. + """Undo the most recent call to :meth:`pushElement` or + :meth:`appendElement` on this :class:`EventFormatter` and return the + context of the :class:`EventFormatter` to where it was before the call + to :meth:`pushElement` or :meth:`appendElement`. Once + :meth:`popElement` has been called it is invalid to attempt to + re-visit the same context. """ _ExceptionUtil.raiseOnError( internals.blpapi_EventFormatter_popElement(self.__handle)) @@ -359,6 +368,240 @@ def appendElement(self): _ExceptionUtil.raiseOnError( internals.blpapi_EventFormatter_appendElement(self.__handle)) + def fromPy(self, value): + """ + Format this :class:`EventFormatter`\ 's underlying :class:`Event` using + ``value``. + + Args: + value (collections.abc.Mapping): the object used for formatting + + Raises: + Exception: if ``value`` cannot properly format the :class:`Event` + + The ``value`` used to format the :class:`Event` is always a + :py:class:`collections.abc.Mapping` instance. The keys are + :class:`Name` or :py:class:`str` instances, and the values vary + depending on the :class:`Element` being formatted. + + If the :class:`Element` identified by the key is + + * a complex type, it is formatted using a + :py:class:`collections.abc.Mapping` whose keys are the names of its + sub-:class:`Element`\ s. + * an array, it is formatted using a + :py:class:`collections.abc.Sequence` of the :class:`Element`'s + values (see note below for more details). + + Otherwise, the :class:`Element` is formatted using its associated + scalar value (e.g. :py:class:`str` or :py:class:`int`). + + Note: + Although :py:class:`str`, :py:class:`bytes`, :py:class:`bytearray`, + and :py:class:`memoryview` are sub-types of + :py:class:`collections.abc.Sequence`, :meth:`fromPy` treats them as + scalars of type string and will use them to format scalar + :class:`Element`\ s. If you wish to format an array + :class:`Element` with instances of the aforementioned types, put + them in a different :py:class:`collections.abc.Sequence`, like + :py:class:`list`. + + For null :class:`Element`\ s: + + * A null complex :class:`Element` is formatted using an empty + :py:class:`collections.abc.Mapping`. + * A null scalar :class:`Element` is formatted using ``None``. + * An empty array :class:`Element` is formatted using an empty + :py:class:`collections.abc.Sequence`. + + Note: + The behavior is undefined if :meth:`fromPy` is used to format an + :class:`Event` that has already been formatted. Further formatting + after :meth:`fromPy` is also undefined. + + For example, the following ``SampleOperation`` has the following BLPAPI + representation: + + .. code-block:: none + + SampleOperation = { + complexElement = { + nullElement = { + } + } + scalarArray[] = { + "value1", "value2" + } + complexArray[] = { + complexArray = { + value = 1 + message = "msg" + } + } + valueElement = "value" + nullValueElement = + } + + ``SampleOperation`` can be created with the following code: + + .. code-block:: python + + response = service.createResponseEvent(CorrelationId(0)) + ef = EventFormatter(response) + ef.appendResponse("SampleOperation") + + ef.pushElement("complexElement") + ef.setElementNull("nullElement") + ef.popElement() + ef.pushElement("scalarArray") + ef.appendValue("value1") + ef.appendValue("value2") + ef.popElement() + ef.pushElement("complexArray") + ef.appendElement() + ef.setElement("value", 1) + ef.setElement("message", "msg") + ef.popElement() + ef.popElement() + ef.setElement("valueElement", "value") + ef.setElementNull("nullValueElement") + + :meth:`fromPy` can be used to format ``SampleOperation`` the same way: + + .. code-block:: python + + response = service.createResponseEvent(CorrelationId(0)) + ef = EventFormatter(response) + ef.appendResponse("SampleOperation") + sampleResponseAsDict = { + "complexElement": { + "nullElement": { + } + }, + "scalarArray": [ + "value1", "value2" + ], + "complexArray": [ + { + "value": 1 + "message": "msg" + } + ], + "valueElement": "value", + "nullValueElement": None + } + ef.fromPy(sampleResponseAsDict) + """ + + if not isinstance(value, Mapping): + raise Exception("`value` must be a `Mapping` instance") + self._fromPyHelper(value) + + def _fromPyHelper(self, value, name=None, path=None): + """ + Args: + value (Mapping or Sequence or scalar-type): used to format the + :class:`Element` at the current level + name (str or blpapi.Name or None): the :class:`blpapi.Name` + identifying the :class:`Element` to be formatted. If ``name`` + is ``None``, format the :class:`Event` at the current level. + path (deque): represents the level at which this + :class:`Eventformatter` is operating + """ + if path is None: + path = deque() + + def getPathErrorMessage(): + path.appendleft(str(self.latestMessageName)) + pathStr = "/".join(path) + return "While operating on Element `{}`, ".format(pathStr) + + if isinstance(value, Mapping): + for key, val in value.items(): + if isinstance(val, Mapping): + if val: + try: + self.pushElement(key) + except Exception as exc: + raise Exception(getPathErrorMessage() + + _fromPyErrorTemplate.format(exc)) + + path.append(key) + self._fromPyHelper(val, name=key, path=path) + self.popElement() + path.pop() + else: + try: + self.setElementNull(key) + except (NotFoundException, Exception) as exc: + raise Exception(getPathErrorMessage() + + _fromPyErrorTemplate.format(exc)) + else: + self._fromPyHelper(val, name=key, path=path) + + elif isNonScalarSequence(value): + try: + self.pushElement(name) + except Exception as exc: + raise Exception(getPathErrorMessage() + + _fromPyErrorTemplate.format(exc)) + + for index, val in enumerate(value): + path.append("{}[{}]".format(name, index)) + + if isinstance(val, Mapping): + try: + self.appendElement() + except Exception as exc: + errorMsg = "encountered a `Mapping` where a scalar" \ + " value was expected. Error: {}".format(exc) + raise Exception(getPathErrorMessage() + + errorMsg) + + self._fromPyHelper(val, path=path) + self.popElement() + elif isNonScalarSequence(val): + errorMsg = "encountered nested `Sequences`s. An array of" \ + " array Elements should be represented as" \ + " `Sequence`s of `Mappings`s with `Sequence`" \ + " values." + raise Exception(getPathErrorMessage() + errorMsg) + else: + try: + self.appendValue(val) + except Exception as exc: + raise Exception(getPathErrorMessage() + + _fromPyErrorTemplate.format(exc)) + + path.pop() + + self.popElement() + + else: + try: + if value is None: + self.setElementNull(name) + else: + self.setElement(name, value) + except IndexOutOfRangeException: + path.append(name) + errorMsg = "attempted to format an array Element using a" \ + " scalar value. Array Elements are formatted with" \ + " `Sequence`s." + raise Exception(getPathErrorMessage() + errorMsg) + except (InvalidConversionException, InvalidArgumentException) \ + as exc: + path.append(name) + raise Exception(getPathErrorMessage() + + _fromPyErrorTemplate.format(exc)) + except Exception as exc: + raise Exception(getPathErrorMessage() + + _fromPyErrorTemplate.format(exc)) + + +_fromPyErrorTemplate = "encountered Error: {}" + + __copyright__ = """ Copyright 2012. Bloomberg Finance L.P. diff --git a/src/blpapi/identity.py b/src/blpapi/identity.py index b83b205..97742e5 100644 --- a/src/blpapi/identity.py +++ b/src/blpapi/identity.py @@ -50,8 +50,9 @@ def __init__(self, handle, sessions): """ super(Identity, self).__init__( handle, internals.blpapi_Identity_release) - self.__handle = handle - self.__sessions = sessions + self.__handle = handle # pylint: disable=unused-private-member + self.__sessions = sessions # pylint: disable=unused-private-member + internals.blpapi_Identity_addRef(self.__handle) def hasEntitlements(self, service, entitlements): diff --git a/src/blpapi/internals.py b/src/blpapi/internals.py index 1daa275..9d0f7d5 100644 --- a/src/blpapi/internals.py +++ b/src/blpapi/internals.py @@ -462,6 +462,9 @@ def __init__(self): _internals.blpapi_CorrelationId_t__value_swigregister(blpapi_CorrelationId_t__value) +def blpapi_Element_toPy(element): + return _internals.blpapi_Element_toPy(element) + def blpapi_Element_setElementFloat(element, nameString, name, value): return _internals.blpapi_Element_setElementFloat(element, nameString, name, value) diff --git a/src/blpapi/internals_wrap.c b/src/blpapi/internals_wrap.c index cfe3c57..55e3c47 100644 --- a/src/blpapi/internals_wrap.c +++ b/src/blpapi/internals_wrap.c @@ -3865,6 +3865,266 @@ SWIGINTERN long long blpapi_CorrelationId_t____toInteger(struct blpapi_Correlati #include "blpapi_element.h" +PyObject* blpapi_Element_toPy(blpapi_Element_t *element); + +PyObject* getScalarValue(const blpapi_Element_t* element, const int index) { + const int datatype = blpapi_Element_datatype(element); + + switch (datatype) { + case BLPAPI_DATATYPE_BOOL: { + blpapi_Bool_t boolBuffer; + if (0 != blpapi_Element_getValueAsBool(element, + &boolBuffer, + index)) { + PyErr_SetString( + PyExc_Exception, + "Internal error getting bool"); + return NULL; + } + return PyBool_FromLong(boolBuffer); + } + case BLPAPI_DATATYPE_BYTE: + case BLPAPI_DATATYPE_INT32: + case BLPAPI_DATATYPE_INT64: { + blpapi_Int64_t int64Buffer; + if (0 != blpapi_Element_getValueAsInt64(element, + &int64Buffer, + index)) { + PyErr_SetString( + PyExc_Exception, + "Internal error getting int"); + return NULL; + } + return PyLong_FromLongLong(int64Buffer); + } + case BLPAPI_DATATYPE_FLOAT32: + case BLPAPI_DATATYPE_FLOAT64: { + blpapi_Float64_t floatBuffer; + if (0 != blpapi_Element_getValueAsFloat64(element, + &floatBuffer, + index)) { + PyErr_SetString( + PyExc_Exception, + "Internal error getting float"); + return NULL; + } + return PyFloat_FromDouble(floatBuffer); + } + case BLPAPI_DATATYPE_CHAR: + case BLPAPI_DATATYPE_STRING: + case BLPAPI_DATATYPE_ENUMERATION: { + const char* strValue; + if (0 != blpapi_Element_getValueAsString(element, + &strValue, + index)) { + PyErr_SetString( + PyExc_Exception, + "Internal error getting string"); + return NULL; + } + return PyString_FromString(strValue); + } + case BLPAPI_DATATYPE_DATE: + case BLPAPI_DATATYPE_TIME: + case BLPAPI_DATATYPE_DATETIME: { + static PyObject* blpapiDatetimeModule = NULL; + static PyObject* datetimeUtil = NULL; + static PyObject* convertToNative = NULL; + blpapi_HighPrecisionDatetime_t highPrecisionDatetimeBuffer; + PyObject* highPrecisionDatetimePyObj; + PyObject* pyDatetimeResult; + + // initialize static variables once + if (convertToNative == NULL) { + blpapiDatetimeModule = + PyImport_ImportModule("blpapi.datetime"); + if (blpapiDatetimeModule == NULL) { + PyErr_SetString( + PyExc_Exception, + "Internal error getting blpapi.datetime"); + return NULL; + } + datetimeUtil = + PyObject_GetAttr(blpapiDatetimeModule, + PyString_FromString("_DatetimeUtil")); + if (datetimeUtil == NULL) { + Py_DECREF(blpapiDatetimeModule); + PyErr_SetString( + PyExc_Exception, + "Internal error getting _DatetimeUtil"); + return NULL; + } + convertToNative = PyObject_GetAttr( + datetimeUtil, PyString_FromString("convertToNative")); + if (convertToNative == NULL) { + Py_DECREF(blpapiDatetimeModule); + Py_DECREF(datetimeUtil); + PyErr_SetString( + PyExc_Exception, + "Internal error getting convertToNative"); + return NULL; + } + } + + if (blpapi_Element_getValueAsHighPrecisionDatetime( + element, + &highPrecisionDatetimeBuffer, + index) != 0) { + PyErr_SetString( + PyExc_Exception, + "Internal error getting datetime"); + return NULL; + } + + // Return `None` when the `datetime` has no parts because our + // `convertToNative` function will raise an exception if there are + // no parts + if (!highPrecisionDatetimeBuffer.datetime.parts) { + Py_RETURN_NONE; // inc ref and return + } + + highPrecisionDatetimePyObj = SWIG_NewPointerObj( + (void *) &highPrecisionDatetimeBuffer, + SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, + 0); + if (highPrecisionDatetimePyObj == NULL) { + PyErr_SetString( + PyExc_Exception, + "Internal error getting HighPrecisionDatetime"); + return NULL; + } + pyDatetimeResult = PyObject_Call( + convertToNative, + Py_BuildValue("(O)", + highPrecisionDatetimePyObj), + NULL); + Py_DECREF(highPrecisionDatetimePyObj); + return pyDatetimeResult; + } + case BLPAPI_DATATYPE_SEQUENCE: + case BLPAPI_DATATYPE_CHOICE: + default: { + PyErr_SetString(PyExc_Exception, "Internal datatype error"); + return NULL; + } + } +} + +PyObject* complexElementToPy(blpapi_Element_t *element) { + PyObject* pyDict = PyDict_New(); + PyObject* subElementPy = NULL; + unsigned int i; + if (pyDict == NULL) { + goto ERROR; + } + + for (i = 0; i < blpapi_Element_numElements(element); ++i) { + blpapi_Element_t* subElement; + const char* name; + if (0 != blpapi_Element_getElementAt(element, &subElement, i)) { + PyErr_SetString(PyExc_Exception, + "Internal error in `Element.toPy`"); + goto ERROR; + } + name = blpapi_Element_nameString(subElement); + subElementPy = blpapi_Element_toPy(subElement); + if (subElementPy == NULL) { + goto ERROR; + } + // does not steal ref to value + if (PyDict_SetItemString(pyDict, name, subElementPy)) { + goto ERROR; + } + Py_DECREF(subElementPy); + } + return pyDict; +ERROR: + Py_XDECREF(pyDict); + Py_XDECREF(subElementPy); + // Ensure that we set an error before returning NULL + if (PyErr_Occurred() == NULL) { + PyErr_SetString( + PyExc_Exception, + "Internal error converting a complex Element"); + } + return NULL; +} + +PyObject* arrayElementToPy(blpapi_Element_t *element) { + const unsigned int numValues = blpapi_Element_numValues(element); + PyObject* pyList = PyList_New(numValues); + PyObject* pyValue = NULL; + + const blpapi_SchemaElementDefinition_t* definition + = blpapi_Element_definition(element); + const blpapi_SchemaTypeDefinition_t* typeDefinition + = blpapi_SchemaElementDefinition_type(definition); + + unsigned int i; + if (pyList == NULL) { + goto ERROR; + } + + // complex values + if (blpapi_SchemaTypeDefinition_isComplexType(typeDefinition)) { + for (i = 0; i < numValues; ++i) { + blpapi_Element_t* result; + if (0 != blpapi_Element_getValueAsElement(element, &result, i)) { + PyErr_SetString( + PyExc_Exception, + "Internal error in blpapi_Element_getValueAsElement"); + goto ERROR; + } + pyValue = blpapi_Element_toPy(result); + if (pyValue == NULL) { + goto ERROR; + } + // steals ref to value + // returns void, no error checking + PyList_SET_ITEM(pyList, i, pyValue); + } + } + else { + // non complex values + for (i = 0; i < numValues; ++i) { + pyValue = getScalarValue(element, i); + if (pyValue == NULL) { + goto ERROR; + } + // steals ref to value + // returns void, no error checking + PyList_SET_ITEM(pyList, i, pyValue); + } + } + return pyList; + +ERROR: + Py_XDECREF(pyList); + Py_XDECREF(pyValue); + // Ensure that we set an error before returning NULL + if (PyErr_Occurred() == NULL) { + PyErr_SetString( + PyExc_Exception, + "Internal error converting an array Element"); + } + return NULL; +} + +PyObject* blpapi_Element_toPy(blpapi_Element_t *element) { + if (blpapi_Element_isComplexType(element)) { + return complexElementToPy(element); + } + else if (blpapi_Element_isArray(element)) { + return arrayElementToPy(element); + } + else if (blpapi_Element_isNull(element)) { + Py_RETURN_NONE; // inc ref and return + } + else { + return getScalarValue(element, 0); + } +} + int blpapi_Element_setElementFloat( blpapi_Element_t *element, const char* nameString, @@ -5823,6 +6083,31 @@ SWIGINTERN PyObject *blpapi_CorrelationId_t__value_swiginit(PyObject *SWIGUNUSED return SWIG_Python_InitShadowInstance(args); } +SWIGINTERN PyObject *_wrap_blpapi_Element_toPy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + PyObject *result = 0 ; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_toPy" "', argument " "1"" of type '" "blpapi_Element_t *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + result = (PyObject *)blpapi_Element_toPy(arg1); + { + resultobj = result; + } + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_blpapi_Element_setElementFloat(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; @@ -21657,6 +21942,7 @@ static PyMethodDef SwigMethods[] = { { "delete_blpapi_CorrelationId_t__value", _wrap_delete_blpapi_CorrelationId_t__value, METH_O, NULL}, { "blpapi_CorrelationId_t__value_swigregister", blpapi_CorrelationId_t__value_swigregister, METH_O, NULL}, { "blpapi_CorrelationId_t__value_swiginit", blpapi_CorrelationId_t__value_swiginit, METH_VARARGS, NULL}, + { "blpapi_Element_toPy", _wrap_blpapi_Element_toPy, METH_O, NULL}, { "blpapi_Element_setElementFloat", _wrap_blpapi_Element_setElementFloat, METH_VARARGS, NULL}, { "blpapi_Element_setValueFloat", _wrap_blpapi_Element_setValueFloat, METH_VARARGS, NULL}, { "blpapi_Element_printHelper", _wrap_blpapi_Element_printHelper, METH_VARARGS, NULL}, diff --git a/src/blpapi/message.py b/src/blpapi/message.py index 7a130dc..47f0247 100644 --- a/src/blpapi/message.py +++ b/src/blpapi/message.py @@ -101,6 +101,30 @@ def __str__(self): return self.toString() + def __getitem__(self, name): + """Equivalent to + :meth:`asElement().__getitem__()`. + """ + return self.asElement()[name] + + def __iter__(self): + """Equivalent to + :meth:`asElement().__iter__()`. + """ + return self.asElement().__iter__() + + def __contains__(self, item): + """Equivalent to + :meth:`asElement().__contains__()`. + """ + return self.asElement().__contains__(item) + + def __len__(self): + """Equivalent to + :meth:`asElement().__len__()`. + """ + return self.asElement().__len__() + def messageType(self): """ Returns: @@ -161,24 +185,47 @@ def service(self): return None if serviceHandle is None \ else service.Service(serviceHandle, self.__sessions) + + def correlationId(self): + """ + Returns: + CorrelationId: The single correlation id or the first correlation + id associated with the message, or None if the message is not + associated with any correlation ids. + + Note: + See :meth:`correlationIds` for more details. + + If ``allowMultipleCorrelatorsPerMsg`` is enabled, + :meth:`correlationIds` should be used. + """ + numCorrelations = internals.blpapi_Message_numCorrelationIds( + self.__handle) + if numCorrelations == 0: + return None + + return internals.blpapi_Message_correlationId(self.__handle, 0) + + def correlationIds(self): """ Returns: [CorrelationId]: Correlation ids associated with this message. Note: - A :class:`Message` will have exactly one :class:`CorrelationId` - unless ``allowMultipleCorrelatorsPerMsg`` option was enabled for - the :class:`Session` this :class:`Message` belongs to. When - ``allowMultipleCorrelatorsPerMsg`` is disabled (the default), and - more than one active subscription would result in the same - :class:`Message`, the :class:`Message` is delivered multiple times - (without making physical copies). Each :class:`Message` is - accompanied by a single :class:`CorrelationId`. When - ``allowMultipleCorrelatorsPerMsg`` is enabled and more than one - active subscription would result in the same :class:`Message` the - :class:`Message` is delivered once with a list of corresponding - :class:`CorrelationId` values. + A subscription data :class:`Message` has exactly one + :class:`CorrelationId` unless the + ``allowMultipleCorrelatorsPerMsg`` option is enabled for the + :class:`Session`. + + When ``allowMultipleCorrelatorsPerMsg`` is disabled (the default), + multiple active subscriptions of the same topic result in the same + :class:`Message` being delivered multiple times (without making + physical copies), with a single :class:`CorrelationId` from each + active subscription. + + Otherwise, only one :class:`Message` is delivered with all the + :class:`CorrelationId`\s from the active subscriptions. """ res = [] @@ -281,6 +328,10 @@ def toString(self, level=0, spacesPerLevel=4): level, spacesPerLevel) + def toPy(self): + """Equivalent to :meth:`asElement().toPy()`.""" + return self.asElement().toPy() + def timeReceived(self, tzinfo=UTC): """Get the time when the message was received by the SDK. diff --git a/src/blpapi/names.py b/src/blpapi/names.py new file mode 100644 index 0000000..a38a137 --- /dev/null +++ b/src/blpapi/names.py @@ -0,0 +1,79 @@ +""" +Provides 'Name' constants for common message types. +""" + +from .name import Name + + +class Names: + """ + Provides 'Name' constants for common message types. + """ + + SLOW_CONSUMER_WARNING = Name("SlowConsumerWarning") + SLOW_CONSUMER_WARNING_CLEARED = Name("SlowConsumerWarningCleared") + DATA_LOSS = Name("DataLoss") + REQUEST_TEMPLATE_AVAILABLE = Name("RequestTemplateAvailable") + REQUEST_TEMPLATE_PENDING = Name("RequestTemplatePending") + REQUEST_TEMPLATE_TERMINATED = Name("RequestTemplateTerminated") + SUBSCRIPTION_TERMINATED = Name("SubscriptionTerminated") + SUBSCRIPTION_STARTED = Name("SubscriptionStarted") + SUBSCRIPTION_FAILURE = Name("SubscriptionFailure") + SUBSCRIPTION_STREAMS_ACTIVATED = Name("SubscriptionStreamsActivated") + SUBSCRIPTION_STREAMS_DEACTIVATED = Name("SubscriptionStreamsDeactivated") + REQUEST_FAILURE = Name("RequestFailure") + TOKEN_GENERATION_SUCCESS = Name("TokenGenerationSuccess") + TOKEN_GENERATION_FAILURE = Name("TokenGenerationFailure") + SESSION_STARTED = Name("SessionStarted") + SESSION_TERMINATED = Name("SessionTerminated") + SESSION_STARTUP_FAILURE = Name("SessionStartupFailure") + SESSION_CONNECTION_UP = Name("SessionConnectionUp") + SESSION_CONNECTION_DOWN = Name("SessionConnectionDown") + SESSION_CLUSTER_INFO = Name("SessionClusterInfo") + SESSION_CLUSTER_UPDATE = Name("SessionClusterUpdate") + SERVICE_OPENED = Name("ServiceOpened") + SERVICE_OPEN_FAILURE = Name("ServiceOpenFailure") + SERVICE_REGISTERED = Name("ServiceRegistered") + SERVICE_REGISTER_FAILURE = Name("ServiceRegisterFailure") + SERVICE_DEREGISTERED = Name("ServiceDeregistered") + SERVICE_UP = Name("ServiceUp") + SERVICE_DOWN = Name("ServiceDown") + SERVICE_AVAILABILITY_INFO = Name("ServiceAvailabilityInfo") + RESOLUTION_SUCCESS = Name("ResolutionSuccess") + RESOLUTION_FAILURE = Name("ResolutionFailure") + TOPIC_SUBSCRIBED = Name("TopicSubscribed") + TOPIC_UNSUBSCRIBED = Name("TopicUnsubscribed") + TOPIC_RECAP = Name("TopicRecap") + TOPIC_ACTIVATED = Name("TopicActivated") + TOPIC_DEACTIVATED = Name("TopicDeactivated") + TOPIC_CREATED = Name("TopicCreated") + TOPIC_CREATE_FAILURE = Name("TopicCreateFailure") + TOPIC_DELETED = Name("TopicDeleted") + TOPIC_RESUBSCRIBED = Name("TopicResubscribed") + PERMISSION_REQUEST = Name("PermissionRequest") + PERMISSION_RESPONSE = Name("PermissionResponse") + AUTHORIZATION_SUCCESS = Name("AuthorizationSuccess") + AUTHORIZATION_FAILURE = Name("AuthorizationFailure") + AUTHORIZATION_REVOKED = Name("AuthorizationRevoked") + + +__copyright__ = """ +Copyright 2021. Bloomberg Finance L.P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above +copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/src/blpapi/providersession.py b/src/blpapi/providersession.py index 171af8e..3cfc3c9 100644 --- a/src/blpapi/providersession.py +++ b/src/blpapi/providersession.py @@ -173,7 +173,7 @@ def setServicePriority(self, priority): By default, a service will be registered with priority :attr:`PRIORITY_HIGH`. - Note this has no effect for request-response or resolution services. + Note this has no effect for resolution services. """ return internals.blpapi_ServiceRegistrationOptions_setServicePriority( self.__handle, @@ -285,8 +285,8 @@ class ProviderSession(AbstractSession): DONT_REGISTER_SERVICES = \ internals.RESOLVEMODE_DONT_REGISTER_SERVICES - __handle = None - __handlerProxy = None + __handle = None # pylint: disable=unused-private-member + __handlerProxy = None # pylint: disable=unused-private-member @staticmethod def __dispatchEvent(sessionRef, eventHandle): # pragma: no cover @@ -354,7 +354,7 @@ def __init__(self, options=None, eventHandler=None, eventDispatcher=None): if options is None: options = SessionOptions() if eventHandler is not None: - self.__handler = eventHandler + self.__handler = eventHandler # pylint: disable=unused-private-member self.__handlerProxy = functools.partial( ProviderSession.__dispatchEvent, weakref.ref(self)) self.__handle = internals.ProviderSession_createHelper( diff --git a/src/blpapi/request.py b/src/blpapi/request.py index 6b20f13..2af161b 100644 --- a/src/blpapi/request.py +++ b/src/blpapi/request.py @@ -47,6 +47,16 @@ def __str__(self): return self.toString() + def __getitem__(self, name): + """Equivalent to :meth:`asElement().__getitem__(name) + `.""" + return self.asElement()[name] + + def __setitem__(self, name, value): + """Equivalent to :meth:`asElement().__setitem__(name, value) + `.""" + self.asElement()[name] = value + def set(self, name, value): """Equivalent to :meth:`asElement().setElement(name, value) `.""" @@ -57,6 +67,22 @@ def append(self, name, value): `.""" return self.getElement(name).appendValue(value) + def fromPy(self, requestDict): + """Equivalent to :meth:`asElement().fromPy(requestDict) + `. + + Args: + requestDict (collections.abc.Mapping): used to format this + :class:`Request`. See :meth:`Element.fromPy` for more details. + + Note: + Using :meth:`fromPy` to format a :class:`Request` that has already + been formatted is not supported. To further format a + :class:`Request`, use :meth:`set` / :meth:`append` or the + ``*Element()`` methods. + """ + self.asElement().fromPy(requestDict) + def asElement(self): """ Returns: diff --git a/src/blpapi/session.py b/src/blpapi/session.py index 544fb4a..48bcc20 100644 --- a/src/blpapi/session.py +++ b/src/blpapi/session.py @@ -95,8 +95,8 @@ class Session(AbstractSession): internals.SUBSCRIPTIONSTATUS_PENDING_CANCELLATION """No longer active, terminated by Application.""" - __handle = None - __handlerProxy = None + __handle = None # pylint: disable=unused-private-member + __handlerProxy = None # pylint: disable=unused-private-member @staticmethod def __dispatchEvent(sessionRef, eventHandle): # pragma: no cover @@ -157,7 +157,7 @@ def __init__(self, options=None, eventHandler=None, eventDispatcher=None): if options is None: options = SessionOptions() if eventHandler is not None: - self.__handler = eventHandler + self.__handler = eventHandler # pylint: disable=unused-private-member self.__handlerProxy = functools.partial(Session.__dispatchEvent, weakref.ref(self)) self.__handle = internals.Session_createHelper( diff --git a/src/blpapi/test/messageformatter.py b/src/blpapi/test/messageformatter.py index e071933..f1a1d30 100644 --- a/src/blpapi/test/messageformatter.py +++ b/src/blpapi/test/messageformatter.py @@ -139,10 +139,10 @@ def setElement(self, name, value): :class:`MessageFormatter`. Args: - name (Name or str): Identifies the element which will be set to - ``value``. + name (blpapi.Name or str): Identifies the element which will be set + to ``value``. value (bool or str or int or float or datetime.date or \ - datetime.time or datetime.datetime or Name or None): + datetime.time or datetime.datetime or blpapi.Name or None): The value to assign to the specified element. Raises: @@ -269,8 +269,8 @@ def pushElement(self, name): :meth:`appendElement()` must be used. Args: - name (Name or str): Specifies the :class:`blpapi.Element` on which - to operate. The element must identify either a choice, a + name (blpapi.Name or str): Specifies the :class:`blpapi.Element` on + which to operate. The element must identify either a choice, a sequence or an array at the current level of the schema or the behavior is undefined. @@ -286,11 +286,12 @@ def pushElement(self, name): get_handle(name))) def popElement(self): - """ Undo the most recent call to :meth:`pushElement` on this - :class:`MessageFormatter` and return the context of the - :class:`MessageFormatter` to where it was before the call to - :meth:`pushElement`. Once :meth:`popElement` has been called, - it is invalid to attempt to re-visit the same context. + """ Undo the most recent call to :meth:`pushElement` or + :meth:`appendElement` on this :class:`MessageFormatter` and return the + context of the :class:`MessageFormatter` to where it was before the + call to :meth:`pushElement` or :meth:`appendElement`. Once + :meth:`popElement` has been called, it is invalid to attempt to + re-visit the same context. """ _ExceptionUtil.raiseOnError( internals.blpapi_MessageFormatter_popElement(self.__handle)) @@ -302,7 +303,7 @@ def appendValue(self, value): Args: value (bool or str or int or float or datetime.date or \ - datetime.time or datetime.datetime or Name): + datetime.time or datetime.datetime or blpapi.Name): The value to append. Raises: diff --git a/src/blpapi/test/messageproperties.py b/src/blpapi/test/messageproperties.py index 4385e48..29752e3 100644 --- a/src/blpapi/test/messageproperties.py +++ b/src/blpapi/test/messageproperties.py @@ -44,7 +44,8 @@ def setCorrelationIds(self, cids): Set the `correlationIds` properties of the message. Args: - cids ([CorrelationId]): list of correlation ids of the message. + cids ([blpapi.CorrelationId]): list of correlation ids of the + message. """ errorCode = internals.blpapi_MessageProperties_setCorrelationIds( self.__handle, list(cids)) @@ -98,7 +99,7 @@ def setService(self, service): Set the `service` property of the message. Args: - service (Service): Service of the message. + service (blpapi.Service): Service of the message. """ errorCode = internals.blpapi_MessageProperties_setService( self.__handle, get_handle(service)) diff --git a/src/blpapi/test/testutil.py b/src/blpapi/test/testutil.py index 9182595..e464601 100644 --- a/src/blpapi/test/testutil.py +++ b/src/blpapi/test/testutil.py @@ -21,7 +21,8 @@ def createEvent(eventType): for a list of enumerated values (e.g., `Event.SUBSCRIPTION_DATA`). Returns: - Event: An event used for testing. It cannot be used for publishing. + blpapi.Event: An event used for testing. It cannot be used for + publishing. The behavior is undefined if :class:`blpapi.EventFormatter` is used with the returned :class:`blpapi.Event`. @@ -36,17 +37,17 @@ def appendMessage(event, elementDef, properties=None): Return a :class:`MessageFormatter` to format the last appended message. Args: - event (Event): The ``event`` to which the new message will + event (blpapi.Event): The ``event`` to which the new message will be appended. The ``event`` must be a test :class:`blpapi.Event` created by :meth:`createEvent()`. - elementDef (SchemaElementDefinition): Used to verify and encode + elementDef (blpapi.SchemaElementDefinition): Used to verify and encode the contents of the message. - properties (MessageProperties): Used to set the metadata properties for - the message. + properties (blpapi.test.MessageProperties): Used to set the metadata + properties for the message. Returns: - MessageFormatter: The :class:`MessageFormatter` used to format the last - appended message. + blpapi.test.MessageFormatter: The :class:`MessageFormatter` used to + format the last appended message. Raises: Exception: If the method fails to append the message. @@ -70,7 +71,8 @@ def deserializeService(serviceXMLStr): :class:`blpapi.Service` in ``XML`` format. The ``str`` should only contain ASCII characters without any embedded ``null`` characters. Returns: - Service: A :class:`blpapi.Service` created from ``serviceXMLStr``. + blpapi.Service: A :class:`blpapi.Service` created from + ``serviceXMLStr``. Raises: Exception: If deserialization fails. @@ -86,7 +88,7 @@ def serializeService(service): """ Serialize the provided ``service`` in ``XML`` format. Args: - service (Service): The :class:`blpapi.Service` to be serialized. + service (blpapi.Service): The :class:`blpapi.Service` to be serialized. Returns: str: The ``service`` represented as an ``XML`` formatted ``str``. @@ -105,13 +107,14 @@ def createTopic(service, isActive=True): :meth:`blpapi.ProviderSession.getTopic()` methods. Args: - service (Service): The :class:`blpapi.Service` to which the returned - :class:`blpapi.Topic` will belong. + service (blpapi.Service): The :class:`blpapi.Service` to which the + returned :class:`blpapi.Topic` will belong. isActive (bool): Optional. Specifies whether the returned :class:`blpapi.Topic` is active. Returns: - Topic: A valid :class:`blpapi.Topic` with the specified ``service``. + blpapi.Topic: A valid :class:`blpapi.Topic` with the specified + ``service``. """ rc, topic_handle = internals.blpapi_TestUtil_createTopic( get_handle(service), @@ -125,10 +128,10 @@ def getAdminMessageDefinition(messageName): ``messageName``. Args: - messageName (Name or str): The name of the desired admin message. + messageName (blpapi.Name or str): The name of the desired admin message. Returns: - SchemaElementDefinition: The element definition for the message + blpapi.SchemaElementDefinition: The element definition for the message specified by ``messageName``. Raises: diff --git a/src/blpapi/utils.py b/src/blpapi/utils.py index def1ead..92501d2 100644 --- a/src/blpapi/utils.py +++ b/src/blpapi/utils.py @@ -2,6 +2,7 @@ """Internal utils.""" +from .compat import Sequence, str_typelist import functools import warnings @@ -10,7 +11,8 @@ MIN_64BIT_INT = -(2**63) MAX_64BIT_INT = 2**63 - 1 -#pylint: disable=too-few-public-methods, useless-object-inheritance + +# pylint: disable=too-few-public-methods, useless-object-inheritance class Iterator(object): """Universal iterator for many of BLPAPI objects. @@ -139,6 +141,16 @@ def wrap_func(*args, **kwargs): return decorate + +# NOTE: `isNonScalarSequence` is used to determine whether `obj` is a +# `Sequence` but does not behave like a scalar. Useful for `Element` and +# `Event` formatting. +# pylint: disable=deprecated-class,no-name-in-module +def isNonScalarSequence(obj): + scalarTypes = str_typelist + (bytearray, memoryview) + return isinstance(obj, Sequence) and not isinstance(obj, scalarTypes) + + __copyright__ = """ Copyright 2012. Bloomberg Finance L.P. diff --git a/src/blpapi/version.py b/src/blpapi/version.py index 108ab83..31cd80d 100644 --- a/src/blpapi/version.py +++ b/src/blpapi/version.py @@ -5,7 +5,8 @@ from __future__ import print_function from . import versionhelper -__version__ = "3.16.5" +__version__ = "3.17.1" + def print_version(): """Print version information of BLPAPI python module and blpapi C++ SDK""" From 516f966b55d3a73dbb95df7ac212e50b9f407193 Mon Sep 17 00:00:00 2001 From: Marland Sitt Date: Fri, 22 Apr 2022 09:14:25 -0700 Subject: [PATCH 10/23] Bump to v3.18.0 --- PKG-INFO | 2 +- changelog.txt | 17 + examples/demoapps/util/RequestOptions.py | 58 ++- src/blpapi.egg-info/PKG-INFO | 2 +- src/blpapi.egg-info/SOURCES.txt | 2 +- src/blpapi/__init__.py | 2 +- src/blpapi/abstractsession.py | 121 +++-- src/blpapi/auth.py | 72 +-- src/blpapi/chandle.py | 11 +- src/blpapi/compat.py | 91 ---- src/blpapi/constant.py | 64 ++- src/blpapi/datatype.py | 40 +- src/blpapi/datetime.py | 61 +-- src/blpapi/debug.py | 48 +- src/blpapi/debug_environment.py | 40 +- src/blpapi/diagnosticsutil.py | 3 +- src/blpapi/element.py | 355 +++++++------ src/blpapi/event.py | 87 ++-- src/blpapi/eventdispatcher.py | 11 +- src/blpapi/eventformatter.py | 133 ++--- src/blpapi/exception.py | 41 +- src/blpapi/highresclock.py | 6 +- src/blpapi/identity.py | 56 +- src/blpapi/internals.py | 23 +- src/blpapi/internals_wrap.c | 629 +++++++++++++++++++++-- src/blpapi/logging.py | 36 +- src/blpapi/message.py | 118 +++-- src/blpapi/name.py | 67 +-- src/blpapi/providersession.py | 321 ++++++------ src/blpapi/request.py | 36 +- src/blpapi/resolutionlist.py | 91 ++-- src/blpapi/schema.py | 156 +++--- src/blpapi/service.py | 135 ++--- src/blpapi/session.py | 336 ++++++++---- src/blpapi/sessionoptions.py | 285 +++++----- src/blpapi/subscriptionlist.py | 66 +-- src/blpapi/test/messageformatter.py | 94 +--- src/blpapi/test/testutil.py | 3 +- src/blpapi/topic.py | 28 +- src/blpapi/topiclist.py | 91 ++-- src/blpapi/typehints.py | 57 ++ src/blpapi/utils.py | 63 ++- src/blpapi/version.py | 11 +- src/blpapi/zfputil.py | 16 +- 44 files changed, 2432 insertions(+), 1553 deletions(-) delete mode 100644 src/blpapi/compat.py create mode 100644 src/blpapi/typehints.py diff --git a/PKG-INFO b/PKG-INFO index 7968b1a..967153f 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: blpapi -Version: 3.17.1 +Version: 3.18.0 Summary: Python SDK for Bloomberg BLPAPI Home-page: http://www.bloomberglabs.com/api/ Author: Bloomberg L.P. diff --git a/changelog.txt b/changelog.txt index 444f5b2..ef55870 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,20 @@ +Version 3.18.0: +=============== +- Improved 'Session.subcribe' and 'Session.resubscribe' interface + The current 'Session.subscribe' and 'Session.resubscribe' raise an + exception when one of the subscriptions is invalid, e.g., subscribe + with a duplicate 'CorrelationId'. A new set of overloads are added + with parameter 'SubscriptionPreprocessMode', which could be + - 'FAIL_ON_FIRST_ERROR': an exception is raised on the first + invalid subscription in the list, and the entire batch will be + considered failed. + - 'RETURN_INDIVIDUAL_ERRORS': instead of raising exceptions, a + list of 'SubscriptionPreprocessError' is returned, each + representing an error due to an invalid subscription in the list. + The valid subscriptions will move forward. + +- Stability and performance improvements + Version 3.17.1: =============== - Stability and performance improvements diff --git a/examples/demoapps/util/RequestOptions.py b/examples/demoapps/util/RequestOptions.py index 2540f4c..0509bf3 100644 --- a/examples/demoapps/util/RequestOptions.py +++ b/examples/demoapps/util/RequestOptions.py @@ -34,15 +34,19 @@ def addRequestOptions(parser): """ # Compute default start/end datetime - defaultStartDateTime, defaultEndDateTime = computeDefaultStartAndEndDateTime() + (defaultStartDateTime, defaultIntradayBarEndDateTime, + defaultIntradayTickEndDateTime) = computeDefaultStartAndEndDateTime() formattedDefaultStartDateTime = defaultStartDateTime.isoformat( timespec="seconds") - formattedDefaultEndDateTime = defaultEndDateTime.isoformat( + formattedDefaultIntradayBarEndDateTime = defaultIntradayBarEndDateTime.isoformat( + timespec="seconds") + formattedDefaultIntradayTickEndDateTime = defaultIntradayTickEndDateTime.isoformat( timespec="seconds") isoDatetimeFormat = "YYYY-MM-DDTHH:MM:SS" # Request options + defaultBarInterval = 5 argGroupRequest = parser.add_argument_group("Request Options") argGroupRequest.add_argument("-s", "--service", @@ -75,9 +79,9 @@ def addRequestOptions(parser): "--interval", dest="barInterval", type=int, - help="Bar interval (default: %(default)d)", + help="Bar interval in minutes (default: %(default)d)", metavar="barInterval", - default=60) + default=defaultBarInterval) argGroupRequest.add_argument("-I", "--include-condition-codes", dest="conditionCodes", @@ -93,17 +97,15 @@ def addRequestOptions(parser): argGroupRequest.add_argument("--start-date", dest="startDateTime", help="Start datetime in the format of " - f"{isoDatetimeFormat} (default: {formattedDefaultStartDateTime})", + f"{isoDatetimeFormat}", metavar="startDateTime", - type=parseDatetime, - default=defaultStartDateTime) + type=parseDatetime) argGroupRequest.add_argument("--end-date", dest="endDateTime", help="End datetime in the format of " - f"{isoDatetimeFormat} (default: {formattedDefaultEndDateTime})", + f"{isoDatetimeFormat}", metavar="endDateTime", - type=parseDatetime, - default=defaultEndDateTime) + type=parseDatetime) argGroupRequest.add_argument("-O", "--override", dest="overrides", @@ -138,9 +140,9 @@ def addRequestOptions(parser): -r, --request {INTRADAY_BAR_REQUEST} [-S, --security ] [-e, --event ] - [-i, --interval ] + [-i, --interval ] [--start-date ] - [--end-date ] + [--end-date ] [-G, --gap-fill-initial-bar] 1) All times are in GMT. 2) Only one security can be specified. @@ -149,9 +151,8 @@ def addRequestOptions(parser): -r, --request {INTRADAY_TICK_REQUEST} [-S, --security ] [-e, --event ] - [-i, --interval ] [--start-date ] - [--end-date ] + [--end-date ] [--include-condition-codes ] 1) All times are in GMT. 2) Only one security can be specified. @@ -181,16 +182,21 @@ def setDefaultValues(options): if options.requestType == REFERENCE_DATA_REQUEST_OVERRIDE: options.fields += ["DS002", "EQY_WEIGHTED_AVG_PX"] - if not options.overrides and options.requestType is REFERENCE_DATA_REQUEST_OVERRIDE: + if not options.overrides and options.requestType == REFERENCE_DATA_REQUEST_OVERRIDE: options.overrides = [Override("VWAP_START_TIME", "9:30"), Override("VWAP_END_TIME", "11:30")] - startDatetime, endDatetime = computeDefaultStartAndEndDateTime() - if not options.startDateTime: - options.startDateTime = startDatetime + # Compute default start/end datetime + if not options.startDateTime or not options.endDateTime: + (defaultStartDateTime, defaultIntradayBarEndDateTime, + defaultIntradayTickEndDateTime) = computeDefaultStartAndEndDateTime() + if not options.startDateTime: + options.startDateTime = defaultStartDateTime - if not options.endDateTime: - options.endDateTime = endDatetime + if not options.endDateTime: + options.endDateTime = (defaultIntradayBarEndDateTime + if options.requestType == INTRADAY_BAR_REQUEST + else defaultIntradayTickEndDateTime) def computeDefaultStartAndEndDateTime(): @@ -201,11 +207,15 @@ def computeDefaultStartAndEndDateTime(): elif datetime.date.weekday(previousTradingDate.date()) == 6: # if Sunday previousTradingDate = previousTradingDate - datetime.timedelta(days=2) - previousTradingDate = previousTradingDate.replace( - hour=13, minute=30, second=0) - nextFiveMinutes = previousTradingDate + datetime.timedelta(minutes=5) + # Start on the market open time (GMT) on previous trading day. + startDateTime = previousTradingDate.replace( + hour=14, minute=30, second=0) + + # The default bar interval is 5 minute, by default there are 12 bars + intradayBarEndDateTime = startDateTime + datetime.timedelta(minutes=60) + intradayTickEndDateTime = startDateTime + datetime.timedelta(minutes=5) - return previousTradingDate, nextFiveMinutes + return startDateTime, intradayBarEndDateTime, intradayTickEndDateTime __copyright__ = """ diff --git a/src/blpapi.egg-info/PKG-INFO b/src/blpapi.egg-info/PKG-INFO index 7968b1a..967153f 100644 --- a/src/blpapi.egg-info/PKG-INFO +++ b/src/blpapi.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: blpapi -Version: 3.17.1 +Version: 3.18.0 Summary: Python SDK for Bloomberg BLPAPI Home-page: http://www.bloomberglabs.com/api/ Author: Bloomberg L.P. diff --git a/src/blpapi.egg-info/SOURCES.txt b/src/blpapi.egg-info/SOURCES.txt index f43efbf..2da53c1 100644 --- a/src/blpapi.egg-info/SOURCES.txt +++ b/src/blpapi.egg-info/SOURCES.txt @@ -66,7 +66,6 @@ src/blpapi/__init__.py src/blpapi/abstractsession.py src/blpapi/auth.py src/blpapi/chandle.py -src/blpapi/compat.py src/blpapi/constant.py src/blpapi/datatype.py src/blpapi/datetime.py @@ -96,6 +95,7 @@ src/blpapi/sessionoptions.py src/blpapi/subscriptionlist.py src/blpapi/topic.py src/blpapi/topiclist.py +src/blpapi/typehints.py src/blpapi/utils.py src/blpapi/version.py src/blpapi/versionhelper.py diff --git a/src/blpapi/__init__.py b/src/blpapi/__init__.py index 0d5f652..d703cc6 100644 --- a/src/blpapi/__init__.py +++ b/src/blpapi/__init__.py @@ -50,7 +50,7 @@ from .resolutionlist import ResolutionList from .schema import SchemaElementDefinition, SchemaStatus, SchemaTypeDefinition from .service import Service, Operation -from .session import Session +from .session import Session, SubscriptionPreprocessError, SubscriptionPreprocessMode from .sessionoptions import SessionOptions, TlsOptions from .subscriptionlist import SubscriptionList from .topic import Topic diff --git a/src/blpapi/abstractsession.py b/src/blpapi/abstractsession.py index ff9b776..c7cd190 100644 --- a/src/blpapi/abstractsession.py +++ b/src/blpapi/abstractsession.py @@ -17,19 +17,19 @@ """ # pylint: disable=protected-access - +from typing import Callable, Union, Sequence, Optional +from . import typehints # pylint: disable=unused-import +from .typehints import BlpapiAbstractSessionHandle from . import exception from .exception import _ExceptionUtil from .identity import Identity from .service import Service from . import internals from .internals import CorrelationId -from . import utils from .utils import get_handle -from .compat import with_metaclass from .chandle import CHandle -@with_metaclass(utils.MetaClassForClassesWithEnums) + class AbstractSession(CHandle): """A common interface shared between publish and consumer sessions. @@ -85,7 +85,10 @@ class AbstractSession(CHandle): ``nextEvent()``. """ - def __init__(self, handle=None, dtor=None): + def __init__( + self, + handle: Optional[BlpapiAbstractSessionHandle]=None, + dtor: Optional[Callable]=None) -> None: """Instantiate an :class:`AbstractSession` with the specified handle. Args: @@ -102,17 +105,17 @@ def __init__(self, handle=None, dtor=None): if self.__class__ is AbstractSession: raise NotImplementedError("Don't instantiate this class directly.\ Create sessions using one of the concrete subclasses of this class.") - super(AbstractSession, self).__init__(handle, dtor) + super(AbstractSession, self).__init__(handle, dtor) # type: ignore self.__handle = handle - def openService(self, serviceName): + def openService(self, serviceName: str) -> bool: """Open the service identified by the specified ``serviceName``. Args: - serviceName (str): Name of the service + serviceName: Name of the service Returns: - bool: ``True`` if the service is opened successfully, ``False`` + ``True`` if the service is opened successfully, ``False`` otherwise. Attempt to open the service identified by the specified ``serviceName`` @@ -132,12 +135,16 @@ def openService(self, serviceName): self.__handle, serviceName) == 0 - def openServiceAsync(self, serviceName, correlationId=None): + def openServiceAsync( + self, + serviceName: str, + correlationId: Optional[CorrelationId]=None + ) -> CorrelationId: """Begin the process to open the service and return immediately. Args: - serviceName (str): Name of the service - correlationId (CorrelationId): Correlation id to associate with + serviceName: Name of the service + correlationId: Correlation id to associate with events generated as a result of this call Returns: @@ -162,22 +169,23 @@ def openServiceAsync(self, serviceName, correlationId=None): internals.blpapi_AbstractSession_openServiceAsync( self.__handle, serviceName, - get_handle(correlationId))) + correlationId)) return correlationId - def sendAuthorizationRequest(self, - request, - identity, - correlationId=None, - eventQueue=None): + def sendAuthorizationRequest( + self, + request: "typehints.Request", + identity: Identity, + correlationId: Optional[CorrelationId]=None, + eventQueue: Optional["typehints.EventQueue"]=None + ) -> CorrelationId: """Send the specified ``authorizationRequest``. Args: - request (Request): Authorization request to send - identity (Identity): Identity to update with the results - correlationId (CorrelationId): Correlation id to associate with the - request - eventQueue (EventQueue): Event queue on which the events related to + request: Authorization request to send + identity: Identity to update with the results + correlationId: Correlation id to associate with the request + eventQueue: Event queue on which the events related to this request will arrive Returns: @@ -217,7 +225,7 @@ def sendAuthorizationRequest(self, self.__handle, get_handle(request), get_handle(identity), - get_handle(correlationId), + correlationId, get_handle(eventQueue), None # no request label )) @@ -225,11 +233,13 @@ def sendAuthorizationRequest(self, eventQueue._registerSession(self) return correlationId - def cancel(self, correlationId): + def cancel(self, + correlationId: Union[CorrelationId, + Sequence[CorrelationId]]) -> None: """Cancel request(s) with a single ``correlationId`` or a list. Args: - correlationId (CorrelationId or [CorrelationId]): Correlation id(s) + correlationId: Correlation id(s) associated with the request(s) to cancel For all specified ``correlationId`` values that identify @@ -253,20 +263,22 @@ def cancel(self, correlationId): cids = [correlationId] _ExceptionUtil.raiseOnError(internals.blpapi_AbstractSession_cancel( self.__handle, - cids, + cids, # type: ignore None)) # no request label - def generateToken(self, correlationId=None, - eventQueue=None, authId=None, ipAddress=None): + def generateToken(self, + correlationId: Optional[CorrelationId]=None, + eventQueue: Optional["typehints.EventQueue"]=None, + authId: Optional[str]=None, + ipAddress: Optional[str]=None) -> CorrelationId: """Generate a token to be used for authorization. Args: - correlationId (CorrelationId): Correlation id to be associated with - the request - eventQueue (EventQueue): Event queue on which to receive Events + correlationId: Correlation id to be associated with the request + eventQueue: Event queue on which to receive Events related to this request - authId (str): The id used for authentication - ipAddress (str): IP of the machine used for authentication + authId: The id used for authentication + ipAddress: IP of the machine used for authentication Returns: CorrelationId: The correlation id used to identify the Events @@ -287,13 +299,13 @@ def generateToken(self, correlationId=None, _ExceptionUtil.raiseOnError( internals.blpapi_AbstractSession_generateToken( self.__handle, - get_handle(correlationId), + correlationId, get_handle(eventQueue))) elif authId is not None and ipAddress is not None: _ExceptionUtil.raiseOnError( internals.blpapi_AbstractSession_generateManualToken( self.__handle, - get_handle(correlationId), + correlationId, authId, ipAddress, get_handle(eventQueue))) @@ -304,11 +316,11 @@ def generateToken(self, correlationId=None, eventQueue._registerSession(self) return correlationId - def getService(self, serviceName): + def getService(self, serviceName: str) -> Service: """Return a :class:`Service` object representing the service. Args: - serviceName (str): Name of the service to retrieve + serviceName: Name of the service to retrieve Returns: Service: Service identified by the service name @@ -324,9 +336,9 @@ def getService(self, serviceName): self.__handle, serviceName) _ExceptionUtil.raiseOnError(errorCode) - return Service(service, self) + return Service(service, {self}) - def createIdentity(self): + def createIdentity(self) -> Identity: """Create an :class:`Identity` which is valid but has not been authorized. @@ -335,17 +347,18 @@ def createIdentity(self): """ return Identity( internals.blpapi_AbstractSession_createIdentity(self.__handle), - self) + (self,)) - def generateAuthorizedIdentity(self, - authOptions, - correlationId=None): + def generateAuthorizedIdentity( + self, + authOptions: "typehints.AuthOptions", + correlationId: Optional[CorrelationId]=None) -> CorrelationId: """Generates an authorized :class:`Identity` with the specified ``authOptions`` and ``correlationId``. Args: - authOptions (AuthOptions): Used to generate the :class:`Identity`. - correlationId (CorrelationId): Optional. Will identify the messages + authOptions: Used to generate the :class:`Identity`. + correlationId: Optional. Will identify the messages associated with the generated :class:`Identity`. Returns: CorrelationId: Identifies the aforementioned events and the @@ -368,18 +381,19 @@ def generateAuthorizedIdentity(self, .blpapi_AbstractSession_generateAuthorizedIdentityAsync( self.__handle, get_handle(authOptions), - get_handle(correlationId)) + correlationId) _ExceptionUtil.raiseOnError(retcode) return correlationId - def getAuthorizedIdentity(self, correlationId=None): + def getAuthorizedIdentity( + self, + correlationId: Optional[CorrelationId]=None) -> Identity: """Returns the authorized :class:`Identity` associated with ``correlationId``. If ``correlationId`` is not given, returns the session identity. Args: - correlationId (CorrelationId): Optional. Associated with an - :class:`Identity`. + correlationId: Optional. Associated with an :class:`Identity`. Returns: Identity: the :class:`Identity` associated with ``correlationId``. @@ -395,12 +409,9 @@ def getAuthorizedIdentity(self, correlationId=None): retcode, identity_handle = internals \ .blpapi_AbstractSession_getAuthorizedIdentity( self.__handle, - get_handle(correlationId)) + correlationId) _ExceptionUtil.raiseOnError(retcode) - return Identity(identity_handle, self) - - # Protect enumeration constant(s) defined in this class and in classes - # derived from this class from changes: + return Identity(identity_handle, (self,)) __copyright__ = """ Copyright 2019. Bloomberg Finance L.P. diff --git a/src/blpapi/auth.py b/src/blpapi/auth.py index ecd27d3..8cb8945 100644 --- a/src/blpapi/auth.py +++ b/src/blpapi/auth.py @@ -2,9 +2,11 @@ """Provide a configuration to specify the settings used for authorization.""" -from blpapi import internals -from blpapi.utils import get_handle -from blpapi.exception import _ExceptionUtil +from typing import Callable, Any +from .typehints import BlpapiAuthOptionsHandle, BlpapiAuthUserHandle +from . import internals +from .utils import get_handle +from .exception import _ExceptionUtil from .chandle import CHandle class AuthOptions(CHandle): @@ -13,9 +15,12 @@ class AuthOptions(CHandle): identity or use to authorize other identities. """ - def __init__(self, handle, **kwargs): + def __init__(self, + handle: BlpapiAuthOptionsHandle, + **kwargs) -> None: """For internal use only.""" - super(AuthOptions, self).__init__(handle, None) + noop = lambda *args: None + super(AuthOptions, self).__init__(handle, noop) self.__handle = handle self.__app_handle = kwargs.get("app_handle") self.__token_handle = kwargs.get("token_handle") @@ -24,14 +29,16 @@ def __init__(self, handle, **kwargs): self._token_dtor = internals.blpapi_AuthToken_destroy @classmethod - def createWithUser(cls, user): + def createWithUser(cls: Callable, + user: "AuthUser") -> "AuthOptions": """Creates an :class:`AuthOptions` instance for User Mode with the Operating System Login (Domain/User), Active Directory, or Email. Args: - user (AuthUser): user-specific authorization option. + user: user-specific authorization option. + Returns: - AuthOptions: Specifies User Mode with the Operating System Login + Specifies User Mode with the Operating System Login (Domain/User), Active Directory, or Email. The behavior is undefined when ``user`` was created with @@ -43,14 +50,14 @@ def createWithUser(cls, user): return cls(authOptions_handle) @classmethod - def createWithApp(cls, appName): + def createWithApp(cls: Callable, appName: str) -> "AuthOptions": """Create an :class:`AuthOptions` instance for Application Mode. Args: - appName (str): app name used for Application Mode. + appName: app name used for Application Mode. Returns: - AuthOptions: Specifies Application Mode. + Specifies Application Mode. The behavior is undefined when ``appName`` is ``None`` or ``""``. """ @@ -61,14 +68,14 @@ def createWithApp(cls, appName): return cls(authOptions_handle, app_handle=app_handle) @classmethod - def createWithToken(cls, token): + def createWithToken(cls: Callable, token: str) -> "AuthOptions": """Create an :class:`AuthOptions` instance for Manual Token Mode. Args: - token (str): token to use for Manual Token Mode. + token: token to use for Manual Token Mode. Returns: - AuthOptions: Specifies Manual Token Mode. + Specifies Manual Token Mode. The behavior is undefined when ``token`` is ``None`` or ``""``. """ @@ -79,13 +86,15 @@ def createWithToken(cls, token): return cls(authOptions_handle, token_handle=token_handle) @classmethod - def createWithUserAndApp(cls, user, appName): + def createWithUserAndApp(cls: Callable, + user: "AuthUser", + appName: str) -> "AuthOptions": """Create an :class:`AuthOptions` instance for User and Application Mode. Args: - user (AuthUser): user-specific authorization option. - appName (str): app name used for Application Mode. + user: user-specific authorization option. + appName: app name used for Application Mode. Returns: AuthOptions: an :class:`AuthOptions` that contains the @@ -101,7 +110,7 @@ def createWithUserAndApp(cls, user, appName): _ExceptionUtil.raiseOnError(retcode) return cls(authOptions_handle, app_handle=app_handle) - def destroy(self): + def destroy(self) -> None: """Destroy this :class:`AuthOptions`.""" if self.__handle: self._options_dtor(self.__handle) @@ -114,7 +123,7 @@ def destroy(self): self.__token_handle = None @staticmethod - def _create_app_handle(appName): + def _create_app_handle(appName: str) -> Any: """For internal use only.""" retcode, app_handle = internals \ .blpapi_AuthApplication_create(appName) @@ -122,7 +131,7 @@ def _create_app_handle(appName): return app_handle @staticmethod - def _create_token_handle(token): + def _create_token_handle(token: str) -> Any: """For internal use only.""" retcode, token_handle = internals \ .blpapi_AuthToken_create(token) @@ -133,19 +142,19 @@ def _create_token_handle(token): class AuthUser(CHandle): """Contains user-specific authorization options.""" - def __init__(self, handle): + def __init__(self, handle: BlpapiAuthUserHandle) -> None: """For internal use only.""" super(AuthUser, self).__init__( handle, internals.blpapi_AuthUser_destroy) self.__handle = handle # pylint: disable=unused-private-member @classmethod - def createWithLogonName(cls): + def createWithLogonName(cls: Callable) -> "AuthUser": """Creates an :class:`AuthUser` instance configured for Operating System Login (Domain/User) authorization mode (OS_LOGON). Returns: - AuthUser: Configured for Operating System Login (Domain/User) mode. + Configured for Operating System Login (Domain/User) mode. """ retcode, handle = internals \ .blpapi_AuthUser_createWithLogonName() @@ -153,15 +162,17 @@ def createWithLogonName(cls): return cls(handle) @classmethod - def createWithActiveDirectoryProperty(cls, propertyName): + def createWithActiveDirectoryProperty( + cls: Callable, + propertyName: str) -> "AuthUser": """Creates an :class:`AuthUser` instance configured for Active Directory authorization mode (DIRECTORY_SERVICE). Args: - propertyName (str): Active Directory property. + propertyName: Active Directory property. Returns: - AuthUser: Configured for Active Directory (DIRECTORY_SERVICE) + Configured for Active Directory (DIRECTORY_SERVICE) authorization mode. The behavior is undefined when ``propertyName`` is ``""`` or @@ -174,16 +185,17 @@ def createWithActiveDirectoryProperty(cls, propertyName): return cls(handle) @classmethod - def createWithManualOptions(cls, userId, ipAddress): + def createWithManualOptions( + cls: Callable, userId: str, ipAddress:str) -> "AuthUser": """Creates an :class:`AuthUser` instance configured for manual authorization. Args: - userId (str): user id. - ipAddress (str): IP address. + userId: user id. + ipAddress: IP address. Returns: - AuthUser: Configured for manual authorization. + Configured for manual authorization. The behavior is undefined when either ``userId`` or ``ipAddress`` is ``""`` or ``None``. diff --git a/src/blpapi/chandle.py b/src/blpapi/chandle.py index 2a72426..b19e35e 100644 --- a/src/blpapi/chandle.py +++ b/src/blpapi/chandle.py @@ -6,12 +6,13 @@ It handles the life of an object with a handle from C layer. """ -# pylint: disable=useless-object-inheritance +from typing import Callable, Any -class CHandle(object): + +class CHandle: """A base class for objects that rely on C handles""" - def __init__(self, handle, dtor): + def __init__(self, handle: Any, dtor: Callable): """ Set the handle and the dtor """ self.__handle = handle self._dtor = dtor @@ -27,12 +28,14 @@ def destroy(self): """ Destroy the handle using stored dtor """ if self.__handle: self._dtor(self.__handle) + self._dtor = None self.__handle = None - def _handle(self): + def _handle(self) -> Any: """Return the internal implementation.""" return self.__handle + __copyright__ = """ Copyright 2020. Bloomberg Finance L.P. diff --git a/src/blpapi/compat.py b/src/blpapi/compat.py deleted file mode 100644 index e38c71e..0000000 --- a/src/blpapi/compat.py +++ /dev/null @@ -1,91 +0,0 @@ -""" Different compatibility tools. Needed to support both -2.x and 3.x python versions.""" - -import sys - -# pylint: disable=undefined-variable - -def with_metaclass(metaclass): - """Python 2 and 3 different metaclass syntax workaround. - Should be used as a decorator.""" - def wrapper(cls): - """ decorator """ - lvars = cls.__dict__.copy() - slots = lvars.get('__slots__') - if slots is not None: - if isinstance(slots, str): - slots = [slots] - for slots_var in slots: - lvars.pop(slots_var) - lvars.pop('__dict__', None) - lvars.pop('__weakref__', None) - return metaclass(cls.__name__, cls.__bases__, lvars) - return wrapper - -# NOTE: this function should be used to convert integer values to long -# values in both python2 and 3. - -if sys.version.startswith('2'): - def tolong(val): - return long(val) -else: - def tolong(val): - return int(val) - -# NOTE: python2 wrapper uses byte strings (str type) to pass strings -# to C-functions, unicode type is not supported so we need to encode -# all strings first. On the other hand, python3 wrapper uses unicode strings -# (str type) for this so we need to decode byte-strings first to get unicode -# strings. Rule of thumb: to pass string to any wrapper function convert -# it using `conv2str` function first, to check that type of the string -# is correct - use `isstr` function. - -if sys.version.startswith('2'): - def conv2str(s): - """Convert unicode string to byte string.""" - if isinstance(s, str): - return s - if isinstance(s, unicode): - return s.encode('utf-8') - return None - - def isstr(s): - if isinstance(s, (str, unicode)): - return True - return False -else: - def conv2str(s): - """Convert byte string to unicode string.""" - if isinstance(s, bytes): - return s.decode() - if isinstance(s, str): - return s - return None - - def isstr(s): - if isinstance(s, (bytes, str)): - return True - return False - -# NOTE: integer typelist for different python versions -# to use with isinstance builtin function -if sys.version.startswith('2'): - int_typelist = (int, long) -else: - int_typelist = (int,) - -# NOTE: string typelist for different python versions -# to use with isinstance builtin function -if sys.version.startswith('2'): - str_typelist = (str, unicode) -else: - str_typelist = (bytes, str) - -# Helper import -# pylint: disable=deprecated-class,no-name-in-module -if sys.version.startswith('2'): - from collections import Mapping as _Mapping, Sequence as _Sequence -else: - from collections.abc import Mapping as _Mapping, Sequence as _Sequence -Mapping = _Mapping -Sequence = _Sequence diff --git a/src/blpapi/constant.py b/src/blpapi/constant.py index 56940cb..a0c17a1 100644 --- a/src/blpapi/constant.py +++ b/src/blpapi/constant.py @@ -11,12 +11,19 @@ """ - -from .exception import _ExceptionUtil, NotFoundException, \ +from typing import Any, Iterator as IteratorType, Optional, Set +from .exception import \ + _ExceptionUtil, \ + NotFoundException, \ IndexOutOfRangeException from .name import Name, getNamePair from .datatype import DataType from .datetime import _DatetimeUtil +from . import typehints # pylint: disable=unused-import +from .typehints import \ + AnyPythonDatetime, \ + BlpapiConstantHandle, \ + BlpapiConstantListHandle from . import utils from . import internals @@ -41,7 +48,9 @@ class Constant: by other ``blpapi`` components. """ - def __init__(self, handle, sessions): + def __init__(self, + handle: BlpapiConstantHandle, + sessions: Optional[Set["typehints.AbstractSession"]]) -> None: """ Args: handle: Handle to the internal implementation @@ -50,44 +59,43 @@ def __init__(self, handle, sessions): self.__handle = handle self.__sessions = sessions - def name(self): + def name(self) -> Name: """ Returns: - Name: The symbolic name of this :class:`Constant`. + The symbolic name of this :class:`Constant`. """ return Name._createInternally( internals.blpapi_Constant_name(self.__handle)) - def description(self): + def description(self) -> str: """ Returns: - str: Human readable description of this :class:`Constant`. + Human readable description of this :class:`Constant`. """ return internals.blpapi_Constant_description(self.__handle) - def status(self): + def status(self) -> int: """ Returns: - int: Status of this :class:`Constant`. + Status of this :class:`Constant`. The possible return values are enumerated in :class:`SchemaStatus`. """ return internals.blpapi_Constant_status(self.__handle) - def datatype(self): + def datatype(self) -> int: """ Returns: - int: Data type used to represent the value of this - :class:`Constant`. + Data type used to represent the value of this :class:`Constant`. The possible return values are enumerated in :class:`DataType`. """ return internals.blpapi_Constant_datatype(self.__handle) - def getValueAsInteger(self): + def getValueAsInteger(self) -> int: """ Returns: - int: Value of this object as an integer. + Value of this object as an integer. Raises: InvalidConversionException: If the value cannot be converted to an @@ -102,10 +110,10 @@ def getValueAsInteger(self): _ExceptionUtil.raiseOnError(errCode) return value - def getValueAsFloat(self): + def getValueAsFloat(self) -> float: """ Returns: - float: Value of this object as a float. + Value of this object as a float. Raises: InvalidConversionException: If the value cannot be converted to a @@ -120,11 +128,10 @@ def getValueAsFloat(self): _ExceptionUtil.raiseOnError(errCode) return value - def getValueAsDatetime(self): + def getValueAsDatetime(self) -> AnyPythonDatetime: """ Returns: - datetime.time or datetime.date or datetime.datetime: Value of this - object as one of the datetime types. + Value of this object as one of the datetime types. Raises: InvalidConversionException: If the value cannot be converted to @@ -135,10 +142,10 @@ def getValueAsDatetime(self): _ExceptionUtil.raiseOnError(errCode) return _DatetimeUtil.convertToNativeNotHighPrecision(value) - def getValueAsString(self): + def getValueAsString(self) -> str: """ Returns: - str: Value of this object as a string. + Value of this object as a string. Raises: InvalidConversionException: If the value cannot be converted to a @@ -153,7 +160,7 @@ def getValueAsString(self): _ExceptionUtil.raiseOnError(errCode) return value - def getValue(self): + def getValue(self) -> Any: """ Returns: Value of this object as it is stored in the object. @@ -164,7 +171,7 @@ def getValue(self): Constant.getValueAsString) return valueGetter(self) - def _sessions(self): + def _sessions(self) -> Optional[Set["typehints.AbstractSession"]]: """Return session(s) this object is related to. For internal use.""" return self.__sessions @@ -184,7 +191,9 @@ class ConstantList: returned by other ``blpapi`` components. """ - def __init__(self, handle, sessions): + def __init__(self, + handle: BlpapiConstantListHandle, + sessions: Optional[Set["typehints.AbstractSession"]]) -> None: """ Args: handle: Handle to the internal implementation @@ -193,7 +202,7 @@ def __init__(self, handle, sessions): self.__handle = handle self.__sessions = sessions - def __iter__(self): + def __iter__(self) -> IteratorType: """ Returns: Iterator over constants contained in this :class:`ConstantList` @@ -277,8 +286,7 @@ def getConstant(self, name): names[1]) if res is None: errMessage = \ - "Constant '{0!s}' is not found in '{1!s}'.".\ - format(name, self.name()) + f"Constant '{name!s}' is not found in '{self.name()!s}'." raise NotFoundException(errMessage, 0) return Constant(res, self.__sessions) @@ -297,7 +305,7 @@ def getConstantAt(self, position): res = internals.blpapi_ConstantList_getConstantAt(self.__handle, position) if res is None: - errMessage = "Index '{0}' out of bounds.".format(position) + errMessage = f"Index '{position}' out of bounds." raise IndexOutOfRangeException(errMessage, 0) return Constant(res, self.__sessions) diff --git a/src/blpapi/datatype.py b/src/blpapi/datatype.py index b58df81..46e0a7c 100644 --- a/src/blpapi/datatype.py +++ b/src/blpapi/datatype.py @@ -8,49 +8,47 @@ from . import internals from . import utils -from .compat import with_metaclass -# pylint: disable=too-few-public-methods,useless-object-inheritance -@with_metaclass(utils.MetaClassForClassesWithEnums) -class DataType(object): +# pylint: disable=too-few-public-methods +class DataType(metaclass=utils.MetaClassForClassesWithEnums): """Contains the possible data types which can be represented in an :class:`Element`. """ - BOOL = internals.DATATYPE_BOOL + BOOL = internals.DATATYPE_BOOL # type: ignore """Boolean""" - CHAR = internals.DATATYPE_CHAR + CHAR = internals.DATATYPE_CHAR # type: ignore """Char""" - BYTE = internals.DATATYPE_BYTE + BYTE = internals.DATATYPE_BYTE # type: ignore """Unsigned 8 bit value""" - INT32 = internals.DATATYPE_INT32 + INT32 = internals.DATATYPE_INT32 # type: ignore """32 bit Integer""" - INT64 = internals.DATATYPE_INT64 + INT64 = internals.DATATYPE_INT64 # type: ignore """64 bit Integer""" - FLOAT32 = internals.DATATYPE_FLOAT32 + FLOAT32 = internals.DATATYPE_FLOAT32 # type: ignore """32 bit Floating point""" - FLOAT64 = internals.DATATYPE_FLOAT64 + FLOAT64 = internals.DATATYPE_FLOAT64 # type: ignore """64 bit Floating point""" - STRING = internals.DATATYPE_STRING + STRING = internals.DATATYPE_STRING # type: ignore """ASCIIZ string""" - BYTEARRAY = internals.DATATYPE_BYTEARRAY + BYTEARRAY = internals.DATATYPE_BYTEARRAY # type: ignore """Opaque binary data""" - DATE = internals.DATATYPE_DATE + DATE = internals.DATATYPE_DATE # type: ignore """Date""" - TIME = internals.DATATYPE_TIME + TIME = internals.DATATYPE_TIME # type: ignore """Timestamp""" - DECIMAL = internals.DATATYPE_DECIMAL + DECIMAL = internals.DATATYPE_DECIMAL # type: ignore """Currently Unsupported""" - DATETIME = internals.DATATYPE_DATETIME + DATETIME = internals.DATATYPE_DATETIME # type: ignore """Date and time""" - ENUMERATION = internals.DATATYPE_ENUMERATION + ENUMERATION = internals.DATATYPE_ENUMERATION # type: ignore """An opaque enumeration""" - SEQUENCE = internals.DATATYPE_SEQUENCE + SEQUENCE = internals.DATATYPE_SEQUENCE # type: ignore """Sequence type""" - CHOICE = internals.DATATYPE_CHOICE + CHOICE = internals.DATATYPE_CHOICE # type: ignore """Choice type""" - CORRELATION_ID = internals.DATATYPE_CORRELATION_ID + CORRELATION_ID = internals.DATATYPE_CORRELATION_ID # type: ignore """Used for some internal messages""" __copyright__ = """ diff --git a/src/blpapi/datetime.py b/src/blpapi/datetime.py index 4efc29e..cad79b3 100644 --- a/src/blpapi/datetime.py +++ b/src/blpapi/datetime.py @@ -2,20 +2,17 @@ """Utilities that deal with blpapi.Datetime data type""" -from __future__ import absolute_import -from __future__ import division - import datetime as _dt +from typing import Any, Optional +from .typehints import AnyPythonDatetime, BlpapiDatetime from . import internals from . import utils -from .compat import with_metaclass, tolong - +from . import typehints # pylint: disable=unused-import -# pylint: disable=no-member,useless-object-inheritance -@with_metaclass(utils.MetaClassForClassesWithEnums) -class FixedOffset(_dt.tzinfo): +# pylint: disable=no-member +class FixedOffset(_dt.tzinfo, metaclass=utils.MetaClassForClassesWithEnums): """Time zone information. Represents time zone information to be used with Python standard library @@ -43,10 +40,10 @@ class FixedOffset(_dt.tzinfo): https://docs.python.org/library/datetime.html """ - def __init__(self, offsetInMinutes=0): + def __init__(self, offsetInMinutes: int = 0) -> None: """ Args: - offsetInMinutes (int): Offset from UTC in minutes + offsetInMinutes: Offset from UTC in minutes Creates an object that implements :class:`datetime.tzinfo` interface and represents a timezone with the specified ``offsetInMinutes`` from @@ -54,45 +51,38 @@ def __init__(self, offsetInMinutes=0): """ self.__offset = _dt.timedelta(minutes=offsetInMinutes) - def utcoffset(self, dt): + def utcoffset(self, dt: Optional[_dt.datetime]) -> _dt.timedelta: del dt return self.__offset - def dst(self, dt): # pylint: disable=no-self-use + def dst(self, dt: Optional[_dt.datetime]) -> _dt.timedelta: # pylint: disable=no-self-use del dt return _dt.timedelta(0) - def tzname(self, dt): + def tzname(self, dt: Optional[_dt.datetime]) -> _dt.timedelta: # type: ignore # superclass returns str, but .__offset is a timedelta del dt return self.__offset - def getOffsetInMinutes(self): + def getOffsetInMinutes(self) -> int: """ Returns: - int: Offset from UTC in minutes + Offset from UTC in minutes """ return self.__offset.days * 24 * 60 + self.__offset.seconds // 60 - def __hash__(self): + def __hash__(self) -> int: """x.__hash__() <==> hash(x)""" return self.getOffsetInMinutes() - def __cmp__(self, other): - """Let the comparison operations work based on the time delta. - NOTE: (compatibility) this method have no special meaning in python3, - we should use __eq__, __lt__ and __le__ instead. Built-in cmp function - is also gone. This method can be called only from python2.""" - return cmp(self.getOffsetInMinutes(), other.getOffsetInMinutes()) # pylint: disable=undefined-variable - - def __eq__(self, other): + def __eq__(self, other: "FixedOffset") -> bool: # type: ignore # mypy wants us to accept arbitrary object and check isinstance() """Let the equality operator work based on the time delta.""" return self.getOffsetInMinutes() == other.getOffsetInMinutes() - def __lt__(self, other): + def __lt__(self, other: "FixedOffset") -> bool: """Let the comparison operator work based on the time delta.""" return self.getOffsetInMinutes() < other.getOffsetInMinutes() - def __le__(self, other): + def __le__(self, other: "FixedOffset") -> bool: """Let the comparison operator work based on the time delta.""" return self.getOffsetInMinutes() <= other.getOffsetInMinutes() @@ -104,7 +94,7 @@ def __le__(self, other): class _DatetimeUtil(object): """Utility methods that deal with BLPAPI dates and times.""" @staticmethod - def convertToNative(blpapiDatetimeObj): + def convertToNative(blpapiDatetimeObj: BlpapiDatetime) -> AnyPythonDatetime: """Convert BLPAPI Datetime object to a suitable Python object.""" isHighPrecision = isinstance( @@ -131,7 +121,7 @@ def convertToNative(blpapiDatetimeObj): microsecs) @staticmethod - def convertToNativeNotHighPrecision(blpapiDatetime): + def convertToNativeNotHighPrecision(blpapiDatetime: BlpapiDatetime) -> AnyPythonDatetime: """Convert BLPAPI Datetime object to a suitable Python object. This version should only be used for logging callback which does not provide a high precision datetime alternative.""" @@ -149,10 +139,11 @@ def convertToNativeNotHighPrecision(blpapiDatetime): microsecs) @staticmethod - def _convertToNativeTypeHelper(hasDate, - hasTime, - blpapiDatetime, - microsecs): + def _convertToNativeTypeHelper(hasDate: bool, + hasTime: bool, + blpapiDatetime: BlpapiDatetime, + microsecs: int + ) -> AnyPythonDatetime: parts = blpapiDatetime.parts tzinfo = FixedOffset(blpapiDatetime.offset) if parts & \ internals.DATETIME_OFFSET_PART else None @@ -184,12 +175,12 @@ def _convertToNativeTypeHelper(hasDate, @staticmethod - def isDatetime(dtime): + def isDatetime(dtime: Any) -> bool: """Return True if the parameter is one of Python date/time objects.""" return isinstance(dtime, (_dt.datetime, _dt.date, _dt.time)) @staticmethod - def convertToBlpapi(dtime): + def convertToBlpapi(dtime: AnyPythonDatetime) -> BlpapiDatetime: "Convert a Python date/time object to a BLPAPI Datetime object.""" highPrecDatetime = internals.blpapi_HighPrecisionDatetime_tag() res = highPrecDatetime.datetime @@ -225,7 +216,7 @@ def convertToBlpapi(dtime): raise TypeError("Datetime can be created only from \ datetime.datetime, datetime.date or datetime.time") if offset is not None: - offsetInMinutes = tolong(offset.total_seconds() // 60) + offsetInMinutes = int(offset.total_seconds() // 60) res.offset = offsetInMinutes res.parts |= internals.DATETIME_OFFSET_PART return highPrecDatetime diff --git a/src/blpapi/debug.py b/src/blpapi/debug.py index 3e16b1a..ddd5e0e 100644 --- a/src/blpapi/debug.py +++ b/src/blpapi/debug.py @@ -8,7 +8,8 @@ from .debug_environment import get_env_diagnostics -def debug_load_error(error): + +def debug_load_error(error: ImportError) -> ImportError: """Called when the module fails to import "internals". Returns ImportError with some debugging message. """ @@ -30,12 +31,12 @@ def debug_load_error(error): if platform.system().lower() == "windows": env_diagnostics = get_env_diagnostics() - full_error_msg = """ + full_error_msg = f""" ---------------------------- ENVIRONMENT ----------------------------- -%s +{env_diagnostics} ---------------------------------------------------------------------- -%s -""" % (env_diagnostics, import_error) +{import_error} +""" else: full_error_msg = import_error @@ -47,13 +48,13 @@ def debug_load_error(error): with open(diagnostics_path, "w", encoding=getpreferredencoding()) as f: f.write(full_error_msg) except IOError: - print("Failed to write to path defined by %s: \"%s\"" \ - % (diagnostics_path_env_var, diagnostics_path)) + print("Failed to write to path defined by" + f" {diagnostics_path_env_var}: \"{diagnostics_path}\"") return ImportError(full_error_msg) -def _linker_env(): +def _linker_env() -> str: """Return the name of the right environment variable for linking in the current platform. """ @@ -66,18 +67,19 @@ def _linker_env(): env = 'LD_LIBRARY_PATH' return env -def _version_load_error(error): + +def _version_load_error(error: ImportError) -> str: """Called when the module fails to import "versionhelper". - Returns ImportError with some debugging message. + Returns some debugging message. """ - msg = """%s + msg = f"""{error} Could not open the C++ SDK library. Download and install the latest C++ SDK from: http://www.bloomberg.com/professional/api-library -""" % str(error) +""" if 'add_dll_directory' in dir(os): msg += """ @@ -88,31 +90,33 @@ def _version_load_error(error): import blpapi """ else: - msg += """ + msg += f""" If the C++ SDK is already installed, please ensure that the path to the library -was added to %s before entering the interpreter. +was added to {_linker_env()} before entering the interpreter. -""" % _linker_env() +""" return msg -def _version_mismatch_error(error, py_version, cpp_version): +def _version_mismatch_error(error: ImportError, + py_version: str, + cpp_version: str) -> str: """Called when "import version" succeeds after "import internals" fails - Returns ImportError with some debugging message. + Returns some debugging message. """ - msg = """%s + msg = f"""{error} Mismatch between C++ and Python SDK libraries. -Python SDK version %s -Found C++ SDK version %s +Python SDK version {py_version} +Found C++ SDK version {cpp_version} Download and install the latest C++ SDK from: http://www.bloomberg.com/professional/api-library If a recent version of the C++ SDK is already installed, please ensure that the -path to the library is added to %s before entering the interpreter. +path to the library is added to {_linker_env()} before entering the interpreter. -""" % (str(error), py_version, cpp_version, _linker_env()) +""" return msg diff --git a/src/blpapi/debug_environment.py b/src/blpapi/debug_environment.py index 8200041..1cce375 100644 --- a/src/blpapi/debug_environment.py +++ b/src/blpapi/debug_environment.py @@ -2,42 +2,39 @@ Print various potentially useful information to debug environment setup related issues """ -from __future__ import print_function - import platform import sys import os import pkgutil import functools +from typing import Callable from locale import getpreferredencoding from ctypes import util +from io import StringIO -# Python 2/3 compatibility -try: - from StringIO import StringIO -except ImportError: - from io import StringIO -def _path_diagnostics(print_to_str): +def _path_diagnostics(print_to_str: Callable[[str], None]) -> None: # Information for PATH related issues - print_to_str("blpapi 64-bit will be loaded from: \"%s\"" - % util.find_library("blpapi3_64")) - print_to_str("blpapi 32-bit will be loaded from: \"%s\"" - % util.find_library("blpapi3_32")) + print_to_str('blpapi 64-bit will be loaded from:' + f' "{util.find_library("blpapi3_64")}"') + print_to_str('blpapi 32-bit will be loaded from:' + f' "{util.find_library("blpapi3_32")}"') print_to_str("System PATH: (* marks locations where blpapi was found)") for p in os.environ["PATH"].split(os.pathsep): if p: # Skip empty entries dll_32 = os.path.join(p, "blpapi3_32.dll") dll_64 = os.path.join(p, "blpapi3_64.dll") found_blpapi_dll = os.path.isfile(dll_32) or os.path.isfile(dll_64) - print_to_str(" %s \"%s\"" % ("*" if found_blpapi_dll else " ", p)) - print_to_str() + print_to_str(f' {"*" if found_blpapi_dll else " "} "{p}"') + print_to_str("") -def _add_dll_directory_diagnostics(print_to_str): + +def _add_dll_directory_diagnostics(print_to_str: Callable[[str], None]) -> None: print_to_str("This Python version does not use PATH to find dlls") -def get_env_diagnostics(): + +def get_env_diagnostics() -> str: """ Get various potentially useful information to debug environment setup related issues @@ -53,7 +50,7 @@ def get_env_diagnostics(): print_to_str("Python implementation:", platform.python_implementation()) print_to_str() - if not 'add_dll_directory' in dir(os): + if 'add_dll_directory' not in dir(os): _path_diagnostics(print_to_str) else: _add_dll_directory_diagnostics(print_to_str) @@ -62,21 +59,22 @@ def get_env_diagnostics(): blpapi_package_found = False for i in pkgutil.iter_modules(): if i[1] == "blpapi": - print_to_str("blpapi package at: \"%s\"" % i[0].path) + # some modules don't have a .path (e.g. MetaPathFinder) + print_to_str(f'blpapi package at: "{i[0].path}"') # type: ignore blpapi_package_found = True if not blpapi_package_found: print_to_str("ERROR: Failed to find the blpapi package") - print_to_str("Python prefix: \"%s\"" % sys.prefix) + print_to_str(f'Python prefix: "{sys.prefix}"') print_to_str("Python path:") for p in sys.path: - print_to_str(" \"%s\"" % p) + print_to_str(f' "{p}"') print_to_str() # There is currently a known issue where attempting to import blpapi # from the local directory (e.g. if trying to run a script in the root # of our repository) will fail. Check that this is not the case. - print_to_str("Current directory: \"%s\"" % os.getcwd()) + print_to_str(f'Current directory: "{os.getcwd()}"') if os.path.isfile(os.path.join(".", "blpapi", "__init__.py")): print_to_str("WARNING: Using the blpapi module from current path") print_to_str(" CWD files:", ", ".join( diff --git a/src/blpapi/diagnosticsutil.py b/src/blpapi/diagnosticsutil.py index a0a6c72..ff09201 100644 --- a/src/blpapi/diagnosticsutil.py +++ b/src/blpapi/diagnosticsutil.py @@ -5,7 +5,8 @@ from . import internals -def memoryInfo(): + +def memoryInfo() -> str: """Return the string describing the 'blpapi' library's memory usage; the format of the string is platform-specific.""" return internals.blpapi_DiagnosticsUtil_memoryInfo_wrapper() diff --git a/src/blpapi/element.py b/src/blpapi/element.py index bddb2dd..91401d5 100644 --- a/src/blpapi/element.py +++ b/src/blpapi/element.py @@ -13,12 +13,28 @@ from .datatype import DataType from .name import Name, getNamePair from .schema import SchemaElementDefinition -from .compat import conv2str, isstr, int_typelist, Mapping -from .utils import Iterator, isNonScalarSequence +from .utils import conv2str, Iterator, isNonScalarSequence, isstr +from .chandle import CHandle from . import internals - -# pylint: disable=useless-object-inheritance,protected-access,too-many-return-statements,too-many-public-methods -class ElementIterator: +from .typehints import BlpapiNameOrStr,\ + BlpapiNameOrStrOrIndex,\ + AnyPythonDatetime,\ + SupportedElementTypes +from . import typehints # pylint: disable=unused-import +from collections.abc import Iterator as IteratorABC, Mapping +from typing import Any,\ + Callable,\ + Dict,\ + Iterator as IteratorType,\ + List,\ + Optional,\ + Sequence,\ + Set,\ + Tuple,\ + Union + +# pylint: disable=protected-access,too-many-return-statements,too-many-public-methods +class ElementIterator(IteratorABC): """An iterator over the objects within an :class:`Element`. If the :class:`Element` is a sequence or choice, this iterates over its @@ -26,11 +42,11 @@ class ElementIterator: value(s). """ - def __init__(self, element): + def __init__(self, element: "Element") -> None: self._element = element self._index = 0 - def __next__(self): + def __next__(self) -> Union[SupportedElementTypes, "Element"]: i = self._index self._index += 1 @@ -43,10 +59,8 @@ def __next__(self): raise StopIteration() - next = __next__ # Python 2 compatibility - -class Element(object): +class Element(CHandle): """Represents an item in a message. An :class:`Element` can represent: @@ -168,13 +182,14 @@ class Element(object): str) @staticmethod - def __getTraits(value): + def __getTraits(value: SupportedElementTypes + ) -> Tuple[Callable, Callable, Optional[Any]]: """ traits dispatcher """ if isstr(value): return Element.__stringTraits if isinstance(value, bool): return Element.__boolTraits - if isinstance(value, int_typelist): + if isinstance(value, int): if -(2 ** 31) <= value <= (2 ** 31 - 1): return Element.__int32Traits if -(2 ** 63) <= value <= (2 ** 63 - 1): @@ -188,27 +203,35 @@ def __getTraits(value): return Element.__nameTraits return Element.__defaultTraits - def __assertIsValid(self): + def __assertIsValid(self) -> None: if not self.isValid(): raise RuntimeError("Element is not valid") - def __init__(self, handle, dataHolder): + def __init__(self, + handle: "typehints.BlpapiElementHandle", + dataHolder: Optional[Union["Element", + "typehints.Message", + "typehints.Request"]]) -> None: + noop = lambda *args: None + super(Element, self).__init__(handle, noop) self.__handle = handle self.__dataHolder = dataHolder - def _getDataHolder(self): + def _getDataHolder(self) -> Optional[Union["Element", + "typehints.Message", + "typehints.Request"]]: """Return the owner of underlying data. For internal use.""" return self if self.__dataHolder is None else self.__dataHolder - def _sessions(self): + def _sessions(self) -> Set["typehints.AbstractSession"]: """Return session(s) that this 'Element' is related to. For internal use.""" if self.__dataHolder is None: - return list() + return set() return self.__dataHolder._sessions() - def __str__(self): + def __str__(self) -> str: """x.__str__() <==> str(x) Return a string representation of this Element. Call of 'str(element)' @@ -218,10 +241,12 @@ def __str__(self): return self.toString() - def __getitem__(self, nameOrIndex): + def __getitem__(self, + nameOrIndex: BlpapiNameOrStrOrIndex + ) -> Union[SupportedElementTypes, "Element"]: """ Args: - nameOrIndex (Name or str or int): The :class:`Name` identifying the + nameOrIndex: The :class:`Name` identifying the :class:`Element` to retrieve from this :class:`Element`\ , or the index to retrieve the value from this :class:`Element`\ . @@ -247,13 +272,14 @@ def __getitem__(self, nameOrIndex): ``nameOrIndex`` >= :meth:`numValues`. """ # is index - if isinstance(nameOrIndex, int_typelist): + if isinstance(nameOrIndex, int): return self.getValue(nameOrIndex) # is name if not self.hasElement(nameOrIndex): - raise KeyError("Element {} does not contain element {}" - .format(self.name(), nameOrIndex)) + raise KeyError(f"Element {self.name()} " # type: ignore + f"does not contain element" + f" {nameOrIndex}") element = self.getElement(nameOrIndex) @@ -265,10 +291,13 @@ def __getitem__(self, nameOrIndex): return element.getValue() - def __setitem__(self, name, value): + def __setitem__(self, + name: BlpapiNameOrStr, + value: Union[Mapping, Sequence, SupportedElementTypes] + ) -> None: """ Args: - name (Name or str): The :class:`Name` identifying one of this + name: The :class:`Name` identifying one of this :class:`Element`\ 's sub-:class:`Element`\ s. value: Used to format the :class:`Element`. See :meth:`fromPy` for more details. @@ -294,12 +323,12 @@ def __setitem__(self, name, value): Note: :class:`Element`\ s cannot be modified by index. """ - if isinstance(name, int_typelist): + if isinstance(name, int): raise Exception("Elements cannot be formatted by index") self.getElement(name).fromPy(value) - def __iter__(self): + def __iter__(self) -> IteratorType: """ Returns: An iterator over the contents of this :class:`Element`. If this @@ -310,10 +339,10 @@ def __iter__(self): """ return ElementIterator(self) - def __len__(self): + def __len__(self) -> int: """ Returns: - int: if this :class:`Element` is a complex type + If this :class:`Element` is a complex type (see :meth:`isComplexType`), return the number of :class:`Element`\ s in this :class:`Element`. Otherwise, return the number of values in this :class:`Element`. @@ -323,27 +352,25 @@ def __len__(self): return self.numValues() - def __contains__(self, item): + def __contains__(self, item: SupportedElementTypes) -> bool: """ Args: - item (str or blpapi.Name or bool or int or float or datetime.date \ - or datetime.time or datetime.datetime or None): - item to check for existence in this :class:`Element`. + item: item to check for existence in this :class:`Element`. Returns: - bool: If this :class:`Element` is a complex type, return whether + If this :class:`Element` is a complex type, return whether this :class:`Element` contains an :class:`Element` with the specified :class:`Name` ``item``. Otherwise, return whether ``item`` is a value in this :class:`Element`. """ if self.isComplexType(): - return self.hasElement(item) + return self.hasElement(item) # type: ignore return item in self.values() - def name(self): + def name(self) -> Name: """ Returns: - Name: If this :class:`Element` is part of a sequence or choice + If this :class:`Element` is part of a sequence or choice :class:`Element`, then return the :class:`Name` of this :class:`Element` within the sequence or choice :class:`Element` that owns it. If this :class:`Element` is not part of a sequence @@ -356,10 +383,10 @@ def name(self): return Name._createInternally( internals.blpapi_Element_name(self.__handle)) - def datatype(self): + def datatype(self) -> int: """ Returns: - int: Basic data type used to represent a value in this + Basic data type used to represent a value in this :class:`Element`. The possible types are enumerated in :class:`DataType`. @@ -368,20 +395,20 @@ def datatype(self): self.__assertIsValid() return internals.blpapi_Element_datatype(self.__handle) - def isComplexType(self): + def isComplexType(self) -> bool: """ Returns: - bool: ``True`` if ``datatype()==DataType.SEQUENCE`` or + ``True`` if ``datatype()==DataType.SEQUENCE`` or ``datatype()==DataType.CHOICE`` and ``False`` otherwise. """ self.__assertIsValid() return bool(internals.blpapi_Element_isComplexType(self.__handle)) - def isArray(self): + def isArray(self) -> bool: """ Returns: - bool: ``True`` if this element is an array. + ``True`` if this element is an array. This element is an array if ``elementDefinition().maxValues()>1`` or if ``elementDefinition().maxValues()==UNBOUNDED``. @@ -390,33 +417,33 @@ def isArray(self): self.__assertIsValid() return bool(internals.blpapi_Element_isArray(self.__handle)) - def isValid(self): + def isValid(self) -> bool: """ Returns: - bool: ``True`` if this :class:`Element` is valid. + ``True`` if this :class:`Element` is valid. """ return self.__handle is not None - def isNull(self): + def isNull(self) -> bool: """ Returns: - bool: ``True`` if this :class:`Element` has a null value. + ``True`` if this :class:`Element` has a null value. """ self.__assertIsValid() return bool(internals.blpapi_Element_isNull(self.__handle)) - def isReadOnly(self): + def isReadOnly(self) -> bool: """ Returns: - bool: ``True`` if this :class:`Element` cannot be modified. + ``True`` if this :class:`Element` cannot be modified. """ self.__assertIsValid() return bool(internals.blpapi_Element_isReadOnly(self.__handle)) - def elementDefinition(self): + def elementDefinition(self) -> "typehints.SchemaElementDefinition": """ Return: - SchemaElementDefinition: Reference to the read-only element + Reference to the read-only element definition object that defines the properties of this elements value. """ @@ -425,10 +452,10 @@ def elementDefinition(self): internals.blpapi_Element_definition(self.__handle), self._sessions()) - def numValues(self): + def numValues(self) -> int: """ Returns: - int: Number of values contained by this element. + Number of values contained by this element. The number of values is ``0`` if :meth:`isNull()` returns ``True``, and no greater than ``1`` if :meth:`isComplexType()` returns ``True``. The @@ -440,10 +467,10 @@ def numValues(self): self.__assertIsValid() return internals.blpapi_Element_numValues(self.__handle) - def numElements(self): + def numElements(self) -> int: """ Returns: - int: Number of elements in this element. + Number of elements in this element. The number of elements is ``0`` if :meth:`isComplexType()` returns ``False``, and no greater than ``1`` if the :class:`DataType` is @@ -455,13 +482,13 @@ def numElements(self): self.__assertIsValid() return internals.blpapi_Element_numElements(self.__handle) - def isNullValue(self, position=0): + def isNullValue(self, position: int=0) -> bool: """ Args: - position (int): Position of the sub-element + position: Position of the sub-element Returns: - bool: ``True`` if the value of the sub-element at the ``position`` + ``True`` if the value of the sub-element at the ``position`` is a null value. Raises: @@ -473,9 +500,9 @@ def isNullValue(self, position=0): if res in (0, 1): return bool(res) _ExceptionUtil.raiseOnError(res) - return None # unreachable + return False # unreachable - def toPy(self): + def toPy(self) -> Union[Dict, List, SupportedElementTypes]: """ Returns: A :py:class:`dict`, :py:class:`list`, or value representation of @@ -544,17 +571,17 @@ def toPy(self): """ return internals.blpapi_Element_toPy(self.__handle) - def toString(self, level=0, spacesPerLevel=4): + def toString(self, level: int=0, spacesPerLevel: int=4) -> str: """Format this :class:`Element` to the string at the specified indentation level. Args: - level (int): Indentation level - spacesPerLevel (int): Number of spaces per indentation level for + level: Indentation level + spacesPerLevel: Number of spaces per indentation level for this and all nested objects Returns: - str: This element formatted as a string + This element formatted as a string If ``level`` is negative, suppress indentation of the first line. If ``spacesPerLevel`` is negative, format the entire output on one line, @@ -566,13 +593,13 @@ def toString(self, level=0, spacesPerLevel=4): level, spacesPerLevel) - def getElement(self, nameOrIndex): + def getElement(self, nameOrIndex: BlpapiNameOrStrOrIndex) -> "Element": """ Args: - nameOrIndex (Name or str or int): Sub-element identifier + nameOrIndex: Sub-element identifier Returns: - Element: Sub-element identified by ``nameOrIndex`` + Sub-element identified by ``nameOrIndex`` Raises: Exception: If ``nameOrIndex`` is a string or a :class:`Name` and @@ -594,8 +621,13 @@ def getElement(self, nameOrIndex): _ExceptionUtil.raiseOnError(res[0]) return Element(res[1], self._getDataHolder()) - def elements(self): + def elements(self) -> IteratorType: """ + Note: prefer to iterate over this :class:`Element` directly instead + of calling this method. E.g. + + ```for e in element``` rather than ```for e in element.elements()``` + Returns: Iterator over elements contained in this :class:`Element`. @@ -609,14 +641,16 @@ def elements(self): description="Only sequences are supported", errorCode=None) return Iterator(self, Element.numElements, Element.getElement) - def hasElement(self, name, excludeNullElements=False): + def hasElement(self, + name: BlpapiNameOrStr, + excludeNullElements: bool=False) -> bool: """ Args: - name (Name or str): Name of the element - excludeNullElements (bool): Whether to exclude null elements + name: Name of the element + excludeNullElements: Whether to exclude null elements Returns: - bool: ``True`` if this :class:`Element` is a choice or sequence + ``True`` if this :class:`Element` is a choice or sequence (``isComplexType() == True``) and it contains an :class:`Element` with the specified ``name``. @@ -625,19 +659,19 @@ def hasElement(self, name, excludeNullElements=False): """ self.__assertIsValid() - name = getNamePair(name) + namepair = getNamePair(name) res = internals.blpapi_Element_hasElementEx( self.__handle, - name[0], - name[1], + namepair[0], + namepair[1], 1 if excludeNullElements else 0, 0) return bool(res) - def getChoice(self): + def getChoice(self) -> "Element": """ Returns: - Element: The selection name of this element as :class:`Element`. + The selection name of this element as :class:`Element`. Raises: Exception: If ``datatype() != DataType.CHOICE`` @@ -648,13 +682,13 @@ def getChoice(self): _ExceptionUtil.raiseOnError(res[0]) return Element(res[1], self._getDataHolder()) - def getValueAsBool(self, index=0): + def getValueAsBool(self, index: int=0) -> bool: """ Args: - index (int): Index of the value in the element + index: Index of the value in the element Returns: - bool: ``index``\ th entry in the :class:`Element` as a boolean. + ``index``\ th entry in the :class:`Element` as a boolean. Raises: InvalidConversionException: If the data type of this @@ -667,13 +701,13 @@ def getValueAsBool(self, index=0): _ExceptionUtil.raiseOnError(res[0]) return bool(res[1]) - def getValueAsString(self, index=0): + def getValueAsString(self, index: int=0) -> str: """ Args: - index (int): Index of the value in the element + index: Index of the value in the element Returns: - str: ``index``\ th entry in the :class:`Element` as a string. + ``index``\ th entry in the :class:`Element` as a string. Raises: InvalidConversionException: If the data type of this @@ -686,10 +720,10 @@ def getValueAsString(self, index=0): _ExceptionUtil.raiseOnError(res[0]) return res[1] - def getValueAsDatetime(self, index=0): + def getValueAsDatetime(self, index: int=0) -> AnyPythonDatetime: """ Args: - index (int): Index of the value in the element + index: Index of the value in the element Returns: datetime.time or datetime.date or datetime.datetime: ``index``\ th @@ -707,13 +741,13 @@ def getValueAsDatetime(self, index=0): _ExceptionUtil.raiseOnError(res[0]) return _DatetimeUtil.convertToNative(res[1]) - def getValueAsInteger(self, index=0): + def getValueAsInteger(self, index: int=0) -> int: """ Args: - index (int): Index of the value in the element + index: Index of the value in the element Returns: - int: ``index``\ th entry in the :class:`Element` as a integer + ``index``\ th entry in the :class:`Element` as a integer Raises: InvalidConversionException: If the data type of this @@ -726,13 +760,13 @@ def getValueAsInteger(self, index=0): _ExceptionUtil.raiseOnError(res[0]) return res[1] - def getValueAsFloat(self, index=0): + def getValueAsFloat(self, index: int=0) -> float: """ Args: - index (int): Index of the value in the element + index: Index of the value in the element Returns: - float: ``index``\ th entry in the :class:`Element` as a float. + ``index``\ th entry in the :class:`Element` as a float. Raises: InvalidConversionException: If the data type of this @@ -745,13 +779,13 @@ def getValueAsFloat(self, index=0): _ExceptionUtil.raiseOnError(res[0]) return res[1] - def getValueAsName(self, index=0): + def getValueAsName(self, index: int=0) -> Name: """ Args: - index (int): Index of the value in the element + index: Index of the value in the element Returns: - Name: ``index``\ th entry in the :class:`Element` as a Name. + ``index``\ th entry in the :class:`Element` as a Name. Raises: InvalidConversionException: If the data type of this @@ -764,13 +798,13 @@ def getValueAsName(self, index=0): _ExceptionUtil.raiseOnError(res[0]) return Name._createInternally(res[1]) - def getValueAsElement(self, index=0): + def getValueAsElement(self, index: int=0) -> "Element": """ Args: - index (int): Index of the value in the element + index: Index of the value in the element Returns: - Element: ``index``\ th entry in the :class:`Element` as a Element. + ``index``\ th entry in the :class:`Element` as a Element. Raises: InvalidConversionException: If the data type of this @@ -783,10 +817,11 @@ def getValueAsElement(self, index=0): _ExceptionUtil.raiseOnError(res[0]) return Element(res[1], self._getDataHolder()) - def getValue(self, index=0): + def getValue(self, index: int=0 + ) -> Union[SupportedElementTypes, "Element"]: """ Args: - index (int): Index of the value in the element + index: Index of the value in the element Returns: ``index``\ th entry in the :class:`Element` defined by this @@ -801,10 +836,15 @@ def getValue(self, index=0): datatype = self.datatype() valueGetter = _ELEMENT_VALUE_GETTER.get(datatype, Element.getValueAsString) - return valueGetter(self, index) + return valueGetter(self, index) # type: ignore - def values(self): + def values(self) -> IteratorType: """ + Note: prefer to iterate over this :class:`Element` directly instead + of calling this method. E.g. + + ```for e in element``` rather than ```for e in element.values()``` + Returns: Iterator over values contained in this :class:`Element`. @@ -819,13 +859,13 @@ def values(self): Element.getValueAsString) return Iterator(self, Element.numValues, valueGetter) - def getElementAsBool(self, name): + def getElementAsBool(self, name: BlpapiNameOrStr) -> bool: """ Args: - name (Name or str): Sub-element identifier + name: Sub-element identifier Returns: - bool: This element's sub-element with ``name`` as a boolean + This element's sub-element with ``name`` as a boolean Raises: Exception: If ``name`` is neither a :class:`Name` nor a string, or @@ -836,13 +876,13 @@ def getElementAsBool(self, name): return self.getElement(name).getValueAsBool() - def getElementAsString(self, name): + def getElementAsString(self, name: BlpapiNameOrStr) -> str: """ Args: - name (Name or str): Sub-element identifier + name: Sub-element identifier Returns: - str: This element's sub-element with ``name`` as a string + This element's sub-element with ``name`` as a string Raises: Exception: If ``name`` is neither a :class:`Name` nor a string, or @@ -853,10 +893,10 @@ def getElementAsString(self, name): return self.getElement(name).getValueAsString() - def getElementAsDatetime(self, name): + def getElementAsDatetime(self, name: BlpapiNameOrStr) -> AnyPythonDatetime: """ Args: - name (Name or str): Sub-element identifier + name: Sub-element identifier Returns: datetime.time or datetime.date or datetime.datetime: This element's @@ -871,13 +911,13 @@ def getElementAsDatetime(self, name): return self.getElement(name).getValueAsDatetime() - def getElementAsInteger(self, name): + def getElementAsInteger(self, name: BlpapiNameOrStr) -> int: """ Args: - name (Name or str): Sub-element identifier + name: Sub-element identifier Returns: - int: This element's sub-element with ``name`` as an integer + This element's sub-element with ``name`` as an integer Raises: Exception: If ``name`` is neither a :class:`Name` nor a string, or @@ -888,13 +928,13 @@ def getElementAsInteger(self, name): return self.getElement(name).getValueAsInteger() - def getElementAsFloat(self, name): + def getElementAsFloat(self, name: BlpapiNameOrStr) -> float: """ Args: - name (Name or str): Sub-element identifier + name: Sub-element identifier Returns: - float: This element's sub-element with ``name`` as a float + This element's sub-element with ``name`` as a float Raises: Exception: If ``name`` is neither a :class:`Name` nor a string, or @@ -905,13 +945,13 @@ def getElementAsFloat(self, name): return self.getElement(name).getValueAsFloat() - def getElementAsName(self, name): + def getElementAsName(self, name: BlpapiNameOrStr) -> Name: """ Args: - name (Name or str): Sub-element identifier + name: Sub-element identifier Returns: - Name: This element's sub-element with ``name`` as a :class:`Name` + This element's sub-element with ``name`` as a :class:`Name` Raises: Exception: If ``name`` is neither a :class:`Name` nor a string, or @@ -923,10 +963,11 @@ def getElementAsName(self, name): return self.getElement(name).getValueAsName() - def getElementValue(self, name): + def getElementValue(self, name: BlpapiNameOrStr + ) -> Union[SupportedElementTypes, "Element"]: """ Args: - name (Name or str): Sub-element identifier + name: Sub-element identifier Returns: This element's sub-element with ``name`` defined by its datatype @@ -939,11 +980,13 @@ def getElementValue(self, name): return self.getElement(name).getValue() - def setElement(self, name, value): + def setElement(self, + name: BlpapiNameOrStr, + value: SupportedElementTypes) -> None: """Set this Element's sub-element with 'name' to the specified 'value'. Args: - name (Name or str): Sub-element identifier + name: Sub-element identifier value: Value to set the sub-element to Raises: @@ -970,13 +1013,13 @@ def setElement(self, name, value): self.__assertIsValid() traits = Element.__getTraits(value) - name = getNamePair(name) + namepair = getNamePair(name) if traits[2] is not None: value = traits[2](value) _ExceptionUtil.raiseOnError( - traits[0](self.__handle, name[0], name[1], value)) + traits[0](self.__handle, namepair[0], namepair[1], value)) - def setValue(self, value, index=0): + def setValue(self, value: SupportedElementTypes, index: int=0) -> None: """Set the specified ``index``\ th entry in this :class:`Element` to the ``value``. @@ -1010,7 +1053,7 @@ def setValue(self, value, index=0): value = traits[2](value) _ExceptionUtil.raiseOnError(traits[1](self.__handle, value, index)) - def appendValue(self, value): + def appendValue(self, value: SupportedElementTypes) -> None: """Append the specified ``value`` to this :class:`Element`\ s entries at the end. @@ -1041,11 +1084,11 @@ def appendValue(self, value): self.setValue(value, internals.ELEMENT_INDEX_END) - def appendElement(self): + def appendElement(self) -> "Element": """Append a new element to this array :class:`Element`. Returns: - Element: The newly appended element + The newly appended element Raises: Exception: If this :class:`Element` is not an array of sequence or @@ -1058,15 +1101,14 @@ def appendElement(self): _ExceptionUtil.raiseOnError(res[0]) return Element(res[1], self._getDataHolder()) - def setChoice(self, selectionName): + def setChoice(self, selectionName: BlpapiNameOrStr) -> "Element": """Set this :class:`Element`\ 's active element to ``selectionName``. Args: - selectionName (Name or str): Name of the element to set the active - choice + selectionName: Name of the element to set the active choice Returns: - Element: The newly active element + The newly active element Raises: Exception: If ``selectionName`` is neither a :class:`Name` nor a @@ -1082,7 +1124,7 @@ def setChoice(self, selectionName): _ExceptionUtil.raiseOnError(res[0]) return Element(res[1], self._getDataHolder()) - def fromPy(self, value): + def fromPy(self, value: Union[Mapping, Sequence, SupportedElementTypes]): """Format this :class:`Element` with the provided native Python value. Args: @@ -1216,16 +1258,19 @@ def fromPy(self, value): """ self._fromPyHelper(value) - def _fromPyHelper(self, value, name=None, path=None): + def _fromPyHelper(self, + value: Union[Mapping, Sequence, SupportedElementTypes], + name: Optional[BlpapiNameOrStr]=None, + path: Optional[str]=None): """Helper method for `fromPy`. Args: value: Used to format this `Element` or the `Element` specified by ``name``. - name (Name or str): If ``name`` is ``None``, format this `Element` + name: If ``name`` is ``None``, format this `Element` with ``value``. Otherwise, ``name`` refers to this `Element`'s sub-`Element` that will be formatted with ``value``. - path (str): The path uniquely identifying this `Element`, starting + path: The path uniquely identifying this `Element`, starting from the root `Element`. """ # Note, the double exception throwing has no good solution in Python 2, @@ -1233,7 +1278,7 @@ def _fromPyHelper(self, value, name=None, path=None): activeElement = self - def getActivePathMessage(isArrayEntry=False): + def getActivePathMessage(isArrayEntry: bool=False): elementType = "scalar" if activeElement.isArray(): elementType = "array" @@ -1241,8 +1286,8 @@ def getActivePathMessage(isArrayEntry=False): elementType = "complex" arrayEntryText = "an entry in " if isArrayEntry else "" - return "While operating on {}{} Element `{}`, ".format( - arrayEntryText, elementType, path) + return f"While operating on {arrayEntryText}{elementType} " \ + f" Element `{path}`, " if path is None: path = str(activeElement.name()) @@ -1251,7 +1296,7 @@ def getActivePathMessage(isArrayEntry=False): activeElement = self.getElement(name) path += "/" + str(activeElement.name()) except Exception as exc: - errorMsg = "encountered error: {}".format(exc) + errorMsg = f"encountered error: {exc}" raise Exception(getActivePathMessage() + errorMsg) if activeElement.numElements() or activeElement.numValues(): @@ -1278,30 +1323,30 @@ def getActivePathMessage(isArrayEntry=False): arrayElement = activeElement typeDef = arrayElement.elementDefinition().typeDefinition() arrayValuesAreScalar = not typeDef.isComplexType() - for index, val in enumerate(value): + for index, val in enumerate(value): # type: ignore if isinstance(val, Mapping): if arrayValuesAreScalar: - path += "[{}]".format(index) + path += f"[{index}]" errorMsg = "encountered a `Mapping` where a scalar" \ " value was expected." raise Exception(getActivePathMessage(isArrayEntry=True) + errorMsg) appendedElement = arrayElement.appendElement() - arrayEntryPath = path + "[{}]".format(index) + arrayEntryPath = path + f"[{index}]" appendedElement._fromPyHelper(val, path=arrayEntryPath) elif isNonScalarSequence(val): - path += "[{}]".format(index) + path += f"[{index}]" expectedObject = "scalar value" if arrayValuesAreScalar \ else "`Mapping`" - errorMsg = "encountered a nested `Sequence` where a {}" \ - " was expected.".format(expectedObject) + errorMsg = f"encountered a nested `Sequence` where a " \ + f"{expectedObject} was expected." raise Exception(getActivePathMessage(isArrayEntry=True) + errorMsg) else: if not arrayValuesAreScalar: - path += "[{}]".format(index) + path += f"[{index}]" errorMsg = "encountered a scalar value where a" \ " `Mapping` was expected." raise Exception(getActivePathMessage(isArrayEntry=True) @@ -1310,8 +1355,8 @@ def getActivePathMessage(isArrayEntry=False): try: arrayElement.appendValue(val) except Exception as exc: - path += "[{}]".format(index) - errorMsg = "encountered error: {}".format(exc) + path += f"[{index}]" + errorMsg = f"encountered error: {exc}" raise Exception(getActivePathMessage(isArrayEntry=True) + errorMsg) else: @@ -1319,20 +1364,16 @@ def getActivePathMessage(isArrayEntry=False): return if activeElement.isComplexType() or activeElement.isArray(): - errorMsg = "encountered an incompatible type, {}, for a" \ - " non-scalar Element".format(type(value)) + errorMsg = f"encountered an incompatible type, {type(value)}," \ + " for a non-scalar Element" raise Exception(getActivePathMessage() + errorMsg) try: - activeElement.setValue(value) + activeElement.setValue(value) # type: ignore except Exception as exc: - errorMsg = "encountered error: {}".format(exc) + errorMsg = f"encountered error: {exc}" raise Exception(getActivePathMessage() + errorMsg) - def _handle(self): - """Return the internal implementation.""" - return self.__handle - _ELEMENT_VALUE_GETTER = { DataType.BOOL: Element.getValueAsBool, diff --git a/src/blpapi/event.py b/src/blpapi/event.py index 9d3cab1..9e3320f 100644 --- a/src/blpapi/event.py +++ b/src/blpapi/event.py @@ -32,15 +32,18 @@ raise Exception("Failed to get token") """ - +from typing import Iterator as IteratorType, Optional, Set +from collections.abc import Iterator as IteratorABC from .message import Message from . import internals from . import utils from .utils import get_handle -from .compat import with_metaclass from .chandle import CHandle +from . import typehints # pylint: disable=unused-import +from .typehints import BlpapiEventHandle + -class MessageIterator(CHandle): +class MessageIterator(CHandle, IteratorABC): """An iterator over the :class:`Message` objects within an :class:`Event`. Few clients will ever make direct use of :class:`MessageIterator` objects; @@ -48,7 +51,7 @@ class MessageIterator(CHandle): :class:`Event` and :class:`Message` objects. """ - def __init__(self, event): + def __init__(self, event: "Event") -> None: selfhandle = internals.blpapi_MessageIterator_create(get_handle(event)) super(MessageIterator, self).__init__( selfhandle, @@ -56,21 +59,18 @@ def __init__(self, event): self.__handle = selfhandle self.__event = event - def __iter__(self): + def __iter__(self) -> IteratorType: return self - def __next__(self): + def __next__(self) -> Message: retCode, message = internals.blpapi_MessageIterator_next(self.__handle) if retCode: raise StopIteration() else: return Message(message, self.__event) - next = __next__ - -@with_metaclass(utils.MetaClassForClassesWithEnums) -class Event(CHandle): +class Event(CHandle, metaclass=utils.MetaClassForClassesWithEnums): """A single event resulting from a subscription or a request. :class:`Event` objects are created by the API and passed to the application @@ -92,57 +92,59 @@ class Event(CHandle): The class attributes represent the possible types of event. """ - ADMIN = internals.EVENTTYPE_ADMIN + ADMIN = internals.EVENTTYPE_ADMIN # type: ignore """Admin event""" - SESSION_STATUS = internals.EVENTTYPE_SESSION_STATUS + SESSION_STATUS = internals.EVENTTYPE_SESSION_STATUS # type: ignore """Status updates for a session""" - SUBSCRIPTION_STATUS = internals.EVENTTYPE_SUBSCRIPTION_STATUS + SUBSCRIPTION_STATUS = internals.EVENTTYPE_SUBSCRIPTION_STATUS # type: ignore """Status updates for a subscription""" - REQUEST_STATUS = internals.EVENTTYPE_REQUEST_STATUS + REQUEST_STATUS = internals.EVENTTYPE_REQUEST_STATUS # type: ignore """Status updates for a request""" - RESPONSE = internals.EVENTTYPE_RESPONSE + RESPONSE = internals.EVENTTYPE_RESPONSE # type: ignore """The final (possibly only) response to a request""" - PARTIAL_RESPONSE = internals.EVENTTYPE_PARTIAL_RESPONSE + PARTIAL_RESPONSE = internals.EVENTTYPE_PARTIAL_RESPONSE # type: ignore """A partial response to a request""" - SUBSCRIPTION_DATA = internals.EVENTTYPE_SUBSCRIPTION_DATA + SUBSCRIPTION_DATA = internals.EVENTTYPE_SUBSCRIPTION_DATA # type: ignore """Data updates resulting from a subscription""" - SERVICE_STATUS = internals.EVENTTYPE_SERVICE_STATUS + SERVICE_STATUS = internals.EVENTTYPE_SERVICE_STATUS # type: ignore """Status updates for a service""" - TIMEOUT = internals.EVENTTYPE_TIMEOUT + TIMEOUT = internals.EVENTTYPE_TIMEOUT # type: ignore """An Event returned from nextEvent() if it timed out""" - AUTHORIZATION_STATUS = internals.EVENTTYPE_AUTHORIZATION_STATUS + AUTHORIZATION_STATUS = internals.EVENTTYPE_AUTHORIZATION_STATUS # type: ignore """Status updates for user authorization""" - RESOLUTION_STATUS = internals.EVENTTYPE_RESOLUTION_STATUS + RESOLUTION_STATUS = internals.EVENTTYPE_RESOLUTION_STATUS # type: ignore """Status updates for a resolution operation""" - TOPIC_STATUS = internals.EVENTTYPE_TOPIC_STATUS + TOPIC_STATUS = internals.EVENTTYPE_TOPIC_STATUS # type: ignore """Status updates about topics for service providers""" - TOKEN_STATUS = internals.EVENTTYPE_TOKEN_STATUS + TOKEN_STATUS = internals.EVENTTYPE_TOKEN_STATUS # type: ignore """Status updates for a generate token request""" - REQUEST = internals.EVENTTYPE_REQUEST + REQUEST = internals.EVENTTYPE_REQUEST # type: ignore """Request event""" UNKNOWN = -1 """Unknown event""" - def __init__(self, handle, sessions): + def __init__(self, + handle: BlpapiEventHandle, + sessions: Optional[Set["typehints.AbstractSession"]] = None): super(Event, self).__init__(handle, internals.blpapi_Event_release) self.__handle = handle - self.__sessions = sessions + self.__sessions = sessions if sessions is not None else set() - def eventType(self): + def eventType(self) -> int: """ Returns: - int: Type of messages contained by this :class:`Event`. + Type of messages contained by this :class:`Event`. """ return internals.blpapi_Event_eventType(self.__handle) - def __iter__(self): + def __iter__(self) -> IteratorType: """ Returns: Iterator over messages contained in this :class:`Event`. """ return MessageIterator(self) - def _sessions(self): + def _sessions(self) -> Set["typehints.AbstractSession"]: """Return session(s) that this 'Event' is related to. For internal use.""" @@ -161,7 +163,7 @@ class EventQueue(CHandle): :class:`EventQueue` will only deliver responses to the request(s) it is associated with. """ - def __init__(self): + def __init__(self) -> None: """ Construct an empty :class:`EventQueue` which can be passed to :meth:`~Session.sendRequest()` and @@ -172,15 +174,15 @@ def __init__(self): selfhandle, internals.blpapi_EventQueue_destroy) self.__handle = selfhandle - self.__sessions = set() + self.__sessions: Set["typehints.AbstractSession"] = set() - def nextEvent(self, timeout=0): + def nextEvent(self, timeout: int=0) -> Event: """ Args: - timeout (int): Timeout threshold in milliseconds. + timeout: Timeout threshold in milliseconds. Returns: - Event: The next :class:`Event` available from the + The next :class:`Event` available from the :class:`EventQueue`. If the specified ``timeout`` is zero this method will wait forever for @@ -191,10 +193,10 @@ def nextEvent(self, timeout=0): res = internals.blpapi_EventQueue_nextEvent(self.__handle, timeout) return Event(res, self._getSessions()) - def tryNextEvent(self): + def tryNextEvent(self) -> Optional[Event]: """ Returns: - Event: If the :class:`EventQueue` is non-empty, the next + If the :class:`EventQueue` is non-empty, the next :class:`Event` available, otherwise ``None``. """ res = internals.blpapi_EventQueue_tryNextEvent(self.__handle) @@ -202,7 +204,7 @@ def tryNextEvent(self): return None return Event(res[1], self._getSessions()) - def purge(self): + def purge(self) -> None: """Purge any :class:`Event` objects in this :class:`EventQueue`. Purges any :class:`Event` objects in this :class:`EventQueue` which @@ -213,17 +215,16 @@ def purge(self): internals.blpapi_EventQueue_purge(self.__handle) self.__sessions.clear() - def _registerSession(self, session): + def _registerSession(self, session: "typehints.AbstractSession") -> None: """Add a new session to this 'EventQueue'. For internal use.""" self.__sessions.add(session) - def _getSessions(self): - """Get a list of sessions this EventQueue related to. + def _getSessions(self) -> Set["typehints.AbstractSession"]: + """Get a set of sessions this EventQueue related to. For internal use. """ - sessions = list(self.__sessions) - return sessions + return self.__sessions __copyright__ = """ Copyright 2012. Bloomberg Finance L.P. diff --git a/src/blpapi/eventdispatcher.py b/src/blpapi/eventdispatcher.py index 0e533b9..6ca94d2 100644 --- a/src/blpapi/eventdispatcher.py +++ b/src/blpapi/eventdispatcher.py @@ -10,6 +10,7 @@ from . import internals from .chandle import CHandle + class EventDispatcher(CHandle): """Dispatches events from one or more Sessions through callbacks @@ -23,11 +24,11 @@ class EventDispatcher(CHandle): __handle = None # pylint: disable=unused-private-member - def __init__(self, numDispatcherThreads=1): + def __init__(self, numDispatcherThreads: int = 1): """Construct an :class:`EventDispatcher`. Args: - numDispatcherThreads (int): Number of dispatcher threads + numDispatcherThreads: Number of dispatcher threads If ``numDispatcherThreads`` is ``1`` (the default) then a single internal thread is created to dispatch events. If @@ -41,18 +42,18 @@ def __init__(self, numDispatcherThreads=1): internals.blpapi_EventDispatcher_destroy) self.__handle = selfhandle - def start(self): + def start(self) -> int: """Start generating callbacks for events from sessions associated with this :class:`EventDispatcher`. """ return internals.blpapi_EventDispatcher_start(self.__handle) - def stop(self, async_=False, **kwargs): + def stop(self, async_: bool = False, **kwargs) -> int: """Stop generating callbacks. Args: - async\_ (bool): Whether to execute this method asynchronously + async\_ : Whether to execute this method asynchronously Stop generating callbacks for events from sessions associated with this :class:`EventDispatcher`. If the specified ``async_`` is ``False`` (the diff --git a/src/blpapi/eventformatter.py b/src/blpapi/eventformatter.py index ff0b269..0d7de49 100644 --- a/src/blpapi/eventformatter.py +++ b/src/blpapi/eventformatter.py @@ -13,9 +13,14 @@ from . import internals from .utils import get_handle, invoke_if_valid, isNonScalarSequence from .chandle import CHandle -from .compat import Mapping +from . import typehints # pylint: disable=unused-import +from .typehints import BlpapiNameOrStr from collections import deque +from collections.abc import Mapping +from typing import Any, Callable, Optional, Deque, Tuple +from typing import Mapping as MappingType + class EventFormatter(CHandle): """:class:`EventFormatter` is used to populate :class:`Event`\ s for @@ -82,7 +87,7 @@ class EventFormatter(CHandle): #pylint: disable=too-many-return-statements @staticmethod - def __getTraits(value): + def __getTraits(value: Any) -> Tuple[Callable, Callable, Optional[Callable]]: """Returns traits for value based on its type""" if isinstance(value, str): return EventFormatter.__stringTraits @@ -94,7 +99,7 @@ def __getTraits(value): if -(2 ** 63) <= value <= (2 ** 63 - 1): return EventFormatter.__int64Traits raise InvalidConversionException( - "Value is out of supported range (INT64): {}".format(value), 0) + f"Value is out of supported range (INT64): {value}", 0) if isinstance(value, float): return EventFormatter.__floatTraits if _DatetimeUtil.isDatetime(value): @@ -103,12 +108,12 @@ def __getTraits(value): return EventFormatter.__nameTraits return EventFormatter.__defaultTraits - def __init__(self, event): + def __init__(self, event: "typehints.Event") -> None: """Create an :class:`EventFormatter` to create :class:`Message`\ s in the specified ``event``. Args: - event (Event): Event to be formatted + event: Event to be formatted An :class:`Event` may only be referenced by one :class:`EventFormatter` at any time. Attempting to create a second :class:`EventFormatter` @@ -120,16 +125,19 @@ def __init__(self, event): selfhandle, internals.blpapi_EventFormatter_destroy) self.__handle = selfhandle - self.latestMessageName = None + self.latestMessageName: Optional[BlpapiNameOrStr] = None - def appendMessage(self, messageType, topic, sequenceNumber=None): + def appendMessage(self, + messageType: BlpapiNameOrStr, + topic: "typehints.Topic", + sequenceNumber: Optional[int]=None) -> None: """Append an (empty) message to the :class:`Event` referenced by this :class:`EventFormatter` Args: - messageType (Name or str): Type of the message - topic (Topic): Topic to publish the message under - sequenceNumber (int): Sequence number of the message + messageType: Type of the message + topic: Topic to publish the message under + sequenceNumber: Sequence number of the message After a message has been appended its elements can be set using the various :meth:`setElement()` methods. @@ -161,13 +169,12 @@ def appendMessage(self, messageType, topic, sequenceNumber=None): self.latestMessageName = messageType - def appendResponse(self, operationName): + def appendResponse(self, operationName: BlpapiNameOrStr) -> None: """Append an (empty) response message for the specified ``operationName``. Args: - operationName (Name or str): Name of the operation whose response - type to use + operationName: Name of the operation whose response type to use Append an (empty) response message for the specified ``operationName`` (e.g. ``ReferenceDataRequest``) that will be sent in response to the @@ -192,18 +199,21 @@ def appendResponse(self, operationName): self.latestMessageName = "" - def appendRecapMessage(self, topic, correlationId=None, - sequenceNumber=None, - fragmentType=Message.FRAGMENT_NONE): + def appendRecapMessage( + self, + topic: "typehints.Topic", + correlationId: Optional["typehints.CorrelationId"]=None, + sequenceNumber: Optional[int]=None, + fragmentType: int=Message.FRAGMENT_NONE) -> None: """Append a (empty) recap message to the :class:`Event` referenced by this :class:`EventFormatter`. Args: - topic (Topic): Topic to publish under - correlationId (CorrelationId): Specify if recap message + topic: Topic to publish under + correlationId: Specify if recap message added in response to a ``TOPIC_RECAP`` message - sequenceNumber (int): Sequence number of the message - fragmentType (int): Type of the message fragment + sequenceNumber: Sequence number of the message + fragmentType: Type of the message fragment Specify the optional ``correlationId`` if this recap message is added in response to a ``TOPIC_RECAP`` message. @@ -223,8 +233,8 @@ def appendRecapMessage(self, topic, correlationId=None, previous message on this ``topic``, otherwise the behavior is undefined. """ - # pylint: disable=line-too-long - cIdHandle = None if correlationId is None else get_handle(correlationId) + + cIdHandle = correlationId if sequenceNumber is None: if fragmentType == Message.FRAGMENT_NONE: @@ -263,12 +273,12 @@ def appendRecapMessage(self, topic, correlationId=None, self.latestMessageName = "" - def setElement(self, name, value): + def setElement(self, name: BlpapiNameOrStr, value: Any) -> None: """Set an element in the :class:`Event` referenced by this :class:`EventFormatter`. Args: - name (Name or str): Name of the element to set + name: Name of the element to set value (bool or str or int or float or ~datetime.datetime or Name): Value to set the element to @@ -283,34 +293,36 @@ def setElement(self, name, value): :meth:`setElementNull` instead. """ traits = EventFormatter.__getTraits(value) - name = getNamePair(name) + namepair = getNamePair(name) value = invoke_if_valid(traits[2], value) _ExceptionUtil.raiseOnError( - traits[0](self.__handle, name[0], name[1], value)) + traits[0](self.__handle, + namepair[0], namepair[1], + value)) - def setElementNull(self, name): + def setElementNull(self, name: BlpapiNameOrStr) -> None: """Create a null element with the specified ``name``. Args: - name (Name or str): Name of the element + name: Name of the element Note: Whether or not fields containing null values are published to subscribers depends on the details of the service and schema configuration. """ - name = getNamePair(name) + namepair = getNamePair(name) _ExceptionUtil.raiseOnError( internals.blpapi_EventFormatter_setValueNull( self.__handle, - name[0], - name[1])) + namepair[0], + namepair[1])) - def pushElement(self, name): + def pushElement(self, name: BlpapiNameOrStr) -> None: """Change the level at which this :class:`EventFormatter` is operating. Args: - name (Name or str): Name of the element that is used to determine + name: Name of the element that is used to determine the level After this returns the context of the :class:`EventFormatter` is set to @@ -336,14 +348,14 @@ def pushElement(self, name): an array at the current level of the schema or the behavior is undefined. """ - name = getNamePair(name) + namepair = getNamePair(name) _ExceptionUtil.raiseOnError( internals.blpapi_EventFormatter_pushElement( self.__handle, - name[0], - name[1])) + namepair[0], + namepair[1])) - def popElement(self): + def popElement(self) -> None: """Undo the most recent call to :meth:`pushElement` or :meth:`appendElement` on this :class:`EventFormatter` and return the context of the :class:`EventFormatter` to where it was before the call @@ -354,7 +366,7 @@ def popElement(self): _ExceptionUtil.raiseOnError( internals.blpapi_EventFormatter_popElement(self.__handle)) - def appendValue(self, value): + def appendValue(self, value: Any) -> None: """ Args: value (bool or str or int or float or ~datetime.datetime or Name): @@ -364,11 +376,11 @@ def appendValue(self, value): value = invoke_if_valid(traits[2], value) _ExceptionUtil.raiseOnError(traits[1](self.__handle, value)) - def appendElement(self): + def appendElement(self) -> None: _ExceptionUtil.raiseOnError( internals.blpapi_EventFormatter_appendElement(self.__handle)) - def fromPy(self, value): + def fromPy(self, value: MappingType[BlpapiNameOrStr, Any]) -> None: """ Format this :class:`EventFormatter`\ 's underlying :class:`Event` using ``value``. @@ -497,24 +509,27 @@ def fromPy(self, value): raise Exception("`value` must be a `Mapping` instance") self._fromPyHelper(value) - def _fromPyHelper(self, value, name=None, path=None): + def _fromPyHelper(self, + value: Any, + name: Optional[BlpapiNameOrStr]=None, + dpath: Optional[Deque[BlpapiNameOrStr]]=None) -> None: """ Args: value (Mapping or Sequence or scalar-type): used to format the :class:`Element` at the current level - name (str or blpapi.Name or None): the :class:`blpapi.Name` + name: the :class:`blpapi.Name` identifying the :class:`Element` to be formatted. If ``name`` is ``None``, format the :class:`Event` at the current level. - path (deque): represents the level at which this + dpath: represents the level at which this :class:`Eventformatter` is operating """ - if path is None: - path = deque() + path = deque() if dpath is None else dpath + namestr = "" if name is None else str(name) - def getPathErrorMessage(): + def getPathErrorMessage() -> str: path.appendleft(str(self.latestMessageName)) - pathStr = "/".join(path) - return "While operating on Element `{}`, ".format(pathStr) + pathStr = "/".join([str(p) for p in path]) + return f"While operating on Element `{pathStr}`, " if isinstance(value, Mapping): for key, val in value.items(): @@ -527,7 +542,7 @@ def getPathErrorMessage(): + _fromPyErrorTemplate.format(exc)) path.append(key) - self._fromPyHelper(val, name=key, path=path) + self._fromPyHelper(val, name=key, dpath=path) self.popElement() path.pop() else: @@ -537,28 +552,28 @@ def getPathErrorMessage(): raise Exception(getPathErrorMessage() + _fromPyErrorTemplate.format(exc)) else: - self._fromPyHelper(val, name=key, path=path) + self._fromPyHelper(val, name=key, dpath=path) elif isNonScalarSequence(value): try: - self.pushElement(name) + self.pushElement(namestr) except Exception as exc: raise Exception(getPathErrorMessage() + _fromPyErrorTemplate.format(exc)) for index, val in enumerate(value): - path.append("{}[{}]".format(name, index)) + path.append(f"{namestr}[{index}]") if isinstance(val, Mapping): try: self.appendElement() except Exception as exc: - errorMsg = "encountered a `Mapping` where a scalar" \ - " value was expected. Error: {}".format(exc) + errorMsg = "encountered a `Mapping` where a scalar " \ + f"value was expected. Error: {exc}" raise Exception(getPathErrorMessage() + errorMsg) - self._fromPyHelper(val, path=path) + self._fromPyHelper(val, dpath=path) self.popElement() elif isNonScalarSequence(val): errorMsg = "encountered nested `Sequences`s. An array of" \ @@ -580,18 +595,18 @@ def getPathErrorMessage(): else: try: if value is None: - self.setElementNull(name) + self.setElementNull(namestr) else: - self.setElement(name, value) + self.setElement(namestr, value) except IndexOutOfRangeException: - path.append(name) + path.append(namestr) errorMsg = "attempted to format an array Element using a" \ " scalar value. Array Elements are formatted with" \ " `Sequence`s." raise Exception(getPathErrorMessage() + errorMsg) except (InvalidConversionException, InvalidArgumentException) \ as exc: - path.append(name) + path.append(namestr) raise Exception(getPathErrorMessage() + _fromPyErrorTemplate.format(exc)) except Exception as exc: diff --git a/src/blpapi/exception.py b/src/blpapi/exception.py index a382ef2..d9410fe 100644 --- a/src/blpapi/exception.py +++ b/src/blpapi/exception.py @@ -5,33 +5,30 @@ This file defines various exceptions that blpapi can raise. """ - -try: - from builtins import Exception as _StandardException -except ImportError: - from __builtin__ import Exception as _StandardException +from builtins import Exception as _StandardException +from typing import Optional, Type from . import internals -# pylint: disable=useless-object-inheritance, redefined-builtin +# pylint: disable=redefined-builtin class Exception(_StandardException): """This class defines a base exception for blpapi operations. Objects of this class contain the error description for the exception. """ - def __init__(self, description, errorCode): + def __init__(self, description: str, errorCode: Optional[int]) -> None: """Create a blpapi exception Args: - description (str): Description of the error - errorCode (int): Code corresponding to the error + description: Description of the error + errorCode: Code corresponding to the error """ _StandardException.__init__(self, description, errorCode) - def __str__(self): + def __str__(self) -> str: args_arr = list(self.args) - return "{0} ({1:#010x})".format(args_arr[0], args_arr[1]) + return f"{args_arr[0]} ({args_arr[1]:#010x})" class DuplicateCorrelationIdException(Exception): @@ -106,20 +103,20 @@ class UnknownErrorException(Exception): """ -class _ExceptionUtil(object): +class _ExceptionUtil: """Internal exception generating class.""" __errorClasses = { - internals.INVALIDSTATE_CLASS: InvalidStateException, - internals.INVALIDARG_CLASS: InvalidArgumentException, - internals.CNVERROR_CLASS: InvalidConversionException, - internals.BOUNDSERROR_CLASS: IndexOutOfRangeException, - internals.NOTFOUND_CLASS: NotFoundException, - internals.FLDNOTFOUND_CLASS: FieldNotFoundException, - internals.UNSUPPORTED_CLASS: UnsupportedOperationException + internals.INVALIDSTATE_CLASS: InvalidStateException, # type: ignore + internals.INVALIDARG_CLASS: InvalidArgumentException, # type: ignore + internals.CNVERROR_CLASS: InvalidConversionException, # type: ignore + internals.BOUNDSERROR_CLASS: IndexOutOfRangeException, # type: ignore + internals.NOTFOUND_CLASS: NotFoundException, # type: ignore + internals.FLDNOTFOUND_CLASS: FieldNotFoundException, # type: ignore + internals.UNSUPPORTED_CLASS: UnsupportedOperationException # type: ignore } @staticmethod - def __getErrorClass(errorCode): + def __getErrorClass(errorCode: int) -> Type: """ returns proper error class for the code """ if errorCode == internals.ERROR_DUPLICATE_CORRELATIONID: return DuplicateCorrelationIdException @@ -128,7 +125,7 @@ def __getErrorClass(errorCode): UnknownErrorException) @staticmethod - def raiseException(errorCode, description=None): + def raiseException(errorCode: int, description: str=None) -> None: """Throw the appropriate exception for the specified 'errorCode'.""" if description is None: description = internals.blpapi_getLastErrorDescription(errorCode) @@ -138,7 +135,7 @@ def raiseException(errorCode, description=None): raise errorClass(description, errorCode) @staticmethod - def raiseOnError(errorCode, description=None): + def raiseOnError(errorCode: int, description: str=None) -> None: """Throw the appropriate exception for the specified 'errorCode' if the 'errorCode != 0'. """ diff --git a/src/blpapi/highresclock.py b/src/blpapi/highresclock.py index 9c99b8d..b4c3896 100644 --- a/src/blpapi/highresclock.py +++ b/src/blpapi/highresclock.py @@ -1,11 +1,11 @@ # coding: utf-8 """ Support highres clock""" -from __future__ import absolute_import from blpapi import internals from blpapi.datetime import _DatetimeUtil, UTC +import datetime -def now(tzinfo=UTC): +def now(tzinfo: datetime.tzinfo = UTC): """Return the current time using the same clock as is used to measure the 'timeReceived' value on incoming messages; note that this is *not* necessarily the same clock as is accessed by calls to 'datetime.now'. The @@ -17,4 +17,4 @@ def now(tzinfo=UTC): original = internals.blpapi_HighPrecisionDatetime_fromTimePoint_wrapper( time_point) native = _DatetimeUtil.convertToNative(original) - return native.astimezone(tzinfo) + return native.astimezone(tzinfo) # type: ignore diff --git a/src/blpapi/identity.py b/src/blpapi/identity.py index 97742e5..50d898e 100644 --- a/src/blpapi/identity.py +++ b/src/blpapi/identity.py @@ -5,17 +5,18 @@ This component provides an identification of a user and implements the access to the entitlements. """ - +from typing import List, Sequence, Tuple, Union +from .typehints import BlpapiIdentityHandle from .element import Element from .exception import _ExceptionUtil from . import internals from . import utils +from . import typehints # pylint: disable=unused-import from .utils import get_handle -from .compat import with_metaclass from .chandle import CHandle -@with_metaclass(utils.MetaClassForClassesWithEnums) -class Identity(CHandle): + +class Identity(CHandle, metaclass=utils.MetaClassForClassesWithEnums): """Provides access to the entitlements for a specific user. An unauthorized Identity is created using @@ -34,14 +35,16 @@ class Identity(CHandle): The class attributes represent the various seat types. """ - INVALID_SEAT = internals.SEATTYPE_INVALID_SEAT + INVALID_SEAT = internals.SEATTYPE_INVALID_SEAT # type: ignore """Unknown seat type""" - BPS = internals.SEATTYPE_BPS + BPS = internals.SEATTYPE_BPS # type: ignore """Bloomberg Professional Service""" - NONBPS = internals.SEATTYPE_NONBPS + NONBPS = internals.SEATTYPE_NONBPS # type: ignore """Non-BPS""" - def __init__(self, handle, sessions): + def __init__(self, + handle: BlpapiIdentityHandle, + sessions: Sequence["typehints.AbstractSession"]): """Create an :class:`Identity` associated with the ``sessions`` Args: @@ -51,18 +54,21 @@ def __init__(self, handle, sessions): super(Identity, self).__init__( handle, internals.blpapi_Identity_release) self.__handle = handle # pylint: disable=unused-private-member - self.__sessions = sessions # pylint: disable=unused-private-member + self.__sessions = sessions # pylint: disable=unused-private-member internals.blpapi_Identity_addRef(self.__handle) - def hasEntitlements(self, service, entitlements): + def hasEntitlements(self, + service: "typehints.Service", + entitlements: Union[Sequence[int], "typehints.Element"] + ) -> bool: """ Args: - service (Service): Service to check authorization for - entitlements ([int] or Element): EIDs to check authorization for + service: Service to check authorization for + entitlements: EIDs to check authorization for Returns: - bool: ``True`` if this :class:`Identity` is authorized for the + ``True`` if this :class:`Identity` is authorized for the specified ``service`` and for each of the entitlement IDs contained in the specified ``entitlements``. @@ -94,14 +100,18 @@ def hasEntitlements(self, service, entitlements): None) return True if res else False - def getFailedEntitlements(self, service, entitlements): + def getFailedEntitlements(self, + service: "typehints.Service", + entitlements: Union[Sequence[int], + "typehints.Element"] + ) -> Tuple[bool, List[int]]: """ Args: - service (Service): Service to check authorization for - entitlements ([int] or Element): EIDs to check authorization for + service: Service to check authorization for + entitlements: EIDs to check authorization for Returns: - (bool, [int]): Tuple where the boolean is True if this + Tuple where the boolean is True if this :class:`Identity` is authorized for the specified ``service`` and all of the specified ``entitlements``, and the list is a subset of ``entitlements`` for which this :class:`Identity` is not @@ -147,13 +157,13 @@ def getFailedEntitlements(self, service, entitlements): result.append(failedEIDs[i]) return (True if res else False, result) - def isAuthorized(self, service): + def isAuthorized(self, service: "typehints.Service") -> bool: """ Args: - service (Service): Service to check authorization for + service: Service to check authorization for Returns: - bool: ``True`` if this :class:`Identity` is authorized for the + ``True`` if this :class:`Identity` is authorized for the specified ``service``, ``False`` otherwise. """ res = internals.blpapi_Identity_isAuthorized( @@ -161,10 +171,10 @@ def isAuthorized(self, service): get_handle(service)) return True if res else False - def getSeatType(self): + def getSeatType(self) -> int: """ Returns: - int: Seat type of this identity. + Seat type of this identity. The class attributes of :class:`Identity` represent the seat types. """ @@ -172,8 +182,6 @@ def getSeatType(self): _ExceptionUtil.raiseOnError(res[0]) return res[1] - # Protect enumeration constant(s) defined in this class and in classes - # derived from this class from changes: __copyright__ = """ Copyright 2012. Bloomberg Finance L.P. diff --git a/src/blpapi/internals.py b/src/blpapi/internals.py index 9d0f7d5..bc6307c 100644 --- a/src/blpapi/internals.py +++ b/src/blpapi/internals.py @@ -168,6 +168,8 @@ class _SwigNonDynamicMeta(type): IDENTITYUTIL_USERTYPE_UNKNOWN = _internals.IDENTITYUTIL_USERTYPE_UNKNOWN IDENTITYUTIL_USERTYPE_APP_PORTAL = _internals.IDENTITYUTIL_USERTYPE_APP_PORTAL IDENTITYUTIL_USERTYPE_SANDBOX_EXCEL = _internals.IDENTITYUTIL_USERTYPE_SANDBOX_EXCEL +SUBSCRIPTIONPREPROCESS_INVALID_SUBSCRIPTION_STRING = _internals.SUBSCRIPTIONPREPROCESS_INVALID_SUBSCRIPTION_STRING +SUBSCRIPTIONPREPROCESS_CORRELATIONID_ERROR = _internals.SUBSCRIPTIONPREPROCESS_CORRELATIONID_ERROR DATATYPE_BOOL = _internals.DATATYPE_BOOL DATATYPE_CHAR = _internals.DATATYPE_CHAR DATATYPE_BYTE = _internals.DATATYPE_BYTE @@ -362,8 +364,7 @@ def __str__(self): if valueType == CorrelationId.UNSET_TYPE: return valueTypeName else: - return "({0}: {1!r}, ClassId: {2})".format( - valueTypeName, self.value(), self.classId()) + return f"({valueTypeName}: {self.value()!r}, ClassId: {self.classId()})" def __hash__(self): return hash((self.type(), self.classId(), self.__toInteger())) @@ -795,6 +796,15 @@ def blpapi_MessageFormatter_assign(rhs): def blpapi_MessageFormatter_destroy(formatter): return _internals.blpapi_MessageFormatter_destroy(formatter) +def blpapi_Session_subscribeEx_helper(session, subscriptionList, identity, requestLabel, errorAppenderCb): + return _internals.blpapi_Session_subscribeEx_helper(session, subscriptionList, identity, requestLabel, errorAppenderCb) + +def blpapi_Session_resubscribeEx_helper(session, resubscriptionList, requestLabel, errorAppenderCb): + return _internals.blpapi_Session_resubscribeEx_helper(session, resubscriptionList, requestLabel, errorAppenderCb) + +def blpapi_Session_resubscribeWithIdEx_helper(session, resubscriptionList, resubscriptionId, requestLabel, errorAppenderCb): + return _internals.blpapi_Session_resubscribeWithIdEx_helper(session, resubscriptionList, resubscriptionId, requestLabel, errorAppenderCb) + def blpapi_AuthOptions_create_default(): return _internals.blpapi_AuthOptions_create_default() @@ -1500,12 +1510,21 @@ def blpapi_Session_tryNextEvent(session): def blpapi_Session_subscribe(session, subscriptionList, handle, requestLabel): return _internals.blpapi_Session_subscribe(session, subscriptionList, handle, requestLabel) +def blpapi_Session_subscribeEx(session, subscriptionList, handle, requestLabel, errorHandler, userData): + return _internals.blpapi_Session_subscribeEx(session, subscriptionList, handle, requestLabel, errorHandler, userData) + def blpapi_Session_resubscribe(session, resubscriptionList, requestLabel): return _internals.blpapi_Session_resubscribe(session, resubscriptionList, requestLabel) +def blpapi_Session_resubscribeEx(session, resubscriptionList, requestLabel, errorHandler, userData): + return _internals.blpapi_Session_resubscribeEx(session, resubscriptionList, requestLabel, errorHandler, userData) + def blpapi_Session_resubscribeWithId(session, resubscriptionList, resubscriptionId, requestLabel): return _internals.blpapi_Session_resubscribeWithId(session, resubscriptionList, resubscriptionId, requestLabel) +def blpapi_Session_resubscribeWithIdEx(session, resubscriptionList, resubscriptionId, requestLabel, errorHandler, userData): + return _internals.blpapi_Session_resubscribeWithIdEx(session, resubscriptionList, resubscriptionId, requestLabel, errorHandler, userData) + def blpapi_Session_unsubscribe(session, unsubscriptionList, requestLabel): return _internals.blpapi_Session_unsubscribe(session, unsubscriptionList, requestLabel) diff --git a/src/blpapi/internals_wrap.c b/src/blpapi/internals_wrap.c index 55e3c47..3d09586 100644 --- a/src/blpapi/internals_wrap.c +++ b/src/blpapi/internals_wrap.c @@ -2685,37 +2685,38 @@ SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyO #define SWIGTYPE_p_blpapi_TopicList swig_types[41] #define SWIGTYPE_p_char swig_types[42] #define SWIGTYPE_p_double swig_types[43] -#define SWIGTYPE_p_f_p_struct_blpapi_Event_p_struct_blpapi_ProviderSession_p_void__void swig_types[44] -#define SWIGTYPE_p_float swig_types[45] -#define SWIGTYPE_p_int swig_types[46] -#define SWIGTYPE_p_intArray swig_types[47] -#define SWIGTYPE_p_long_long swig_types[48] -#define SWIGTYPE_p_p_blpapi_AuthApplication swig_types[49] -#define SWIGTYPE_p_p_blpapi_AuthOptions swig_types[50] -#define SWIGTYPE_p_p_blpapi_AuthToken swig_types[51] -#define SWIGTYPE_p_p_blpapi_AuthUser swig_types[52] -#define SWIGTYPE_p_p_blpapi_Element swig_types[53] -#define SWIGTYPE_p_p_blpapi_Event swig_types[54] -#define SWIGTYPE_p_p_blpapi_Identity swig_types[55] -#define SWIGTYPE_p_p_blpapi_Message swig_types[56] -#define SWIGTYPE_p_p_blpapi_MessageFormatter swig_types[57] -#define SWIGTYPE_p_p_blpapi_MessageProperties swig_types[58] -#define SWIGTYPE_p_p_blpapi_Name swig_types[59] -#define SWIGTYPE_p_p_blpapi_Operation swig_types[60] -#define SWIGTYPE_p_p_blpapi_Request swig_types[61] -#define SWIGTYPE_p_p_blpapi_RequestTemplate swig_types[62] -#define SWIGTYPE_p_p_blpapi_SchemaElementDefinition swig_types[63] -#define SWIGTYPE_p_p_blpapi_Service swig_types[64] -#define SWIGTYPE_p_p_blpapi_Topic swig_types[65] -#define SWIGTYPE_p_p_char swig_types[66] -#define SWIGTYPE_p_p_void swig_types[67] -#define SWIGTYPE_p_short swig_types[68] -#define SWIGTYPE_p_unsigned_char swig_types[69] -#define SWIGTYPE_p_unsigned_int swig_types[70] -#define SWIGTYPE_p_unsigned_long_long swig_types[71] -#define SWIGTYPE_p_unsigned_short swig_types[72] -static swig_type_info *swig_types[74]; -static swig_module_info swig_module = {swig_types, 73, 0, 0, 0, 0}; +#define SWIGTYPE_p_f_p_q_const__struct_blpapi_CorrelationId_t__p_q_const__char_int_p_q_const__char_p_void__void swig_types[44] +#define SWIGTYPE_p_f_p_struct_blpapi_Event_p_struct_blpapi_ProviderSession_p_void__void swig_types[45] +#define SWIGTYPE_p_float swig_types[46] +#define SWIGTYPE_p_int swig_types[47] +#define SWIGTYPE_p_intArray swig_types[48] +#define SWIGTYPE_p_long_long swig_types[49] +#define SWIGTYPE_p_p_blpapi_AuthApplication swig_types[50] +#define SWIGTYPE_p_p_blpapi_AuthOptions swig_types[51] +#define SWIGTYPE_p_p_blpapi_AuthToken swig_types[52] +#define SWIGTYPE_p_p_blpapi_AuthUser swig_types[53] +#define SWIGTYPE_p_p_blpapi_Element swig_types[54] +#define SWIGTYPE_p_p_blpapi_Event swig_types[55] +#define SWIGTYPE_p_p_blpapi_Identity swig_types[56] +#define SWIGTYPE_p_p_blpapi_Message swig_types[57] +#define SWIGTYPE_p_p_blpapi_MessageFormatter swig_types[58] +#define SWIGTYPE_p_p_blpapi_MessageProperties swig_types[59] +#define SWIGTYPE_p_p_blpapi_Name swig_types[60] +#define SWIGTYPE_p_p_blpapi_Operation swig_types[61] +#define SWIGTYPE_p_p_blpapi_Request swig_types[62] +#define SWIGTYPE_p_p_blpapi_RequestTemplate swig_types[63] +#define SWIGTYPE_p_p_blpapi_SchemaElementDefinition swig_types[64] +#define SWIGTYPE_p_p_blpapi_Service swig_types[65] +#define SWIGTYPE_p_p_blpapi_Topic swig_types[66] +#define SWIGTYPE_p_p_char swig_types[67] +#define SWIGTYPE_p_p_void swig_types[68] +#define SWIGTYPE_p_short swig_types[69] +#define SWIGTYPE_p_unsigned_char swig_types[70] +#define SWIGTYPE_p_unsigned_int swig_types[71] +#define SWIGTYPE_p_unsigned_long_long swig_types[72] +#define SWIGTYPE_p_unsigned_short swig_types[73] +static swig_type_info *swig_types[75]; +static swig_module_info swig_module = {swig_types, 74, 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) @@ -4551,6 +4552,93 @@ SWIG_AsVal_float (PyObject * obj, float *val) } + +void blpapi_SubscriptionPreprocess_handleErrorPy( + const blpapi_CorrelationId_t *correlationId, + const char *subscriptionString, + int errorCode, + const char *description, + void *userData) +{ + /* GIL needs to be held while using the python C-API. */ + SWIG_PYTHON_THREAD_BEGIN_BLOCK; + + PyObject* cidPyObject; + PyObject* result; + PyObject* errorAppenderCb; + + cidPyObject = SWIG_NewPointerObj( + CorrelationId_t_clone(correlationId), + SWIGTYPE_p_blpapi_CorrelationId_t_, + SWIG_POINTER_OWN); + + errorAppenderCb = (PyObject*) userData; + result = PyObject_CallFunction(errorAppenderCb, "Osis", + cidPyObject, + subscriptionString, + errorCode, + description); + + Py_XDECREF(result); + + SWIG_PYTHON_THREAD_END_BLOCK; +} + + +int blpapi_Session_subscribeEx_helper( + blpapi_Session_t *session, + const blpapi_SubscriptionList_t *subscriptionList, + const blpapi_Identity_t *identity, + const char* requestLabel, + int requestLabelLen, + PyObject* errorAppenderCb) +{ + return blpapi_Session_subscribeEx( + session, + subscriptionList, + identity, + requestLabel, + requestLabelLen, + &blpapi_SubscriptionPreprocess_handleErrorPy, + errorAppenderCb); +} + +int blpapi_Session_resubscribeEx_helper( + blpapi_Session_t *session, + const blpapi_SubscriptionList_t *resubscriptionList, + const char *requestLabel, + int requestLabelLen, + PyObject* errorAppenderCb) +{ + return blpapi_Session_resubscribeEx( + session, + resubscriptionList, + requestLabel, + requestLabelLen, + &blpapi_SubscriptionPreprocess_handleErrorPy, + errorAppenderCb); +} + +int blpapi_Session_resubscribeWithIdEx_helper( + blpapi_Session_t *session, + const blpapi_SubscriptionList_t *resubscriptionList, + int resubscriptionId, + const char *requestLabel, + int requestLabelLen, + PyObject* errorAppenderCb) +{ + return blpapi_Session_resubscribeWithIdEx( + session, + resubscriptionList, + resubscriptionId, + requestLabel, + requestLabelLen, + &blpapi_SubscriptionPreprocess_handleErrorPy, + errorAppenderCb); +} + + + SWIGINTERNINLINE PyObject * SWIG_From_float (float value) { @@ -10476,6 +10564,226 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_destroy(PyObject *SWIGUNUSEDP } +SWIGINTERN PyObject *_wrap_blpapi_Session_subscribeEx_helper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; + blpapi_SubscriptionList_t *arg2 = (blpapi_SubscriptionList_t *) 0 ; + blpapi_Identity_t *arg3 = (blpapi_Identity_t *) 0 ; + char *arg4 = (char *) 0 ; + int arg5 ; + PyObject *arg6 = (PyObject *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject *asAscii4 = 0 ; + PyObject *swig_obj[5] ; + int result; + + if (!SWIG_Python_UnpackTuple(args, "blpapi_Session_subscribeEx_helper", 5, 5, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_subscribeEx_helper" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + } + arg1 = (blpapi_Session_t *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_subscribeEx_helper" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); + } + arg2 = (blpapi_SubscriptionList_t *)(argp2); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_subscribeEx_helper" "', argument " "3"" of type '" "blpapi_Identity_t const *""'"); + } + arg3 = (blpapi_Identity_t *)(argp3); + { + if (swig_obj[3] == Py_None) { + arg4 = 0; + arg5 = 0; + } + else { + if(PyUnicode_Check(swig_obj[3])) { + asAscii4 = PyUnicode_AsASCIIString(swig_obj[3]); + arg4 = PyString_AsString(asAscii4); + arg5 = PyString_Size(asAscii4); + } + else { + arg4 = PyString_AsString(swig_obj[3]); + arg5 = PyString_Size(swig_obj[3]); + } + } + } + { + arg6 = swig_obj[4]; + } + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Session_subscribeEx_helper(arg1,(struct blpapi_SubscriptionList const *)arg2,(struct blpapi_Identity const *)arg3,(char const *)arg4,arg5,arg6); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + { + if(asAscii4) { + Py_DECREF(asAscii4); + } + } + return resultobj; +fail: + { + if(asAscii4) { + Py_DECREF(asAscii4); + } + } + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Session_resubscribeEx_helper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; + blpapi_SubscriptionList_t *arg2 = (blpapi_SubscriptionList_t *) 0 ; + char *arg3 = (char *) 0 ; + int arg4 ; + PyObject *arg5 = (PyObject *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *asAscii3 = 0 ; + PyObject *swig_obj[4] ; + int result; + + if (!SWIG_Python_UnpackTuple(args, "blpapi_Session_resubscribeEx_helper", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_resubscribeEx_helper" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + } + arg1 = (blpapi_Session_t *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_resubscribeEx_helper" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); + } + arg2 = (blpapi_SubscriptionList_t *)(argp2); + { + if (swig_obj[2] == Py_None) { + arg3 = 0; + arg4 = 0; + } + else { + if(PyUnicode_Check(swig_obj[2])) { + asAscii3 = PyUnicode_AsASCIIString(swig_obj[2]); + arg3 = PyString_AsString(asAscii3); + arg4 = PyString_Size(asAscii3); + } + else { + arg3 = PyString_AsString(swig_obj[2]); + arg4 = PyString_Size(swig_obj[2]); + } + } + } + { + arg5 = swig_obj[3]; + } + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Session_resubscribeEx_helper(arg1,(struct blpapi_SubscriptionList const *)arg2,(char const *)arg3,arg4,arg5); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + { + if(asAscii3) { + Py_DECREF(asAscii3); + } + } + return resultobj; +fail: + { + if(asAscii3) { + Py_DECREF(asAscii3); + } + } + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Session_resubscribeWithIdEx_helper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; + blpapi_SubscriptionList_t *arg2 = (blpapi_SubscriptionList_t *) 0 ; + int arg3 ; + char *arg4 = (char *) 0 ; + int arg5 ; + PyObject *arg6 = (PyObject *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject *asAscii4 = 0 ; + PyObject *swig_obj[5] ; + int result; + + if (!SWIG_Python_UnpackTuple(args, "blpapi_Session_resubscribeWithIdEx_helper", 5, 5, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_resubscribeWithIdEx_helper" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + } + arg1 = (blpapi_Session_t *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_resubscribeWithIdEx_helper" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); + } + arg2 = (blpapi_SubscriptionList_t *)(argp2); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Session_resubscribeWithIdEx_helper" "', argument " "3"" of type '" "int""'"); + } + arg3 = (int)(val3); + { + if (swig_obj[3] == Py_None) { + arg4 = 0; + arg5 = 0; + } + else { + if(PyUnicode_Check(swig_obj[3])) { + asAscii4 = PyUnicode_AsASCIIString(swig_obj[3]); + arg4 = PyString_AsString(asAscii4); + arg5 = PyString_Size(asAscii4); + } + else { + arg4 = PyString_AsString(swig_obj[3]); + arg5 = PyString_Size(swig_obj[3]); + } + } + } + { + arg6 = swig_obj[4]; + } + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Session_resubscribeWithIdEx_helper(arg1,(struct blpapi_SubscriptionList const *)arg2,arg3,(char const *)arg4,arg5,arg6); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + { + if(asAscii4) { + Py_DECREF(asAscii4); + } + } + return resultobj; +fail: + { + if(asAscii4) { + Py_DECREF(asAscii4); + } + } + return NULL; +} + + SWIGINTERN PyObject *_wrap_blpapi_AuthOptions_create_default(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_AuthOptions_t **arg1 = (blpapi_AuthOptions_t **) 0 ; @@ -18183,6 +18491,91 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_subscribe(PyObject *SWIGUNUSEDPARM(sel } +SWIGINTERN PyObject *_wrap_blpapi_Session_subscribeEx(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; + blpapi_SubscriptionList_t *arg2 = (blpapi_SubscriptionList_t *) 0 ; + blpapi_Identity_t *arg3 = (blpapi_Identity_t *) 0 ; + char *arg4 = (char *) 0 ; + int arg5 ; + blpapi_SubscriptionPreprocessErrorHandler_t arg6 = (blpapi_SubscriptionPreprocessErrorHandler_t) 0 ; + void *arg7 = (void *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject *asAscii4 = 0 ; + int res7 ; + PyObject *swig_obj[6] ; + int result; + + if (!SWIG_Python_UnpackTuple(args, "blpapi_Session_subscribeEx", 6, 6, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_subscribeEx" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + } + arg1 = (blpapi_Session_t *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_subscribeEx" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); + } + arg2 = (blpapi_SubscriptionList_t *)(argp2); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_subscribeEx" "', argument " "3"" of type '" "blpapi_Identity_t const *""'"); + } + arg3 = (blpapi_Identity_t *)(argp3); + { + if (swig_obj[3] == Py_None) { + arg4 = 0; + arg5 = 0; + } + else { + if(PyUnicode_Check(swig_obj[3])) { + asAscii4 = PyUnicode_AsASCIIString(swig_obj[3]); + arg4 = PyString_AsString(asAscii4); + arg5 = PyString_Size(asAscii4); + } + else { + arg4 = PyString_AsString(swig_obj[3]); + arg5 = PyString_Size(swig_obj[3]); + } + } + } + { + int res = SWIG_ConvertFunctionPtr(swig_obj[4], (void**)(&arg6), SWIGTYPE_p_f_p_q_const__struct_blpapi_CorrelationId_t__p_q_const__char_int_p_q_const__char_p_void__void); + if (!SWIG_IsOK(res)) { + SWIG_exception_fail(SWIG_ArgError(res), "in method '" "blpapi_Session_subscribeEx" "', argument " "6"" of type '" "blpapi_SubscriptionPreprocessErrorHandler_t""'"); + } + } + res7 = SWIG_ConvertPtr(swig_obj[5],SWIG_as_voidptrptr(&arg7), 0, 0); + if (!SWIG_IsOK(res7)) { + SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "blpapi_Session_subscribeEx" "', argument " "7"" of type '" "void *""'"); + } + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Session_subscribeEx(arg1,(struct blpapi_SubscriptionList const *)arg2,(struct blpapi_Identity const *)arg3,(char const *)arg4,arg5,arg6,arg7); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + { + if(asAscii4) { + Py_DECREF(asAscii4); + } + } + return resultobj; +fail: + { + if(asAscii4) { + Py_DECREF(asAscii4); + } + } + return NULL; +} + + SWIGINTERN PyObject *_wrap_blpapi_Session_resubscribe(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; @@ -18247,6 +18640,83 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_resubscribe(PyObject *SWIGUNUSEDPARM(s } +SWIGINTERN PyObject *_wrap_blpapi_Session_resubscribeEx(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; + blpapi_SubscriptionList_t *arg2 = (blpapi_SubscriptionList_t *) 0 ; + char *arg3 = (char *) 0 ; + int arg4 ; + blpapi_SubscriptionPreprocessErrorHandler_t arg5 = (blpapi_SubscriptionPreprocessErrorHandler_t) 0 ; + void *arg6 = (void *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *asAscii3 = 0 ; + int res6 ; + PyObject *swig_obj[5] ; + int result; + + if (!SWIG_Python_UnpackTuple(args, "blpapi_Session_resubscribeEx", 5, 5, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_resubscribeEx" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + } + arg1 = (blpapi_Session_t *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_resubscribeEx" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); + } + arg2 = (blpapi_SubscriptionList_t *)(argp2); + { + if (swig_obj[2] == Py_None) { + arg3 = 0; + arg4 = 0; + } + else { + if(PyUnicode_Check(swig_obj[2])) { + asAscii3 = PyUnicode_AsASCIIString(swig_obj[2]); + arg3 = PyString_AsString(asAscii3); + arg4 = PyString_Size(asAscii3); + } + else { + arg3 = PyString_AsString(swig_obj[2]); + arg4 = PyString_Size(swig_obj[2]); + } + } + } + { + int res = SWIG_ConvertFunctionPtr(swig_obj[3], (void**)(&arg5), SWIGTYPE_p_f_p_q_const__struct_blpapi_CorrelationId_t__p_q_const__char_int_p_q_const__char_p_void__void); + if (!SWIG_IsOK(res)) { + SWIG_exception_fail(SWIG_ArgError(res), "in method '" "blpapi_Session_resubscribeEx" "', argument " "5"" of type '" "blpapi_SubscriptionPreprocessErrorHandler_t""'"); + } + } + res6 = SWIG_ConvertPtr(swig_obj[4],SWIG_as_voidptrptr(&arg6), 0, 0); + if (!SWIG_IsOK(res6)) { + SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "blpapi_Session_resubscribeEx" "', argument " "6"" of type '" "void *""'"); + } + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Session_resubscribeEx(arg1,(struct blpapi_SubscriptionList const *)arg2,(char const *)arg3,arg4,arg5,arg6); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + { + if(asAscii3) { + Py_DECREF(asAscii3); + } + } + return resultobj; +fail: + { + if(asAscii3) { + Py_DECREF(asAscii3); + } + } + return NULL; +} + + SWIGINTERN PyObject *_wrap_blpapi_Session_resubscribeWithId(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; @@ -18319,6 +18789,91 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_resubscribeWithId(PyObject *SWIGUNUSED } +SWIGINTERN PyObject *_wrap_blpapi_Session_resubscribeWithIdEx(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; + blpapi_SubscriptionList_t *arg2 = (blpapi_SubscriptionList_t *) 0 ; + int arg3 ; + char *arg4 = (char *) 0 ; + int arg5 ; + blpapi_SubscriptionPreprocessErrorHandler_t arg6 = (blpapi_SubscriptionPreprocessErrorHandler_t) 0 ; + void *arg7 = (void *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject *asAscii4 = 0 ; + int res7 ; + PyObject *swig_obj[6] ; + int result; + + if (!SWIG_Python_UnpackTuple(args, "blpapi_Session_resubscribeWithIdEx", 6, 6, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_resubscribeWithIdEx" "', argument " "1"" of type '" "blpapi_Session_t *""'"); + } + arg1 = (blpapi_Session_t *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_resubscribeWithIdEx" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); + } + arg2 = (blpapi_SubscriptionList_t *)(argp2); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Session_resubscribeWithIdEx" "', argument " "3"" of type '" "int""'"); + } + arg3 = (int)(val3); + { + if (swig_obj[3] == Py_None) { + arg4 = 0; + arg5 = 0; + } + else { + if(PyUnicode_Check(swig_obj[3])) { + asAscii4 = PyUnicode_AsASCIIString(swig_obj[3]); + arg4 = PyString_AsString(asAscii4); + arg5 = PyString_Size(asAscii4); + } + else { + arg4 = PyString_AsString(swig_obj[3]); + arg5 = PyString_Size(swig_obj[3]); + } + } + } + { + int res = SWIG_ConvertFunctionPtr(swig_obj[4], (void**)(&arg6), SWIGTYPE_p_f_p_q_const__struct_blpapi_CorrelationId_t__p_q_const__char_int_p_q_const__char_p_void__void); + if (!SWIG_IsOK(res)) { + SWIG_exception_fail(SWIG_ArgError(res), "in method '" "blpapi_Session_resubscribeWithIdEx" "', argument " "6"" of type '" "blpapi_SubscriptionPreprocessErrorHandler_t""'"); + } + } + res7 = SWIG_ConvertPtr(swig_obj[5],SWIG_as_voidptrptr(&arg7), 0, 0); + if (!SWIG_IsOK(res7)) { + SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "blpapi_Session_resubscribeWithIdEx" "', argument " "7"" of type '" "void *""'"); + } + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Session_resubscribeWithIdEx(arg1,(struct blpapi_SubscriptionList const *)arg2,arg3,(char const *)arg4,arg5,arg6,arg7); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + { + if(asAscii4) { + Py_DECREF(asAscii4); + } + } + return resultobj; +fail: + { + if(asAscii4) { + Py_DECREF(asAscii4); + } + } + return NULL; +} + + SWIGINTERN PyObject *_wrap_blpapi_Session_unsubscribe(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; @@ -22053,6 +22608,9 @@ static PyMethodDef SwigMethods[] = { { "blpapi_MessageFormatter_copy", _wrap_blpapi_MessageFormatter_copy, METH_O, NULL}, { "blpapi_MessageFormatter_assign", _wrap_blpapi_MessageFormatter_assign, METH_O, NULL}, { "blpapi_MessageFormatter_destroy", _wrap_blpapi_MessageFormatter_destroy, METH_O, NULL}, + { "blpapi_Session_subscribeEx_helper", _wrap_blpapi_Session_subscribeEx_helper, METH_VARARGS, NULL}, + { "blpapi_Session_resubscribeEx_helper", _wrap_blpapi_Session_resubscribeEx_helper, METH_VARARGS, NULL}, + { "blpapi_Session_resubscribeWithIdEx_helper", _wrap_blpapi_Session_resubscribeWithIdEx_helper, METH_VARARGS, NULL}, { "blpapi_AuthOptions_create_default", _wrap_blpapi_AuthOptions_create_default, METH_NOARGS, NULL}, { "blpapi_AuthOptions_create_forUserMode", _wrap_blpapi_AuthOptions_create_forUserMode, METH_O, NULL}, { "blpapi_AuthOptions_create_forAppMode", _wrap_blpapi_AuthOptions_create_forAppMode, METH_O, NULL}, @@ -22299,8 +22857,11 @@ static PyMethodDef SwigMethods[] = { { "blpapi_Session_nextEvent", _wrap_blpapi_Session_nextEvent, METH_VARARGS, NULL}, { "blpapi_Session_tryNextEvent", _wrap_blpapi_Session_tryNextEvent, METH_O, NULL}, { "blpapi_Session_subscribe", _wrap_blpapi_Session_subscribe, METH_VARARGS, NULL}, + { "blpapi_Session_subscribeEx", _wrap_blpapi_Session_subscribeEx, METH_VARARGS, NULL}, { "blpapi_Session_resubscribe", _wrap_blpapi_Session_resubscribe, METH_VARARGS, NULL}, + { "blpapi_Session_resubscribeEx", _wrap_blpapi_Session_resubscribeEx, METH_VARARGS, NULL}, { "blpapi_Session_resubscribeWithId", _wrap_blpapi_Session_resubscribeWithId, METH_VARARGS, NULL}, + { "blpapi_Session_resubscribeWithIdEx", _wrap_blpapi_Session_resubscribeWithIdEx, METH_VARARGS, NULL}, { "blpapi_Session_unsubscribe", _wrap_blpapi_Session_unsubscribe, METH_VARARGS, NULL}, { "blpapi_Session_setStatusCorrelationId", _wrap_blpapi_Session_setStatusCorrelationId, METH_VARARGS, NULL}, { "blpapi_Session_sendRequest", _wrap_blpapi_Session_sendRequest, METH_VARARGS, NULL}, @@ -22451,6 +23012,7 @@ static swig_type_info _swigt__p_blpapi_Topic = {"_p_blpapi_Topic", "struct blpap static swig_type_info _swigt__p_blpapi_TopicList = {"_p_blpapi_TopicList", "struct blpapi_TopicList *|blpapi_TopicList_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_char = {"_p_char", "char *|blpapi_Char_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_double = {"_p_double", "blpapi_Float64_t *|double *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_f_p_q_const__struct_blpapi_CorrelationId_t__p_q_const__char_int_p_q_const__char_p_void__void = {"_p_f_p_q_const__struct_blpapi_CorrelationId_t__p_q_const__char_int_p_q_const__char_p_void__void", "void (*)(struct blpapi_CorrelationId_t_ const *,char const *,int,char const *,void *)|blpapi_SubscriptionPreprocessErrorHandler_t", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_f_p_struct_blpapi_Event_p_struct_blpapi_ProviderSession_p_void__void = {"_p_f_p_struct_blpapi_Event_p_struct_blpapi_ProviderSession_p_void__void", "void (*)(struct blpapi_Event *,struct blpapi_ProviderSession *,void *)|blpapi_ProviderEventHandler_t", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_float = {"_p_float", "blpapi_Float32_t *|float *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_int = {"_p_int", "blpapi_Bool_t *|int *|blpapi_Int32_t *", 0, 0, (void*)0, 0}; @@ -22526,6 +23088,7 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_blpapi_TopicList, &_swigt__p_char, &_swigt__p_double, + &_swigt__p_f_p_q_const__struct_blpapi_CorrelationId_t__p_q_const__char_int_p_q_const__char_p_void__void, &_swigt__p_f_p_struct_blpapi_Event_p_struct_blpapi_ProviderSession_p_void__void, &_swigt__p_float, &_swigt__p_int, @@ -22601,6 +23164,7 @@ static swig_cast_info _swigc__p_blpapi_Topic[] = { {&_swigt__p_blpapi_Topic, 0, static swig_cast_info _swigc__p_blpapi_TopicList[] = { {&_swigt__p_blpapi_TopicList, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_double[] = { {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_f_p_q_const__struct_blpapi_CorrelationId_t__p_q_const__char_int_p_q_const__char_p_void__void[] = { {&_swigt__p_f_p_q_const__struct_blpapi_CorrelationId_t__p_q_const__char_int_p_q_const__char_p_void__void, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_f_p_struct_blpapi_Event_p_struct_blpapi_ProviderSession_p_void__void[] = { {&_swigt__p_f_p_struct_blpapi_Event_p_struct_blpapi_ProviderSession_p_void__void, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_float[] = { {&_swigt__p_float, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_int[] = { {&_swigt__p_intArray, _p_intArrayTo_p_int, 0, 0}, {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}}; @@ -22676,6 +23240,7 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_blpapi_TopicList, _swigc__p_char, _swigc__p_double, + _swigc__p_f_p_q_const__struct_blpapi_CorrelationId_t__p_q_const__char_int_p_q_const__char_p_void__void, _swigc__p_f_p_struct_blpapi_Event_p_struct_blpapi_ProviderSession_p_void__void, _swigc__p_float, _swigc__p_int, @@ -23517,6 +24082,8 @@ SWIG_init(void) { SWIG_Python_SetConstant(d, "IDENTITYUTIL_USERTYPE_UNKNOWN",SWIG_From_int((int)((-2)))); SWIG_Python_SetConstant(d, "IDENTITYUTIL_USERTYPE_APP_PORTAL",SWIG_From_int((int)(8))); SWIG_Python_SetConstant(d, "IDENTITYUTIL_USERTYPE_SANDBOX_EXCEL",SWIG_From_int((int)(9))); + SWIG_Python_SetConstant(d, "SUBSCRIPTIONPREPROCESS_INVALID_SUBSCRIPTION_STRING",SWIG_From_int((int)(1))); + SWIG_Python_SetConstant(d, "SUBSCRIPTIONPREPROCESS_CORRELATIONID_ERROR",SWIG_From_int((int)(2))); SWIG_Python_SetConstant(d, "DATATYPE_BOOL",SWIG_From_int((int)(BLPAPI_DATATYPE_BOOL))); SWIG_Python_SetConstant(d, "DATATYPE_CHAR",SWIG_From_int((int)(BLPAPI_DATATYPE_CHAR))); SWIG_Python_SetConstant(d, "DATATYPE_BYTE",SWIG_From_int((int)(BLPAPI_DATATYPE_BYTE))); diff --git a/src/blpapi/logging.py b/src/blpapi/logging.py index af57575..69f0ee4 100644 --- a/src/blpapi/logging.py +++ b/src/blpapi/logging.py @@ -5,30 +5,32 @@ @DESCRIPTION: This component provides a function that is used to register a callback for logging""" -from __future__ import absolute_import +from typing import Callable, List from blpapi import internals +from datetime import datetime from . import utils -from .compat import with_metaclass from .datetime import _DatetimeUtil +from .typehints import AnyPythonDatetime -@with_metaclass(utils.MetaClassForClassesWithEnums) -class Logger: +class Logger(metaclass=utils.MetaClassForClassesWithEnums): """This utility class provides a namespace for functions to test the logging configuration.""" # Different logging levels - SEVERITY_OFF = internals.blpapi_Logging_SEVERITY_OFF - SEVERITY_FATAL = internals.blpapi_Logging_SEVERITY_FATAL - SEVERITY_ERROR = internals.blpapi_Logging_SEVERITY_ERROR - SEVERITY_WARN = internals.blpapi_Logging_SEVERITY_WARN - SEVERITY_INFO = internals.blpapi_Logging_SEVERITY_INFO - SEVERITY_DEBUG = internals.blpapi_Logging_SEVERITY_DEBUG - SEVERITY_TRACE = internals.blpapi_Logging_SEVERITY_TRACE + SEVERITY_OFF = internals.blpapi_Logging_SEVERITY_OFF # type: ignore + SEVERITY_FATAL = internals.blpapi_Logging_SEVERITY_FATAL # type: ignore + SEVERITY_ERROR = internals.blpapi_Logging_SEVERITY_ERROR # type: ignore + SEVERITY_WARN = internals.blpapi_Logging_SEVERITY_WARN # type: ignore + SEVERITY_INFO = internals.blpapi_Logging_SEVERITY_INFO # type: ignore + SEVERITY_DEBUG = internals.blpapi_Logging_SEVERITY_DEBUG # type: ignore + SEVERITY_TRACE = internals.blpapi_Logging_SEVERITY_TRACE # type: ignore - loggerCallbacksLocal = [] # needed for temporary ref. holding + loggerCallbacksLocal: List[Callable] = [] # needed for temp. ref. holding @staticmethod - def registerCallback(callback, thresholdSeverity=SEVERITY_INFO): + def registerCallback(callback: + Callable[[int, int, AnyPythonDatetime, str, str], None], + thresholdSeverity: int = SEVERITY_INFO) -> None: """Register the specified 'callback' that will be called for all log messages with severity greater than or equal to the specified 'thresholdSeverity'. The callback needs to be registered before the @@ -36,7 +38,11 @@ def registerCallback(callback, thresholdSeverity=SEVERITY_INFO): the last registered callback will take effect. An exception of type 'RuntimeError' will be thrown if 'callback' cannot be registered. If callback is None, any existing callback shall be removed.""" - def callbackWrapper(threadId, severity, ts, category, message): + def callbackWrapper(threadId: int, + severity: int, + ts: datetime, + category: str, + message: str): dt = _DatetimeUtil.convertToNativeNotHighPrecision(ts) callback(threadId, severity, dt, category, message) @@ -57,7 +63,7 @@ def callbackWrapper(threadId, severity, ts, category, message): raise RuntimeError("unable to register callback") @staticmethod - def logTestMessage(severity): + def logTestMessage(severity: int) -> None: """Log a test message at the specified 'severity'. Note that this function is intended for testing of the logging configuration only.""" diff --git a/src/blpapi/message.py b/src/blpapi/message.py index 47f0247..5080325 100644 --- a/src/blpapi/message.py +++ b/src/blpapi/message.py @@ -11,25 +11,30 @@ from __future__ import absolute_import import sys import weakref +import datetime +from typing import Set, Optional, Any, List from blpapi.datetime import _DatetimeUtil, UTC +from . import typehints # pylint: disable=unused-import +from .typehints import BlpapiNameOrStr, BlpapiNameOrStrOrIndex +from .typehints import BlpapiMessageHandle, AnyPythonDatetime +from .typehints import SupportedElementTypes +from typing import Iterator as IteratorType from .element import Element from .exception import _ExceptionUtil from .name import Name from . import internals from .utils import deprecated, MetaClassForClassesWithEnums -from .compat import with_metaclass from .chandle import CHandle -# Handling a circular dependancy between modules: +# Handling a circular dependency between modules: # service->event->message->service service = sys.modules.get('blpapi.service') if service is None: from . import service -# pylint: disable=protected-access -@with_metaclass(MetaClassForClassesWithEnums) -class Message(CHandle): +# pylint: disable=protected-access +class Message(CHandle, metaclass=MetaClassForClassesWithEnums): """A handle to a single message. :class:`Message` objects are obtained by iterating an :class:`Event`. Each @@ -55,23 +60,27 @@ class Message(CHandle): the application. """ - FRAGMENT_NONE = internals.MESSAGE_FRAGMENT_NONE + FRAGMENT_NONE = internals.MESSAGE_FRAGMENT_NONE # type: ignore """Unfragmented message""" - FRAGMENT_START = internals.MESSAGE_FRAGMENT_START + FRAGMENT_START = internals.MESSAGE_FRAGMENT_START # type: ignore """Start of a fragmented message""" - FRAGMENT_INTERMEDIATE = internals.MESSAGE_FRAGMENT_INTERMEDIATE + FRAGMENT_INTERMEDIATE = internals.MESSAGE_FRAGMENT_INTERMEDIATE # type: ignore """Intermediate fragment""" - FRAGMENT_END = internals.MESSAGE_FRAGMENT_END + FRAGMENT_END = internals.MESSAGE_FRAGMENT_END # type: ignore """Final part of a fragmented message""" - RECAPTYPE_NONE = internals.MESSAGE_RECAPTYPE_NONE + RECAPTYPE_NONE = internals.MESSAGE_RECAPTYPE_NONE # type: ignore """Normal data tick""" - RECAPTYPE_SOLICITED = internals.MESSAGE_RECAPTYPE_SOLICITED + RECAPTYPE_SOLICITED = internals.MESSAGE_RECAPTYPE_SOLICITED # type: ignore """Generated on request by subscriber""" - RECAPTYPE_UNSOLICITED = internals.MESSAGE_RECAPTYPE_UNSOLICITED + RECAPTYPE_UNSOLICITED = internals.MESSAGE_RECAPTYPE_UNSOLICITED # type: ignore """Generated by the service""" - def __init__(self, handle, event=None, sessions=None): + def __init__(self, + handle : BlpapiMessageHandle, + event : Optional["typehints.Event"] = None, + sessions : Optional[Set["typehints.AbstractSession"]] = None + ) -> None: """ Args: handle: Handle to the internal implementation @@ -81,17 +90,16 @@ def __init__(self, handle, event=None, sessions=None): internals.blpapi_Message_addRef(handle) super(Message, self).__init__(handle, internals.blpapi_Message_release) self.__handle = handle + self.__sessions: Set["typehints.AbstractSession"] = set() if event is None: - if sessions is None: - self.__sessions = set() - else: + if sessions is not None: self.__sessions = sessions else: self.__sessions = event._sessions() self.__element = None - def __str__(self): + def __str__(self) -> str: """x.__str__() <==> str(x) Return a string representation of this Message. Call of str(message) @@ -101,51 +109,51 @@ def __str__(self): return self.toString() - def __getitem__(self, name): + def __getitem__(self, name : BlpapiNameOrStrOrIndex) -> Any: """Equivalent to :meth:`asElement().__getitem__()`. """ return self.asElement()[name] - def __iter__(self): + def __iter__(self) -> IteratorType: """Equivalent to :meth:`asElement().__iter__()`. """ return self.asElement().__iter__() - def __contains__(self, item): + def __contains__(self, item: SupportedElementTypes) -> bool: """Equivalent to :meth:`asElement().__contains__()`. """ return self.asElement().__contains__(item) - def __len__(self): + def __len__(self) -> int: """Equivalent to :meth:`asElement().__len__()`. """ return self.asElement().__len__() - def messageType(self): + def messageType(self) -> Name: """ Returns: - Name: Type of this message. + Type of this message. """ return Name._createInternally( internals.blpapi_Message_messageType(self.__handle)) - def fragmentType(self): + def fragmentType(self) -> int: """ Returns: - int: Fragment type of this message. + Fragment type of this message. Fragment types are listed in the class docstring. """ return internals.blpapi_Message_fragmentType(self.__handle) - def recapType(self): + def recapType(self) -> int: """ Returns: - int: Recap type of this message. + Recap type of this message. Recap types are listed in the class docstring. """ @@ -153,10 +161,10 @@ def recapType(self): @deprecated - def topicName(self): + def topicName(self) -> str: """ Returns: - str: Topic string of this message. If there is no topic associated + Topic string of this message. If there is no topic associated with the message, empty string is returned. **DEPRECATED** @@ -179,17 +187,17 @@ def topicName(self): def service(self): """ Returns: - Service: Service that this :class:`Message` is associated with. + Service that this :class:`Message` is associated with. """ serviceHandle = internals.blpapi_Message_service(self.__handle) return None if serviceHandle is None \ else service.Service(serviceHandle, self.__sessions) - def correlationId(self): + def correlationId(self) -> Optional["typehints.CorrelationId"]: """ Returns: - CorrelationId: The single correlation id or the first correlation + The single correlation id or the first correlation id associated with the message, or None if the message is not associated with any correlation ids. @@ -207,10 +215,10 @@ def correlationId(self): return internals.blpapi_Message_correlationId(self.__handle, 0) - def correlationIds(self): + def correlationIds(self) -> List["typehints.CorrelationId"]: """ Returns: - [CorrelationId]: Correlation ids associated with this message. + Correlation ids associated with this message. Note: A subscription data :class:`Message` has exactly one @@ -235,46 +243,48 @@ def correlationIds(self): internals.blpapi_Message_correlationId(self.__handle, i)) return res - def hasElement(self, name, excludeNullElements=False): + def hasElement(self, + name: BlpapiNameOrStr, + excludeNullElements: bool=False) -> bool: """Equivalent to asElement().hasElement(name, excludeNullElements).""" return self.asElement().hasElement(name, excludeNullElements) - def numElements(self): + def numElements(self) -> int: """Equivalent to :meth:`asElement().numElements() `.""" return self.asElement().numElements() - def getElement(self, name): + def getElement(self, name: BlpapiNameOrStrOrIndex) -> Element: """Equivalent to :meth:`asElement().getElement(name) `.""" return self.asElement().getElement(name) - def getElementAsBool(self, name): + def getElementAsBool(self, name: BlpapiNameOrStr) -> bool: """Equivalent to :meth:`asElement().getElementAsBool(name) `.""" return self.asElement().getElementAsBool(name) - def getElementAsString(self, name): + def getElementAsString(self, name: BlpapiNameOrStr) -> str: """Equivalent to :meth:`asElement().getElementAsString(name) `.""" return self.asElement().getElementAsString(name) - def getElementAsInteger(self, name): + def getElementAsInteger(self, name: BlpapiNameOrStr) -> int: """Equivalent to :meth:`asElement().getElementAsInteger(name) `.""" return self.asElement().getElementAsInteger(name) - def getElementAsFloat(self, name): + def getElementAsFloat(self, name: BlpapiNameOrStr) -> float: """Equivalent to :meth:`asElement().getElementAsFloat(name) `.""" return self.asElement().getElementAsFloat(name) - def getElementAsDatetime(self, name): + def getElementAsDatetime(self, name: BlpapiNameOrStr) -> AnyPythonDatetime: """Equivalent to :meth:`asElement().getElementAsDatetime(name) `.""" return self.asElement().getElementAsDatetime(name) - def getRequestId(self): + def getRequestId(self) -> Optional[str]: """Return the message's request id if one exists, otherwise return ``None``. @@ -286,13 +296,13 @@ def getRequestId(self): not be used for correlation purposes. Returns: - str: The request id of the message. + The request id of the message. """ rc, requestId = internals.blpapi_Message_getRequestId(self.__handle) _ExceptionUtil.raiseOnError(rc) return requestId - def asElement(self): + def asElement(self) -> Element: """ Returns: Element: The content of this :class:`Message` as an @@ -304,20 +314,20 @@ def asElement(self): if el is None: el = Element(internals.blpapi_Message_elements(self.__handle), self) - self.__element = weakref.ref(el) + self.__element = weakref.ref(el) # type: ignore return el - def toString(self, level=0, spacesPerLevel=4): + def toString(self, level: int=0, spacesPerLevel: int=4) -> str: """Format this :class:`Message` to the string at the specified indentation level. Args: - level (int): Indentation level - spacesPerLevel (int): Number of spaces per indentation level for + level: Indentation level + spacesPerLevel: Number of spaces per indentation level for this and all nested objects Returns: - str: This element formatted as a string + This element formatted as a string If ``level`` is negative, suppress indentation of the first line. If ``spacesPerLevel`` is negative, format the entire output on one line, @@ -332,11 +342,11 @@ def toPy(self): """Equivalent to :meth:`asElement().toPy()`.""" return self.asElement().toPy() - def timeReceived(self, tzinfo=UTC): + def timeReceived(self, tzinfo: datetime.tzinfo=UTC) -> AnyPythonDatetime: """Get the time when the message was received by the SDK. Args: - tzinfo (~datetime.tzinfo): Timezone info + tzinfo: Timezone info Returns: datetime.datetime or datetime.date or datetime.time: Time when the @@ -359,9 +369,9 @@ def timeReceived(self, tzinfo=UTC): time_point) native = _DatetimeUtil.convertToNative(original) - return native.astimezone(tzinfo) + return native.astimezone(tzinfo) # type: ignore - def _sessions(self): + def _sessions(self) -> Set["typehints.AbstractSession"]: """Return session(s) this Message related to. For internal use.""" return self.__sessions diff --git a/src/blpapi/name.py b/src/blpapi/name.py index 25900c4..403cdf9 100644 --- a/src/blpapi/name.py +++ b/src/blpapi/name.py @@ -6,14 +6,16 @@ form for efficient string comparison. """ - +from typing import Optional, Tuple, Union from . import internals -from .compat import conv2str, tolong, isstr -from .utils import get_handle +from .utils import conv2str, get_handle, isstr from .chandle import CHandle +from . import typehints # pylint: disable=unused-import +from .typehints import BlpapiNameOrStr, BlpapiNameHandle -# pylint: disable=broad-except + +# pylint: disable=broad-except class Name(CHandle): """:class:`Name` represents a string in a form which is efficient for comparison. @@ -49,49 +51,50 @@ class Name(CHandle): """ @staticmethod - def findName(nameString): + def findName(nameString: str) -> Optional["Name"]: """ Args: - nameString (str): String represented by an existing :class:`Name` + nameString: String represented by an existing :class:`Name` Returns: - Name: An existing :class:`Name` object representing ``nameString``. - If no such object exists, ``None`` is retured. + An existing :class:`Name` object representing ``nameString``. + If no such object exists, ``None`` is returned. """ nameHandle = internals.blpapi_Name_findName(nameString) return None if nameHandle is None \ else Name._createInternally(nameHandle) @staticmethod - def hasName(nameString): + def hasName(nameString: str) -> bool: """ Args: - nameString (str): String represented by an existing :class:`Name` + nameString: String represented by an existing :class:`Name` Returns: - bool: ``True`` if a :class:`Name` object representing + ``True`` if a :class:`Name` object representing ``nameString`` exists """ return bool(internals.blpapi_Name_hasName(nameString)) @staticmethod - def _createInternally(handle): + def _createInternally(handle: BlpapiNameHandle) -> "Name": return Name(None, handle) - def __init__(self, nameString, internalHandle=None): + def __init__(self, nameString: Optional[str], + internalHandle: Optional[BlpapiNameHandle] = None) -> None: selfhandle = internalHandle if selfhandle is None: selfhandle = internals.blpapi_Name_create(nameString) super(Name, self).__init__(selfhandle, internals.blpapi_Name_destroy) self.__handle = selfhandle - def __len__(self): + def __len__(self) -> int: """Return the length of the string that this Name represents. """ return internals.blpapi_Name_length(self.__handle) - def __str__(self): + def __str__(self) -> str: """x.__str__() <==> str(x) Return a string that this Name represents. @@ -100,32 +103,32 @@ def __str__(self): return internals.blpapi_Name_string(self.__handle) - def __eq__(self, other): + def __eq__(self, other) -> bool: """x.__eq__(y) <==> x==y""" - try: - s = conv2str(other) - if s is not None: - p = internals.blpapi_Name_equalsStr(self.__handle, s) - return p != 0 - return self.__handle == get_handle(other) - except Exception: - return NotImplemented - - def __ne__(self, other): + s = conv2str(other) + if s is not None: + p = internals.blpapi_Name_equalsStr(self.__handle, s) + return p != 0 + return self.__handle == get_handle(other) + + def __ne__(self, other) -> bool: """x.__ne__(y) <==> x!=y""" - equal = self.__eq__(other) - return NotImplemented if equal is NotImplemented else not equal + return not self.__eq__(other) - def __hash__(self): + def __hash__(self) -> int: """x.__hash__() <==> hash(x)""" - return tolong(self.__handle) + return int(self.__handle) + + -def getNamePair(name): +def getNamePair( + name: BlpapiNameOrStr) -> Union[Tuple[None, BlpapiNameHandle], + Tuple[str, None]]: """Create a tuple that contains a name string and blpapi_Name_t*. Args: - name (Name or str): A :class:`Name` or a string instance + name: A :class:`Name` or a string instance Returns: ``(None, name._handle())`` if ``name`` is a :class:`Name` instance, or diff --git a/src/blpapi/providersession.py b/src/blpapi/providersession.py index 3cfc3c9..53cc595 100644 --- a/src/blpapi/providersession.py +++ b/src/blpapi/providersession.py @@ -57,9 +57,8 @@ publishers that do not maintain per-topic state. """ -from __future__ import print_function -from __future__ import absolute_import -import weakref +from weakref import ref, ReferenceType # pylint: disable=unused-import +from typing import Optional, Callable, Sequence import sys import traceback import os @@ -75,14 +74,14 @@ from .topic import Topic from . import utils from .utils import get_handle -from .compat import with_metaclass from .chandle import CHandle +from . import typehints # pylint: disable=unused-import +from .typehints import BlpapiEventHandle # pylint: disable=line-too-long,too-many-lines # pylint: disable=protected-access,too-many-public-methods,bare-except,too-many-function-args - -@with_metaclass(utils.MetaClassForClassesWithEnums) -class ServiceRegistrationOptions(CHandle): +class ServiceRegistrationOptions(CHandle, + metaclass=utils.MetaClassForClassesWithEnums): """Contains the options which can be specified when registering a service. To use non-default options to :meth:`~ProviderSession.registerService()`, @@ -105,36 +104,36 @@ class ServiceRegistrationOptions(CHandle): - :attr:`PART_DEFAULT` """ - PRIORITY_LOW = internals.SERVICEREGISTRATIONOPTIONS_PRIORITY_LOW + PRIORITY_LOW = internals.SERVICEREGISTRATIONOPTIONS_PRIORITY_LOW # type: ignore PRIORITY_MEDIUM = \ - internals.SERVICEREGISTRATIONOPTIONS_PRIORITY_MEDIUM - PRIORITY_HIGH = internals.SERVICEREGISTRATIONOPTIONS_PRIORITY_HIGH + internals.SERVICEREGISTRATIONOPTIONS_PRIORITY_MEDIUM # type: ignore + PRIORITY_HIGH = internals.SERVICEREGISTRATIONOPTIONS_PRIORITY_HIGH # type: ignore # Constants for specifying which part(s) of a service should be registered: - PART_PUBLISHING = internals.REGISTRATIONPARTS_PUBLISHING + PART_PUBLISHING = internals.REGISTRATIONPARTS_PUBLISHING # type: ignore """Register to receive subscribe and unsubscribe messages""" - PART_OPERATIONS = internals.REGISTRATIONPARTS_OPERATIONS + PART_OPERATIONS = internals.REGISTRATIONPARTS_OPERATIONS # type: ignore """Register to receive the request types corresponding to each "operation" defined in the service metadata""" PART_SUBSCRIBER_RESOLUTION \ - = internals.REGISTRATIONPARTS_SUBSCRIBER_RESOLUTION + = internals.REGISTRATIONPARTS_SUBSCRIBER_RESOLUTION # type: ignore """Register to receive resolution requests (with message type ``PermissionRequest``) from subscribers""" PART_PUBLISHER_RESOLUTION \ - = internals.REGISTRATIONPARTS_PUBLISHER_RESOLUTION + = internals.REGISTRATIONPARTS_PUBLISHER_RESOLUTION # type: ignore """Register to receive resolution requests (with message type ``PermissionRequest``) from publishers (via :meth:`ProviderSession.createTopics()`)""" - PART_DEFAULT = internals.REGISTRATIONPARTS_DEFAULT + PART_DEFAULT = internals.REGISTRATIONPARTS_DEFAULT # type: ignore """Register the parts of the service implied by options specified in the service metadata""" - def __init__(self): + def __init__(self) -> None: """Create :class:`ServiceRegistrationOptions` with default options.""" selfhandle = internals.blpapi_ServiceRegistrationOptions_create() super(ServiceRegistrationOptions, self).__init__( @@ -142,11 +141,11 @@ def __init__(self): internals.blpapi_ServiceRegistrationOptions_destroy) self.__handle = selfhandle - def setGroupId(self, groupId): + def setGroupId(self, groupId: str) -> None: """Set the Group ID for the service to be registered. Args: - groupId (str): The group ID for the service to be registered + groupId: The group ID for the service to be registered Set the Group ID for the service to be registered to the specified ``groupId`` string. If ``groupId`` length is greater than @@ -156,12 +155,12 @@ def setGroupId(self, groupId): internals.blpapi_ServiceRegistrationOptions_setGroupId( self.__handle, groupId) - def setServicePriority(self, priority): + def setServicePriority(self, priority: int) -> int: """Set the priority with which a subscription service will be registered. Args: - priority (int): The service priority + priority: The service priority Set the priority with which a subscription service will be registered to the specified ``priority``, where numerically greater values of @@ -179,33 +178,36 @@ def setServicePriority(self, priority): self.__handle, priority) - def getGroupId(self): + def getGroupId(self) -> str: """ Returns: - str: The value of the service Group Id in this instance. + The value of the service Group Id in this instance. """ _, groupId = \ internals.blpapi_ServiceRegistrationOptions_getGroupId( self.__handle) return groupId - def getServicePriority(self): + def getServicePriority(self) -> int: """ Returns: - int: The value of the priority for subscription services in this - instance. + The value of the priority for subscription services + in this instance. """ priority = \ internals.blpapi_ServiceRegistrationOptions_getServicePriority( self.__handle) return priority - def addActiveSubServiceCodeRange(self, begin, end, priority): + def addActiveSubServiceCodeRange(self, + begin: int, + end: int, + priority: int) -> None: """ Args: - begin (int): Start of sub-service code range - end (int): End of sub-service code range - priority (int): Priority with which to receive subscriptions + begin: Start of sub-service code range + end: End of sub-service code range + priority: Priority with which to receive subscriptions Advertise the service to be registered to receive, with the specified ``priority``, subscriptions that the resolver has mapped to a @@ -221,16 +223,16 @@ def addActiveSubServiceCodeRange(self, begin, end, priority): self.__handle, begin, end, priority) _ExceptionUtil.raiseOnError(err) - def removeAllActiveSubServiceCodeRanges(self): + def removeAllActiveSubServiceCodeRanges(self) -> None: """Remove all previously added sub-service code ranges.""" internals.blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges( self.__handle) - def setPartsToRegister(self, parts): + def setPartsToRegister(self, parts: int) -> None: """Set the parts of the service to be registered. Args: - int: Parts of the service to be registered. + parts: Parts of the service to be registered. Set the parts of the service to be registered to the specified ``parts``, which must be a bitwise-or of the options provided in @@ -240,10 +242,10 @@ def setPartsToRegister(self, parts): internals.blpapi_ServiceRegistrationOptions_setPartsToRegister( self.__handle, parts) - def getPartsToRegister(self): + def getPartsToRegister(self) -> int: """ Returns: - int: The parts of the service to be registered. + The parts of the service to be registered. Registration parts are enumerated in the class docstring. """ @@ -251,8 +253,8 @@ def getPartsToRegister(self): self.__handle) -@with_metaclass(utils.MetaClassForClassesWithEnums) -class ProviderSession(AbstractSession): +class ProviderSession(AbstractSession, + metaclass=utils.MetaClassForClassesWithEnums): """This class provides a session that can be used for providing services. It inherits from :class:`AbstractSession`. In addition to the @@ -280,37 +282,39 @@ class ProviderSession(AbstractSession): """ AUTO_REGISTER_SERVICES = \ - internals.RESOLVEMODE_AUTO_REGISTER_SERVICES + internals.RESOLVEMODE_AUTO_REGISTER_SERVICES # type: ignore DONT_REGISTER_SERVICES = \ - internals.RESOLVEMODE_DONT_REGISTER_SERVICES + internals.RESOLVEMODE_DONT_REGISTER_SERVICES # type: ignore __handle = None # pylint: disable=unused-private-member __handlerProxy = None # pylint: disable=unused-private-member @staticmethod - def __dispatchEvent(sessionRef, eventHandle): # pragma: no cover + def __dispatchEvent( + sessionRef: "ReferenceType[ProviderSession]", + eventHandle: BlpapiEventHandle) -> None: # pragma: no cover """Use sessions ref to dispatch an event""" try: session = sessionRef() if session is not None: - event = Event(eventHandle, session) + event = Event(eventHandle, {session}) session.__handler(event, session) except: print("Exception in event handler:", file=sys.stderr) traceback.print_exc(file=sys.stderr) os._exit(1) - def __init__(self, options=None, eventHandler=None, eventDispatcher=None): + def __init__(self, + options: Optional[SessionOptions]=None, + eventHandler: Optional[Callable]=None, + eventDispatcher: Optional["typehints.EventDispatcher"]=None) -> None: """Constructor. Args: - options (SessionOptions): Options used to construct the sessions - eventHandler (~collections.abc.Callable): Handler for the events - generated by this session - eventDispatcher (EventDispatcher): Dispatcher for the events - generated by this session - + options: Options used to construct the sessions + eventHandler: Handler for the events generated by this session + eventDispatcher: Dispatcher for the events generated by this session Raises: InvalidArgumentException: If ``eventHandler`` is ``None`` and the ``eventDispatcher`` is not ``None`` @@ -318,14 +322,13 @@ def __init__(self, options=None, eventHandler=None, eventDispatcher=None): Construct a Session using the optionally specified 'options', the optionally specified 'eventHandler' and the optionally specified 'eventDispatcher'. - See :class:`SessionOptions` for details on what can be specified in the ``options``. + If ``eventHandler`` is not ``None`` then this Session will operate in asynchronous mode, otherwise the Session will operate in synchronous mode. - If supplied, ``eventHandler`` is a callable object that takes two arguments: received event and related session. @@ -356,7 +359,7 @@ def __init__(self, options=None, eventHandler=None, eventDispatcher=None): if eventHandler is not None: self.__handler = eventHandler # pylint: disable=unused-private-member self.__handlerProxy = functools.partial( - ProviderSession.__dispatchEvent, weakref.ref(self)) + ProviderSession.__dispatchEvent, ref(self)) self.__handle = internals.ProviderSession_createHelper( get_handle(options), self.__handlerProxy, @@ -372,11 +375,11 @@ def __init__(self, options=None, eventHandler=None, eventDispatcher=None): internals.blpapi_ProviderSession_getAbstractSession(self.__handle), _dtor) - def start(self): + def start(self) -> bool: """Start this :class:`Session` in synchronous mode. Returns: - bool: ``True`` if the :class:`Session` started successfully, + ``True`` if the :class:`Session` started successfully, ``False`` otherwise. Attempt to start this :class:`Session` and block until the @@ -386,11 +389,11 @@ def start(self): """ return internals.blpapi_ProviderSession_start(self.__handle) == 0 - def startAsync(self): + def startAsync(self) -> bool: """Start this :class:`Session` in asynchronous mode. Returns: - bool: ``True`` if the process to start a :class:`Session` began + ``True`` if the process to start a :class:`Session` began successfully, ``False`` otherwise. Attempt to begin the process to start this :class:`Session`. The @@ -403,15 +406,15 @@ def startAsync(self): """ return internals.blpapi_ProviderSession_startAsync(self.__handle) == 0 - def flushPublishedEvents(self, timeoutMsecs): + def flushPublishedEvents(self, timeoutMsecs: int) -> bool: """Wait at most ``timeoutMsecs`` milliseconds for all the published events to be sent through the underlying channel. Args: - timeoutMsecs (int): Timeout threshold in milliseconds + timeoutMsecs: Timeout threshold in milliseconds Returns: - bool: ``True`` if all the published events have been sent, + ``True`` if all the published events have been sent, ``False`` otherwise The method returns either as soon as all the published events have been @@ -427,11 +430,11 @@ def flushPublishedEvents(self, timeoutMsecs): return allFlushed != 0 - def stop(self): + def stop(self) -> bool: """Stop operation of this :class:`Session` and wait until it stops. Returns: - bool: ``True`` if the :class:`Session` stopped successfully, + ``True`` if the :class:`Session` stopped successfully, ``False`` otherwise. Stop operation of this :class:`Session` and block until all callbacks @@ -444,15 +447,14 @@ def stop(self): deadlock. Once a :class:`Session` has been stopped it can only be destroyed. """ - if sys.version_info >= (3, 6): - atexit.unregister(self.stop) + atexit.unregister(self.stop) return internals.blpapi_ProviderSession_stop(self.__handle) == 0 - def stopAsync(self): + def stopAsync(self) -> bool: """Begin the process to stop this Session and return immediately. Returns: - bool: ``True`` if the process to stop a :class:`Session` began + ``True`` if the process to stop a :class:`Session` began successfully, ``False`` otherwise. The application must monitor events for a :attr:`~Event.SESSION_STATUS` @@ -463,13 +465,13 @@ def stopAsync(self): """ return internals.blpapi_ProviderSession_stopAsync(self.__handle) == 0 - def nextEvent(self, timeout=0): + def nextEvent(self, timeout: int=0) -> Event: """ Args: - timeout (int): Timeout threshold in milliseconds + timeout: Timeout threshold in milliseconds Returns: - Event: Next available event for this session + Next available event for this session Raises: InvalidStateException: If invoked on a session created in @@ -490,12 +492,12 @@ def nextEvent(self, timeout=0): _ExceptionUtil.raiseOnError(retCode) - return Event(event, self) + return Event(event, {self}) - def tryNextEvent(self): + def tryNextEvent(self) -> Optional[Event]: """ Returns: - Event: Next available event for this session + Next available event for this session If there are :class:`Event`\ s available for the session, return the next :class:`Event` If there is no event available for the @@ -505,21 +507,23 @@ def tryNextEvent(self): self.__handle) if retCode: return None - return Event(event, self) + return Event(event, {self}) - def registerService(self, uri, identity=None, options=None): + def registerService( + self, + uri: str, + identity: Optional["typehints.Identity"]=None, + options: Optional[ServiceRegistrationOptions]=None) -> bool: """Attempt to register the service and block until it is done. Args: - uri (str): Name of the service - identity (Identity): Identity used to verify permissions to provide + uri: Name of the service + identity: Identity used to verify permissions to provide the service being registered - options (ServiceRegistrationOptions): Options used to register the - service + options: Options used to register the service Returns: - bool: ``True`` if the service registered successfully, ``False`` - otherwise + ``True`` if the service registered successfully, else ``False`` Attempt to register the service identified by the specified ``uri`` and block until the service is either registered successfully or has failed @@ -550,22 +554,23 @@ def registerService(self, uri, identity=None, options=None): return True return False - def registerServiceAsync(self, uri, identity=None, correlationId=None, - options=None): + def registerServiceAsync( + self, + uri: str, + identity: Optional["typehints.Identity"]=None, + correlationId: Optional[CorrelationId]=None, + options: Optional[ServiceRegistrationOptions]=None) -> CorrelationId: """Begin the process of registering the service immediately. Args: - uri (str): Name of the service - identity (Identity): Identity used to verify permissions to provide + uri: Name of the service + identity: Identity used to verify permissions to provide the service being registered - correlationId (CorrelationId): Correlation id to associate with - this operation - options (ServiceRegistrationOptions): Options used to register the - service + correlationId: Correlation id to associate with this operation + options: Options used to register the service Returns: - CorrelationId: Correlation id associated with events generated by - this operation + Correlation id associated with events generated by this operation Begin the process of registering the service identified by the specified ``uri`` and return immediately. The optionally specified @@ -598,20 +603,22 @@ def registerServiceAsync(self, uri, identity=None, correlationId=None, self.__handle, uri, get_handle(identity), - get_handle(correlationId), + correlationId, get_handle(options) )) return correlationId - def resolve(self, resolutionList, resolveMode=DONT_REGISTER_SERVICES, - identity=None): + def resolve(self, + resolutionList: "typehints.ResolutionList", + resolveMode: int=DONT_REGISTER_SERVICES, + identity: Optional["typehints.Identity"]=None) -> None: """Resolve the topics in the specified ``resolutionList``. Args: - resolutionList (ResolutionList): List of topics to resolve - resolveMode (int): Mode to resolve in - identity (Identity): Identity used for authorization + resolutionList: List of topics to resolve + resolveMode: Mode to resolve in + identity: Identity used for authorization Resolve the topics in the specified ``resolutionList``, which must be an object of type :class:`ResolutionList`, and update the @@ -646,14 +653,16 @@ def resolve(self, resolutionList, resolveMode=DONT_REGISTER_SERVICES, resolveMode, get_handle(identity))) - def resolveAsync(self, resolutionList, resolveMode=DONT_REGISTER_SERVICES, - identity=None): + def resolveAsync(self, + resolutionList: "typehints.ResolutionList", + resolveMode: int=DONT_REGISTER_SERVICES, + identity: Optional["typehints.Identity"]=None) -> None: """Begin the resolution of the topics in the specified list. Args: - resolutionList (ResolutionList): List of topics to resolve - resolveMode (int): Mode to resolve in - identity (Identity): Identity used for authorization + resolutionList: List of topics to resolve + resolveMode: Mode to resolve in + identity: Identity used for authorization Begin the resolution of the topics in the specified ``resolutionList``, which must be an object of type :class:`ResolutionList`. If the @@ -684,14 +693,14 @@ def resolveAsync(self, resolutionList, resolveMode=DONT_REGISTER_SERVICES, resolveMode, get_handle(identity))) - def getTopic(self, message): + def getTopic(self, message: "typehints.Message") -> Topic: """Find a previously created :class:`Topic` based on the ``message``. Args: - message (Message): Message to get the topic from + message: Message to get the topic from Returns: - Topic: The topic the message was published on + The topic the message was published on The ``message`` must be one of the following types: ``TopicCreated``, ``TopicActivated``, ``TopicDeactivated``, ``TopicSubscribed``, @@ -699,49 +708,52 @@ def getTopic(self, message): then invoking :meth:`~Topic.isValid()` on the returned :class:`Topic` will return ``False``. """ - errorCode, topic = internals.blpapi_ProviderSession_getTopic( + errorCode, topicHandle = internals.blpapi_ProviderSession_getTopic( self.__handle, get_handle(message)) _ExceptionUtil.raiseOnError(errorCode) - return Topic(topic, sessions=(self,)) + return Topic(topicHandle, {self}) - def createServiceStatusTopic(self, service): + def createServiceStatusTopic(self, + service: "typehints.Service") -> Topic: """Create a :class:`Service` Status :class:`Topic` which is to be used to provide service status. Args: - service (Service): Service for which to create the topic + service: Service for which to create the topic Returns: - Topic: A service status topic + A service status topic On success invoking :meth:`~Topic.isValid()` on the returned :class:`Topic` will return ``False``. """ - errorCode, topic = \ + errorCode, topicHandle = \ internals.blpapi_ProviderSession_createServiceStatusTopic( self.__handle, get_handle(service)) _ExceptionUtil.raiseOnError(errorCode) - return Topic(topic) + return Topic(topicHandle, {self}) - def publish(self, event): + def publish(self, event: Event) -> None: """Publish the specified ``event``. Args: - event (Event): Event to publish + event: Event to publish """ _ExceptionUtil.raiseOnError( internals.blpapi_ProviderSession_publish( self.__handle, get_handle(event))) - def sendResponse(self, event, isPartialResponse=False): + def sendResponse(self, + event: Event, + isPartialResponse: bool=False) -> None: """Send the response event for previously received request. Args: - event (Event): Response event to send - isPartialResponse (bool): Whether the response is partial or not + event: Response event to send + isPartialResponse: Whether the response is partial or not """ _ExceptionUtil.raiseOnError( internals.blpapi_ProviderSession_sendResponse( @@ -749,15 +761,16 @@ def sendResponse(self, event, isPartialResponse=False): get_handle(event), isPartialResponse)) - def createTopics(self, topicList, - resolveMode=DONT_REGISTER_SERVICES, - identity=None): + def createTopics(self, + topicList: "typehints.TopicList", + resolveMode: int=DONT_REGISTER_SERVICES, + identity: Optional["typehints.Identity"]=None) -> None: """Create the topics in the specified ``topicList``. Args: - topicList (TopicList): List of topics to create - resolveMode (int): Mode to use for topic resolution - identity (Identity): Identity to use for authorization + topicList: List of topics to create + resolveMode: Mode to use for topic resolution + identity: Identity to use for authorization Create the topics in the specified ``topicList``, which must be an object of type :class:`TopicList`, and update ``topicList`` with the results of the @@ -784,15 +797,16 @@ def createTopics(self, topicList, resolveMode, get_handle(identity))) - def createTopicsAsync(self, topicList, - resolveMode=DONT_REGISTER_SERVICES, - identity=None): + def createTopicsAsync(self, + topicList: "typehints.TopicList", + resolveMode: int=DONT_REGISTER_SERVICES, + identity: Optional["typehints.Identity"]=None) -> None: """Create the topics in the specified ``topicList``. Args: - topicList (TopicList): List of topics to create - resolveMode (int): Mode to use for topic resolution - identity (Identity): Identity to use for authorization + topicList: List of topics to create + resolveMode: Mode to use for topic resolution + identity: Identity to use for authorization Create the topics in the specified ``topicList``, which must be an object of type :class:`TopicList`, and update ``topicList`` with the results of the @@ -819,13 +833,17 @@ def createTopicsAsync(self, topicList, resolveMode, get_handle(identity))) - def activateSubServiceCodeRange(self, serviceName, begin, end, priority): + def activateSubServiceCodeRange(self, + serviceName: str, + begin: int, + end: int, + priority: int) -> None: """ Args: - serviceName (str): Name of the service - begin (int): Start of sub-service code range - end (int): End of sub-service code range - priority (int): Priority with which to receive subscriptions + serviceName: Name of the service + begin: Start of sub-service code range + end: End of sub-service code range + priority: Priority with which to receive subscriptions Register to receive, with the specified ``priority``, subscriptions for the specified ``service`` that the resolver has mapped to a service @@ -842,12 +860,15 @@ def activateSubServiceCodeRange(self, serviceName, begin, end, priority): self.__handle, serviceName, begin, end, priority) _ExceptionUtil.raiseOnError(err) - def deactivateSubServiceCodeRange(self, serviceName, begin, end): + def deactivateSubServiceCodeRange(self, + serviceName: str, + begin: int, + end: int) -> None: """ Args: - serviceName (str): Name of the service - begin (int): Start of sub-service code range - end (int): End of sub-service code range + serviceName: Name of the service + begin: Start of sub-service code range + end: End of sub-service code range De-register to receive subscriptions for the specified ``service`` that the resolver has mapped to a service code between the specified @@ -862,14 +883,14 @@ def deactivateSubServiceCodeRange(self, serviceName, begin, end): self.__handle, serviceName, begin, end) _ExceptionUtil.raiseOnError(err) - def deregisterService(self, serviceName): + def deregisterService(self, serviceName: str) -> bool: """De-register the service, including all registered parts. Args: - serviceName (str): Service to de-register + serviceName: Service to de-register Returns: - bool: ``False`` if the service is not registered nor in pending + ``False`` if the service is not registered nor in pending registration, ``True`` otherwise. The identity in the service registration is reused to verify @@ -889,13 +910,16 @@ def deregisterService(self, serviceName): self.__handle, serviceName) return res == 0 - def terminateSubscriptionsOnTopic(self, topic, message=None): + def terminateSubscriptionsOnTopic( + self, + topic: Topic, + message: Optional["typehints.Message"]=None) -> None: """Delete the specified ``topic`` (See :meth:`deleteTopic()` for additional details). Args: - topic (Topic): Topic to delete - message (Message): Message to convey additional information to + topic: Topic to delete + message: Message to convey additional information to subscribers regarding the termination Furthermore, proactively terminate all current subscriptions on @@ -910,12 +934,15 @@ def terminateSubscriptionsOnTopic(self, topic, message=None): internals.ProviderSession_terminateSubscriptionsOnTopic( self.__handle, get_handle(topic), message)) - def terminateSubscriptionsOnTopics(self, topics, message=None): + def terminateSubscriptionsOnTopics( + self, + topics: Sequence[Topic], + message: Optional["typehints.Message"]=None) -> None: """Terminate subscriptions on the specified ``topics``. Args: - topics ([Topic]): Topics to delete - message (Message): Message to convey additional information to + topics: Topics to delete + message: Message to convey additional information to subscribers regarding the termination See :meth:`terminateSubscriptionsOnTopic()` for additional details. @@ -938,11 +965,11 @@ def terminateSubscriptionsOnTopics(self, topics, message=None): finally: internals.delete_topicPtrArray(topicsCArray) - def deleteTopic(self, topic): + def deleteTopic(self, topic: Topic) -> None: """Remove one reference from the specified 'topic'. Args: - topic (Topic): Topic to remove the reference from + topic: Topic to remove the reference from If this function has been called the same number of times that ``topic`` was created by ``createTopics``, then ``topic`` is deleted: a @@ -958,11 +985,11 @@ def deleteTopic(self, topic): """ self.deleteTopics((topic,)) - def deleteTopics(self, topics): + def deleteTopics(self, topics: Sequence[Topic]) -> None: """Delete each topic in the specified ``topics`` container. Args: - deleteTopics([Topic]): Topics to delete + deleteTopics: Topics to delete See :meth:`deleteTopic()` above for additional details.""" if not topics: diff --git a/src/blpapi/request.py b/src/blpapi/request.py index 2af161b..94284e5 100644 --- a/src/blpapi/request.py +++ b/src/blpapi/request.py @@ -8,10 +8,15 @@ """ import weakref +from typing import Any, Mapping, Set +from .typehints import BlpapiRequestHandle from .element import Element from .exception import _ExceptionUtil +from .typehints import BlpapiNameOrStr from . import internals from .chandle import CHandle +from . import typehints # pylint: disable=unused-import + class Request(CHandle): """A single request to a single service. @@ -31,13 +36,14 @@ class Request(CHandle): :class:`Element` interface. """ - def __init__(self, handle, sessions): + def __init__(self, handle: BlpapiRequestHandle, + sessions: Set["typehints.AbstractSession"]) -> None: super(Request, self).__init__(handle, internals.blpapi_Request_destroy) self.__handle = handle self.__sessions = sessions self.__element = None - def __str__(self): + def __str__(self) -> str: """x.__str__() <==> str(x) Return a string representation of this Request. Call of str(request) is @@ -47,27 +53,27 @@ def __str__(self): return self.toString() - def __getitem__(self, name): + def __getitem__(self, name: BlpapiNameOrStr) -> Any: """Equivalent to :meth:`asElement().__getitem__(name) `.""" return self.asElement()[name] - def __setitem__(self, name, value): + def __setitem__(self, name: BlpapiNameOrStr, value: Any) -> None: """Equivalent to :meth:`asElement().__setitem__(name, value) `.""" self.asElement()[name] = value - def set(self, name, value): + def set(self, name: BlpapiNameOrStr, value: Any) -> None: """Equivalent to :meth:`asElement().setElement(name, value) `.""" self.asElement().setElement(name, value) - def append(self, name, value): + def append(self, name: BlpapiNameOrStr, value: Any) -> None: """Equivalent to :meth:`getElement(name).appendValue(value) `.""" - return self.getElement(name).appendValue(value) + self.getElement(name).appendValue(value) - def fromPy(self, requestDict): + def fromPy(self, requestDict: Mapping) -> None: """Equivalent to :meth:`asElement().fromPy(requestDict) `. @@ -83,7 +89,7 @@ def fromPy(self, requestDict): """ self.asElement().fromPy(requestDict) - def asElement(self): + def asElement(self) -> Element: """ Returns: Element: The content of this :class:`Request` as an @@ -95,15 +101,15 @@ def asElement(self): if el is None: el = Element(internals.blpapi_Request_elements(self.__handle), self) - self.__element = weakref.ref(el) + self.__element = weakref.ref(el) # type: ignore return el - def getElement(self, name): + def getElement(self, name: BlpapiNameOrStr) -> Element: """Equivalent to :meth:`asElement().getElement(name) `.""" return self.asElement().getElement(name) - def getRequestId(self): + def getRequestId(self) -> str: """ Return the request's id if one exists, otherwise return ``None``. @@ -114,18 +120,18 @@ def getRequestId(self): id and should not be used for correlation purposes. Returns: - str: The request id of the request. + The request id of the request. """ rc, requestId = internals.blpapi_Request_getRequestId(self.__handle) _ExceptionUtil.raiseOnError(rc) return requestId - def toString(self, level=0, spacesPerLevel=4): + def toString(self, level: int = 0, spacesPerLevel: int = 4) -> str: """Equivalent to :meth:`asElement().toString(level, spacesPerLevel) `.""" return self.asElement().toString(level, spacesPerLevel) - def _sessions(self): + def _sessions(self) -> Set["typehints.AbstractSession"]: """Return session(s) this Request related to. For internal use.""" return self.__sessions diff --git a/src/blpapi/resolutionlist.py b/src/blpapi/resolutionlist.py index 4283745..6bb3f9d 100644 --- a/src/blpapi/resolutionlist.py +++ b/src/blpapi/resolutionlist.py @@ -4,6 +4,7 @@ This component implements a list of topics that require resolution. """ +from typing import Optional, Set, Union from .exception import _ExceptionUtil from .message import Message @@ -11,12 +12,11 @@ from . import utils from .utils import deprecated, get_handle from .internals import CorrelationId -from .compat import with_metaclass from .chandle import CHandle +from . import typehints # pylint: disable=unused-import -@with_metaclass(utils.MetaClassForClassesWithEnums) -class ResolutionList(CHandle): +class ResolutionList(CHandle, metaclass=utils.MetaClassForClassesWithEnums): """Contains a list of topics that require resolution. Created from topic strings or from ``SUBSCRIPTION_STARTED`` messages. This @@ -28,17 +28,17 @@ class ResolutionList(CHandle): :class:`ResolutionList` can be. """ - UNRESOLVED = internals.RESOLUTIONLIST_UNRESOLVED - RESOLVED = internals.RESOLUTIONLIST_RESOLVED + UNRESOLVED = internals.RESOLUTIONLIST_UNRESOLVED # type: ignore + RESOLVED = internals.RESOLUTIONLIST_RESOLVED # type: ignore RESOLUTION_FAILURE_BAD_SERVICE = \ - internals.RESOLUTIONLIST_RESOLUTION_FAILURE_BAD_SERVICE + internals.RESOLUTIONLIST_RESOLUTION_FAILURE_BAD_SERVICE # type: ignore RESOLUTION_FAILURE_SERVICE_AUTHORIZATION_FAILED = \ internals. \ - RESOLUTIONLIST_RESOLUTION_FAILURE_SERVICE_AUTHORIZATION_FAILED + RESOLUTIONLIST_RESOLUTION_FAILURE_SERVICE_AUTHORIZATION_FAILED # type: ignore RESOLUTION_FAILURE_BAD_TOPIC = \ - internals.RESOLUTIONLIST_RESOLUTION_FAILURE_BAD_TOPIC + internals.RESOLUTIONLIST_RESOLUTION_FAILURE_BAD_TOPIC # type: ignore RESOLUTION_FAILURE_TOPIC_AUTHORIZATION_FAILED = \ - internals.RESOLUTIONLIST_RESOLUTION_FAILURE_TOPIC_AUTHORIZATION_FAILED + internals.RESOLUTIONLIST_RESOLUTION_FAILURE_TOPIC_AUTHORIZATION_FAILED # type: ignore @staticmethod @deprecated("attributes are no longer supported.") @@ -53,25 +53,25 @@ def extractAttributeFromResolutionSuccess(message, attribute): """ _ExceptionUtil.raiseOnError(internals.ERROR_UNSUPPORTED_OPERATION) - def __init__(self): + def __init__(self) -> None: """Create an empty :class:`ResolutionList`.""" selfhandle = internals.blpapi_ResolutionList_create(None) super(ResolutionList, self).__init__( selfhandle, internals.blpapi_ResolutionList_destroy) self.__handle = selfhandle - self.__sessions = set() + self.__sessions: Set["typehints.AbstractSession"] = set() - def add(self, topicOrMessage, correlationId=None): + def add(self, topicOrMessage: Union[str, Message], correlationId: Optional[CorrelationId] = None) -> int: """Add the specified topic or topic from message to this list. Args: - topicOrMessage (str or Message): Topic or message to add - correlationId (CorrelationId): CorrelationId to associate with this + topicOrMessage: Topic or message to add + correlationId: CorrelationId to associate with this operation Returns: - int: ``0`` on success, negative number on failure + ``0`` on success, negative number on failure Raises: TypeError: If ``correlationId`` is not an instance of @@ -96,11 +96,11 @@ def add(self, topicOrMessage, correlationId=None): return internals.blpapi_ResolutionList_addFromMessage( self.__handle, get_handle(topicOrMessage), - get_handle(correlationId)) + correlationId) return internals.blpapi_ResolutionList_add( self.__handle, topicOrMessage, - get_handle(correlationId)) + correlationId) @deprecated("attributes are no longer supported.") # pylint: disable=unused-argument,no-self-use @@ -114,10 +114,10 @@ def addAttribute(self, attribute): """ _ExceptionUtil.raiseOnError(internals.ERROR_UNSUPPORTED_OPERATION) - def correlationIdAt(self, index): + def correlationIdAt(self, index: int) -> CorrelationId: """ Args: - index (int): Index of the correlation id + index: Index of the correlation id Returns: CorrelationId: CorrelationId at the specified ``index``. @@ -131,15 +131,15 @@ def correlationIdAt(self, index): _ExceptionUtil.raiseOnError(errorCode) return cid - def topicString(self, correlationId): + def topicString(self, correlationId: CorrelationId) -> str: """Return the topic of the entry identified by ``correlationId``. Args: - correlationId (CorrelationId): Correlation id that identifies the + correlationId: Correlation id that identifies the topic Returns: - str: Topic string of the entry identified by ``correlationId``. + Topic string of the entry identified by ``correlationId``. Raises: Exception: If ``correlationId`` does not identify an entry in this @@ -147,17 +147,17 @@ def topicString(self, correlationId): """ errorCode, topic = internals.blpapi_ResolutionList_topicString( self.__handle, - get_handle(correlationId)) + correlationId) _ExceptionUtil.raiseOnError(errorCode) return topic - def topicStringAt(self, index): + def topicStringAt(self, index: int) -> str: """ Args: - index (int): Index of the topic string + index: Index of the topic string Returns: - str: Topic string at the specified ``index``. + Topic string at the specified ``index``. Raises: IndexOutOfRangeException: If ``index >= size()``. @@ -168,14 +168,14 @@ def topicStringAt(self, index): _ExceptionUtil.raiseOnError(errorCode) return topic - def status(self, correlationId): + def status(self, correlationId: CorrelationId) -> int: """ Args: - correlationId (CorrelationId): Correlation id that identifies the + correlationId: Correlation id that identifies the entry Returns: - int: status of the entry in this :class:`ResolutionList`. + status of the entry in this :class:`ResolutionList`. Raises: Exception: If the ``correlationId`` does not identify an entry in @@ -186,15 +186,14 @@ def status(self, correlationId): """ errorCode, status = internals.blpapi_ResolutionList_status( self.__handle, - get_handle(correlationId)) + correlationId) _ExceptionUtil.raiseOnError(errorCode) return status - def statusAt(self, index): + def statusAt(self, index: int) -> int: """ Args: - correlationId (CorrelationId): Correlation id that identifies the - entry + index: Index of the Correlation id Returns: int: status of the entry in this :class:`ResolutionList`. @@ -237,14 +236,14 @@ def attributeAt(self, attribute, index): """ _ExceptionUtil.raiseOnError(internals.ERROR_UNSUPPORTED_OPERATION) - def message(self, correlationId): + def message(self, correlationId: CorrelationId) -> Message: """ Args: - correlationId (CorrelationId): Correlation id that identifies an + correlationId: Correlation id that identifies an entry in this list Returns: - Message: Message received during resolution of the topic + Message received during resolution of the topic identified by the specified ``correlationId``. Raises: @@ -259,17 +258,17 @@ def message(self, correlationId): """ errorCode, message = internals.blpapi_ResolutionList_message( self.__handle, - get_handle(correlationId)) + correlationId) _ExceptionUtil.raiseOnError(errorCode) - return Message(message, sessions=self.__sessions) + return Message(message, sessions=self._sessions()) - def messageAt(self, index): + def messageAt(self, index: int) -> Message: """ Args: - index (int): Index of an entry in this list + index: Index of an entry in this list Returns: - Message: Message received during resolution of the topic + Message received during resolution of the topic specified ``index``\ th entry in this :class:`ResolutionList`. Raises: @@ -284,22 +283,22 @@ def messageAt(self, index): self.__handle, index) _ExceptionUtil.raiseOnError(errorCode) - return Message(message, sessions=self.__sessions) + return Message(message, sessions=self._sessions()) - def size(self): + def size(self) -> int: """ Returns: - int: Number of entries in this :class:`ResolutionList`. + Number of entries in this :class:`ResolutionList`. """ return internals.blpapi_ResolutionList_size(self.__handle) - def _sessions(self): + def _sessions(self) -> Set["typehints.AbstractSession"]: """Return session(s) that this 'ResolutionList' is related to. For internal use.""" return self.__sessions - def _addSession(self, session): + def _addSession(self, session: "typehints.AbstractSession") -> None: """Add a new session to this 'ResolutionList'. For internal use.""" diff --git a/src/blpapi/schema.py b/src/blpapi/schema.py index ae7594a..f639bb7 100644 --- a/src/blpapi/schema.py +++ b/src/blpapi/schema.py @@ -17,35 +17,36 @@ permitted to be associated with that identifier. """ - +from typing import Sequence, Set, Optional +from typing import Iterator as IteratorType +from . import typehints # pylint: disable=unused-import +from .typehints import BlpapiNameOrStr, BlpapiNameOrStrOrIndex +from .typehints import BlpapiSchemaElementDefinitionHandle +from .typehints import BlpapiSchemaTypeDefinitionHandle from .exception import NotFoundException, IndexOutOfRangeException from .name import Name, getNamePair from .constant import ConstantList from . import utils from . import internals -from .compat import with_metaclass - -# pylint: disable=useless-object-inheritance,protected-access,too-few-public-methods -@with_metaclass(utils.MetaClassForClassesWithEnums) -class SchemaStatus(object): +# pylint: disable=protected-access,too-few-public-methods +class SchemaStatus(metaclass=utils.MetaClassForClassesWithEnums): """The possible deprecation statuses of a schema element or type. """ - ACTIVE = internals.STATUS_ACTIVE + ACTIVE = internals.STATUS_ACTIVE # type: ignore """This item is current and may appear in Messages""" - DEPRECATED = internals.STATUS_DEPRECATED + DEPRECATED = internals.STATUS_DEPRECATED # type: ignore """This item is current and may appear in Messages but will be removed in due course""" - INACTIVE = internals.STATUS_INACTIVE + INACTIVE = internals.STATUS_INACTIVE # type: ignore """This item is not current and will not appear in Messages""" - PENDING_DEPRECATION = internals.STATUS_PENDING_DEPRECATION + PENDING_DEPRECATION = internals.STATUS_PENDING_DEPRECATION # type: ignore """This item is expected to be deprecated in the future; clients are advised to migrate away from use of this item.""" -@with_metaclass(utils.MetaClassForClassesWithEnums) -class SchemaElementDefinition(object): +class SchemaElementDefinition(metaclass=utils.MetaClassForClassesWithEnums): """The definition of an individual field within a schema type. This class implements the definition of an individual field within a schema @@ -81,14 +82,16 @@ class SchemaElementDefinition(object): other blpapi components. """ - UNBOUNDED = internals.ELEMENTDEFINITION_UNBOUNDED + UNBOUNDED = internals.ELEMENTDEFINITION_UNBOUNDED # type: ignore """Indicates an array has an unbounded number of values.""" - def __init__(self, handle, sessions): + def __init__(self, + handle: BlpapiSchemaElementDefinitionHandle, + sessions: Set["typehints.AbstractSession"]) -> None: self.__handle = handle self.__sessions = sessions - def __str__(self): + def __str__(self) -> str: """x.__str__() <==> str(x) Return a string representation of this item. It is equivalent to @@ -98,47 +101,47 @@ def __str__(self): return self.toString() - def name(self): + def name(self) -> Name: """ Returns: - Name: The name identifying this element within its containing + The name identifying this element within its containing structure/type. """ return Name._createInternally( internals.blpapi_SchemaElementDefinition_name(self.__handle)) - def description(self): + def description(self) -> str: """ Returns: - str: Human readable description of this element. + Human readable description of this element. """ return internals.blpapi_SchemaElementDefinition_description( self.__handle) - def status(self): + def status(self) -> int: """ Returns: - int: The deprecation status of this element. + The deprecation status of this element. The possible return values are enumerated in :class:`SchemaStatus`. """ return internals.blpapi_SchemaElementDefinition_status(self.__handle) - def typeDefinition(self): + def typeDefinition(self) -> "SchemaTypeDefinition": """ Returns: - SchemaTypeDefinition: The type of values contained in this element. + The type of values contained in this element. """ return SchemaTypeDefinition( internals.blpapi_SchemaElementDefinition_type(self.__handle), self.__sessions) - def minValues(self): + def minValues(self) -> int: """ Returns: - int: The minimum number of occurences of this element. + The minimum number of occurrences of this element. This value is always greater than or equal to zero. """ @@ -146,10 +149,10 @@ def minValues(self): return internals.blpapi_SchemaElementDefinition_minValues( self.__handle) - def maxValues(self): + def maxValues(self) -> int: """ Returns: - int: The maximum number of occurences of this element. + The maximum number of occurrences of this element. This value is always greater than or equal to one. @@ -160,10 +163,10 @@ def maxValues(self): return internals.blpapi_SchemaElementDefinition_maxValues( self.__handle) - def alternateNames(self): + def alternateNames(self) -> Sequence[Name]: """ Returns: - [Name]: The list of alternate names for this element. + The list of alternate names for this element. """ res = [] @@ -177,15 +180,15 @@ def alternateNames(self): i))) return res - def toString(self, level=0, spacesPerLevel=4): + def toString(self, level: int=0, spacesPerLevel: int=4) -> str: """ Args: - level (int): Indentation level - spacesPerLevel (int): Number of spaces per indentation level for + level: Indentation level + spacesPerLevel: Number of spaces per indentation level for this and all nested objects Returns: - str: This object formatted as a string + This object formatted as a string If ``level`` is negative, suppress indentation of the first line. If ``spacesPerLevel`` is negative, format the entire output on one line, @@ -201,12 +204,12 @@ def _handle(self): """Return the internal implementation.""" return self.__handle - def _sessions(self): + def _sessions(self) -> Set["typehints.AbstractSession"]: """Return session(s) this object is related to. For internal use.""" return self.__sessions -class SchemaTypeDefinition(object): +class SchemaTypeDefinition: """Representation of a "type" that can be used within a schema. This class implements a representation of a "type" that can be used within @@ -228,11 +231,13 @@ class SchemaTypeDefinition(object): other blpapi components. """ - def __init__(self, handle, sessions): + def __init__(self, + handle: BlpapiSchemaTypeDefinitionHandle, + sessions: Set["typehints.AbstractSession"]) -> None: self.__handle = handle self.__sessions = sessions - def __str__(self): + def __str__(self) -> str: """x.__str__() <==> str(x) Return a string representation of this 'SchemaTypeDefinition'. It is @@ -242,46 +247,45 @@ def __str__(self): return self.toString() - def datatype(self): + def datatype(self) -> int: """ Returns: - int: The data type of this :class:`SchemaTypeDefinition`. + The data type of this :class:`SchemaTypeDefinition`. The possible return values are enumerated in :class:`DataType`. """ return internals.blpapi_SchemaTypeDefinition_datatype(self.__handle) - def name(self): + def name(self) -> Name: """ Returns: - Name: The name of this :class:`SchemaTypeDefinition`. + The name of this :class:`SchemaTypeDefinition`. """ return Name._createInternally( internals.blpapi_SchemaTypeDefinition_name(self.__handle)) - def description(self): + def description(self) -> str: """ Returns: - str: Human readable description of this - :class:`SchemaTypeDefinition`. + Human readable description of this :class:`SchemaTypeDefinition`. """ return internals.blpapi_SchemaTypeDefinition_description(self.__handle) - def status(self): + def status(self) -> int: """ Returns: - int: The deprecation status of this :class:`SchemaTypeDefinition`. + The deprecation status of this :class:`SchemaTypeDefinition`. The possible return values are enumerated in :class:`SchemaStatus`. """ return internals.blpapi_SchemaTypeDefinition_status(self.__handle) - def numElementDefinitions(self): + def numElementDefinitions(self) -> int: """ Returns: - int: The number of :class:`SchemaElementDefinition` objects. + The number of :class:`SchemaElementDefinition` objects. If this :class:`SchemaTypeDefinition` is neither a choice nor a sequence this will return ``0``. @@ -290,62 +294,64 @@ def numElementDefinitions(self): return internals.blpapi_SchemaTypeDefinition_numElementDefinitions( self.__handle) - def isComplexType(self): + def isComplexType(self) -> bool: """ Returns: - bool: ``True`` if this :class:`SchemaTypeDefinition` represents a + ``True`` if this :class:`SchemaTypeDefinition` represents a sequence or choice type. """ return bool(internals.blpapi_SchemaTypeDefinition_isComplexType( self.__handle)) - def isSimpleType(self): + def isSimpleType(self) -> bool: """ Returns: - bool: True if this :class:`SchemaTypeDefinition` represents neither + ``True`` if this :class:`SchemaTypeDefinition` represents neither a sequence nor a choice type. """ return bool(internals.blpapi_SchemaTypeDefinition_isSimpleType( self.__handle)) - def isEnumerationType(self): + def isEnumerationType(self) -> bool: """ Returns: - bool: ``True`` if this :class:`SchemaTypeDefinition` represents an + ``True`` if this :class:`SchemaTypeDefinition` represents an enumeration type, ``False`` otherwise. """ return bool(internals.blpapi_SchemaTypeDefinition_isEnumerationType( self.__handle)) - def hasElementDefinition(self, name): + def hasElementDefinition(self, name: BlpapiNameOrStr) -> bool: """ Args: - name (Name or str): Item identifier + name: Item identifier Returns: - bool: ``True`` if this object contains an item with the + ``True`` if this object contains an item with the specified ``name``, ``False`` otherwise Raises: Exception: If ``name`` is neither a :class:`Name` nor a string. """ - name = getNamePair(name) + namepair = getNamePair(name) return bool(internals.blpapi_SchemaTypeDefinition_hasElementDefinition( self.__handle, - name[0], - name[1])) + namepair[0], + namepair[1])) - def getElementDefinition(self, nameOrIndex): + def getElementDefinition( + self, + nameOrIndex: BlpapiNameOrStrOrIndex) -> "SchemaElementDefinition": """ Args: - nameOrIndex (Name or str or int): Name or index of the element + nameOrIndex: Name or index of the element Returns: - SchemaElementDefinition: The definition of a specified element. + The definition of a specified element. Raises: NotFoundException: If ``nameOrIndex`` is a string and @@ -363,8 +369,8 @@ def getElementDefinition(self, nameOrIndex): names[1]) if res is None: errMessage =\ - "Name '{0!s}' not a sub-element of element '{1!s}'.".\ - format(name, self.name()) + f"Name '{name!s}' not a sub-element of element " \ + f" '{self.name()!s}'." raise NotFoundException(errMessage, 0) return SchemaElementDefinition(res, self.__sessions) position = nameOrIndex @@ -372,11 +378,11 @@ def getElementDefinition(self, nameOrIndex): self.__handle, position) if res is None: - errMessage = "Index '{0}' out of bounds.".format(position) + errMessage = f"Index '{position}' out of bounds." raise IndexOutOfRangeException(errMessage, 0) return SchemaElementDefinition(res, self.__sessions) - def elementDefinitions(self): + def elementDefinitions(self) -> IteratorType["SchemaElementDefinition"]: """ Returns: Iterator over :class:`SchemaElementDefinition`\ s defined by this @@ -387,26 +393,26 @@ def elementDefinitions(self): SchemaTypeDefinition.numElementDefinitions, SchemaTypeDefinition.getElementDefinition) - def enumeration(self): + def enumeration(self) -> Optional["typehints.ConstantList"]: """ Returns: - ConstantList: All possible values of the enumeration defined by - this type. ``None`` in case this :class:`SchemaTypeDefinition` is + All possible values of the enumeration defined by this type. + ``None`` in case this :class:`SchemaTypeDefinition` is not a enumeration. """ res = internals.blpapi_SchemaTypeDefinition_enumeration(self.__handle) return None if res is None else ConstantList(res, self.__sessions) - def toString(self, level=0, spacesPerLevel=4): + def toString(self, level: int=0, spacesPerLevel: int=4) -> str: """ Args: - level (int): Indentation level - spacesPerLevel (int): Number of spaces per indentation level for + level: Indentation level + spacesPerLevel: Number of spaces per indentation level for this and all nested objects Returns: - str: This object formatted as a string + This object formatted as a string If ``level`` is negative, suppress indentation of the first line. If ``spacesPerLevel`` is negative, format the entire output on one line, @@ -418,7 +424,7 @@ def toString(self, level=0, spacesPerLevel=4): level, spacesPerLevel) - def _sessions(self): + def _sessions(self) -> Set["typehints.AbstractSession"]: """Return session(s) this object is related to. For internal use.""" return self.__sessions diff --git a/src/blpapi/service.py b/src/blpapi/service.py index 7594482..d23558d 100644 --- a/src/blpapi/service.py +++ b/src/blpapi/service.py @@ -8,18 +8,22 @@ """ import warnings +from typing import Optional, Set +from typing import Iterator as IteratorType +from . import typehints # pylint: disable=unused-import +from .typehints import BlpapiNameOrStr, BlpapiNameOrStrOrIndex +from .typehints import BlpapiServiceHandle, BlpapiOperationHandle from .event import Event from .name import getNamePair from .request import Request from .schema import SchemaElementDefinition from .exception import _ExceptionUtil from . import utils -from .utils import get_handle from . import internals from .chandle import CHandle -class Operation(object): +class Operation: """Defines an operation which can be performed by a :class:`Service`. Operation objects are obtained from a :class:`Service` object. They provide @@ -27,29 +31,30 @@ class Operation(object): the possible response. """ - def __init__(self, handle, sessions): + def __init__(self, + handle: BlpapiOperationHandle, + sessions: Set["typehints.AbstractSession"]): self.__handle = handle self.__sessions = sessions - def name(self): + def name(self) -> str: """ Returns: - str: The name of this :class:`Operation`. + The name of this :class:`Operation`. """ return internals.blpapi_Operation_name(self.__handle) - def description(self): + def description(self) -> str: """ Returns: - str: a human readable description of this Operation. + A human readable description of this Operation. """ return internals.blpapi_Operation_description(self.__handle) - def requestDefinition(self): + def requestDefinition(self) -> Optional[SchemaElementDefinition]: """ Returns: - SchemaElementDefinition: Object which defines the schema for this - :class:`Operation`. + Object which defines the schema for this :class:`Operation`. """ errCode, definition = internals.blpapi_Operation_requestDefinition( @@ -57,23 +62,24 @@ def requestDefinition(self): return None if errCode != 0 else\ SchemaElementDefinition(definition, self.__sessions) - def numResponseDefinitions(self): + def numResponseDefinitions(self) -> int: """ Returns: - int: The number of the response types that can be returned by this + The number of the response types that can be returned by this :class:`Operation`. """ return internals.blpapi_Operation_numResponseDefinitions(self.__handle) - def getResponseDefinitionAt(self, position): + def getResponseDefinitionAt(self, + position: int) -> SchemaElementDefinition: """ Args: - position (int): Index of the response type + position: Index of the response type Returns: - SchemaElementDefinition: Object which defines the schema for the + Object which defines the schema for the response that this :class:`Operation` delivers. Raises: @@ -86,7 +92,7 @@ def getResponseDefinitionAt(self, position): _ExceptionUtil.raiseOnError(errCode) return SchemaElementDefinition(definition, self.__sessions) - def responseDefinitions(self): + def responseDefinitions(self) -> IteratorType[SchemaElementDefinition]: """ Returns: Iterator over response types that can be returned by this @@ -99,7 +105,7 @@ def responseDefinitions(self): Operation.numResponseDefinitions, Operation.getResponseDefinitionAt) - def _sessions(self): + def _sessions(self) -> Set["typehints.AbstractSession"]: """Return session(s) this object is related to. For internal use.""" return self.__sessions @@ -122,26 +128,28 @@ class Service(CHandle): :class:`Session` is terminated. """ - def __init__(self, handle, sessions): + def __init__(self, + handle: BlpapiServiceHandle, + sessions: Set["typehints.AbstractSession"]) -> None: super(Service, self).__init__(handle, internals.blpapi_Service_release) self.__handle = handle self.__sessions = sessions internals.blpapi_Service_addRef(self.__handle) - def __str__(self): + def __str__(self) -> str: """Convert the service schema to a string.""" return self.toString() - def toString(self, level=0, spacesPerLevel=4): + def toString(self, level: int=0, spacesPerLevel:int =4) -> str: """Convert this :class:`Service` schema to a string. Args: - level (int): Indentation level - spacesPerLevel (int): Number of spaces per indentation level for + level: Indentation level + spacesPerLevel: Number of spaces per indentation level for this and all nested objects Returns: - str: This object formatted as a string + This object formatted as a string If ``level`` is negative, suppress indentation of the first line. If ``spacesPerLevel`` is negative, format the entire output on one line, @@ -152,10 +160,10 @@ def toString(self, level=0, spacesPerLevel=4): level, spacesPerLevel) - def createPublishEvent(self): + def createPublishEvent(self) -> Event: """ Returns: - Event: :class:`Event` suitable for publishing to this + :class:`Event` suitable for publishing to this :class:`Service` Use an :class:`EventFormatter` to add :class:`Message`\ s to the @@ -167,10 +175,10 @@ def createPublishEvent(self): _ExceptionUtil.raiseOnError(errCode) return Event(event, self.__sessions) - def createAdminEvent(self): + def createAdminEvent(self) -> Event: """ Returns: - Event: An :attr:`~Event.ADMIN` :class:`Event` suitable for + An :attr:`~Event.ADMIN` :class:`Event` suitable for publishing to this :class:`Service` Use an :class:`EventFormatter` to add :class:`Message`\ s to the @@ -189,16 +197,17 @@ def createAdminEvent(self): _ExceptionUtil.raiseOnError(errCode) return Event(event, self.__sessions) - def createResponseEvent(self, correlationId): + def createResponseEvent(self, + correlationId: "typehints.CorrelationId") -> Event: """Create a :attr:`~Event.RESPONSE` :class:`Event` to answer the request. Args: - correlationId (CorrelationId): Correlation id to associate with the + correlationId: Correlation id to associate with the created event Returns: - Event: The created response event. + The created response event. Use an :class:`EventFormatter` to add :class:`Message`\ s to the :class:`Event` and set fields. @@ -206,28 +215,28 @@ def createResponseEvent(self, correlationId): errCode, event = internals.blpapi_Service_createResponseEvent( self.__handle, - get_handle(correlationId)) + correlationId) _ExceptionUtil.raiseOnError(errCode) return Event(event, self.__sessions) - def name(self): + def name(self) -> str: """ Returns: - str: Name of this service. + Name of this service. """ return internals.blpapi_Service_name(self.__handle) - def description(self): + def description(self) -> str: """ Returns: - str: Human-readable description of this service. + str: Human-readable description of this service. """ return internals.blpapi_Service_description(self.__handle) - def hasOperation(self, name): + def hasOperation(self, name: BlpapiNameOrStr) -> bool: """ Returns: - bool: ``True`` if the specified ``name`` is a valid + ``True`` if the specified ``name`` is a valid :class:`Operation` in this :class:`Service`. """ @@ -236,13 +245,13 @@ def hasOperation(self, name): names[0], names[1])) - def getOperation(self, nameOrIndex): + def getOperation(self, nameOrIndex: BlpapiNameOrStrOrIndex) -> Operation: """ Args: - nameOrIndex (Name or str or int): Name or index of the operation + nameOrIndex: Name or index of the operation Returns: - Operation: The specified operation. + The specified operation. Raises: Exception: If ``nameOrIndex`` is a string or a :class:`Name` and @@ -262,15 +271,15 @@ def getOperation(self, nameOrIndex): _ExceptionUtil.raiseOnError(errCode) return Operation(operation, self.__sessions) - def numOperations(self): + def numOperations(self) -> int: """ Returns: - int: The number of :class:`Operation`\ s defined by this + The number of :class:`Operation`\ s defined by this :class:`Service`. """ return internals.blpapi_Service_numOperations(self.__handle) - def operations(self): + def operations(self) -> IteratorType[Operation]: """ Returns: Iterator over :class:`Operation`\ s defined by this :class:`Service` @@ -279,13 +288,13 @@ def operations(self): Service.numOperations, Service.getOperation) - def hasEventDefinition(self, name): + def hasEventDefinition(self, name: BlpapiNameOrStr) -> bool: """ Args: - name (Name or str): Event identifier + name: Event identifier Returns: - bool: ``True`` if the specified ``name`` identifies a valid event + ``True`` if the specified ``name`` identifies a valid event in this :class:`Service`, ``False`` otherwise. Raises: @@ -297,15 +306,17 @@ def hasEventDefinition(self, name): names[0], names[1])) - def getEventDefinition(self, nameOrIndex): + def getEventDefinition( + self, + nameOrIndex: BlpapiNameOrStrOrIndex) -> SchemaElementDefinition: """Get the definition of a specified event. Args: - nameOrIndex (Name or str or int): Name or index of the event + nameOrIndex: Name or index of the event Returns: - SchemaElementDefinition: Object describing the element - identified by the specified ``nameOrIndex``. + Object describing the element identified + by the specified ``nameOrIndex``. Raises: NotFoundException: If ``nameOrIndex`` is a string and @@ -328,15 +339,14 @@ def getEventDefinition(self, nameOrIndex): _ExceptionUtil.raiseOnError(errCode) return SchemaElementDefinition(definition, self.__sessions) - def numEventDefinitions(self): + def numEventDefinitions(self) -> int: """ Returns: - int: The number of unsolicited events defined by this - :class:`Service`. + The number of unsolicited events defined by this :class:`Service`. """ return internals.blpapi_Service_numEventDefinitions(self.__handle) - def eventDefinitions(self): + def eventDefinitions(self) -> IteratorType[SchemaElementDefinition]: """ Returns: An iterator over unsolicited events defined by this @@ -347,11 +357,11 @@ def eventDefinitions(self): Service.numEventDefinitions, Service.getEventDefinition) - def authorizationServiceName(self): + def authorizationServiceName(self) -> str: """Get the authorization service name. Returns: - str: The name of the :class:`Service` which must be used in order + The name of the :class:`Service` which must be used in order to authorize access to restricted operations on this :class:`Service`. If no authorization is required to access operations on this service an empty string is returned. @@ -360,14 +370,14 @@ def authorizationServiceName(self): """ return internals.blpapi_Service_authorizationServiceName(self.__handle) - def createRequest(self, operation): + def createRequest(self, operation: str) -> Request: """Create an empty Request object for the specified ``operation``. Args: operation: A valid operation on this service Returns: - Request: An empty request for the specified ``operation``. + An empty request for the specified ``operation``. Raises: Exception: If ``operation`` does not identify a valid operation in @@ -383,7 +393,9 @@ def createRequest(self, operation): _ExceptionUtil.raiseOnError(errCode) return Request(request, self.__sessions) - def createAuthorizationRequest(self, authorizationOperation=None): + def createAuthorizationRequest( + self, + authorizationOperation: Optional[str]=None) -> Request: """Create an empty :class:`Request` object for ``authorizationOperation``. @@ -391,8 +403,7 @@ def createAuthorizationRequest(self, authorizationOperation=None): authorizationOperation: A valid operation on this service Returns: - Request: An empty request for the specified - ``authorizationOperation``. + An empty request for the specified ``authorizationOperation``. Raises: Exception: If ``authorizationOperation`` does not identify a valid @@ -408,7 +419,7 @@ def createAuthorizationRequest(self, authorizationOperation=None): _ExceptionUtil.raiseOnError(errCode) return Request(request, self.__sessions) - def _sessions(self): + def _sessions(self) -> Set["typehints.AbstractSession"]: """Return session(s) this object is related to. For internal use.""" return self.__sessions diff --git a/src/blpapi/session.py b/src/blpapi/session.py index 48bcc20..6b3ca1e 100644 --- a/src/blpapi/session.py +++ b/src/blpapi/session.py @@ -5,14 +5,15 @@ This component implements a consumer session for getting services. """ -from __future__ import print_function -from __future__ import absolute_import -import weakref +from weakref import ref, ReferenceType # pylint: disable=unused-import +from typing import Optional, Callable, List import sys import traceback import os import functools import atexit +from typing import NamedTuple +from enum import Enum from .abstractsession import AbstractSession from .event import Event from . import exception @@ -21,11 +22,30 @@ from .internals import CorrelationId from .sessionoptions import SessionOptions from .requesttemplate import RequestTemplate -from .utils import get_handle +from .utils import get_handle, MetaClassForClassesWithEnums +from . import typehints # pylint: disable=unused-import +from .typehints import BlpapiEventHandle # pylint: disable=too-many-arguments,protected-access,bare-except -class Session(AbstractSession): + +class SubscriptionPreprocessMode(Enum): + """The modes that can be used for the :meth:`Session.subscribe()` and + :meth:`Session.resubscribe()` operations.""" + + FAIL_ON_FIRST_ERROR = 1 + """In this mode, an exception is raised on the first invalid entry in the + :class:`SubscriptionList`, and the entire batch will be considered failed. + Otherwise, all the subscriptions will move forward and the method returns + ``None``.""" + + RETURN_INDIVIDUAL_ERRORS = 2 + """In this mode, instead of raising exceptions, a list of + :class:`SubscriptionPreprocessError` is returned, each representing an + error due to an invalid subscription in the :class:`SubscriptionList`. The + valid subscriptions will move forward.""" + +class Session(AbstractSession, metaclass=MetaClassForClassesWithEnums): """Consumer session for making requests for Bloomberg services. This class provides a consumer session for making requests for Bloomberg @@ -83,42 +103,49 @@ class Session(AbstractSession): The class attributes represent the states in which a subscription can be. """ - UNSUBSCRIBED = internals.SUBSCRIPTIONSTATUS_UNSUBSCRIBED + UNSUBSCRIBED = internals.SUBSCRIPTIONSTATUS_UNSUBSCRIBED # type: ignore """No longer active, terminated by API.""" - SUBSCRIBING = internals.SUBSCRIPTIONSTATUS_SUBSCRIBING + SUBSCRIBING = internals.SUBSCRIPTIONSTATUS_SUBSCRIBING # type: ignore """Initiated but no updates received.""" - SUBSCRIBED = internals.SUBSCRIPTIONSTATUS_SUBSCRIBED + SUBSCRIBED = internals.SUBSCRIPTIONSTATUS_SUBSCRIBED # type: ignore """Updates are flowing.""" - CANCELLED = internals.SUBSCRIPTIONSTATUS_CANCELLED + CANCELLED = internals.SUBSCRIPTIONSTATUS_CANCELLED # type: ignore """No longer active, terminated by Application.""" PENDING_CANCELLATION = \ - internals.SUBSCRIPTIONSTATUS_PENDING_CANCELLATION + internals.SUBSCRIPTIONSTATUS_PENDING_CANCELLATION # type: ignore """No longer active, terminated by Application.""" __handle = None # pylint: disable=unused-private-member __handlerProxy = None # pylint: disable=unused-private-member @staticmethod - def __dispatchEvent(sessionRef, eventHandle): # pragma: no cover + def __dispatchEvent( + sessionRef: "ReferenceType[Session]", + eventHandle: BlpapiEventHandle) -> None: # pragma: no cover """ event dispatcher """ try: session = sessionRef() if session is not None: - event = Event(eventHandle, session) + event = Event(eventHandle, {session}) session.__handler(event, session) except: print("Exception in event handler:", file=sys.stderr) traceback.print_exc(file=sys.stderr) os._exit(1) - def __init__(self, options=None, eventHandler=None, eventDispatcher=None): + def __init__( + self, + options: Optional[SessionOptions]=None, + eventHandler: Optional[Callable]=None, + eventDispatcher: Optional["typehints.EventDispatcher"]=None) -> None: """Create a consumer :class:`Session`. Args: - options (SessionOptions): Options to construct the session with - eventHandler (~collections.abc.Callable): Handler for events + options: Options to construct the session with + eventHandler: Handler for events generated by the session. Takes two arguments - received event and related session + eventDispatcher: An optional dispatcher for events. Raises: InvalidArgumentException: If ``eventHandler`` is ``None`` and and @@ -159,7 +186,7 @@ def __init__(self, options=None, eventHandler=None, eventDispatcher=None): if eventHandler is not None: self.__handler = eventHandler # pylint: disable=unused-private-member self.__handlerProxy = functools.partial(Session.__dispatchEvent, - weakref.ref(self)) + ref(self)) self.__handle = internals.Session_createHelper( get_handle(options), self.__handlerProxy, @@ -175,11 +202,11 @@ def __init__(self, options=None, eventHandler=None, eventDispatcher=None): internals.blpapi_Session_getAbstractSession(self.__handle), _dtor) - def start(self): + def start(self) -> bool: """Start this :class:`Session` in synchronous mode. Returns: - bool: ``True`` if the :class:`Session` started successfully, + ``True`` if the :class:`Session` started successfully, ``False`` otherwise. Attempt to start this :class:`Session` and block until the @@ -189,11 +216,11 @@ def start(self): """ return internals.blpapi_Session_start(self.__handle) == 0 - def startAsync(self): + def startAsync(self) -> bool: """Start this :class:`Session` in asynchronous mode. Returns: - bool: ``True`` if the process to start a :class:`Session` began + ``True`` if the process to start a :class:`Session` began successfully, ``False`` otherwise. Attempt to begin the process to start this :class:`Session`. The @@ -206,11 +233,11 @@ def startAsync(self): """ return internals.blpapi_Session_startAsync(self.__handle) == 0 - def stop(self): + def stop(self) -> bool: """Stop operation of this :class:`Session` and wait until it stops. Returns: - bool: ``True`` if the :class:`Session` stopped successfully, + ``True`` if the :class:`Session` stopped successfully, ``False`` otherwise. Stop operation of this :class:`Session` and block until all callbacks @@ -223,15 +250,14 @@ def stop(self): deadlock. Once a :class:`Session` has been stopped it can only be destroyed. """ - if sys.version_info >= (3, 6): - atexit.unregister(self.stop) + atexit.unregister(self.stop) return internals.blpapi_Session_stop(self.__handle) == 0 - def stopAsync(self): + def stopAsync(self) -> bool: """Begin the process to stop this Session and return immediately. Returns: - bool: ``True`` if the process to stop a :class:`Session` began + ``True`` if the process to stop a :class:`Session` began successfully, ``False`` otherwise. The application must monitor events for a :attr:`~Event.SESSION_STATUS` @@ -242,10 +268,10 @@ def stopAsync(self): """ return internals.blpapi_Session_stopAsync(self.__handle) == 0 - def nextEvent(self, timeout=0): + def nextEvent(self, timeout: int=0) -> Event: """ Args: - timeout (int): Timeout threshold in milliseconds + timeout: Timeout threshold in milliseconds Returns: Event: Next available event for this session @@ -268,9 +294,9 @@ def nextEvent(self, timeout=0): _ExceptionUtil.raiseOnError(retCode) - return Event(event, self) + return Event(event, {self}) - def tryNextEvent(self): + def tryNextEvent(self) -> Optional[Event]: """ Returns: Event: Next available event for this session @@ -282,16 +308,48 @@ def tryNextEvent(self): retCode, event = internals.blpapi_Session_tryNextEvent(self.__handle) if retCode: return None - return Event(event, self) + return Event(event, {self}) - def subscribe(self, subscriptionList, identity=None, requestLabel=""): + @staticmethod + def _createErrorAppender(errorList): + def errorAppender( + correlationId: CorrelationId, + subscriptionString: str, + errorCode: int, + description: str): + errorList.append( + SubscriptionPreprocessError( + correlationId, + subscriptionString, + SubscriptionPreprocessError.ErrorCode(errorCode), + description)) + + return errorAppender + + def subscribe(self, + subscriptionList: "typehints.SubscriptionList", + identity: Optional["typehints.Identity"]=None, + requestLabel: str="", + mode: SubscriptionPreprocessMode= + SubscriptionPreprocessMode.FAIL_ON_FIRST_ERROR + ) -> Optional[List["SubscriptionPreprocessError"]]: """Begin subscriptions for each entry in the specified list. Args: - subscriptionList (SubscriptionList): List of subscriptions to begin - identity (Identity): Identity used for authorization - requestLabel (str): String which will be recorded along with any + subscriptionList: List of subscriptions to begin + identity: Identity used for authorization + requestLabel: String which will be recorded along with any diagnostics for this operation + mode: Mode to use for this operation. + See :class:`SubscriptionPreprocessMode` for an explanation of + the available modes. + + Returns: + If mode is :attr:`~SubscriptionPreprocessMode.FAIL_ON_FIRST_ERROR`, + then ``None`` is returned. If mode is + :attr:`~SubscriptionPreprocessMode.RETURN_INDIVIDUAL_ERRORS`, + then a list of :class:`SubscriptionPreprocessError` is + returned. Begin subscriptions for each entry in the specified ``subscriptionList``, which must be an object of type @@ -307,17 +365,37 @@ def subscribe(self, subscriptionList, identity=None, requestLabel=""): When ``identity`` is not provided, the session identity will be used if it has been authorized. """ - _ExceptionUtil.raiseOnError(internals.blpapi_Session_subscribe( - self.__handle, - get_handle(subscriptionList), - get_handle(identity), - requestLabel)) + subMode = SubscriptionPreprocessMode(mode) + + if subMode == SubscriptionPreprocessMode.FAIL_ON_FIRST_ERROR: + _ExceptionUtil.raiseOnError(internals.blpapi_Session_subscribe( + self.__handle, + get_handle(subscriptionList), + get_handle(identity), + requestLabel)) + elif subMode == SubscriptionPreprocessMode.RETURN_INDIVIDUAL_ERRORS: + errorList = [] # type: ignore + errorAppender = Session._createErrorAppender(errorList) + _ExceptionUtil.raiseOnError( + internals.blpapi_Session_subscribeEx_helper( + self.__handle, + get_handle(subscriptionList), + get_handle(identity), + requestLabel, + errorAppender)) + + return errorList + else: + raise exception.InvalidArgumentException( + "Unsupported SubscriptionPreprocessMode: '{}'".format(mode), 0) + return None - def unsubscribe(self, subscriptionList): + def unsubscribe(self, + subscriptionList: "typehints.SubscriptionList") -> None: """Cancel subscriptions from the specified ``subscriptionList``. Args: - subscriptionList (SubscriptionList): List of subscriptions to cancel + subscriptionList: List of subscriptions to cancel Cancel each of the current subscriptions identified by the specified ``subscriptionList``, which must be an object of type @@ -346,17 +424,30 @@ def unsubscribe(self, subscriptionList): def resubscribe( self, - subscriptionList, - requestLabel="", - resubscriptionId=None): + subscriptionList: "typehints.SubscriptionList", + requestLabel: str="", + resubscriptionId: Optional[int]=None, + mode: SubscriptionPreprocessMode= + SubscriptionPreprocessMode.FAIL_ON_FIRST_ERROR + ) -> Optional[List["SubscriptionPreprocessError"]]: """Modify subscriptions in ``subscriptionList``. Args: - subscriptionList (SubscriptionList): List of subscriptions to modify - requestLabel (str): String which will be recorded along with any + subscriptionList: List of subscriptions to modify + requestLabel: String which will be recorded along with any diagnostics for this operation - resubscriptionId (int): An id that will be included in the event + resubscriptionId: An id that will be included in the event generated from this operation + mode: Mode to use for this operation. + See :class:`SubscriptionPreprocessMode` for an explanation of + the available modes. + + Returns: + If mode is :attr:`~SubscriptionPreprocessMode.FAIL_ON_FIRST_ERROR`, + then ``None`` is returned. If mode is + :attr:`~SubscriptionPreprocessMode.RETURN_INDIVIDUAL_ERRORS`, + then a list of :class:`SubscriptionPreprocessError` is + returned. Modify each subscription in the specified ``subscriptionList``, which must be an object of type :class:`SubscriptionList`, to reflect the @@ -373,31 +464,63 @@ def resubscribe( correlation ID of an entry in the ``subscriptionList`` does not identify a current subscription then that entry is ignored. """ - error = None - if resubscriptionId is None: - error = internals.blpapi_Session_resubscribe( - self.__handle, - get_handle(subscriptionList), - requestLabel) + subMode = SubscriptionPreprocessMode(mode) + + if subMode == SubscriptionPreprocessMode.FAIL_ON_FIRST_ERROR: + if resubscriptionId is None: + _ExceptionUtil.raiseOnError( + internals.blpapi_Session_resubscribe( + self.__handle, + get_handle(subscriptionList), + requestLabel)) + else: + _ExceptionUtil.raiseOnError( + internals.blpapi_Session_resubscribeWithId( + self.__handle, + get_handle(subscriptionList), + resubscriptionId, # an int, not a cid + requestLabel)) + elif subMode == SubscriptionPreprocessMode.RETURN_INDIVIDUAL_ERRORS: + errorList = [] # type: ignore + errorAppender = Session._createErrorAppender(errorList) + + if resubscriptionId is None: + _ExceptionUtil.raiseOnError( + internals.blpapi_Session_resubscribeEx_helper( + self.__handle, + get_handle(subscriptionList), + requestLabel, + errorAppender)) + else: + _ExceptionUtil.raiseOnError( + internals.blpapi_Session_resubscribeWithIdEx_helper( + self.__handle, + get_handle(subscriptionList), + resubscriptionId, # an int, not a cid + requestLabel, + errorAppender)) + + return errorList else: - error = internals.blpapi_Session_resubscribeWithId( - self.__handle, - get_handle(subscriptionList), - resubscriptionId, # an int, not a cid - requestLabel) + raise exception.InvalidArgumentException( + "Unsupported SubscriptionPreprocessMode: '{}'".format(mode), 0) + return None - _ExceptionUtil.raiseOnError(error) - def setStatusCorrelationId(self, service, correlationId, identity=None): + def setStatusCorrelationId( + self, + service: "typehints.Service", + correlationId: CorrelationId, + identity: Optional["typehints.Identity"]=None) -> None: """Set the Correlation id on which service status messages will be received. Args: - service (Service): The service from which the status messages + service: The service from which the status messages are received - correlationId (CorrelationId): Correlation id to associate with the + correlationId: Correlation id to associate with the service status messages - identity (Identity): Identity used for authorization + identity: Identity used for authorization Note: No service status messages are received prior to this call @@ -407,24 +530,24 @@ def setStatusCorrelationId(self, service, correlationId, identity=None): self.__handle, get_handle(service), get_handle(identity), - get_handle(correlationId))) + correlationId)) def sendRequest(self, - request, - identity=None, - correlationId=None, - eventQueue=None, - requestLabel=""): + request: "typehints.Request", + identity: Optional["typehints.Identity"]=None, + correlationId: Optional[CorrelationId]=None, + eventQueue: Optional["typehints.EventQueue"]=None, + requestLabel: str="") -> CorrelationId: """Send the specified ``request``. Args: - request (Request): Request to send - identity (Identity): Identity used for authorization - correlationId (CorrelationId): Correlation id to associate with the + request: Request to send + identity: Identity used for authorization + correlationId: Correlation id to associate with the request - eventQueue (EventQueue): Event queue on which the events related to + eventQueue: Event queue on which the events related to this operation will arrive - requestLabel (str): String which will be recorded along with any + requestLabel: String which will be recorded along with any diagnostics for this operation Returns: @@ -459,7 +582,7 @@ def sendRequest(self, res = internals.blpapi_Session_sendRequest( self.__handle, get_handle(request), - get_handle(correlationId), + correlationId, get_handle(identity), get_handle(eventQueue), requestLabel) @@ -468,13 +591,17 @@ def sendRequest(self, eventQueue._registerSession(self) return correlationId - def sendRequestTemplate(self, requestTemplate, correlationId=None): + def sendRequestTemplate( + self, + requestTemplate: RequestTemplate, + correlationId: Optional[CorrelationId]=None + ) -> CorrelationId: """Send a request defined by the specified ``requestTemplate``. Args: - requestTemplate (RequestTemplate): Template that defines the + requestTemplate: Template that defines the request - correlationId (CorrelationId): Correlation id to associate with the + correlationId: Correlation id to associate with the request Returns: @@ -498,24 +625,25 @@ def sendRequestTemplate(self, requestTemplate, correlationId=None): res = internals.blpapi_Session_sendRequestTemplate( self.__handle, get_handle(requestTemplate), - get_handle(correlationId)) + correlationId) _ExceptionUtil.raiseOnError(res) return correlationId def createSnapshotRequestTemplate( self, - subscriptionString, - correlationId, - identity=None): + subscriptionString: str, + correlationId: CorrelationId, + identity: Optional["typehints.Identity"]=None + ) -> RequestTemplate: """Create a snapshot request template for getting subscription data specified by the ``subscriptionString`` using the specified ``identity``. Args: - subscriptionString (str): String that specifies the subscription - correlationId (CorrelationId): Correlation id to associate with + subscriptionString: String that specifies the subscription + correlationId: Correlation id to associate with events generated by this operation - identity (Identity): Identity used for authorization. + identity: Optional. Identity used for authorization. Returns: RequestTemplate: Created request template @@ -603,11 +731,45 @@ def createSnapshotRequestTemplate( self.__handle, subscriptionString, get_handle(identityArg), - get_handle(cidArg)) + cidArg) _ExceptionUtil.raiseOnError(rc) reqTemplate = RequestTemplate(template) return reqTemplate + +class SubscriptionPreprocessError(NamedTuple): + """Class representing an error due to an invalid subscription.""" + + class ErrorCode(Enum): # type: ignore + """The error codes used by :class:`SubscriptionPreprocessError`.""" + + SUBSCRIPTIONPREPROCESS_INVALID_SUBSCRIPTION_STRING = \ + internals.SUBSCRIPTIONPREPROCESS_INVALID_SUBSCRIPTION_STRING + """Error due to an invalid subscription string.""" + + SUBSCRIPTIONPREPROCESS_CORRELATIONID_ERROR = \ + internals.SUBSCRIPTIONPREPROCESS_CORRELATIONID_ERROR + """Error due to misuse of correlation id, such as using a duplicate.""" + + correlationId: CorrelationId + """:class:`CorrelationId` of the subscription.""" + + subscriptionString: str + """The subscription string.""" + + errorCode: ErrorCode # type: ignore + """Error code representing the error.""" + + description: str + """Description of the error.""" + + def __str__(self) -> str: + return (f"{{correlationId: {self.correlationId}" + f", subscriptionString: {self.subscriptionString}" + f", code: {self.errorCode}" + f", description: {self.description}}}") + + __copyright__ = """ Copyright 2012. Bloomberg Finance L.P. diff --git a/src/blpapi/sessionoptions.py b/src/blpapi/sessionoptions.py index a36d694..c18c382 100644 --- a/src/blpapi/sessionoptions.py +++ b/src/blpapi/sessionoptions.py @@ -20,20 +20,20 @@ """ -from __future__ import absolute_import +from typing import Iterator, Optional, Sequence, Tuple, Union +from .typehints import BlpapiTlsOptionsHandle from .exception import _ExceptionUtil from . import AuthOptions from . import CorrelationId from . import internals from . import utils from .utils import get_handle -from .compat import with_metaclass from .chandle import CHandle +from . import typehints # pylint: disable=unused-import -# pylint: disable=too-many-public-methods -@with_metaclass(utils.MetaClassForClassesWithEnums) -class SessionOptions(CHandle): +# pylint: disable=too-many-public-methods +class SessionOptions(CHandle, metaclass=utils.MetaClassForClassesWithEnums): """Options which the user can specify when creating a session. To use non-default options on a :class:`Session`, create a @@ -44,14 +44,14 @@ class SessionOptions(CHandle): the API. """ - AUTO = internals.CLIENTMODE_AUTO + AUTO = internals.CLIENTMODE_AUTO # type: ignore """Automatic (desktop if available otherwise server)""" - DAPI = internals.CLIENTMODE_DAPI + DAPI = internals.CLIENTMODE_DAPI # type: ignore """Always connect to the desktop API""" - SAPI = internals.CLIENTMODE_SAPI + SAPI = internals.CLIENTMODE_SAPI # type: ignore """Always connect to the server API""" - def __init__(self): + def __init__(self) -> None: """Create a :class:`SessionOptions` with all options set to the defaults""" selfhandle = internals.blpapi_SessionOptions_create() @@ -60,7 +60,7 @@ def __init__(self): internals.blpapi_SessionOptions_destroy) self.__handle = selfhandle - def __str__(self): + def __str__(self) -> str: """x.__str__() <==> str(x) Return a string representation of this SessionOptions. Call of @@ -70,11 +70,11 @@ def __str__(self): """ return self.toString() - def setServerHost(self, serverHost): + def setServerHost(self, serverHost: str) -> None: """Set the API server host to connect to when using the server API. Args: - serverHost (str): Server host + serverHost: Server host Set the API server host to connect to when using the server API to the specified ``serverHost``. The server host is either a hostname or an @@ -85,11 +85,11 @@ def setServerHost(self, serverHost): internals.blpapi_SessionOptions_setServerHost(self.__handle, serverHost)) - def setServerPort(self, serverPort): + def setServerPort(self, serverPort: int) -> None: """Set the port to connect to when using the server API. Args: - serverPort (int): Server port + serverPort: Server port Set the port to connect to when using the server API to the specified ``serverPort``. The default is ``8194``. @@ -99,13 +99,13 @@ def setServerPort(self, serverPort): internals.blpapi_SessionOptions_setServerPort(self.__handle, serverPort)) - def setServerAddress(self, serverHost, serverPort, index): + def setServerAddress(self, serverHost: str, serverPort: int, index: int) -> None: """Set the server address at the specified ``index``. Args: - serverHost (str): Server host - serverPort (int): Server port - index (int): Index to set the address at + serverHost: Server host + serverPort: Server port + index: Index to set the address at Set the server address at the specified ``index`` using the specified ``serverHost`` and ``serverPort``. @@ -117,22 +117,22 @@ def setServerAddress(self, serverHost, serverPort, index): serverPort, index)) - def removeServerAddress(self, index): + def removeServerAddress(self, index: int) -> None: """Remove the server address at the specified ``index``. Args: - index (int): Index to remove the address at + index: Index to remove the address at """ _ExceptionUtil.raiseOnError( internals.blpapi_SessionOptions_removeServerAddress(self.__handle, index)) - def setConnectTimeout(self, timeoutMilliSeconds): + def setConnectTimeout(self, timeoutMilliSeconds: int) -> None: """Set the connection timeout in milliseconds. Args: - timeoutMilliSeconds (int): Timeout threshold in milliseconds + timeoutMilliSeconds: Timeout threshold in milliseconds Set the connection timeout in milliseconds when connecting to the API. The default is ``5000`` milliseconds. Behavior is not defined unless @@ -145,11 +145,11 @@ def setConnectTimeout(self, timeoutMilliSeconds): self.__handle, timeoutMilliSeconds)) - def setDefaultServices(self, defaultServices): + def setDefaultServices(self, defaultServices: Sequence[str]) -> None: """Set the default service for the session. Args: - defaultServices ([str]): The default services + defaultServices: The default services **DEPRECATED** @@ -162,11 +162,11 @@ def setDefaultServices(self, defaultServices): self.__handle, defaultServices)) - def setDefaultSubscriptionService(self, defaultSubscriptionService): + def setDefaultSubscriptionService(self, defaultSubscriptionService: str) -> None: """Set the default service for subscriptions. Args: - defaultSubscriptionService (str): Identifier for the service to be + defaultSubscriptionService: Identifier for the service to be used as default Set the default service for subscriptions which do not specify a @@ -181,11 +181,11 @@ def setDefaultSubscriptionService(self, defaultSubscriptionService): self.__handle, defaultSubscriptionService)) - def setDefaultTopicPrefix(self, prefix): + def setDefaultTopicPrefix(self, prefix: str) -> None: """Set the default topic prefix. Args: - prefix (str): The topic prefix to set + prefix: The topic prefix to set Set the default topic prefix to be used when a subscription does not specify a prefix to the specified ``prefix``. The default is @@ -197,12 +197,12 @@ def setDefaultTopicPrefix(self, prefix): prefix) def setAllowMultipleCorrelatorsPerMsg(self, - allowMultipleCorrelatorsPerMsg): + allowMultipleCorrelatorsPerMsg: bool) -> None: """Associate more than one :class:`CorrelationId` with a :class:`Message`. Args: - allowMultipleCorrelatorsPerMsg (bool): Value to set the option to + allowMultipleCorrelatorsPerMsg: Value to set the option to Set whether the :class:`Session` is allowed to associate more than one :class:`CorrelationId` with a :class:`Message` to the specified @@ -219,11 +219,11 @@ def setAllowMultipleCorrelatorsPerMsg(self, self.__handle, allowMultipleCorrelatorsPerMsg) - def setClientMode(self, clientMode): + def setClientMode(self, clientMode: int) -> None: """Set how to connect to the API. The default is :attr:`AUTO`. Args: - clientMode (int): The client mode + clientMode: The client mode Set how to connect to the API. The default is :attr:`AUTO` which will try to connect to the desktop API but fall back to the server API if @@ -235,11 +235,11 @@ def setClientMode(self, clientMode): internals.blpapi_SessionOptions_setClientMode(self.__handle, clientMode) - def setMaxPendingRequests(self, maxPendingRequests): + def setMaxPendingRequests(self, maxPendingRequests: int) -> None: """Set the maximum number of requests which can be pending. Args: - maxPendingRequests (int): Maximum number of pending requests + maxPendingRequests: Maximum number of pending requests Set the maximum number of requests which can be pending to the specified ``maxPendingRequests``. The default is ``1024``. @@ -250,16 +250,17 @@ def setMaxPendingRequests(self, maxPendingRequests): maxPendingRequests) def setSessionIdentityOptions(self, - authOptions, - correlationId=None): + authOptions: AuthOptions, + correlationId: Optional[CorrelationId] = None + ) -> CorrelationId: """Sets the specified ``authOptions`` as the :class:`AuthOptions` for the session identity, enabling automatic authorization of the session identity during startup. Args: - authOptions (AuthOptions): the authorization options to use for the + authOptions: the authorization options to use for the session identity. - correlationId (CorrelationId): Optional. Used to identify the + correlationId: Optional. Used to identify the messages associated with the session identity. Returns: @@ -293,21 +294,21 @@ def setSessionIdentityOptions(self, retcode = internals.blpapi_SessionOptions_setSessionIdentityOptions( self._handle(), get_handle(authOptions), - get_handle(correlationId)) + correlationId) _ExceptionUtil.raiseOnError(retcode) return correlationId - def setAuthenticationOptions(self, authOptions): + def setAuthenticationOptions(self, authOptions: str) -> None: """Set the specified ``authOptions`` as the authentication options. Args: - authOptions (str): The options used during authentication. + authOptions: The options used during authentication. """ internals.blpapi_SessionOptions_setAuthenticationOptions( self.__handle, authOptions) - def setNumStartAttempts(self, numStartAttempts): + def setNumStartAttempts(self, numStartAttempts: int) -> None: """Set the maximum number of attempts to start a session. Set the maximum number of attempts to start a session by connecting a @@ -316,7 +317,7 @@ def setNumStartAttempts(self, numStartAttempts): internals.blpapi_SessionOptions_setNumStartAttempts(self.__handle, numStartAttempts) - def setAutoRestartOnDisconnection(self, autoRestart): + def setAutoRestartOnDisconnection(self, autoRestart: bool) -> None: """Set whether automatically restarting connection if disconnected. Args: @@ -327,11 +328,11 @@ def setAutoRestartOnDisconnection(self, autoRestart): self.__handle, autoRestart) - def setSlowConsumerWarningHiWaterMark(self, hiWaterMark): + def setSlowConsumerWarningHiWaterMark(self, hiWaterMark: float) -> None: """Set the point at which "slow consumer" events will be generated. Args: - hiWaterMark (float): Fraction of :meth:`maxEventQueueSize()` + hiWaterMark: Fraction of :meth:`maxEventQueueSize()` Set the point at which "slow consumer" events will be generated, using the specified ``hiWaterMark`` as a fraction of @@ -348,12 +349,12 @@ def setSlowConsumerWarningHiWaterMark(self, hiWaterMark): self.__handle, hiWaterMark) _ExceptionUtil.raiseOnError(err) - def setSlowConsumerWarningLoWaterMark(self, loWaterMark): + def setSlowConsumerWarningLoWaterMark(self, loWaterMark: float) -> None: """Set the point at which "slow consumer cleared" events will be generated Args: - loWaterMark (float): Fraction of :meth:`maxEventQueueSize()` + loWaterMark: Fraction of :meth:`maxEventQueueSize()` Set the point at which "slow consumer cleared" events will be generated, using the specified ``loWaterMark`` as a fraction of @@ -370,12 +371,12 @@ def setSlowConsumerWarningLoWaterMark(self, loWaterMark): self.__handle, loWaterMark) _ExceptionUtil.raiseOnError(err) - def setMaxEventQueueSize(self, eventQueueSize): + def setMaxEventQueueSize(self, eventQueueSize: int) -> None: """Set the maximum number of outstanding undelivered events per session. Args: - eventQueueSize (int): Maximum number of outstanding undelivered + eventQueueSize: Maximum number of outstanding undelivered events Set the maximum number of outstanding undelivered events per session to @@ -388,11 +389,11 @@ def setMaxEventQueueSize(self, eventQueueSize): self.__handle, eventQueueSize) - def setKeepAliveEnabled(self, isEnabled): + def setKeepAliveEnabled(self, isEnabled: bool) -> None: """Set whether to enable keep-alive pings. Args: - isEnabled (bool): Whether to enable keep-alive pings + isEnabled: Whether to enable keep-alive pings If the specified ``isEnabled`` is ``False``, then disable all keep-alive mechanisms, both from the client to the server and from the @@ -408,7 +409,7 @@ def setKeepAliveEnabled(self, isEnabled): self.__handle, keepAliveValue) _ExceptionUtil.raiseOnError(err) - def setDefaultKeepAliveInactivityTime(self, inactivityMsecs): + def setDefaultKeepAliveInactivityTime(self, inactivityMsecs: int) -> None: """Set the amount of time that no traffic can be received before the keep-alive mechanism is triggered. @@ -432,11 +433,11 @@ def setDefaultKeepAliveInactivityTime(self, inactivityMsecs): self.__handle, inactivityMsecs) _ExceptionUtil.raiseOnError(err) - def setDefaultKeepAliveResponseTimeout(self, timeoutMsecs): + def setDefaultKeepAliveResponseTimeout(self, timeoutMsecs: int) -> None: """Set the timeout for terminating the connection due to inactivity. Args: - timeoutMsecs (int): Timeout threshold in milliseconds + timeoutMsecs: Timeout threshold in milliseconds When a keep-alive ping is sent, wait for the specified ``timeoutMsecs`` to receive traffic (of any kind) before terminating the connection due @@ -453,10 +454,10 @@ def setDefaultKeepAliveResponseTimeout(self, timeoutMsecs): self.__handle, timeoutMsecs) _ExceptionUtil.raiseOnError(err) - def setFlushPublishedEventsTimeout(self, timeoutMsecs): + def setFlushPublishedEventsTimeout(self, timeoutMsecs: int) -> None: """ Args: - timeoutMsecs (int): Timeout threshold in milliseconds + timeoutMsecs: Timeout threshold in milliseconds Set the timeout, in milliseconds, for :class:`ProviderSession` to flush published events before stopping. The behavior is not defined unless @@ -466,10 +467,10 @@ def setFlushPublishedEventsTimeout(self, timeoutMsecs): internals.blpapi_SessionOptions_setFlushPublishedEventsTimeout( self.__handle, timeoutMsecs) - def setRecordSubscriptionDataReceiveTimes(self, shouldRecord): + def setRecordSubscriptionDataReceiveTimes(self, shouldRecord: bool) -> None: """ Args: - shouldRecord (bool): Whether to record the receipt time + shouldRecord: Whether to record the receipt time Set whether the receipt time (accessed via :meth:`.Message.timeReceived()`) should be recorded for subscription @@ -479,10 +480,10 @@ def setRecordSubscriptionDataReceiveTimes(self, shouldRecord): internals.blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes( self.__handle, shouldRecord) - def setServiceCheckTimeout(self, timeoutMsecs): + def setServiceCheckTimeout(self, timeoutMsecs: int) -> None: """ Args: - timeoutMsecs (int): Timeout threshold in milliseconds + timeoutMsecs: Timeout threshold in milliseconds Set the timeout, in milliseconds, when opening a service for checking what version of the schema should be downloaded. The behavior is not @@ -493,10 +494,10 @@ def setServiceCheckTimeout(self, timeoutMsecs): self.__handle, timeoutMsecs) _ExceptionUtil.raiseOnError(err) - def setServiceDownloadTimeout(self, timeoutMsecs): + def setServiceDownloadTimeout(self, timeoutMsecs: int) -> None: """ Args: - timeoutMsecs (int): Timeout threshold in milliseconds + timeoutMsecs: Timeout threshold in milliseconds Set the timeout, in milliseconds, when opening a service for downloading the service schema. The behavior is not defined unless the @@ -507,57 +508,56 @@ def setServiceDownloadTimeout(self, timeoutMsecs): self.__handle, timeoutMsecs) _ExceptionUtil.raiseOnError(err) - def setTlsOptions(self, tlsOptions): + def setTlsOptions(self, tlsOptions: "TlsOptions") -> None: """Set the TLS options Args: - tlsOptions (TlsOptions): The TLS options + tlsOptions: The TLS options """ internals.blpapi_SessionOptions_setTlsOptions( self.__handle, get_handle(tlsOptions)) - def setBandwidthSaveModeDisabled(self, isDisabled): + def setBandwidthSaveModeDisabled(self, isDisabled: bool) -> None: """Specify whether to disable bandwidth saving measures. Args: - isDisabled (bool): Whether to disable bandwidth saving measures. + isDisabled: Whether to disable bandwidth saving measures. """ _ExceptionUtil.raiseOnError( internals.blpapi_SessionOptions_setBandwidthSaveModeDisabled( self.__handle, isDisabled)) - def serverHost(self): + def serverHost(self) -> str: """ Returns: - str: The server host option in this :class:`SessionOptions` - instance. + The server host option in this :class:`SessionOptions` instance. """ return internals.blpapi_SessionOptions_serverHost(self.__handle) - def serverPort(self): + def serverPort(self) -> int: """ Returns: - int: The server port that this session connects to. + The server port that this session connects to. """ return internals.blpapi_SessionOptions_serverPort(self.__handle) - def numServerAddresses(self): + def numServerAddresses(self) -> int: """ Returns: - int: The number of server addresses. + The number of server addresses. """ return internals.blpapi_SessionOptions_numServerAddresses( self.__handle) - def getServerAddress(self, index): + def getServerAddress(self, index: int) -> Tuple[str, int]: """ Returns: - (str, int): Server name and port indexed by ``index``. + Server name and port indexed by ``index``. """ errorCode, host, port = \ @@ -569,7 +569,7 @@ def getServerAddress(self, index): return host, port - def serverAddresses(self): + def serverAddresses(self) -> Iterator: """ Returns: Iterator over server addresses for this :class:`SessionOptions`. @@ -579,197 +579,198 @@ def serverAddresses(self): SessionOptions.numServerAddresses, SessionOptions.getServerAddress) - def connectTimeout(self): + def connectTimeout(self) -> int: """ Returns: - int: The value of the connection timeout option. + The value of the connection timeout option. """ return internals.blpapi_SessionOptions_connectTimeout(self.__handle) - def defaultServices(self): + def defaultServices(self) -> str: """ Returns: - str: All default services in one string. + All default services in one string, separated by `;`. """ return internals.blpapi_SessionOptions_defaultServices(self.__handle) - def defaultSubscriptionService(self): + def defaultSubscriptionService(self) -> str: """ Returns: - str: The default subscription service. + The default subscription service. """ return internals.blpapi_SessionOptions_defaultSubscriptionService( self.__handle) - def defaultTopicPrefix(self): + def defaultTopicPrefix(self) -> str: """ Returns: - str: The default topic prefix. + The default topic prefix. """ return internals.blpapi_SessionOptions_defaultTopicPrefix( self.__handle) - def allowMultipleCorrelatorsPerMsg(self): + def allowMultipleCorrelatorsPerMsg(self) -> bool: """ Returns: - bool: The value of the allow multiple correlators per message + The value of the allow multiple correlators per message option. """ return internals.blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg( self.__handle) != 0 - def clientMode(self): + def clientMode(self) -> int: """ Returns: - int: The value of the client mode option. + The value of the client mode option. """ return internals.blpapi_SessionOptions_clientMode(self.__handle) - def maxPendingRequests(self): + def maxPendingRequests(self) -> int: """ Returns: - int: The value of the maximum pending request option. + The value of the maximum pending request option. """ return internals.blpapi_SessionOptions_maxPendingRequests( self.__handle) - def autoRestartOnDisconnection(self): + def autoRestartOnDisconnection(self) -> bool: """ Returns: - bool: Whether automatically restart connection if disconnected. + Whether automatically restart connection if disconnected. """ return internals.blpapi_SessionOptions_autoRestartOnDisconnection( self.__handle) != 0 - def authenticationOptions(self): + def authenticationOptions(self) -> str: """ Returns: - str: Authentication options in a string. + Authentication options in a string. """ return internals.blpapi_SessionOptions_authenticationOptions( self.__handle) - def numStartAttempts(self): + def numStartAttempts(self) -> int: """ Returns: - int: The maximum number of attempts to start a session. + The maximum number of attempts to start a session. """ return internals.blpapi_SessionOptions_numStartAttempts(self.__handle) - def recordSubscriptionDataReceiveTimes(self): + def recordSubscriptionDataReceiveTimes(self) -> bool: """ Returns: - bool: Whether the receipt time (accessed via + Whether the receipt time (accessed via :meth:`Message.timeReceived()`) should be recorded for subscription data messages. """ - return internals.blpapi_SessionOptions_recordSubscriptionDataReceiveTimes( - self.__handle) + return bool(internals.blpapi_SessionOptions_recordSubscriptionDataReceiveTimes( + self.__handle)) - def slowConsumerWarningHiWaterMark(self): + def slowConsumerWarningHiWaterMark(self) -> float: """ Returns: - float: The fraction of :meth:`maxEventQueueSize()` at which "slow + The fraction of :meth:`maxEventQueueSize()` at which "slow consumer" event will be generated. """ return internals.blpapi_SessionOptions_slowConsumerWarningHiWaterMark( self.__handle) - def slowConsumerWarningLoWaterMark(self): + def slowConsumerWarningLoWaterMark(self) -> float: """ Returns: - float: The fraction of :meth:`maxEventQueueSize()` at which "slow + The fraction of :meth:`maxEventQueueSize()` at which "slow consumer cleared" event will be generated. """ return internals.blpapi_SessionOptions_slowConsumerWarningLoWaterMark( self.__handle) - def maxEventQueueSize(self): + def maxEventQueueSize(self) -> int: """ Returns: - int: The value of maximum outstanding undelivered events that the + The value of maximum outstanding undelivered events that the session is configured with. """ return internals.blpapi_SessionOptions_maxEventQueueSize(self.__handle) - def defaultKeepAliveInactivityTime(self): + def defaultKeepAliveInactivityTime(self) -> int: """ Returns: - int: The interval (in milliseconds) a connection has to remain + The interval (in milliseconds) a connection has to remain inactive (receive no data) before a keep alive probe will be sent. """ return internals.blpapi_SessionOptions_defaultKeepAliveInactivityTime( self.__handle) - def defaultKeepAliveResponseTimeout(self): + def defaultKeepAliveResponseTimeout(self) -> int: """ Returns: - int: The time (in milliseconds) the library will wait for response + The time (in milliseconds) the library will wait for response to a keep alive probe before declaring it lost. """ return internals.blpapi_SessionOptions_defaultKeepAliveResponseTimeout( self.__handle) - def flushPublishedEventsTimeout(self): + def flushPublishedEventsTimeout(self) -> int: """ Returns: - int: The timeout, in milliseconds, for :class:`ProviderSession` to + The timeout, in milliseconds, for :class:`ProviderSession` to flush published events before stopping. The default value is ``2000``. """ return internals.blpapi_SessionOptions_flushPublishedEventsTimeout( self.__handle) - def keepAliveEnabled(self): + def keepAliveEnabled(self) -> bool: """ Returns: - bool: ``True`` if the keep-alive mechanism is enabled; otherwise + ``True`` if the keep-alive mechanism is enabled; otherwise return ``False``. """ - return internals.blpapi_SessionOptions_keepAliveEnabled(self.__handle) + return bool( + internals.blpapi_SessionOptions_keepAliveEnabled(self.__handle)) - def serviceCheckTimeout(self): + def serviceCheckTimeout(self) -> int: """ Returns: - int: The value of the service check timeout option in this + The value of the service check timeout option in this :class:`SessionOptions` instance in milliseconds. """ return internals.blpapi_SessionOptions_serviceCheckTimeout( self.__handle) - def serviceDownloadTimeout(self): + def serviceDownloadTimeout(self) -> int: """ Returns: - int: The value of the service download timeout option in this + The value of the service download timeout option in this :class:`SessionOptions` instance in milliseconds. """ return internals.blpapi_SessionOptions_serviceDownloadTimeout( self.__handle) - def bandwidthSaveModeDisabled(self): + def bandwidthSaveModeDisabled(self) -> bool: """ Returns: - bool: Whether bandwidth saving measures are disabled. + Whether bandwidth saving measures are disabled. """ return bool(internals.blpapi_SessionOptions_bandwidthSaveModeDisabled( self.__handle)) - def toString(self, level=0, spacesPerLevel=4): + def toString(self, level: int = 0, spacesPerLevel: int = 4) -> str: """Format this :class:`SessionOptions` to the string. Args: - level (int): Indentation level - spacesPerLevel (int): Number of spaces per indentation level for + level: Indentation level + spacesPerLevel: Number of spaces per indentation level for this and all nested objects Returns: - str: This object formatted as a string + This object formatted as a string If ``level`` is negative, suppress indentation of the first line. If ``spacesPerLevel`` is negative, format the entire output on one line, @@ -795,15 +796,15 @@ class TlsOptions(CHandle): PKCS#12 format and the DER encoded trusted material in PKCS#7 format. """ - def __init__(self, handle): + def __init__(self, handle: BlpapiTlsOptionsHandle) -> None: super(TlsOptions, self).__init__( handle, internals.blpapi_TlsOptions_destroy) self.__handle = handle - def setTlsHandshakeTimeoutMs(self, timeoutMs): + def setTlsHandshakeTimeoutMs(self, timeoutMs: int) -> None: """ Args: - timeoutMs (int): Timeout threshold in milliseconds + timeoutMs: Timeout threshold in milliseconds Set the TLS handshake timeout to the specified ``timeoutMs``. The default is ``10,000`` milliseconds. The TLS handshake timeout will be @@ -811,10 +812,10 @@ def setTlsHandshakeTimeoutMs(self, timeoutMs): """ internals.blpapi_TlsOptions_setTlsHandshakeTimeoutMs(self.__handle, timeoutMs) - def setCrlFetchTimeoutMs(self, timeoutMs): + def setCrlFetchTimeoutMs(self, timeoutMs: int) -> None: """ Args: - timeoutMs (int): Timeout threshold in milliseconds + timeoutMs: Timeout threshold in milliseconds Set the CRL fetch timeout to the specified ``timeoutMs``. The default is ``20,000`` milliseconds. The TLS handshake timeout will be set to @@ -824,15 +825,15 @@ def setCrlFetchTimeoutMs(self, timeoutMs): self.__handle, timeoutMs) @staticmethod - def createFromFiles(clientCredentialsFilename, - clientCredentialsPassword, - trustedCertificatesFilename): + def createFromFiles(clientCredentialsFilename: str, + clientCredentialsPassword: str, + trustedCertificatesFilename: str) -> "TlsOptions": """ Args: - clientCredentialsFilename (str): Path to the file with the client + clientCredentialsFilename: Path to the file with the client credentials - clientCredentialsPassword (str): Password for the credentials - trustedCertificatesFilename (str): Path to the file with the + clientCredentialsPassword: Password for the credentials + trustedCertificatesFilename: Path to the file with the trusted certificates Creates a :class:`TlsOptions` using a DER encoded client credentials in @@ -846,15 +847,15 @@ def createFromFiles(clientCredentialsFilename, return TlsOptions(handle) @staticmethod - def createFromBlobs(clientCredentials, - clientCredentialsPassword, - trustedCertificates): + def createFromBlobs(clientCredentials: Union[bytes, bytearray], + clientCredentialsPassword: str, + trustedCertificates: Union[bytes, bytearray]) -> "TlsOptions": """ Args: - clientCredentials (bytes or bytearray): Blob with the client + clientCredentials: Blob with the client credentials - clientCredentialsPassword (str): Password for the credentials - trustedCertificates (bytes or bytearray): Blob with the trusted + clientCredentialsPassword: Password for the credentials + trustedCertificates: Blob with the trusted certificates Creates a :class:`TlsOptions` using a DER encoded client credentials in diff --git a/src/blpapi/subscriptionlist.py b/src/blpapi/subscriptionlist.py index 1a04cc7..35df6ec 100644 --- a/src/blpapi/subscriptionlist.py +++ b/src/blpapi/subscriptionlist.py @@ -82,13 +82,14 @@ """ from __future__ import absolute_import +from typing import Mapping, Optional, Sequence, Union from .exception import _ExceptionUtil from . import internals from .internals import CorrelationId -from .compat import conv2str, isstr -from .utils import get_handle +from .utils import conv2str, get_handle, isstr from .chandle import CHandle +from . import typehints # pylint: disable=unused-import class SubscriptionList(CHandle): @@ -133,7 +134,7 @@ class SubscriptionList(CHandle): | | | | needs to be canceled. | +-------------+--------------------------+----------------------------+ """ - def __init__(self): + def __init__(self) -> None: """Create an empty :class:`SubscriptionList`.""" selfhandle = internals.blpapi_SubscriptionList_create() super(SubscriptionList, self).__init__( @@ -141,15 +142,17 @@ def __init__(self): internals.blpapi_SubscriptionList_destroy) self.__handle = selfhandle - def add(self, topic, fields=None, options=None, correlationId=None): + def add(self, topic: str, + fields: Union[str, Sequence[str], None] = None, + options: Union[str, Sequence[str], Mapping, None] = None, + correlationId: Optional[CorrelationId] = None) -> int: """Add the specified ``topic`` to this :class:`SubscriptionList`. Args: - topic (str): The topic to subscribe to - fields (str or [str]): List of fields to subscribe to - options (str or [str] or dict): List of options - correlationId (CorrelationId): Correlation id to associate with the - subscription + topic: The topic to subscribe to + fields: List of fields to subscribe to + options: List of options + correlationId: Correlation id to associate with the subscription Add the specified ``topic``, with the optionally specified ``fields`` and the ``options`` to this :class:`SubscriptionList`, associating the @@ -169,56 +172,56 @@ def add(self, topic, fields=None, options=None, correlationId=None): if fields is not None: if isstr(fields): - fields = conv2str(fields) + fields = conv2str(fields) # type: ignore # the isstr() check means fields must be string by this point else: fields = ",".join(fields) if options is not None: if isstr(options): - options = conv2str(options) + options = conv2str(options) # type: ignore # the isstr() check means options must be string by this point elif isinstance(options, (list, tuple)): options = "&".join(options) elif isinstance(options, dict): options = "&".join([key if val is None - else "{0}={1}".format(key, val) + else f"{key}={val}" for key, val in options.items()]) return internals.blpapi_SubscriptionList_addHelper( self.__handle, topic, - get_handle(correlationId), + correlationId, fields, options) - def append(self, other): + def append(self, other: "typehints.SubscriptionList") -> int: """Append a copy of the specified :class:`SubscriptionList` to this list. Args: - other (SubscriptionList): List to append to this one + other: List to append to this one """ return internals.blpapi_SubscriptionList_append( self.__handle, get_handle(other)) - def clear(self): + def clear(self) -> int: """Remove all entries from this object.""" return internals.blpapi_SubscriptionList_clear(self.__handle) - def size(self): + def size(self) -> int: """ Returns: - int: The number of subscriptions in this object. + The number of subscriptions in this object. """ return internals.blpapi_SubscriptionList_size(self.__handle) - def correlationIdAt(self, index): + def correlationIdAt(self, index: int) -> CorrelationId: """ Args: - index (int): Index of the entry in the list + index: Index of the entry in the list Returns: - CorrelationId: Correlation id of the ``index``\ th entry. + Correlation id of the ``index``\ th entry. Raises: Exception: If ``index >= size()``. @@ -229,13 +232,13 @@ def correlationIdAt(self, index): _ExceptionUtil.raiseOnError(errorCode) return cid - def topicStringAt(self, index): + def topicStringAt(self, index: int) -> str: """ Args: - index (int): Index of the entry in the list + index: Index of the entry in the list Returns: - str: The full topic string at the specified ``index``. + The full topic string at the specified ``index``. Raises: Exception: If ``index >= size()``. @@ -246,11 +249,12 @@ def topicStringAt(self, index): _ExceptionUtil.raiseOnError(errorCode) return topic - def addResolved(self, subscriptionString, correlationId=None): + def addResolved(self, subscriptionString: str, + correlationId: Optional[CorrelationId] = None) -> int: """ Args: - subscriptionString (str): Fully-resolved subscription string - correlationId (CorrelationId): Correlation id to associate with the + subscriptionString: Fully-resolved subscription string + correlationId: Correlation id to associate with the subscription Add the specified ``subscriptionString`` to this @@ -270,15 +274,15 @@ def addResolved(self, subscriptionString, correlationId=None): if correlationId is None: correlationId = internals.CorrelationId() return internals.blpapi_SubscriptionList_addResolved( - self.__handle, subscriptionString, get_handle(correlationId)) + self.__handle, subscriptionString, correlationId) - def isResolvedTopicAt(self, index): + def isResolvedTopicAt(self, index: int) -> bool: """ Args: - index (int): Index of the entry in the list + index: Index of the entry in the list Returns: - bool: ``True`` if the ``index``\ th entry in this + ``True`` if the ``index``\ th entry in this ``SubscriptionList`` object was created using :meth:`addResolved()` and ``False`` if it was created using :meth:`add()`. An exception is thrown if ``index >= size()``. diff --git a/src/blpapi/test/messageformatter.py b/src/blpapi/test/messageformatter.py index f1a1d30..e6da240 100644 --- a/src/blpapi/test/messageformatter.py +++ b/src/blpapi/test/messageformatter.py @@ -4,74 +4,23 @@ # pylint: disable=function-redefined,ungrouped-imports,no-name-in-module -import sys -from functools import update_wrapper +from functools import singledispatch, update_wrapper from datetime import date, time, datetime from json import dumps from blpapi import internals, Name from blpapi.datetime import _DatetimeUtil -from blpapi.compat import conv2str, int_typelist, isstr, str_typelist from blpapi.exception import _ExceptionUtil from blpapi.utils import \ + conv2str, \ get_handle, \ + isstr, \ MAX_32BIT_INT, \ MIN_32BIT_INT, \ MIN_64BIT_INT, \ - MAX_64BIT_INT - -if sys.version_info >= (3, 4): - from functools import singledispatch -else: - def singledispatch(func): - """ Transform a function into a single-dispatch generic function. - - This function is intended to provide a basic implementation of - `functools.singledispatch` found in Python >= 3.4. No caching - optimizations are performed. Types are matched naively: there is no - support for inherited types. - """ - - registry = {} - funcname = getattr(func, "__name__", "singledispatch function") - - def dispatch(cls): - """ Return the function registered to `cls`. If there is no - function associated with `cls`, return `func`. - """ - - # Return `func` instead of `None` because the native - # python implementation ultimately ends up doing this for - # types whose closest match in the registry is type - # `object` - return registry.get(cls, func) - - def register(cls, func=None): - """ Register a new function `func` for the given `cls`. """ - - # Return a lambda so that `register` can be used as a decorator - if func is None: - return lambda f: register(cls, f) - - registry[cls] = func - - return func - - def wrapper(*args, **kw): - """ Wrap the provided `func` from `singledispatch` to provide - additional functionality without modifying `func` directly. - """ - if not args: - raise TypeError("{} requires at least 1 positional argument" - .format(funcname)) - - return dispatch(args[0].__class__)(*args, **kw) + MAX_64BIT_INT, \ + STR_TYPES - wrapper.register = register - wrapper.dispatch = dispatch - wrapper.registry = registry - update_wrapper(wrapper, func) - return wrapper def _singledispatchmethod(arg_index): """ Decorator to implement singledispatch on a class method. @@ -174,10 +123,9 @@ def _setElement(self, name, value): - The ``value`` cannot be assigned to the element identified by ``name`` """ - raise TypeError("The type of value {} is not supported. Type is {}." - .format(value, type(value)) - + " Please refer to the documentation for the" - + " supported types.") + raise TypeError(f"The type of value {value} is not supported. Type" + f" is {type(value)}. Please refer to the" + " documentation for the supported types.") @_setElement.register(bool) def _(self, name, value): @@ -188,7 +136,7 @@ def _(self, name, value): get_handle(name), value)) - @_setElement.register(datetime) + @_setElement.register(datetime) # type: ignore @_setElement.register(date) @_setElement.register(time) def _(self, name, value): @@ -199,6 +147,7 @@ def _(self, name, value): get_handle(name), _DatetimeUtil.convertToBlpapi(value))) + @_setElement.register(int) def _setElementInt(self, name, value): """ Dispatch method for setting integer types. """ if MIN_32BIT_INT <= value <= MAX_32BIT_INT: @@ -215,10 +164,8 @@ def _setElementInt(self, name, value): value)) else: raise ValueError("Value is out of element's supported range") - for _int_type in int_typelist: - _setElement.register(_int_type, _setElementInt) - @_setElement.register(float) + @_setElement.register(float) # type: ignore def _(self, name, value): """ Dispatch method for setting `float` types. """ _ExceptionUtil.raiseOnError( @@ -227,7 +174,7 @@ def _(self, name, value): get_handle(name), value)) - @_setElement.register(Name) + @_setElement.register(Name) # type: ignore def _(self, name, value): """ Dispatch method for setting `Name` types. """ _ExceptionUtil.raiseOnError( @@ -236,7 +183,7 @@ def _(self, name, value): get_handle(name), get_handle(value))) - @_setElement.register(type(None)) + @_setElement.register(type(None)) # type: ignore def _(self, name, _): """ Dispatch method for setting `None` types. """ _ExceptionUtil.raiseOnError( @@ -251,7 +198,7 @@ def _setElementStr(self, name, value): self.__handle, get_handle(name), conv2str(value))) - for _str_type in str_typelist: + for _str_type in STR_TYPES: _setElement.register(_str_type, _setElementStr) def pushElement(self, name): @@ -315,7 +262,7 @@ def appendValue(self, value): self.__handle, value)) - @appendValue.register(bool) + @appendValue.register(bool) # type: ignore def _(self, value): """ Dispatch method for appending `bool` types. """ _ExceptionUtil.raiseOnError( @@ -323,7 +270,7 @@ def _(self, value): self.__handle, value)) - @appendValue.register(datetime) + @appendValue.register(datetime) # type: ignore @appendValue.register(date) @appendValue.register(time) def _(self, value): @@ -333,6 +280,7 @@ def _(self, value): self.__handle, _DatetimeUtil.convertToBlpapi(value))) + @appendValue.register(int) def _appendValueInt(self, value): """ Dispatch method for appending integer types. """ if MIN_32BIT_INT <= value <= MAX_32BIT_INT: @@ -347,10 +295,8 @@ def _appendValueInt(self, value): value)) else: raise ValueError("Value is out of element's supported range") - for _int_type in int_typelist: - appendValue.register(_int_type, _appendValueInt) - @appendValue.register(float) + @appendValue.register(float) # type: ignore def _(self, value): """ Dispatch method for appending `float` types. """ _ExceptionUtil.raiseOnError( @@ -358,7 +304,7 @@ def _(self, value): self.__handle, value)) - @appendValue.register(Name) + @appendValue.register(Name) # type: ignore def _(self, value): """ Dispatch method for appending `Name` types. """ _ExceptionUtil.raiseOnError( @@ -372,7 +318,7 @@ def _appendValueStr(self, value): internals.blpapi_MessageFormatter_appendValueString( self.__handle, conv2str(value))) - for _str_type in str_typelist: + for _str_type in STR_TYPES: appendValue.register(_str_type, _appendValueStr) def appendElement(self): diff --git a/src/blpapi/test/testutil.py b/src/blpapi/test/testutil.py index e464601..7f3ff80 100644 --- a/src/blpapi/test/testutil.py +++ b/src/blpapi/test/testutil.py @@ -6,9 +6,8 @@ from blpapi import internals from blpapi import Event, Name, SchemaElementDefinition, Service, Topic -from blpapi.compat import conv2str, isstr from blpapi.exception import _ExceptionUtil -from blpapi.utils import get_handle +from blpapi.utils import conv2str, get_handle, isstr from blpapi.test import MessageProperties, MessageFormatter diff --git a/src/blpapi/topic.py b/src/blpapi/topic.py index 1c648c1..b181157 100644 --- a/src/blpapi/topic.py +++ b/src/blpapi/topic.py @@ -4,8 +4,10 @@ This component provides a topic that is used for publishing data on. """ - +from typing import Set +from .typehints import BlpapiTopicHandle from . import internals +from . import typehints # pylint: disable=unused-import from .service import Service from .utils import get_handle from .chandle import CHandle @@ -20,7 +22,9 @@ class Topic(CHandle): :class:`EventFormatter`. """ - def __init__(self, handle=None, sessions=None): + def __init__(self, + handle: BlpapiTopicHandle, + sessions: Set["typehints.AbstractSession"]): """Create a :class:`Topic` object. Args: @@ -37,23 +41,23 @@ def __init__(self, handle=None, sessions=None): self.__handle = selfhandle self.__sessions = sessions - def isValid(self): + def isValid(self) -> bool: """ Returns: - bool: ``True`` if this :class:`Topic` is valid and can be used to + ``True`` if this :class:`Topic` is valid and can be used to publish a message on. """ return self.__handle is not None - def isActive(self): + def isActive(self) -> bool: """ Returns: - bool: ``True`` if this topic was elected by the platform to become + ``True`` if this topic was elected by the platform to become the primary publisher. """ return bool(internals.blpapi_Topic_isActive(self.__handle)) - def service(self): + def service(self) -> "typehints.Service": # type: ignore """ Returns: Service: The service for which this topic was created. @@ -61,18 +65,12 @@ def service(self): return Service(internals.blpapi_Topic_service(self.__handle), self.__sessions) - def __cmp__(self, other): - """3-way comparison of Topic objects.""" - return internals.blpapi_Topic_compare( - self.__handle, - get_handle(other)) - - def __lt__(self, other): + def __lt__(self, other: "typehints.Topic") -> bool: """2-way comparison of Topic objects.""" return internals.blpapi_Topic_compare( self.__handle, get_handle(other)) < 0 - def __eq__(self, other): + def __eq__(self, other) -> bool: """2-way comparison of Topic objects.""" return internals.blpapi_Topic_compare( self.__handle, get_handle(other)) == 0 diff --git a/src/blpapi/topiclist.py b/src/blpapi/topiclist.py index c5cb510..8f18132 100644 --- a/src/blpapi/topiclist.py +++ b/src/blpapi/topiclist.py @@ -4,6 +4,7 @@ This component implements a list of topics which require topic creation. """ +from typing import Optional, Set, Union from .exception import _ExceptionUtil from .message import Message @@ -12,13 +13,12 @@ from . import utils from .utils import get_handle from .internals import CorrelationId -from .compat import with_metaclass from .chandle import CHandle +from . import typehints # pylint: disable=unused-import -# pylint: disable=protected-access -@with_metaclass(utils.MetaClassForClassesWithEnums) -class TopicList(CHandle): +# pylint: disable=protected-access +class TopicList(CHandle, metaclass=utils.MetaClassForClassesWithEnums): """A list of topics which require creation. Contains a list of topics which require creation. @@ -31,16 +31,16 @@ class TopicList(CHandle): :meth:`~ProviderSession.createTopics()` call. """ - NOT_CREATED = internals.TOPICLIST_NOT_CREATED - CREATED = internals.TOPICLIST_CREATED - FAILURE = internals.TOPICLIST_FAILURE + NOT_CREATED = internals.TOPICLIST_NOT_CREATED # type: ignore + CREATED = internals.TOPICLIST_CREATED # type: ignore + FAILURE = internals.TOPICLIST_FAILURE # type: ignore - def __init__(self, original=None): + def __init__(self, original: Optional[ResolutionList] = None) -> None: """Create an empty :class:`TopicList`, or a :class:`TopicList` based on ``original`` :class:`ResolutionList`. Args: - ``original`` (:class:`ResolutionList`): Original resolution list to use. + ``original``: Original resolution list to use. Raises: TypeError: If ``original`` is not an instance of @@ -67,18 +67,20 @@ def __init__(self, original=None): selfhandle, internals.blpapi_TopicList_destroy) self.__handle = selfhandle - def add(self, topicOrMessage, correlationId=None): + def add(self, + topicOrMessage: Union[str, Message], + correlationId: Optional[CorrelationId] = None) -> int: """Add the specified topic or topic from message to this :class:`TopicList`. Args: - topicOrMessage (str or Message): Topic string or message to create + topicOrMessage: Topic string or message to create a topic from - correlationId (CorrelationId): CorrelationId to associate with the + correlationId: CorrelationId to associate with the topic Returns: - int: ``0`` on success or negative number on failure. + ``0`` on success or negative number on failure. Raises: TypeError: If ``correlationId`` is not an instance of @@ -103,19 +105,19 @@ def add(self, topicOrMessage, correlationId=None): return internals.blpapi_TopicList_addFromMessage( self.__handle, get_handle(topicOrMessage), - get_handle(correlationId)) + correlationId) return internals.blpapi_TopicList_add( self.__handle, topicOrMessage, - get_handle(correlationId)) + correlationId) - def correlationIdAt(self, index): + def correlationIdAt(self, index: int) -> CorrelationId: """ Args: - index (int): Index of the entry in the list + index: Index of the entry in the list Returns: - CorrelationId: Correlation id of the ``index``\ th entry. + Correlation id of the ``index``\ th entry. Raises: Exception: If ``index >= size()``. @@ -126,14 +128,14 @@ def correlationIdAt(self, index): _ExceptionUtil.raiseOnError(errorCode) return cid - def topicString(self, correlationId): + def topicString(self, correlationId: CorrelationId) -> str: """ Args: - correlationId (CorrelationId): Correlation id associated with the + correlationId: Correlation id associated with the topic. Returns: - str: Topic of the entry identified by 'correlationId'. + Topic of the entry identified by 'correlationId'. Raises: Exception: If the ``correlationId`` does not identify an entry in @@ -141,18 +143,17 @@ def topicString(self, correlationId): """ errorCode, topic = internals.blpapi_TopicList_topicString( self.__handle, - get_handle(correlationId)) + correlationId) _ExceptionUtil.raiseOnError(errorCode) return topic - def topicStringAt(self, index): + def topicStringAt(self, index: int) -> str: """ Args: - index (int): Index of the entry + index: Index of the entry Returns: - str: The full topic string of the ``index``\ th entry in this - list. + The full topic string of the ``index``\ th entry in this list. Raises: Exception: If ``index >= size()``. @@ -163,14 +164,14 @@ def topicStringAt(self, index): _ExceptionUtil.raiseOnError(errorCode) return topic - def status(self, correlationId): + def status(self, correlationId: CorrelationId) -> int: """ Args: - correlationId (CorrelationId): Correlation id associated with the + correlationId: Correlation id associated with the entry Returns: - int: Status of the entry in this list identified by the + Status of the entry in this list identified by the specified ``correlationId``. This may be :attr:`NOT_CREATED`, :attr:`CREATED` and :attr:`FAILURE`. @@ -180,17 +181,17 @@ def status(self, correlationId): """ errorCode, status = internals.blpapi_TopicList_status( self.__handle, - get_handle(correlationId)) + correlationId) _ExceptionUtil.raiseOnError(errorCode) return status - def statusAt(self, index): + def statusAt(self, index: int) -> int: """ Args: - index (int): Index of the entry + index: Index of the entry Returns: - int: Status of the ``index``\ th entry in this list. This may be + Status of the ``index``\ th entry in this list. This may be :attr:`NOT_CREATED`, :attr:`CREATED` and :attr:`FAILURE`. Raises: @@ -202,14 +203,14 @@ def statusAt(self, index): _ExceptionUtil.raiseOnError(errorCode) return status - def message(self, correlationId): + def message(self, correlationId: CorrelationId) -> Message: """ Args: - correlationId (CorrelationId): Correlation id associated with the + correlationId: Correlation id associated with the message Returns: - Message: Message received during creation of the topic identified + Message received during creation of the topic identified by the specified ``correlationId``. Raises: @@ -222,17 +223,17 @@ def message(self, correlationId): """ errorCode, message = internals.blpapi_TopicList_message( self.__handle, - get_handle(correlationId)) + correlationId) _ExceptionUtil.raiseOnError(errorCode) - return Message(message, sessions=self.__sessions) + return Message(message, sessions=self._sessions()) - def messageAt(self, index): + def messageAt(self, index: int) -> Message: """ Args: - index (int): Index of the entry + index: Index of the entry Returns: - Message: Message received during creation of the entry at + Message received during creation of the entry at ``index``. Raises: @@ -246,19 +247,19 @@ def messageAt(self, index): self.__handle, index) _ExceptionUtil.raiseOnError(errorCode) - return Message(message, sessions=self.__sessions) + return Message(message, sessions=self._sessions()) - def size(self): + def size(self) -> int: """Return the number of entries in this :class:`TopicList`.""" return internals.blpapi_TopicList_size(self.__handle) - def _sessions(self): + def _sessions(self) -> Set["typehints.AbstractSession"]: """Return session(s) that this 'TopicList' is related to. For internal use.""" return self.__sessions - def _addSession(self, session): + def _addSession(self, session: "typehints.AbstractSession") -> None: """Add a new session to this 'TopicList'. For internal use.""" diff --git a/src/blpapi/typehints.py b/src/blpapi/typehints.py new file mode 100644 index 0000000..6c263b6 --- /dev/null +++ b/src/blpapi/typehints.py @@ -0,0 +1,57 @@ +# typehints.py + +"""Type definitions for common type hints""" + +from typing import TYPE_CHECKING +if TYPE_CHECKING: + from blpapi import AbstractSession + from blpapi import AuthOptions + from blpapi import ConstantList + from blpapi import CorrelationId + from blpapi import Element + from blpapi import Event + from blpapi import EventDispatcher + from blpapi import EventQueue + from blpapi import Message + from blpapi import Name + from blpapi import Identity + from blpapi import ResolutionList + from blpapi import Request + from blpapi import SchemaElementDefinition + from blpapi import Service + from blpapi import Session + from blpapi import SessionOptions + from blpapi import SubscriptionList + from blpapi import TlsOptions + from blpapi import Topic + from blpapi import TopicList + +import datetime +from typing import Union, Any + +AnyPythonDatetime = Union[datetime.datetime, datetime.date, datetime.time] +BlpapiNameOrStr = Union[str, "Name", bytes] +BlpapiNameOrStrOrIndex = Union[str, "Name", bytes, int] +SupportedElementTypes = Union[BlpapiNameOrStr, bool, int, float, + AnyPythonDatetime, None] +# placeholders for opaque handles +BlpapiAbstractSessionHandle = Any +BlpapiAuthOptionsHandle = Any +BlpapiAuthUserHandle = Any +BlpapiConstantHandle = Any +BlpapiConstantListHandle = Any +BlpapiDatetime = Union[Any, "blpapi_HighPrecisionDatetime_tag"] # type: ignore +BlpapiElementHandle = Any +BlpapiEventHandle = Any +BlpapiIdentityHandle = Any +BlpapiMessageHandle = Any +BlpapiNameHandle = Any +BlpapiOperationHandle = Any +BlpapiProviderSessionHandle = Any +BlpapiRequestHandle = Any +BlpapiSchemaElementDefinitionHandle = Any +BlpapiSchemaTypeDefinitionHandle = Any +BlpapiServiceHandle = Any +BlpapiSessionHandle = Any +BlpapiTlsOptionsHandle = Any +BlpapiTopicHandle = Any diff --git a/src/blpapi/utils.py b/src/blpapi/utils.py index 92501d2..84d5e77 100644 --- a/src/blpapi/utils.py +++ b/src/blpapi/utils.py @@ -2,18 +2,25 @@ """Internal utils.""" -from .compat import Sequence, str_typelist +from collections.abc import Iterator as IteratorABC, Sequence +from typing import Any, Callable, Union, Optional +from typing import Iterator as IteratorType import functools import warnings +from .chandle import CHandle + + +STR_TYPES = (bytes, str) + MIN_32BIT_INT = -(2**31) MAX_32BIT_INT = 2**31 - 1 MIN_64BIT_INT = -(2**63) MAX_64BIT_INT = 2**63 - 1 -# pylint: disable=too-few-public-methods, useless-object-inheritance -class Iterator(object): +# pylint: disable=too-few-public-methods +class Iterator(IteratorABC): """Universal iterator for many of BLPAPI objects. It can be used to iterate any sub-items in an item which has @@ -37,16 +44,20 @@ def eventDefinitions(self): """ - def __init__(self, objToIterate, numFunc, getFunc): + def __init__(self, + objToIterate: Any, + numFunc: Callable[[Any], int], + getFunc: Callable[[Any, int], Any] + ) -> None: self.__obj = objToIterate self.__index = 0 self.__num = numFunc(objToIterate) self.__getter = getFunc - def __iter__(self): + def __iter__(self) -> IteratorType: return self - def __next__(self): + def __next__(self) -> Any: if self.__index == self.__num: raise StopIteration() res = self.__getter(self.__obj, self.__index) @@ -68,35 +79,35 @@ class EnumError(TypeError): """Raise this on attempt to change value of an enumeration constant. """ - def __setattr__(cls, name, value): + def __setattr__(cls, name: str, value: Any) -> None: """Change the value of an attribute if it is not an enum. Raise EnumError exception otherwise. """ if name.isupper() and name in cls.__dict__: - raise cls.EnumError("Can't change value of enum %s" % name) + raise cls.EnumError(f"Can't change value of enum {name}") type.__setattr__(cls, name, value) - def __delattr__(cls, name): + def __delattr__(cls, name: str) -> None: """Unbind the attribute if it is not an enum. Raise EnumError exception otherwise. """ if name.isupper() and name in cls.__dict__: - raise cls.EnumError("Can't unbind enum %s" % name) + raise cls.EnumError(f"Can't unbind enum {name}") type.__delattr__(cls, name) -def get_handle(thing): +def get_handle(thing: Optional[CHandle]) -> Any: """Returns the result of thing._handle() or None if thing is None""" return None if thing is None else thing._handle() #pylint: disable=protected-access -def invoke_if_valid(cb, value): +def invoke_if_valid(cb: Any, value: Any) -> Any: """Returns the result of cb(value) if cb is callable, else -- just value""" if cb is None or not callable(cb): return value return cb(value) -def deprecated(func_or_reason): +def deprecated(func_or_reason: Union[Callable, str]) -> Callable: ''' This is a decorator which can be used to mark classes or functions as deprecated. It results in a warning being emitted when the class or the @@ -129,7 +140,7 @@ def decorate(func): @functools.wraps(func) def wrap_func(*args, **kwargs): warnings.warn( - "%s is deprecated, %s." % (func.__name__, message), + f"{func.__name__} is deprecated, {message}.", category=DeprecationWarning, stacklevel=2) return func(*args, **kwargs) @@ -146,11 +157,31 @@ def wrap_func(*args, **kwargs): # `Sequence` but does not behave like a scalar. Useful for `Element` and # `Event` formatting. # pylint: disable=deprecated-class,no-name-in-module -def isNonScalarSequence(obj): - scalarTypes = str_typelist + (bytearray, memoryview) +def isNonScalarSequence(obj: Any) -> bool: + scalarTypes = STR_TYPES + (bytearray, memoryview) return isinstance(obj, Sequence) and not isinstance(obj, scalarTypes) +# NOTE: Our Python3 wrapper uses unicode strings (str type) for passing +# strings to C-functions so we need to decode byte-strings first to get unicode +# strings. Rule of thumb: to pass string to any wrapper function convert +# it using `conv2str` function first, to check that type of the string +# is correct - use `isstr` function. +def conv2str(s: Union[bytes, str]) -> str: + """Convert byte string to unicode string.""" + if isinstance(s, bytes): + return s.decode() + if isinstance(s, str): + return s + return None + + +def isstr(s: Any) -> bool: + if isinstance(s, STR_TYPES): + return True + return False + + __copyright__ = """ Copyright 2012. Bloomberg Finance L.P. diff --git a/src/blpapi/version.py b/src/blpapi/version.py index 31cd80d..c7ffbd7 100644 --- a/src/blpapi/version.py +++ b/src/blpapi/version.py @@ -2,25 +2,26 @@ """Provide BLPAPI SDK versions""" -from __future__ import print_function from . import versionhelper -__version__ = "3.17.1" +__version__ = "3.18.0" -def print_version(): +def print_version() -> None: """Print version information of BLPAPI python module and blpapi C++ SDK""" print("Python BLPAPI SDK version: ", version()) print("C++ BLPAPI SDK version: ", cpp_sdk_version()) -def version(): + +def version() -> str: """ Returns: str: BLPAPI Python module version """ return __version__ -def cpp_sdk_version(): + +def cpp_sdk_version() -> str: """ Returns: str: BLPAPI C++ SDK dependency version diff --git a/src/blpapi/zfputil.py b/src/blpapi/zfputil.py index 4bd1e44..2f05408 100644 --- a/src/blpapi/zfputil.py +++ b/src/blpapi/zfputil.py @@ -21,17 +21,15 @@ session = blpapi.Session(sessionOptions) session.start() """ - from . import utils from . import internals -from .compat import with_metaclass +from . import typehints # pylint: disable=unused-import from .exception import _ExceptionUtil from .sessionoptions import SessionOptions -# pylint: disable=too-few-public-methods,useless-object-inheritance -@with_metaclass(utils.MetaClassForClassesWithEnums) -class ZfpUtil(object): +# pylint: disable=too-few-public-methods +class ZfpUtil(metaclass=utils.MetaClassForClassesWithEnums): """Utility used to prepare :class:`SessionOptions` for private leased lines. @@ -49,11 +47,13 @@ class ZfpUtil(object): session.start() """ - REMOTE_8194 = internals.ZFPUTIL_REMOTE_8194 - REMOTE_8196 = internals.ZFPUTIL_REMOTE_8196 + REMOTE_8194 = internals.ZFPUTIL_REMOTE_8194 # type: ignore + REMOTE_8196 = internals.ZFPUTIL_REMOTE_8196 # type: ignore @staticmethod - def getZfpOptionsForLeasedLines(remote, tlsOptions): + def getZfpOptionsForLeasedLines(remote: int, + tlsOptions: "typehints.TlsOptions" + ) -> "typehints.SessionOptions": """Creates a :class:`SessionOptions` object for applications that leverage private leased lines to the Bloomberg network. From 631e13d1651ed7f7de1fc4e40fddf6394f705f7a Mon Sep 17 00:00:00 2001 From: Marland Sitt Date: Wed, 10 Aug 2022 13:19:51 -0700 Subject: [PATCH 11/23] Bump to v3.18.2 --- PKG-INFO | 2 +- README.md | 12 + changelog.txt | 8 + examples/demoapps/ApiFieldsExample.py | 40 ++- .../demoapps/BroadcastPublisherExample.py | 127 ++++--- examples/demoapps/ContributionsExample.py | 128 +++---- ...mentsVerificationRequestResponseExample.py | 148 ++++---- ...tlementsVerificationSubscriptionExample.py | 145 ++++---- examples/demoapps/GenerateTokenExample.py | 47 +-- .../demoapps/InteractivePublisherExample.py | 265 ++++++++------ .../MultipleRequestsOverrideExample.py | 32 +- examples/demoapps/RequestResponseExample.py | 51 ++- .../demoapps/RequestServiceConsumerExample.py | 15 +- .../demoapps/RequestServiceProviderExample.py | 15 +- examples/demoapps/SecurityLookupExample.py | 89 +++-- .../SnapshotRequestTemplateExample.py | 53 +-- examples/demoapps/SubscriptionExample.py | 63 ++-- .../SubscriptionWithEventPollingExample.py | 45 ++- examples/demoapps/UserModeExample.py | 159 +++++---- .../demoapps/blpapi_import_helper/__init__.py | 10 +- .../snippets/apiflds/ApiFieldsRequestUtils.py | 24 +- .../apiflds/CategorizedFieldSearchRequests.py | 6 +- .../snippets/instruments/CurveListRequests.py | 11 +- .../requestresponse/IntradayBarRequests.py | 12 +- .../requestresponse/IntradayTickRequests.py | 6 +- .../requestresponse/ReferenceDataRequests.py | 44 +-- .../demoapps/util/ConnectionAndAuthOptions.py | 201 ++++++----- examples/demoapps/util/MaxEventsOption.py | 19 +- examples/demoapps/util/RequestOptions.py | 229 +++++++----- examples/demoapps/util/SubscriptionOptions.py | 105 +++--- .../demoapps/util/events/SessionRouter.py | 65 ++-- .../market-data-notifier/src/appconfig.py | 137 ++++--- .../market-data-notifier/src/application.py | 10 +- .../market-data-notifier/src/authorizer.py | 14 +- .../src/compute_engine.py | 3 +- .../src/event_processor.py | 8 +- .../market-data-notifier/src/main.py | 2 +- .../market-data-notifier/src/notifier.py | 3 +- .../market-data-notifier/src/subscriber.py | 8 +- .../src/token_generator.py | 9 +- .../tests/test_application.py | 59 ++-- .../tests/test_authorizer.py | 45 ++- .../tests/test_eventprocessor.py | 51 +-- .../tests/test_tokengenerator.py | 19 +- .../snippets/resolver/resolverutils.py | 27 +- .../snippets/resolver/test_resolverutils.py | 66 ++-- examples/unittests/snippets/test_events.py | 302 ++++++++-------- examples/unittests/snippets/test_refdata.py | 135 ++++--- pyproject.toml | 9 + setup.py | 95 ++--- src/blpapi.egg-info/PKG-INFO | 2 +- src/blpapi.egg-info/SOURCES.txt | 1 + src/blpapi/__init__.py | 11 +- src/blpapi/abstractsession.py | 134 +++---- src/blpapi/auth.py | 94 +++-- src/blpapi/chandle.py | 14 +- src/blpapi/constant.py | 127 ++++--- src/blpapi/datatype.py | 35 +- src/blpapi/datetime.py | 167 +++++---- src/blpapi/debug.py | 31 +- src/blpapi/debug_environment.py | 34 +- src/blpapi/element.py | 294 ++++++++------- src/blpapi/event.py | 50 +-- src/blpapi/eventdispatcher.py | 25 +- src/blpapi/eventformatter.py | 206 ++++++----- src/blpapi/exception.py | 31 +- src/blpapi/highresclock.py | 8 +- src/blpapi/identity.py | 54 +-- src/blpapi/internals_wrap.c | 4 +- src/blpapi/logging.py | 40 ++- src/blpapi/message.py | 96 ++--- src/blpapi/name.py | 34 +- src/blpapi/providersession.py | 334 ++++++++++-------- src/blpapi/request.py | 17 +- src/blpapi/requesttemplate.py | 8 +- src/blpapi/resolutionlist.py | 87 ++--- src/blpapi/schema.py | 140 ++++---- src/blpapi/service.py | 132 ++++--- src/blpapi/session.py | 242 +++++++------ src/blpapi/sessionoptions.py | 311 ++++++++++------ src/blpapi/subscriptionlist.py | 64 ++-- src/blpapi/test/messageformatter.py | 302 +++++++++------- src/blpapi/test/messageproperties.py | 55 +-- src/blpapi/test/testutil.py | 116 +++--- src/blpapi/topic.py | 36 +- src/blpapi/topiclist.py | 76 ++-- src/blpapi/typehints.py | 14 +- src/blpapi/utils.py | 34 +- src/blpapi/version.py | 2 +- src/blpapi/zfputil.py | 16 +- 90 files changed, 3854 insertions(+), 2802 deletions(-) create mode 100644 pyproject.toml diff --git a/PKG-INFO b/PKG-INFO index 967153f..769baae 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: blpapi -Version: 3.18.0 +Version: 3.18.2 Summary: Python SDK for Bloomberg BLPAPI Home-page: http://www.bloomberglabs.com/api/ Author: Bloomberg L.P. diff --git a/README.md b/README.md index 6b1d500..66d4872 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,17 @@ # Bloomberg Python API +[![Build Status](https://rdp.jaas.dev.bloomberg.com/buildStatus/icon?job=apisdk%2Fblpapi-py%2Fmain)](https://rdp.jaas.dev.bloomberg.com/job/apisdk/job/blpapi-py/job/main/) +[![failed/skipped/total unit tests](https://rdp.jaas.dev.bloomberg.com/job/apisdk/job/blpapi-py/job/main/lastCompletedBuild/artifact/failed_skipped_total_unit_tests-badge.svg 'apisdk/blpapi-py/main failed/skipped/total unit tests')](https://rdp.jaas.dev.bloomberg.com/job/apisdk/job/blpapi-py/job/main/lastCompletedBuild/testReport/) + +[![python coverage](https://rdp.jaas.dev.bloomberg.com/job/apisdk/job/blpapi-py/job/main/lastCompletedBuild/artifact/python_coverage-badge.svg 'apisdk/blpapi-py/main python coverage')](https://rdp.jaas.dev.bloomberg.com/job/apisdk/job/blpapi-py/job/main/lastCompletedBuild/cobertura/) +[![c/c++ swig coverage](https://rdp.jaas.dev.bloomberg.com/job/apisdk/job/blpapi-py/job/main/lastCompletedBuild/artifact/c_c++_swig_coverage-badge.svg 'apisdk/blpapi-py/main c/c++ swig coverage')](https://rdp.jaas.dev.bloomberg.com/job/apisdk/job/blpapi-py/job/main/lastCompletedBuild/HTML_20Coverage_20Report_20_28c_2fc_2b_2b_20swig_29/) +[![c/c++ blpapi coverage](https://rdp.jaas.dev.bloomberg.com/job/apisdk/job/blpapi-py/job/main/lastCompletedBuild/artifact/c_c++_blpapi_coverage-badge.svg 'apisdk/blpapi-py/main c/c++ blpapi coverage')](https://rdp.jaas.dev.bloomberg.com/job/apisdk/job/blpapi-py/job/main/lastCompletedBuild/HTML_20Coverage_20Report_20_28c_2fc_2b_2b_20blpapi_29/) + +[![ARTA tests and coverage](https://badges.dev.bloomberg.com/badge//ARTA%20tests%20and%20coverage/blue?icon=codecov "ARTA tests and coverage")](https://bbgithub.dev.bloomberg.com/apisdk/arta-jaas-dailies/blob/main/README.md) + +[![blpapi python documentation (main branch)](https://badges.dev.bloomberg.com/badge//blpapi%20python%20documentation%20(main%20branch)/blue?icon=fa-book "blpapi python documentation (main branch)")](https://rdp.jaas.dev.bloomberg.com/job/apisdk/job/blpapi-py/job/main/lastCompletedBuild/blpapi_20Python_20documentation/) +[![blpapi documentation (release)](https://badges.dev.bloomberg.com/badge//blpapi%20documentation%20(release)/blue?icon=fa-book "blpapi documentation (release)")](https://bloomberg.github.io/blpapi-docs/) + This directory contains an interface for interacting with Bloomberg API services using the Python programming language. This package is the source installer, and requires a C/C++ compilation environment compatible with diff --git a/changelog.txt b/changelog.txt index ef55870..d717706 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,11 @@ +Version 3.18.2: +=============== +- Stability and performance improvements + +Version 3.18.1: +=============== +- Stability and performance improvements + Version 3.18.0: =============== - Improved 'Session.subcribe' and 'Session.resubscribe' interface diff --git a/examples/demoapps/ApiFieldsExample.py b/examples/demoapps/ApiFieldsExample.py index 0f64e41..8e73a05 100644 --- a/examples/demoapps/ApiFieldsExample.py +++ b/examples/demoapps/ApiFieldsExample.py @@ -1,7 +1,10 @@ from argparse import ArgumentParser, RawTextHelpFormatter from blpapi_import_helper import blpapi -from util.ConnectionAndAuthOptions import addConnectionAndAuthOptions, createSessionOptions +from util.ConnectionAndAuthOptions import ( + addConnectionAndAuthOptions, + createSessionOptions, +) from snippets.apiflds import CategorizedFieldSearchRequests from snippets.apiflds import FieldInfoRequests @@ -52,18 +55,23 @@ def processResponse(requestType, event): def main(): parser = ArgumentParser( description="Retrieve API data fields", - formatter_class=RawTextHelpFormatter) + formatter_class=RawTextHelpFormatter, + ) addConnectionAndAuthOptions(parser) - parser.add_argument("-r", - "--request", - dest="requestType", - help="API fields request type, choices are: %(choices)s", - required=True, - choices=[CATEGORIZED_FIELD_SEARCH_REQUEST, - FIELD_INFO_REQUEST, - FIELD_LIST_REQUEST, - FIELD_SEARCH_REQUEST], - metavar="requestType") + parser.add_argument( + "-r", + "--request", + dest="requestType", + help="API fields request type, choices are: %(choices)s", + required=True, + choices=[ + CATEGORIZED_FIELD_SEARCH_REQUEST, + FIELD_INFO_REQUEST, + FIELD_LIST_REQUEST, + FIELD_SEARCH_REQUEST, + ], + metavar="requestType", + ) options = parser.parse_args() @@ -96,8 +104,10 @@ def main(): print(msg) done = True break - elif eventType in [blpapi.Event.RESPONSE, - blpapi.Event.PARTIAL_RESPONSE]: + elif eventType in [ + blpapi.Event.RESPONSE, + blpapi.Event.PARTIAL_RESPONSE, + ]: processResponse(options.requestType, event) @@ -112,7 +122,7 @@ def main(): if __name__ == "__main__": try: main() - except Exception as e: # pylint: disable=broad-except + except Exception as e: # pylint: disable=broad-except print(e) __copyright__ = """ diff --git a/examples/demoapps/BroadcastPublisherExample.py b/examples/demoapps/BroadcastPublisherExample.py index b8b63ba..e9c75b4 100644 --- a/examples/demoapps/BroadcastPublisherExample.py +++ b/examples/demoapps/BroadcastPublisherExample.py @@ -1,7 +1,10 @@ from argparse import ArgumentParser, RawTextHelpFormatter from blpapi_import_helper import blpapi -from util.ConnectionAndAuthOptions import addConnectionAndAuthOptions, createSessionOptions +from util.ConnectionAndAuthOptions import ( + addConnectionAndAuthOptions, + createSessionOptions, +) from util.MaxEventsOption import addMaxEventsOption from threading import Event @@ -10,6 +13,7 @@ DEFAULT_MARKET_DATA_TOPIC = "IBM Equity" DEFAULT_PAGE_TOPIC = "1245/4/5" + class MyStream(object): def __init__(self, sid=""): self.id = sid @@ -30,50 +34,69 @@ def processEvent(self, event, _session): def parseCmdLine(): - parser = ArgumentParser(formatter_class=RawTextHelpFormatter, - description="Broadcast data publisher.") + parser = ArgumentParser( + formatter_class=RawTextHelpFormatter, + description="Broadcast data publisher.", + ) addConnectionAndAuthOptions(parser) publisher_group = parser.add_argument_group("Broadcast Publisher Options") - publisher_group.add_argument("-s", "--service", - dest="service", - help="the service name", - required=True, - metavar="service") - publisher_group.add_argument("-t", "--topic", - dest="topics", - help="topic to publish (default: " - f"{DEFAULT_MARKET_DATA_TOPIC}; or for page " - f"data {DEFAULT_PAGE_TOPIC})." - "Can be specified multiple times.", - metavar="topic", - action="append", - default=[]) - publisher_group.add_argument("-g", "--group-id", - dest="groupId", - metavar="groupId", - help="publisher groupId (default to an " - "automatically generated unique value)") - publisher_group.add_argument("-p", "--priority", - dest="priority", - metavar="priority", - type=int, - help="publisher's priority (default: %(default)d)", - default=blpapi.ServiceRegistrationOptions.PRIORITY_HIGH) - publisher_group.add_argument("--page", - dest="isPageData", - help="publish as page data", - action="store_true", - default=False) + publisher_group.add_argument( + "-s", + "--service", + dest="service", + help="the service name", + required=True, + metavar="service", + ) + publisher_group.add_argument( + "-t", + "--topic", + dest="topics", + help="topic to publish (default: " + f"{DEFAULT_MARKET_DATA_TOPIC}; or for page " + f"data {DEFAULT_PAGE_TOPIC})." + "Can be specified multiple times.", + metavar="topic", + action="append", + default=[], + ) + publisher_group.add_argument( + "-g", + "--group-id", + dest="groupId", + metavar="groupId", + help="publisher groupId (default to an " + "automatically generated unique value)", + ) + publisher_group.add_argument( + "-p", + "--priority", + dest="priority", + metavar="priority", + type=int, + help="publisher's priority (default: %(default)d)", + default=blpapi.ServiceRegistrationOptions.PRIORITY_HIGH, + ) + publisher_group.add_argument( + "--page", + dest="isPageData", + help="publish as page data", + action="store_true", + default=False, + ) addMaxEventsOption(parser) options = parser.parse_args() if not options.topics: - options.topics = [DEFAULT_PAGE_TOPIC] if options.isPageData \ + options.topics = ( + [DEFAULT_PAGE_TOPIC] + if options.isPageData else [DEFAULT_MARKET_DATA_TOPIC] + ) return options @@ -91,13 +114,11 @@ def formatMarketData(eventFormatter, topic): secondsStr = time.strftime("%S", time.localtime()) seconds = int(secondsStr) - messageDict = { - HIGH: seconds * 1.0, - LOW: seconds * 0.5 - } + messageDict = {HIGH: seconds * 1.0, LOW: seconds * 0.5} eventFormatter.fromPy(messageDict) + def formatPageData(eventFormatter, topic): # NOTE: This function demonstrates how to use the `Element`-based interface # of `EventFormatter` to format an `Event`. For an example of formatting an @@ -117,6 +138,7 @@ def formatPageData(eventFormatter, topic): eventFormatter.popElement() + def main(): options = parseCmdLine() @@ -125,8 +147,9 @@ def main(): # Create a Session sessionOptions = createSessionOptions(options) - session = blpapi.ProviderSession(sessionOptions, - myEventHandler.processEvent) + session = blpapi.ProviderSession( + sessionOptions, myEventHandler.processEvent + ) # Start a Session if not session.start(): @@ -140,9 +163,9 @@ def main(): serviceOptions = blpapi.ServiceRegistrationOptions() serviceOptions.setGroupId(options.groupId) serviceOptions.setServicePriority(options.priority) - if not session.registerService(options.service, - session.getAuthorizedIdentity(), - serviceOptions): + if not session.registerService( + options.service, session.getAuthorizedIdentity(), serviceOptions + ): print(f"Failed to register {options.service}") session.stop() return @@ -152,13 +175,16 @@ def main(): userTopic = topic if userTopic and not userTopic.startswith("/"): userTopic = "/" + userTopic - topicList.add(f"{options.service}{userTopic}", - blpapi.CorrelationId(MyStream(topic))) + topicList.add( + f"{options.service}{userTopic}", + blpapi.CorrelationId(MyStream(topic)), + ) # createTopics() is synchronous, topicList will be updated with the # results of topic creation (resolution will happen under the covers) - session.createTopics(topicList, - blpapi.ProviderSession.AUTO_REGISTER_SERVICES) + session.createTopics( + topicList, blpapi.ProviderSession.AUTO_REGISTER_SERVICES + ) streams = [] for i in range(topicList.size()): @@ -166,12 +192,14 @@ def main(): status = topicList.statusAt(i) topicString = topicList.topicStringAt(i) - if (status == blpapi.TopicList.CREATED): + if status == blpapi.TopicList.CREATED: print(f"Start publishing on topic: {topicString}") stream.topic = session.getTopic(topicList.messageAt(i)) streams.append(stream) else: - print(f"Stream '{stream.id}': topic not created, status = {status}") + print( + f"Stream '{stream.id}': topic not created, status = {status}" + ) service = session.getService(options.service) @@ -205,6 +233,7 @@ def main(): print("Stopping the session") session.stop() + if __name__ == "__main__": print("BroadcastPublisherExample") try: diff --git a/examples/demoapps/ContributionsExample.py b/examples/demoapps/ContributionsExample.py index 3b74e71..8da0b9c 100644 --- a/examples/demoapps/ContributionsExample.py +++ b/examples/demoapps/ContributionsExample.py @@ -2,7 +2,10 @@ from threading import Event from argparse import ArgumentParser, RawTextHelpFormatter from blpapi_import_helper import blpapi -from util.ConnectionAndAuthOptions import addConnectionAndAuthOptions, createSessionOptions +from util.ConnectionAndAuthOptions import ( + addConnectionAndAuthOptions, + createSessionOptions, +) from util.MaxEventsOption import addMaxEventsOption MARKET_DATA = blpapi.Name("MarketData") @@ -24,11 +27,12 @@ DEFAULT_PAGE_DATA_TOPIC = "/page/220/660/1" DATETIME_FORMAT = "%m/%d/%Y %H:%M" + class MyEventHandler(object): """Event handler for the session""" def __init__(self, stop): - """ Construct a handler """ + """Construct a handler""" self.stop = stop def processEvent(self, event, _sesssion): @@ -41,41 +45,51 @@ def processEvent(self, event, _sesssion): self.stop.set() continue + def parseCmdLine(): """Parse command line arguments""" parser = ArgumentParser( description="Contribute market or page data to a topic", - formatter_class=RawTextHelpFormatter) + formatter_class=RawTextHelpFormatter, + ) addConnectionAndAuthOptions(parser) addMaxEventsOption(parser) - parser.add_argument("-s", - "--service", - dest="service", - help="service name (default: %(default)s)", - metavar="service", - default="//blp/mpfbapi") - parser.add_argument("-t", - "--topic", - dest="topic", - help=f"topic to contribute (mktdata default: '{DEFAULT_MKT_DATA_TOPIC}'" - f", page default: '{DEFAULT_PAGE_DATA_TOPIC}')", - metavar="topic") + parser.add_argument( + "-s", + "--service", + dest="service", + help="service name (default: %(default)s)", + metavar="service", + default="//blp/mpfbapi", + ) + parser.add_argument( + "-t", + "--topic", + dest="topic", + help=f"topic to contribute (mktdata default: '{DEFAULT_MKT_DATA_TOPIC}'" + f", page default: '{DEFAULT_PAGE_DATA_TOPIC}')", + metavar="topic", + ) # Page contributions options - parser.add_argument("-P", - "--page", - dest="page_enabled", - action='store_true', - help="enable page contributions") - parser.add_argument("-C", - "--contribution-id", - dest="contributionId", - help="contributor id (default: %(default)d), ignored unless page is enabled", - metavar="contributionId", - type=int, - default=8563) + parser.add_argument( + "-P", + "--page", + dest="page_enabled", + action="store_true", + help="enable page contributions", + ) + parser.add_argument( + "-C", + "--contribution-id", + dest="contributionId", + help="contributor id (default: %(default)d), ignored unless page is enabled", + metavar="contributionId", + type=int, + default=8563, + ) options = parser.parse_args() @@ -83,42 +97,31 @@ def parseCmdLine(): options.topic = DEFAULT_MKT_DATA_TOPIC if options.page_enabled: options.topic = DEFAULT_PAGE_DATA_TOPIC - elif options.topic[0] != '/': + elif options.topic[0] != "/": options.topic = f"/{options.topic}" return options + def formatMktDataEvent(eventFormatter, topic, value): - """Format a Mktdata event. """ + """Format a Mktdata event.""" eventFormatter.appendMessage(MARKET_DATA, topic) eventFormatter.setElement(BID, 0.5 * value) eventFormatter.setElement(ASK, value) + def formatPageDataEvent(eventFormatter, topic, contributorId): - """Format a PageData event. """ + """Format a PageData event.""" tm = time.strftime("%X") messageDict = { ROW_UPDATE: [ { ROW_NUM: 1, SPAN_UPDATE: [ - { - START_COL: 20, - LENGTH: 4, - TEXT: "TEST" - }, - { - START_COL: 25, - LENGTH: 4, - TEXT: "PAGE" - }, - { - START_COL: 30, - LENGTH: len(tm), - TEXT: tm, - ATTR: "BLINK" - } - ] + {START_COL: 20, LENGTH: 4, TEXT: "TEST"}, + {START_COL: 25, LENGTH: 4, TEXT: "PAGE"}, + {START_COL: 30, LENGTH: len(tm), TEXT: tm, ATTR: "BLINK"}, + ], }, { ROW_NUM: 2, @@ -127,9 +130,9 @@ def formatPageDataEvent(eventFormatter, topic, contributorId): START_COL: 20, LENGTH: 9, TEXT: "---------", - ATTR: "UNDERLINE" + ATTR: "UNDERLINE", }, - ] + ], }, { ROW_NUM: 3, @@ -144,8 +147,8 @@ def formatPageDataEvent(eventFormatter, topic, contributorId): LENGTH: 5, TEXT: "THREE", }, - ] - } + ], + }, ], CONTRIBUTION_ID: contributorId, PRODUCT_CODE: 1, @@ -155,6 +158,7 @@ def formatPageDataEvent(eventFormatter, topic, contributorId): eventFormatter.appendMessage(PAGE_DATA, topic) eventFormatter.fromPy(messageDict) + def main(): """Main function""" @@ -166,8 +170,9 @@ def main(): myEventHandler = MyEventHandler(stop) # Create a Session - session = blpapi.ProviderSession(sessionOptions, - myEventHandler.processEvent) + session = blpapi.ProviderSession( + sessionOptions, myEventHandler.processEvent + ) try: # Start a Session @@ -176,12 +181,15 @@ def main(): return topicList = blpapi.TopicList() - topicList.add(options.service + options.topic, - blpapi.CorrelationId(options.topic)) + topicList.add( + options.service + options.topic, + blpapi.CorrelationId(options.topic), + ) # Create topics - session.createTopics(topicList, - blpapi.ProviderSession.AUTO_REGISTER_SERVICES) + session.createTopics( + topicList, blpapi.ProviderSession.AUTO_REGISTER_SERVICES + ) # createTopics() is synchronous, topicList will be updated # with the results of topic creation (resolution will happen # under the covers) @@ -206,7 +214,8 @@ def main(): if options.page_enabled: formatPageDataEvent( - eventFormatter, topic, options.contributionId) + eventFormatter, topic, options.contributionId + ) else: formatMktDataEvent(eventFormatter, topic, i) @@ -220,10 +229,11 @@ def main(): # Stop the session session.stop() + if __name__ == "__main__": try: main() - except Exception as e: # pylint: disable=broad-except + except Exception as e: # pylint: disable=broad-except print(e) __copyright__ = """ diff --git a/examples/demoapps/EntitlementsVerificationRequestResponseExample.py b/examples/demoapps/EntitlementsVerificationRequestResponseExample.py index 58de1ff..168029c 100644 --- a/examples/demoapps/EntitlementsVerificationRequestResponseExample.py +++ b/examples/demoapps/EntitlementsVerificationRequestResponseExample.py @@ -2,10 +2,11 @@ from blpapi_import_helper import blpapi from blpapi import CorrelationId, Event, Name, Names, Session -from util.ConnectionAndAuthOptions import \ - addConnectionAndAuthOptions, \ - createClientServerSetupAuthOptions, \ - createSessionOptions +from util.ConnectionAndAuthOptions import ( + addConnectionAndAuthOptions, + createClientServerSetupAuthOptions, + createSessionOptions, +) from util.events.SessionRouter import SessionRouter from threading import Event as ThreadingEvent from time import sleep @@ -20,7 +21,6 @@ class EntitlementsVerificationRequestResponseExample: - def __init__(self, options): self._options = options self._router = SessionRouter() @@ -32,19 +32,24 @@ def __init__(self, options): self._router.addExceptionHandler(self._handleException) self._router.addMessageHandlerByMessageType( - Names.SESSION_STARTED, self._handleSessionStarted) + Names.SESSION_STARTED, self._handleSessionStarted + ) self._router.addMessageHandlerByMessageType( - Names.SESSION_STARTUP_FAILURE, - self._handleSessionStartupFailure) + Names.SESSION_STARTUP_FAILURE, self._handleSessionStartupFailure + ) self._router.addMessageHandlerByMessageType( - Names.SESSION_TERMINATED, self._handleSessionTerminated) + Names.SESSION_TERMINATED, self._handleSessionTerminated + ) self._router.addMessageHandlerByMessageType( - Names.SERVICE_OPENED, self._handleServiceOpened) + Names.SERVICE_OPENED, self._handleServiceOpened + ) self._router.addMessageHandlerByMessageType( - Names.SERVICE_OPEN_FAILURE, self._handleServiceOpenFailure) + Names.SERVICE_OPEN_FAILURE, self._handleServiceOpenFailure + ) self._router.addMessageHandlerByMessageType( - ENTITLEMENT_CHANGED, self._handleEntitlementChanged) + ENTITLEMENT_CHANGED, self._handleEntitlementChanged + ) @property def stopped(self): @@ -73,14 +78,14 @@ def _handleSessionStarted(self, session, _1, _2): # started to only react to the authorization messages of users, # i.e., avoid those of the session identity. self._router.addMessageHandlerByMessageType( - Names.AUTHORIZATION_SUCCESS, - self._handleAuthorizationSuccess) + Names.AUTHORIZATION_SUCCESS, self._handleAuthorizationSuccess + ) self._router.addMessageHandlerByMessageType( - Names.AUTHORIZATION_FAILURE, - self._handleAuthorizationFailure) + Names.AUTHORIZATION_FAILURE, self._handleAuthorizationFailure + ) self._router.addMessageHandlerByMessageType( - Names.AUTHORIZATION_REVOKED, - self._handleAuthorizationRevoked) + Names.AUTHORIZATION_REVOKED, self._handleAuthorizationRevoked + ) self._authorizeUsers(session) self._openServices(session) @@ -119,45 +124,53 @@ def _sendRefDataRequest(self, session, refDataService): requestDict = { "securities": self._options.securities, "fields": ["PX_LAST", "DS002"], - "returnEids": True + "returnEids": True, } request.fromPy(requestDict) print(f"Sending RefDataRequest {request}") - correlationId = CorrelationId("example") - self._router.addMessageHandlerByCorrelationId( - correlationId, self._processResponseMessage) - session.sendRequest(request, correlationId=correlationId) - - def _processResponseMessage(self, session, event, message): - if message.messageType() == Names.REQUEST_FAILURE: - print("Request failed, stopping...") - self._stop(session) - return - - if event.eventType() == Event.PARTIAL_RESPONSE: - print("Received partial response") - - # Save the response - self._responses.append(event) - elif event.eventType() == Event.RESPONSE: - print("Received final response") - self._finalResponseReceived = True - - # Save the response - self._responses.append(event) - - # Distributes all the cached responses to the identities that have - # been authorized so far. - for correlationId, identity in self._identitiesByCorrelationId.items(): - userIdentifier = correlationId.value() - self._distributeResponses(userIdentifier, identity) + self._router.addEventHandlerByEventType( + Event.REQUEST_STATUS, self._processRequestStatus + ) + self._router.addEventHandlerByEventType( + Event.PARTIAL_RESPONSE, self._processPartialResponse + ) + self._router.addEventHandlerByEventType( + Event.RESPONSE, self._processResponse + ) + session.sendRequest(request, correlationId=CorrelationId("example")) + + def _processRequestStatus(self, session, event): + for message in event: + if message.messageType() == Names.REQUEST_FAILURE: + print("Request failed, stopping...") + self._stop(session) + + def _processPartialResponse(self, _, event): + # Save the response + self._responses.append(event) + print("Received partial response") + + def _processResponse(self, _, event): + print("Received final response") + self._finalResponseReceived = True + self._responses.append(event) + + # Distributes all the cached responses to the identities that have + # been authorized so far. + for ( + correlationId, + identity, + ) in self._identitiesByCorrelationId.items(): + userIdentifier = correlationId.value() + self._distributeResponses(userIdentifier, identity) def _authorizeUsers(self, session): # Authorize each of the users authOptionsByIdentifier = createClientServerSetupAuthOptions( - self._options) + self._options + ) for userIdentifier, authOptions in authOptionsByIdentifier.items(): correlationId = blpapi.CorrelationId(userIdentifier) session.generateAuthorizedIdentity(authOptions, correlationId) @@ -216,17 +229,22 @@ def _distributeResponse(self, event, userIdentifier, identity): # Entitlements are required to access this data entitlements = securityData[EID_DATA] - entitled, failedEntitlements = identity.getFailedEntitlements( - service, - entitlements) + ( + entitled, + failedEntitlements, + ) = identity.getFailedEntitlements(service, entitlements) if entitled: - print(f"{userIdentifier} is entitled to get data " - f"for: {ticker}") + print( + f"{userIdentifier} is entitled to get data " + f"for: {ticker}" + ) # Now Distribute message to the user. else: - print(f"{userIdentifier} is NOT entitled to get " - f"data for: {ticker} - Failed EIDs: {failedEntitlements}") + print( + f"{userIdentifier} is NOT entitled to get " + f"data for: {ticker} - Failed EIDs: {failedEntitlements}" + ) else: print(f"No entitlements are required for: {ticker}") @@ -236,16 +254,20 @@ def _distributeResponse(self, event, userIdentifier, identity): def parseCmdLine(): parser = ArgumentParser( description="Entitlements Verification Request/Response Example", - formatter_class=RawTextHelpFormatter) + formatter_class=RawTextHelpFormatter, + ) addConnectionAndAuthOptions(parser, forClientServerSetup=True) - parser.add_argument("-S", "--security", - dest="securities", - help="security used in ReferenceDataRequest (default:" - " IBM US Equity). Can be specified multiple times", - metavar="security", - action="append", - default=[]) + parser.add_argument( + "-S", + "--security", + dest="securities", + help="security used in ReferenceDataRequest (default:" + " IBM US Equity). Can be specified multiple times", + metavar="security", + action="append", + default=[], + ) options = parser.parse_args() diff --git a/examples/demoapps/EntitlementsVerificationSubscriptionExample.py b/examples/demoapps/EntitlementsVerificationSubscriptionExample.py index 33a040a..5a46077 100644 --- a/examples/demoapps/EntitlementsVerificationSubscriptionExample.py +++ b/examples/demoapps/EntitlementsVerificationSubscriptionExample.py @@ -3,14 +3,16 @@ import time from blpapi_import_helper import blpapi -from blpapi import AbstractSession, Message, Name, Names, Session -from util.ConnectionAndAuthOptions import \ - addConnectionAndAuthOptions, \ - createClientServerSetupAuthOptions, \ - createSessionOptions -from util.SubscriptionOptions import \ - addSubscriptionOptions, \ - createSubscriptionList +from blpapi import AbstractSession, Message, Name, Names, Session, Event +from util.ConnectionAndAuthOptions import ( + addConnectionAndAuthOptions, + createClientServerSetupAuthOptions, + createSessionOptions, +) +from util.SubscriptionOptions import ( + addSubscriptionOptions, + createSubscriptionList, +) from util.events.SessionRouter import SessionRouter @@ -20,8 +22,9 @@ def parseCmdLine(): parser = ArgumentParser( - formatter_class=RawTextHelpFormatter, - description="Entitlements verification subscription example") + formatter_class=RawTextHelpFormatter, + description="Entitlements verification subscription example", + ) addConnectionAndAuthOptions(parser, forClientServerSetup=True) addSubscriptionOptions(parser) @@ -37,7 +40,6 @@ def parseCmdLine(): class EntitlementsVerificationSubscriptionExample: - def __init__(self, options): self._options = options self._router = SessionRouter() @@ -47,18 +49,24 @@ def __init__(self, options): self._router.addExceptionHandler(self._handleException) - self._router.addMessageHandlerByMessageType(Names.SESSION_STARTED, - self._handleSessionStarted) - self._router.addMessageHandlerByMessageType(Names.SESSION_STARTUP_FAILURE, - self._handleSessionStartupFailure) - self._router.addMessageHandlerByMessageType(Names.SESSION_TERMINATED, - self._handleSessionTerminated) - self._router.addMessageHandlerByMessageType(Names.SERVICE_OPENED, - self._handleServiceOpened) - self._router.addMessageHandlerByMessageType(Names.SERVICE_OPEN_FAILURE, - self._handleServiceOpenFailure) - self._router.addMessageHandlerByMessageType(Name("EntitlementChanged"), - self._handleEntitlementChanged) + self._router.addMessageHandlerByMessageType( + Names.SESSION_STARTED, self._handleSessionStarted + ) + self._router.addMessageHandlerByMessageType( + Names.SESSION_STARTUP_FAILURE, self._handleSessionStartupFailure + ) + self._router.addMessageHandlerByMessageType( + Names.SESSION_TERMINATED, self._handleSessionTerminated + ) + self._router.addMessageHandlerByMessageType( + Names.SERVICE_OPENED, self._handleServiceOpened + ) + self._router.addMessageHandlerByMessageType( + Names.SERVICE_OPEN_FAILURE, self._handleServiceOpenFailure + ) + self._router.addMessageHandlerByMessageType( + Name("EntitlementChanged"), self._handleEntitlementChanged + ) @property def stopped(self): @@ -80,20 +88,24 @@ def _openServices(self): def _authorizeUsers(self): # Authorize each of the users - authOptionsByIdentifier = \ - createClientServerSetupAuthOptions(self._options) + authOptionsByIdentifier = createClientServerSetupAuthOptions( + self._options + ) for identifier, authOptions in authOptionsByIdentifier.items(): cid = blpapi.CorrelationId(identifier) self._session.generateAuthorizedIdentity(authOptions, cid) def _subscribe(self): - self._router.addMessageHandlerByEventType(blpapi.Event.SUBSCRIPTION_DATA, - self._handleSubscriptionData) - self._router.addMessageHandlerByMessageType(Names.SUBSCRIPTION_FAILURE, - self._handleSubscriptionFailure) - self._router.addMessageHandlerByMessageType(Names.SUBSCRIPTION_TERMINATED, - self._handleSubscriptionTerminated) + self._router.addEventHandlerByEventType( + blpapi.Event.SUBSCRIPTION_DATA, self._handleSubscriptionData + ) + self._router.addMessageHandlerByMessageType( + Names.SUBSCRIPTION_FAILURE, self._handleSubscriptionFailure + ) + self._router.addMessageHandlerByMessageType( + Names.SUBSCRIPTION_TERMINATED, self._handleSubscriptionTerminated + ) print("Subscribing...") subscriptionList = createSubscriptionList(self._options) @@ -107,12 +119,15 @@ def _handleSessionStarted(self, *_): # Add the authorization messages handlers after the session # started to only react to the authorization messages of users, # i.e., avoid those of the session identity. - self._router.addMessageHandlerByMessageType(Names.AUTHORIZATION_SUCCESS, - self._handleAuthorizationSuccess) - self._router.addMessageHandlerByMessageType(Names.AUTHORIZATION_FAILURE, - self._handleAuthorizationFailure) - self._router.addMessageHandlerByMessageType(Names.AUTHORIZATION_REVOKED, - self._handleAuthorizationRevoked) + self._router.addMessageHandlerByMessageType( + Names.AUTHORIZATION_SUCCESS, self._handleAuthorizationSuccess + ) + self._router.addMessageHandlerByMessageType( + Names.AUTHORIZATION_FAILURE, self._handleAuthorizationFailure + ) + self._router.addMessageHandlerByMessageType( + Names.AUTHORIZATION_REVOKED, self._handleAuthorizationRevoked + ) self._authorizeUsers() self._openServices() @@ -146,7 +161,9 @@ def _handleServiceOpenFailure(self, _1, _2, message: Message): if serviceName == self._options.service: self._stop() else: - raise Exception(f"A service which is unknown failed to open: {serviceName}") + raise Exception( + f"A service which is unknown failed to open: {serviceName}" + ) @staticmethod def _handleEntitlementChanged(_1, _2, message: Message): @@ -155,32 +172,39 @@ def _handleEntitlementChanged(_1, _2, message: Message): userIdentifier = correlationId.value() print(f"Entitlements updated for {userIdentifier}") - def _handleSubscriptionData(self, _1, _2, message: Message): - topic = message.correlationId().value() + def _handleSubscriptionData(self, _, event: Event): + for message in event: + topic = message.correlationId().value() - service = message.service() + service = message.service() - if message.hasElement(EID, excludeNullElements=True): - entitlements = message.getElement(EID) + if message.hasElement(EID, excludeNullElements=True): + entitlements = message.getElement(EID) - for cid, identity in self._identitiesByCorrelationId.items(): - userIdentifier = cid.value() - isAuthorizedForAllEntitlements, failedEntitlements = \ - identity.getFailedEntitlements(service, entitlements) - if isAuthorizedForAllEntitlements: - print(f"{userIdentifier} is entitled to get data for: {topic}") + for cid, identity in self._identitiesByCorrelationId.items(): + userIdentifier = cid.value() + ( + isAuthorizedForAllEntitlements, + failedEntitlements, + ) = identity.getFailedEntitlements(service, entitlements) + if isAuthorizedForAllEntitlements: + print( + f"{userIdentifier} is entitled to get data for: {topic}" + ) - # Now distribute the message to the user. - else: - print(f"{userIdentifier} is NOT entitled to get data for: " - f"{topic} - Failed eids: {failedEntitlements}") + # Now distribute the message to the user. + else: + print( + f"{userIdentifier} is NOT entitled to get data for: " + f"{topic} - Failed eids: {failedEntitlements}" + ) - else: - print(f"No entitlements are required for: {topic}") + else: + print(f"No entitlements are required for: {topic}") - # Now distribute the message to the authorized users. + # Now distribute the message to the authorized users. - print() + print() @staticmethod def _handleSubscriptionFailure(_1, _2, message: Message): @@ -192,10 +216,9 @@ def _handleSubscriptionTerminated(_1, _2, message: Message): topic = message.correlationId().value() print(f"Subscription terminated: {topic}") - def _handleAuthorizationSuccess(self, - session: AbstractSession, - _, - message: Message): + def _handleAuthorizationSuccess( + self, session: AbstractSession, _, message: Message + ): correlationId = message.correlationId() userIdentifier = correlationId.value() print(f"Successfully authorized {userIdentifier}") diff --git a/examples/demoapps/GenerateTokenExample.py b/examples/demoapps/GenerateTokenExample.py index 6cecae5..1d8b63f 100644 --- a/examples/demoapps/GenerateTokenExample.py +++ b/examples/demoapps/GenerateTokenExample.py @@ -17,7 +17,7 @@ class AuthOptionsAction(Action): """The action that parses authorization options from user input""" def __call__(self, parser, args, values, option_string=None): - vals = values.split('=', 1) + vals = values.split("=", 1) if vals[0] == AUTH_OPTION_USER: authOptions = AUTH_USER @@ -41,28 +41,33 @@ def parseCmdLine(): parser = ArgumentParser( description="Generate a token for a user to be used on the server side", - formatter_class=RawTextHelpFormatter) - parser.add_argument("-H", - "--host", - required=True, - dest="ipAndPort", - help="Server name or IP and port separated by ':'", - metavar="host:port") - parser.add_argument("-a", - "--auth", - required=True, - dest="authOptions", - help="Authentication option: \n" - " user as a user using OS logon information\n" - " dir= as a user using directory services\n" - " app= as the specified application\n" - " userapp= as user and application using logon information for the user\n", - metavar="option", - action=AuthOptionsAction) + formatter_class=RawTextHelpFormatter, + ) + parser.add_argument( + "-H", + "--host", + required=True, + dest="ipAndPort", + help="Server name or IP and port separated by ':'", + metavar="host:port", + ) + parser.add_argument( + "-a", + "--auth", + required=True, + dest="authOptions", + help="Authentication option: \n" + " user as a user using OS logon information\n" + " dir= as a user using directory services\n" + " app= as the specified application\n" + " userapp= as user and application using logon information for the user\n", + metavar="option", + action=AuthOptionsAction, + ) options = parser.parse_args() - ipAndPort = options.ipAndPort.split(':') + ipAndPort = options.ipAndPort.split(":") if len(ipAndPort) != 2: parser.error(f"Invalid host '{options.ipAndPort}'") @@ -110,7 +115,7 @@ def main(): if __name__ == "__main__": try: main() - except Exception as e: # pylint: disable=broad-except + except Exception as e: # pylint: disable=broad-except print(e) __copyright__ = """ diff --git a/examples/demoapps/InteractivePublisherExample.py b/examples/demoapps/InteractivePublisherExample.py index 685fb80..9e54545 100644 --- a/examples/demoapps/InteractivePublisherExample.py +++ b/examples/demoapps/InteractivePublisherExample.py @@ -1,8 +1,10 @@ from argparse import ArgumentParser, RawTextHelpFormatter from blpapi_import_helper import blpapi -from util.ConnectionAndAuthOptions import addConnectionAndAuthOptions, \ - createSessionOptions +from util.ConnectionAndAuthOptions import ( + addConnectionAndAuthOptions, + createSessionOptions, +) import threading import time @@ -11,14 +13,16 @@ class MyEventHandler(object): - def __init__(self, - serviceName, - eids, - resolveSubServiceCode, - mutex, - stop, - condition, - isPageData): + def __init__( + self, + serviceName, + eids, + resolveSubServiceCode, + mutex, + stop, + condition, + isPageData, + ): self.serviceName = serviceName self.eids = eids self.resolveSubServiceCode = resolveSubServiceCode @@ -49,8 +53,10 @@ def processEvent(self, event, session): resolvedTopic = msg.getElementAsString(RESOLVED_TOPIC) print(f"ResolvedTopic: {resolvedTopic}") elif msg.messageType() == blpapi.Names.RESOLUTION_FAILURE: - print("Topic resolution failed " - f"(CorrelationId = {msg.correlationId()})") + print( + "Topic resolution failed " + f"(CorrelationId = {msg.correlationId()})" + ) elif eventType == blpapi.Event.REQUEST: for msg in event: @@ -114,7 +120,6 @@ def processTopicStatusEvent(self, session, event): if len(unsubscribedTopics) > 0: session.deleteTopics(unsubscribedTopics) - def processPermissionRequest(self, session, msg): service = session.getService(self.serviceName) @@ -146,21 +151,25 @@ def processPermissionRequest(self, session, msg): ef.setElement("topic", topic) if self.resolveSubServiceCode: try: - ef.setElement("subServiceCode", - self.resolveSubServiceCode) - print(f"Mapping topic {topic} to subServiceCode" - f" {self.resolveSubServiceCode}") + ef.setElement("subServiceCode", self.resolveSubServiceCode) + print( + f"Mapping topic {topic} to subServiceCode" + f" {self.resolveSubServiceCode}" + ) except blpapi.Exception: - print("subServiceCode could not be set." - " Resolving without subServiceCode") + print( + "subServiceCode could not be set." + " Resolving without subServiceCode" + ) ef.setElement("result", permission) if permission == 1: # DENIED ef.pushElement("reason") ef.setElement("source", "My Publisher Name") ef.setElement("category", "NOT_AUTHORIZED") ef.setElement("subcategory", "Publisher Controlled") - ef.setElement("description", - "Permission denied by My Publisher Name") + ef.setElement( + "description", "Permission denied by My Publisher Name" + ) ef.popElement() elif self.eids: ef.pushElement("permissions") @@ -179,6 +188,7 @@ def processPermissionRequest(self, session, msg): # - partialResponse - that defaults to false. session.sendResponse(response) + def formatPageRecapEvent(eventFormatter): numRows = 5 eventFormatter.setElement("numRows", numRows) @@ -199,89 +209,120 @@ def formatPageRecapEvent(eventFormatter): eventFormatter.popElement() + def formatMarketDataRecapEvent(eventFormatter): eventFormatter.setElement("OPEN", 100.0) def parseCmdLine(): - parser = ArgumentParser(formatter_class=RawTextHelpFormatter, - description="Interactive data publisher.") + parser = ArgumentParser( + formatter_class=RawTextHelpFormatter, + description="Interactive data publisher.", + ) addConnectionAndAuthOptions(parser) publisher_group = parser.add_argument_group("Publisher Options") - publisher_group.add_argument("-s", "--service", - dest="service", - help="the service name", - required=True, - metavar="service") - publisher_group.add_argument("-g", "--group-id", - dest="groupId", - help="the group ID of the service, default to an " - "automatically generated unique value", - metavar="groupId") - publisher_group.add_argument("-p", "--priority", - type=int, - dest="priority", - help="the service priority (default: %(default)s)", - metavar="priority", - default=blpapi.ServiceRegistrationOptions.PRIORITY_HIGH) - publisher_group.add_argument("--register-ssc", - dest="ssc", - help="specify active sub-service code range and " - "priority separated by ','", - metavar="begin,end,priority") - publisher_group.add_argument("--clear-cache", - type=int, - dest="clearInterval", - help="number of events after which cache will be " - "cleared (default: 0 i.e cache never cleared)", - metavar="eventCount", - default=0) - publisher_group.add_argument("--resolve-ssc", - dest="rssc", - type=int, - help="sub-service code to be used in permission response", - metavar="subServiceCode") - publisher_group.add_argument("-E", "--eid", - dest="eids", - type=int, - help="EIDs that are used in permission response. Can be specified multiple times.", - metavar="eid", - action="append", - default=[]) - publisher_group.add_argument("-P", "--page", - dest="isPageData", - help="publish as page data", - action="store_true", - default=False) + publisher_group.add_argument( + "-s", + "--service", + dest="service", + help="the service name", + required=True, + metavar="service", + ) + publisher_group.add_argument( + "-g", + "--group-id", + dest="groupId", + help="the group ID of the service, default to an " + "automatically generated unique value", + metavar="groupId", + ) + publisher_group.add_argument( + "-p", + "--priority", + type=int, + dest="priority", + help="the service priority (default: %(default)s)", + metavar="priority", + default=blpapi.ServiceRegistrationOptions.PRIORITY_HIGH, + ) + publisher_group.add_argument( + "--register-ssc", + dest="ssc", + help="specify active sub-service code range and " + "priority separated by ','", + metavar="begin,end,priority", + ) + publisher_group.add_argument( + "--clear-cache", + type=int, + dest="clearInterval", + help="number of events after which cache will be " + "cleared (default: 0 i.e cache never cleared)", + metavar="eventCount", + default=0, + ) + publisher_group.add_argument( + "--resolve-ssc", + dest="rssc", + type=int, + help="sub-service code to be used in permission response", + metavar="subServiceCode", + ) + publisher_group.add_argument( + "-E", + "--eid", + dest="eids", + type=int, + help="EIDs that are used in permission response. Can be specified multiple times.", + metavar="eid", + action="append", + default=[], + ) + publisher_group.add_argument( + "-P", + "--page", + dest="isPageData", + help="publish as page data", + action="store_true", + default=False, + ) options = parser.parse_args() # Parse sub-service code range and priority if options.ssc: options.sscBegin, options.sscEnd, options.sscPriority = map( - int, options.ssc.split(",")) + int, options.ssc.split(",") + ) return options def activate(options, session): if options.ssc: - print("Activating sub service code range [" - f"{options.sscBegin}, {options.sscEnd}] @ {options.sscPriority}") - session.activateSubServiceCodeRange(options.service, - options.sscBegin, - options.sscEnd, - options.sscPriority) + print( + "Activating sub service code range [" + f"{options.sscBegin}, {options.sscEnd}] @ {options.sscPriority}" + ) + session.activateSubServiceCodeRange( + options.service, + options.sscBegin, + options.sscEnd, + options.sscPriority, + ) def deactivate(options, session): if options.ssc: - print("Deactivating sub service code range [" - f"{options.sscBegin}, {options.sscEnd}] @ {options.sscPriority}") - session.deactivateSubServiceCodeRange(options.service, - options.sscBegin, - options.sscEnd) + print( + "Deactivating sub service code range [" + f"{options.sscBegin}, {options.sscEnd}] @ {options.sscPriority}" + ) + session.deactivateSubServiceCodeRange( + options.service, options.sscBegin, options.sscEnd + ) def main(): @@ -291,17 +332,20 @@ def main(): stop = threading.Event() condition = threading.Condition(mutex) - myEventHandler = MyEventHandler(options.service, - options.eids, - options.rssc, - mutex, - stop, - condition, - options.isPageData) + myEventHandler = MyEventHandler( + options.service, + options.eids, + options.rssc, + mutex, + stop, + condition, + options.isPageData, + ) sessionOptions = createSessionOptions(options) - session = blpapi.ProviderSession(sessionOptions, - myEventHandler.processEvent) + session = blpapi.ProviderSession( + sessionOptions, myEventHandler.processEvent + ) if not session.start(): print("Failed to start session.") @@ -313,20 +357,24 @@ def main(): serviceOptions.setServicePriority(options.priority) if options.ssc: - print("Adding active sub-service code range [" - f"{options.sscBegin}, {options.sscEnd}] @ {options.sscPriority}") + print( + "Adding active sub-service code range [" + f"{options.sscBegin}, {options.sscEnd}] @ {options.sscPriority}" + ) try: - serviceOptions.addActiveSubServiceCodeRange(options.sscBegin, - options.sscEnd, - options.sscPriority) + serviceOptions.addActiveSubServiceCodeRange( + options.sscBegin, options.sscEnd, options.sscPriority + ) except blpapi.Exception as exception: - print("FAILED to add active sub-service codes." - f" Exception {exception.description()}") + print( + "FAILED to add active sub-service codes." + f" Exception {exception.description()}" + ) try: - if not session.registerService(options.service, - session.getAuthorizedIdentity(), - serviceOptions): + if not session.registerService( + options.service, session.getAuthorizedIdentity(), serviceOptions + ): print(f"Failed to register '{options.service}'") return @@ -335,13 +383,15 @@ def main(): while not stop.is_set(): with condition: if not condition.wait_for( - lambda: len(myEventHandler.activeTopics) > 0, - timeout=1): + lambda: len(myEventHandler.activeTopics) > 0, timeout=1 + ): continue publishNull = False - if options.clearInterval > 0 \ - and eventCount == options.clearInterval: + if ( + options.clearInterval > 0 + and eventCount == options.clearInterval + ): eventCount = 0 publishNull = True @@ -353,7 +403,9 @@ def main(): if options.isPageData: formatPageEvent(eventFormatter, topic, publishNull) else: - formatMarketDataEvent(eventFormatter, topic, publishNull) + formatMarketDataEvent( + eventFormatter, topic, publishNull + ) print("Publishing event:") for msg in event: @@ -371,6 +423,7 @@ def main(): print("Stopping the session") session.stop() + def formatMarketDataEvent(eventFormatter, topic, publishNull): # NOTE: This function demonstrates how to use the `Element`-based interface # of `EventFormatter` to format an `Event`. For an example of formatting an @@ -401,9 +454,7 @@ def formatPageEvent(eventFormatter, topic, publishNull): eventFormatter.appendMessage("RowUpdate", topic) secondsStr = time.strftime("%S", time.localtime()) - messageDict = { - "rowNum": i - } + messageDict = {"rowNum": i} if publishNull: messageDict["spanUpdate"] = {} else: diff --git a/examples/demoapps/MultipleRequestsOverrideExample.py b/examples/demoapps/MultipleRequestsOverrideExample.py index 3ca9536..7890998 100644 --- a/examples/demoapps/MultipleRequestsOverrideExample.py +++ b/examples/demoapps/MultipleRequestsOverrideExample.py @@ -1,6 +1,9 @@ from blpapi_import_helper import blpapi -from util.ConnectionAndAuthOptions import addConnectionAndAuthOptions, createSessionOptions +from util.ConnectionAndAuthOptions import ( + addConnectionAndAuthOptions, + createSessionOptions, +) from snippets.requestresponse import ReferenceDataRequests from util.RequestOptions import Override, REFDATA_SERVICE from collections import namedtuple @@ -9,8 +12,10 @@ def main(): - parser = ArgumentParser(formatter_class=RawTextHelpFormatter, - description="Multiple requests with override example") + parser = ArgumentParser( + formatter_class=RawTextHelpFormatter, + description="Multiple requests with override example", + ) addConnectionAndAuthOptions(parser) options = parser.parse_args() @@ -31,16 +36,20 @@ def main(): fieldIdVwapStartTime = "VWAP_START_TIME" fieldIdVwapEndTime = "VWAP_END_TIME" - Options = namedtuple('Options', ['securities', 'fields', 'overrides']) + Options = namedtuple("Options", ["securities", "fields", "overrides"]) # Request 1 startTime1 = "9:30" endTime1 = "11:30" - options = Options(["IBM US Equity", "MSFT US Equity"], - ["PX_LAST", "DS002"], - [Override(fieldIdVwapStartTime, startTime1), - Override(fieldIdVwapEndTime, endTime1)]) + options = Options( + ["IBM US Equity", "MSFT US Equity"], + ["PX_LAST", "DS002"], + [ + Override(fieldIdVwapStartTime, startTime1), + Override(fieldIdVwapEndTime, endTime1), + ], + ) request1 = ReferenceDataRequests.createRequest(service, options) @@ -77,7 +86,10 @@ def main(): print("Request 2 failed.") finalResponseCount += 1 - elif eventType in [blpapi.Event.RESPONSE, blpapi.Event.PARTIAL_RESPONSE]: + elif eventType in [ + blpapi.Event.RESPONSE, + blpapi.Event.PARTIAL_RESPONSE, + ]: if correlationId1 == msgCorrelationId: print("Received response for request 1") elif correlationId2 == msgCorrelationId: @@ -94,7 +106,7 @@ def main(): if __name__ == "__main__": try: main() - except Exception as e: # pylint: disable=broad-except + except Exception as e: # pylint: disable=broad-except print(e) __copyright__ = """ diff --git a/examples/demoapps/RequestResponseExample.py b/examples/demoapps/RequestResponseExample.py index 977037f..bb7c3bd 100644 --- a/examples/demoapps/RequestResponseExample.py +++ b/examples/demoapps/RequestResponseExample.py @@ -6,17 +6,29 @@ from snippets.requestresponse import IntradayBarRequests from snippets.requestresponse import ReferenceDataRequests from snippets.requestresponse import HistoricalDataRequest -from util.ConnectionAndAuthOptions import addConnectionAndAuthOptions, createSessionOptions -from util.RequestOptions import addRequestOptions, setDefaultValues, \ - REFERENCE_DATA_REQUEST_TABLE_OVERRIDE, REFERENCE_DATA_REQUEST_OVERRIDE, INTRADAY_BAR_REQUEST, \ - INTRADAY_TICK_REQUEST, REFERENCE_DATA_REQUEST, HISTORICAL_DATA_REQUEST +from util.ConnectionAndAuthOptions import ( + addConnectionAndAuthOptions, + createSessionOptions, +) +from util.RequestOptions import ( + addRequestOptions, + setDefaultValues, + REFERENCE_DATA_REQUEST_TABLE_OVERRIDE, + REFERENCE_DATA_REQUEST_OVERRIDE, + INTRADAY_BAR_REQUEST, + INTRADAY_TICK_REQUEST, + REFERENCE_DATA_REQUEST, + HISTORICAL_DATA_REQUEST, +) def parseCmdLine(): """Parse command line arguments""" - parser = ArgumentParser(formatter_class=RawTextHelpFormatter, - description="Request/Response Example") + parser = ArgumentParser( + formatter_class=RawTextHelpFormatter, + description="Request/Response Example", + ) addConnectionAndAuthOptions(parser) addRequestOptions(parser) @@ -42,8 +54,10 @@ def processGenericEvent(event): print(msg) messageType = msg.messageType() if eventType == blpapi.Event.SESSION_STATUS: - if messageType == blpapi.Names.SESSION_TERMINATED \ - or messageType == blpapi.Names.SESSION_STARTUP_FAILURE: + if ( + messageType == blpapi.Names.SESSION_TERMINATED + or messageType == blpapi.Names.SESSION_STARTUP_FAILURE + ): print("Session failed to start or terminated.") printContactSupportMessage(msg) return True @@ -91,11 +105,15 @@ def sendRequest(options, session): request = IntradayBarRequests.createRequest(service, options) elif requestType == INTRADAY_TICK_REQUEST: request = IntradayTickRequests.createRequest(service, options) - elif requestType in [REFERENCE_DATA_REQUEST, REFERENCE_DATA_REQUEST_OVERRIDE]: + elif requestType in [ + REFERENCE_DATA_REQUEST, + REFERENCE_DATA_REQUEST_OVERRIDE, + ]: request = ReferenceDataRequests.createRequest(service, options) elif requestType == REFERENCE_DATA_REQUEST_TABLE_OVERRIDE: request = ReferenceDataRequests.createTableOverrideRequest( - service, options) + service, options + ) elif requestType == HISTORICAL_DATA_REQUEST: request = HistoricalDataRequest.createRequest(service, options) @@ -104,8 +122,7 @@ def sendRequest(options, session): # in the response messages. The RequestId should be provided when # contacting support. print(f"Sending Request {request.getRequestId()}: {request}") - session.sendRequest(request, - None) # correlationId + session.sendRequest(request, None) # correlationId def waitForResponse(session, requestType): @@ -149,9 +166,11 @@ def processResponseEvent(event, requestType): IntradayBarRequests.processResponseEvent(event) elif requestType == INTRADAY_TICK_REQUEST: IntradayTickRequests.processResponseEvent(event) - elif requestType in [REFERENCE_DATA_REQUEST, - REFERENCE_DATA_REQUEST_OVERRIDE, - REFERENCE_DATA_REQUEST_TABLE_OVERRIDE]: + elif requestType in [ + REFERENCE_DATA_REQUEST, + REFERENCE_DATA_REQUEST_OVERRIDE, + REFERENCE_DATA_REQUEST_TABLE_OVERRIDE, + ]: ReferenceDataRequests.processResponseEvent(event) elif requestType == HISTORICAL_DATA_REQUEST: HistoricalDataRequest.processResponseEvent(event) @@ -185,7 +204,7 @@ def main(): if __name__ == "__main__": try: main() - except Exception as e: # pylint: disable=broad-except + except Exception as e: # pylint: disable=broad-except print(e) __copyright__ = """ diff --git a/examples/demoapps/RequestServiceConsumerExample.py b/examples/demoapps/RequestServiceConsumerExample.py index 0e0075e..ffc53a7 100644 --- a/examples/demoapps/RequestServiceConsumerExample.py +++ b/examples/demoapps/RequestServiceConsumerExample.py @@ -1,5 +1,8 @@ from blpapi_import_helper import blpapi -from util.ConnectionAndAuthOptions import addConnectionAndAuthOptions, createSessionOptions +from util.ConnectionAndAuthOptions import ( + addConnectionAndAuthOptions, + createSessionOptions, +) from argparse import ArgumentParser, RawTextHelpFormatter import time @@ -12,9 +15,11 @@ def parseCmdLine(): """Parse command line arguments""" - parser = ArgumentParser(formatter_class=RawTextHelpFormatter, - description="Request service consumer example, to be used in " - "conjunction with RequestServiceProviderExample") + parser = ArgumentParser( + formatter_class=RawTextHelpFormatter, + description="Request service consumer example, to be used in " + "conjunction with RequestServiceProviderExample", + ) addConnectionAndAuthOptions(parser) options = parser.parse_args() return options @@ -78,7 +83,7 @@ def main(): if __name__ == "__main__": try: main() - except Exception as e: # pylint: disable=broad-except + except Exception as e: # pylint: disable=broad-except print(e) diff --git a/examples/demoapps/RequestServiceProviderExample.py b/examples/demoapps/RequestServiceProviderExample.py index 6c1286d..3db7e0e 100644 --- a/examples/demoapps/RequestServiceProviderExample.py +++ b/examples/demoapps/RequestServiceProviderExample.py @@ -1,7 +1,10 @@ from argparse import ArgumentParser, RawTextHelpFormatter from blpapi_import_helper import blpapi -from util.ConnectionAndAuthOptions import addConnectionAndAuthOptions, createSessionOptions +from util.ConnectionAndAuthOptions import ( + addConnectionAndAuthOptions, + createSessionOptions, +) import time @@ -22,9 +25,11 @@ def parseCmdLine(): """Parse command line arguments""" - parser = ArgumentParser(formatter_class=RawTextHelpFormatter, - description="Request service provider example, to be used in " - "conjunction with RequestServiceConsumerExample") + parser = ArgumentParser( + formatter_class=RawTextHelpFormatter, + description="Request service provider example, to be used in " + "conjunction with RequestServiceConsumerExample", + ) addConnectionAndAuthOptions(parser) options = parser.parse_args() return options @@ -116,7 +121,7 @@ def main(): if __name__ == "__main__": try: main() - except Exception as e: # pylint: disable=broad-except + except Exception as e: # pylint: disable=broad-except print(e) diff --git a/examples/demoapps/SecurityLookupExample.py b/examples/demoapps/SecurityLookupExample.py index 494c8bc..3be1150 100644 --- a/examples/demoapps/SecurityLookupExample.py +++ b/examples/demoapps/SecurityLookupExample.py @@ -5,7 +5,10 @@ from snippets.instruments import CurveListRequests from snippets.instruments import GovtListRequests from snippets.instruments import InstrumentListRequests -from util.ConnectionAndAuthOptions import addConnectionAndAuthOptions, createSessionOptions +from util.ConnectionAndAuthOptions import ( + addConnectionAndAuthOptions, + createSessionOptions, +) from collections import namedtuple INSTRUMENT_SERVICE = "//blp/instruments" @@ -22,7 +25,7 @@ "type", "subtype", "curveid", - "bbgid" + "bbgid", ] REQUEST_FAILURE = blpapi.Name("RequestFailure") @@ -31,14 +34,14 @@ SERVICE_OPEN_FAILURE = blpapi.Name("ServiceOpenFailure") # Defines a filter that is used in a //blp/instruments request. -InstrumentsFilter = namedtuple('InstrumentsFilter', ['name', 'value']) +InstrumentsFilter = namedtuple("InstrumentsFilter", ["name", "value"]) class FilterAction(Action): """The action that parses filter options from user input""" def __call__(self, parser, args, values, option_string=None): - vals = values.split('=', 1) + vals = values.split("=", 1) if len(vals) != 2: parser.error(f"Invalid filter option '{values}'") @@ -49,40 +52,55 @@ def __call__(self, parser, args, values, option_string=None): def parseCmdLine(): """Parse command line arguments""" - parser = ArgumentParser(formatter_class=RawTextHelpFormatter, - description="Security Lookup Example") + parser = ArgumentParser( + formatter_class=RawTextHelpFormatter, + description="Security Lookup Example", + ) addConnectionAndAuthOptions(parser) lookup_group = parser.add_argument_group("Security Lookup Options") - lookup_group.add_argument("-r", "--request", - dest="requestType", - choices=[INSTRUMENT_LIST_REQUEST, - CURVE_LIST_REQUEST, - GOVT_LIST_REQUEST], - help="specify the request type (default: %(default)s)", - metavar="requestType", - default=INSTRUMENT_LIST_REQUEST) - lookup_group.add_argument("-S", "--security", - dest="query", - help="security query string", - metavar="security") - lookup_group.add_argument("--max-results", - dest="maxResults", - help="max results returned in the response (default: %(default)d)", - metavar="maxResults", - type=int, - default=10) - lookup_group.add_argument("-F", "--filter", - dest="filters", - help=f'''filter and value separated by '=', e.g., countryCode=US. Can be specified multiple times. + lookup_group.add_argument( + "-r", + "--request", + dest="requestType", + choices=[ + INSTRUMENT_LIST_REQUEST, + CURVE_LIST_REQUEST, + GOVT_LIST_REQUEST, + ], + help="specify the request type (default: %(default)s)", + metavar="requestType", + default=INSTRUMENT_LIST_REQUEST, + ) + lookup_group.add_argument( + "-S", + "--security", + dest="query", + help="security query string", + metavar="security", + ) + lookup_group.add_argument( + "--max-results", + dest="maxResults", + help="max results returned in the response (default: %(default)d)", + metavar="maxResults", + type=int, + default=10, + ) + lookup_group.add_argument( + "-F", + "--filter", + dest="filters", + help=f"""filter and value separated by '=', e.g., countryCode=US. Can be specified multiple times. The applicable filters for each request: {INSTRUMENT_LIST_REQUEST}: {FILTERS_INSTRUMENTS} {CURVE_LIST_REQUEST} : {FILTERS_CURVE} -{GOVT_LIST_REQUEST} : {FILTERS_GOVT}''', - metavar="=", - action=FilterAction, - default=[]) +{GOVT_LIST_REQUEST} : {FILTERS_GOVT}""", + metavar="=", + action=FilterAction, + default=[], + ) options = parser.parse_args() @@ -98,19 +116,22 @@ def sendRequest(options, session): instrumentsService, options.query, options.maxResults, - options.filters) + options.filters, + ) elif requestType == GOVT_LIST_REQUEST: request = GovtListRequests.createRequest( instrumentsService, options.query, options.maxResults, - options.filters) + options.filters, + ) elif requestType == INSTRUMENT_LIST_REQUEST: request = InstrumentListRequests.createRequest( instrumentsService, options.query, options.maxResults, - options.filters) + options.filters, + ) print(f"Sending Request {request}") session.sendRequest(request) diff --git a/examples/demoapps/SnapshotRequestTemplateExample.py b/examples/demoapps/SnapshotRequestTemplateExample.py index d9851ba..c4e5288 100644 --- a/examples/demoapps/SnapshotRequestTemplateExample.py +++ b/examples/demoapps/SnapshotRequestTemplateExample.py @@ -2,13 +2,15 @@ from threading import Condition, Lock from blpapi_import_helper import blpapi from blpapi import Names -from util.ConnectionAndAuthOptions import \ - addConnectionAndAuthOptions, \ - createSessionOptions -from util.SubscriptionOptions import \ - addSubscriptionOptionsForSnapshot, \ - setSubscriptionSessionOptions, \ - createSubscriptionStrings +from util.ConnectionAndAuthOptions import ( + addConnectionAndAuthOptions, + createSessionOptions, +) +from util.SubscriptionOptions import ( + addSubscriptionOptionsForSnapshot, + setSubscriptionSessionOptions, + createSubscriptionStrings, +) import time # Requests are throttled in the infrastructure. Snapshot request templates send @@ -45,8 +47,9 @@ def __str__(self): def parseCmdLine(): """Parse command line arguments""" - parser = ArgumentParser(formatter_class=RawTextHelpFormatter, - description="Retrieve Snapshots") + parser = ArgumentParser( + formatter_class=RawTextHelpFormatter, description="Retrieve Snapshots" + ) addConnectionAndAuthOptions(parser) addSubscriptionOptionsForSnapshot(parser) @@ -56,7 +59,6 @@ def parseCmdLine(): class SnapshotRequestTemplateExample: - def __init__(self): self._snapshots = {} @@ -89,7 +91,9 @@ def _createTemplates(self, session, options): self._responseCount = len(subscriptionStrings) for userTopic, subscriptionString in subscriptionStrings.items(): self.d_templateBatchingCondition.wait_for( - lambda: not self._running or self._templateCount < TEMPLATE_BATCH_SIZE) + lambda: not self._running + or self._templateCount < TEMPLATE_BATCH_SIZE + ) if not self._running: break @@ -99,14 +103,15 @@ def _createTemplates(self, session, options): statusCid = blpapi.CorrelationId(MyCorrelation(userTopic)) requestTemplate = session.createSnapshotRequestTemplate( - subscriptionString, - statusCid) + subscriptionString, statusCid + ) self._snapshots[statusCid] = requestTemplate # Wait until all the request templates have finished, either # success or failure. self._responseCondition.wait_for( - lambda: not self._running or self._responseCount == 0) + lambda: not self._running or self._responseCount == 0 + ) def _sendRequests(self, session): while True: @@ -122,13 +127,17 @@ def _sendRequests(self, session): print(f"Sending request for {userTopic}") session.sendRequestTemplate( template, - blpapi.CorrelationId(MyCorrelation(userTopic))) + blpapi.CorrelationId(MyCorrelation(userTopic)), + ) print("Waiting for the responses..., Press [Ctrl-C] to exit\n") self._responseCondition.wait_for( - lambda: not self._running or self._responseCount == 0) + lambda: not self._running or self._responseCount == 0 + ) - print("Received all the responses, will send next request in 5 seconds\n") + print( + "Received all the responses, will send next request in 5 seconds\n" + ) time.sleep(5) def run(self): @@ -153,7 +162,9 @@ def run(self): if self._snapshots: self._sendRequests(session) else: - print("Failed to create all the request templates, stopping...") + print( + "Failed to create all the request templates, stopping..." + ) finally: session.stop() @@ -167,8 +178,10 @@ def processEvent(self, event, _): cid = msg.correlationId() myCorrelation = cid.value() if messageType == Names.REQUEST_TEMPLATE_AVAILABLE: - print("Request template is successfully created for topic" - f" {myCorrelation}") + print( + "Request template is successfully created for topic" + f" {myCorrelation}" + ) print(msg) with self._lock: diff --git a/examples/demoapps/SubscriptionExample.py b/examples/demoapps/SubscriptionExample.py index af354f1..3c75d35 100644 --- a/examples/demoapps/SubscriptionExample.py +++ b/examples/demoapps/SubscriptionExample.py @@ -4,13 +4,15 @@ from blpapi_import_helper import blpapi -from util.SubscriptionOptions import \ - addSubscriptionOptions, \ - setSubscriptionSessionOptions, \ - createSubscriptionList -from util.ConnectionAndAuthOptions import \ - addConnectionAndAuthOptions, \ - createSessionOptions +from util.SubscriptionOptions import ( + addSubscriptionOptions, + setSubscriptionSessionOptions, + createSubscriptionList, +) +from util.ConnectionAndAuthOptions import ( + addConnectionAndAuthOptions, + createSessionOptions, +) DEFAULT_QUEUE_SIZE = 10000 @@ -42,24 +44,32 @@ def processSubscriptionDataEvent(self, event): def processMiscEvents(self, event): for msg in event: if msg.messageType() == blpapi.Names.SLOW_CONSUMER_WARNING: - print(f"{blpapi.Names.SLOW_CONSUMER_WARNING} - The event queue is " + - "beginning to approach its maximum capacity and " + - "the application is not processing the data fast " + - "enough. This could lead to ticks being dropped" + - " (DataLoss).\n") - elif msg.messageType() == blpapi.Names.SLOW_CONSUMER_WARNING_CLEARED: - print(f"{blpapi.Names.SLOW_CONSUMER_WARNING_CLEARED} - the event " + - "queue has shrunk enough that there is no " + - "longer any immediate danger of overflowing the " + - "queue. If any precautionary actions were taken " + - "when SlowConsumerWarning message was delivered, " + - "it is now safe to continue as normal.\n") + print( + f"{blpapi.Names.SLOW_CONSUMER_WARNING} - The event queue is " + + "beginning to approach its maximum capacity and " + + "the application is not processing the data fast " + + "enough. This could lead to ticks being dropped" + + " (DataLoss).\n" + ) + elif ( + msg.messageType() == blpapi.Names.SLOW_CONSUMER_WARNING_CLEARED + ): + print( + f"{blpapi.Names.SLOW_CONSUMER_WARNING_CLEARED} - the event " + + "queue has shrunk enough that there is no " + + "longer any immediate danger of overflowing the " + + "queue. If any precautionary actions were taken " + + "when SlowConsumerWarning message was delivered, " + + "it is now safe to continue as normal.\n" + ) elif msg.messageType() == blpapi.Names.DATA_LOSS: print(msg) topic = msg.correlationId().value() - print(f"{blpapi.Names.DATA_LOSS} - The application is too slow to " + - "process events and the event queue is overflowing. " + - f"Data is lost for topic {topic}.\n") + print( + f"{blpapi.Names.DATA_LOSS} - The application is too slow to " + + "process events and the event queue is overflowing. " + + f"Data is lost for topic {topic}.\n" + ) elif event.eventType() == blpapi.Event.SESSION_STATUS: # SESSION_STATUS events can happen at any time and # should be handled as the session can be terminated, @@ -85,8 +95,10 @@ def processEvent(self, event, _session): def parseCmdLine(): """Parse command line arguments""" - parser = ArgumentParser(formatter_class=RawTextHelpFormatter, - description="Asynchronous subscription with event handler") + parser = ArgumentParser( + formatter_class=RawTextHelpFormatter, + description="Asynchronous subscription with event handler", + ) addConnectionAndAuthOptions(parser) addSubscriptionOptions(parser) @@ -97,7 +109,8 @@ def parseCmdLine(): help="The maximum number of events that is buffered by the session (default: %(default)d)", type=int, metavar="eventQueueSize", - default=DEFAULT_QUEUE_SIZE) + default=DEFAULT_QUEUE_SIZE, + ) options = parser.parse_args() diff --git a/examples/demoapps/SubscriptionWithEventPollingExample.py b/examples/demoapps/SubscriptionWithEventPollingExample.py index 58f7509..fcd77b8 100644 --- a/examples/demoapps/SubscriptionWithEventPollingExample.py +++ b/examples/demoapps/SubscriptionWithEventPollingExample.py @@ -3,21 +3,25 @@ from blpapi_import_helper import blpapi from blpapi import Names -from util.SubscriptionOptions import \ - addSubscriptionOptions, \ - setSubscriptionSessionOptions, \ - createSubscriptionList -from util.ConnectionAndAuthOptions import \ - addConnectionAndAuthOptions, \ - createSessionOptions +from util.SubscriptionOptions import ( + addSubscriptionOptions, + setSubscriptionSessionOptions, + createSubscriptionList, +) +from util.ConnectionAndAuthOptions import ( + addConnectionAndAuthOptions, + createSessionOptions, +) from util.MaxEventsOption import addMaxEventsOption def parseCmdLine(): """Parse command line arguments""" - parser = ArgumentParser(formatter_class=RawTextHelpFormatter, - description="Subscription example with event polling") + parser = ArgumentParser( + formatter_class=RawTextHelpFormatter, + description="Subscription example with event polling", + ) addSubscriptionOptions(parser) addConnectionAndAuthOptions(parser) addMaxEventsOption(parser) @@ -26,6 +30,7 @@ def parseCmdLine(): return options + def checkFailures(session): """Checks failure events published by the session.""" @@ -43,6 +48,7 @@ def checkFailures(session): if processGenericMessage(eventType, msg): return + def processSubscriptionEvents(session, maxEvents): eventCount = 0 while True: @@ -54,8 +60,10 @@ def processSubscriptionEvents(session, maxEvents): messageType = msg.messageType() messageCorrelationId = msg.correlationId() if eventType == blpapi.Event.SUBSCRIPTION_STATUS: - if messageType == Names.SUBSCRIPTION_FAILURE \ - or messageType == Names.SUBSCRIPTION_TERMINATED: + if ( + messageType == Names.SUBSCRIPTION_FAILURE + or messageType == Names.SUBSCRIPTION_TERMINATED + ): topic = messageCorrelationId.value() print(f"Subscription failed for topic {topic}") printContactSupportMessage(msg) @@ -69,7 +77,9 @@ def processSubscriptionEvents(session, maxEvents): # RequestId that is used to identify the # source of the data and can be used when # contacting support - print(f"Received init paint with RequestId {msg.getRequestId()}") + print( + f"Received init paint with RequestId {msg.getRequestId()}" + ) else: # SESSION_STATUS events can happen at any time and @@ -84,6 +94,7 @@ def processSubscriptionEvents(session, maxEvents): if eventCount >= maxEvents: break + def processGenericMessage(eventType, message): """Prints error information if the 'message' is a failure message.""" @@ -95,8 +106,10 @@ def processGenericMessage(eventType, message): # session, in which case, applications only need to check session status # messages. Applications don't need to handle token or authorization messages if eventType == blpapi.Event.SESSION_STATUS: - if messageType == Names.SESSION_TERMINATED or \ - messageType == Names.SESSION_STARTUP_FAILURE: + if ( + messageType == Names.SESSION_TERMINATED + or messageType == Names.SESSION_STARTUP_FAILURE + ): print("Session failed to start or terminated") printContactSupportMessage(message) # Session failed to start/terminated @@ -110,6 +123,7 @@ def processGenericMessage(eventType, message): # Session OK return False + def printContactSupportMessage(msg): """Prints contact support message.""" @@ -146,10 +160,11 @@ def main(): finally: session.stop() + if __name__ == "__main__": try: main() - except Exception as e: # pylint: disable=broad-except + except Exception as e: # pylint: disable=broad-except print(e) __copyright__ = """ diff --git a/examples/demoapps/UserModeExample.py b/examples/demoapps/UserModeExample.py index 980d9ea..16de5cd 100644 --- a/examples/demoapps/UserModeExample.py +++ b/examples/demoapps/UserModeExample.py @@ -2,10 +2,11 @@ from blpapi_import_helper import blpapi from blpapi import Session, Names, CorrelationId -from util.ConnectionAndAuthOptions import \ - addConnectionAndAuthOptions, \ - createClientServerSetupAuthOptions, \ - createSessionOptions +from util.ConnectionAndAuthOptions import ( + addConnectionAndAuthOptions, + createClientServerSetupAuthOptions, + createSessionOptions, +) from util.events.SessionRouter import SessionRouter from functools import partial @@ -29,16 +30,21 @@ def __init__(self, options): self._router.addExceptionHandler(self._handleException) self._router.addMessageHandlerByMessageType( - Names.SESSION_STARTED, self._handleSessionStarted) + Names.SESSION_STARTED, self._handleSessionStarted + ) self._router.addMessageHandlerByMessageType( - Names.SESSION_STARTUP_FAILURE, self._handleSessionStartupFailure) + Names.SESSION_STARTUP_FAILURE, self._handleSessionStartupFailure + ) self._router.addMessageHandlerByMessageType( - Names.SESSION_TERMINATED, self._handleSessionTerminated) + Names.SESSION_TERMINATED, self._handleSessionTerminated + ) self._router.addMessageHandlerByMessageType( - Names.SERVICE_OPENED, self._handleServiceOpened) + Names.SERVICE_OPENED, self._handleServiceOpened + ) self._router.addMessageHandlerByMessageType( - Names.SERVICE_OPEN_FAILURE, self._handleServiceOpenFailure) + Names.SERVICE_OPEN_FAILURE, self._handleServiceOpenFailure + ) @property def stopped(self): @@ -61,43 +67,54 @@ def _handleException(self, _session, _event, exception): print(exception) self._stop() - def _handleSessionStarted(self, - _session: blpapi.AbstractSession, - _event: blpapi.Event, - _msg: blpapi.Message): + def _handleSessionStarted( + self, + _session: blpapi.AbstractSession, + _event: blpapi.Event, + _msg: blpapi.Message, + ): # Add the authorization messages handlers after the session # started to only react to the authorization messages of users, # i.e., avoid those of the session identity. self._router.addMessageHandlerByMessageType( - Names.AUTHORIZATION_SUCCESS, self._handleAuthorizationSuccess) + Names.AUTHORIZATION_SUCCESS, self._handleAuthorizationSuccess + ) self._router.addMessageHandlerByMessageType( - Names.AUTHORIZATION_FAILURE, self._handleAuthorizationFailure) + Names.AUTHORIZATION_FAILURE, self._handleAuthorizationFailure + ) self._router.addMessageHandlerByMessageType( - Names.AUTHORIZATION_REVOKED, self._handleAuthorizationRevoked) + Names.AUTHORIZATION_REVOKED, self._handleAuthorizationRevoked + ) # both actions will run concurrently self._openServices() self._authorizeUsers() - def _handleSessionStartupFailure(self, - _session: blpapi.AbstractSession, - _event: blpapi.Event, - _msg: blpapi.Message): + def _handleSessionStartupFailure( + self, + _session: blpapi.AbstractSession, + _event: blpapi.Event, + _msg: blpapi.Message, + ): print("Failed to start session. Exiting...") self._sessionTerminatedSignal.set() - def _handleSessionTerminated(self, - _session: blpapi.AbstractSession, - _event: blpapi.Event, - _msg: blpapi.Message): + def _handleSessionTerminated( + self, + _session: blpapi.AbstractSession, + _event: blpapi.Event, + _msg: blpapi.Message, + ): print("Session terminated. Exiting...") self._sessionTerminatedSignal.set() - def _handleServiceOpened(self, - session: blpapi.AbstractSession, - _event: blpapi.Event, - message: blpapi.Message): + def _handleServiceOpened( + self, + session: blpapi.AbstractSession, + _event: blpapi.Event, + message: blpapi.Message, + ): serviceName = message["serviceName"] self._refDataService = session.getService(serviceName) @@ -109,10 +126,12 @@ def _handleServiceOpened(self, self._sendRefDataRequest(identity, userIdentifier) print(f"A service was opened: {serviceName}") - def _handleServiceOpenFailure(self, - _session: blpapi.AbstractSession, - _event: blpapi.Event, - message: blpapi.Message): + def _handleServiceOpenFailure( + self, + _session: blpapi.AbstractSession, + _event: blpapi.Event, + message: blpapi.Message, + ): serviceName = message["serviceName"] if serviceName == REFDATA_SVC_NAME: print(f"Failed to open service '{serviceName}', stopping...") @@ -121,10 +140,12 @@ def _handleServiceOpenFailure(self, raise RuntimeError(f"An unknown service failed to open: {serviceName}") - def _handleAuthorizationSuccess(self, - session: blpapi.AbstractSession, - _event: blpapi.Event, - message: blpapi.Message): + def _handleAuthorizationSuccess( + self, + session: blpapi.AbstractSession, + _event: blpapi.Event, + message: blpapi.Message, + ): correlationId = message.correlationId() userIdentifier = correlationId.value() print(f"Successfully authorized {userIdentifier}") @@ -138,22 +159,26 @@ def _handleAuthorizationSuccess(self, userIdentifier = correlationId.value() self._sendRefDataRequest(identity, userIdentifier) else: - pass # the request will be sent by open service handler - - def _handleAuthorizationFailure(self, - _session: blpapi.AbstractSession, - _event: blpapi.Event, - message: blpapi.Message): + pass # the request will be sent by open service handler + + def _handleAuthorizationFailure( + self, + _session: blpapi.AbstractSession, + _event: blpapi.Event, + message: blpapi.Message, + ): correlationId = message.correlationId() self._router.removeMessageHandlerByCorrelationId(correlationId) userIdentifier = correlationId.value() print(f"Failed to authorize {userIdentifier}") - def _handleAuthorizationRevoked(self, - _session: blpapi.AbstractSession, - _event: blpapi.Event, - message: blpapi.Message): + def _handleAuthorizationRevoked( + self, + _session: blpapi.AbstractSession, + _event: blpapi.Event, + message: blpapi.Message, + ): correlationId = message.correlationId() self._router.removeMessageHandlerByCorrelationId(correlationId) @@ -166,11 +191,13 @@ def _handleAuthorizationRevoked(self, def _authorizeUsers(self): # Authorize each of the users authOptionsByIdentifier = createClientServerSetupAuthOptions( - self._options) + self._options + ) for userIdentifier, authOptions in authOptionsByIdentifier.items(): correlationId = blpapi.CorrelationId(userIdentifier) self._session.generateAuthorizedIdentity( - authOptions, correlationId) + authOptions, correlationId + ) def _openServices(self): self._session.openServiceAsync(REFDATA_SVC_NAME) @@ -188,7 +215,7 @@ def _sendRefDataRequest(self, identity, userId): requestDict = { "securities": self._options.securities, "fields": ["PX_LAST", "DS002"], - "returnEids": True + "returnEids": True, } request.fromPy(requestDict) @@ -197,14 +224,17 @@ def _sendRefDataRequest(self, identity, userId): correlationId = CorrelationId("example") self._router.addMessageHandlerByCorrelationId( correlationId, - partial(UserModeExample._processResponseMessage, userId)) + partial(UserModeExample._processResponseMessage, userId), + ) self._session.sendRequest(request, identity, correlationId) @staticmethod - def _processResponseMessage(userId, - _session: blpapi.Session, - _event: blpapi.Event, - message: blpapi.Message): + def _processResponseMessage( + userId, + _session: blpapi.Session, + _event: blpapi.Event, + message: blpapi.Message, + ): if message.messageType() == Names.REQUEST_FAILURE: print(f"Request failed for {userId}.") else: @@ -214,17 +244,20 @@ def _processResponseMessage(userId, def parseCmdLine(): """Parse command line arguments""" parser = ArgumentParser( - description="User Mode Example", - formatter_class=RawTextHelpFormatter) + description="User Mode Example", formatter_class=RawTextHelpFormatter + ) addConnectionAndAuthOptions(parser, forClientServerSetup=True) - parser.add_argument("-S", "--security", - dest="securities", - help="security used in ReferenceDataRequest (default:" - " IBM US Equity). Can be specified multiple times", - metavar="security", - action="append", - default=[]) + parser.add_argument( + "-S", + "--security", + dest="securities", + help="security used in ReferenceDataRequest (default:" + " IBM US Equity). Can be specified multiple times", + metavar="security", + action="append", + default=[], + ) options = parser.parse_args() diff --git a/examples/demoapps/blpapi_import_helper/__init__.py b/examples/demoapps/blpapi_import_helper/__init__.py index 7b93bf5..e6d0fae 100644 --- a/examples/demoapps/blpapi_import_helper/__init__.py +++ b/examples/demoapps/blpapi_import_helper/__init__.py @@ -7,11 +7,15 @@ import sys import contextlib + @contextlib.contextmanager def _libdir(): - if sys.version_info >= (3, 8) and plat.system().lower() == "windows" \ - and os.getenv('BLPAPI_LIBDIR') is not None: - yield os.add_dll_directory(os.getenv('BLPAPI_LIBDIR')) + if ( + sys.version_info >= (3, 8) + and plat.system().lower() == "windows" + and os.getenv("BLPAPI_LIBDIR") is not None + ): + yield os.add_dll_directory(os.getenv("BLPAPI_LIBDIR")) else: yield None diff --git a/examples/demoapps/snippets/apiflds/ApiFieldsRequestUtils.py b/examples/demoapps/snippets/apiflds/ApiFieldsRequestUtils.py index b65fd1a..d9013f7 100644 --- a/examples/demoapps/snippets/apiflds/ApiFieldsRequestUtils.py +++ b/examples/demoapps/snippets/apiflds/ApiFieldsRequestUtils.py @@ -5,12 +5,16 @@ def printHeader(): - print(f'{"FIELD ID".ljust(ID_LEN)}' - f'{"MNEMONIC".ljust(MNEMONIC_LEN)}' - f'{"DESCRIPTION".ljust(DESC_LEN)}') - print(f'{"-----------".ljust(ID_LEN)}' - f'{"-----------".ljust(MNEMONIC_LEN)}' - f'{"-----------".ljust(DESC_LEN)}') + print( + f'{"FIELD ID".ljust(ID_LEN)}' + f'{"MNEMONIC".ljust(MNEMONIC_LEN)}' + f'{"DESCRIPTION".ljust(DESC_LEN)}' + ) + print( + f'{"-----------".ljust(ID_LEN)}' + f'{"-----------".ljust(MNEMONIC_LEN)}' + f'{"-----------".ljust(DESC_LEN)}' + ) def printField(field): @@ -20,9 +24,11 @@ def printField(field): fieldMnemonic = fieldInfo["mnemonic"] fieldDesc = fieldInfo["description"] - print(f"{fieldId.ljust(ID_LEN)}" - f"{fieldMnemonic.ljust(MNEMONIC_LEN)}" - f"{fieldDesc.ljust(DESC_LEN)}") + print( + f"{fieldId.ljust(ID_LEN)}" + f"{fieldMnemonic.ljust(MNEMONIC_LEN)}" + f"{fieldDesc.ljust(DESC_LEN)}" + ) else: errorMsg = field["fieldError"]["message"] diff --git a/examples/demoapps/snippets/apiflds/CategorizedFieldSearchRequests.py b/examples/demoapps/snippets/apiflds/CategorizedFieldSearchRequests.py index 7fa5cc3..762470e 100644 --- a/examples/demoapps/snippets/apiflds/CategorizedFieldSearchRequests.py +++ b/examples/demoapps/snippets/apiflds/CategorizedFieldSearchRequests.py @@ -23,8 +23,10 @@ def processResponse(event): for category in categories: category_name = category["categoryName"] category_id = category["categoryId"] - print(f"\nCategory Name: {category_name.ljust(ApiFieldsRequestUtils.CAT_NAME_LEN)}" - f"\tId: {category_id}") + print( + f"\nCategory Name: {category_name.ljust(ApiFieldsRequestUtils.CAT_NAME_LEN)}" + f"\tId: {category_id}" + ) ApiFieldsRequestUtils.printHeader() diff --git a/examples/demoapps/snippets/instruments/CurveListRequests.py b/examples/demoapps/snippets/instruments/CurveListRequests.py index a9b3b8e..9394a22 100644 --- a/examples/demoapps/snippets/instruments/CurveListRequests.py +++ b/examples/demoapps/snippets/instruments/CurveListRequests.py @@ -14,7 +14,8 @@ Name("type"), Name("subtype"), Name("publisher"), - Name("bbgid")] + Name("bbgid"), +] def createRequest(instrumentsService, query, maxResults, filters): @@ -38,13 +39,15 @@ def processResponse(event): print(f"Processing {len(results)} results:") for i, result in enumerate(results): - elements_values = [f"{n}={result[n]}" - for n in CURVE_RESPONSE_ELEMENTS] + elements_values = [ + f"{n}={result[n]}" for n in CURVE_RESPONSE_ELEMENTS + ] curve = result[NAME_CURVE] description = result[NAME_DESCRIPTION] print( - f" {i + 1} {curve} - {description}, {' '.join(elements_values)}") + f" {i + 1} {curve} - {description}, {' '.join(elements_values)}" + ) __copyright__ = """ diff --git a/examples/demoapps/snippets/requestresponse/IntradayBarRequests.py b/examples/demoapps/snippets/requestresponse/IntradayBarRequests.py index 8cd67a6..d30dc06 100644 --- a/examples/demoapps/snippets/requestresponse/IntradayBarRequests.py +++ b/examples/demoapps/snippets/requestresponse/IntradayBarRequests.py @@ -56,7 +56,9 @@ def processResponseEvent(response): data = msgDict[BAR_DATA][BAR_TICK_DATA] print(f"Response contains {len(data)} bar(s)") spaces = "\t\t\t\t" - print(f"Datetime{spaces}Open{spaces}High{spaces}Low{spaces}Close{spaces}NumEvents{spaces}Volume") + print( + f"Datetime{spaces}Open{spaces}High{spaces}Low{spaces}Close{spaces}NumEvents{spaces}Volume" + ) for bar in data: barTime = bar[TIME] barOpen = bar[OPEN] @@ -66,9 +68,11 @@ def processResponseEvent(response): barNumEvents = bar[NUM_EVENTS] barVolume = bar[VOLUME] - print(f"{barTime.strftime(DATETIME_FORMAT)}{spaces}{barOpen:.2f}" - f"{spaces}{barHigh:.2f}{spaces}{barLow:.2f}{spaces}" - f"{barClose:.2f}{spaces}{barNumEvents}{spaces}{barVolume}") + print( + f"{barTime.strftime(DATETIME_FORMAT)}{spaces}{barOpen:.2f}" + f"{spaces}{barHigh:.2f}{spaces}{barLow:.2f}{spaces}" + f"{barClose:.2f}{spaces}{barNumEvents}{spaces}{barVolume}" + ) __copyright__ = """ diff --git a/examples/demoapps/snippets/requestresponse/IntradayTickRequests.py b/examples/demoapps/snippets/requestresponse/IntradayTickRequests.py index e12c3e2..c2bf3d3 100644 --- a/examples/demoapps/snippets/requestresponse/IntradayTickRequests.py +++ b/examples/demoapps/snippets/requestresponse/IntradayTickRequests.py @@ -60,8 +60,10 @@ def processResponseEvent(response): if CONDITION_CODES in item: itemConditionCodes = item[CONDITION_CODES] - print(f"{itemTime.strftime(DATETIME_FORMAT)}\t{itemType}\t" - f"{itemValue:.2f}\t\t{itemSize}\t{itemConditionCodes}") + print( + f"{itemTime.strftime(DATETIME_FORMAT)}\t{itemType}\t" + f"{itemValue:.2f}\t\t{itemSize}\t{itemConditionCodes}" + ) __copyright__ = """ diff --git a/examples/demoapps/snippets/requestresponse/ReferenceDataRequests.py b/examples/demoapps/snippets/requestresponse/ReferenceDataRequests.py index 8f9e158..530f544 100644 --- a/examples/demoapps/snippets/requestresponse/ReferenceDataRequests.py +++ b/examples/demoapps/snippets/requestresponse/ReferenceDataRequests.py @@ -48,41 +48,27 @@ def createTableOverrideRequest(service, options): request = service.createRequest("ReferenceDataRequest") # (rate, duration, transition) - rate1 = (1.0, 12, 'S') # S = Step - rate2 = (2.0, 12, 'R') # R = Ramp + rate1 = (1.0, 12, "S") # S = Step + rate2 = (2.0, 12, "R") # R = Ramp requestDict = { "securities": options.securities, "fields": options.fields, "overrides": [ - { - "fieldId": "ALLOW_DYNAMIC_CASHFLOW_CALCS", - "value": "Y" - }, - { - "fieldId": "LOSS_SEVERITY", - "value": 31 - } + {"fieldId": "ALLOW_DYNAMIC_CASHFLOW_CALCS", "value": "Y"}, + {"fieldId": "LOSS_SEVERITY", "value": 31}, ], "tableOverrides": [ { "fieldId": "DEFAULT_VECTOR", "row": [ - { - "value": ["Anchor", "PROJ"] - }, - { - "value": ["Type", "CDR"] - }, - { - "value": rate1 - }, - { - "value": rate2 - }, - ] + {"value": ["Anchor", "PROJ"]}, + {"value": ["Type", "CDR"]}, + {"value": rate1}, + {"value": rate2}, + ], } - ] + ], } request.fromPy(requestDict) @@ -112,7 +98,9 @@ def processResponseEvent(event): print(f"\nTicker: {ticker}") if security.hasElement(SECURITY_ERROR): - print(f"SECURITY FAILED: {security.getElement(SECURITY_ERROR)}") + print( + f"SECURITY FAILED: {security.getElement(SECURITY_ERROR)}" + ) continue if security.hasElement(FIELD_DATA): @@ -131,8 +119,10 @@ def processResponseEvent(event): print("-----\t\t---------") for k in range(fieldExceptions.numValues()): fieldException = fieldExceptions.getValueAsElement(k) - print(f"{fieldException.getElementAsString(FIELD_ID)} " - f"\t\t {fieldException.getElement(ERROR_INFO)}") + print( + f"{fieldException.getElementAsString(FIELD_ID)} " + f"\t\t {fieldException.getElement(ERROR_INFO)}" + ) __copyright__ = """ diff --git a/examples/demoapps/util/ConnectionAndAuthOptions.py b/examples/demoapps/util/ConnectionAndAuthOptions.py index b3ac6f1..416e69c 100644 --- a/examples/demoapps/util/ConnectionAndAuthOptions.py +++ b/examples/demoapps/util/ConnectionAndAuthOptions.py @@ -9,7 +9,7 @@ class AuthOptionsAction(Action): """The action that parses authorization options from user input""" def __call__(self, parser, args, values, option_string=None): - vals = values.split('=', 1) + vals = values.split("=", 1) auth_type = vals[0] if auth_type == "user": @@ -28,21 +28,24 @@ def __call__(self, parser, args, values, option_string=None): appName = vals[1] authUser = blpapi.AuthUser.createWithLogonName() authOptions = blpapi.AuthOptions.createWithUserAndApp( - authUser, appName) + authUser, appName + ) elif auth_type == "dir": dirProperty = vals[1] authUser = blpapi.AuthUser.createWithActiveDirectoryProperty( - dirProperty) + dirProperty + ) authOptions = blpapi.AuthOptions.createWithUser(authUser) elif auth_type == "manual": - parts = vals[1].split(',') + parts = vals[1].split(",") if len(parts) != 3: parser.error(f"Invalid auth option '{values}'") appName, ip, userId = parts authUser = blpapi.AuthUser.createWithManualOptions(userId, ip) authOptions = blpapi.AuthOptions.createWithUserAndApp( - authUser, appName) + authUser, appName + ) else: parser.error(f"Invalid auth option '{values}'") @@ -53,7 +56,7 @@ class AppAuthAction(Action): """The action that parses app authorization options from user input""" def __call__(self, parser, args, values, option_string=None): - vals = values.split('=', 1) + vals = values.split("=", 1) if len(vals) != 2: parser.error(f"Invalid auth option '{values}'") @@ -70,7 +73,7 @@ class HostAction(Action): """The action that parses host options from user input""" def __call__(self, parser, args, values, option_string=None): - vals = values.split(':', 1) + vals = values.split(":", 1) if len(vals) != 2: parser.error(f"Invalid host option '{values}'") @@ -99,12 +102,15 @@ def addConnectionAndAuthOptions(parser, forClientServerSetup=False): """ # Server options server_group = parser.add_argument_group("Connections") - server_group.add_argument("-H", "--host", - dest="hosts", - help="server name or IP (default: 127.0.0.1:8194). Can be specified multiple times.", - metavar="host:port", - action=HostAction, - default=[]) + server_group.add_argument( + "-H", + "--host", + dest="hosts", + help="server name or IP (default: 127.0.0.1:8194). Can be specified multiple times.", + metavar="host:port", + action=HostAction, + default=[], + ) # Auth options if forClientServerSetup: @@ -114,43 +120,56 @@ def addConnectionAndAuthOptions(parser, forClientServerSetup=False): # TLS Options tls_group = parser.add_argument_group("TLS (specify all or none)") - tls_group.add_argument("--tls-client-credentials", - dest="tls_client_credentials", - help="name a PKCS#12 file to use as a source of " - "client credentials", - metavar="file") - tls_group.add_argument("--tls-client-credentials-password", - dest="tls_client_credentials_password", - help="specify password for accessing client credentials", - metavar="password", - default="") - tls_group.add_argument("--tls-trust-material", - dest="tls_trust_material", - help="name a PKCS#7 file to use as a source of " - "trusted certificates", - metavar="file") - tls_group.add_argument("--read-certificate-files", - dest="read_certificate_files", - help="Enable reading the TLS files and pass the blobs", - action="store_true") + tls_group.add_argument( + "--tls-client-credentials", + dest="tls_client_credentials", + help="name a PKCS#12 file to use as a source of " "client credentials", + metavar="file", + ) + tls_group.add_argument( + "--tls-client-credentials-password", + dest="tls_client_credentials_password", + help="specify password for accessing client credentials", + metavar="password", + default="", + ) + tls_group.add_argument( + "--tls-trust-material", + dest="tls_trust_material", + help="name a PKCS#7 file to use as a source of " + "trusted certificates", + metavar="file", + ) + tls_group.add_argument( + "--read-certificate-files", + dest="read_certificate_files", + help="Enable reading the TLS files and pass the blobs", + action="store_true", + ) # ZFP Options zfp_group = parser.add_argument_group( - "ZFP connections over leased lines (requires TLS)") - zfp_group.add_argument("-z", "--zfp-over-leased-line", - dest="remote", - help="enable ZFP connections over leased lines on the " - "specified port (8194 or 8196)" - "\n(When this option is enabled, option -H/--host is ignored.)", - metavar="port", - type=int) + "ZFP connections over leased lines (requires TLS)" + ) + zfp_group.add_argument( + "-z", + "--zfp-over-leased-line", + dest="remote", + help="enable ZFP connections over leased lines on the " + "specified port (8194 or 8196)" + "\n(When this option is enabled, option -H/--host is ignored.)", + metavar="port", + type=int, + ) def _addArgGroupAuth(parser): auth_group = parser.add_argument_group("Authorization") - auth_group.add_argument("-a", "--auth", - dest=_SESSION_IDENTITY_AUTH_OPTIONS, - help='''authorization option (default: none) + auth_group.add_argument( + "-a", + "--auth", + dest=_SESSION_IDENTITY_AUTH_OPTIONS, + help="""authorization option (default: none) none applicable to Desktop API product that requires Bloomberg Professional service to be installed locally user as a user using OS logon information @@ -158,9 +177,10 @@ def _addArgGroupAuth(parser): app= as the specified application userapp= as user and application using logon information for the user manual= as user and application, with manually provided - IP address and EMRS user''', - metavar="option", - action=AuthOptionsAction) + IP address and EMRS user""", + metavar="option", + action=AuthOptionsAction, + ) def _addArgGroupsAuthAndEntitlementsClientServerSetup(parser): @@ -168,53 +188,68 @@ def _addArgGroupsAuthAndEntitlementsClientServerSetup(parser): the argument parser. """ auth_group = parser.add_argument_group("Authorization") - auth_group.add_argument("-a", "--auth", - dest="authAppName", - required=True, - help="authorize this application using the specified application", - metavar="app=", - action=AppAuthAction) - - entitlements_group = parser.add_argument_group("User Authorization/Entitlements") - entitlements_group.add_argument("-u", "--userid-ip", - dest="userIdAndIps", - help="authorize a user using userId and IP separated by ':'. Can be specified multiple times.", - metavar="userId:IP", - action=UserIdIpAction, - default=[]) - - entitlements_group.add_argument("-T", "--token", - dest="tokens", - help="authorize a user using the specified token. Can be specified multiple times.\n" - "If the token starts with '-', use " - "either -T or --token=.", - metavar="token", - action="append", - default=[]) + auth_group.add_argument( + "-a", + "--auth", + dest="authAppName", + required=True, + help="authorize this application using the specified application", + metavar="app=", + action=AppAuthAction, + ) + + entitlements_group = parser.add_argument_group( + "User Authorization/Entitlements" + ) + entitlements_group.add_argument( + "-u", + "--userid-ip", + dest="userIdAndIps", + help="authorize a user using userId and IP separated by ':'. Can be specified multiple times.", + metavar="userId:IP", + action=UserIdIpAction, + default=[], + ) + + entitlements_group.add_argument( + "-T", + "--token", + dest="tokens", + help="authorize a user using the specified token. Can be specified multiple times.\n" + "If the token starts with '-', use " + "either -T or --token=.", + metavar="token", + action="append", + default=[], + ) def _getTlsOptions(options): """Parse TlsOptions from user input""" - if (options.tls_client_credentials is None or - options.tls_trust_material is None): + if ( + options.tls_client_credentials is None + or options.tls_trust_material is None + ): return None print("TlsOptions enabled") if options.read_certificate_files: - with open(options.tls_client_credentials, 'rb') as credentialfile: + with open(options.tls_client_credentials, "rb") as credentialfile: credential_blob = credentialfile.read() - with open(options.tls_trust_material, 'rb') as trustfile: + with open(options.tls_trust_material, "rb") as trustfile: trust_blob = trustfile.read() return blpapi.TlsOptions.createFromBlobs( credential_blob, options.tls_client_credentials_password, - trust_blob) + trust_blob, + ) return blpapi.TlsOptions.createFromFiles( options.tls_client_credentials, options.tls_client_credentials_password, - options.tls_trust_material) + options.tls_trust_material, + ) def createClientServerSetupAuthOptions(options): @@ -226,7 +261,8 @@ def createClientServerSetupAuthOptions(options): for userId, ip in options.userIdAndIps: authUser = blpapi.AuthUser.createWithManualOptions(userId, ip) authOptions = blpapi.AuthOptions.createWithUserAndApp( - authUser, options.authAppName) + authUser, options.authAppName + ) authOptionsByIdentifier[f"{userId}:{ip}"] = authOptions for i, token in enumerate(options.tokens): @@ -251,8 +287,8 @@ def createSessionOptions(options): print("Creating a ZFP connection for leased lines.") sessionOptions = blpapi.ZfpUtil.getZfpOptionsForLeasedLines( - options.remote, - tlsOptions) + options.remote, tlsOptions + ) else: sessionOptions = blpapi.SessionOptions() for idx, host in enumerate(options.hosts): @@ -262,9 +298,12 @@ def createSessionOptions(options): sessionOptions.setTlsOptions(tlsOptions) sessionOptions.setSessionIdentityOptions( - options.sessionIdentityAuthOptions) - print(f"Connecting to " - f"{', '.join([h[0] + ':' + str(h[1]) for h in sessionOptions.serverAddresses()])}") + options.sessionIdentityAuthOptions + ) + print( + f"Connecting to " + f"{', '.join([h[0] + ':' + str(h[1]) for h in sessionOptions.serverAddresses()])}" + ) return sessionOptions diff --git a/examples/demoapps/util/MaxEventsOption.py b/examples/demoapps/util/MaxEventsOption.py index 58c389b..d437314 100644 --- a/examples/demoapps/util/MaxEventsOption.py +++ b/examples/demoapps/util/MaxEventsOption.py @@ -1,17 +1,20 @@ import sys + def addMaxEventsOption(argparser): - ''' + """ Helper function that adds the option for the maximum number of events before stopping to the argument parser and parses the command line argument to an integer as the maximum number of events. - ''' - argparser.add_argument("--max-events", - dest="maxEvents", - help="number of events to process before stopping (default: %(default)d).", - metavar="maxEvents", - type=int, - default=sys.maxsize) + """ + argparser.add_argument( + "--max-events", + dest="maxEvents", + help="number of events to process before stopping (default: %(default)d).", + metavar="maxEvents", + type=int, + default=sys.maxsize, + ) __copyright__ = """ diff --git a/examples/demoapps/util/RequestOptions.py b/examples/demoapps/util/RequestOptions.py index 0509bf3..66baa53 100644 --- a/examples/demoapps/util/RequestOptions.py +++ b/examples/demoapps/util/RequestOptions.py @@ -11,14 +11,14 @@ HISTORICAL_DATA_REQUEST = "HistoricalDataRequest" # Defines a parameter override in a reference data request. -Override = namedtuple('Override', ['fieldId', 'value']) +Override = namedtuple("Override", ["fieldId", "value"]) class OverridesAction(Action): """The action that parses overrides options from user input""" def __call__(self, parser, args, values, option_string=None): - vals = values.split('=', 1) + vals = values.split("=", 1) overrides = getattr(args, self.dest) overrides.append(Override(vals[0], vals[1])) @@ -34,95 +34,122 @@ def addRequestOptions(parser): """ # Compute default start/end datetime - (defaultStartDateTime, defaultIntradayBarEndDateTime, - defaultIntradayTickEndDateTime) = computeDefaultStartAndEndDateTime() + ( + defaultStartDateTime, + defaultIntradayBarEndDateTime, + defaultIntradayTickEndDateTime, + ) = computeDefaultStartAndEndDateTime() formattedDefaultStartDateTime = defaultStartDateTime.isoformat( - timespec="seconds") - formattedDefaultIntradayBarEndDateTime = defaultIntradayBarEndDateTime.isoformat( - timespec="seconds") - formattedDefaultIntradayTickEndDateTime = defaultIntradayTickEndDateTime.isoformat( - timespec="seconds") + timespec="seconds" + ) + formattedDefaultIntradayBarEndDateTime = ( + defaultIntradayBarEndDateTime.isoformat(timespec="seconds") + ) + formattedDefaultIntradayTickEndDateTime = ( + defaultIntradayTickEndDateTime.isoformat(timespec="seconds") + ) isoDatetimeFormat = "YYYY-MM-DDTHH:MM:SS" # Request options defaultBarInterval = 5 argGroupRequest = parser.add_argument_group("Request Options") - argGroupRequest.add_argument("-s", - "--service", - dest="service", - help="The service name (default: %(default)s)", - metavar="service", - default=REFDATA_SERVICE) - argGroupRequest.add_argument("-S", - "--security", - dest="securities", - help="Security to request. Can be specified multiple times.", - metavar="security", - action="append", - default=[]) - argGroupRequest.add_argument("-f", - "--field", - dest="fields", - help="Field to request. Can be specified multiple times.", - metavar="field", - action="append", - default=[]) - argGroupRequest.add_argument("-e", - "--event", - dest="eventTypes", - help="Event Type (default: ['TRADE']). Can be specified multiple times.", - metavar="eventType", - action="append", - default=[]) - argGroupRequest.add_argument("-i", - "--interval", - dest="barInterval", - type=int, - help="Bar interval in minutes (default: %(default)d)", - metavar="barInterval", - default=defaultBarInterval) - argGroupRequest.add_argument("-I", - "--include-condition-codes", - dest="conditionCodes", - help="Include condition codes", - action='store_true', - default=False) - argGroupRequest.add_argument("-G", - "--gap-fill-initial-bar", - dest="gapFillInitialBar", - help="Gap fill initial bar", - action='store_true', - default=False) - argGroupRequest.add_argument("--start-date", - dest="startDateTime", - help="Start datetime in the format of " - f"{isoDatetimeFormat}", - metavar="startDateTime", - type=parseDatetime) - argGroupRequest.add_argument("--end-date", - dest="endDateTime", - help="End datetime in the format of " - f"{isoDatetimeFormat}", - metavar="endDateTime", - type=parseDatetime) - argGroupRequest.add_argument("-O", - "--override", - dest="overrides", - help="Field to override. Can be specified multiple times.", - metavar="=", - action=OverridesAction, - default=[]) - argGroupRequest.add_argument("-r", - "--request", - dest="requestType", - choices=[REFERENCE_DATA_REQUEST, - REFERENCE_DATA_REQUEST_OVERRIDE, - REFERENCE_DATA_REQUEST_TABLE_OVERRIDE, - INTRADAY_BAR_REQUEST, - INTRADAY_TICK_REQUEST, - HISTORICAL_DATA_REQUEST], - help=f"""Request Type (default: %(default)s) + argGroupRequest.add_argument( + "-s", + "--service", + dest="service", + help="The service name (default: %(default)s)", + metavar="service", + default=REFDATA_SERVICE, + ) + argGroupRequest.add_argument( + "-S", + "--security", + dest="securities", + help="Security to request. Can be specified multiple times.", + metavar="security", + action="append", + default=[], + ) + argGroupRequest.add_argument( + "-f", + "--field", + dest="fields", + help="Field to request. Can be specified multiple times.", + metavar="field", + action="append", + default=[], + ) + argGroupRequest.add_argument( + "-e", + "--event", + dest="eventTypes", + help="Event Type (default: ['TRADE']). Can be specified multiple times.", + metavar="eventType", + action="append", + default=[], + ) + argGroupRequest.add_argument( + "-i", + "--interval", + dest="barInterval", + type=int, + help="Bar interval in minutes (default: %(default)d)", + metavar="barInterval", + default=defaultBarInterval, + ) + argGroupRequest.add_argument( + "-I", + "--include-condition-codes", + dest="conditionCodes", + help="Include condition codes", + action="store_true", + default=False, + ) + argGroupRequest.add_argument( + "-G", + "--gap-fill-initial-bar", + dest="gapFillInitialBar", + help="Gap fill initial bar", + action="store_true", + default=False, + ) + argGroupRequest.add_argument( + "--start-date", + dest="startDateTime", + help="Start datetime in the format of " f"{isoDatetimeFormat}", + metavar="startDateTime", + type=parseDatetime, + ) + argGroupRequest.add_argument( + "--end-date", + dest="endDateTime", + help="End datetime in the format of " f"{isoDatetimeFormat}", + metavar="endDateTime", + type=parseDatetime, + ) + argGroupRequest.add_argument( + "-O", + "--override", + dest="overrides", + help="Field to override. Can be specified multiple times.", + metavar="=", + action=OverridesAction, + default=[], + ) + argGroupRequest.add_argument( + "-r", + "--request", + dest="requestType", + choices=[ + REFERENCE_DATA_REQUEST, + REFERENCE_DATA_REQUEST_OVERRIDE, + REFERENCE_DATA_REQUEST_TABLE_OVERRIDE, + INTRADAY_BAR_REQUEST, + INTRADAY_TICK_REQUEST, + HISTORICAL_DATA_REQUEST, + ], + help=f"""Request Type (default: %(default)s) To retrieve reference data: -r, --request {REFERENCE_DATA_REQUEST} [-S, --security ] @@ -160,8 +187,9 @@ def addRequestOptions(parser): -r, --request {HISTORICAL_DATA_REQUEST} [-S, --security ] [-f, --field ]""", - metavar="requestType", - default=REFERENCE_DATA_REQUEST) + metavar="requestType", + default=REFERENCE_DATA_REQUEST, + ) def setDefaultValues(options): @@ -182,21 +210,31 @@ def setDefaultValues(options): if options.requestType == REFERENCE_DATA_REQUEST_OVERRIDE: options.fields += ["DS002", "EQY_WEIGHTED_AVG_PX"] - if not options.overrides and options.requestType == REFERENCE_DATA_REQUEST_OVERRIDE: - options.overrides = [Override("VWAP_START_TIME", "9:30"), - Override("VWAP_END_TIME", "11:30")] + if ( + not options.overrides + and options.requestType == REFERENCE_DATA_REQUEST_OVERRIDE + ): + options.overrides = [ + Override("VWAP_START_TIME", "9:30"), + Override("VWAP_END_TIME", "11:30"), + ] # Compute default start/end datetime if not options.startDateTime or not options.endDateTime: - (defaultStartDateTime, defaultIntradayBarEndDateTime, - defaultIntradayTickEndDateTime) = computeDefaultStartAndEndDateTime() + ( + defaultStartDateTime, + defaultIntradayBarEndDateTime, + defaultIntradayTickEndDateTime, + ) = computeDefaultStartAndEndDateTime() if not options.startDateTime: options.startDateTime = defaultStartDateTime if not options.endDateTime: - options.endDateTime = (defaultIntradayBarEndDateTime - if options.requestType == INTRADAY_BAR_REQUEST - else defaultIntradayTickEndDateTime) + options.endDateTime = ( + defaultIntradayBarEndDateTime + if options.requestType == INTRADAY_BAR_REQUEST + else defaultIntradayTickEndDateTime + ) def computeDefaultStartAndEndDateTime(): @@ -208,8 +246,7 @@ def computeDefaultStartAndEndDateTime(): previousTradingDate = previousTradingDate - datetime.timedelta(days=2) # Start on the market open time (GMT) on previous trading day. - startDateTime = previousTradingDate.replace( - hour=14, minute=30, second=0) + startDateTime = previousTradingDate.replace(hour=14, minute=30, second=0) # The default bar interval is 5 minute, by default there are 12 bars intradayBarEndDateTime = startDateTime + datetime.timedelta(minutes=60) diff --git a/examples/demoapps/util/SubscriptionOptions.py b/examples/demoapps/util/SubscriptionOptions.py index b67baf4..b836197 100644 --- a/examples/demoapps/util/SubscriptionOptions.py +++ b/examples/demoapps/util/SubscriptionOptions.py @@ -19,53 +19,65 @@ def addSubscriptionOptions(parser, isSnapshot=False): parser. """ subscription_group = parser.add_argument_group("Subscription Options") - subscription_group.add_argument("-s", - "--service", - dest="service", - help="service name (default: %(default)s)", - metavar="service", - default=DEFAULT_SERVICE) - subscription_group.add_argument("-t", - "--topic", - dest="topics", - help=f"""topic name (default: {DEFAULT_TOPIC}). Can be specified multiple times. + subscription_group.add_argument( + "-s", + "--service", + dest="service", + help="service name (default: %(default)s)", + metavar="service", + default=DEFAULT_SERVICE, + ) + subscription_group.add_argument( + "-t", + "--topic", + dest="topics", + help=f"""topic name (default: {DEFAULT_TOPIC}). Can be specified multiple times. Can be one of the following: * Instrument * Instrument qualified with a prefix * Instrument qualified with a service and a prefix """, - metavar="topic", - action="append", - default=[]) - subscription_group.add_argument("-f", - "--field", - dest="fields", - help="field to subscribe. Can be specified multiple times.", - metavar="field", - action="append", - default=[]) - subscription_group.add_argument("-o", - "--option", - dest="options", - help="subscription options. Can be specified multiple times.", - metavar="option", - action="append", - default=[]) - subscription_group.add_argument("-x", - "--topic-prefix", - dest="topicPrefix", - help="The topic prefix to be used for subscriptions (default: %(default)s)", - metavar="prefix", - default=DEFAULT_TOPIC_PREFIX) + metavar="topic", + action="append", + default=[], + ) + subscription_group.add_argument( + "-f", + "--field", + dest="fields", + help="field to subscribe. Can be specified multiple times.", + metavar="field", + action="append", + default=[], + ) + subscription_group.add_argument( + "-o", + "--option", + dest="options", + help="subscription options. Can be specified multiple times.", + metavar="option", + action="append", + default=[], + ) + subscription_group.add_argument( + "-x", + "--topic-prefix", + dest="topicPrefix", + help="The topic prefix to be used for subscriptions (default: %(default)s)", + metavar="prefix", + default=DEFAULT_TOPIC_PREFIX, + ) if not isSnapshot: - subscription_group.add_argument("-i", - "--interval", - dest="interval", - type=float, - help="subscription option that specifies a time in seconds to " - "intervalize the subscriptions", - metavar="interval") + subscription_group.add_argument( + "-i", + "--interval", + dest="interval", + type=float, + help="subscription option that specifies a time in seconds to " + "intervalize the subscriptions", + metavar="interval", + ) def setSubscriptionSessionOptions(sessionOptions, options): @@ -90,10 +102,9 @@ def createSubscriptionList(options): subscriptions = blpapi.SubscriptionList() for topic in options.topics: - subscriptions.add(topic, - options.fields, - options.options, - blpapi.CorrelationId(topic)) + subscriptions.add( + topic, options.fields, options.options, blpapi.CorrelationId(topic) + ) return subscriptions @@ -112,8 +123,10 @@ def createSubscriptionStrings(options): for i, userTopic in enumerate(options.topics): subscriptionList.add(userTopic, options.fields, options.options) subscriptionStrings[userTopic] = subscriptionList.topicStringAt(i) - print(f"topic: {userTopic} -> subscription string: " - f"{subscriptionStrings[userTopic]}") + print( + f"topic: {userTopic} -> subscription string: " + f"{subscriptionStrings[userTopic]}" + ) return subscriptionStrings diff --git a/examples/demoapps/util/events/SessionRouter.py b/examples/demoapps/util/events/SessionRouter.py index ad4a908..1e2cb5d 100644 --- a/examples/demoapps/util/events/SessionRouter.py +++ b/examples/demoapps/util/events/SessionRouter.py @@ -13,8 +13,12 @@ def printEvent(event: blpapi.Event): class SessionRouter: EventHandler = Callable[[blpapi.AbstractSession, blpapi.Event], None] - MessageHandler = Callable[[blpapi.AbstractSession, blpapi.Event, blpapi.Message], None] - ExceptionHandler = Callable[[blpapi.AbstractSession, blpapi.Event, Exception], None] + MessageHandler = Callable[ + [blpapi.AbstractSession, blpapi.Event, blpapi.Message], None + ] + ExceptionHandler = Callable[ + [blpapi.AbstractSession, blpapi.Event, Exception], None + ] def __init__(self): super(SessionRouter, self).__init__() @@ -24,61 +28,72 @@ def __init__(self): self._messageHandlersByCorrelationId = {} self._exceptionHandlers = [] - def processEvent(self, - event: blpapi.Event, - session: blpapi.AbstractSession): + def processEvent( + self, event: blpapi.Event, session: blpapi.AbstractSession + ): try: printEvent(event) - eventHandler = self._eventHandlersByEventType.get(event.eventType()) + eventHandler = self._eventHandlersByEventType.get( + event.eventType() + ) if eventHandler is not None: eventHandler(session, event) - eventTypeMessageHandler = \ - self._messageHandlersByEventType.get(event.eventType()) + eventTypeMessageHandler = self._messageHandlersByEventType.get( + event.eventType() + ) for message in event: for cid in message.correlationIds(): - cidMessageHandler = self._messageHandlersByCorrelationId.get(cid) + cidMessageHandler = ( + self._messageHandlersByCorrelationId.get(cid) + ) if cidMessageHandler is not None: cidMessageHandler(session, event, message) if eventTypeMessageHandler is not None: eventTypeMessageHandler(session, event, message) - messageTypeMessageHandler = \ - self._messageHandlersByMessageType.get(message.messageType()) + messageTypeMessageHandler = ( + self._messageHandlersByMessageType.get( + message.messageType() + ) + ) if messageTypeMessageHandler is not None: messageTypeMessageHandler(session, event, message) except Exception as exception: # pylint: disable=broad-except for exceptionHandler in self._exceptionHandlers: exceptionHandler(session, event, exception) - def addEventHandlerByEventType(self, - eventType: int, - eventHandler: EventHandler): + def addEventHandlerByEventType( + self, eventType: int, eventHandler: EventHandler + ): self._eventHandlersByEventType[eventType] = eventHandler - def addMessageHandlerByEventType(self, - eventType: int, - messageHandler: MessageHandler): + def addMessageHandlerByEventType( + self, eventType: int, messageHandler: MessageHandler + ): self._messageHandlersByEventType[eventType] = messageHandler - def addMessageHandlerByMessageType(self, - messageType: blpapi.Name, - messageHandler: MessageHandler): + def addMessageHandlerByMessageType( + self, messageType: blpapi.Name, messageHandler: MessageHandler + ): self._messageHandlersByMessageType[messageType] = messageHandler - def addMessageHandlerByCorrelationId(self, - correlationId: blpapi.CorrelationId, - messageHandler: MessageHandler): + def addMessageHandlerByCorrelationId( + self, + correlationId: blpapi.CorrelationId, + messageHandler: MessageHandler, + ): self._messageHandlersByCorrelationId[correlationId] = messageHandler def addExceptionHandler(self, exceptionHandler: ExceptionHandler): self._exceptionHandlers.append(exceptionHandler) - def removeMessageHandlerByCorrelationId(self, - correlationId: blpapi.CorrelationId): + def removeMessageHandlerByCorrelationId( + self, correlationId: blpapi.CorrelationId + ): self._messageHandlersByCorrelationId.pop(correlationId, None) diff --git a/examples/unittests/market-data-notifier/src/appconfig.py b/examples/unittests/market-data-notifier/src/appconfig.py index f751792..d794cdf 100644 --- a/examples/unittests/market-data-notifier/src/appconfig.py +++ b/examples/unittests/market-data-notifier/src/appconfig.py @@ -2,6 +2,7 @@ from argparse import ArgumentParser, Action + class AuthOptionsAction(Action): # pylint: disable=too-few-public-methods """Parse authorization args from user input.""" @@ -12,24 +13,27 @@ def __call__(self, parser, args, values, option_string=None): auth = None if value == "user": - auth = {"option" : "AuthenticationType=OS_LOGON"} + auth = {"option": "AuthenticationType=OS_LOGON"} elif value == "none": - auth = {"option" : None} + auth = {"option": None} elif vals[0] == "app" and len(vals) == 2: auth = { - "option" : "AuthenticationMode=APPLICATION_ONLY;" - "ApplicationAuthenticationType=APPNAME_AND_KEY;" - "ApplicationName=" + vals[1]} + "option": "AuthenticationMode=APPLICATION_ONLY;" + "ApplicationAuthenticationType=APPNAME_AND_KEY;" + "ApplicationName=" + vals[1] + } elif vals[0] == "userapp" and len(vals) == 2: auth = { - "option" : "AuthenticationMode" - "=USER_AND_APPLICATION;AuthenticationType=OS_LOGON;" - "ApplicationAuthenticationType=APPNAME_AND_KEY;" - "ApplicationName=" + vals[1]} + "option": "AuthenticationMode" + "=USER_AND_APPLICATION;AuthenticationType=OS_LOGON;" + "ApplicationAuthenticationType=APPNAME_AND_KEY;" + "ApplicationName=" + vals[1] + } elif vals[0] == "dir" and len(vals) == 2: auth = { - "option" : "AuthenticationType=DIRECTORY_SERVICE;" - "DirSvcPropertyName=" + vals[1]} + "option": "AuthenticationType=DIRECTORY_SERVICE;" + "DirSvcPropertyName=" + vals[1] + } elif vals[0] == "manual": parts = [] if len(vals) == 2: @@ -38,14 +42,17 @@ def __call__(self, parser, args, values, option_string=None): if len(parts) != 3: raise ValueError("Invalid auth option '%s'" % value) - option = ("AuthenticationMode=USER_AND_APPLICATION;" - "AuthenticationType=MANUAL;" - "ApplicationAuthenticationType=APPNAME_AND_KEY;" - "ApplicationName=") + parts[0] + option = ( + "AuthenticationMode=USER_AND_APPLICATION;" + "AuthenticationType=MANUAL;" + "ApplicationAuthenticationType=APPNAME_AND_KEY;" + "ApplicationName=" + ) + parts[0] - auth = {"option" : option, - "manual" : {"ip" : parts[1], - "user" : parts[2]}} + auth = { + "option": option, + "manual": {"ip": parts[1], "user": parts[2]}, + } else: raise ValueError("Invalid auth option '%s'" % value) @@ -56,56 +63,70 @@ def parseCmdLine(): """Parse command line arguments.""" parser = ArgumentParser(description="Retrieve realtime data.") - parser.add_argument("-a", - "--ip", - dest="hosts", - help="server name or IP (default: localhost)", - metavar="ipAddress", - action="append", - default=[]) - parser.add_argument("-p", - dest="port", - type=int, - help="server port (default: %default)", - metavar="tcpPort", - default=8194) - parser.add_argument("-s", - dest="service", - help="service name (default: %default)", - metavar="service", - default="//viper/mktdata") + parser.add_argument( + "-a", + "--ip", + dest="hosts", + help="server name or IP (default: localhost)", + metavar="ipAddress", + action="append", + default=[], + ) + parser.add_argument( + "-p", + dest="port", + type=int, + help="server port (default: %default)", + metavar="tcpPort", + default=8194, + ) + parser.add_argument( + "-s", + dest="service", + help="service name (default: %default)", + metavar="service", + default="//viper/mktdata", + ) parser.add_argument( "-t", dest="topics", help="topic name (default: //blp/mktdata/ticker/IBM Equity)", metavar="topic", action="append", - default=['//blp/mktdata/ticker/IBM Equity']) - parser.add_argument("-f", - dest="fields", - help="field to subscribe to (default: LAST_PRICE)", - metavar="field", - action="append", - default=['LAST_PRICE']) - parser.add_argument("-o", - dest="options", - help="subscription options (default: empty)", - metavar="option", - action="append", - default=[]) - parser.add_argument("--auth", - dest="auth", - help="authentication option: " - "user|none|app=|userapp=|dir=|" - "manual=" - " (default: none)", - metavar="option", - action=AuthOptionsAction, - default={"option" : None}) + default=["//blp/mktdata/ticker/IBM Equity"], + ) + parser.add_argument( + "-f", + dest="fields", + help="field to subscribe to (default: LAST_PRICE)", + metavar="field", + action="append", + default=["LAST_PRICE"], + ) + parser.add_argument( + "-o", + dest="options", + help="subscription options (default: empty)", + metavar="option", + action="append", + default=[], + ) + parser.add_argument( + "--auth", + dest="auth", + help="authentication option: " + "user|none|app=|userapp=|dir=|" + "manual=" + " (default: none)", + metavar="option", + action=AuthOptionsAction, + default={"option": None}, + ) args = parser.parse_args() return args + __copyright__ = """ Copyright 2020. Bloomberg Finance L.P. diff --git a/examples/unittests/market-data-notifier/src/application.py b/examples/unittests/market-data-notifier/src/application.py index 77af352..d9b1ae5 100644 --- a/examples/unittests/market-data-notifier/src/application.py +++ b/examples/unittests/market-data-notifier/src/application.py @@ -3,7 +3,7 @@ from __future__ import print_function # pylint: disable=too-few-public-methods -class Application(): +class Application: """Custom application for demonstration purposes.""" def __init__(self, session, authorizer, subscriber, options): @@ -24,8 +24,12 @@ def run(self): return self._subscriber.subscribe( - self._options.topics, self._options.fields, - self._options.options, identity) + self._options.topics, + self._options.fields, + self._options.options, + identity, + ) + __copyright__ = """ Copyright 2020. Bloomberg Finance L.P. diff --git a/examples/unittests/market-data-notifier/src/authorizer.py b/examples/unittests/market-data-notifier/src/authorizer.py index b9ef328..5043a3b 100644 --- a/examples/unittests/market-data-notifier/src/authorizer.py +++ b/examples/unittests/market-data-notifier/src/authorizer.py @@ -10,7 +10,7 @@ TOKEN = blpapi.Name("token") # pylint: disable=too-few-public-methods, too-many-branches -class Authorizer(): +class Authorizer: """Helper for authorization.""" def __init__(self, session, token_generator): @@ -35,16 +35,19 @@ def _authorize(self, auth_service, identity, cid, event_queue=None): # Send authorization request to "fill" the Identity self._session.sendAuthorizationRequest( - auth_request, identity, cid, event_queue) + auth_request, identity, cid, event_queue + ) # Process related responses start_time = datetime.datetime.today() WAIT_TIME_SECONDS = 10 while True: event = event_queue.nextEvent(WAIT_TIME_SECONDS * 1000) - if event.eventType() == blpapi.Event.RESPONSE or \ - event.eventType() == blpapi.Event.REQUEST_STATUS or \ - event.eventType() == blpapi.Event.PARTIAL_RESPONSE: + if ( + event.eventType() == blpapi.Event.RESPONSE + or event.eventType() == blpapi.Event.REQUEST_STATUS + or event.eventType() == blpapi.Event.PARTIAL_RESPONSE + ): for msg in event: print(msg) if msg.messageType() == AUTHORIZATION_SUCCESS: @@ -68,6 +71,7 @@ def authorize(self, identity, queue=None): return self._authorize(service, identity, cid, queue) return False + __copyright__ = """ Copyright 2020. Bloomberg Finance L.P. diff --git a/examples/unittests/market-data-notifier/src/compute_engine.py b/examples/unittests/market-data-notifier/src/compute_engine.py index 6983431..6497ab8 100644 --- a/examples/unittests/market-data-notifier/src/compute_engine.py +++ b/examples/unittests/market-data-notifier/src/compute_engine.py @@ -1,13 +1,14 @@ """Dummy 'compute engine' for testing purposes""" # pylint: disable=too-few-public-methods, no-init, no-self-use -class ComputeEngine(): +class ComputeEngine: """A class that does some 'financial computation'.""" def someVeryComplexComputation(self, value): """Computation to be tested.""" return value * 2 + __copyright__ = """ Copyright 2020. Bloomberg Finance L.P. diff --git a/examples/unittests/market-data-notifier/src/event_processor.py b/examples/unittests/market-data-notifier/src/event_processor.py index 12512d5..e3ad2be 100644 --- a/examples/unittests/market-data-notifier/src/event_processor.py +++ b/examples/unittests/market-data-notifier/src/event_processor.py @@ -6,7 +6,7 @@ TOKEN = blpapi.Name("token") # pylint: disable=too-few-public-methods -class EventProcessor(): +class EventProcessor: """Custom EventHandler implementation for demonstration purposes.""" def __init__(self, notifier, compute_engine): @@ -22,10 +22,12 @@ def processEvent(self, event, _): self._notifier.log_subscription_state(msg) elif event.eventType() == blpapi.Event.SUBSCRIPTION_DATA: last_price = msg.getElementAsFloat("LAST_PRICE") - result = \ - self._compute_engine.someVeryComplexComputation(last_price) + result = self._compute_engine.someVeryComplexComputation( + last_price + ) self._notifier.send_to_terminal(result) + __copyright__ = """ Copyright 2020. Bloomberg Finance L.P. diff --git a/examples/unittests/market-data-notifier/src/main.py b/examples/unittests/market-data-notifier/src/main.py index 859b6dd..4860419 100644 --- a/examples/unittests/market-data-notifier/src/main.py +++ b/examples/unittests/market-data-notifier/src/main.py @@ -21,7 +21,7 @@ for i, host in enumerate(options.hosts): so.setServerAddress(host, options.port, i) - so.setAuthenticationOptions(options.auth['option']) + so.setAuthenticationOptions(options.auth["option"]) session = blpapi.Session(so, event_processor.processEvent) diff --git a/examples/unittests/market-data-notifier/src/notifier.py b/examples/unittests/market-data-notifier/src/notifier.py index 6e581a4..8d5efee 100644 --- a/examples/unittests/market-data-notifier/src/notifier.py +++ b/examples/unittests/market-data-notifier/src/notifier.py @@ -2,7 +2,7 @@ from __future__ import print_function # pylint: disable=no-init,no-self-use -class Notifier(): +class Notifier: """ Notifier is an approximation of a class that attempts to: 1. Log all session events (for example SessionStartupFailure). @@ -22,6 +22,7 @@ def send_to_terminal(self, value): """Print the provided value.""" print("VALUE = " + str(value)) + __copyright__ = """ Copyright 2020. Bloomberg Finance L.P. diff --git a/examples/unittests/market-data-notifier/src/subscriber.py b/examples/unittests/market-data-notifier/src/subscriber.py index 213af7d..2bc5a35 100644 --- a/examples/unittests/market-data-notifier/src/subscriber.py +++ b/examples/unittests/market-data-notifier/src/subscriber.py @@ -3,7 +3,7 @@ import blpapi # pylint: disable=too-few-public-methods,too-many-arguments -class Subscriber(): +class Subscriber: """Custom Subscriber implementation for demonstration purposes.""" def __init__(self, session): @@ -14,10 +14,12 @@ def subscribe(self, topics, fields, options, identity): subscription_list = blpapi.SubscriptionList() for topic in topics: - subscription_list.add(topic, fields, options, - blpapi.CorrelationId(topic)) + subscription_list.add( + topic, fields, options, blpapi.CorrelationId(topic) + ) self._session.subscribe(subscription_list, identity) + __copyright__ = """ Copyright 2020. Bloomberg Finance L.P. diff --git a/examples/unittests/market-data-notifier/src/token_generator.py b/examples/unittests/market-data-notifier/src/token_generator.py index 1c35c2e..cff5d79 100644 --- a/examples/unittests/market-data-notifier/src/token_generator.py +++ b/examples/unittests/market-data-notifier/src/token_generator.py @@ -7,7 +7,7 @@ TOKEN = blpapi.Name("token") # pylint: disable=too-few-public-methods -class TokenGenerator(): +class TokenGenerator: """Generates a token for later authorization.""" def __init__(self, session): @@ -23,8 +23,10 @@ def generate(self, event_queue=None): self._session.generateToken(blpapi.CorrelationId(), event_queue) event = event_queue.nextEvent() - if event.eventType() == blpapi.Event.REQUEST_STATUS or \ - event.eventType() == blpapi.Event.TOKEN_STATUS: + if ( + event.eventType() == blpapi.Event.REQUEST_STATUS + or event.eventType() == blpapi.Event.TOKEN_STATUS + ): for msg in event: if msg.messageType() == TOKEN_SUCCESS: token = msg.getElementAsString(TOKEN) @@ -33,6 +35,7 @@ def generate(self, event_queue=None): return None return None + __copyright__ = """ Copyright 2020. Bloomberg Finance L.P. diff --git a/examples/unittests/market-data-notifier/tests/test_application.py b/examples/unittests/market-data-notifier/tests/test_application.py index 80a9ea1..24f6230 100644 --- a/examples/unittests/market-data-notifier/tests/test_application.py +++ b/examples/unittests/market-data-notifier/tests/test_application.py @@ -9,13 +9,16 @@ import os import sys -#pylint: disable=line-too-long,wrong-import-position -sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../src'))) + +# pylint: disable=line-too-long,wrong-import-position +sys.path.insert( + 0, os.path.abspath(os.path.join(os.path.dirname(__file__), "../src")) +) from application import Application class TestApplication(unittest.TestCase): - """ Test cases for Application. """ + """Test cases for Application.""" def setUp(self): self.mock_session = Mock() @@ -24,7 +27,7 @@ def setUp(self): self.mock_options = Mock() def testSessionStartFail(self): - """ Verify that if the session fails to start, no authorization or + """Verify that if the session fails to start, no authorization or subscriptions are made. Plan: @@ -33,10 +36,12 @@ def testSessionStartFail(self): b. authorize() is not called. c. subscribe() is not called. """ - application = Application(self.mock_session, - self.mock_authorizer, - self.mock_subscriber, - self.mock_options) + application = Application( + self.mock_session, + self.mock_authorizer, + self.mock_subscriber, + self.mock_options, + ) self.mock_session.start.return_value = False application.run() @@ -46,7 +51,7 @@ def testSessionStartFail(self): self.mock_subscriber.subscribe.assert_not_called() def testSessionAuthorizeFail(self): - """ Verify that if authorization fails, no subscriptions are made. + """Verify that if authorization fails, no subscriptions are made. Plan: Set up and verify the following mocks: @@ -54,10 +59,12 @@ def testSessionAuthorizeFail(self): b. authorize() fails and returns False. c. subscribe() is not called. """ - application = Application(self.mock_session, - self.mock_authorizer, - self.mock_subscriber, - self.mock_options) + application = Application( + self.mock_session, + self.mock_authorizer, + self.mock_subscriber, + self.mock_options, + ) self.mock_session.start.return_value = True self.mock_authorizer.authorize.return_value = False @@ -69,7 +76,7 @@ def testSessionAuthorizeFail(self): self.mock_subscriber.subscribe.assert_not_called() def testSubscribeWithConfig(self): - """ Verify the correct topics and fields are used when subscribing on + """Verify the correct topics and fields are used when subscribing on the session. Plan: @@ -83,16 +90,20 @@ def testSubscribeWithConfig(self): expected_fields = ["LAST_PRICE", "BID", "ASK"] service_name = "//blp/mktdata" - self.mock_options.configure_mock(**{ - "service": service_name, - "topics": expected_topics, - "fields": expected_fields - }) - - application = Application(self.mock_session, - self.mock_authorizer, - self.mock_subscriber, - self.mock_options) + self.mock_options.configure_mock( + **{ + "service": service_name, + "topics": expected_topics, + "fields": expected_fields, + } + ) + + application = Application( + self.mock_session, + self.mock_authorizer, + self.mock_subscriber, + self.mock_options, + ) self.mock_session.start.return_value = True self.mock_authorizer.authorize.return_value = True diff --git a/examples/unittests/market-data-notifier/tests/test_authorizer.py b/examples/unittests/market-data-notifier/tests/test_authorizer.py index 9abc66e..01fe1aa 100644 --- a/examples/unittests/market-data-notifier/tests/test_authorizer.py +++ b/examples/unittests/market-data-notifier/tests/test_authorizer.py @@ -9,15 +9,17 @@ import os import sys -#pylint: disable=line-too-long,wrong-import-position -sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../src'))) + +# pylint: disable=line-too-long,wrong-import-position +sys.path.insert( + 0, os.path.abspath(os.path.join(os.path.dirname(__file__), "../src")) +) from authorizer import Authorizer import blpapi -APIAUTH_SCHEMA = \ -""" +APIAUTH_SCHEMA = """ @@ -158,18 +160,20 @@ """ + class TestAuthorizer(unittest.TestCase): - """ Test cases for Authorizer. """ + """Test cases for Authorizer.""" def setUp(self): self.mock_session = Mock() self.mock_token_generator = Mock() - self.authorizer = Authorizer(self.mock_session, - self.mock_token_generator) + self.authorizer = Authorizer( + self.mock_session, self.mock_token_generator + ) self.mock_event_queue = Mock() def testAuthorizationSuccess(self): - """ Verify that for a valid identity the authorization returns True. + """Verify that for a valid identity the authorization returns True. Plan: 1. Create a service instance from the apiauth schema. @@ -193,8 +197,9 @@ def testAuthorizationSuccess(self): event = blpapi.test.createEvent(blpapi.Event.RESPONSE) authorization_success = blpapi.Name("AuthorizationSuccess") - schema_def = \ - blpapi.test.getAdminMessageDefinition(authorization_success) + schema_def = blpapi.test.getAdminMessageDefinition( + authorization_success + ) blpapi.test.appendMessage(event, schema_def) @@ -204,8 +209,9 @@ def testAuthorizationSuccess(self): self.mock_event_queue.nextEvent.return_value = event identity = Mock() - authorization_result = self.authorizer.authorize(identity, - self.mock_event_queue) + authorization_result = self.authorizer.authorize( + identity, self.mock_event_queue + ) self.mock_session.openService.assert_called_once() self.mock_session.getService.assert_called_once() @@ -217,7 +223,7 @@ def testAuthorizationSuccess(self): self.assertTrue(authorization_result) def testAuthorizationFailure(self): - """ Verify that for a invalid identity the authorization returns False. + """Verify that for a invalid identity the authorization returns False. Plan: 1. Create a service instance from the apiauth schema. @@ -240,9 +246,9 @@ def testAuthorizationFailure(self): event = blpapi.test.createEvent(blpapi.Event.RESPONSE) authorization_request = blpapi.Name("AuthorizationRequest") authorization_failure_index = 1 - schema_def = service \ - .getOperation(authorization_request) \ - .getResponseDefinitionAt(authorization_failure_index) + schema_def = service.getOperation( + authorization_request + ).getResponseDefinitionAt(authorization_failure_index) formatter = blpapi.test.appendMessage(event, schema_def) @@ -252,7 +258,7 @@ def testAuthorizationFailure(self): "message": "Invalid user", "category": "BAD_ARGS", "subcategory": "INVALID_USER", - "source": "test-source" + "source": "test-source", } } @@ -261,8 +267,9 @@ def testAuthorizationFailure(self): self.mock_event_queue.nextEvent.return_value = event identity = Mock() - authorization_result = self.authorizer.authorize(identity, - self.mock_event_queue) + authorization_result = self.authorizer.authorize( + identity, self.mock_event_queue + ) self.mock_session.openService.assert_called_once() self.mock_session.getService.assert_called_once() diff --git a/examples/unittests/market-data-notifier/tests/test_eventprocessor.py b/examples/unittests/market-data-notifier/tests/test_eventprocessor.py index 63ca39f..30f02c7 100644 --- a/examples/unittests/market-data-notifier/tests/test_eventprocessor.py +++ b/examples/unittests/market-data-notifier/tests/test_eventprocessor.py @@ -9,15 +9,17 @@ import os import sys -#pylint: disable=line-too-long,wrong-import-position -sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../src'))) + +# pylint: disable=line-too-long,wrong-import-position +sys.path.insert( + 0, os.path.abspath(os.path.join(os.path.dirname(__file__), "../src")) +) from event_processor import EventProcessor import blpapi -MKTDATA_SCHEMA = \ -""" +MKTDATA_SCHEMA = """ @@ -56,18 +58,20 @@ """ + class TestEventProcessor(unittest.TestCase): - """ Test cases for EventProcessor. """ + """Test cases for EventProcessor.""" def setUp(self): self.mock_session = Mock() self.mock_notifier = Mock() self.mock_compute_engine = Mock() - self.event_processor = EventProcessor(self.mock_notifier, - self.mock_compute_engine) + self.event_processor = EventProcessor( + self.mock_notifier, self.mock_compute_engine + ) def testNotifierReceivesSessionStarted(self): - """ Verify that notifier receives a `SessionStarted' message. + """Verify that notifier receives a `SessionStarted' message. Plan: 1. Create a SessionStatus admin event using blpapi.test.createEvent(). @@ -90,9 +94,8 @@ def testNotifierReceivesSessionStarted(self): actual_message = self.mock_notifier.log_session_state.call_args[0][0] self.assertEqual(session_started, actual_message.messageType()) - def testNotifierReceivesSubscriptionStarted(self): - """ Verify that notifier receives a `SubscriptionStarted` message. + """Verify that notifier receives a `SubscriptionStarted` message. Plan: 1. Create a SubscriptionStatus admin event using @@ -106,19 +109,22 @@ def testNotifierReceivesSubscriptionStarted(self): """ event = blpapi.test.createEvent(blpapi.Event.SUBSCRIPTION_STATUS) subscription_started = blpapi.Name("SubscriptionStarted") - schema_def = blpapi.test.getAdminMessageDefinition(subscription_started) + schema_def = blpapi.test.getAdminMessageDefinition( + subscription_started + ) blpapi.test.appendMessage(event, schema_def) self.event_processor.processEvent(event, self.mock_session) self.mock_notifier.log_subscription_state.assert_called_once() - actual_message = \ - self.mock_notifier.log_subscription_state.call_args[0][0] + actual_message = self.mock_notifier.log_subscription_state.call_args[ + 0 + ][0] self.assertEqual(subscription_started, actual_message.messageType()) def testNotifierReceivesSubscriptionData(self): - """ Verify that: + """Verify that: 1. Compute engine receives the correct LAST_PRICE. 2. Compute engine performs the correct computation and returns the correct value. @@ -144,22 +150,23 @@ def testNotifierReceivesSubscriptionData(self): formatter = blpapi.test.appendMessage(event, schema_def) expected_last_price = 142.80 - message_content = { - "LAST_PRICE": expected_last_price - } + message_content = {"LAST_PRICE": expected_last_price} formatter.formatMessageDict(message_content) expected_compute_result = 200.00 - self.mock_compute_engine.someVeryComplexComputation.return_value = \ + self.mock_compute_engine.someVeryComplexComputation.return_value = ( expected_compute_result + ) self.event_processor.processEvent(event, self.mock_session) - self.mock_compute_engine.someVeryComplexComputation \ - .assert_called_once_with(expected_last_price) - self.mock_notifier.send_to_terminal \ - .assert_called_once_with(expected_compute_result) + self.mock_compute_engine.someVeryComplexComputation.assert_called_once_with( + expected_last_price + ) + self.mock_notifier.send_to_terminal.assert_called_once_with( + expected_compute_result + ) if __name__ == "__main__": diff --git a/examples/unittests/market-data-notifier/tests/test_tokengenerator.py b/examples/unittests/market-data-notifier/tests/test_tokengenerator.py index c0239aa..3531bcd 100644 --- a/examples/unittests/market-data-notifier/tests/test_tokengenerator.py +++ b/examples/unittests/market-data-notifier/tests/test_tokengenerator.py @@ -9,15 +9,18 @@ import os import sys -#pylint: disable=line-too-long,wrong-import-position -sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../src'))) + +# pylint: disable=line-too-long,wrong-import-position +sys.path.insert( + 0, os.path.abspath(os.path.join(os.path.dirname(__file__), "../src")) +) from token_generator import TokenGenerator import blpapi class TestTokenGenerator(unittest.TestCase): - """ Test cases for TokenGenerator. """ + """Test cases for TokenGenerator.""" def setUp(self): self.mock_session = Mock() @@ -25,7 +28,7 @@ def setUp(self): self.token_generator = TokenGenerator(self.mock_session) def testTokenGenerationSuccess(self): - """ Verify that on token generation success, the application receives + """Verify that on token generation success, the application receives a valid token. Plan: @@ -48,9 +51,7 @@ def testTokenGenerationSuccess(self): formatter = blpapi.test.appendMessage(event, schema_def) expected_token = "dummy_token" - message_content = { - "token": expected_token - } + message_content = {"token": expected_token} formatter.formatMessageDict(message_content) @@ -63,7 +64,7 @@ def testTokenGenerationSuccess(self): self.assertEqual(expected_token, actual_token) def testTokenGenerationFailure(self): - """ Verify that on token generation failure, the application receives an + """Verify that on token generation failure, the application receives an empty token. Plan: @@ -84,7 +85,7 @@ def testTokenGenerationFailure(self): "category": "NO_AUTH", "errorCode": 3, "description": "App not in emrs ...", - "subcategory": "INVALID_APP" + "subcategory": "INVALID_APP", } } event = blpapi.test.createEvent(blpapi.Event.TOKEN_STATUS) diff --git a/examples/unittests/snippets/resolver/resolverutils.py b/examples/unittests/snippets/resolver/resolverutils.py index f34567d..7d12b4b 100644 --- a/examples/unittests/snippets/resolver/resolverutils.py +++ b/examples/unittests/snippets/resolver/resolverutils.py @@ -24,10 +24,11 @@ # This can be any string, but it's helpful to provide information on the # instance of the resolver that responded to debug failures in production. -def resolutionServiceRegistration(providerSession, - providerIdentity, - serviceName): - """ This helper demonstrates how to register a service. + +def resolutionServiceRegistration( + providerSession, providerIdentity, serviceName +): + """This helper demonstrates how to register a service. This helper assumes the following: * Specified `providerSession` is already started @@ -49,26 +50,30 @@ def resolutionServiceRegistration(providerSession, serviceOptions.setServicePriority(dummyPriority) serviceOptions.setPartsToRegister( - blpapi.ServiceRegistrationOptions.PART_PUBLISHER_RESOLUTION) + blpapi.ServiceRegistrationOptions.PART_PUBLISHER_RESOLUTION + ) - if not providerSession.registerService(serviceName, - providerIdentity, - serviceOptions): + if not providerSession.registerService( + serviceName, providerIdentity, serviceOptions + ): print("Failed to register {}".format(serviceName)) return False return True + def handlePermissionRequest(providerSession, service, request): - """ Respond to a PermissionRequest. + """Respond to a PermissionRequest. Only accept requests with applicationId `ALLOWED_APP_ID`. """ assert request.messageType() == PERMISSION_REQUEST disallowed = 1 - if request.hasElement("applicationId") and \ - request.getElementAsInteger("applicationId") == ALLOWED_APP_ID: + if ( + request.hasElement("applicationId") + and request.getElementAsInteger("applicationId") == ALLOWED_APP_ID + ): disallowed = 0 response = service.createResponseEvent(request.correlationIds()[0]) diff --git a/examples/unittests/snippets/resolver/test_resolverutils.py b/examples/unittests/snippets/resolver/test_resolverutils.py index 34b3375..b0e1b09 100644 --- a/examples/unittests/snippets/resolver/test_resolverutils.py +++ b/examples/unittests/snippets/resolver/test_resolverutils.py @@ -11,9 +11,10 @@ import blpapi -from resolverutils import \ - resolutionServiceRegistration, \ - handlePermissionRequest +from resolverutils import ( + resolutionServiceRegistration, + handlePermissionRequest, +) RESULT = blpapi.Name("result") @@ -27,8 +28,9 @@ ALLOWED_APP_ID = 1234 INVALID_APP_ID = 4321 + def createPermissionEvent(cid, applicationId): - """ Create a mock PermissionRequest `event`. """ + """Create a mock PermissionRequest `event`.""" props = blpapi.test.MessageProperties() props.setCorrelationIds([cid]) @@ -37,12 +39,9 @@ def createPermissionEvent(cid, applicationId): schemaDef = blpapi.test.getAdminMessageDefinition(PERMISSION_REQUEST) content = { - "topics": [ - "topic1", - "topic2" - ], + "topics": ["topic1", "topic2"], "serviceName": "//blp/mytestservice", - "applicationId": applicationId + "applicationId": applicationId, } formatter = blpapi.test.appendMessage(request, schemaDef, props) @@ -53,14 +52,15 @@ def createPermissionEvent(cid, applicationId): def getFirstMessage(event): - """ Retrieve the first `Message` from the provided `event`. """ + """Retrieve the first `Message` from the provided `event`.""" for msg in event: return msg raise Exception("No messages in event") -#pylint: disable=line-too-long + +# pylint: disable=line-too-long def getService(): - """ Create a basic `Service` instance by deserializing a schema string. """ + """Create a basic `Service` instance by deserializing a schema string.""" schema = """ \ -\ - \ - \ +# pylint: disable=line-too-long +REF_DATA_SCHEMA = '\ +\ + \ + \ ReferenceDataRequest\ Response\ ReferenceDataResponse\ \ \ \ - \ - \ - \ - \ + \ + \ + \ + \ \ - \ - \ - \ + \ + \ + \ \ - \ - \ + \ + \ true\ false\ \ \ - \ - \ - \ + \ + \ + \ \ - \ - \ - \ - \ - \ - \ - \ + \ + \ + \ + \ + \ + \ + \ \ - \ + \ The contents of this type depends on the response\ - \ - \ + \ + \ \ - \ - \ - \ + \ + \ + \ \ - \ - \ - \ - \ - \ - \ + \ + \ + \ + \ + \ + \ \ \ -" +' class TestRefdata(unittest.TestCase): - """ Responses in `//blp/refdata` use a different dynamic schema for each + """Responses in `//blp/refdata` use a different dynamic schema for each response, depending on the fields requested. This makes it is necessary to create an ad-hoc schema for the test cases. @@ -84,15 +83,15 @@ def setUp(self): self.requestName = blpapi.Name("ReferenceDataRequest") def testRefdataResponseSuccess(self): - """ Verify that a successful `ReferenceDataResponse` can be created + """Verify that a successful `ReferenceDataResponse` can be created with the provided sample schema. Note that some of the fields are not filled in this example. """ event = blpapi.test.createEvent(blpapi.Event.RESPONSE) - schema = self.refdataService \ - .getOperation(self.requestName) \ - .getResponseDefinitionAt(0) + schema = self.refdataService.getOperation( + self.requestName + ).getResponseDefinitionAt(0) formatter = blpapi.test.appendMessage(event, schema) @@ -100,10 +99,8 @@ def testRefdataResponseSuccess(self): "securityData": [ { "security": "IBM US Equity", - "fieldData": { - "LAST_PRICE": 138.533300 - }, - "sequenceNumber": 0 + "fieldData": {"LAST_PRICE": 138.533300}, + "sequenceNumber": 0, } ] } @@ -111,15 +108,15 @@ def testRefdataResponseSuccess(self): formatter.formatMessageDict(content) def testRefdataResponseFailure(self): - """ Verify that an unsuccessful `ReferenceDataResponse` can be created + """Verify that an unsuccessful `ReferenceDataResponse` can be created with the provided sample schema. Note that some of the fields are not filled in this example. """ event = blpapi.test.createEvent(blpapi.Event.RESPONSE) - schema = self.refdataService \ - .getOperation(self.requestName) \ - .getResponseDefinitionAt(0) + schema = self.refdataService.getOperation( + self.requestName + ).getResponseDefinitionAt(0) formatter = blpapi.test.appendMessage(event, schema) @@ -128,17 +125,19 @@ def testRefdataResponseFailure(self): { "security": "IBM US Equity", "fieldData": {}, - "fieldExceptions": [{ - "fieldId": "PX_LAST", - "errorInfo": { - "source": "src", - "code": 5, - "category": "NO_AUTH", - "message": "Field..", - "subcategory": "FIELD.." + "fieldExceptions": [ + { + "fieldId": "PX_LAST", + "errorInfo": { + "source": "src", + "code": 5, + "category": "NO_AUTH", + "message": "Field..", + "subcategory": "FIELD..", + }, } - }], - "sequenceNumber": 0 + ], + "sequenceNumber": 0, } ] } @@ -146,7 +145,7 @@ def testRefdataResponseFailure(self): formatter.formatMessageDict(content) -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..1301504 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,9 @@ +[tool.black] +line-length = 79 +extend-exclude = ''' +/( + | docs +)/ +| src/blpapi/internals.py +| src/blpapi/versionhelper.py +''' diff --git a/setup.py b/setup.py index 36a1215..0f68877 100644 --- a/setup.py +++ b/setup.py @@ -15,100 +15,105 @@ os.chdir(os.path.dirname(os.path.realpath(__file__))) platform = plat.system().lower() + def find_version_number(): """Load the version number from blpapi/version.py""" - version_path = os.path.abspath(os.path.join('src', 'blpapi', 'version.py')) + version_path = os.path.abspath(os.path.join("src", "blpapi", "version.py")) version_file = None - with codecs.open(version_path, 'r') as fp: + with codecs.open(version_path, "r") as fp: version_file = fp.read() - version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", - version_file, re.M) + version_match = re.search( + r"^__version__ = ['\"]([^'\"]*)['\"]", version_file, re.M + ) if version_match: return version_match.group(1) raise RuntimeError("Unable to find version string.") + def lib_in_release(): """Returns the right library folder name for each platform""" - if platform == 'windows': - return 'lib' - if platform == 'linux': - return 'Linux' - if platform == 'darwin': - return 'Darwin' + if platform == "windows": + return "lib" + if platform == "linux": + return "Linux" + if platform == "darwin": + return "Darwin" raise Exception("Platform '" + platform + "' isn't supported") -blpapiRoot = os.environ.get('BLPAPI_ROOT') -blpapiIncludesVar = os.environ.get('BLPAPI_INCDIR') -blpapiLibVar = os.environ.get('BLPAPI_LIBDIR') +blpapiRoot = os.environ.get("BLPAPI_ROOT") +blpapiIncludesVar = os.environ.get("BLPAPI_INCDIR") +blpapiLibVar = os.environ.get("BLPAPI_LIBDIR") -assert blpapiRoot or (blpapiIncludesVar and blpapiLibVar), \ - "BLPAPI_ROOT (or BLPAPI_INCDIR/BLPAPI_LIBDIR) " + \ - "environment variable isn't defined" +assert blpapiRoot or (blpapiIncludesVar and blpapiLibVar), ( + "BLPAPI_ROOT (or BLPAPI_INCDIR/BLPAPI_LIBDIR) " + + "environment variable isn't defined" +) -is64bit = plat.architecture()[0] == '64bit' +is64bit = plat.architecture()[0] == "64bit" if is64bit: - blpapiLibraryName = 'blpapi3_64' + blpapiLibraryName = "blpapi3_64" else: - blpapiLibraryName = 'blpapi3_32' + blpapiLibraryName = "blpapi3_32" extraLinkArgs = [] package_data = {} -if platform == 'windows': - extraLinkArgs = ['/MANIFEST'] +if platform == "windows": + extraLinkArgs = ["/MANIFEST"] # Handle the very frequent case when user need to use Visual C++ 2010 # with Python that wants to use Visual C++ 2008. - if plat.python_compiler().startswith('MSC v.1500'): - if (not 'VS90COMNTOOLS' in os.environ) and \ - ('VS100COMNTOOLS' in os.environ): - os.environ['VS90COMNTOOLS'] = os.environ['VS100COMNTOOLS'] + if plat.python_compiler().startswith("MSC v.1500"): + if (not "VS90COMNTOOLS" in os.environ) and ( + "VS100COMNTOOLS" in os.environ + ): + os.environ["VS90COMNTOOLS"] = os.environ["VS100COMNTOOLS"] - if 'bdist_wheel' in argv: + if "bdist_wheel" in argv: # get src/blpapi/*.dll package_data = { "blpapi": ["blpapi3_64.dll" if is64bit else "blpapi3_32.dll"] } blpapiLibraryPath = blpapiLibVar or os.path.join(blpapiRoot, lib_in_release()) -blpapiIncludes = blpapiIncludesVar or os.path.join(blpapiRoot, 'include') +blpapiIncludes = blpapiIncludesVar or os.path.join(blpapiRoot, "include") blpapi_wrap = Extension( - 'blpapi._internals', - sources=['src/blpapi/internals_wrap.c'], + "blpapi._internals", + sources=["src/blpapi/internals_wrap.c"], include_dirs=[blpapiIncludes], library_dirs=[blpapiLibraryPath], libraries=[blpapiLibraryName], - extra_link_args=extraLinkArgs + extra_link_args=extraLinkArgs, ) versionhelper_wrap = Extension( - 'blpapi._versionhelper', - sources=['src/blpapi/versionhelper_wrap.c'], + "blpapi._versionhelper", + sources=["src/blpapi/versionhelper_wrap.c"], include_dirs=[blpapiIncludes], library_dirs=[blpapiLibraryPath], libraries=[blpapiLibraryName], - extra_link_args=extraLinkArgs + extra_link_args=extraLinkArgs, ) setup( - name='blpapi', + name="blpapi", version=find_version_number(), - author='Bloomberg L.P.', - author_email='open-tech@bloomberg.net', - description='Python SDK for Bloomberg BLPAPI', + author="Bloomberg L.P.", + author_email="open-tech@bloomberg.net", + description="Python SDK for Bloomberg BLPAPI", ext_modules=[blpapi_wrap, versionhelper_wrap], - url='http://www.bloomberglabs.com/api/', + url="http://www.bloomberglabs.com/api/", packages=["blpapi", "blpapi.test"], - package_dir={'': 'src'}, + package_dir={"": "src"}, package_data=package_data, - python_requires='>=3', + python_requires=">=3", classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'License :: Other/Proprietary License', - 'Topic :: Office/Business :: Financial', + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "Intended Audience :: Financial and Insurance Industry", + "License :: Other/Proprietary License", + "Topic :: Office/Business :: Financial", ], ) diff --git a/src/blpapi.egg-info/PKG-INFO b/src/blpapi.egg-info/PKG-INFO index 967153f..769baae 100644 --- a/src/blpapi.egg-info/PKG-INFO +++ b/src/blpapi.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: blpapi -Version: 3.18.0 +Version: 3.18.2 Summary: Python SDK for Bloomberg BLPAPI Home-page: http://www.bloomberglabs.com/api/ Author: Bloomberg L.P. diff --git a/src/blpapi.egg-info/SOURCES.txt b/src/blpapi.egg-info/SOURCES.txt index 2da53c1..4b554aa 100644 --- a/src/blpapi.egg-info/SOURCES.txt +++ b/src/blpapi.egg-info/SOURCES.txt @@ -3,6 +3,7 @@ MANIFEST.in NOTES README.md changelog.txt +pyproject.toml setup.cfg setup.py examples/demoapps/ApiFieldsExample.py diff --git a/src/blpapi/__init__.py b/src/blpapi/__init__.py index d703cc6..95ccf6c 100644 --- a/src/blpapi/__init__.py +++ b/src/blpapi/__init__.py @@ -5,7 +5,8 @@ # pylint: disable=no-member import platform -if platform.system().lower() == 'windows': + +if platform.system().lower() == "windows": import glob import os @@ -19,6 +20,7 @@ # In that case, the next block is going to be skipped entirely. for filename in glob.glob(os.path.join(blpapi_dir, dll_glob)): from ctypes import CDLL + CDLL(os.path.abspath(filename)) try: @@ -27,6 +29,7 @@ # The most likely reason for a failure here is a failure to locate the # shared object for the C++ library. Provide a meaningful error message. from .debug import debug_load_error + raise debug_load_error(error) from .abstractsession import AbstractSession @@ -50,7 +53,11 @@ from .resolutionlist import ResolutionList from .schema import SchemaElementDefinition, SchemaStatus, SchemaTypeDefinition from .service import Service, Operation -from .session import Session, SubscriptionPreprocessError, SubscriptionPreprocessMode +from .session import ( + Session, + SubscriptionPreprocessError, + SubscriptionPreprocessMode, +) from .sessionoptions import SessionOptions, TlsOptions from .subscriptionlist import SubscriptionList from .topic import Topic diff --git a/src/blpapi/abstractsession.py b/src/blpapi/abstractsession.py index c7cd190..a4c6c47 100644 --- a/src/blpapi/abstractsession.py +++ b/src/blpapi/abstractsession.py @@ -18,7 +18,7 @@ # pylint: disable=protected-access from typing import Callable, Union, Sequence, Optional -from . import typehints # pylint: disable=unused-import +from . import typehints # pylint: disable=unused-import from .typehints import BlpapiAbstractSessionHandle from . import exception from .exception import _ExceptionUtil @@ -86,9 +86,10 @@ class AbstractSession(CHandle): """ def __init__( - self, - handle: Optional[BlpapiAbstractSessionHandle]=None, - dtor: Optional[Callable]=None) -> None: + self, + handle: Optional[BlpapiAbstractSessionHandle] = None, + dtor: Optional[Callable] = None, + ) -> None: """Instantiate an :class:`AbstractSession` with the specified handle. Args: @@ -103,9 +104,11 @@ def __init__( """ if self.__class__ is AbstractSession: - raise NotImplementedError("Don't instantiate this class directly.\ - Create sessions using one of the concrete subclasses of this class.") - super(AbstractSession, self).__init__(handle, dtor) # type: ignore + raise NotImplementedError( + "Don't instantiate this class directly.\ + Create sessions using one of the concrete subclasses of this class." + ) + super(AbstractSession, self).__init__(handle, dtor) # type: ignore self.__handle = handle def openService(self, serviceName: str) -> bool: @@ -131,15 +134,16 @@ def openService(self, serviceName: str) -> bool: this :class:`Event` may be processed by the registered ``eventHandler`` before :meth:`openService()` has returned. """ - return internals.blpapi_AbstractSession_openService( - self.__handle, - serviceName) == 0 + return ( + internals.blpapi_AbstractSession_openService( + self.__handle, serviceName + ) + == 0 + ) def openServiceAsync( - self, - serviceName: str, - correlationId: Optional[CorrelationId]=None - ) -> CorrelationId: + self, serviceName: str, correlationId: Optional[CorrelationId] = None + ) -> CorrelationId: """Begin the process to open the service and return immediately. Args: @@ -167,18 +171,18 @@ def openServiceAsync( correlationId = CorrelationId() _ExceptionUtil.raiseOnError( internals.blpapi_AbstractSession_openServiceAsync( - self.__handle, - serviceName, - correlationId)) + self.__handle, serviceName, correlationId + ) + ) return correlationId def sendAuthorizationRequest( - self, - request: "typehints.Request", - identity: Identity, - correlationId: Optional[CorrelationId]=None, - eventQueue: Optional["typehints.EventQueue"]=None - ) -> CorrelationId: + self, + request: "typehints.Request", + identity: Identity, + correlationId: Optional[CorrelationId] = None, + eventQueue: Optional["typehints.EventQueue"] = None, + ) -> CorrelationId: """Send the specified ``authorizationRequest``. Args: @@ -227,15 +231,16 @@ def sendAuthorizationRequest( get_handle(identity), correlationId, get_handle(eventQueue), - None # no request label - )) + None, # no request label + ) + ) if eventQueue is not None: eventQueue._registerSession(self) return correlationId - def cancel(self, - correlationId: Union[CorrelationId, - Sequence[CorrelationId]]) -> None: + def cancel( + self, correlationId: Union[CorrelationId, Sequence[CorrelationId]] + ) -> None: """Cancel request(s) with a single ``correlationId`` or a list. Args: @@ -261,16 +266,17 @@ def cancel(self, cids = correlationId else: cids = [correlationId] - _ExceptionUtil.raiseOnError(internals.blpapi_AbstractSession_cancel( - self.__handle, - cids, # type: ignore - None)) # no request label - - def generateToken(self, - correlationId: Optional[CorrelationId]=None, - eventQueue: Optional["typehints.EventQueue"]=None, - authId: Optional[str]=None, - ipAddress: Optional[str]=None) -> CorrelationId: + _ExceptionUtil.raiseOnError( + internals.blpapi_AbstractSession_cancel(self.__handle, cids, None) + ) # no request label + + def generateToken( + self, + correlationId: Optional[CorrelationId] = None, + eventQueue: Optional["typehints.EventQueue"] = None, + authId: Optional[str] = None, + ipAddress: Optional[str] = None, + ) -> CorrelationId: """Generate a token to be used for authorization. Args: @@ -298,9 +304,9 @@ def generateToken(self, if authId is None and ipAddress is None: _ExceptionUtil.raiseOnError( internals.blpapi_AbstractSession_generateToken( - self.__handle, - correlationId, - get_handle(eventQueue))) + self.__handle, correlationId, get_handle(eventQueue) + ) + ) elif authId is not None and ipAddress is not None: _ExceptionUtil.raiseOnError( internals.blpapi_AbstractSession_generateManualToken( @@ -308,10 +314,13 @@ def generateToken(self, correlationId, authId, ipAddress, - get_handle(eventQueue))) + get_handle(eventQueue), + ) + ) else: raise exception.InvalidArgumentException( - "'authId' and 'ipAddress' must be provided together", 0) + "'authId' and 'ipAddress' must be provided together", 0 + ) if eventQueue is not None: eventQueue._registerSession(self) return correlationId @@ -333,8 +342,8 @@ def getService(self, serviceName: str) -> Service: is, it must be of the form ``///``. """ errorCode, service = internals.blpapi_AbstractSession_getService( - self.__handle, - serviceName) + self.__handle, serviceName + ) _ExceptionUtil.raiseOnError(errorCode) return Service(service, {self}) @@ -347,12 +356,14 @@ def createIdentity(self) -> Identity: """ return Identity( internals.blpapi_AbstractSession_createIdentity(self.__handle), - (self,)) + (self,), + ) def generateAuthorizedIdentity( - self, - authOptions: "typehints.AuthOptions", - correlationId: Optional[CorrelationId]=None) -> CorrelationId: + self, + authOptions: "typehints.AuthOptions", + correlationId: Optional[CorrelationId] = None, + ) -> CorrelationId: """Generates an authorized :class:`Identity` with the specified ``authOptions`` and ``correlationId``. @@ -377,17 +388,17 @@ def generateAuthorizedIdentity( """ if correlationId is None: correlationId = CorrelationId() - retcode = internals \ - .blpapi_AbstractSession_generateAuthorizedIdentityAsync( - self.__handle, - get_handle(authOptions), - correlationId) + retcode = ( + internals.blpapi_AbstractSession_generateAuthorizedIdentityAsync( + self.__handle, get_handle(authOptions), correlationId + ) + ) _ExceptionUtil.raiseOnError(retcode) return correlationId def getAuthorizedIdentity( - self, - correlationId: Optional[CorrelationId]=None) -> Identity: + self, correlationId: Optional[CorrelationId] = None + ) -> Identity: """Returns the authorized :class:`Identity` associated with ``correlationId``. If ``correlationId`` is not given, returns the session identity. @@ -406,13 +417,16 @@ def getAuthorizedIdentity( """ if correlationId is None: correlationId = CorrelationId() - retcode, identity_handle = internals \ - .blpapi_AbstractSession_getAuthorizedIdentity( - self.__handle, - correlationId) + ( + retcode, + identity_handle, + ) = internals.blpapi_AbstractSession_getAuthorizedIdentity( + self.__handle, correlationId + ) _ExceptionUtil.raiseOnError(retcode) return Identity(identity_handle, (self,)) + __copyright__ = """ Copyright 2019. Bloomberg Finance L.P. diff --git a/src/blpapi/auth.py b/src/blpapi/auth.py index 8cb8945..cbd2587 100644 --- a/src/blpapi/auth.py +++ b/src/blpapi/auth.py @@ -2,22 +2,30 @@ """Provide a configuration to specify the settings used for authorization.""" -from typing import Callable, Any -from .typehints import BlpapiAuthOptionsHandle, BlpapiAuthUserHandle +from typing import Callable, Union +from .typehints import ( + BlpapiAuthOptionsHandle, + BlpapiAuthUserHandle, + BlpapiAuthTokenHandle, + BlpapiAuthAppHandle, +) from . import internals from .utils import get_handle from .exception import _ExceptionUtil from .chandle import CHandle + class AuthOptions(CHandle): """Defines the authorization options which the user can set on :class:`SessionOptions` as the authorization options for the session identity or use to authorize other identities. """ - def __init__(self, - handle: BlpapiAuthOptionsHandle, - **kwargs) -> None: + def __init__( + self, + handle: BlpapiAuthOptionsHandle, + **kwargs: Union[BlpapiAuthAppHandle, BlpapiAuthTokenHandle] + ) -> None: """For internal use only.""" noop = lambda *args: None super(AuthOptions, self).__init__(handle, noop) @@ -29,8 +37,7 @@ def __init__(self, self._token_dtor = internals.blpapi_AuthToken_destroy @classmethod - def createWithUser(cls: Callable, - user: "AuthUser") -> "AuthOptions": + def createWithUser(cls: Callable, user: "AuthUser") -> "AuthOptions": """Creates an :class:`AuthOptions` instance for User Mode with the Operating System Login (Domain/User), Active Directory, or Email. @@ -44,8 +51,10 @@ def createWithUser(cls: Callable, The behavior is undefined when ``user`` was created with :meth:`AuthUser.createWithManualOptions` or is ``None``. """ - retcode, authOptions_handle = internals \ - .blpapi_AuthOptions_create_forUserMode(get_handle(user)) + ( + retcode, + authOptions_handle, + ) = internals.blpapi_AuthOptions_create_forUserMode(get_handle(user)) _ExceptionUtil.raiseOnError(retcode) return cls(authOptions_handle) @@ -62,8 +71,10 @@ def createWithApp(cls: Callable, appName: str) -> "AuthOptions": The behavior is undefined when ``appName`` is ``None`` or ``""``. """ app_handle = AuthOptions._create_app_handle(appName) - retcode, authOptions_handle = internals \ - .blpapi_AuthOptions_create_forAppMode(app_handle) + ( + retcode, + authOptions_handle, + ) = internals.blpapi_AuthOptions_create_forAppMode(app_handle) _ExceptionUtil.raiseOnError(retcode) return cls(authOptions_handle, app_handle=app_handle) @@ -80,15 +91,17 @@ def createWithToken(cls: Callable, token: str) -> "AuthOptions": The behavior is undefined when ``token`` is ``None`` or ``""``. """ token_handle = AuthOptions._create_token_handle(token) - retcode, authOptions_handle = internals \ - .blpapi_AuthOptions_create_forToken(token_handle) + ( + retcode, + authOptions_handle, + ) = internals.blpapi_AuthOptions_create_forToken(token_handle) _ExceptionUtil.raiseOnError(retcode) return cls(authOptions_handle, token_handle=token_handle) @classmethod - def createWithUserAndApp(cls: Callable, - user: "AuthUser", - appName: str) -> "AuthOptions": + def createWithUserAndApp( + cls: Callable, user: "AuthUser", appName: str + ) -> "AuthOptions": """Create an :class:`AuthOptions` instance for User and Application Mode. @@ -104,9 +117,12 @@ def createWithUserAndApp(cls: Callable, The behavior is undefined when ``appName`` is ``None`` or ``""``. """ app_handle = AuthOptions._create_app_handle(appName) - retcode, authOptions_handle = internals \ - .blpapi_AuthOptions_create_forUserAndAppMode(get_handle(user), - app_handle) + ( + retcode, + authOptions_handle, + ) = internals.blpapi_AuthOptions_create_forUserAndAppMode( + get_handle(user), app_handle + ) _ExceptionUtil.raiseOnError(retcode) return cls(authOptions_handle, app_handle=app_handle) @@ -123,18 +139,16 @@ def destroy(self) -> None: self.__token_handle = None @staticmethod - def _create_app_handle(appName: str) -> Any: + def _create_app_handle(appName: str) -> BlpapiAuthAppHandle: """For internal use only.""" - retcode, app_handle = internals \ - .blpapi_AuthApplication_create(appName) + retcode, app_handle = internals.blpapi_AuthApplication_create(appName) _ExceptionUtil.raiseOnError(retcode) return app_handle @staticmethod - def _create_token_handle(token: str) -> Any: + def _create_token_handle(token: str) -> BlpapiAuthTokenHandle: """For internal use only.""" - retcode, token_handle = internals \ - .blpapi_AuthToken_create(token) + retcode, token_handle = internals.blpapi_AuthToken_create(token) _ExceptionUtil.raiseOnError(retcode) return token_handle @@ -145,8 +159,9 @@ class AuthUser(CHandle): def __init__(self, handle: BlpapiAuthUserHandle) -> None: """For internal use only.""" super(AuthUser, self).__init__( - handle, internals.blpapi_AuthUser_destroy) - self.__handle = handle # pylint: disable=unused-private-member + handle, internals.blpapi_AuthUser_destroy + ) + self.__handle = handle # pylint: disable=unused-private-member @classmethod def createWithLogonName(cls: Callable) -> "AuthUser": @@ -156,15 +171,14 @@ def createWithLogonName(cls: Callable) -> "AuthUser": Returns: Configured for Operating System Login (Domain/User) mode. """ - retcode, handle = internals \ - .blpapi_AuthUser_createWithLogonName() + retcode, handle = internals.blpapi_AuthUser_createWithLogonName() _ExceptionUtil.raiseOnError(retcode) return cls(handle) @classmethod def createWithActiveDirectoryProperty( - cls: Callable, - propertyName: str) -> "AuthUser": + cls: Callable, propertyName: str + ) -> "AuthUser": """Creates an :class:`AuthUser` instance configured for Active Directory authorization mode (DIRECTORY_SERVICE). @@ -178,15 +192,19 @@ def createWithActiveDirectoryProperty( The behavior is undefined when ``propertyName`` is ``""`` or ``None``. """ - retcode, handle = internals \ - .blpapi_AuthUser_createWithActiveDirectoryProperty( - propertyName) + ( + retcode, + handle, + ) = internals.blpapi_AuthUser_createWithActiveDirectoryProperty( + propertyName + ) _ExceptionUtil.raiseOnError(retcode) return cls(handle) @classmethod def createWithManualOptions( - cls: Callable, userId: str, ipAddress:str) -> "AuthUser": + cls: Callable, userId: str, ipAddress: str + ) -> "AuthUser": """Creates an :class:`AuthUser` instance configured for manual authorization. @@ -200,11 +218,13 @@ def createWithManualOptions( The behavior is undefined when either ``userId`` or ``ipAddress`` is ``""`` or ``None``. """ - retcode, handle = internals \ - .blpapi_AuthUser_createWithManualOptions(userId, ipAddress) + retcode, handle = internals.blpapi_AuthUser_createWithManualOptions( + userId, ipAddress + ) _ExceptionUtil.raiseOnError(retcode) return cls(handle) + __copyright__ = """ Copyright 2020. Bloomberg Finance L.P. diff --git a/src/blpapi/chandle.py b/src/blpapi/chandle.py index b19e35e..264e518 100644 --- a/src/blpapi/chandle.py +++ b/src/blpapi/chandle.py @@ -12,23 +12,23 @@ class CHandle: """A base class for objects that rely on C handles""" - def __init__(self, handle: Any, dtor: Callable): - """ Set the handle and the dtor """ + def __init__(self, handle: Any, dtor: Callable) -> None: + """Set the handle and the dtor""" self.__handle = handle self._dtor = dtor - def __del__(self): - """ Destroy the object """ + def __del__(self) -> None: + """Destroy the object""" try: self.destroy() except (NameError, AttributeError): pass - def destroy(self): - """ Destroy the handle using stored dtor """ + def destroy(self) -> None: + """Destroy the handle using stored dtor""" if self.__handle: self._dtor(self.__handle) - self._dtor = None + self._dtor = None # type: ignore self.__handle = None def _handle(self) -> Any: diff --git a/src/blpapi/constant.py b/src/blpapi/constant.py index a0c17a1..5b9e614 100644 --- a/src/blpapi/constant.py +++ b/src/blpapi/constant.py @@ -12,23 +12,27 @@ from typing import Any, Iterator as IteratorType, Optional, Set -from .exception import \ - _ExceptionUtil, \ - NotFoundException, \ - IndexOutOfRangeException +from .exception import ( + _ExceptionUtil, + NotFoundException, + IndexOutOfRangeException, +) from .name import Name, getNamePair from .datatype import DataType from .datetime import _DatetimeUtil -from . import typehints # pylint: disable=unused-import -from .typehints import \ - AnyPythonDatetime, \ - BlpapiConstantHandle, \ - BlpapiConstantListHandle +from . import typehints # pylint: disable=unused-import +from .typehints import ( + AnyPythonDatetime, + BlpapiConstantHandle, + BlpapiConstantListHandle, + BlpapiNameOrStr, +) from . import utils from . import internals # pylint: disable=protected-access + class Constant: """Represents the value of a schema enumeration constant. @@ -48,9 +52,11 @@ class Constant: by other ``blpapi`` components. """ - def __init__(self, - handle: BlpapiConstantHandle, - sessions: Optional[Set["typehints.AbstractSession"]]) -> None: + def __init__( + self, + handle: BlpapiConstantHandle, + sessions: Optional[Set["typehints.AbstractSession"]], + ) -> None: """ Args: handle: Handle to the internal implementation @@ -65,7 +71,8 @@ def name(self) -> Name: The symbolic name of this :class:`Constant`. """ return Name._createInternally( - internals.blpapi_Constant_name(self.__handle)) + internals.blpapi_Constant_name(self.__handle) + ) def description(self) -> str: """ @@ -103,10 +110,12 @@ def getValueAsInteger(self) -> int: """ if self.datatype() == DataType.INT32: errCode, value = internals.blpapi_Constant_getValueAsInt32( - self.__handle) + self.__handle + ) else: errCode, value = internals.blpapi_Constant_getValueAsInt64( - self.__handle) + self.__handle + ) _ExceptionUtil.raiseOnError(errCode) return value @@ -121,10 +130,12 @@ def getValueAsFloat(self) -> float: """ if self.datatype() == DataType.FLOAT32: errCode, value = internals.blpapi_Constant_getValueAsFloat32( - self.__handle) + self.__handle + ) else: errCode, value = internals.blpapi_Constant_getValueAsFloat64( - self.__handle) + self.__handle + ) _ExceptionUtil.raiseOnError(errCode) return value @@ -138,7 +149,8 @@ def getValueAsDatetime(self) -> AnyPythonDatetime: one of the datetime types. """ errCode, value = internals.blpapi_Constant_getValueAsDatetime( - self.__handle) + self.__handle + ) _ExceptionUtil.raiseOnError(errCode) return _DatetimeUtil.convertToNativeNotHighPrecision(value) @@ -153,10 +165,12 @@ def getValueAsString(self) -> str: """ if self.datatype() == DataType.CHAR: errCode, value = internals.blpapi_Constant_getValueAsChar( - self.__handle) + self.__handle + ) else: errCode, value = internals.blpapi_Constant_getValueAsString( - self.__handle) + self.__handle + ) _ExceptionUtil.raiseOnError(errCode) return value @@ -167,8 +181,8 @@ def getValue(self) -> Any: """ datatype = self.datatype() valueGetter = _CONSTANT_VALUE_GETTER.get( - datatype, - Constant.getValueAsString) + datatype, Constant.getValueAsString + ) return valueGetter(self) def _sessions(self) -> Optional[Set["typehints.AbstractSession"]]: @@ -191,9 +205,11 @@ class ConstantList: returned by other ``blpapi`` components. """ - def __init__(self, - handle: BlpapiConstantListHandle, - sessions: Optional[Set["typehints.AbstractSession"]]) -> None: + def __init__( + self, + handle: BlpapiConstantListHandle, + sessions: Optional[Set["typehints.AbstractSession"]], + ) -> None: """ Args: handle: Handle to the internal implementation @@ -207,26 +223,27 @@ def __iter__(self) -> IteratorType: Returns: Iterator over constants contained in this :class:`ConstantList` """ - return utils.Iterator(self, - ConstantList.numConstants, - ConstantList.getConstantAt) + return utils.Iterator( + self, ConstantList.numConstants, ConstantList.getConstantAt + ) - def name(self): + def name(self) -> Name: """ Returns: Name: Symbolic name of this :class:`ConstantList` """ return Name._createInternally( - internals.blpapi_ConstantList_name(self.__handle)) + internals.blpapi_ConstantList_name(self.__handle) + ) - def description(self): + def description(self) -> str: """ Returns: str: Human readable description of this :class:`ConstantList` """ return internals.blpapi_ConstantList_description(self.__handle) - def status(self): + def status(self) -> int: """ Returns: int: Status of this :class:`ConstantList` @@ -235,14 +252,14 @@ def status(self): """ return internals.blpapi_ConstantList_status(self.__handle) - def numConstants(self): + def numConstants(self) -> int: """ Returns: int: Number of :class:`Constant` objects in this list """ return internals.blpapi_ConstantList_numConstants(self.__handle) - def datatype(self): + def datatype(self) -> int: """ Returns: int: Data type used to represent the value of this constant @@ -251,65 +268,69 @@ def datatype(self): """ return internals.blpapi_ConstantList_datatype(self.__handle) - def hasConstant(self, name): + def hasConstant(self, name: BlpapiNameOrStr) -> bool: """ Args: - name (Name or str): Name of the constant + name: Name of the constant Returns: - bool: ``True`` if this :class:`ConstantList` contains an item with + ``True`` if this :class:`ConstantList` contains an item with this ``name``. Raises: TypeError: If ``name`` is neither a :class:`Name` nor a string """ names = getNamePair(name) - return bool(internals.blpapi_ConstantList_hasConstant(self.__handle, - names[0], - names[1])) + return bool( + internals.blpapi_ConstantList_hasConstant( + self.__handle, names[0], names[1] + ) + ) - def getConstant(self, name): + def getConstant(self, name: BlpapiNameOrStr) -> Constant: """ Args: - name (Name or str): Name of the constant + name: Name of the constant Returns: - Constant: Constant with the specified ``name`` + Constant with the specified ``name`` Raises: NotFoundException: If this :class:`ConstantList` does not contain a :class:`Constant` with the specified ``name`` """ names = getNamePair(name) - res = internals.blpapi_ConstantList_getConstant(self.__handle, - names[0], - names[1]) + res = internals.blpapi_ConstantList_getConstant( + self.__handle, names[0], names[1] + ) if res is None: - errMessage = \ + errMessage = ( f"Constant '{name!s}' is not found in '{self.name()!s}'." + ) raise NotFoundException(errMessage, 0) return Constant(res, self.__sessions) - def getConstantAt(self, position): + def getConstantAt(self, position: int) -> Constant: """ Args: - position (int): Position of the requested constant in the list + position: Position of the requested constant in the list Returns: - Constant: Constant at the specified ``position``. + Constant at the specified ``position``. Raises: IndexOutOfRangeException: If ``position`` is not in the range from ``0`` to ``numConstants() - 1``. """ - res = internals.blpapi_ConstantList_getConstantAt(self.__handle, - position) + res = internals.blpapi_ConstantList_getConstantAt( + self.__handle, position + ) if res is None: errMessage = f"Index '{position}' out of bounds." raise IndexOutOfRangeException(errMessage, 0) return Constant(res, self.__sessions) - def _sessions(self): + def _sessions(self) -> Optional[Set["typehints.AbstractSession"]]: """Return session(s) this object is related to. For internal use.""" return self.__sessions diff --git a/src/blpapi/datatype.py b/src/blpapi/datatype.py index 46e0a7c..cd14eaa 100644 --- a/src/blpapi/datatype.py +++ b/src/blpapi/datatype.py @@ -16,41 +16,42 @@ class DataType(metaclass=utils.MetaClassForClassesWithEnums): :class:`Element`. """ - BOOL = internals.DATATYPE_BOOL # type: ignore + BOOL = internals.DATATYPE_BOOL # type: ignore """Boolean""" - CHAR = internals.DATATYPE_CHAR # type: ignore + CHAR = internals.DATATYPE_CHAR # type: ignore """Char""" - BYTE = internals.DATATYPE_BYTE # type: ignore + BYTE = internals.DATATYPE_BYTE # type: ignore """Unsigned 8 bit value""" - INT32 = internals.DATATYPE_INT32 # type: ignore + INT32 = internals.DATATYPE_INT32 # type: ignore """32 bit Integer""" - INT64 = internals.DATATYPE_INT64 # type: ignore + INT64 = internals.DATATYPE_INT64 # type: ignore """64 bit Integer""" - FLOAT32 = internals.DATATYPE_FLOAT32 # type: ignore + FLOAT32 = internals.DATATYPE_FLOAT32 # type: ignore """32 bit Floating point""" - FLOAT64 = internals.DATATYPE_FLOAT64 # type: ignore + FLOAT64 = internals.DATATYPE_FLOAT64 # type: ignore """64 bit Floating point""" - STRING = internals.DATATYPE_STRING # type: ignore + STRING = internals.DATATYPE_STRING # type: ignore """ASCIIZ string""" - BYTEARRAY = internals.DATATYPE_BYTEARRAY # type: ignore + BYTEARRAY = internals.DATATYPE_BYTEARRAY # type: ignore """Opaque binary data""" - DATE = internals.DATATYPE_DATE # type: ignore + DATE = internals.DATATYPE_DATE # type: ignore """Date""" - TIME = internals.DATATYPE_TIME # type: ignore + TIME = internals.DATATYPE_TIME # type: ignore """Timestamp""" - DECIMAL = internals.DATATYPE_DECIMAL # type: ignore + DECIMAL = internals.DATATYPE_DECIMAL # type: ignore """Currently Unsupported""" - DATETIME = internals.DATATYPE_DATETIME # type: ignore + DATETIME = internals.DATATYPE_DATETIME # type: ignore """Date and time""" - ENUMERATION = internals.DATATYPE_ENUMERATION # type: ignore + ENUMERATION = internals.DATATYPE_ENUMERATION # type: ignore """An opaque enumeration""" - SEQUENCE = internals.DATATYPE_SEQUENCE # type: ignore + SEQUENCE = internals.DATATYPE_SEQUENCE # type: ignore """Sequence type""" - CHOICE = internals.DATATYPE_CHOICE # type: ignore + CHOICE = internals.DATATYPE_CHOICE # type: ignore """Choice type""" - CORRELATION_ID = internals.DATATYPE_CORRELATION_ID # type: ignore + CORRELATION_ID = internals.DATATYPE_CORRELATION_ID # type: ignore """Used for some internal messages""" + __copyright__ = """ Copyright 2012. Bloomberg Finance L.P. diff --git a/src/blpapi/datetime.py b/src/blpapi/datetime.py index cad79b3..f64c5d8 100644 --- a/src/blpapi/datetime.py +++ b/src/blpapi/datetime.py @@ -8,7 +8,7 @@ from .typehints import AnyPythonDatetime, BlpapiDatetime from . import internals from . import utils -from . import typehints # pylint: disable=unused-import +from . import typehints # pylint: disable=unused-import # pylint: disable=no-member @@ -55,11 +55,13 @@ def utcoffset(self, dt: Optional[_dt.datetime]) -> _dt.timedelta: del dt return self.__offset - def dst(self, dt: Optional[_dt.datetime]) -> _dt.timedelta: # pylint: disable=no-self-use + def dst( + self, dt: Optional[_dt.datetime] + ) -> _dt.timedelta: # pylint: disable=no-self-use del dt return _dt.timedelta(0) - def tzname(self, dt: Optional[_dt.datetime]) -> _dt.timedelta: # type: ignore # superclass returns str, but .__offset is a timedelta + def tzname(self, dt: Optional[_dt.datetime]) -> _dt.timedelta: # type: ignore # superclass returns str, but .__offset is a timedelta del dt return self.__offset @@ -74,7 +76,7 @@ def __hash__(self) -> int: """x.__hash__() <==> hash(x)""" return self.getOffsetInMinutes() - def __eq__(self, other: "FixedOffset") -> bool: # type: ignore # mypy wants us to accept arbitrary object and check isinstance() + def __eq__(self, other: "FixedOffset") -> bool: # type: ignore # mypy wants us to accept arbitrary object and check isinstance() """Let the equality operator work based on the time delta.""" return self.getOffsetInMinutes() == other.getOffsetInMinutes() @@ -93,86 +95,112 @@ def __le__(self, other: "FixedOffset") -> bool: class _DatetimeUtil(object): """Utility methods that deal with BLPAPI dates and times.""" + @staticmethod - def convertToNative(blpapiDatetimeObj: BlpapiDatetime) -> AnyPythonDatetime: + def convertToNative( + blpapiDatetimeObj: BlpapiDatetime, + ) -> AnyPythonDatetime: """Convert BLPAPI Datetime object to a suitable Python object.""" isHighPrecision = isinstance( - blpapiDatetimeObj, - internals.blpapi_HighPrecisionDatetime_tag) + blpapiDatetimeObj, internals.blpapi_HighPrecisionDatetime_tag + ) if not isHighPrecision: raise ValueError( - "Datetime object is not high precision", - blpapiDatetimeObj) + "Datetime object is not high precision", blpapiDatetimeObj + ) blpapiDatetime = blpapiDatetimeObj.datetime parts = blpapiDatetime.parts - hasDate = parts & internals.DATETIME_DATE_PART == \ - internals.DATETIME_DATE_PART + hasDate = ( + parts & internals.DATETIME_DATE_PART + == internals.DATETIME_DATE_PART + ) hasTime = parts & internals.DATETIME_TIMEFRACSECONDS_PART != 0 - microsecs = (blpapiDatetime.milliSeconds * 1000 + - blpapiDatetimeObj.picoseconds // 1000 // 1000) \ - if parts & internals.DATETIME_FRACSECONDS_PART else 0 - - return _DatetimeUtil._convertToNativeTypeHelper(hasDate, - hasTime, - blpapiDatetime, - microsecs) + microsecs = ( + ( + blpapiDatetime.milliSeconds * 1000 + + blpapiDatetimeObj.picoseconds // 1000 // 1000 + ) + if parts & internals.DATETIME_FRACSECONDS_PART + else 0 + ) + + return _DatetimeUtil._convertToNativeTypeHelper( + hasDate, hasTime, blpapiDatetime, microsecs + ) @staticmethod - def convertToNativeNotHighPrecision(blpapiDatetime: BlpapiDatetime) -> AnyPythonDatetime: + def convertToNativeNotHighPrecision( + blpapiDatetime: BlpapiDatetime, + ) -> AnyPythonDatetime: """Convert BLPAPI Datetime object to a suitable Python object. This version should only be used for logging callback which does not provide a high precision datetime alternative.""" parts = blpapiDatetime.parts - hasDate = parts & internals.DATETIME_DATE_PART == \ - internals.DATETIME_DATE_PART - hasTime = parts & internals.DATETIME_TIME_PART == \ - internals.DATETIME_TIME_PART - microsecs = blpapiDatetime.milliSeconds * 1000 if parts & \ - internals.DATETIME_MILLISECONDS_PART else 0 - return _DatetimeUtil._convertToNativeTypeHelper(hasDate, - hasTime, - blpapiDatetime, - microsecs) + hasDate = ( + parts & internals.DATETIME_DATE_PART + == internals.DATETIME_DATE_PART + ) + hasTime = ( + parts & internals.DATETIME_TIME_PART + == internals.DATETIME_TIME_PART + ) + microsecs = ( + blpapiDatetime.milliSeconds * 1000 + if parts & internals.DATETIME_MILLISECONDS_PART + else 0 + ) + return _DatetimeUtil._convertToNativeTypeHelper( + hasDate, hasTime, blpapiDatetime, microsecs + ) @staticmethod - def _convertToNativeTypeHelper(hasDate: bool, - hasTime: bool, - blpapiDatetime: BlpapiDatetime, - microsecs: int - ) -> AnyPythonDatetime: + def _convertToNativeTypeHelper( + hasDate: bool, + hasTime: bool, + blpapiDatetime: BlpapiDatetime, + microsecs: int, + ) -> AnyPythonDatetime: parts = blpapiDatetime.parts - tzinfo = FixedOffset(blpapiDatetime.offset) if parts & \ - internals.DATETIME_OFFSET_PART else None + tzinfo = ( + FixedOffset(blpapiDatetime.offset) + if parts & internals.DATETIME_OFFSET_PART + else None + ) if hasDate and hasTime: - return _dt.datetime(blpapiDatetime.year, - blpapiDatetime.month, - blpapiDatetime.day, - blpapiDatetime.hours, - blpapiDatetime.minutes, - blpapiDatetime.seconds, - microsecs, - tzinfo) + return _dt.datetime( + blpapiDatetime.year, + blpapiDatetime.month, + blpapiDatetime.day, + blpapiDatetime.hours, + blpapiDatetime.minutes, + blpapiDatetime.seconds, + microsecs, + tzinfo, + ) elif hasDate: # Skip an offset, because it's not informative if there is a # date without time - return _dt.date(blpapiDatetime.year, - blpapiDatetime.month, - blpapiDatetime.day) + return _dt.date( + blpapiDatetime.year, blpapiDatetime.month, blpapiDatetime.day + ) elif hasTime: - return _dt.time(blpapiDatetime.hours, - blpapiDatetime.minutes, - blpapiDatetime.seconds, - microsecs, - tzinfo) - - raise ValueError("Blpapi datetime object is invalid: missing" - " both date and time parts") - + return _dt.time( + blpapiDatetime.hours, + blpapiDatetime.minutes, + blpapiDatetime.seconds, + microsecs, + tzinfo, + ) + + raise ValueError( + "Blpapi datetime object is invalid: missing" + " both date and time parts" + ) @staticmethod def isDatetime(dtime: Any) -> bool: @@ -181,7 +209,7 @@ def isDatetime(dtime: Any) -> bool: @staticmethod def convertToBlpapi(dtime: AnyPythonDatetime) -> BlpapiDatetime: - "Convert a Python date/time object to a BLPAPI Datetime object.""" + "Convert a Python date/time object to a BLPAPI Datetime object." "" highPrecDatetime = internals.blpapi_HighPrecisionDatetime_tag() res = highPrecDatetime.datetime offset = None @@ -193,11 +221,14 @@ def convertToBlpapi(dtime: AnyPythonDatetime) -> BlpapiDatetime: res.hours = dtime.hour res.minutes = dtime.minute res.seconds = dtime.second - (res.milliSeconds, highPrecDatetime.picoseconds) = \ - divmod(dtime.microsecond, 1000) + (res.milliSeconds, highPrecDatetime.picoseconds) = divmod( + dtime.microsecond, 1000 + ) highPrecDatetime.picoseconds *= 1000 * 1000 - res.parts = internals.DATETIME_DATE_PART | \ - internals.DATETIME_TIMEFRACSECONDS_PART + res.parts = ( + internals.DATETIME_DATE_PART + | internals.DATETIME_TIMEFRACSECONDS_PART + ) elif isinstance(dtime, _dt.date): res.year = dtime.year res.month = dtime.month @@ -208,19 +239,23 @@ def convertToBlpapi(dtime: AnyPythonDatetime) -> BlpapiDatetime: res.hours = dtime.hour res.minutes = dtime.minute res.seconds = dtime.second - (res.milliSeconds, highPrecDatetime.picoseconds) = \ - divmod(dtime.microsecond, 1000) + (res.milliSeconds, highPrecDatetime.picoseconds) = divmod( + dtime.microsecond, 1000 + ) highPrecDatetime.picoseconds *= 1000 * 1000 res.parts = internals.DATETIME_TIMEFRACSECONDS_PART else: - raise TypeError("Datetime can be created only from \ -datetime.datetime, datetime.date or datetime.time") + raise TypeError( + "Datetime can be created only from \ +datetime.datetime, datetime.date or datetime.time" + ) if offset is not None: offsetInMinutes = int(offset.total_seconds() // 60) res.offset = offsetInMinutes res.parts |= internals.DATETIME_OFFSET_PART return highPrecDatetime + __copyright__ = """ Copyright 2012. Bloomberg Finance L.P. diff --git a/src/blpapi/debug.py b/src/blpapi/debug.py index ddd5e0e..420d5d7 100644 --- a/src/blpapi/debug.py +++ b/src/blpapi/debug.py @@ -25,7 +25,8 @@ def debug_load_error(error: ImportError) -> ImportError: # If the version loading succeeds, the most likely reason for a failure # is a mismatch between C++ and Python SDKs. import_error = _version_mismatch_error( - error, version(), cpp_sdk_version()) + error, version(), cpp_sdk_version() + ) # Environment diagnostics currently only works for windows if platform.system().lower() == "windows": @@ -45,11 +46,15 @@ def debug_load_error(error: ImportError) -> ImportError: if diagnostics_path_env_var in os.environ: diagnostics_path = os.environ[diagnostics_path_env_var] try: - with open(diagnostics_path, "w", encoding=getpreferredencoding()) as f: + with open( + diagnostics_path, "w", encoding=getpreferredencoding() + ) as f: f.write(full_error_msg) except IOError: - print("Failed to write to path defined by" - f" {diagnostics_path_env_var}: \"{diagnostics_path}\"") + print( + "Failed to write to path defined by" + f' {diagnostics_path_env_var}: "{diagnostics_path}"' + ) return ImportError(full_error_msg) @@ -59,12 +64,12 @@ def _linker_env() -> str: current platform. """ s = platform.system() - if s == 'Windows': - env = 'PATH' - elif s == 'Darwin': - env = 'DYLD_LIBRARY_PATH' + if s == "Windows": + env = "PATH" + elif s == "Darwin": + env = "DYLD_LIBRARY_PATH" else: - env = 'LD_LIBRARY_PATH' + env = "LD_LIBRARY_PATH" return env @@ -81,7 +86,7 @@ def _version_load_error(error: ImportError) -> str: http://www.bloomberg.com/professional/api-library """ - if 'add_dll_directory' in dir(os): + if "add_dll_directory" in dir(os): msg += """ If the C++ SDK is already installed, Python 3.8+ on Windows requires that the path to the library is added to 'add_dll_directory', i.e.: @@ -98,9 +103,9 @@ def _version_load_error(error: ImportError) -> str: return msg -def _version_mismatch_error(error: ImportError, - py_version: str, - cpp_version: str) -> str: +def _version_mismatch_error( + error: ImportError, py_version: str, cpp_version: str +) -> str: """Called when "import version" succeeds after "import internals" fails Returns some debugging message. """ diff --git a/src/blpapi/debug_environment.py b/src/blpapi/debug_environment.py index 1cce375..05f0e63 100644 --- a/src/blpapi/debug_environment.py +++ b/src/blpapi/debug_environment.py @@ -16,13 +16,17 @@ def _path_diagnostics(print_to_str: Callable[[str], None]) -> None: # Information for PATH related issues - print_to_str('blpapi 64-bit will be loaded from:' - f' "{util.find_library("blpapi3_64")}"') - print_to_str('blpapi 32-bit will be loaded from:' - f' "{util.find_library("blpapi3_32")}"') + print_to_str( + "blpapi 64-bit will be loaded from:" + f' "{util.find_library("blpapi3_64")}"' + ) + print_to_str( + "blpapi 32-bit will be loaded from:" + f' "{util.find_library("blpapi3_32")}"' + ) print_to_str("System PATH: (* marks locations where blpapi was found)") for p in os.environ["PATH"].split(os.pathsep): - if p: # Skip empty entries + if p: # Skip empty entries dll_32 = os.path.join(p, "blpapi3_32.dll") dll_64 = os.path.join(p, "blpapi3_64.dll") found_blpapi_dll = os.path.isfile(dll_32) or os.path.isfile(dll_64) @@ -30,7 +34,9 @@ def _path_diagnostics(print_to_str: Callable[[str], None]) -> None: print_to_str("") -def _add_dll_directory_diagnostics(print_to_str: Callable[[str], None]) -> None: +def _add_dll_directory_diagnostics( + print_to_str: Callable[[str], None] +) -> None: print_to_str("This Python version does not use PATH to find dlls") @@ -50,7 +56,7 @@ def get_env_diagnostics() -> str: print_to_str("Python implementation:", platform.python_implementation()) print_to_str() - if 'add_dll_directory' not in dir(os): + if "add_dll_directory" not in dir(os): _path_diagnostics(print_to_str) else: _add_dll_directory_diagnostics(print_to_str) @@ -60,7 +66,7 @@ def get_env_diagnostics() -> str: for i in pkgutil.iter_modules(): if i[1] == "blpapi": # some modules don't have a .path (e.g. MetaPathFinder) - print_to_str(f'blpapi package at: "{i[0].path}"') # type: ignore + print_to_str(f'blpapi package at: "{i[0].path}"') # type: ignore blpapi_package_found = True if not blpapi_package_found: @@ -77,10 +83,14 @@ def get_env_diagnostics() -> str: print_to_str(f'Current directory: "{os.getcwd()}"') if os.path.isfile(os.path.join(".", "blpapi", "__init__.py")): print_to_str("WARNING: Using the blpapi module from current path") - print_to_str(" CWD files:", ", ".join( - [x for x in os.listdir(".") if os.path.isfile(x)])) - print_to_str(" CWD dirs:", ", ".join( - [x for x in os.listdir(".") if not os.path.isfile(x)])) + print_to_str( + " CWD files:", + ", ".join([x for x in os.listdir(".") if os.path.isfile(x)]), + ) + print_to_str( + " CWD dirs:", + ", ".join([x for x in os.listdir(".") if not os.path.isfile(x)]), + ) return strIO.getvalue() diff --git a/src/blpapi/element.py b/src/blpapi/element.py index 91401d5..48470b1 100644 --- a/src/blpapi/element.py +++ b/src/blpapi/element.py @@ -16,22 +16,26 @@ from .utils import conv2str, Iterator, isNonScalarSequence, isstr from .chandle import CHandle from . import internals -from .typehints import BlpapiNameOrStr,\ - BlpapiNameOrStrOrIndex,\ - AnyPythonDatetime,\ - SupportedElementTypes -from . import typehints # pylint: disable=unused-import +from .typehints import ( + BlpapiNameOrStr, + BlpapiNameOrStrOrIndex, + AnyPythonDatetime, + SupportedElementTypes, +) +from . import typehints # pylint: disable=unused-import from collections.abc import Iterator as IteratorABC, Mapping -from typing import Any,\ - Callable,\ - Dict,\ - Iterator as IteratorType,\ - List,\ - Optional,\ - Sequence,\ - Set,\ - Tuple,\ - Union +from typing import ( + Any, + Callable, + Dict, + Iterator as IteratorType, + List, + Optional, + Sequence, + Set, + Tuple, + Union, +) # pylint: disable=protected-access,too-many-return-statements,too-many-public-methods class ElementIterator(IteratorABC): @@ -144,55 +148,64 @@ class Element(CHandle): __boolTraits = ( internals.blpapi_Element_setElementBool, internals.blpapi_Element_setValueBool, - None) + None, + ) __datetimeTraits = ( internals.blpapi_Element_setElementHighPrecisionDatetime, internals.blpapi_Element_setValueHighPrecisionDatetime, - _DatetimeUtil.convertToBlpapi) + _DatetimeUtil.convertToBlpapi, + ) __int32Traits = ( internals.blpapi_Element_setElementInt32, internals.blpapi_Element_setValueInt32, - None) + None, + ) __int64Traits = ( internals.blpapi_Element_setElementInt64, internals.blpapi_Element_setValueInt64, - None) + None, + ) __floatTraits = ( internals.blpapi_Element_setElementFloat, internals.blpapi_Element_setValueFloat, - None) + None, + ) __nameTraits = ( internals.blpapi_Element_setElementFromName, internals.blpapi_Element_setValueFromName, - Name._handle) + Name._handle, + ) __stringTraits = ( internals.blpapi_Element_setElementString, internals.blpapi_Element_setValueString, - conv2str) + conv2str, + ) __defaultTraits = ( internals.blpapi_Element_setElementString, internals.blpapi_Element_setValueString, - str) + str, + ) @staticmethod - def __getTraits(value: SupportedElementTypes - ) -> Tuple[Callable, Callable, Optional[Any]]: - """ traits dispatcher """ + def __getTraits( + value: SupportedElementTypes, + ) -> Tuple[Callable, Callable, Optional[Any]]: + """traits dispatcher""" if isstr(value): return Element.__stringTraits if isinstance(value, bool): return Element.__boolTraits if isinstance(value, int): - if -(2 ** 31) <= value <= (2 ** 31 - 1): + if -(2**31) <= value <= (2**31 - 1): return Element.__int32Traits - if -(2 ** 63) <= value <= (2 ** 63 - 1): + if -(2**63) <= value <= (2**63 - 1): return Element.__int64Traits raise ValueError("value is out of element's supported range") if isinstance(value, float): @@ -207,19 +220,21 @@ def __assertIsValid(self) -> None: if not self.isValid(): raise RuntimeError("Element is not valid") - def __init__(self, - handle: "typehints.BlpapiElementHandle", - dataHolder: Optional[Union["Element", - "typehints.Message", - "typehints.Request"]]) -> None: + def __init__( + self, + handle: "typehints.BlpapiElementHandle", + dataHolder: Optional[ + Union["Element", "typehints.Message", "typehints.Request"] + ], + ) -> None: noop = lambda *args: None super(Element, self).__init__(handle, noop) self.__handle = handle self.__dataHolder = dataHolder - def _getDataHolder(self) -> Optional[Union["Element", - "typehints.Message", - "typehints.Request"]]: + def _getDataHolder( + self, + ) -> Optional[Union["Element", "typehints.Message", "typehints.Request"]]: """Return the owner of underlying data. For internal use.""" return self if self.__dataHolder is None else self.__dataHolder @@ -241,9 +256,9 @@ def __str__(self) -> str: return self.toString() - def __getitem__(self, - nameOrIndex: BlpapiNameOrStrOrIndex - ) -> Union[SupportedElementTypes, "Element"]: + def __getitem__( + self, nameOrIndex: BlpapiNameOrStrOrIndex + ) -> Union[SupportedElementTypes, "Element"]: """ Args: nameOrIndex: The :class:`Name` identifying the @@ -277,9 +292,11 @@ def __getitem__(self, # is name if not self.hasElement(nameOrIndex): - raise KeyError(f"Element {self.name()} " # type: ignore - f"does not contain element" - f" {nameOrIndex}") + raise KeyError( + f"Element {self.name()} " # type: ignore + f"does not contain element" + f" {nameOrIndex}" + ) element = self.getElement(nameOrIndex) @@ -291,10 +308,11 @@ def __getitem__(self, return element.getValue() - def __setitem__(self, - name: BlpapiNameOrStr, - value: Union[Mapping, Sequence, SupportedElementTypes] - ) -> None: + def __setitem__( + self, + name: BlpapiNameOrStr, + value: Union[Mapping, Sequence, SupportedElementTypes], + ) -> None: """ Args: name: The :class:`Name` identifying one of this @@ -364,7 +382,7 @@ def __contains__(self, item: SupportedElementTypes) -> bool: ``item`` is a value in this :class:`Element`. """ if self.isComplexType(): - return self.hasElement(item) # type: ignore + return self.hasElement(item) # type: ignore return item in self.values() def name(self) -> Name: @@ -381,7 +399,8 @@ def name(self) -> Name: self.__assertIsValid() return Name._createInternally( - internals.blpapi_Element_name(self.__handle)) + internals.blpapi_Element_name(self.__handle) + ) def datatype(self) -> int: """ @@ -450,7 +469,8 @@ def elementDefinition(self) -> "typehints.SchemaElementDefinition": self.__assertIsValid() return SchemaElementDefinition( internals.blpapi_Element_definition(self.__handle), - self._sessions()) + self._sessions(), + ) def numValues(self) -> int: """ @@ -482,7 +502,7 @@ def numElements(self) -> int: self.__assertIsValid() return internals.blpapi_Element_numElements(self.__handle) - def isNullValue(self, position: int=0) -> bool: + def isNullValue(self, position: int = 0) -> bool: """ Args: position: Position of the sub-element @@ -500,7 +520,7 @@ def isNullValue(self, position: int=0) -> bool: if res in (0, 1): return bool(res) _ExceptionUtil.raiseOnError(res) - return False # unreachable + return False # unreachable def toPy(self) -> Union[Dict, List, SupportedElementTypes]: """ @@ -571,7 +591,7 @@ def toPy(self) -> Union[Dict, List, SupportedElementTypes]: """ return internals.blpapi_Element_toPy(self.__handle) - def toString(self, level: int=0, spacesPerLevel: int=4) -> str: + def toString(self, level: int = 0, spacesPerLevel: int = 4) -> str: """Format this :class:`Element` to the string at the specified indentation level. @@ -589,9 +609,9 @@ def toString(self, level: int=0, spacesPerLevel: int=4) -> str: """ self.__assertIsValid() - return internals.blpapi_Element_printHelper(self.__handle, - level, - spacesPerLevel) + return internals.blpapi_Element_printHelper( + self.__handle, level, spacesPerLevel + ) def getElement(self, nameOrIndex: BlpapiNameOrStrOrIndex) -> "Element": """ @@ -611,9 +631,9 @@ def getElement(self, nameOrIndex: BlpapiNameOrStrOrIndex) -> "Element": if not isinstance(nameOrIndex, int): self.__assertIsValid() name = getNamePair(nameOrIndex) - res = internals.blpapi_Element_getElement(self.__handle, - name[0], - name[1]) + res = internals.blpapi_Element_getElement( + self.__handle, name[0], name[1] + ) _ExceptionUtil.raiseOnError(res[0]) return Element(res[1], self._getDataHolder()) self.__assertIsValid() @@ -638,12 +658,13 @@ def elements(self) -> IteratorType: if self.datatype() != DataType.SEQUENCE: raise UnsupportedOperationException( - description="Only sequences are supported", errorCode=None) + description="Only sequences are supported", errorCode=None + ) return Iterator(self, Element.numElements, Element.getElement) - def hasElement(self, - name: BlpapiNameOrStr, - excludeNullElements: bool=False) -> bool: + def hasElement( + self, name: BlpapiNameOrStr, excludeNullElements: bool = False + ) -> bool: """ Args: name: Name of the element @@ -665,7 +686,8 @@ def hasElement(self, namepair[0], namepair[1], 1 if excludeNullElements else 0, - 0) + 0, + ) return bool(res) def getChoice(self) -> "Element": @@ -682,7 +704,7 @@ def getChoice(self) -> "Element": _ExceptionUtil.raiseOnError(res[0]) return Element(res[1], self._getDataHolder()) - def getValueAsBool(self, index: int=0) -> bool: + def getValueAsBool(self, index: int = 0) -> bool: """ Args: index: Index of the value in the element @@ -701,7 +723,7 @@ def getValueAsBool(self, index: int=0) -> bool: _ExceptionUtil.raiseOnError(res[0]) return bool(res[1]) - def getValueAsString(self, index: int=0) -> str: + def getValueAsString(self, index: int = 0) -> str: """ Args: index: Index of the value in the element @@ -720,7 +742,7 @@ def getValueAsString(self, index: int=0) -> str: _ExceptionUtil.raiseOnError(res[0]) return res[1] - def getValueAsDatetime(self, index: int=0) -> AnyPythonDatetime: + def getValueAsDatetime(self, index: int = 0) -> AnyPythonDatetime: """ Args: index: Index of the value in the element @@ -737,11 +759,12 @@ def getValueAsDatetime(self, index: int=0) -> AnyPythonDatetime: self.__assertIsValid() res = internals.blpapi_Element_getValueAsHighPrecisionDatetime( - self.__handle, index) + self.__handle, index + ) _ExceptionUtil.raiseOnError(res[0]) return _DatetimeUtil.convertToNative(res[1]) - def getValueAsInteger(self, index: int=0) -> int: + def getValueAsInteger(self, index: int = 0) -> int: """ Args: index: Index of the value in the element @@ -760,7 +783,7 @@ def getValueAsInteger(self, index: int=0) -> int: _ExceptionUtil.raiseOnError(res[0]) return res[1] - def getValueAsFloat(self, index: int=0) -> float: + def getValueAsFloat(self, index: int = 0) -> float: """ Args: index: Index of the value in the element @@ -779,7 +802,7 @@ def getValueAsFloat(self, index: int=0) -> float: _ExceptionUtil.raiseOnError(res[0]) return res[1] - def getValueAsName(self, index: int=0) -> Name: + def getValueAsName(self, index: int = 0) -> Name: """ Args: index: Index of the value in the element @@ -798,7 +821,7 @@ def getValueAsName(self, index: int=0) -> Name: _ExceptionUtil.raiseOnError(res[0]) return Name._createInternally(res[1]) - def getValueAsElement(self, index: int=0) -> "Element": + def getValueAsElement(self, index: int = 0) -> "Element": """ Args: index: Index of the value in the element @@ -817,8 +840,9 @@ def getValueAsElement(self, index: int=0) -> "Element": _ExceptionUtil.raiseOnError(res[0]) return Element(res[1], self._getDataHolder()) - def getValue(self, index: int=0 - ) -> Union[SupportedElementTypes, "Element"]: + def getValue( + self, index: int = 0 + ) -> Union[SupportedElementTypes, "Element"]: """ Args: index: Index of the value in the element @@ -834,9 +858,10 @@ def getValue(self, index: int=0 """ datatype = self.datatype() - valueGetter = _ELEMENT_VALUE_GETTER.get(datatype, - Element.getValueAsString) - return valueGetter(self, index) # type: ignore + valueGetter = _ELEMENT_VALUE_GETTER.get( + datatype, Element.getValueAsString + ) + return valueGetter(self, index) # type: ignore def values(self) -> IteratorType: """ @@ -855,8 +880,9 @@ def values(self) -> IteratorType: if self.isComplexType(): return iter(()) # empty tuple datatype = self.datatype() - valueGetter = _ELEMENT_VALUE_GETTER.get(datatype, - Element.getValueAsString) + valueGetter = _ELEMENT_VALUE_GETTER.get( + datatype, Element.getValueAsString + ) return Iterator(self, Element.numValues, valueGetter) def getElementAsBool(self, name: BlpapiNameOrStr) -> bool: @@ -963,8 +989,9 @@ def getElementAsName(self, name: BlpapiNameOrStr) -> Name: return self.getElement(name).getValueAsName() - def getElementValue(self, name: BlpapiNameOrStr - ) -> Union[SupportedElementTypes, "Element"]: + def getElementValue( + self, name: BlpapiNameOrStr + ) -> Union[SupportedElementTypes, "Element"]: """ Args: name: Sub-element identifier @@ -980,9 +1007,9 @@ def getElementValue(self, name: BlpapiNameOrStr return self.getElement(name).getValue() - def setElement(self, - name: BlpapiNameOrStr, - value: SupportedElementTypes) -> None: + def setElement( + self, name: BlpapiNameOrStr, value: SupportedElementTypes + ) -> None: """Set this Element's sub-element with 'name' to the specified 'value'. Args: @@ -1017,9 +1044,10 @@ def setElement(self, if traits[2] is not None: value = traits[2](value) _ExceptionUtil.raiseOnError( - traits[0](self.__handle, namepair[0], namepair[1], value)) + traits[0](self.__handle, namepair[0], namepair[1], value) + ) - def setValue(self, value: SupportedElementTypes, index: int=0) -> None: + def setValue(self, value: SupportedElementTypes, index: int = 0) -> None: """Set the specified ``index``\ th entry in this :class:`Element` to the ``value``. @@ -1117,14 +1145,15 @@ def setChoice(self, selectionName: BlpapiNameOrStr) -> "Element": self.__assertIsValid() name = getNamePair(selectionName) - res = internals.blpapi_Element_setChoice(self.__handle, - name[0], - name[1], - 0) + res = internals.blpapi_Element_setChoice( + self.__handle, name[0], name[1], 0 + ) _ExceptionUtil.raiseOnError(res[0]) return Element(res[1], self._getDataHolder()) - def fromPy(self, value: Union[Mapping, Sequence, SupportedElementTypes]): + def fromPy( + self, value: Union[Mapping, Sequence, SupportedElementTypes] + ) -> None: """Format this :class:`Element` with the provided native Python value. Args: @@ -1258,10 +1287,12 @@ def fromPy(self, value: Union[Mapping, Sequence, SupportedElementTypes]): """ self._fromPyHelper(value) - def _fromPyHelper(self, - value: Union[Mapping, Sequence, SupportedElementTypes], - name: Optional[BlpapiNameOrStr]=None, - path: Optional[str]=None): + def _fromPyHelper( + self, + value: Union[Mapping, Sequence, SupportedElementTypes], + name: Optional[BlpapiNameOrStr] = None, + path: Optional[str] = None, + ) -> None: """Helper method for `fromPy`. Args: @@ -1278,7 +1309,7 @@ def _fromPyHelper(self, activeElement = self - def getActivePathMessage(isArrayEntry: bool=False): + def getActivePathMessage(isArrayEntry: bool = False) -> str: elementType = "scalar" if activeElement.isArray(): elementType = "array" @@ -1286,8 +1317,10 @@ def getActivePathMessage(isArrayEntry: bool=False): elementType = "complex" arrayEntryText = "an entry in " if isArrayEntry else "" - return f"While operating on {arrayEntryText}{elementType} " \ - f" Element `{path}`, " + return ( + f"While operating on {arrayEntryText}{elementType} " + f" Element `{path}`, " + ) if path is None: path = str(activeElement.name()) @@ -1305,8 +1338,10 @@ def getActivePathMessage(isArrayEntry: bool=False): if isinstance(value, Mapping): if not activeElement.isComplexType(): - errorMsg = "encountered a `Mapping` instance while" \ - " formatting a non-complex Element" + errorMsg = ( + "encountered a `Mapping` instance while" + " formatting a non-complex Element" + ) raise Exception(getActivePathMessage() + errorMsg) complexElement = activeElement @@ -1316,60 +1351,75 @@ def getActivePathMessage(isArrayEntry: bool=False): elif isNonScalarSequence(value): if not activeElement.isArray(): - errorMsg = "encountered a `Sequence` while formatting a" \ - " non-array Element" + errorMsg = ( + "encountered a `Sequence` while formatting a" + " non-array Element" + ) raise Exception(getActivePathMessage() + errorMsg) arrayElement = activeElement typeDef = arrayElement.elementDefinition().typeDefinition() arrayValuesAreScalar = not typeDef.isComplexType() - for index, val in enumerate(value): # type: ignore + for index, val in enumerate(value): # type: ignore if isinstance(val, Mapping): if arrayValuesAreScalar: path += f"[{index}]" - errorMsg = "encountered a `Mapping` where a scalar" \ - " value was expected." - raise Exception(getActivePathMessage(isArrayEntry=True) - + errorMsg) + errorMsg = ( + "encountered a `Mapping` where a scalar" + " value was expected." + ) + raise Exception( + getActivePathMessage(isArrayEntry=True) + errorMsg + ) appendedElement = arrayElement.appendElement() arrayEntryPath = path + f"[{index}]" appendedElement._fromPyHelper(val, path=arrayEntryPath) elif isNonScalarSequence(val): path += f"[{index}]" - expectedObject = "scalar value" if arrayValuesAreScalar \ - else "`Mapping`" - errorMsg = f"encountered a nested `Sequence` where a " \ - f"{expectedObject} was expected." - raise Exception(getActivePathMessage(isArrayEntry=True) - + errorMsg) + expectedObject = ( + "scalar value" if arrayValuesAreScalar else "`Mapping`" + ) + errorMsg = ( + f"encountered a nested `Sequence` where a " + f"{expectedObject} was expected." + ) + raise Exception( + getActivePathMessage(isArrayEntry=True) + errorMsg + ) else: if not arrayValuesAreScalar: path += f"[{index}]" - errorMsg = "encountered a scalar value where a" \ - " `Mapping` was expected." - raise Exception(getActivePathMessage(isArrayEntry=True) - + errorMsg) + errorMsg = ( + "encountered a scalar value where a" + " `Mapping` was expected." + ) + raise Exception( + getActivePathMessage(isArrayEntry=True) + errorMsg + ) try: arrayElement.appendValue(val) except Exception as exc: path += f"[{index}]" errorMsg = f"encountered error: {exc}" - raise Exception(getActivePathMessage(isArrayEntry=True) - + errorMsg) + raise Exception( + getActivePathMessage(isArrayEntry=True) + errorMsg + ) else: if value is None: return if activeElement.isComplexType() or activeElement.isArray(): - errorMsg = f"encountered an incompatible type, {type(value)}," \ - " for a non-scalar Element" + errorMsg = ( + f"encountered an incompatible type, {type(value)}," + " for a non-scalar Element" + ) raise Exception(getActivePathMessage() + errorMsg) try: - activeElement.setValue(value) # type: ignore + activeElement.setValue(value) # type: ignore except Exception as exc: errorMsg = f"encountered error: {exc}" raise Exception(getActivePathMessage() + errorMsg) @@ -1389,7 +1439,7 @@ def getActivePathMessage(isArrayEntry: bool=False): DataType.DATETIME: Element.getValueAsDatetime, DataType.ENUMERATION: Element.getValueAsName, DataType.SEQUENCE: Element.getValueAsElement, - DataType.CHOICE: Element.getValueAsElement + DataType.CHOICE: Element.getValueAsElement, } __copyright__ = """ diff --git a/src/blpapi/event.py b/src/blpapi/event.py index 9e3320f..4f54225 100644 --- a/src/blpapi/event.py +++ b/src/blpapi/event.py @@ -39,7 +39,7 @@ from . import utils from .utils import get_handle from .chandle import CHandle -from . import typehints # pylint: disable=unused-import +from . import typehints # pylint: disable=unused-import from .typehints import BlpapiEventHandle @@ -54,8 +54,8 @@ class MessageIterator(CHandle, IteratorABC): def __init__(self, event: "Event") -> None: selfhandle = internals.blpapi_MessageIterator_create(get_handle(event)) super(MessageIterator, self).__init__( - selfhandle, - internals.blpapi_MessageIterator_destroy) + selfhandle, internals.blpapi_MessageIterator_destroy + ) self.__handle = selfhandle self.__event = event @@ -92,40 +92,42 @@ class Event(CHandle, metaclass=utils.MetaClassForClassesWithEnums): The class attributes represent the possible types of event. """ - ADMIN = internals.EVENTTYPE_ADMIN # type: ignore + ADMIN = internals.EVENTTYPE_ADMIN # type: ignore """Admin event""" - SESSION_STATUS = internals.EVENTTYPE_SESSION_STATUS # type: ignore + SESSION_STATUS = internals.EVENTTYPE_SESSION_STATUS # type: ignore """Status updates for a session""" - SUBSCRIPTION_STATUS = internals.EVENTTYPE_SUBSCRIPTION_STATUS # type: ignore + SUBSCRIPTION_STATUS = internals.EVENTTYPE_SUBSCRIPTION_STATUS # type: ignore """Status updates for a subscription""" - REQUEST_STATUS = internals.EVENTTYPE_REQUEST_STATUS # type: ignore + REQUEST_STATUS = internals.EVENTTYPE_REQUEST_STATUS # type: ignore """Status updates for a request""" - RESPONSE = internals.EVENTTYPE_RESPONSE # type: ignore + RESPONSE = internals.EVENTTYPE_RESPONSE # type: ignore """The final (possibly only) response to a request""" - PARTIAL_RESPONSE = internals.EVENTTYPE_PARTIAL_RESPONSE # type: ignore + PARTIAL_RESPONSE = internals.EVENTTYPE_PARTIAL_RESPONSE # type: ignore """A partial response to a request""" - SUBSCRIPTION_DATA = internals.EVENTTYPE_SUBSCRIPTION_DATA # type: ignore + SUBSCRIPTION_DATA = internals.EVENTTYPE_SUBSCRIPTION_DATA # type: ignore """Data updates resulting from a subscription""" - SERVICE_STATUS = internals.EVENTTYPE_SERVICE_STATUS # type: ignore + SERVICE_STATUS = internals.EVENTTYPE_SERVICE_STATUS # type: ignore """Status updates for a service""" - TIMEOUT = internals.EVENTTYPE_TIMEOUT # type: ignore + TIMEOUT = internals.EVENTTYPE_TIMEOUT # type: ignore """An Event returned from nextEvent() if it timed out""" - AUTHORIZATION_STATUS = internals.EVENTTYPE_AUTHORIZATION_STATUS # type: ignore + AUTHORIZATION_STATUS = internals.EVENTTYPE_AUTHORIZATION_STATUS # type: ignore """Status updates for user authorization""" - RESOLUTION_STATUS = internals.EVENTTYPE_RESOLUTION_STATUS # type: ignore + RESOLUTION_STATUS = internals.EVENTTYPE_RESOLUTION_STATUS # type: ignore """Status updates for a resolution operation""" - TOPIC_STATUS = internals.EVENTTYPE_TOPIC_STATUS # type: ignore + TOPIC_STATUS = internals.EVENTTYPE_TOPIC_STATUS # type: ignore """Status updates about topics for service providers""" - TOKEN_STATUS = internals.EVENTTYPE_TOKEN_STATUS # type: ignore + TOKEN_STATUS = internals.EVENTTYPE_TOKEN_STATUS # type: ignore """Status updates for a generate token request""" - REQUEST = internals.EVENTTYPE_REQUEST # type: ignore + REQUEST = internals.EVENTTYPE_REQUEST # type: ignore """Request event""" UNKNOWN = -1 """Unknown event""" - def __init__(self, - handle: BlpapiEventHandle, - sessions: Optional[Set["typehints.AbstractSession"]] = None): + def __init__( + self, + handle: BlpapiEventHandle, + sessions: Optional[Set["typehints.AbstractSession"]] = None, + ): super(Event, self).__init__(handle, internals.blpapi_Event_release) self.__handle = handle self.__sessions = sessions if sessions is not None else set() @@ -163,6 +165,7 @@ class EventQueue(CHandle): :class:`EventQueue` will only deliver responses to the request(s) it is associated with. """ + def __init__(self) -> None: """ Construct an empty :class:`EventQueue` which can be passed to @@ -171,12 +174,12 @@ def __init__(self) -> None: """ selfhandle = internals.blpapi_EventQueue_create() super(EventQueue, self).__init__( - selfhandle, - internals.blpapi_EventQueue_destroy) + selfhandle, internals.blpapi_EventQueue_destroy + ) self.__handle = selfhandle self.__sessions: Set["typehints.AbstractSession"] = set() - def nextEvent(self, timeout: int=0) -> Event: + def nextEvent(self, timeout: int = 0) -> Event: """ Args: timeout: Timeout threshold in milliseconds. @@ -226,6 +229,7 @@ def _getSessions(self) -> Set["typehints.AbstractSession"]: """ return self.__sessions + __copyright__ = """ Copyright 2012. Bloomberg Finance L.P. diff --git a/src/blpapi/eventdispatcher.py b/src/blpapi/eventdispatcher.py index 6ca94d2..f2392f8 100644 --- a/src/blpapi/eventdispatcher.py +++ b/src/blpapi/eventdispatcher.py @@ -22,9 +22,9 @@ class EventDispatcher(CHandle): callbacks from one or more internal threads for one or more sessions. """ - __handle = None # pylint: disable=unused-private-member + __handle = None # pylint: disable=unused-private-member - def __init__(self, numDispatcherThreads: int = 1): + def __init__(self, numDispatcherThreads: int = 1) -> None: """Construct an :class:`EventDispatcher`. Args: @@ -36,10 +36,12 @@ def __init__(self, numDispatcherThreads: int = 1): ``numDispatcherThreads`` threads is created to dispatch events. The behavior is undefined if ``numDispatcherThreads`` is ``0``. """ - selfhandle = internals.blpapi_EventDispatcher_create(numDispatcherThreads) + selfhandle = internals.blpapi_EventDispatcher_create( + numDispatcherThreads + ) super(EventDispatcher, self).__init__( - selfhandle, - internals.blpapi_EventDispatcher_destroy) + selfhandle, internals.blpapi_EventDispatcher_destroy + ) self.__handle = selfhandle def start(self) -> int: @@ -49,7 +51,7 @@ def start(self) -> int: return internals.blpapi_EventDispatcher_start(self.__handle) - def stop(self, async_: bool = False, **kwargs) -> int: + def stop(self, async_: bool = False, **kwargs: bool) -> int: """Stop generating callbacks. Args: @@ -68,20 +70,23 @@ def stop(self, async_: bool = False, **kwargs) -> int: ``async_`` parameter is overridden to ``True``. """ - if 'async' in kwargs: + if "async" in kwargs: warnings.warn( "async parameter has been deprecated in favor of async_", - DeprecationWarning) - async_ = kwargs.pop('async') + DeprecationWarning, + ) + async_ = kwargs.pop("async") if kwargs: raise TypeError( "EventDispatcher.stop() got an unexpected keyword " "argument. Only 'async' is allowed for backwards " - "compatibility.") + "compatibility." + ) return internals.blpapi_EventDispatcher_stop(self.__handle, async_) + __copyright__ = """ Copyright 2012. Bloomberg Finance L.P. diff --git a/src/blpapi/eventformatter.py b/src/blpapi/eventformatter.py index 0d7de49..3174da9 100644 --- a/src/blpapi/eventformatter.py +++ b/src/blpapi/eventformatter.py @@ -5,8 +5,13 @@ This component adds messages to an Event which can be later published. """ -from .exception import _ExceptionUtil, InvalidConversionException, \ - IndexOutOfRangeException, InvalidArgumentException, NotFoundException +from .exception import ( + _ExceptionUtil, + InvalidConversionException, + IndexOutOfRangeException, + InvalidArgumentException, + NotFoundException, +) from .datetime import _DatetimeUtil from .message import Message from .name import Name, getNamePair @@ -48,58 +53,70 @@ class EventFormatter(CHandle): __boolTraits = ( internals.blpapi_EventFormatter_setValueBool, internals.blpapi_EventFormatter_appendValueBool, - None) + None, + ) __datetimeTraits = ( internals.blpapi_EventFormatter_setValueHighPrecisionDatetime, internals.blpapi_EventFormatter_appendValueHighPrecisionDatetime, - _DatetimeUtil.convertToBlpapi) + _DatetimeUtil.convertToBlpapi, + ) __int32Traits = ( internals.blpapi_EventFormatter_setValueInt32, internals.blpapi_EventFormatter_appendValueInt32, - None) + None, + ) __int64Traits = ( internals.blpapi_EventFormatter_setValueInt64, internals.blpapi_EventFormatter_appendValueInt64, - None) + None, + ) __floatTraits = ( internals.blpapi_EventFormatter_setValueFloat, internals.blpapi_EventFormatter_appendValueFloat, - None) + None, + ) + # pylint: disable=protected-access __nameTraits = ( internals.blpapi_EventFormatter_setValueFromName, internals.blpapi_EventFormatter_appendValueFromName, - Name._handle) #pylint: disable=protected-access + Name._handle, + ) __stringTraits = ( internals.blpapi_EventFormatter_setValueString, internals.blpapi_EventFormatter_appendValueString, - None) + None, + ) __defaultTraits = ( internals.blpapi_EventFormatter_setValueString, internals.blpapi_EventFormatter_appendValueString, - str) + str, + ) - #pylint: disable=too-many-return-statements + # pylint: disable=too-many-return-statements @staticmethod - def __getTraits(value: Any) -> Tuple[Callable, Callable, Optional[Callable]]: + def __getTraits( + value: Any, + ) -> Tuple[Callable, Callable, Optional[Callable]]: """Returns traits for value based on its type""" if isinstance(value, str): return EventFormatter.__stringTraits if isinstance(value, bool): return EventFormatter.__boolTraits if isinstance(value, int): - if -(2 ** 31) <= value <= (2 ** 31 - 1): + if -(2**31) <= value <= (2**31 - 1): return EventFormatter.__int32Traits - if -(2 ** 63) <= value <= (2 ** 63 - 1): + if -(2**63) <= value <= (2**63 - 1): return EventFormatter.__int64Traits raise InvalidConversionException( - f"Value is out of supported range (INT64): {value}", 0) + f"Value is out of supported range (INT64): {value}", 0 + ) if isinstance(value, float): return EventFormatter.__floatTraits if _DatetimeUtil.isDatetime(value): @@ -122,15 +139,17 @@ def __init__(self, event: "typehints.Event") -> None: """ selfhandle = internals.blpapi_EventFormatter_create(get_handle(event)) super(EventFormatter, self).__init__( - selfhandle, - internals.blpapi_EventFormatter_destroy) + selfhandle, internals.blpapi_EventFormatter_destroy + ) self.__handle = selfhandle self.latestMessageName: Optional[BlpapiNameOrStr] = None - def appendMessage(self, - messageType: BlpapiNameOrStr, - topic: "typehints.Topic", - sequenceNumber: Optional[int]=None) -> None: + def appendMessage( + self, + messageType: BlpapiNameOrStr, + topic: "typehints.Topic", + sequenceNumber: Optional[int] = None, + ) -> None: """Append an (empty) message to the :class:`Event` referenced by this :class:`EventFormatter` @@ -153,10 +172,9 @@ def appendMessage(self, if sequenceNumber is None: _ExceptionUtil.raiseOnError( internals.blpapi_EventFormatter_appendMessage( - self.__handle, - name[0], - name[1], - get_handle(topic))) + self.__handle, name[0], name[1], get_handle(topic) + ) + ) else: _ExceptionUtil.raiseOnError( internals.blpapi_EventFormatter_appendMessageSeq( @@ -165,7 +183,9 @@ def appendMessage(self, name[1], get_handle(topic), sequenceNumber, - 0)) + 0, + ) + ) self.latestMessageName = messageType @@ -193,18 +213,19 @@ def appendResponse(self, operationName: BlpapiNameOrStr) -> None: name = getNamePair(operationName) _ExceptionUtil.raiseOnError( internals.blpapi_EventFormatter_appendResponse( - self.__handle, - name[0], - name[1])) + self.__handle, name[0], name[1] + ) + ) self.latestMessageName = "" def appendRecapMessage( - self, - topic: "typehints.Topic", - correlationId: Optional["typehints.CorrelationId"]=None, - sequenceNumber: Optional[int]=None, - fragmentType: int=Message.FRAGMENT_NONE) -> None: + self, + topic: "typehints.Topic", + correlationId: Optional["typehints.CorrelationId"] = None, + sequenceNumber: Optional[int] = None, + fragmentType: int = Message.FRAGMENT_NONE, + ) -> None: """Append a (empty) recap message to the :class:`Event` referenced by this :class:`EventFormatter`. @@ -240,9 +261,9 @@ def appendRecapMessage( if fragmentType == Message.FRAGMENT_NONE: _ExceptionUtil.raiseOnError( internals.blpapi_EventFormatter_appendRecapMessage( - self.__handle, - get_handle(topic), - cIdHandle)) + self.__handle, get_handle(topic), cIdHandle + ) + ) else: _ExceptionUtil.raiseOnError( internals.blpapi_EventFormatter_appendFragmentedRecapMessage( @@ -251,7 +272,9 @@ def appendRecapMessage( None, get_handle(topic), cIdHandle, - fragmentType)) + fragmentType, + ) + ) else: if fragmentType == Message.FRAGMENT_NONE: _ExceptionUtil.raiseOnError( @@ -260,7 +283,9 @@ def appendRecapMessage( get_handle(topic), cIdHandle, sequenceNumber, - 0)) + 0, + ) + ) else: _ExceptionUtil.raiseOnError( internals.blpapi_EventFormatter_appendFragmentedRecapMessageSeq( @@ -269,7 +294,9 @@ def appendRecapMessage( None, get_handle(topic), fragmentType, - sequenceNumber)) + sequenceNumber, + ) + ) self.latestMessageName = "" @@ -296,9 +323,8 @@ def setElement(self, name: BlpapiNameOrStr, value: Any) -> None: namepair = getNamePair(name) value = invoke_if_valid(traits[2], value) _ExceptionUtil.raiseOnError( - traits[0](self.__handle, - namepair[0], namepair[1], - value)) + traits[0](self.__handle, namepair[0], namepair[1], value) + ) def setElementNull(self, name: BlpapiNameOrStr) -> None: """Create a null element with the specified ``name``. @@ -314,9 +340,9 @@ def setElementNull(self, name: BlpapiNameOrStr) -> None: namepair = getNamePair(name) _ExceptionUtil.raiseOnError( internals.blpapi_EventFormatter_setValueNull( - self.__handle, - namepair[0], - namepair[1])) + self.__handle, namepair[0], namepair[1] + ) + ) def pushElement(self, name: BlpapiNameOrStr) -> None: """Change the level at which this :class:`EventFormatter` is operating. @@ -351,9 +377,9 @@ def pushElement(self, name: BlpapiNameOrStr) -> None: namepair = getNamePair(name) _ExceptionUtil.raiseOnError( internals.blpapi_EventFormatter_pushElement( - self.__handle, - namepair[0], - namepair[1])) + self.__handle, namepair[0], namepair[1] + ) + ) def popElement(self) -> None: """Undo the most recent call to :meth:`pushElement` or @@ -364,7 +390,8 @@ def popElement(self) -> None: re-visit the same context. """ _ExceptionUtil.raiseOnError( - internals.blpapi_EventFormatter_popElement(self.__handle)) + internals.blpapi_EventFormatter_popElement(self.__handle) + ) def appendValue(self, value: Any) -> None: """ @@ -378,7 +405,8 @@ def appendValue(self, value: Any) -> None: def appendElement(self) -> None: _ExceptionUtil.raiseOnError( - internals.blpapi_EventFormatter_appendElement(self.__handle)) + internals.blpapi_EventFormatter_appendElement(self.__handle) + ) def fromPy(self, value: MappingType[BlpapiNameOrStr, Any]) -> None: """ @@ -509,10 +537,12 @@ def fromPy(self, value: MappingType[BlpapiNameOrStr, Any]) -> None: raise Exception("`value` must be a `Mapping` instance") self._fromPyHelper(value) - def _fromPyHelper(self, - value: Any, - name: Optional[BlpapiNameOrStr]=None, - dpath: Optional[Deque[BlpapiNameOrStr]]=None) -> None: + def _fromPyHelper( + self, + value: Any, + name: Optional[BlpapiNameOrStr] = None, + dpath: Optional[Deque[BlpapiNameOrStr]] = None, + ) -> None: """ Args: value (Mapping or Sequence or scalar-type): used to format the @@ -538,8 +568,10 @@ def getPathErrorMessage() -> str: try: self.pushElement(key) except Exception as exc: - raise Exception(getPathErrorMessage() - + _fromPyErrorTemplate.format(exc)) + raise Exception( + getPathErrorMessage() + + _fromPyErrorTemplate.format(exc) + ) path.append(key) self._fromPyHelper(val, name=key, dpath=path) @@ -549,8 +581,10 @@ def getPathErrorMessage() -> str: try: self.setElementNull(key) except (NotFoundException, Exception) as exc: - raise Exception(getPathErrorMessage() - + _fromPyErrorTemplate.format(exc)) + raise Exception( + getPathErrorMessage() + + _fromPyErrorTemplate.format(exc) + ) else: self._fromPyHelper(val, name=key, dpath=path) @@ -558,8 +592,9 @@ def getPathErrorMessage() -> str: try: self.pushElement(namestr) except Exception as exc: - raise Exception(getPathErrorMessage() - + _fromPyErrorTemplate.format(exc)) + raise Exception( + getPathErrorMessage() + _fromPyErrorTemplate.format(exc) + ) for index, val in enumerate(value): path.append(f"{namestr}[{index}]") @@ -568,25 +603,30 @@ def getPathErrorMessage() -> str: try: self.appendElement() except Exception as exc: - errorMsg = "encountered a `Mapping` where a scalar " \ - f"value was expected. Error: {exc}" - raise Exception(getPathErrorMessage() - + errorMsg) + errorMsg = ( + "encountered a `Mapping` where a scalar " + f"value was expected. Error: {exc}" + ) + raise Exception(getPathErrorMessage() + errorMsg) self._fromPyHelper(val, dpath=path) self.popElement() elif isNonScalarSequence(val): - errorMsg = "encountered nested `Sequences`s. An array of" \ - " array Elements should be represented as" \ - " `Sequence`s of `Mappings`s with `Sequence`" \ - " values." + errorMsg = ( + "encountered nested `Sequences`s. An array of" + " array Elements should be represented as" + " `Sequence`s of `Mappings`s with `Sequence`" + " values." + ) raise Exception(getPathErrorMessage() + errorMsg) else: try: self.appendValue(val) except Exception as exc: - raise Exception(getPathErrorMessage() - + _fromPyErrorTemplate.format(exc)) + raise Exception( + getPathErrorMessage() + + _fromPyErrorTemplate.format(exc) + ) path.pop() @@ -600,18 +640,24 @@ def getPathErrorMessage() -> str: self.setElement(namestr, value) except IndexOutOfRangeException: path.append(namestr) - errorMsg = "attempted to format an array Element using a" \ - " scalar value. Array Elements are formatted with" \ - " `Sequence`s." + errorMsg = ( + "attempted to format an array Element using a" + " scalar value. Array Elements are formatted with" + " `Sequence`s." + ) raise Exception(getPathErrorMessage() + errorMsg) - except (InvalidConversionException, InvalidArgumentException) \ - as exc: + except ( + InvalidConversionException, + InvalidArgumentException, + ) as exc: path.append(namestr) - raise Exception(getPathErrorMessage() - + _fromPyErrorTemplate.format(exc)) + raise Exception( + getPathErrorMessage() + _fromPyErrorTemplate.format(exc) + ) except Exception as exc: - raise Exception(getPathErrorMessage() - + _fromPyErrorTemplate.format(exc)) + raise Exception( + getPathErrorMessage() + _fromPyErrorTemplate.format(exc) + ) _fromPyErrorTemplate = "encountered Error: {}" diff --git a/src/blpapi/exception.py b/src/blpapi/exception.py index d9410fe..44286cc 100644 --- a/src/blpapi/exception.py +++ b/src/blpapi/exception.py @@ -12,11 +12,13 @@ # pylint: disable=redefined-builtin + class Exception(_StandardException): """This class defines a base exception for blpapi operations. Objects of this class contain the error description for the exception. """ + def __init__(self, description: str, errorCode: Optional[int]) -> None: """Create a blpapi exception @@ -105,27 +107,29 @@ class UnknownErrorException(Exception): class _ExceptionUtil: """Internal exception generating class.""" + __errorClasses = { - internals.INVALIDSTATE_CLASS: InvalidStateException, # type: ignore - internals.INVALIDARG_CLASS: InvalidArgumentException, # type: ignore - internals.CNVERROR_CLASS: InvalidConversionException, # type: ignore - internals.BOUNDSERROR_CLASS: IndexOutOfRangeException, # type: ignore - internals.NOTFOUND_CLASS: NotFoundException, # type: ignore - internals.FLDNOTFOUND_CLASS: FieldNotFoundException, # type: ignore - internals.UNSUPPORTED_CLASS: UnsupportedOperationException # type: ignore + internals.INVALIDSTATE_CLASS: InvalidStateException, # type: ignore + internals.INVALIDARG_CLASS: InvalidArgumentException, # type: ignore + internals.CNVERROR_CLASS: InvalidConversionException, # type: ignore + internals.BOUNDSERROR_CLASS: IndexOutOfRangeException, # type: ignore + internals.NOTFOUND_CLASS: NotFoundException, # type: ignore + internals.FLDNOTFOUND_CLASS: FieldNotFoundException, # type: ignore + internals.UNSUPPORTED_CLASS: UnsupportedOperationException, # type: ignore } @staticmethod def __getErrorClass(errorCode: int) -> Type: - """ returns proper error class for the code """ + """returns proper error class for the code""" if errorCode == internals.ERROR_DUPLICATE_CORRELATIONID: return DuplicateCorrelationIdException - errorClass = errorCode & 0xff0000 - return _ExceptionUtil.__errorClasses.get(errorClass, - UnknownErrorException) + errorClass = errorCode & 0xFF0000 + return _ExceptionUtil.__errorClasses.get( + errorClass, UnknownErrorException + ) @staticmethod - def raiseException(errorCode: int, description: str=None) -> None: + def raiseException(errorCode: int, description: str = None) -> None: """Throw the appropriate exception for the specified 'errorCode'.""" if description is None: description = internals.blpapi_getLastErrorDescription(errorCode) @@ -135,13 +139,14 @@ def raiseException(errorCode: int, description: str=None) -> None: raise errorClass(description, errorCode) @staticmethod - def raiseOnError(errorCode: int, description: str=None) -> None: + def raiseOnError(errorCode: int, description: str = None) -> None: """Throw the appropriate exception for the specified 'errorCode' if the 'errorCode != 0'. """ if errorCode: _ExceptionUtil.raiseException(errorCode, description) + __copyright__ = """ Copyright 2012. Bloomberg Finance L.P. diff --git a/src/blpapi/highresclock.py b/src/blpapi/highresclock.py index b4c3896..352758c 100644 --- a/src/blpapi/highresclock.py +++ b/src/blpapi/highresclock.py @@ -5,7 +5,8 @@ from blpapi.datetime import _DatetimeUtil, UTC import datetime -def now(tzinfo: datetime.tzinfo = UTC): + +def now(tzinfo: datetime.tzinfo = UTC) -> datetime.datetime: """Return the current time using the same clock as is used to measure the 'timeReceived' value on incoming messages; note that this is *not* necessarily the same clock as is accessed by calls to 'datetime.now'. The @@ -15,6 +16,7 @@ def now(tzinfo: datetime.tzinfo = UTC): if err_code != 0: raise RuntimeError("High resolution clock error") original = internals.blpapi_HighPrecisionDatetime_fromTimePoint_wrapper( - time_point) + time_point + ) native = _DatetimeUtil.convertToNative(original) - return native.astimezone(tzinfo) # type: ignore + return native.astimezone(tzinfo) # type: ignore diff --git a/src/blpapi/identity.py b/src/blpapi/identity.py index 50d898e..a6c3451 100644 --- a/src/blpapi/identity.py +++ b/src/blpapi/identity.py @@ -11,7 +11,7 @@ from .exception import _ExceptionUtil from . import internals from . import utils -from . import typehints # pylint: disable=unused-import +from . import typehints # pylint: disable=unused-import from .utils import get_handle from .chandle import CHandle @@ -35,16 +35,18 @@ class Identity(CHandle, metaclass=utils.MetaClassForClassesWithEnums): The class attributes represent the various seat types. """ - INVALID_SEAT = internals.SEATTYPE_INVALID_SEAT # type: ignore + INVALID_SEAT = internals.SEATTYPE_INVALID_SEAT # type: ignore """Unknown seat type""" - BPS = internals.SEATTYPE_BPS # type: ignore + BPS = internals.SEATTYPE_BPS # type: ignore """Bloomberg Professional Service""" - NONBPS = internals.SEATTYPE_NONBPS # type: ignore + NONBPS = internals.SEATTYPE_NONBPS # type: ignore """Non-BPS""" - def __init__(self, - handle: BlpapiIdentityHandle, - sessions: Sequence["typehints.AbstractSession"]): + def __init__( + self, + handle: BlpapiIdentityHandle, + sessions: Sequence["typehints.AbstractSession"], + ): """Create an :class:`Identity` associated with the ``sessions`` Args: @@ -52,16 +54,18 @@ def __init__(self, sessions: Sessions associated with this object """ super(Identity, self).__init__( - handle, internals.blpapi_Identity_release) + handle, internals.blpapi_Identity_release + ) self.__handle = handle # pylint: disable=unused-private-member self.__sessions = sessions # pylint: disable=unused-private-member internals.blpapi_Identity_addRef(self.__handle) - def hasEntitlements(self, - service: "typehints.Service", - entitlements: Union[Sequence[int], "typehints.Element"] - ) -> bool: + def hasEntitlements( + self, + service: "typehints.Service", + entitlements: Union[Sequence[int], "typehints.Element"], + ) -> bool: """ Args: service: Service to check authorization for @@ -83,7 +87,8 @@ def hasEntitlements(self, None, 0, None, - None) + None, + ) else: # Otherwise, assume entitlements is a list, or tuple, etc numberOfEIDs = len(entitlements) @@ -97,14 +102,15 @@ def hasEntitlements(self, carrayOfEIDs, numberOfEIDs, None, - None) + None, + ) return True if res else False - def getFailedEntitlements(self, - service: "typehints.Service", - entitlements: Union[Sequence[int], - "typehints.Element"] - ) -> Tuple[bool, List[int]]: + def getFailedEntitlements( + self, + service: "typehints.Service", + entitlements: Union[Sequence[int], "typehints.Element"], + ) -> Tuple[bool, List[int]]: """ Args: service: Service to check authorization for @@ -133,7 +139,8 @@ def getFailedEntitlements(self, None, 0, failedEIDs, - failedEIDsSize) + failedEIDsSize, + ) else: # Otherwise, assume entitlements is a list, or tuple, etc numberOfEIDs = len(entitlements) @@ -151,7 +158,8 @@ def getFailedEntitlements(self, carrayOfEIDs, numberOfEIDs, failedEIDs, - failedEIDsSize) + failedEIDsSize, + ) result = [] for i in range(failedEIDsSize[0]): result.append(failedEIDs[i]) @@ -167,8 +175,8 @@ def isAuthorized(self, service: "typehints.Service") -> bool: specified ``service``, ``False`` otherwise. """ res = internals.blpapi_Identity_isAuthorized( - self.__handle, - get_handle(service)) + self.__handle, get_handle(service) + ) return True if res else False def getSeatType(self) -> int: diff --git a/src/blpapi/internals_wrap.c b/src/blpapi/internals_wrap.c index 3d09586..1b445cc 100644 --- a/src/blpapi/internals_wrap.c +++ b/src/blpapi/internals_wrap.c @@ -3756,8 +3756,8 @@ PyObject *CorrelationId_t_getObject(const blpapi_CorrelationId_t *cid) { typedef union { - blpapi_UInt64_t intValue; - blpapi_ManagedPtr_t ptrValue; + blpapi_UInt64_t intValue; + blpapi_ManagedPtr_t ptrValue; } blpapi_CorrelationId_t__value; SWIGINTERN struct blpapi_CorrelationId_t_ *new_blpapi_CorrelationId_t___SWIG_0(void){ diff --git a/src/blpapi/logging.py b/src/blpapi/logging.py index 69f0ee4..81fbf97 100644 --- a/src/blpapi/logging.py +++ b/src/blpapi/logging.py @@ -12,25 +12,27 @@ from .datetime import _DatetimeUtil from .typehints import AnyPythonDatetime + class Logger(metaclass=utils.MetaClassForClassesWithEnums): """This utility class provides a namespace for functions to test the logging configuration.""" # Different logging levels - SEVERITY_OFF = internals.blpapi_Logging_SEVERITY_OFF # type: ignore - SEVERITY_FATAL = internals.blpapi_Logging_SEVERITY_FATAL # type: ignore - SEVERITY_ERROR = internals.blpapi_Logging_SEVERITY_ERROR # type: ignore - SEVERITY_WARN = internals.blpapi_Logging_SEVERITY_WARN # type: ignore - SEVERITY_INFO = internals.blpapi_Logging_SEVERITY_INFO # type: ignore - SEVERITY_DEBUG = internals.blpapi_Logging_SEVERITY_DEBUG # type: ignore - SEVERITY_TRACE = internals.blpapi_Logging_SEVERITY_TRACE # type: ignore + SEVERITY_OFF = internals.blpapi_Logging_SEVERITY_OFF # type: ignore + SEVERITY_FATAL = internals.blpapi_Logging_SEVERITY_FATAL # type: ignore + SEVERITY_ERROR = internals.blpapi_Logging_SEVERITY_ERROR # type: ignore + SEVERITY_WARN = internals.blpapi_Logging_SEVERITY_WARN # type: ignore + SEVERITY_INFO = internals.blpapi_Logging_SEVERITY_INFO # type: ignore + SEVERITY_DEBUG = internals.blpapi_Logging_SEVERITY_DEBUG # type: ignore + SEVERITY_TRACE = internals.blpapi_Logging_SEVERITY_TRACE # type: ignore - loggerCallbacksLocal: List[Callable] = [] # needed for temp. ref. holding + loggerCallbacksLocal: List[Callable] = [] # needed for temp. ref. holding @staticmethod - def registerCallback(callback: - Callable[[int, int, AnyPythonDatetime, str, str], None], - thresholdSeverity: int = SEVERITY_INFO) -> None: + def registerCallback( + callback: Callable[[int, int, AnyPythonDatetime, str, str], None], + thresholdSeverity: int = SEVERITY_INFO, + ) -> None: """Register the specified 'callback' that will be called for all log messages with severity greater than or equal to the specified 'thresholdSeverity'. The callback needs to be registered before the @@ -38,11 +40,14 @@ def registerCallback(callback: the last registered callback will take effect. An exception of type 'RuntimeError' will be thrown if 'callback' cannot be registered. If callback is None, any existing callback shall be removed.""" - def callbackWrapper(threadId: int, - severity: int, - ts: datetime, - category: str, - message: str): + + def callbackWrapper( + threadId: int, + severity: int, + ts: datetime, + category: str, + message: str, + ) -> None: dt = _DatetimeUtil.convertToNativeNotHighPrecision(ts) callback(threadId, severity, dt, category, message) @@ -51,7 +56,8 @@ def callbackWrapper(threadId: int, # for as long as it may be needed, i.e. until gc or re-register Logger.loggerCallbacksLocal.append(callbackRef) err_code = internals.setLoggerCallbackWrapper( - callbackRef, thresholdSeverity) + callbackRef, thresholdSeverity + ) if len(Logger.loggerCallbacksLocal) > 1: # we have a new cb now, let the previous one go diff --git a/src/blpapi/message.py b/src/blpapi/message.py index 5080325..b269f48 100644 --- a/src/blpapi/message.py +++ b/src/blpapi/message.py @@ -14,7 +14,7 @@ import datetime from typing import Set, Optional, Any, List from blpapi.datetime import _DatetimeUtil, UTC -from . import typehints # pylint: disable=unused-import +from . import typehints # pylint: disable=unused-import from .typehints import BlpapiNameOrStr, BlpapiNameOrStrOrIndex from .typehints import BlpapiMessageHandle, AnyPythonDatetime from .typehints import SupportedElementTypes @@ -28,7 +28,7 @@ # Handling a circular dependency between modules: # service->event->message->service -service = sys.modules.get('blpapi.service') +service = sys.modules.get("blpapi.service") if service is None: from . import service @@ -60,27 +60,28 @@ class Message(CHandle, metaclass=MetaClassForClassesWithEnums): the application. """ - FRAGMENT_NONE = internals.MESSAGE_FRAGMENT_NONE # type: ignore + FRAGMENT_NONE = internals.MESSAGE_FRAGMENT_NONE # type: ignore """Unfragmented message""" - FRAGMENT_START = internals.MESSAGE_FRAGMENT_START # type: ignore + FRAGMENT_START = internals.MESSAGE_FRAGMENT_START # type: ignore """Start of a fragmented message""" - FRAGMENT_INTERMEDIATE = internals.MESSAGE_FRAGMENT_INTERMEDIATE # type: ignore + FRAGMENT_INTERMEDIATE = internals.MESSAGE_FRAGMENT_INTERMEDIATE # type: ignore """Intermediate fragment""" - FRAGMENT_END = internals.MESSAGE_FRAGMENT_END # type: ignore + FRAGMENT_END = internals.MESSAGE_FRAGMENT_END # type: ignore """Final part of a fragmented message""" - RECAPTYPE_NONE = internals.MESSAGE_RECAPTYPE_NONE # type: ignore + RECAPTYPE_NONE = internals.MESSAGE_RECAPTYPE_NONE # type: ignore """Normal data tick""" - RECAPTYPE_SOLICITED = internals.MESSAGE_RECAPTYPE_SOLICITED # type: ignore + RECAPTYPE_SOLICITED = internals.MESSAGE_RECAPTYPE_SOLICITED # type: ignore """Generated on request by subscriber""" - RECAPTYPE_UNSOLICITED = internals.MESSAGE_RECAPTYPE_UNSOLICITED # type: ignore + RECAPTYPE_UNSOLICITED = internals.MESSAGE_RECAPTYPE_UNSOLICITED # type: ignore """Generated by the service""" - def __init__(self, - handle : BlpapiMessageHandle, - event : Optional["typehints.Event"] = None, - sessions : Optional[Set["typehints.AbstractSession"]] = None - ) -> None: + def __init__( + self, + handle: BlpapiMessageHandle, + event: Optional["typehints.Event"] = None, + sessions: Optional[Set["typehints.AbstractSession"]] = None, + ) -> None: """ Args: handle: Handle to the internal implementation @@ -109,7 +110,7 @@ def __str__(self) -> str: return self.toString() - def __getitem__(self, name : BlpapiNameOrStrOrIndex) -> Any: + def __getitem__(self, name: BlpapiNameOrStrOrIndex) -> Any: """Equivalent to :meth:`asElement().__getitem__()`. """ @@ -139,7 +140,8 @@ def messageType(self) -> Name: Type of this message. """ return Name._createInternally( - internals.blpapi_Message_messageType(self.__handle)) + internals.blpapi_Message_messageType(self.__handle) + ) def fragmentType(self) -> int: """ @@ -159,7 +161,6 @@ def recapType(self) -> int: """ return internals.blpapi_Message_recapType(self.__handle) - @deprecated def topicName(self) -> str: """ @@ -184,15 +185,17 @@ def topicName(self) -> str: """ return internals.blpapi_Message_topicName(self.__handle) - def service(self): + def service(self) -> Optional["typehints.Service"]: """ Returns: Service that this :class:`Message` is associated with. """ - serviceHandle = internals.blpapi_Message_service(self.__handle) - return None if serviceHandle is None \ - else service.Service(serviceHandle, self.__sessions) - + svcHandle = internals.blpapi_Message_service(self.__handle) + return ( + None + if svcHandle is None + else service.Service(svcHandle, self.__sessions) # type: ignore + ) def correlationId(self) -> Optional["typehints.CorrelationId"]: """ @@ -208,13 +211,13 @@ def correlationId(self) -> Optional["typehints.CorrelationId"]: :meth:`correlationIds` should be used. """ numCorrelations = internals.blpapi_Message_numCorrelationIds( - self.__handle) + self.__handle + ) if numCorrelations == 0: return None return internals.blpapi_Message_correlationId(self.__handle, 0) - def correlationIds(self) -> List["typehints.CorrelationId"]: """ Returns: @@ -238,14 +241,16 @@ def correlationIds(self) -> List["typehints.CorrelationId"]: res = [] for i in range( - internals.blpapi_Message_numCorrelationIds(self.__handle)): + internals.blpapi_Message_numCorrelationIds(self.__handle) + ): res.append( - internals.blpapi_Message_correlationId(self.__handle, i)) + internals.blpapi_Message_correlationId(self.__handle, i) + ) return res - def hasElement(self, - name: BlpapiNameOrStr, - excludeNullElements: bool=False) -> bool: + def hasElement( + self, name: BlpapiNameOrStr, excludeNullElements: bool = False + ) -> bool: """Equivalent to asElement().hasElement(name, excludeNullElements).""" return self.asElement().hasElement(name, excludeNullElements) @@ -312,12 +317,13 @@ def asElement(self) -> Element: if self.__element: el = self.__element() if el is None: - el = Element(internals.blpapi_Message_elements(self.__handle), - self) - self.__element = weakref.ref(el) # type: ignore + el = Element( + internals.blpapi_Message_elements(self.__handle), self + ) + self.__element = weakref.ref(el) # type: ignore return el - def toString(self, level: int=0, spacesPerLevel: int=4) -> str: + def toString(self, level: int = 0, spacesPerLevel: int = 4) -> str: """Format this :class:`Message` to the string at the specified indentation level. @@ -334,15 +340,14 @@ def toString(self, level: int=0, spacesPerLevel: int=4) -> str: suppressing all but the initial indentation (as governed by ``level``). """ return internals.blpapi_Message_printHelper( - self.__handle, - level, - spacesPerLevel) + self.__handle, level, spacesPerLevel + ) - def toPy(self): + def toPy(self) -> dict: """Equivalent to :meth:`asElement().toPy()`.""" - return self.asElement().toPy() + return self.asElement().toPy() # type: ignore - def timeReceived(self, tzinfo: datetime.tzinfo=UTC) -> AnyPythonDatetime: + def timeReceived(self, tzinfo: datetime.tzinfo = UTC) -> AnyPythonDatetime: """Get the time when the message was received by the SDK. Args: @@ -362,19 +367,24 @@ def timeReceived(self, tzinfo: datetime.tzinfo=UTC) -> AnyPythonDatetime: internal to the SDK. """ err_code, time_point = internals.blpapi_Message_timeReceived( - self.__handle) + self.__handle + ) if err_code != 0: raise ValueError("Message has no timestamp") - original = internals.blpapi_HighPrecisionDatetime_fromTimePoint_wrapper( - time_point) + original = ( + internals.blpapi_HighPrecisionDatetime_fromTimePoint_wrapper( + time_point + ) + ) native = _DatetimeUtil.convertToNative(original) - return native.astimezone(tzinfo) # type: ignore + return native.astimezone(tzinfo) # type: ignore def _sessions(self) -> Set["typehints.AbstractSession"]: """Return session(s) this Message related to. For internal use.""" return self.__sessions + __copyright__ = """ Copyright 2012. Bloomberg Finance L.P. diff --git a/src/blpapi/name.py b/src/blpapi/name.py index 403cdf9..447df82 100644 --- a/src/blpapi/name.py +++ b/src/blpapi/name.py @@ -6,15 +6,14 @@ form for efficient string comparison. """ -from typing import Optional, Tuple, Union +from typing import Any, Optional, Tuple, Union from . import internals from .utils import conv2str, get_handle, isstr from .chandle import CHandle -from . import typehints # pylint: disable=unused-import +from . import typehints # pylint: disable=unused-import from .typehints import BlpapiNameOrStr, BlpapiNameHandle - # pylint: disable=broad-except class Name(CHandle): """:class:`Name` represents a string in a form which is efficient for @@ -61,8 +60,9 @@ def findName(nameString: str) -> Optional["Name"]: If no such object exists, ``None`` is returned. """ nameHandle = internals.blpapi_Name_findName(nameString) - return None if nameHandle is None \ - else Name._createInternally(nameHandle) + return ( + None if nameHandle is None else Name._createInternally(nameHandle) + ) @staticmethod def hasName(nameString: str) -> bool: @@ -80,8 +80,11 @@ def hasName(nameString: str) -> bool: def _createInternally(handle: BlpapiNameHandle) -> "Name": return Name(None, handle) - def __init__(self, nameString: Optional[str], - internalHandle: Optional[BlpapiNameHandle] = None) -> None: + def __init__( + self, + nameString: Optional[str], + internalHandle: Optional[BlpapiNameHandle] = None, + ) -> None: selfhandle = internalHandle if selfhandle is None: selfhandle = internals.blpapi_Name_create(nameString) @@ -89,8 +92,7 @@ def __init__(self, nameString: Optional[str], self.__handle = selfhandle def __len__(self) -> int: - """Return the length of the string that this Name represents. - """ + """Return the length of the string that this Name represents.""" return internals.blpapi_Name_length(self.__handle) @@ -103,7 +105,7 @@ def __str__(self) -> str: return internals.blpapi_Name_string(self.__handle) - def __eq__(self, other) -> bool: + def __eq__(self, other: Any) -> bool: """x.__eq__(y) <==> x==y""" s = conv2str(other) if s is not None: @@ -111,7 +113,7 @@ def __eq__(self, other) -> bool: return p != 0 return self.__handle == get_handle(other) - def __ne__(self, other) -> bool: + def __ne__(self, other: Any) -> bool: """x.__ne__(y) <==> x!=y""" return not self.__eq__(other) @@ -120,11 +122,9 @@ def __hash__(self) -> int: return int(self.__handle) - - def getNamePair( - name: BlpapiNameOrStr) -> Union[Tuple[None, BlpapiNameHandle], - Tuple[str, None]]: + name: BlpapiNameOrStr, +) -> Union[Tuple[None, BlpapiNameHandle], Tuple[str, None]]: """Create a tuple that contains a name string and blpapi_Name_t*. Args: @@ -145,8 +145,8 @@ def getNamePair( return (None, get_handle(name)) if isstr(name): return (conv2str(name), None) - raise TypeError( - "name should be an instance of a string or blpapi.Name") + raise TypeError("name should be an instance of a string or blpapi.Name") + __copyright__ = """ Copyright 2012. Bloomberg Finance L.P. diff --git a/src/blpapi/providersession.py b/src/blpapi/providersession.py index 53cc595..8436a6d 100644 --- a/src/blpapi/providersession.py +++ b/src/blpapi/providersession.py @@ -57,7 +57,7 @@ publishers that do not maintain per-topic state. """ -from weakref import ref, ReferenceType # pylint: disable=unused-import +from weakref import ref, ReferenceType # pylint: disable=unused-import from typing import Optional, Callable, Sequence import sys import traceback @@ -75,13 +75,14 @@ from . import utils from .utils import get_handle from .chandle import CHandle -from . import typehints # pylint: disable=unused-import +from . import typehints # pylint: disable=unused-import from .typehints import BlpapiEventHandle # pylint: disable=line-too-long,too-many-lines # pylint: disable=protected-access,too-many-public-methods,bare-except,too-many-function-args -class ServiceRegistrationOptions(CHandle, - metaclass=utils.MetaClassForClassesWithEnums): +class ServiceRegistrationOptions( + CHandle, metaclass=utils.MetaClassForClassesWithEnums +): """Contains the options which can be specified when registering a service. To use non-default options to :meth:`~ProviderSession.registerService()`, @@ -104,32 +105,33 @@ class ServiceRegistrationOptions(CHandle, - :attr:`PART_DEFAULT` """ - PRIORITY_LOW = internals.SERVICEREGISTRATIONOPTIONS_PRIORITY_LOW # type: ignore - PRIORITY_MEDIUM = \ - internals.SERVICEREGISTRATIONOPTIONS_PRIORITY_MEDIUM # type: ignore - PRIORITY_HIGH = internals.SERVICEREGISTRATIONOPTIONS_PRIORITY_HIGH # type: ignore + PRIORITY_LOW = internals.SERVICEREGISTRATIONOPTIONS_PRIORITY_LOW + PRIORITY_MEDIUM = internals.SERVICEREGISTRATIONOPTIONS_PRIORITY_MEDIUM + PRIORITY_HIGH = internals.SERVICEREGISTRATIONOPTIONS_PRIORITY_HIGH # Constants for specifying which part(s) of a service should be registered: - PART_PUBLISHING = internals.REGISTRATIONPARTS_PUBLISHING # type: ignore + PART_PUBLISHING = internals.REGISTRATIONPARTS_PUBLISHING """Register to receive subscribe and unsubscribe messages""" - PART_OPERATIONS = internals.REGISTRATIONPARTS_OPERATIONS # type: ignore + PART_OPERATIONS = internals.REGISTRATIONPARTS_OPERATIONS """Register to receive the request types corresponding to each "operation" defined in the service metadata""" - PART_SUBSCRIBER_RESOLUTION \ - = internals.REGISTRATIONPARTS_SUBSCRIBER_RESOLUTION # type: ignore + PART_SUBSCRIBER_RESOLUTION = ( + internals.REGISTRATIONPARTS_SUBSCRIBER_RESOLUTION + ) """Register to receive resolution requests (with message type ``PermissionRequest``) from subscribers""" - PART_PUBLISHER_RESOLUTION \ - = internals.REGISTRATIONPARTS_PUBLISHER_RESOLUTION # type: ignore + PART_PUBLISHER_RESOLUTION = ( + internals.REGISTRATIONPARTS_PUBLISHER_RESOLUTION + ) """Register to receive resolution requests (with message type ``PermissionRequest``) from publishers (via :meth:`ProviderSession.createTopics()`)""" - PART_DEFAULT = internals.REGISTRATIONPARTS_DEFAULT # type: ignore + PART_DEFAULT = internals.REGISTRATIONPARTS_DEFAULT """Register the parts of the service implied by options specified in the service metadata""" @@ -137,8 +139,8 @@ def __init__(self) -> None: """Create :class:`ServiceRegistrationOptions` with default options.""" selfhandle = internals.blpapi_ServiceRegistrationOptions_create() super(ServiceRegistrationOptions, self).__init__( - selfhandle, - internals.blpapi_ServiceRegistrationOptions_destroy) + selfhandle, internals.blpapi_ServiceRegistrationOptions_destroy + ) self.__handle = selfhandle def setGroupId(self, groupId: str) -> None: @@ -153,7 +155,8 @@ def setGroupId(self, groupId: str) -> None: are considered as Group Id. """ internals.blpapi_ServiceRegistrationOptions_setGroupId( - self.__handle, groupId) + self.__handle, groupId + ) def setServicePriority(self, priority: int) -> int: """Set the priority with which a subscription service will be @@ -175,17 +178,17 @@ def setServicePriority(self, priority: int) -> int: Note this has no effect for resolution services. """ return internals.blpapi_ServiceRegistrationOptions_setServicePriority( - self.__handle, - priority) + self.__handle, priority + ) def getGroupId(self) -> str: """ Returns: The value of the service Group Id in this instance. """ - _, groupId = \ - internals.blpapi_ServiceRegistrationOptions_getGroupId( - self.__handle) + _, groupId = internals.blpapi_ServiceRegistrationOptions_getGroupId( + self.__handle + ) return groupId def getServicePriority(self) -> int: @@ -194,15 +197,16 @@ def getServicePriority(self) -> int: The value of the priority for subscription services in this instance. """ - priority = \ + priority = ( internals.blpapi_ServiceRegistrationOptions_getServicePriority( - self.__handle) + self.__handle + ) + ) return priority - def addActiveSubServiceCodeRange(self, - begin: int, - end: int, - priority: int) -> None: + def addActiveSubServiceCodeRange( + self, begin: int, end: int, priority: int + ) -> None: """ Args: begin: Start of sub-service code range @@ -220,13 +224,15 @@ def addActiveSubServiceCodeRange(self, end < (1 << 24)``, and ``priority`` is non-negative. """ err = internals.blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange( - self.__handle, begin, end, priority) + self.__handle, begin, end, priority + ) _ExceptionUtil.raiseOnError(err) def removeAllActiveSubServiceCodeRanges(self) -> None: """Remove all previously added sub-service code ranges.""" internals.blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges( - self.__handle) + self.__handle + ) def setPartsToRegister(self, parts: int) -> None: """Set the parts of the service to be registered. @@ -240,7 +246,8 @@ def setPartsToRegister(self, parts: int) -> None: option defaults to :attr:`PART_DEFAULT`. """ internals.blpapi_ServiceRegistrationOptions_setPartsToRegister( - self.__handle, parts) + self.__handle, parts + ) def getPartsToRegister(self) -> int: """ @@ -250,11 +257,13 @@ def getPartsToRegister(self) -> int: Registration parts are enumerated in the class docstring. """ return internals.blpapi_ServiceRegistrationOptions_getPartsToRegister( - self.__handle) + self.__handle + ) -class ProviderSession(AbstractSession, - metaclass=utils.MetaClassForClassesWithEnums): +class ProviderSession( + AbstractSession, metaclass=utils.MetaClassForClassesWithEnums +): """This class provides a session that can be used for providing services. It inherits from :class:`AbstractSession`. In addition to the @@ -281,19 +290,18 @@ class ProviderSession(AbstractSession, be routed to one of the providers with the highest service priority. """ - AUTO_REGISTER_SERVICES = \ - internals.RESOLVEMODE_AUTO_REGISTER_SERVICES # type: ignore + AUTO_REGISTER_SERVICES = internals.RESOLVEMODE_AUTO_REGISTER_SERVICES - DONT_REGISTER_SERVICES = \ - internals.RESOLVEMODE_DONT_REGISTER_SERVICES # type: ignore + DONT_REGISTER_SERVICES = internals.RESOLVEMODE_DONT_REGISTER_SERVICES __handle = None # pylint: disable=unused-private-member __handlerProxy = None # pylint: disable=unused-private-member @staticmethod def __dispatchEvent( - sessionRef: "ReferenceType[ProviderSession]", - eventHandle: BlpapiEventHandle) -> None: # pragma: no cover + sessionRef: "ReferenceType[ProviderSession]", + eventHandle: BlpapiEventHandle, + ) -> None: # pragma: no cover """Use sessions ref to dispatch an event""" try: session = sessionRef() @@ -305,10 +313,14 @@ def __dispatchEvent( traceback.print_exc(file=sys.stderr) os._exit(1) - def __init__(self, - options: Optional[SessionOptions]=None, - eventHandler: Optional[Callable]=None, - eventDispatcher: Optional["typehints.EventDispatcher"]=None) -> None: + def __init__( + self, + options: Optional[SessionOptions] = None, + eventHandler: Optional[ + Callable[[Event, "ProviderSession"], None] + ] = None, + eventDispatcher: Optional["typehints.EventDispatcher"] = None, + ) -> None: """Constructor. Args: @@ -353,27 +365,32 @@ def __init__(self, AbstractSession.__init__(self) if (eventHandler is None) and (eventDispatcher is not None): raise exception.InvalidArgumentException( - "eventDispatcher is specified but eventHandler is None", 0) + "eventDispatcher is specified but eventHandler is None", 0 + ) if options is None: options = SessionOptions() if eventHandler is not None: - self.__handler = eventHandler # pylint: disable=unused-private-member + # pylint: disable=unused-private-member + self.__handler = eventHandler self.__handlerProxy = functools.partial( - ProviderSession.__dispatchEvent, ref(self)) + ProviderSession.__dispatchEvent, ref(self) + ) self.__handle = internals.ProviderSession_createHelper( get_handle(options), self.__handlerProxy, - get_handle(eventDispatcher)) + get_handle(eventDispatcher), + ) _destroy = internals.ProviderSession_destroyHelper # note: AbstractSession destroy passes AbstractSession handle _dtor = lambda hndl: _destroy(self.__handle, self.__handlerProxy) - atexit.register(self.stop) # we must stop session before shutdown + atexit.register(self.stop) # we must stop session before shutdown AbstractSession.__init__( self, internals.blpapi_ProviderSession_getAbstractSession(self.__handle), - _dtor) + _dtor, + ) def start(self) -> bool: """Start this :class:`Session` in synchronous mode. @@ -424,7 +441,12 @@ def flushPublishedEvents(self, timeoutMsecs: int) -> bool: events have been sent and returns without waiting. """ - err_code, allFlushed = internals.blpapi_ProviderSession_flushPublishedEvents(self.__handle, timeoutMsecs) + ( + err_code, + allFlushed, + ) = internals.blpapi_ProviderSession_flushPublishedEvents( + self.__handle, timeoutMsecs + ) if err_code != 0: raise RuntimeError("Flush published events failed") @@ -465,7 +487,7 @@ def stopAsync(self) -> bool: """ return internals.blpapi_ProviderSession_stopAsync(self.__handle) == 0 - def nextEvent(self, timeout: int=0) -> Event: + def nextEvent(self, timeout: int = 0) -> Event: """ Args: timeout: Timeout threshold in milliseconds @@ -487,8 +509,8 @@ def nextEvent(self, timeout: int=0) -> Event: of type :attr:`~Event.TIMEOUT`. """ retCode, event = internals.blpapi_ProviderSession_nextEvent( - self.__handle, - timeout) + self.__handle, timeout + ) _ExceptionUtil.raiseOnError(retCode) @@ -504,16 +526,18 @@ def tryNextEvent(self) -> Optional[Event]: :class:`Session`, return ``None``. This method never blocks. """ retCode, event = internals.blpapi_ProviderSession_tryNextEvent( - self.__handle) + self.__handle + ) if retCode: return None return Event(event, {self}) def registerService( - self, - uri: str, - identity: Optional["typehints.Identity"]=None, - options: Optional[ServiceRegistrationOptions]=None) -> bool: + self, + uri: str, + identity: Optional["typehints.Identity"] = None, + options: Optional[ServiceRegistrationOptions] = None, + ) -> bool: """Attempt to register the service and block until it is done. Args: @@ -547,19 +571,22 @@ def registerService( """ if options is None: options = ServiceRegistrationOptions() - if internals.blpapi_ProviderSession_registerService( - self.__handle, uri, - get_handle(identity), - get_handle(options)) == 0: + if ( + internals.blpapi_ProviderSession_registerService( + self.__handle, uri, get_handle(identity), get_handle(options) + ) + == 0 + ): return True return False def registerServiceAsync( - self, - uri: str, - identity: Optional["typehints.Identity"]=None, - correlationId: Optional[CorrelationId]=None, - options: Optional[ServiceRegistrationOptions]=None) -> CorrelationId: + self, + uri: str, + identity: Optional["typehints.Identity"] = None, + correlationId: Optional[CorrelationId] = None, + options: Optional[ServiceRegistrationOptions] = None, + ) -> CorrelationId: """Begin the process of registering the service immediately. Args: @@ -604,15 +631,18 @@ def registerServiceAsync( uri, get_handle(identity), correlationId, - get_handle(options) - )) + get_handle(options), + ) + ) return correlationId - def resolve(self, - resolutionList: "typehints.ResolutionList", - resolveMode: int=DONT_REGISTER_SERVICES, - identity: Optional["typehints.Identity"]=None) -> None: + def resolve( + self, + resolutionList: "typehints.ResolutionList", + resolveMode: int = DONT_REGISTER_SERVICES, + identity: Optional["typehints.Identity"] = None, + ) -> None: """Resolve the topics in the specified ``resolutionList``. Args: @@ -651,12 +681,16 @@ def resolve(self, self.__handle, get_handle(resolutionList), resolveMode, - get_handle(identity))) - - def resolveAsync(self, - resolutionList: "typehints.ResolutionList", - resolveMode: int=DONT_REGISTER_SERVICES, - identity: Optional["typehints.Identity"]=None) -> None: + get_handle(identity), + ) + ) + + def resolveAsync( + self, + resolutionList: "typehints.ResolutionList", + resolveMode: int = DONT_REGISTER_SERVICES, + identity: Optional["typehints.Identity"] = None, + ) -> None: """Begin the resolution of the topics in the specified list. Args: @@ -691,7 +725,9 @@ def resolveAsync(self, self.__handle, get_handle(resolutionList), resolveMode, - get_handle(identity))) + get_handle(identity), + ) + ) def getTopic(self, message: "typehints.Message") -> Topic: """Find a previously created :class:`Topic` based on the ``message``. @@ -709,13 +745,12 @@ def getTopic(self, message: "typehints.Message") -> Topic: will return ``False``. """ errorCode, topicHandle = internals.blpapi_ProviderSession_getTopic( - self.__handle, - get_handle(message)) + self.__handle, get_handle(message) + ) _ExceptionUtil.raiseOnError(errorCode) return Topic(topicHandle, {self}) - def createServiceStatusTopic(self, - service: "typehints.Service") -> Topic: + def createServiceStatusTopic(self, service: "typehints.Service") -> Topic: """Create a :class:`Service` Status :class:`Topic` which is to be used to provide service status. @@ -728,10 +763,12 @@ def createServiceStatusTopic(self, On success invoking :meth:`~Topic.isValid()` on the returned :class:`Topic` will return ``False``. """ - errorCode, topicHandle = \ - internals.blpapi_ProviderSession_createServiceStatusTopic( - self.__handle, - get_handle(service)) + ( + errorCode, + topicHandle, + ) = internals.blpapi_ProviderSession_createServiceStatusTopic( + self.__handle, get_handle(service) + ) _ExceptionUtil.raiseOnError(errorCode) return Topic(topicHandle, {self}) @@ -743,12 +780,13 @@ def publish(self, event: Event) -> None: """ _ExceptionUtil.raiseOnError( internals.blpapi_ProviderSession_publish( - self.__handle, - get_handle(event))) + self.__handle, get_handle(event) + ) + ) - def sendResponse(self, - event: Event, - isPartialResponse: bool=False) -> None: + def sendResponse( + self, event: Event, isPartialResponse: bool = False + ) -> None: """Send the response event for previously received request. Args: @@ -757,14 +795,16 @@ def sendResponse(self, """ _ExceptionUtil.raiseOnError( internals.blpapi_ProviderSession_sendResponse( - self.__handle, - get_handle(event), - isPartialResponse)) - - def createTopics(self, - topicList: "typehints.TopicList", - resolveMode: int=DONT_REGISTER_SERVICES, - identity: Optional["typehints.Identity"]=None) -> None: + self.__handle, get_handle(event), isPartialResponse + ) + ) + + def createTopics( + self, + topicList: "typehints.TopicList", + resolveMode: int = DONT_REGISTER_SERVICES, + identity: Optional["typehints.Identity"] = None, + ) -> None: """Create the topics in the specified ``topicList``. Args: @@ -795,12 +835,16 @@ def createTopics(self, self.__handle, get_handle(topicList), resolveMode, - get_handle(identity))) - - def createTopicsAsync(self, - topicList: "typehints.TopicList", - resolveMode: int=DONT_REGISTER_SERVICES, - identity: Optional["typehints.Identity"]=None) -> None: + get_handle(identity), + ) + ) + + def createTopicsAsync( + self, + topicList: "typehints.TopicList", + resolveMode: int = DONT_REGISTER_SERVICES, + identity: Optional["typehints.Identity"] = None, + ) -> None: """Create the topics in the specified ``topicList``. Args: @@ -831,13 +875,13 @@ def createTopicsAsync(self, self.__handle, get_handle(topicList), resolveMode, - get_handle(identity))) + get_handle(identity), + ) + ) - def activateSubServiceCodeRange(self, - serviceName: str, - begin: int, - end: int, - priority: int) -> None: + def activateSubServiceCodeRange( + self, serviceName: str, begin: int, end: int, priority: int + ) -> None: """ Args: serviceName: Name of the service @@ -857,13 +901,13 @@ def activateSubServiceCodeRange(self, 24)``, and ``priority`` is non-negative. """ err = internals.blpapi_ProviderSession_activateSubServiceCodeRange( - self.__handle, serviceName, begin, end, priority) + self.__handle, serviceName, begin, end, priority + ) _ExceptionUtil.raiseOnError(err) - def deactivateSubServiceCodeRange(self, - serviceName: str, - begin: int, - end: int) -> None: + def deactivateSubServiceCodeRange( + self, serviceName: str, begin: int, end: int + ) -> None: """ Args: serviceName: Name of the service @@ -880,7 +924,8 @@ def deactivateSubServiceCodeRange(self, 24)``. """ err = internals.blpapi_ProviderSession_deactivateSubServiceCodeRange( - self.__handle, serviceName, begin, end) + self.__handle, serviceName, begin, end + ) _ExceptionUtil.raiseOnError(err) def deregisterService(self, serviceName: str) -> bool: @@ -907,13 +952,13 @@ def deregisterService(self, serviceName: str) -> bool: on this service will be ignored after this method returns. """ res = internals.blpapi_ProviderSession_deregisterService( - self.__handle, serviceName) + self.__handle, serviceName + ) return res == 0 def terminateSubscriptionsOnTopic( - self, - topic: Topic, - message: Optional["typehints.Message"]=None) -> None: + self, topic: Topic, message: Optional["typehints.Message"] = None + ) -> None: """Delete the specified ``topic`` (See :meth:`deleteTopic()` for additional details). @@ -931,13 +976,16 @@ def terminateSubscriptionsOnTopic( if not topic: return _ExceptionUtil.raiseOnError( - internals.ProviderSession_terminateSubscriptionsOnTopic( - self.__handle, get_handle(topic), message)) + internals.ProviderSession_terminateSubscriptionsOnTopic( + self.__handle, get_handle(topic), message + ) + ) def terminateSubscriptionsOnTopics( - self, - topics: Sequence[Topic], - message: Optional["typehints.Message"]=None) -> None: + self, + topics: Sequence[Topic], + message: Optional["typehints.Message"] = None, + ) -> None: """Terminate subscriptions on the specified ``topics``. Args: @@ -953,15 +1001,14 @@ def terminateSubscriptionsOnTopics( topicsCArray = internals.new_topicPtrArray(topicsCArraySize) try: for i, topic in enumerate(topics): - internals.topicPtrArray_setitem(topicsCArray, - i, - get_handle(topic)) + internals.topicPtrArray_setitem( + topicsCArray, i, get_handle(topic) + ) _ExceptionUtil.raiseOnError( internals.blpapi_ProviderSession_terminateSubscriptionsOnTopics( - self.__handle, - topicsCArray, - topicsCArraySize, - message)) + self.__handle, topicsCArray, topicsCArraySize, message + ) + ) finally: internals.delete_topicPtrArray(topicsCArray) @@ -998,17 +1045,18 @@ def deleteTopics(self, topics: Sequence[Topic]) -> None: topicsCArray = internals.new_topicPtrArray(topicsCArraySize) try: for i, topic in enumerate(topics): - internals.topicPtrArray_setitem(topicsCArray, - i, - get_handle(topic)) + internals.topicPtrArray_setitem( + topicsCArray, i, get_handle(topic) + ) _ExceptionUtil.raiseOnError( internals.blpapi_ProviderSession_deleteTopics( - self.__handle, - topicsCArray, - topicsCArraySize)) + self.__handle, topicsCArray, topicsCArraySize + ) + ) finally: internals.delete_topicPtrArray(topicsCArray) + __copyright__ = """ Copyright 2012. Bloomberg Finance L.P. diff --git a/src/blpapi/request.py b/src/blpapi/request.py index 94284e5..b0d5c19 100644 --- a/src/blpapi/request.py +++ b/src/blpapi/request.py @@ -15,7 +15,7 @@ from .typehints import BlpapiNameOrStr from . import internals from .chandle import CHandle -from . import typehints # pylint: disable=unused-import +from . import typehints # pylint: disable=unused-import class Request(CHandle): @@ -36,8 +36,11 @@ class Request(CHandle): :class:`Element` interface. """ - def __init__(self, handle: BlpapiRequestHandle, - sessions: Set["typehints.AbstractSession"]) -> None: + def __init__( + self, + handle: BlpapiRequestHandle, + sessions: Set["typehints.AbstractSession"], + ) -> None: super(Request, self).__init__(handle, internals.blpapi_Request_destroy) self.__handle = handle self.__sessions = sessions @@ -99,9 +102,10 @@ def asElement(self) -> Element: if self.__element: el = self.__element() if el is None: - el = Element(internals.blpapi_Request_elements(self.__handle), - self) - self.__element = weakref.ref(el) # type: ignore + el = Element( + internals.blpapi_Request_elements(self.__handle), self + ) + self.__element = weakref.ref(el) # type: ignore return el def getElement(self, name: BlpapiNameOrStr) -> Element: @@ -135,6 +139,7 @@ def _sessions(self) -> Set["typehints.AbstractSession"]: """Return session(s) this Request related to. For internal use.""" return self.__sessions + __copyright__ = """ Copyright 2012. Bloomberg Finance L.P. diff --git a/src/blpapi/requesttemplate.py b/src/blpapi/requesttemplate.py index bfbf583..f5bd60d 100644 --- a/src/blpapi/requesttemplate.py +++ b/src/blpapi/requesttemplate.py @@ -19,15 +19,19 @@ from . import internals from .chandle import CHandle +from .typehints import BlpapiRequestTemplateHandle + class RequestTemplate(CHandle): """Request templates cache the necessary information to make a request and eliminate the need to create new requests for snapshot services. """ - def __init__(self, handle): + def __init__(self, handle: BlpapiRequestTemplateHandle) -> None: super(RequestTemplate, self).__init__( - handle, internals.blpapi_RequestTemplate_release) + handle, internals.blpapi_RequestTemplate_release + ) + __copyright__ = """ Copyright 2018. Bloomberg Finance L.P. diff --git a/src/blpapi/resolutionlist.py b/src/blpapi/resolutionlist.py index 6bb3f9d..1e3b36c 100644 --- a/src/blpapi/resolutionlist.py +++ b/src/blpapi/resolutionlist.py @@ -13,7 +13,7 @@ from .utils import deprecated, get_handle from .internals import CorrelationId from .chandle import CHandle -from . import typehints # pylint: disable=unused-import +from . import typehints # pylint: disable=unused-import class ResolutionList(CHandle, metaclass=utils.MetaClassForClassesWithEnums): @@ -28,22 +28,25 @@ class ResolutionList(CHandle, metaclass=utils.MetaClassForClassesWithEnums): :class:`ResolutionList` can be. """ - UNRESOLVED = internals.RESOLUTIONLIST_UNRESOLVED # type: ignore - RESOLVED = internals.RESOLUTIONLIST_RESOLVED # type: ignore - RESOLUTION_FAILURE_BAD_SERVICE = \ - internals.RESOLUTIONLIST_RESOLUTION_FAILURE_BAD_SERVICE # type: ignore - RESOLUTION_FAILURE_SERVICE_AUTHORIZATION_FAILED = \ - internals. \ - RESOLUTIONLIST_RESOLUTION_FAILURE_SERVICE_AUTHORIZATION_FAILED # type: ignore - RESOLUTION_FAILURE_BAD_TOPIC = \ - internals.RESOLUTIONLIST_RESOLUTION_FAILURE_BAD_TOPIC # type: ignore - RESOLUTION_FAILURE_TOPIC_AUTHORIZATION_FAILED = \ - internals.RESOLUTIONLIST_RESOLUTION_FAILURE_TOPIC_AUTHORIZATION_FAILED # type: ignore + UNRESOLVED = internals.RESOLUTIONLIST_UNRESOLVED + RESOLVED = internals.RESOLUTIONLIST_RESOLVED + RESOLUTION_FAILURE_BAD_SERVICE = ( + internals.RESOLUTIONLIST_RESOLUTION_FAILURE_BAD_SERVICE + ) + RESOLUTION_FAILURE_SERVICE_AUTHORIZATION_FAILED = ( + internals.RESOLUTIONLIST_RESOLUTION_FAILURE_SERVICE_AUTHORIZATION_FAILED + ) + RESOLUTION_FAILURE_BAD_TOPIC = ( + internals.RESOLUTIONLIST_RESOLUTION_FAILURE_BAD_TOPIC + ) + RESOLUTION_FAILURE_TOPIC_AUTHORIZATION_FAILED = ( + internals.RESOLUTIONLIST_RESOLUTION_FAILURE_TOPIC_AUTHORIZATION_FAILED + ) @staticmethod @deprecated("attributes are no longer supported.") # pylint: disable=unused-argument,no-self-use - def extractAttributeFromResolutionSuccess(message, attribute): + def extractAttributeFromResolutionSuccess(message, attribute): # type: ignore """ Raises: UnsupportedOperationException: Unconditionally. @@ -57,12 +60,16 @@ def __init__(self) -> None: """Create an empty :class:`ResolutionList`.""" selfhandle = internals.blpapi_ResolutionList_create(None) super(ResolutionList, self).__init__( - selfhandle, - internals.blpapi_ResolutionList_destroy) + selfhandle, internals.blpapi_ResolutionList_destroy + ) self.__handle = selfhandle self.__sessions: Set["typehints.AbstractSession"] = set() - def add(self, topicOrMessage: Union[str, Message], correlationId: Optional[CorrelationId] = None) -> int: + def add( + self, + topicOrMessage: Union[str, Message], + correlationId: Optional[CorrelationId] = None, + ) -> int: """Add the specified topic or topic from message to this list. Args: @@ -91,20 +98,19 @@ def add(self, topicOrMessage: Union[str, Message], correlationId: Optional[Corre correlationId = CorrelationId() if not isinstance(correlationId, CorrelationId): raise TypeError( - "correlationId should be an instance of 'CorrelationId'") + "correlationId should be an instance of 'CorrelationId'" + ) if isinstance(topicOrMessage, Message): return internals.blpapi_ResolutionList_addFromMessage( - self.__handle, - get_handle(topicOrMessage), - correlationId) + self.__handle, get_handle(topicOrMessage), correlationId + ) return internals.blpapi_ResolutionList_add( - self.__handle, - topicOrMessage, - correlationId) + self.__handle, topicOrMessage, correlationId + ) @deprecated("attributes are no longer supported.") # pylint: disable=unused-argument,no-self-use - def addAttribute(self, attribute): + def addAttribute(self, attribute): # type: ignore """ Raises: UnsupportedOperationException: Unconditionally. @@ -126,8 +132,8 @@ def correlationIdAt(self, index: int) -> CorrelationId: IndexOutOfRangeException: If ``index >= size()``. """ errorCode, cid = internals.blpapi_ResolutionList_correlationIdAt( - self.__handle, - index) + self.__handle, index + ) _ExceptionUtil.raiseOnError(errorCode) return cid @@ -146,8 +152,8 @@ def topicString(self, correlationId: CorrelationId) -> str: :class:`ResolutionList`. """ errorCode, topic = internals.blpapi_ResolutionList_topicString( - self.__handle, - correlationId) + self.__handle, correlationId + ) _ExceptionUtil.raiseOnError(errorCode) return topic @@ -163,8 +169,8 @@ def topicStringAt(self, index: int) -> str: IndexOutOfRangeException: If ``index >= size()``. """ errorCode, topic = internals.blpapi_ResolutionList_topicStringAt( - self.__handle, - index) + self.__handle, index + ) _ExceptionUtil.raiseOnError(errorCode) return topic @@ -185,8 +191,8 @@ def status(self, correlationId: CorrelationId) -> int: :class:`ResolutionList`. """ errorCode, status = internals.blpapi_ResolutionList_status( - self.__handle, - correlationId) + self.__handle, correlationId + ) _ExceptionUtil.raiseOnError(errorCode) return status @@ -205,14 +211,14 @@ def statusAt(self, index: int) -> int: :class:`ResolutionList`. """ errorCode, status = internals.blpapi_ResolutionList_statusAt( - self.__handle, - index) + self.__handle, index + ) _ExceptionUtil.raiseOnError(errorCode) return status @deprecated("attributes are no longer supported") # pylint: disable=unused-argument,no-self-use - def attribute(self, attribute, correlationId): + def attribute(self, attribute, correlationId): # type: ignore """ Raises: UnsupportedOperationException: Unconditionally. @@ -226,7 +232,7 @@ def attribute(self, attribute, correlationId): @deprecated("attributes are no longer supported") # pylint: disable=unused-argument,no-self-use - def attributeAt(self, attribute, index): + def attributeAt(self, attribute, index): # type: ignore """ Raises: UnsupportedOperationException: Unconditionally. @@ -257,8 +263,8 @@ def message(self, correlationId: CorrelationId) -> Message: of :class:`Topic`. """ errorCode, message = internals.blpapi_ResolutionList_message( - self.__handle, - correlationId) + self.__handle, correlationId + ) _ExceptionUtil.raiseOnError(errorCode) return Message(message, sessions=self._sessions()) @@ -280,8 +286,8 @@ def messageAt(self, index: int) -> Message: of :class:`Topic`. """ errorCode, message = internals.blpapi_ResolutionList_messageAt( - self.__handle, - index) + self.__handle, index + ) _ExceptionUtil.raiseOnError(errorCode) return Message(message, sessions=self._sessions()) @@ -304,6 +310,7 @@ def _addSession(self, session: "typehints.AbstractSession") -> None: For internal use.""" self.__sessions.add(session) + __copyright__ = """ Copyright 2012. Bloomberg Finance L.P. diff --git a/src/blpapi/schema.py b/src/blpapi/schema.py index f639bb7..2ae95b3 100644 --- a/src/blpapi/schema.py +++ b/src/blpapi/schema.py @@ -19,7 +19,7 @@ """ from typing import Sequence, Set, Optional from typing import Iterator as IteratorType -from . import typehints # pylint: disable=unused-import +from . import typehints # pylint: disable=unused-import from .typehints import BlpapiNameOrStr, BlpapiNameOrStrOrIndex from .typehints import BlpapiSchemaElementDefinitionHandle from .typehints import BlpapiSchemaTypeDefinitionHandle @@ -31,17 +31,16 @@ # pylint: disable=protected-access,too-few-public-methods class SchemaStatus(metaclass=utils.MetaClassForClassesWithEnums): - """The possible deprecation statuses of a schema element or type. - """ + """The possible deprecation statuses of a schema element or type.""" - ACTIVE = internals.STATUS_ACTIVE # type: ignore + ACTIVE = internals.STATUS_ACTIVE # type: ignore """This item is current and may appear in Messages""" - DEPRECATED = internals.STATUS_DEPRECATED # type: ignore + DEPRECATED = internals.STATUS_DEPRECATED # type: ignore """This item is current and may appear in Messages but will be removed in due course""" - INACTIVE = internals.STATUS_INACTIVE # type: ignore + INACTIVE = internals.STATUS_INACTIVE # type: ignore """This item is not current and will not appear in Messages""" - PENDING_DEPRECATION = internals.STATUS_PENDING_DEPRECATION # type: ignore + PENDING_DEPRECATION = internals.STATUS_PENDING_DEPRECATION # type: ignore """This item is expected to be deprecated in the future; clients are advised to migrate away from use of this item.""" @@ -67,7 +66,7 @@ class SchemaElementDefinition(metaclass=utils.MetaClassForClassesWithEnums): A mandatory element has ``minValues() >= 1``. - An element that must constain a single value has + An element that must contain a single value has ``minValues() == maxValues() == 1``. An element containing an array has ``maxValues() > 1``. @@ -82,12 +81,14 @@ class SchemaElementDefinition(metaclass=utils.MetaClassForClassesWithEnums): other blpapi components. """ - UNBOUNDED = internals.ELEMENTDEFINITION_UNBOUNDED # type: ignore + UNBOUNDED = internals.ELEMENTDEFINITION_UNBOUNDED # type: ignore """Indicates an array has an unbounded number of values.""" - def __init__(self, - handle: BlpapiSchemaElementDefinitionHandle, - sessions: Set["typehints.AbstractSession"]) -> None: + def __init__( + self, + handle: BlpapiSchemaElementDefinitionHandle, + sessions: Set["typehints.AbstractSession"], + ) -> None: self.__handle = handle self.__sessions = sessions @@ -109,7 +110,8 @@ def name(self) -> Name: """ return Name._createInternally( - internals.blpapi_SchemaElementDefinition_name(self.__handle)) + internals.blpapi_SchemaElementDefinition_name(self.__handle) + ) def description(self) -> str: """ @@ -117,7 +119,8 @@ def description(self) -> str: Human readable description of this element. """ return internals.blpapi_SchemaElementDefinition_description( - self.__handle) + self.__handle + ) def status(self) -> int: """ @@ -136,7 +139,8 @@ def typeDefinition(self) -> "SchemaTypeDefinition": """ return SchemaTypeDefinition( internals.blpapi_SchemaElementDefinition_type(self.__handle), - self.__sessions) + self.__sessions, + ) def minValues(self) -> int: """ @@ -147,7 +151,8 @@ def minValues(self) -> int: """ return internals.blpapi_SchemaElementDefinition_minValues( - self.__handle) + self.__handle + ) def maxValues(self) -> int: """ @@ -161,7 +166,8 @@ def maxValues(self) -> int: """ return internals.blpapi_SchemaElementDefinition_maxValues( - self.__handle) + self.__handle + ) def alternateNames(self) -> Sequence[Name]: """ @@ -170,17 +176,22 @@ def alternateNames(self) -> Sequence[Name]: """ res = [] - numAlternateNames = \ + numAlternateNames = ( internals.blpapi_SchemaElementDefinition_numAlternateNames( - self.__handle) + self.__handle + ) + ) for i in range(numAlternateNames): - res.append(Name._createInternally( - internals.blpapi_SchemaElementDefinition_getAlternateName( - self.__handle, - i))) + res.append( + Name._createInternally( + internals.blpapi_SchemaElementDefinition_getAlternateName( + self.__handle, i + ) + ) + ) return res - def toString(self, level: int=0, spacesPerLevel: int=4) -> str: + def toString(self, level: int = 0, spacesPerLevel: int = 4) -> str: """ Args: level: Indentation level @@ -196,11 +207,10 @@ def toString(self, level: int=0, spacesPerLevel: int=4) -> str: """ return internals.blpapi_SchemaElementDefinition_printHelper( - self.__handle, - level, - spacesPerLevel) + self.__handle, level, spacesPerLevel + ) - def _handle(self): + def _handle(self) -> typehints.BlpapiSchemaElementDefinitionHandle: """Return the internal implementation.""" return self.__handle @@ -231,9 +241,11 @@ class SchemaTypeDefinition: other blpapi components. """ - def __init__(self, - handle: BlpapiSchemaTypeDefinitionHandle, - sessions: Set["typehints.AbstractSession"]) -> None: + def __init__( + self, + handle: BlpapiSchemaTypeDefinitionHandle, + sessions: Set["typehints.AbstractSession"], + ) -> None: self.__handle = handle self.__sessions = sessions @@ -263,7 +275,8 @@ def name(self) -> Name: The name of this :class:`SchemaTypeDefinition`. """ return Name._createInternally( - internals.blpapi_SchemaTypeDefinition_name(self.__handle)) + internals.blpapi_SchemaTypeDefinition_name(self.__handle) + ) def description(self) -> str: """ @@ -292,7 +305,8 @@ def numElementDefinitions(self) -> int: """ return internals.blpapi_SchemaTypeDefinition_numElementDefinitions( - self.__handle) + self.__handle + ) def isComplexType(self) -> bool: """ @@ -301,8 +315,9 @@ def isComplexType(self) -> bool: sequence or choice type. """ - return bool(internals.blpapi_SchemaTypeDefinition_isComplexType( - self.__handle)) + return bool( + internals.blpapi_SchemaTypeDefinition_isComplexType(self.__handle) + ) def isSimpleType(self) -> bool: """ @@ -311,8 +326,9 @@ def isSimpleType(self) -> bool: a sequence nor a choice type. """ - return bool(internals.blpapi_SchemaTypeDefinition_isSimpleType( - self.__handle)) + return bool( + internals.blpapi_SchemaTypeDefinition_isSimpleType(self.__handle) + ) def isEnumerationType(self) -> bool: """ @@ -321,8 +337,11 @@ def isEnumerationType(self) -> bool: enumeration type, ``False`` otherwise. """ - return bool(internals.blpapi_SchemaTypeDefinition_isEnumerationType( - self.__handle)) + return bool( + internals.blpapi_SchemaTypeDefinition_isEnumerationType( + self.__handle + ) + ) def hasElementDefinition(self, name: BlpapiNameOrStr) -> bool: """ @@ -338,14 +357,15 @@ def hasElementDefinition(self, name: BlpapiNameOrStr) -> bool: """ namepair = getNamePair(name) - return bool(internals.blpapi_SchemaTypeDefinition_hasElementDefinition( - self.__handle, - namepair[0], - namepair[1])) + return bool( + internals.blpapi_SchemaTypeDefinition_hasElementDefinition( + self.__handle, namepair[0], namepair[1] + ) + ) def getElementDefinition( - self, - nameOrIndex: BlpapiNameOrStrOrIndex) -> "SchemaElementDefinition": + self, nameOrIndex: BlpapiNameOrStrOrIndex + ) -> "SchemaElementDefinition": """ Args: nameOrIndex: Name or index of the element @@ -364,19 +384,19 @@ def getElementDefinition( name = nameOrIndex names = getNamePair(name) res = internals.blpapi_SchemaTypeDefinition_getElementDefinition( - self.__handle, - names[0], - names[1]) + self.__handle, names[0], names[1] + ) if res is None: - errMessage =\ - f"Name '{name!s}' not a sub-element of element " \ + errMessage = ( + f"Name '{name!s}' not a sub-element of element " f" '{self.name()!s}'." + ) raise NotFoundException(errMessage, 0) return SchemaElementDefinition(res, self.__sessions) position = nameOrIndex res = internals.blpapi_SchemaTypeDefinition_getElementDefinitionAt( - self.__handle, - position) + self.__handle, position + ) if res is None: errMessage = f"Index '{position}' out of bounds." raise IndexOutOfRangeException(errMessage, 0) @@ -389,9 +409,11 @@ def elementDefinitions(self) -> IteratorType["SchemaElementDefinition"]: :class:`SchemaTypeDefinition`. """ - return utils.Iterator(self, - SchemaTypeDefinition.numElementDefinitions, - SchemaTypeDefinition.getElementDefinition) + return utils.Iterator( + self, + SchemaTypeDefinition.numElementDefinitions, + SchemaTypeDefinition.getElementDefinition, + ) def enumeration(self) -> Optional["typehints.ConstantList"]: """ @@ -404,7 +426,7 @@ def enumeration(self) -> Optional["typehints.ConstantList"]: res = internals.blpapi_SchemaTypeDefinition_enumeration(self.__handle) return None if res is None else ConstantList(res, self.__sessions) - def toString(self, level: int=0, spacesPerLevel: int=4) -> str: + def toString(self, level: int = 0, spacesPerLevel: int = 4) -> str: """ Args: level: Indentation level @@ -420,14 +442,14 @@ def toString(self, level: int=0, spacesPerLevel: int=4) -> str: """ return internals.blpapi_SchemaTypeDefinition_printHelper( - self.__handle, - level, - spacesPerLevel) + self.__handle, level, spacesPerLevel + ) def _sessions(self) -> Set["typehints.AbstractSession"]: """Return session(s) this object is related to. For internal use.""" return self.__sessions + __copyright__ = """ Copyright 2012. Bloomberg Finance L.P. diff --git a/src/blpapi/service.py b/src/blpapi/service.py index d23558d..c40f97b 100644 --- a/src/blpapi/service.py +++ b/src/blpapi/service.py @@ -10,7 +10,7 @@ import warnings from typing import Optional, Set from typing import Iterator as IteratorType -from . import typehints # pylint: disable=unused-import +from . import typehints # pylint: disable=unused-import from .typehints import BlpapiNameOrStr, BlpapiNameOrStrOrIndex from .typehints import BlpapiServiceHandle, BlpapiOperationHandle from .event import Event @@ -31,9 +31,11 @@ class Operation: the possible response. """ - def __init__(self, - handle: BlpapiOperationHandle, - sessions: Set["typehints.AbstractSession"]): + def __init__( + self, + handle: BlpapiOperationHandle, + sessions: Set["typehints.AbstractSession"], + ): self.__handle = handle self.__sessions = sessions @@ -58,9 +60,13 @@ def requestDefinition(self) -> Optional[SchemaElementDefinition]: """ errCode, definition = internals.blpapi_Operation_requestDefinition( - self.__handle) - return None if errCode != 0 else\ - SchemaElementDefinition(definition, self.__sessions) + self.__handle + ) + return ( + None + if errCode != 0 + else SchemaElementDefinition(definition, self.__sessions) + ) def numResponseDefinitions(self) -> int: """ @@ -72,8 +78,9 @@ def numResponseDefinitions(self) -> int: return internals.blpapi_Operation_numResponseDefinitions(self.__handle) - def getResponseDefinitionAt(self, - position: int) -> SchemaElementDefinition: + def getResponseDefinitionAt( + self, position: int + ) -> SchemaElementDefinition: """ Args: position: Index of the response type @@ -87,8 +94,8 @@ def getResponseDefinitionAt(self, """ errCode, definition = internals.blpapi_Operation_responseDefinition( - self.__handle, - position) + self.__handle, position + ) _ExceptionUtil.raiseOnError(errCode) return SchemaElementDefinition(definition, self.__sessions) @@ -101,9 +108,11 @@ def responseDefinitions(self) -> IteratorType[SchemaElementDefinition]: Response type is defined by :class:`SchemaElementDefinition`. """ - return utils.Iterator(self, - Operation.numResponseDefinitions, - Operation.getResponseDefinitionAt) + return utils.Iterator( + self, + Operation.numResponseDefinitions, + Operation.getResponseDefinitionAt, + ) def _sessions(self) -> Set["typehints.AbstractSession"]: """Return session(s) this object is related to. For internal use.""" @@ -128,9 +137,11 @@ class Service(CHandle): :class:`Session` is terminated. """ - def __init__(self, - handle: BlpapiServiceHandle, - sessions: Set["typehints.AbstractSession"]) -> None: + def __init__( + self, + handle: BlpapiServiceHandle, + sessions: Set["typehints.AbstractSession"], + ) -> None: super(Service, self).__init__(handle, internals.blpapi_Service_release) self.__handle = handle self.__sessions = sessions @@ -140,7 +151,7 @@ def __str__(self) -> str: """Convert the service schema to a string.""" return self.toString() - def toString(self, level: int=0, spacesPerLevel:int =4) -> str: + def toString(self, level: int = 0, spacesPerLevel: int = 4) -> str: """Convert this :class:`Service` schema to a string. Args: @@ -156,9 +167,9 @@ def toString(self, level: int=0, spacesPerLevel:int =4) -> str: suppressing all but the initial indentation (as governed by ``level``). """ - return internals.blpapi_Service_printHelper(self.__handle, - level, - spacesPerLevel) + return internals.blpapi_Service_printHelper( + self.__handle, level, spacesPerLevel + ) def createPublishEvent(self) -> Event: """ @@ -171,7 +182,8 @@ def createPublishEvent(self) -> Event: """ errCode, event = internals.blpapi_Service_createPublishEvent( - self.__handle) + self.__handle + ) _ExceptionUtil.raiseOnError(errCode) return Event(event, self.__sessions) @@ -191,14 +203,17 @@ def createAdminEvent(self) -> Event: warnings.warn( "This method is deprecated, see docstring for details", - DeprecationWarning) + DeprecationWarning, + ) errCode, event = internals.blpapi_Service_createAdminEvent( - self.__handle) + self.__handle + ) _ExceptionUtil.raiseOnError(errCode) return Event(event, self.__sessions) - def createResponseEvent(self, - correlationId: "typehints.CorrelationId") -> Event: + def createResponseEvent( + self, correlationId: "typehints.CorrelationId" + ) -> Event: """Create a :attr:`~Event.RESPONSE` :class:`Event` to answer the request. @@ -214,8 +229,8 @@ def createResponseEvent(self, """ errCode, event = internals.blpapi_Service_createResponseEvent( - self.__handle, - correlationId) + self.__handle, correlationId + ) _ExceptionUtil.raiseOnError(errCode) return Event(event, self.__sessions) @@ -241,9 +256,11 @@ def hasOperation(self, name: BlpapiNameOrStr) -> bool: """ names = getNamePair(name) - return bool(internals.blpapi_Service_hasOperation(self.__handle, - names[0], - names[1])) + return bool( + internals.blpapi_Service_hasOperation( + self.__handle, names[0], names[1] + ) + ) def getOperation(self, nameOrIndex: BlpapiNameOrStrOrIndex) -> Operation: """ @@ -262,12 +279,13 @@ def getOperation(self, nameOrIndex: BlpapiNameOrStrOrIndex) -> Operation: if not isinstance(nameOrIndex, int): names = getNamePair(nameOrIndex) errCode, operation = internals.blpapi_Service_getOperation( - self.__handle, names[0], names[1]) + self.__handle, names[0], names[1] + ) _ExceptionUtil.raiseOnError(errCode) return Operation(operation, self.__sessions) errCode, operation = internals.blpapi_Service_getOperationAt( - self.__handle, - nameOrIndex) + self.__handle, nameOrIndex + ) _ExceptionUtil.raiseOnError(errCode) return Operation(operation, self.__sessions) @@ -284,9 +302,9 @@ def operations(self) -> IteratorType[Operation]: Returns: Iterator over :class:`Operation`\ s defined by this :class:`Service` """ - return utils.Iterator(self, - Service.numOperations, - Service.getOperation) + return utils.Iterator( + self, Service.numOperations, Service.getOperation + ) def hasEventDefinition(self, name: BlpapiNameOrStr) -> bool: """ @@ -302,13 +320,15 @@ def hasEventDefinition(self, name: BlpapiNameOrStr) -> bool: """ names = getNamePair(name) - return bool(internals.blpapi_Service_hasEventDefinition(self.__handle, - names[0], - names[1])) + return bool( + internals.blpapi_Service_hasEventDefinition( + self.__handle, names[0], names[1] + ) + ) def getEventDefinition( - self, - nameOrIndex: BlpapiNameOrStrOrIndex) -> SchemaElementDefinition: + self, nameOrIndex: BlpapiNameOrStrOrIndex + ) -> SchemaElementDefinition: """Get the definition of a specified event. Args: @@ -328,14 +348,13 @@ def getEventDefinition( if not isinstance(nameOrIndex, int): names = getNamePair(nameOrIndex) errCode, definition = internals.blpapi_Service_getEventDefinition( - self.__handle, - names[0], - names[1]) + self.__handle, names[0], names[1] + ) _ExceptionUtil.raiseOnError(errCode) return SchemaElementDefinition(definition, self.__sessions) errCode, definition = internals.blpapi_Service_getEventDefinitionAt( - self.__handle, - nameOrIndex) + self.__handle, nameOrIndex + ) _ExceptionUtil.raiseOnError(errCode) return SchemaElementDefinition(definition, self.__sessions) @@ -353,9 +372,9 @@ def eventDefinitions(self) -> IteratorType[SchemaElementDefinition]: :class:`Service`. """ - return utils.Iterator(self, - Service.numEventDefinitions, - Service.getEventDefinition) + return utils.Iterator( + self, Service.numEventDefinitions, Service.getEventDefinition + ) def authorizationServiceName(self) -> str: """Get the authorization service name. @@ -388,14 +407,14 @@ def createRequest(self, operation: str) -> Request: """ errCode, request = internals.blpapi_Service_createRequest( - self.__handle, - operation) + self.__handle, operation + ) _ExceptionUtil.raiseOnError(errCode) return Request(request, self.__sessions) def createAuthorizationRequest( - self, - authorizationOperation: Optional[str]=None) -> Request: + self, authorizationOperation: Optional[str] = None + ) -> Request: """Create an empty :class:`Request` object for ``authorizationOperation``. @@ -414,8 +433,8 @@ def createAuthorizationRequest( """ errCode, request = internals.blpapi_Service_createAuthorizationRequest( - self.__handle, - authorizationOperation) + self.__handle, authorizationOperation + ) _ExceptionUtil.raiseOnError(errCode) return Request(request, self.__sessions) @@ -423,6 +442,7 @@ def _sessions(self) -> Set["typehints.AbstractSession"]: """Return session(s) this object is related to. For internal use.""" return self.__sessions + __copyright__ = """ Copyright 2012. Bloomberg Finance L.P. diff --git a/src/blpapi/session.py b/src/blpapi/session.py index 6b3ca1e..9a36c19 100644 --- a/src/blpapi/session.py +++ b/src/blpapi/session.py @@ -5,7 +5,7 @@ This component implements a consumer session for getting services. """ -from weakref import ref, ReferenceType # pylint: disable=unused-import +from weakref import ref, ReferenceType # pylint: disable=unused-import from typing import Optional, Callable, List import sys import traceback @@ -23,7 +23,7 @@ from .sessionoptions import SessionOptions from .requesttemplate import RequestTemplate from .utils import get_handle, MetaClassForClassesWithEnums -from . import typehints # pylint: disable=unused-import +from . import typehints # pylint: disable=unused-import from .typehints import BlpapiEventHandle # pylint: disable=too-many-arguments,protected-access,bare-except @@ -45,6 +45,7 @@ class SubscriptionPreprocessMode(Enum): error due to an invalid subscription in the :class:`SubscriptionList`. The valid subscriptions will move forward.""" + class Session(AbstractSession, metaclass=MetaClassForClassesWithEnums): """Consumer session for making requests for Bloomberg services. @@ -103,26 +104,25 @@ class Session(AbstractSession, metaclass=MetaClassForClassesWithEnums): The class attributes represent the states in which a subscription can be. """ - UNSUBSCRIBED = internals.SUBSCRIPTIONSTATUS_UNSUBSCRIBED # type: ignore + UNSUBSCRIBED = internals.SUBSCRIPTIONSTATUS_UNSUBSCRIBED """No longer active, terminated by API.""" - SUBSCRIBING = internals.SUBSCRIPTIONSTATUS_SUBSCRIBING # type: ignore + SUBSCRIBING = internals.SUBSCRIPTIONSTATUS_SUBSCRIBING """Initiated but no updates received.""" - SUBSCRIBED = internals.SUBSCRIPTIONSTATUS_SUBSCRIBED # type: ignore + SUBSCRIBED = internals.SUBSCRIPTIONSTATUS_SUBSCRIBED """Updates are flowing.""" - CANCELLED = internals.SUBSCRIPTIONSTATUS_CANCELLED # type: ignore + CANCELLED = internals.SUBSCRIPTIONSTATUS_CANCELLED """No longer active, terminated by Application.""" - PENDING_CANCELLATION = \ - internals.SUBSCRIPTIONSTATUS_PENDING_CANCELLATION # type: ignore + PENDING_CANCELLATION = internals.SUBSCRIPTIONSTATUS_PENDING_CANCELLATION """No longer active, terminated by Application.""" - __handle = None # pylint: disable=unused-private-member - __handlerProxy = None # pylint: disable=unused-private-member + __handle = None # pylint: disable=unused-private-member + __handlerProxy = None # pylint: disable=unused-private-member @staticmethod def __dispatchEvent( - sessionRef: "ReferenceType[Session]", - eventHandle: BlpapiEventHandle) -> None: # pragma: no cover - """ event dispatcher """ + sessionRef: "ReferenceType[Session]", eventHandle: BlpapiEventHandle + ) -> None: # pragma: no cover + """event dispatcher""" try: session = sessionRef() if session is not None: @@ -134,10 +134,11 @@ def __dispatchEvent( os._exit(1) def __init__( - self, - options: Optional[SessionOptions]=None, - eventHandler: Optional[Callable]=None, - eventDispatcher: Optional["typehints.EventDispatcher"]=None) -> None: + self, + options: Optional[SessionOptions] = None, + eventHandler: Optional[Callable[[Event, "Session"], None]] = None, + eventDispatcher: Optional["typehints.EventDispatcher"] = None, + ) -> None: """Create a consumer :class:`Session`. Args: @@ -180,27 +181,32 @@ def __init__( """ if (eventHandler is None) and (eventDispatcher is not None): raise exception.InvalidArgumentException( - "eventDispatcher is specified but eventHandler is None", 0) + "eventDispatcher is specified but eventHandler is None", 0 + ) if options is None: options = SessionOptions() if eventHandler is not None: - self.__handler = eventHandler # pylint: disable=unused-private-member - self.__handlerProxy = functools.partial(Session.__dispatchEvent, - ref(self)) + # pylint: disable=unused-private-member + self.__handler = eventHandler + self.__handlerProxy = functools.partial( + Session.__dispatchEvent, ref(self) + ) self.__handle = internals.Session_createHelper( get_handle(options), self.__handlerProxy, - get_handle(eventDispatcher)) + get_handle(eventDispatcher), + ) _destroy = internals.Session_destroyHelper # note: AbstractSession destroy passes AbstractSession handle _dtor = lambda hndl: _destroy(self.__handle, self.__handlerProxy) - atexit.register(self.stop) # we must stop session before shutdown + atexit.register(self.stop) # we must stop session before shutdown AbstractSession.__init__( self, internals.blpapi_Session_getAbstractSession(self.__handle), - _dtor) + _dtor, + ) def start(self) -> bool: """Start this :class:`Session` in synchronous mode. @@ -268,7 +274,7 @@ def stopAsync(self) -> bool: """ return internals.blpapi_Session_stopAsync(self.__handle) == 0 - def nextEvent(self, timeout: int=0) -> Event: + def nextEvent(self, timeout: int = 0) -> Event: """ Args: timeout: Timeout threshold in milliseconds @@ -289,8 +295,9 @@ def nextEvent(self, timeout: int=0) -> Event: If :meth:`nextEvent()` returns due to a timeout it will return an event of type :attr:`~Event.TIMEOUT`. """ - retCode, event = internals.blpapi_Session_nextEvent(self.__handle, - timeout) + retCode, event = internals.blpapi_Session_nextEvent( + self.__handle, timeout + ) _ExceptionUtil.raiseOnError(retCode) @@ -311,28 +318,33 @@ def tryNextEvent(self) -> Optional[Event]: return Event(event, {self}) @staticmethod - def _createErrorAppender(errorList): + def _createErrorAppender( + errorList: List["SubscriptionPreprocessError"], + ) -> Callable: def errorAppender( - correlationId: CorrelationId, - subscriptionString: str, - errorCode: int, - description: str): + correlationId: CorrelationId, + subscriptionString: str, + errorCode: int, + description: str, + ) -> None: errorList.append( SubscriptionPreprocessError( correlationId, subscriptionString, SubscriptionPreprocessError.ErrorCode(errorCode), - description)) + description, + ) + ) return errorAppender - def subscribe(self, - subscriptionList: "typehints.SubscriptionList", - identity: Optional["typehints.Identity"]=None, - requestLabel: str="", - mode: SubscriptionPreprocessMode= - SubscriptionPreprocessMode.FAIL_ON_FIRST_ERROR - ) -> Optional[List["SubscriptionPreprocessError"]]: + def subscribe( + self, + subscriptionList: "typehints.SubscriptionList", + identity: Optional["typehints.Identity"] = None, + requestLabel: str = "", + mode: SubscriptionPreprocessMode = SubscriptionPreprocessMode.FAIL_ON_FIRST_ERROR, + ) -> Optional[List["SubscriptionPreprocessError"]]: """Begin subscriptions for each entry in the specified list. Args: @@ -368,13 +380,16 @@ def subscribe(self, subMode = SubscriptionPreprocessMode(mode) if subMode == SubscriptionPreprocessMode.FAIL_ON_FIRST_ERROR: - _ExceptionUtil.raiseOnError(internals.blpapi_Session_subscribe( - self.__handle, - get_handle(subscriptionList), - get_handle(identity), - requestLabel)) + _ExceptionUtil.raiseOnError( + internals.blpapi_Session_subscribe( + self.__handle, + get_handle(subscriptionList), + get_handle(identity), + requestLabel, + ) + ) elif subMode == SubscriptionPreprocessMode.RETURN_INDIVIDUAL_ERRORS: - errorList = [] # type: ignore + errorList = [] # type: ignore errorAppender = Session._createErrorAppender(errorList) _ExceptionUtil.raiseOnError( internals.blpapi_Session_subscribeEx_helper( @@ -382,16 +397,20 @@ def subscribe(self, get_handle(subscriptionList), get_handle(identity), requestLabel, - errorAppender)) + errorAppender, + ) + ) return errorList else: raise exception.InvalidArgumentException( - "Unsupported SubscriptionPreprocessMode: '{}'".format(mode), 0) + "Unsupported SubscriptionPreprocessMode: '{}'".format(mode), 0 + ) return None - def unsubscribe(self, - subscriptionList: "typehints.SubscriptionList") -> None: + def unsubscribe( + self, subscriptionList: "typehints.SubscriptionList" + ) -> None: """Cancel subscriptions from the specified ``subscriptionList``. Args: @@ -417,18 +436,18 @@ def unsubscribe(self, to aggressively re-use correlation IDs, particularly with an asynchronous :class:`Session`. """ - _ExceptionUtil.raiseOnError(internals.blpapi_Session_unsubscribe( - self.__handle, - get_handle(subscriptionList), - None)) + _ExceptionUtil.raiseOnError( + internals.blpapi_Session_unsubscribe( + self.__handle, get_handle(subscriptionList), None + ) + ) def resubscribe( - self, - subscriptionList: "typehints.SubscriptionList", - requestLabel: str="", - resubscriptionId: Optional[int]=None, - mode: SubscriptionPreprocessMode= - SubscriptionPreprocessMode.FAIL_ON_FIRST_ERROR + self, + subscriptionList: "typehints.SubscriptionList", + requestLabel: str = "", + resubscriptionId: Optional[int] = None, + mode: SubscriptionPreprocessMode = SubscriptionPreprocessMode.FAIL_ON_FIRST_ERROR, ) -> Optional[List["SubscriptionPreprocessError"]]: """Modify subscriptions in ``subscriptionList``. @@ -472,16 +491,20 @@ def resubscribe( internals.blpapi_Session_resubscribe( self.__handle, get_handle(subscriptionList), - requestLabel)) + requestLabel, + ) + ) else: _ExceptionUtil.raiseOnError( internals.blpapi_Session_resubscribeWithId( self.__handle, get_handle(subscriptionList), - resubscriptionId, # an int, not a cid - requestLabel)) + resubscriptionId, # an int, not a cid + requestLabel, + ) + ) elif subMode == SubscriptionPreprocessMode.RETURN_INDIVIDUAL_ERRORS: - errorList = [] # type: ignore + errorList = [] # type: ignore errorAppender = Session._createErrorAppender(errorList) if resubscriptionId is None: @@ -490,28 +513,33 @@ def resubscribe( self.__handle, get_handle(subscriptionList), requestLabel, - errorAppender)) + errorAppender, + ) + ) else: _ExceptionUtil.raiseOnError( internals.blpapi_Session_resubscribeWithIdEx_helper( self.__handle, get_handle(subscriptionList), - resubscriptionId, # an int, not a cid + resubscriptionId, # an int, not a cid requestLabel, - errorAppender)) + errorAppender, + ) + ) return errorList else: raise exception.InvalidArgumentException( - "Unsupported SubscriptionPreprocessMode: '{}'".format(mode), 0) + "Unsupported SubscriptionPreprocessMode: '{}'".format(mode), 0 + ) return None - def setStatusCorrelationId( - self, - service: "typehints.Service", - correlationId: CorrelationId, - identity: Optional["typehints.Identity"]=None) -> None: + self, + service: "typehints.Service", + correlationId: CorrelationId, + identity: Optional["typehints.Identity"] = None, + ) -> None: """Set the Correlation id on which service status messages will be received. @@ -530,14 +558,18 @@ def setStatusCorrelationId( self.__handle, get_handle(service), get_handle(identity), - correlationId)) - - def sendRequest(self, - request: "typehints.Request", - identity: Optional["typehints.Identity"]=None, - correlationId: Optional[CorrelationId]=None, - eventQueue: Optional["typehints.EventQueue"]=None, - requestLabel: str="") -> CorrelationId: + correlationId, + ) + ) + + def sendRequest( + self, + request: "typehints.Request", + identity: Optional["typehints.Identity"] = None, + correlationId: Optional[CorrelationId] = None, + eventQueue: Optional["typehints.EventQueue"] = None, + requestLabel: str = "", + ) -> CorrelationId: """Send the specified ``request``. Args: @@ -585,16 +617,17 @@ def sendRequest(self, correlationId, get_handle(identity), get_handle(eventQueue), - requestLabel) + requestLabel, + ) _ExceptionUtil.raiseOnError(res) if eventQueue is not None: eventQueue._registerSession(self) return correlationId def sendRequestTemplate( - self, - requestTemplate: RequestTemplate, - correlationId: Optional[CorrelationId]=None + self, + requestTemplate: RequestTemplate, + correlationId: Optional[CorrelationId] = None, ) -> CorrelationId: """Send a request defined by the specified ``requestTemplate``. @@ -623,17 +656,16 @@ def sendRequestTemplate( if correlationId is None: correlationId = CorrelationId() res = internals.blpapi_Session_sendRequestTemplate( - self.__handle, - get_handle(requestTemplate), - correlationId) + self.__handle, get_handle(requestTemplate), correlationId + ) _ExceptionUtil.raiseOnError(res) return correlationId def createSnapshotRequestTemplate( - self, - subscriptionString: str, - correlationId: CorrelationId, - identity: Optional["typehints.Identity"]=None + self, + subscriptionString: str, + correlationId: CorrelationId, + identity: Optional["typehints.Identity"] = None, ) -> RequestTemplate: """Create a snapshot request template for getting subscription data specified by the ``subscriptionString`` using the specified @@ -728,10 +760,8 @@ def createSnapshotRequestTemplate( identityArg = correlationId rc, template = internals.blpapi_Session_createSnapshotRequestTemplate( - self.__handle, - subscriptionString, - get_handle(identityArg), - cidArg) + self.__handle, subscriptionString, get_handle(identityArg), cidArg + ) _ExceptionUtil.raiseOnError(rc) reqTemplate = RequestTemplate(template) return reqTemplate @@ -740,15 +770,17 @@ def createSnapshotRequestTemplate( class SubscriptionPreprocessError(NamedTuple): """Class representing an error due to an invalid subscription.""" - class ErrorCode(Enum): # type: ignore + class ErrorCode(Enum): # type: ignore """The error codes used by :class:`SubscriptionPreprocessError`.""" - SUBSCRIPTIONPREPROCESS_INVALID_SUBSCRIPTION_STRING = \ + SUBSCRIPTIONPREPROCESS_INVALID_SUBSCRIPTION_STRING = ( internals.SUBSCRIPTIONPREPROCESS_INVALID_SUBSCRIPTION_STRING + ) """Error due to an invalid subscription string.""" - SUBSCRIPTIONPREPROCESS_CORRELATIONID_ERROR = \ + SUBSCRIPTIONPREPROCESS_CORRELATIONID_ERROR = ( internals.SUBSCRIPTIONPREPROCESS_CORRELATIONID_ERROR + ) """Error due to misuse of correlation id, such as using a duplicate.""" correlationId: CorrelationId @@ -757,17 +789,19 @@ class ErrorCode(Enum): # type: ignore subscriptionString: str """The subscription string.""" - errorCode: ErrorCode # type: ignore + errorCode: ErrorCode # type: ignore """Error code representing the error.""" description: str """Description of the error.""" def __str__(self) -> str: - return (f"{{correlationId: {self.correlationId}" - f", subscriptionString: {self.subscriptionString}" - f", code: {self.errorCode}" - f", description: {self.description}}}") + return ( + f"{{correlationId: {self.correlationId}" + f", subscriptionString: {self.subscriptionString}" + f", code: {self.errorCode}" + f", description: {self.description}}}" + ) __copyright__ = """ diff --git a/src/blpapi/sessionoptions.py b/src/blpapi/sessionoptions.py index c18c382..1d1ccc6 100644 --- a/src/blpapi/sessionoptions.py +++ b/src/blpapi/sessionoptions.py @@ -29,7 +29,7 @@ from . import utils from .utils import get_handle from .chandle import CHandle -from . import typehints # pylint: disable=unused-import +from . import typehints # pylint: disable=unused-import # pylint: disable=too-many-public-methods @@ -44,11 +44,11 @@ class SessionOptions(CHandle, metaclass=utils.MetaClassForClassesWithEnums): the API. """ - AUTO = internals.CLIENTMODE_AUTO # type: ignore + AUTO = internals.CLIENTMODE_AUTO """Automatic (desktop if available otherwise server)""" - DAPI = internals.CLIENTMODE_DAPI # type: ignore + DAPI = internals.CLIENTMODE_DAPI """Always connect to the desktop API""" - SAPI = internals.CLIENTMODE_SAPI # type: ignore + SAPI = internals.CLIENTMODE_SAPI """Always connect to the server API""" def __init__(self) -> None: @@ -56,8 +56,8 @@ def __init__(self) -> None: defaults""" selfhandle = internals.blpapi_SessionOptions_create() super(SessionOptions, self).__init__( - selfhandle, - internals.blpapi_SessionOptions_destroy) + selfhandle, internals.blpapi_SessionOptions_destroy + ) self.__handle = selfhandle def __str__(self) -> str: @@ -82,8 +82,10 @@ def setServerHost(self, serverHost: str) -> None: """ _ExceptionUtil.raiseOnError( - internals.blpapi_SessionOptions_setServerHost(self.__handle, - serverHost)) + internals.blpapi_SessionOptions_setServerHost( + self.__handle, serverHost + ) + ) def setServerPort(self, serverPort: int) -> None: """Set the port to connect to when using the server API. @@ -96,10 +98,14 @@ def setServerPort(self, serverPort: int) -> None: """ _ExceptionUtil.raiseOnError( - internals.blpapi_SessionOptions_setServerPort(self.__handle, - serverPort)) - - def setServerAddress(self, serverHost: str, serverPort: int, index: int) -> None: + internals.blpapi_SessionOptions_setServerPort( + self.__handle, serverPort + ) + ) + + def setServerAddress( + self, serverHost: str, serverPort: int, index: int + ) -> None: """Set the server address at the specified ``index``. Args: @@ -112,10 +118,10 @@ def setServerAddress(self, serverHost: str, serverPort: int, index: int) -> None """ _ExceptionUtil.raiseOnError( - internals.blpapi_SessionOptions_setServerAddress(self.__handle, - serverHost, - serverPort, - index)) + internals.blpapi_SessionOptions_setServerAddress( + self.__handle, serverHost, serverPort, index + ) + ) def removeServerAddress(self, index: int) -> None: """Remove the server address at the specified ``index``. @@ -125,8 +131,10 @@ def removeServerAddress(self, index: int) -> None: """ _ExceptionUtil.raiseOnError( - internals.blpapi_SessionOptions_removeServerAddress(self.__handle, - index)) + internals.blpapi_SessionOptions_removeServerAddress( + self.__handle, index + ) + ) def setConnectTimeout(self, timeoutMilliSeconds: int) -> None: """Set the connection timeout in milliseconds. @@ -142,8 +150,9 @@ def setConnectTimeout(self, timeoutMilliSeconds: int) -> None: _ExceptionUtil.raiseOnError( internals.blpapi_SessionOptions_setConnectTimeout( - self.__handle, - timeoutMilliSeconds)) + self.__handle, timeoutMilliSeconds + ) + ) def setDefaultServices(self, defaultServices: Sequence[str]) -> None: """Set the default service for the session. @@ -159,10 +168,13 @@ def setDefaultServices(self, defaultServices: Sequence[str]) -> None: _ExceptionUtil.raiseOnError( internals.blpapi_SessionOptions_setDefaultServices( - self.__handle, - defaultServices)) + self.__handle, defaultServices + ) + ) - def setDefaultSubscriptionService(self, defaultSubscriptionService: str) -> None: + def setDefaultSubscriptionService( + self, defaultSubscriptionService: str + ) -> None: """Set the default service for subscriptions. Args: @@ -178,8 +190,9 @@ def setDefaultSubscriptionService(self, defaultSubscriptionService: str) -> None _ExceptionUtil.raiseOnError( internals.blpapi_SessionOptions_setDefaultSubscriptionService( - self.__handle, - defaultSubscriptionService)) + self.__handle, defaultSubscriptionService + ) + ) def setDefaultTopicPrefix(self, prefix: str) -> None: """Set the default topic prefix. @@ -193,11 +206,12 @@ def setDefaultTopicPrefix(self, prefix: str) -> None: """ internals.blpapi_SessionOptions_setDefaultTopicPrefix( - self.__handle, - prefix) + self.__handle, prefix + ) - def setAllowMultipleCorrelatorsPerMsg(self, - allowMultipleCorrelatorsPerMsg: bool) -> None: + def setAllowMultipleCorrelatorsPerMsg( + self, allowMultipleCorrelatorsPerMsg: bool + ) -> None: """Associate more than one :class:`CorrelationId` with a :class:`Message`. @@ -216,8 +230,8 @@ def setAllowMultipleCorrelatorsPerMsg(self, """ internals.blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg( - self.__handle, - allowMultipleCorrelatorsPerMsg) + self.__handle, allowMultipleCorrelatorsPerMsg + ) def setClientMode(self, clientMode: int) -> None: """Set how to connect to the API. The default is :attr:`AUTO`. @@ -232,8 +246,9 @@ def setClientMode(self, clientMode: int) -> None: connects to the server API and will fail if it is not available. """ - internals.blpapi_SessionOptions_setClientMode(self.__handle, - clientMode) + internals.blpapi_SessionOptions_setClientMode( + self.__handle, clientMode + ) def setMaxPendingRequests(self, maxPendingRequests: int) -> None: """Set the maximum number of requests which can be pending. @@ -246,13 +261,14 @@ def setMaxPendingRequests(self, maxPendingRequests: int) -> None: """ internals.blpapi_SessionOptions_setMaxPendingRequests( - self.__handle, - maxPendingRequests) - - def setSessionIdentityOptions(self, - authOptions: AuthOptions, - correlationId: Optional[CorrelationId] = None - ) -> CorrelationId: + self.__handle, maxPendingRequests + ) + + def setSessionIdentityOptions( + self, + authOptions: Optional[AuthOptions], + correlationId: Optional[CorrelationId] = None, + ) -> CorrelationId: """Sets the specified ``authOptions`` as the :class:`AuthOptions` for the session identity, enabling automatic authorization of the session identity during startup. @@ -286,15 +302,16 @@ def setSessionIdentityOptions(self, if authOptions is None: # Use an 'empty' authoptions instance to reset the value - retcode, authOptions_handle = internals \ - .blpapi_AuthOptions_create_default() + ( + retcode, + authOptions_handle, + ) = internals.blpapi_AuthOptions_create_default() _ExceptionUtil.raiseOnError(retcode) authOptions = AuthOptions(authOptions_handle) retcode = internals.blpapi_SessionOptions_setSessionIdentityOptions( - self._handle(), - get_handle(authOptions), - correlationId) + self._handle(), get_handle(authOptions), correlationId + ) _ExceptionUtil.raiseOnError(retcode) return correlationId @@ -305,8 +322,8 @@ def setAuthenticationOptions(self, authOptions: str) -> None: authOptions: The options used during authentication. """ internals.blpapi_SessionOptions_setAuthenticationOptions( - self.__handle, - authOptions) + self.__handle, authOptions + ) def setNumStartAttempts(self, numStartAttempts: int) -> None: """Set the maximum number of attempts to start a session. @@ -314,8 +331,9 @@ def setNumStartAttempts(self, numStartAttempts: int) -> None: Set the maximum number of attempts to start a session by connecting a server. """ - internals.blpapi_SessionOptions_setNumStartAttempts(self.__handle, - numStartAttempts) + internals.blpapi_SessionOptions_setNumStartAttempts( + self.__handle, numStartAttempts + ) def setAutoRestartOnDisconnection(self, autoRestart: bool) -> None: """Set whether automatically restarting connection if disconnected. @@ -325,8 +343,8 @@ def setAutoRestartOnDisconnection(self, autoRestart: bool) -> None: disconnected """ internals.blpapi_SessionOptions_setAutoRestartOnDisconnection( - self.__handle, - autoRestart) + self.__handle, autoRestart + ) def setSlowConsumerWarningHiWaterMark(self, hiWaterMark: float) -> None: """Set the point at which "slow consumer" events will be generated. @@ -345,8 +363,11 @@ def setSlowConsumerWarningHiWaterMark(self, hiWaterMark: float) -> None: maxEventQueueSize()`` < ``slowConsumerWarningHiWaterMark() * maxEventQueueSize()``. """ - err = internals.blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark( - self.__handle, hiWaterMark) + err = ( + internals.blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark( + self.__handle, hiWaterMark + ) + ) _ExceptionUtil.raiseOnError(err) def setSlowConsumerWarningLoWaterMark(self, loWaterMark: float) -> None: @@ -367,8 +388,11 @@ def setSlowConsumerWarningLoWaterMark(self, loWaterMark: float) -> None: maxEventQueueSize()`` < ``slowConsumerWarningHiWaterMark() * maxEventQueueSize()``. """ - err = internals.blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark( - self.__handle, loWaterMark) + err = ( + internals.blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark( + self.__handle, loWaterMark + ) + ) _ExceptionUtil.raiseOnError(err) def setMaxEventQueueSize(self, eventQueueSize: int) -> None: @@ -386,8 +410,8 @@ def setMaxEventQueueSize(self, eventQueueSize: int) -> None: default value is ``10000``. """ internals.blpapi_SessionOptions_setMaxEventQueueSize( - self.__handle, - eventQueueSize) + self.__handle, eventQueueSize + ) def setKeepAliveEnabled(self, isEnabled: bool) -> None: """Set whether to enable keep-alive pings. @@ -406,7 +430,8 @@ def setKeepAliveEnabled(self, isEnabled: bool) -> None: """ keepAliveValue = 1 if isEnabled else 0 err = internals.blpapi_SessionOptions_setKeepAliveEnabled( - self.__handle, keepAliveValue) + self.__handle, keepAliveValue + ) _ExceptionUtil.raiseOnError(err) def setDefaultKeepAliveInactivityTime(self, inactivityMsecs: int) -> None: @@ -429,8 +454,11 @@ def setDefaultKeepAliveInactivityTime(self, inactivityMsecs: int) -> None: Not all back-end connections provide ping-based keep-alives; this option is ignored by such connections. """ - err = internals.blpapi_SessionOptions_setDefaultKeepAliveInactivityTime( - self.__handle, inactivityMsecs) + err = ( + internals.blpapi_SessionOptions_setDefaultKeepAliveInactivityTime( + self.__handle, inactivityMsecs + ) + ) _ExceptionUtil.raiseOnError(err) def setDefaultKeepAliveResponseTimeout(self, timeoutMsecs: int) -> None: @@ -450,8 +478,11 @@ def setDefaultKeepAliveResponseTimeout(self, timeoutMsecs: int) -> None: that not all back-end connections provide support for ping-based keep-alives; this option is ignored by such connections. """ - err = internals.blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout( - self.__handle, timeoutMsecs) + err = ( + internals.blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout( + self.__handle, timeoutMsecs + ) + ) _ExceptionUtil.raiseOnError(err) def setFlushPublishedEventsTimeout(self, timeoutMsecs: int) -> None: @@ -465,9 +496,12 @@ def setFlushPublishedEventsTimeout(self, timeoutMsecs: int) -> None: is ``2000``. """ internals.blpapi_SessionOptions_setFlushPublishedEventsTimeout( - self.__handle, timeoutMsecs) + self.__handle, timeoutMsecs + ) - def setRecordSubscriptionDataReceiveTimes(self, shouldRecord: bool) -> None: + def setRecordSubscriptionDataReceiveTimes( + self, shouldRecord: bool + ) -> None: """ Args: shouldRecord: Whether to record the receipt time @@ -478,7 +512,8 @@ def setRecordSubscriptionDataReceiveTimes(self, shouldRecord: bool) -> None: recorded. """ internals.blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes( - self.__handle, shouldRecord) + self.__handle, shouldRecord + ) def setServiceCheckTimeout(self, timeoutMsecs: int) -> None: """ @@ -491,7 +526,8 @@ def setServiceCheckTimeout(self, timeoutMsecs: int) -> None: timeout is ``60,000`` milliseconds. """ err = internals.blpapi_SessionOptions_setServiceCheckTimeout( - self.__handle, timeoutMsecs) + self.__handle, timeoutMsecs + ) _ExceptionUtil.raiseOnError(err) def setServiceDownloadTimeout(self, timeoutMsecs: int) -> None: @@ -505,7 +541,8 @@ def setServiceDownloadTimeout(self, timeoutMsecs: int) -> None: ``120,000`` milliseconds. """ err = internals.blpapi_SessionOptions_setServiceDownloadTimeout( - self.__handle, timeoutMsecs) + self.__handle, timeoutMsecs + ) _ExceptionUtil.raiseOnError(err) def setTlsOptions(self, tlsOptions: "TlsOptions") -> None: @@ -515,8 +552,8 @@ def setTlsOptions(self, tlsOptions: "TlsOptions") -> None: tlsOptions: The TLS options """ internals.blpapi_SessionOptions_setTlsOptions( - self.__handle, - get_handle(tlsOptions)) + self.__handle, get_handle(tlsOptions) + ) def setBandwidthSaveModeDisabled(self, isDisabled: bool) -> None: """Specify whether to disable bandwidth saving measures. @@ -526,8 +563,9 @@ def setBandwidthSaveModeDisabled(self, isDisabled: bool) -> None: """ _ExceptionUtil.raiseOnError( internals.blpapi_SessionOptions_setBandwidthSaveModeDisabled( - self.__handle, - isDisabled)) + self.__handle, isDisabled + ) + ) def serverHost(self) -> str: """ @@ -552,7 +590,8 @@ def numServerAddresses(self) -> int: """ return internals.blpapi_SessionOptions_numServerAddresses( - self.__handle) + self.__handle + ) def getServerAddress(self, index: int) -> Tuple[str, int]: """ @@ -560,10 +599,13 @@ def getServerAddress(self, index: int) -> Tuple[str, int]: Server name and port indexed by ``index``. """ - errorCode, host, port = \ - internals.blpapi_SessionOptions_getServerAddress( - self.__handle, - index) + ( + errorCode, + host, + port, + ) = internals.blpapi_SessionOptions_getServerAddress( + self.__handle, index + ) _ExceptionUtil.raiseOnError(errorCode) @@ -575,9 +617,11 @@ def serverAddresses(self) -> Iterator: Iterator over server addresses for this :class:`SessionOptions`. """ - return utils.Iterator(self, - SessionOptions.numServerAddresses, - SessionOptions.getServerAddress) + return utils.Iterator( + self, + SessionOptions.numServerAddresses, + SessionOptions.getServerAddress, + ) def connectTimeout(self) -> int: """ @@ -601,7 +645,8 @@ def defaultSubscriptionService(self) -> str: """ return internals.blpapi_SessionOptions_defaultSubscriptionService( - self.__handle) + self.__handle + ) def defaultTopicPrefix(self) -> str: """ @@ -610,7 +655,8 @@ def defaultTopicPrefix(self) -> str: """ return internals.blpapi_SessionOptions_defaultTopicPrefix( - self.__handle) + self.__handle + ) def allowMultipleCorrelatorsPerMsg(self) -> bool: """ @@ -619,8 +665,12 @@ def allowMultipleCorrelatorsPerMsg(self) -> bool: option. """ - return internals.blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg( - self.__handle) != 0 + return ( + internals.blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg( + self.__handle + ) + != 0 + ) def clientMode(self) -> int: """ @@ -637,15 +687,20 @@ def maxPendingRequests(self) -> int: """ return internals.blpapi_SessionOptions_maxPendingRequests( - self.__handle) + self.__handle + ) def autoRestartOnDisconnection(self) -> bool: """ Returns: Whether automatically restart connection if disconnected. """ - return internals.blpapi_SessionOptions_autoRestartOnDisconnection( - self.__handle) != 0 + return ( + internals.blpapi_SessionOptions_autoRestartOnDisconnection( + self.__handle + ) + != 0 + ) def authenticationOptions(self) -> str: """ @@ -653,7 +708,8 @@ def authenticationOptions(self) -> str: Authentication options in a string. """ return internals.blpapi_SessionOptions_authenticationOptions( - self.__handle) + self.__handle + ) def numStartAttempts(self) -> int: """ @@ -669,8 +725,11 @@ def recordSubscriptionDataReceiveTimes(self) -> bool: :meth:`Message.timeReceived()`) should be recorded for subscription data messages. """ - return bool(internals.blpapi_SessionOptions_recordSubscriptionDataReceiveTimes( - self.__handle)) + return bool( + internals.blpapi_SessionOptions_recordSubscriptionDataReceiveTimes( + self.__handle + ) + ) def slowConsumerWarningHiWaterMark(self) -> float: """ @@ -679,7 +738,8 @@ def slowConsumerWarningHiWaterMark(self) -> float: consumer" event will be generated. """ return internals.blpapi_SessionOptions_slowConsumerWarningHiWaterMark( - self.__handle) + self.__handle + ) def slowConsumerWarningLoWaterMark(self) -> float: """ @@ -688,7 +748,8 @@ def slowConsumerWarningLoWaterMark(self) -> float: consumer cleared" event will be generated. """ return internals.blpapi_SessionOptions_slowConsumerWarningLoWaterMark( - self.__handle) + self.__handle + ) def maxEventQueueSize(self) -> int: """ @@ -705,7 +766,8 @@ def defaultKeepAliveInactivityTime(self) -> int: inactive (receive no data) before a keep alive probe will be sent. """ return internals.blpapi_SessionOptions_defaultKeepAliveInactivityTime( - self.__handle) + self.__handle + ) def defaultKeepAliveResponseTimeout(self) -> int: """ @@ -714,7 +776,8 @@ def defaultKeepAliveResponseTimeout(self) -> int: to a keep alive probe before declaring it lost. """ return internals.blpapi_SessionOptions_defaultKeepAliveResponseTimeout( - self.__handle) + self.__handle + ) def flushPublishedEventsTimeout(self) -> int: """ @@ -724,7 +787,8 @@ def flushPublishedEventsTimeout(self) -> int: ``2000``. """ return internals.blpapi_SessionOptions_flushPublishedEventsTimeout( - self.__handle) + self.__handle + ) def keepAliveEnabled(self) -> bool: """ @@ -733,7 +797,8 @@ def keepAliveEnabled(self) -> bool: return ``False``. """ return bool( - internals.blpapi_SessionOptions_keepAliveEnabled(self.__handle)) + internals.blpapi_SessionOptions_keepAliveEnabled(self.__handle) + ) def serviceCheckTimeout(self) -> int: """ @@ -742,7 +807,8 @@ def serviceCheckTimeout(self) -> int: :class:`SessionOptions` instance in milliseconds. """ return internals.blpapi_SessionOptions_serviceCheckTimeout( - self.__handle) + self.__handle + ) def serviceDownloadTimeout(self) -> int: """ @@ -751,15 +817,19 @@ def serviceDownloadTimeout(self) -> int: :class:`SessionOptions` instance in milliseconds. """ return internals.blpapi_SessionOptions_serviceDownloadTimeout( - self.__handle) + self.__handle + ) def bandwidthSaveModeDisabled(self) -> bool: """ Returns: Whether bandwidth saving measures are disabled. """ - return bool(internals.blpapi_SessionOptions_bandwidthSaveModeDisabled( - self.__handle)) + return bool( + internals.blpapi_SessionOptions_bandwidthSaveModeDisabled( + self.__handle + ) + ) def toString(self, level: int = 0, spacesPerLevel: int = 4) -> str: """Format this :class:`SessionOptions` to the string. @@ -777,9 +847,9 @@ def toString(self, level: int = 0, spacesPerLevel: int = 4) -> str: suppressing all but the initial indentation (as governed by ``level``). """ return internals.blpapi_SessionOptions_printHelper( - self.__handle, - level, - spacesPerLevel) + self.__handle, level, spacesPerLevel + ) + class TlsOptions(CHandle): """SSL configuration options @@ -798,7 +868,8 @@ class TlsOptions(CHandle): def __init__(self, handle: BlpapiTlsOptionsHandle) -> None: super(TlsOptions, self).__init__( - handle, internals.blpapi_TlsOptions_destroy) + handle, internals.blpapi_TlsOptions_destroy + ) self.__handle = handle def setTlsHandshakeTimeoutMs(self, timeoutMs: int) -> None: @@ -810,8 +881,10 @@ def setTlsHandshakeTimeoutMs(self, timeoutMs: int) -> None: default is ``10,000`` milliseconds. The TLS handshake timeout will be set to the default if the specified ``timeoutMs`` is not positive. """ - internals.blpapi_TlsOptions_setTlsHandshakeTimeoutMs(self.__handle, - timeoutMs) + internals.blpapi_TlsOptions_setTlsHandshakeTimeoutMs( + self.__handle, timeoutMs + ) + def setCrlFetchTimeoutMs(self, timeoutMs: int) -> None: """ Args: @@ -822,12 +895,15 @@ def setCrlFetchTimeoutMs(self, timeoutMs: int) -> None: the default if the specified ``timeoutMs`` is not positive. """ internals.blpapi_TlsOptions_setCrlFetchTimeoutMs( - self.__handle, timeoutMs) + self.__handle, timeoutMs + ) @staticmethod - def createFromFiles(clientCredentialsFilename: str, - clientCredentialsPassword: str, - trustedCertificatesFilename: str) -> "TlsOptions": + def createFromFiles( + clientCredentialsFilename: str, + clientCredentialsPassword: str, + trustedCertificatesFilename: str, + ) -> "TlsOptions": """ Args: clientCredentialsFilename: Path to the file with the client @@ -843,13 +919,16 @@ def createFromFiles(clientCredentialsFilename: str, handle = internals.blpapi_TlsOptions_createFromFiles( clientCredentialsFilename, clientCredentialsPassword, - trustedCertificatesFilename) + trustedCertificatesFilename, + ) return TlsOptions(handle) @staticmethod - def createFromBlobs(clientCredentials: Union[bytes, bytearray], - clientCredentialsPassword: str, - trustedCertificates: Union[bytes, bytearray]) -> "TlsOptions": + def createFromBlobs( + clientCredentials: Union[bytes, bytearray], + clientCredentialsPassword: str, + trustedCertificates: Union[bytes, bytearray], + ) -> "TlsOptions": """ Args: clientCredentials: Blob with the client @@ -865,11 +944,11 @@ def createFromBlobs(clientCredentials: Union[bytes, bytearray], credentials = bytearray(clientCredentials) certs = bytearray(trustedCertificates) handle = internals.blpapi_TlsOptions_createFromBlobs( - credentials, - clientCredentialsPassword, - certs) + credentials, clientCredentialsPassword, certs + ) return TlsOptions(handle) + __copyright__ = """ Copyright 2012. Bloomberg Finance L.P. diff --git a/src/blpapi/subscriptionlist.py b/src/blpapi/subscriptionlist.py index 35df6ec..d4762db 100644 --- a/src/blpapi/subscriptionlist.py +++ b/src/blpapi/subscriptionlist.py @@ -89,7 +89,7 @@ from .internals import CorrelationId from .utils import conv2str, get_handle, isstr from .chandle import CHandle -from . import typehints # pylint: disable=unused-import +from . import typehints # pylint: disable=unused-import class SubscriptionList(CHandle): @@ -134,18 +134,22 @@ class SubscriptionList(CHandle): | | | | needs to be canceled. | +-------------+--------------------------+----------------------------+ """ + def __init__(self) -> None: """Create an empty :class:`SubscriptionList`.""" selfhandle = internals.blpapi_SubscriptionList_create() super(SubscriptionList, self).__init__( - selfhandle, - internals.blpapi_SubscriptionList_destroy) + selfhandle, internals.blpapi_SubscriptionList_destroy + ) self.__handle = selfhandle - def add(self, topic: str, - fields: Union[str, Sequence[str], None] = None, - options: Union[str, Sequence[str], Mapping, None] = None, - correlationId: Optional[CorrelationId] = None) -> int: + def add( + self, + topic: str, + fields: Union[str, Sequence[str], None] = None, + options: Union[str, Sequence[str], Mapping, None] = None, + correlationId: Optional[CorrelationId] = None, + ) -> int: """Add the specified ``topic`` to this :class:`SubscriptionList`. Args: @@ -172,26 +176,26 @@ def add(self, topic: str, if fields is not None: if isstr(fields): - fields = conv2str(fields) # type: ignore # the isstr() check means fields must be string by this point + fields = conv2str(fields) # type: ignore # the isstr() check means fields must be string by this point else: fields = ",".join(fields) if options is not None: if isstr(options): - options = conv2str(options) # type: ignore # the isstr() check means options must be string by this point + options = conv2str(options) # type: ignore # the isstr() check means options must be string by this point elif isinstance(options, (list, tuple)): options = "&".join(options) elif isinstance(options, dict): - options = "&".join([key if val is None - else f"{key}={val}" - for key, val in options.items()]) + options = "&".join( + [ + key if val is None else f"{key}={val}" + for key, val in options.items() + ] + ) return internals.blpapi_SubscriptionList_addHelper( - self.__handle, - topic, - correlationId, - fields, - options) + self.__handle, topic, correlationId, fields, options + ) def append(self, other: "typehints.SubscriptionList") -> int: """Append a copy of the specified :class:`SubscriptionList` to this @@ -201,8 +205,8 @@ def append(self, other: "typehints.SubscriptionList") -> int: other: List to append to this one """ return internals.blpapi_SubscriptionList_append( - self.__handle, - get_handle(other)) + self.__handle, get_handle(other) + ) def clear(self) -> int: """Remove all entries from this object.""" @@ -227,8 +231,8 @@ def correlationIdAt(self, index: int) -> CorrelationId: Exception: If ``index >= size()``. """ errorCode, cid = internals.blpapi_SubscriptionList_correlationIdAt( - self.__handle, - index) + self.__handle, index + ) _ExceptionUtil.raiseOnError(errorCode) return cid @@ -244,13 +248,16 @@ def topicStringAt(self, index: int) -> str: Exception: If ``index >= size()``. """ errorCode, topic = internals.blpapi_SubscriptionList_topicStringAt( - self.__handle, - index) + self.__handle, index + ) _ExceptionUtil.raiseOnError(errorCode) return topic - def addResolved(self, subscriptionString: str, - correlationId: Optional[CorrelationId] = None) -> int: + def addResolved( + self, + subscriptionString: str, + correlationId: Optional[CorrelationId] = None, + ) -> int: """ Args: subscriptionString: Fully-resolved subscription string @@ -274,7 +281,8 @@ def addResolved(self, subscriptionString: str, if correlationId is None: correlationId = internals.CorrelationId() return internals.blpapi_SubscriptionList_addResolved( - self.__handle, subscriptionString, correlationId) + self.__handle, subscriptionString, correlationId + ) def isResolvedTopicAt(self, index: int) -> bool: """ @@ -288,10 +296,12 @@ def isResolvedTopicAt(self, index: int) -> bool: is thrown if ``index >= size()``. """ err, res = internals.blpapi_SubscriptionList_isResolvedAt( - self.__handle, index) + self.__handle, index + ) _ExceptionUtil.raiseOnError(err) return res + __copyright__ = """ Copyright 2012. Bloomberg Finance L.P. diff --git a/src/blpapi/test/messageformatter.py b/src/blpapi/test/messageformatter.py index e6da240..6e25cba 100644 --- a/src/blpapi/test/messageformatter.py +++ b/src/blpapi/test/messageformatter.py @@ -7,41 +7,51 @@ from functools import singledispatch, update_wrapper from datetime import date, time, datetime from json import dumps +from typing import Any, Callable, Union from blpapi import internals, Name +from blpapi.typehints import ( + AnyPythonDatetime, + BlpapiMessageFormatterHandle, + BlpapiNameOrStr, + SupportedElementTypes, +) from blpapi.datetime import _DatetimeUtil from blpapi.exception import _ExceptionUtil -from blpapi.utils import \ - conv2str, \ - get_handle, \ - isstr, \ - MAX_32BIT_INT, \ - MIN_32BIT_INT, \ - MIN_64BIT_INT, \ - MAX_64BIT_INT, \ - STR_TYPES - - -def _singledispatchmethod(arg_index): - """ Decorator to implement singledispatch on a class method. +from blpapi.utils import ( + conv2str, + get_handle, + isstr, + MAX_32BIT_INT, + MIN_32BIT_INT, + MIN_64BIT_INT, + MAX_64BIT_INT, + STR_TYPES, +) + + +def _singledispatchmethod(arg_index: int) -> Callable: + """Decorator to implement singledispatch on a class method. `arg_index` indicates the argument whose type will be used to determine the function to which to dispatch. """ - def _singleDispatchMethodImpl(func): - """ Implementation of `_singledispatchmethod`. """ + def _singleDispatchMethodImpl(func: Callable) -> Callable: + """Implementation of `_singledispatchmethod`.""" dispatcher = singledispatch(func) # `dispatcher` is `func` wrapped by singledispatch # `dispatcher` has an attribute `register()`, which is a decorator, # which registers the typed funcs to call based on the arg passed to # `func` - def _wrapper(*args, **kw): + def _wrapper(*args: Any, **kw: Any) -> Any: # singledispatch bases the type on the first arg, which is `self` # in a method. Instead, we need the 3rd argument, skipping over # `self` and `name` in `setElement(self, name, value)` return dispatcher.dispatch(args[arg_index].__class__)(*args, **kw) + # give `_wrapper` a `.register()` attribute - _wrapper.register = dispatcher.register + # pylint: disable=no-member + _wrapper.__setattr__("register", dispatcher.register) # makes `_wrapper` look like `func` with regards to metadata and # attributes update_wrapper(_wrapper, func) @@ -49,8 +59,9 @@ def _wrapper(*args, **kw): return _singleDispatchMethodImpl -class MessageFormatter(): - """ :class:`MessageFormatter` is used to populate/format a message. It + +class MessageFormatter: + """:class:`MessageFormatter` is used to populate/format a message. It supports writing only once to each field. Attempting to set an already set element will fail. @@ -75,24 +86,23 @@ class MessageFormatter(): offset or sub-microsecond precision (e.g. nanoseconds) are not supported. """ - def __init__(self, handle): - """ For internal use only. """ + def __init__(self, handle: BlpapiMessageFormatterHandle) -> None: + """For internal use only.""" self.__handle = handle - def _handle(self): + def _handle(self) -> BlpapiMessageFormatterHandle: return self.__handle - def setElement(self, name, value): - """ Set the element with the specified ``name`` to the specified + def setElement( + self, name: BlpapiNameOrStr, value: SupportedElementTypes + ) -> None: + """Set the element with the specified ``name`` to the specified ``value`` in the current :class:`blpapi.Message` referenced by this :class:`MessageFormatter`. Args: - name (blpapi.Name or str): Identifies the element which will be set - to ``value``. - value (bool or str or int or float or datetime.date or \ - datetime.time or datetime.datetime or blpapi.Name or None): - The value to assign to the specified element. + name: Identifies the element which will be set to ``value``. + value: The value to assign to the specified element. Raises: Exception: An exception is raised if any of the following are true: @@ -102,13 +112,13 @@ def setElement(self, name, value): ``name`` """ if isstr(name): - name = Name(conv2str(name)) + name = Name(conv2str(name)) # type: ignore self._setElement(name, value) # pylint: disable=unused-argument,no-self-use @_singledispatchmethod(2) - def _setElement(self, name, value): - """ Implementation for :meth:`setElement`. + def _setElement(self, name: Name, value: SupportedElementTypes) -> None: + """Implementation for :meth:`setElement`. Args: name (Name): Identifies the element which will be set to ``value`` @@ -123,86 +133,92 @@ def _setElement(self, name, value): - The ``value`` cannot be assigned to the element identified by ``name`` """ - raise TypeError(f"The type of value {value} is not supported. Type" - f" is {type(value)}. Please refer to the" - " documentation for the supported types.") + raise TypeError( + f"The type of value {value} is not supported. Type" + f" is {type(value)}. Please refer to the" + " documentation for the supported types." + ) @_setElement.register(bool) - def _(self, name, value): - """ Dispatch method for setting `bool` types. """ + def _(self, name: Name, value: bool) -> None: + """Dispatch method for setting `bool` types.""" _ExceptionUtil.raiseOnError( internals.blpapi_MessageFormatter_setValueBool( - self.__handle, - get_handle(name), - value)) + self.__handle, get_handle(name), value + ) + ) - @_setElement.register(datetime) # type: ignore + @_setElement.register(datetime) @_setElement.register(date) @_setElement.register(time) - def _(self, name, value): - """ Dispatch method for setting time types. """ + def _(self, name: Name, value: AnyPythonDatetime) -> None: + """Dispatch method for setting time types.""" _ExceptionUtil.raiseOnError( internals.blpapi_MessageFormatter_setValueHighPrecisionDatetime( self.__handle, get_handle(name), - _DatetimeUtil.convertToBlpapi(value))) + _DatetimeUtil.convertToBlpapi(value), + ) + ) @_setElement.register(int) - def _setElementInt(self, name, value): - """ Dispatch method for setting integer types. """ + def _setElementInt(self, name: Name, value: int) -> None: + """Dispatch method for setting integer types.""" if MIN_32BIT_INT <= value <= MAX_32BIT_INT: _ExceptionUtil.raiseOnError( internals.blpapi_MessageFormatter_setValueInt32( - self.__handle, - get_handle(name), - value)) + self.__handle, get_handle(name), value + ) + ) elif MIN_64BIT_INT <= value <= MAX_64BIT_INT: _ExceptionUtil.raiseOnError( internals.blpapi_MessageFormatter_setValueInt64( - self.__handle, - get_handle(name), - value)) + self.__handle, get_handle(name), value + ) + ) else: raise ValueError("Value is out of element's supported range") - @_setElement.register(float) # type: ignore - def _(self, name, value): - """ Dispatch method for setting `float` types. """ + @_setElement.register(float) + def _(self, name: Name, value: float) -> None: + """Dispatch method for setting `float` types.""" _ExceptionUtil.raiseOnError( internals.blpapi_MessageFormatter_setValueFloat( - self.__handle, - get_handle(name), - value)) + self.__handle, get_handle(name), value + ) + ) - @_setElement.register(Name) # type: ignore - def _(self, name, value): - """ Dispatch method for setting `Name` types. """ + @_setElement.register(Name) + def _(self, name: Name, value: Name) -> None: + """Dispatch method for setting `Name` types.""" _ExceptionUtil.raiseOnError( internals.blpapi_MessageFormatter_setValueFromName( - self.__handle, - get_handle(name), - get_handle(value))) + self.__handle, get_handle(name), get_handle(value) + ) + ) - @_setElement.register(type(None)) # type: ignore - def _(self, name, _): - """ Dispatch method for setting `None` types. """ + @_setElement.register(type(None)) + def _(self, name: Name, _: Any) -> None: + """Dispatch method for setting `None` types.""" _ExceptionUtil.raiseOnError( internals.blpapi_MessageFormatter_setValueNull( - self.__handle, - get_handle(name))) + self.__handle, get_handle(name) + ) + ) - def _setElementStr(self, name, value): - """ Dispatch method for setting string types. """ + def _setElementStr(self, name: Name, value: Union[bytes, str]) -> None: + """Dispatch method for setting string types.""" _ExceptionUtil.raiseOnError( internals.blpapi_MessageFormatter_setValueString( - self.__handle, - get_handle(name), - conv2str(value))) + self.__handle, get_handle(name), conv2str(value) + ) + ) + for _str_type in STR_TYPES: _setElement.register(_str_type, _setElementStr) - def pushElement(self, name): - """ Change the level at which this :class:`MessageFormatter` is + def pushElement(self, name: BlpapiNameOrStr) -> None: + """Change the level at which this :class:`MessageFormatter` is operating to the element specified by ``name``. After this returns, the context of the :class:`MessageFormatter` is set @@ -216,24 +232,25 @@ def pushElement(self, name): :meth:`appendElement()` must be used. Args: - name (blpapi.Name or str): Specifies the :class:`blpapi.Element` on - which to operate. The element must identify either a choice, a - sequence or an array at the current level of the schema or the - behavior is undefined. + name: Specifies the :class:`blpapi.Element` on which to operate. + The element must identify either a choice, a sequence or an + array at the current level of the schema or the behavior is + undefined. Raises: Exception: If the ``name`` is invalid for the current message or if the element identified by ``name`` has already been set. """ if isstr(name): - name = Name(conv2str(name)) + name = Name(conv2str(name)) # type: ignore _ExceptionUtil.raiseOnError( internals.blpapi_MessageFormatter_pushElement( - self.__handle, - get_handle(name))) + self.__handle, get_handle(name) # type: ignore + ) + ) - def popElement(self): - """ Undo the most recent call to :meth:`pushElement` or + def popElement(self) -> None: + """Undo the most recent call to :meth:`pushElement` or :meth:`appendElement` on this :class:`MessageFormatter` and return the context of the :class:`MessageFormatter` to where it was before the call to :meth:`pushElement` or :meth:`appendElement`. Once @@ -241,17 +258,16 @@ def popElement(self): re-visit the same context. """ _ExceptionUtil.raiseOnError( - internals.blpapi_MessageFormatter_popElement(self.__handle)) + internals.blpapi_MessageFormatter_popElement(self.__handle) + ) @_singledispatchmethod(1) - def appendValue(self, value): - """ Append the specified ``value`` to the element on which this + def appendValue(self, value: SupportedElementTypes) -> None: + """Append the specified ``value`` to the element on which this :class:`MessageFormatter` is operating. Args: - value (bool or str or int or float or datetime.date or \ - datetime.time or datetime.datetime or blpapi.Name): - The value to append. + value: The value to append. Raises: Exception: If the schema of the message is flat or the current @@ -259,70 +275,79 @@ def appendValue(self, value): """ _ExceptionUtil.raiseOnError( internals.blpapi_MessageFormatter_appendValueString( - self.__handle, - value)) + self.__handle, value + ) + ) - @appendValue.register(bool) # type: ignore - def _(self, value): - """ Dispatch method for appending `bool` types. """ + @appendValue.register(bool) + def _(self, value: bool) -> None: + """Dispatch method for appending `bool` types.""" _ExceptionUtil.raiseOnError( internals.blpapi_MessageFormatter_appendValueBool( - self.__handle, - value)) + self.__handle, value + ) + ) - @appendValue.register(datetime) # type: ignore + @appendValue.register(datetime) @appendValue.register(date) @appendValue.register(time) - def _(self, value): - """ Dispatch method for appending time types. """ + def _(self, value: AnyPythonDatetime) -> None: + """Dispatch method for appending time types.""" _ExceptionUtil.raiseOnError( internals.blpapi_MessageFormatter_appendValueHighPrecisionDatetime( - self.__handle, - _DatetimeUtil.convertToBlpapi(value))) + self.__handle, _DatetimeUtil.convertToBlpapi(value) + ) + ) @appendValue.register(int) - def _appendValueInt(self, value): - """ Dispatch method for appending integer types. """ + def _appendValueInt(self, value: int) -> None: + """Dispatch method for appending integer types.""" if MIN_32BIT_INT <= value <= MAX_32BIT_INT: _ExceptionUtil.raiseOnError( internals.blpapi_MessageFormatter_appendValueInt32( - self.__handle, - value)) + self.__handle, value + ) + ) elif MIN_64BIT_INT <= value <= MAX_64BIT_INT: _ExceptionUtil.raiseOnError( internals.blpapi_MessageFormatter_appendValueInt64( - self.__handle, - value)) + self.__handle, value + ) + ) else: raise ValueError("Value is out of element's supported range") - @appendValue.register(float) # type: ignore - def _(self, value): - """ Dispatch method for appending `float` types. """ + @appendValue.register(float) + def _(self, value: float) -> None: + """Dispatch method for appending `float` types.""" _ExceptionUtil.raiseOnError( internals.blpapi_MessageFormatter_appendValueFloat( - self.__handle, - value)) + self.__handle, value + ) + ) - @appendValue.register(Name) # type: ignore - def _(self, value): - """ Dispatch method for appending `Name` types. """ + @appendValue.register(Name) + def _(self, value: Name) -> None: + """Dispatch method for appending `Name` types.""" _ExceptionUtil.raiseOnError( internals.blpapi_MessageFormatter_appendValueFromName( - self.__handle, - get_handle(value))) + self.__handle, get_handle(value) + ) + ) - def _appendValueStr(self, value): - """ Dispatch method for appending string types. """ + def _appendValueStr(self, value: Union[bytes, str]) -> None: + """Dispatch method for appending string types.""" _ExceptionUtil.raiseOnError( internals.blpapi_MessageFormatter_appendValueString( - self.__handle, - conv2str(value))) + self.__handle, conv2str(value) + ) + ) + for _str_type in STR_TYPES: appendValue.register(_str_type, _appendValueStr) - def appendElement(self): - """ Create an array :class:`blpapi.Element` and append it to the + def appendElement(self) -> None: + """Create an array :class:`blpapi.Element` and append it to the :class:`blpapi.Element` on which this :class:`MessageFormatter` is operating. @@ -333,10 +358,11 @@ def appendElement(self): sequence or a choice. """ _ExceptionUtil.raiseOnError( - internals.blpapi_MessageFormatter_appendElement(self.__handle)) + internals.blpapi_MessageFormatter_appendElement(self.__handle) + ) - def formatMessageJson(self, jsonMessage): - """ Format the :class:`blpapi.Message` from its ``JSON`` representation. + def formatMessageJson(self, jsonMessage: str) -> None: + """Format the :class:`blpapi.Message` from its ``JSON`` representation. Args: jsonMessage (str): A ``JSON``-formatted ``str`` representing the @@ -351,11 +377,12 @@ def formatMessageJson(self, jsonMessage): """ _ExceptionUtil.raiseOnError( internals.blpapi_MessageFormatter_FormatMessageJson( - self.__handle, - jsonMessage)) + self.__handle, jsonMessage + ) + ) - def formatMessageXml(self, xmlMessage): - """ Format the :class:`blpapi.Message` from its ``XML`` representation. + def formatMessageXml(self, xmlMessage: str) -> None: + """Format the :class:`blpapi.Message` from its ``XML`` representation. Args: xmlMessage (str): An ``XML``-formatted ``str`` representing the @@ -370,14 +397,15 @@ def formatMessageXml(self, xmlMessage): """ _ExceptionUtil.raiseOnError( internals.blpapi_MessageFormatter_FormatMessageXml( - self.__handle, - xmlMessage)) + self.__handle, xmlMessage + ) + ) - def formatMessageDict(self, dictMessage): - """ Format the :class:`blpapi.Message` from its ``dict`` representation. + def formatMessageDict(self, dictMessage: dict) -> None: + """Format the :class:`blpapi.Message` from its ``dict`` representation. Args: - dictMessage (dict): A dictionary representing the content used to + dictMessage: A dictionary representing the content used to format the message. Raises: diff --git a/src/blpapi/test/messageproperties.py b/src/blpapi/test/messageproperties.py index 29752e3..27a84de 100644 --- a/src/blpapi/test/messageproperties.py +++ b/src/blpapi/test/messageproperties.py @@ -2,19 +2,22 @@ """ Class for defining properties of mock messages. """ +from typing import Sequence import blpapi from blpapi import internals from blpapi.exception import _ExceptionUtil from blpapi.datetime import _DatetimeUtil +from blpapi import typehints from ..utils import get_handle -class MessageProperties(): + +class MessageProperties: """ This class represents properties of a message that are not part of the message contents, such as the correlation ids or timestamp. """ - def __init__(self): + def __init__(self) -> None: """ Create 'MessageProperties' with default values. @@ -27,47 +30,53 @@ def __init__(self): rc, self.__handle = internals.blpapi_MessageProperties_create() _ExceptionUtil.raiseOnError(rc) - def __del__(self): + def __del__(self) -> None: try: self.destroy() except (NameError, AttributeError): pass - def destroy(self): + def destroy(self) -> None: """Destroy this :class:`MessageProperties`.""" if self.__handle: internals.blpapi_MessageProperties_destroy(self.__handle) self.__handle = None - def setCorrelationIds(self, cids): + def setCorrelationIds( + self, cids: Sequence["typehints.CorrelationId"] + ) -> None: """ Set the `correlationIds` properties of the message. Args: - cids ([blpapi.CorrelationId]): list of correlation ids of the - message. + cids: list of correlation ids of the message. """ errorCode = internals.blpapi_MessageProperties_setCorrelationIds( - self.__handle, list(cids)) + self.__handle, list(cids) + ) _ExceptionUtil.raiseOnError(errorCode) - def setRecapType(self, recapType, - fragmentType=blpapi.Message.FRAGMENT_NONE): + def setRecapType( + self, + recapType: int, + fragmentType: int = blpapi.Message.FRAGMENT_NONE, # type: ignore + ) -> None: """ Set the `recapType` and `fragmentType` properties of the message. Args: - recapType (int): Recap type of the message. See - :class:`blpapi.Message` for valid values. - fragmentType (int): Optional. Fragment type of the message. See + recapType: Recap type of the message. See :class:`blpapi.Message` + for valid values. + fragmentType: Optional. Fragment type of the message. See :class:`blpapi.Message` for valid values. The default value is ``blpapi.Message.FRAGMENT_NONE``. """ errorCode = internals.blpapi_MessageProperties_setRecapType( - self.__handle, recapType, fragmentType) + self.__handle, recapType, fragmentType + ) _ExceptionUtil.raiseOnError(errorCode) - def setTimeReceived(self, timestamp): + def setTimeReceived(self, timestamp: typehints.AnyPythonDatetime) -> None: """ Set the `timeReceived` property of the message. @@ -76,10 +85,11 @@ def setTimeReceived(self, timestamp): """ ts = _DatetimeUtil.convertToBlpapi(timestamp) errorCode = internals.blpapi_MessageProperties_setTimeReceived( - self.__handle, ts) + self.__handle, ts + ) _ExceptionUtil.raiseOnError(errorCode) - def setRequestId(self, requestId): + def setRequestId(self, requestId: str) -> None: """ Set the `requestId` property. A copy of this string is expected to be returned @@ -90,11 +100,11 @@ def setRequestId(self, requestId): requestId (str): RequestId of the message. """ errorCode = internals.blpapi_MessageProperties_setRequestId( - self.__handle, requestId) + self.__handle, requestId + ) _ExceptionUtil.raiseOnError(errorCode) - - def setService(self, service): + def setService(self, service: "typehints.Service") -> None: """ Set the `service` property of the message. @@ -102,10 +112,11 @@ def setService(self, service): service (blpapi.Service): Service of the message. """ errorCode = internals.blpapi_MessageProperties_setService( - self.__handle, get_handle(service)) + self.__handle, get_handle(service) + ) _ExceptionUtil.raiseOnError(errorCode) - def _handle(self): + def _handle(self) -> typehints.BlpapiMessagePropertiesHandle: """For internal use only.""" return self.__handle diff --git a/src/blpapi/test/testutil.py b/src/blpapi/test/testutil.py index 7f3ff80..909c294 100644 --- a/src/blpapi/test/testutil.py +++ b/src/blpapi/test/testutil.py @@ -4,24 +4,25 @@ create events/messages for unit-testing their applications. """ +from typing import Optional from blpapi import internals from blpapi import Event, Name, SchemaElementDefinition, Service, Topic from blpapi.exception import _ExceptionUtil from blpapi.utils import conv2str, get_handle, isstr from blpapi.test import MessageProperties, MessageFormatter +from blpapi.typehints import BlpapiNameOrStr -def createEvent(eventType): - """ Create an :class:`blpapi.Event` with the specified ``eventType`` to be +def createEvent(eventType: int) -> Event: + """Create an :class:`blpapi.Event` with the specified ``eventType`` to be used for testing. Args: - eventType (int): Specifies the type of event. See :class:`blpapi.Event` + eventType: Specifies the type of event. See :class:`blpapi.Event` for a list of enumerated values (e.g., `Event.SUBSCRIPTION_DATA`). Returns: - blpapi.Event: An event used for testing. It cannot be used for - publishing. + An event used for testing. It cannot be used for publishing. The behavior is undefined if :class:`blpapi.EventFormatter` is used with the returned :class:`blpapi.Event`. @@ -31,22 +32,24 @@ def createEvent(eventType): event = Event(event_handle, sessions=None) return event -def appendMessage(event, elementDef, properties=None): - """ Create a new message and append it to the specified ``event``. + +def appendMessage( + event: Event, + elementDef: SchemaElementDefinition, + properties: Optional[MessageProperties] = None, +) -> MessageFormatter: + """Create a new message and append it to the specified ``event``. Return a :class:`MessageFormatter` to format the last appended message. Args: - event (blpapi.Event): The ``event`` to which the new message will - be appended. The ``event`` must be a test :class:`blpapi.Event` - created by :meth:`createEvent()`. - elementDef (blpapi.SchemaElementDefinition): Used to verify and encode - the contents of the message. - properties (blpapi.test.MessageProperties): Used to set the metadata - properties for the message. + event: The ``event`` to which the new message will be appended. The + ``event`` must be a test :class:`blpapi.Event` created by + :meth:`createEvent()`. + elementDef: Used to verify and encode the contents of the message. + properties: Used to set the metadata properties for the message. Returns: - blpapi.test.MessageFormatter: The :class:`MessageFormatter` used to - format the last appended message. + The :class:`MessageFormatter` used to format the last appended message. Raises: Exception: If the method fails to append the message. @@ -55,95 +58,104 @@ def appendMessage(event, elementDef, properties=None): properties = MessageProperties() rc, formatter_handle = internals.blpapi_TestUtil_appendMessage( get_handle(event), - get_handle(elementDef), - get_handle(properties)) + get_handle(elementDef), # type: ignore + get_handle(properties), # type: ignore + ) _ExceptionUtil.raiseOnError(rc) message_formatter = MessageFormatter(formatter_handle) return message_formatter -def deserializeService(serviceXMLStr): - """ Create a :class:`blpapi.Service` instance from the specified + +def deserializeService(serviceXMLStr: str) -> Service: + """Create a :class:`blpapi.Service` instance from the specified ``serviceXMLStr``. Args: - serviceXMLStr (str): A ``str`` representation of a + serviceXMLStr: A ``str`` representation of a :class:`blpapi.Service` in ``XML`` format. The ``str`` should only contain ASCII characters without any embedded ``null`` characters. Returns: - blpapi.Service: A :class:`blpapi.Service` created from - ``serviceXMLStr``. + A :class:`blpapi.Service` created from ``serviceXMLStr``. Raises: Exception: If deserialization fails. """ rc, service_handle = internals.blpapi_TestUtil_deserializeService( - serviceXMLStr, - len(serviceXMLStr)) + serviceXMLStr, len(serviceXMLStr) + ) _ExceptionUtil.raiseOnError(rc) - service = Service(service_handle, sessions=None) + service = Service(service_handle, set()) return service -def serializeService(service): - """ Serialize the provided ``service`` in ``XML`` format. + +def serializeService(service: Service) -> str: + """Serialize the provided ``service`` in ``XML`` format. Args: - service (blpapi.Service): The :class:`blpapi.Service` to be serialized. + service: The :class:`blpapi.Service` to be serialized. Returns: - str: The ``service`` represented as an ``XML`` formatted ``str``. + The ``service`` represented as an ``XML`` formatted ``str``. Raises: Exception: If the service can't be serialized successfully. """ service_str = internals.blpapi_TestUtil_serializeServiceHelper( - get_handle(service)) + get_handle(service) + ) return service_str -def createTopic(service, isActive=True): - """ Create a valid :class:`blpapi.Topic` with the specified ``service`` to + +def createTopic(service: Service, isActive: bool = True) -> Topic: + """Create a valid :class:`blpapi.Topic` with the specified ``service`` to support testing publishers. The expected use case is to support returning a custom :class:`blpapi.Topic` while mocking :meth:`blpapi.ProviderSession.getTopic()` methods. Args: - service (blpapi.Service): The :class:`blpapi.Service` to which the - returned :class:`blpapi.Topic` will belong. - isActive (bool): Optional. Specifies whether the returned + service: The :class:`blpapi.Service` to which the returned + :class:`blpapi.Topic` will belong. + isActive: Optional. Specifies whether the returned :class:`blpapi.Topic` is active. Returns: - blpapi.Topic: A valid :class:`blpapi.Topic` with the specified - ``service``. + A valid :class:`blpapi.Topic` with the specified ``service``. """ rc, topic_handle = internals.blpapi_TestUtil_createTopic( - get_handle(service), - isActive) + get_handle(service), isActive + ) _ExceptionUtil.raiseOnError(rc) - topic = Topic(topic_handle, sessions=None) + topic = Topic(topic_handle, sessions=set()) return topic -def getAdminMessageDefinition(messageName): - """ Return the definition for an admin message of the specified + +def getAdminMessageDefinition( + messageName: BlpapiNameOrStr, +) -> SchemaElementDefinition: + """Return the definition for an admin message of the specified ``messageName``. Args: - messageName (blpapi.Name or str): The name of the desired admin message. + messageName: The name of the desired admin message. Returns: - blpapi.SchemaElementDefinition: The element definition for the message - specified by ``messageName``. + The element definition for the message specified by ``messageName``. Raises: Exception: If ``messageName`` does not name an admin message. """ if isstr(messageName): - messageName = Name(conv2str(messageName)) - rc, schema_element_definition_handle = \ - internals.blpapi_TestUtil_getAdminMessageDefinition( - get_handle(messageName)) + messageName = Name(conv2str(messageName)) # type: ignore + ( + rc, + schema_element_definition_handle, + ) = internals.blpapi_TestUtil_getAdminMessageDefinition( + get_handle(messageName) # type: ignore + ) _ExceptionUtil.raiseOnError(rc) - schema_definition = \ - SchemaElementDefinition(schema_element_definition_handle, sessions=None) + schema_definition = SchemaElementDefinition( + schema_element_definition_handle, set() + ) return schema_definition diff --git a/src/blpapi/topic.py b/src/blpapi/topic.py index b181157..be814e5 100644 --- a/src/blpapi/topic.py +++ b/src/blpapi/topic.py @@ -4,10 +4,10 @@ This component provides a topic that is used for publishing data on. """ -from typing import Set +from typing import Any, Set, Optional from .typehints import BlpapiTopicHandle from . import internals -from . import typehints # pylint: disable=unused-import +from . import typehints # pylint: disable=unused-import from .service import Service from .utils import get_handle from .chandle import CHandle @@ -22,9 +22,11 @@ class Topic(CHandle): :class:`EventFormatter`. """ - def __init__(self, - handle: BlpapiTopicHandle, - sessions: Set["typehints.AbstractSession"]): + def __init__( + self, + handle: Optional[BlpapiTopicHandle] = None, + sessions: Optional[Set["typehints.AbstractSession"]] = None, + ): """Create a :class:`Topic` object. Args: @@ -39,7 +41,7 @@ def __init__(self, selfhandle = internals.blpapi_Topic_create(handle) super(Topic, self).__init__(selfhandle, internals.blpapi_Topic_destroy) self.__handle = selfhandle - self.__sessions = sessions + self.__sessions = sessions if sessions is not None else set() def isValid(self) -> bool: """ @@ -57,23 +59,29 @@ def isActive(self) -> bool: """ return bool(internals.blpapi_Topic_isActive(self.__handle)) - def service(self) -> "typehints.Service": # type: ignore + def service(self) -> "typehints.Service": """ Returns: Service: The service for which this topic was created. """ - return Service(internals.blpapi_Topic_service(self.__handle), - self.__sessions) + return Service( + internals.blpapi_Topic_service(self.__handle), self.__sessions + ) def __lt__(self, other: "typehints.Topic") -> bool: """2-way comparison of Topic objects.""" - return internals.blpapi_Topic_compare( - self.__handle, get_handle(other)) < 0 + return ( + internals.blpapi_Topic_compare(self.__handle, get_handle(other)) + < 0 + ) - def __eq__(self, other) -> bool: + def __eq__(self, other: Any) -> bool: """2-way comparison of Topic objects.""" - return internals.blpapi_Topic_compare( - self.__handle, get_handle(other)) == 0 + return ( + internals.blpapi_Topic_compare(self.__handle, get_handle(other)) + == 0 + ) + __copyright__ = """ Copyright 2012. Bloomberg Finance L.P. diff --git a/src/blpapi/topiclist.py b/src/blpapi/topiclist.py index 8f18132..b865948 100644 --- a/src/blpapi/topiclist.py +++ b/src/blpapi/topiclist.py @@ -14,7 +14,7 @@ from .utils import get_handle from .internals import CorrelationId from .chandle import CHandle -from . import typehints # pylint: disable=unused-import +from . import typehints # pylint: disable=unused-import # pylint: disable=protected-access @@ -31,9 +31,9 @@ class TopicList(CHandle, metaclass=utils.MetaClassForClassesWithEnums): :meth:`~ProviderSession.createTopics()` call. """ - NOT_CREATED = internals.TOPICLIST_NOT_CREATED # type: ignore - CREATED = internals.TOPICLIST_CREATED # type: ignore - FAILURE = internals.TOPICLIST_FAILURE # type: ignore + NOT_CREATED = internals.TOPICLIST_NOT_CREATED + CREATED = internals.TOPICLIST_CREATED + FAILURE = internals.TOPICLIST_FAILURE def __init__(self, original: Optional[ResolutionList] = None) -> None: """Create an empty :class:`TopicList`, or a :class:`TopicList` based on @@ -53,23 +53,27 @@ def __init__(self, original: Optional[ResolutionList] = None) -> None: :class:`TopicList` also changes because owns the same handle. """ if isinstance(original, ResolutionList): - selfhandle = \ - internals.blpapi_TopicList_createFromResolutionList( - get_handle(original)) + selfhandle = internals.blpapi_TopicList_createFromResolutionList( + get_handle(original) + ) self.__sessions = original._sessions() elif original is not None: raise TypeError( - "'original' should be an instance of 'ResolutionList'") + "'original' should be an instance of 'ResolutionList'" + ) else: selfhandle = internals.blpapi_TopicList_create(None) self.__sessions = set() super(TopicList, self).__init__( - selfhandle, internals.blpapi_TopicList_destroy) + selfhandle, internals.blpapi_TopicList_destroy + ) self.__handle = selfhandle - def add(self, - topicOrMessage: Union[str, Message], - correlationId: Optional[CorrelationId] = None) -> int: + def add( + self, + topicOrMessage: Union[str, Message], + correlationId: Optional[CorrelationId] = None, + ) -> int: """Add the specified topic or topic from message to this :class:`TopicList`. @@ -100,16 +104,15 @@ def add(self, correlationId = CorrelationId() if not isinstance(correlationId, CorrelationId): raise TypeError( - "correlationId should be an instance of 'CorrelationId'") + "correlationId should be an instance of 'CorrelationId'" + ) if isinstance(topicOrMessage, Message): return internals.blpapi_TopicList_addFromMessage( - self.__handle, - get_handle(topicOrMessage), - correlationId) + self.__handle, get_handle(topicOrMessage), correlationId + ) return internals.blpapi_TopicList_add( - self.__handle, - topicOrMessage, - correlationId) + self.__handle, topicOrMessage, correlationId + ) def correlationIdAt(self, index: int) -> CorrelationId: """ @@ -123,8 +126,8 @@ def correlationIdAt(self, index: int) -> CorrelationId: Exception: If ``index >= size()``. """ errorCode, cid = internals.blpapi_TopicList_correlationIdAt( - self.__handle, - index) + self.__handle, index + ) _ExceptionUtil.raiseOnError(errorCode) return cid @@ -142,8 +145,8 @@ def topicString(self, correlationId: CorrelationId) -> str: this list. """ errorCode, topic = internals.blpapi_TopicList_topicString( - self.__handle, - correlationId) + self.__handle, correlationId + ) _ExceptionUtil.raiseOnError(errorCode) return topic @@ -159,8 +162,8 @@ def topicStringAt(self, index: int) -> str: Exception: If ``index >= size()``. """ errorCode, topic = internals.blpapi_TopicList_topicStringAt( - self.__handle, - index) + self.__handle, index + ) _ExceptionUtil.raiseOnError(errorCode) return topic @@ -180,8 +183,8 @@ def status(self, correlationId: CorrelationId) -> int: this list. """ errorCode, status = internals.blpapi_TopicList_status( - self.__handle, - correlationId) + self.__handle, correlationId + ) _ExceptionUtil.raiseOnError(errorCode) return status @@ -198,8 +201,8 @@ def statusAt(self, index: int) -> int: Exception: If ``index >= size()``. """ errorCode, status = internals.blpapi_TopicList_statusAt( - self.__handle, - index) + self.__handle, index + ) _ExceptionUtil.raiseOnError(errorCode) return status @@ -215,15 +218,14 @@ def message(self, correlationId: CorrelationId) -> Message: Raises: Exception: If ``correlationId`` does not identify an entry in this - :class:`TopicList` or if the status of the entry identified by - ``correlationId`` is not :attr:`CREATED`. + :class:`TopicList`. The message returned can be used when creating an instance of :class:`Topic`. """ errorCode, message = internals.blpapi_TopicList_message( - self.__handle, - correlationId) + self.__handle, correlationId + ) _ExceptionUtil.raiseOnError(errorCode) return Message(message, sessions=self._sessions()) @@ -237,15 +239,14 @@ def messageAt(self, index: int) -> Message: ``index``. Raises: - Exception: If ``index >= size()`` or if the status of the entry - identify by ``correlationId`` is not :attr:`CREATED`. + Exception: If ``index >= size()``. The message returned can be used when creating an instance of :class:`Topic`. """ errorCode, message = internals.blpapi_TopicList_messageAt( - self.__handle, - index) + self.__handle, index + ) _ExceptionUtil.raiseOnError(errorCode) return Message(message, sessions=self._sessions()) @@ -265,6 +266,7 @@ def _addSession(self, session: "typehints.AbstractSession") -> None: For internal use.""" self.__sessions.add(session) + __copyright__ = """ Copyright 2012. Bloomberg Finance L.P. diff --git a/src/blpapi/typehints.py b/src/blpapi/typehints.py index 6c263b6..cc2f9ad 100644 --- a/src/blpapi/typehints.py +++ b/src/blpapi/typehints.py @@ -3,6 +3,7 @@ """Type definitions for common type hints""" from typing import TYPE_CHECKING + if TYPE_CHECKING: from blpapi import AbstractSession from blpapi import AuthOptions @@ -32,23 +33,30 @@ AnyPythonDatetime = Union[datetime.datetime, datetime.date, datetime.time] BlpapiNameOrStr = Union[str, "Name", bytes] BlpapiNameOrStrOrIndex = Union[str, "Name", bytes, int] -SupportedElementTypes = Union[BlpapiNameOrStr, bool, int, float, - AnyPythonDatetime, None] +SupportedElementTypes = Union[ + BlpapiNameOrStr, bool, int, float, AnyPythonDatetime, None +] # placeholders for opaque handles BlpapiAbstractSessionHandle = Any BlpapiAuthOptionsHandle = Any +BlpapiAuthAppHandle = Any +BlpapiAuthTokenHandle = Any BlpapiAuthUserHandle = Any BlpapiConstantHandle = Any BlpapiConstantListHandle = Any -BlpapiDatetime = Union[Any, "blpapi_HighPrecisionDatetime_tag"] # type: ignore +BlpapiDatetime = Union[Any, "blpapi_HighPrecisionDatetime_tag"] # type: ignore BlpapiElementHandle = Any BlpapiEventHandle = Any BlpapiIdentityHandle = Any BlpapiMessageHandle = Any +BlpapiMessageFormatterHandle = Any +BlpapiMessagePropertiesHandle = Any BlpapiNameHandle = Any BlpapiOperationHandle = Any BlpapiProviderSessionHandle = Any BlpapiRequestHandle = Any +BlpapiRequestTemplateHandle = Any +BlpapiSchemaHandle = Any BlpapiSchemaElementDefinitionHandle = Any BlpapiSchemaTypeDefinitionHandle = Any BlpapiServiceHandle = Any diff --git a/src/blpapi/utils.py b/src/blpapi/utils.py index 84d5e77..e4b7d1a 100644 --- a/src/blpapi/utils.py +++ b/src/blpapi/utils.py @@ -44,11 +44,12 @@ def eventDefinitions(self): """ - def __init__(self, - objToIterate: Any, - numFunc: Callable[[Any], int], - getFunc: Callable[[Any, int], Any] - ) -> None: + def __init__( + self, + objToIterate: Any, + numFunc: Callable[[Any], int], + getFunc: Callable[[Any, int], Any], + ) -> None: self.__obj = objToIterate self.__index = 0 self.__num = numFunc(objToIterate) @@ -76,8 +77,7 @@ class MetaClassForClassesWithEnums(type): """ class EnumError(TypeError): - """Raise this on attempt to change value of an enumeration constant. - """ + """Raise this on attempt to change value of an enumeration constant.""" def __setattr__(cls, name: str, value: Any) -> None: """Change the value of an attribute if it is not an enum. @@ -97,9 +97,12 @@ def __delattr__(cls, name: str) -> None: raise cls.EnumError(f"Can't unbind enum {name}") type.__delattr__(cls, name) + def get_handle(thing: Optional[CHandle]) -> Any: """Returns the result of thing._handle() or None if thing is None""" - return None if thing is None else thing._handle() #pylint: disable=protected-access + # pylint: disable=protected-access + return None if thing is None else thing._handle() + def invoke_if_valid(cb: Any, value: Any) -> Any: """Returns the result of cb(value) if cb is callable, else -- just value""" @@ -107,8 +110,9 @@ def invoke_if_valid(cb: Any, value: Any) -> Any: return value return cb(value) + def deprecated(func_or_reason: Union[Callable, str]) -> Callable: - ''' + """ This is a decorator which can be used to mark classes or functions as deprecated. It results in a warning being emitted when the class or the function is called. @@ -130,25 +134,25 @@ class OldClass: @deprecated("use another function") def old_function(self, msg); print(msg) - ''' + """ is_func = callable(func_or_reason) message = "see docstring for details." if is_func else func_or_reason - def decorate(func): - + def decorate(func: Callable) -> Callable: @functools.wraps(func) - def wrap_func(*args, **kwargs): + def wrap_func(*args: Any, **kwargs: Any) -> Any: warnings.warn( f"{func.__name__} is deprecated, {message}.", category=DeprecationWarning, - stacklevel=2) + stacklevel=2, + ) return func(*args, **kwargs) return wrap_func if is_func: - return decorate(func_or_reason) + return decorate(func_or_reason) # type: ignore return decorate diff --git a/src/blpapi/version.py b/src/blpapi/version.py index c7ffbd7..67974c8 100644 --- a/src/blpapi/version.py +++ b/src/blpapi/version.py @@ -4,7 +4,7 @@ from . import versionhelper -__version__ = "3.18.0" +__version__ = "3.18.2" def print_version() -> None: diff --git a/src/blpapi/zfputil.py b/src/blpapi/zfputil.py index 2f05408..5a589dc 100644 --- a/src/blpapi/zfputil.py +++ b/src/blpapi/zfputil.py @@ -23,7 +23,7 @@ """ from . import utils from . import internals -from . import typehints # pylint: disable=unused-import +from . import typehints # pylint: disable=unused-import from .exception import _ExceptionUtil from .sessionoptions import SessionOptions @@ -47,13 +47,13 @@ class ZfpUtil(metaclass=utils.MetaClassForClassesWithEnums): session.start() """ - REMOTE_8194 = internals.ZFPUTIL_REMOTE_8194 # type: ignore - REMOTE_8196 = internals.ZFPUTIL_REMOTE_8196 # type: ignore + REMOTE_8194 = internals.ZFPUTIL_REMOTE_8194 + REMOTE_8196 = internals.ZFPUTIL_REMOTE_8196 @staticmethod - def getZfpOptionsForLeasedLines(remote: int, - tlsOptions: "typehints.TlsOptions" - ) -> "typehints.SessionOptions": + def getZfpOptionsForLeasedLines( + remote: int, tlsOptions: "typehints.TlsOptions" + ) -> "typehints.SessionOptions": """Creates a :class:`SessionOptions` object for applications that leverage private leased lines to the Bloomberg network. @@ -80,11 +80,13 @@ def getZfpOptionsForLeasedLines(remote: int, err = internals.blpapi_ZfpUtil_getOptionsForLeasedLines( utils.get_handle(sessionOptions), utils.get_handle(tlsOptions), - remote) + remote, + ) _ExceptionUtil.raiseOnError(err) return sessionOptions + __copyright__ = """ Copyright 2019. Bloomberg Finance L.P. From b5b65ed6dce3800dbc5afdd1ee7135af2dce91a3 Mon Sep 17 00:00:00 2001 From: Marland Sitt Date: Wed, 10 Aug 2022 13:20:19 -0700 Subject: [PATCH 12/23] Bump to v3.18.3 --- PKG-INFO | 2 +- README.md | 4 ++-- changelog.txt | 4 ++++ src/blpapi.egg-info/PKG-INFO | 2 +- src/blpapi/version.py | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/PKG-INFO b/PKG-INFO index 769baae..a0f3d92 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: blpapi -Version: 3.18.2 +Version: 3.18.3 Summary: Python SDK for Bloomberg BLPAPI Home-page: http://www.bloomberglabs.com/api/ Author: Bloomberg L.P. diff --git a/README.md b/README.md index 66d4872..825c2cd 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,8 @@ [![ARTA tests and coverage](https://badges.dev.bloomberg.com/badge//ARTA%20tests%20and%20coverage/blue?icon=codecov "ARTA tests and coverage")](https://bbgithub.dev.bloomberg.com/apisdk/arta-jaas-dailies/blob/main/README.md) -[![blpapi python documentation (main branch)](https://badges.dev.bloomberg.com/badge//blpapi%20python%20documentation%20(main%20branch)/blue?icon=fa-book "blpapi python documentation (main branch)")](https://rdp.jaas.dev.bloomberg.com/job/apisdk/job/blpapi-py/job/main/lastCompletedBuild/blpapi_20Python_20documentation/) -[![blpapi documentation (release)](https://badges.dev.bloomberg.com/badge//blpapi%20documentation%20(release)/blue?icon=fa-book "blpapi documentation (release)")](https://bloomberg.github.io/blpapi-docs/) +[![blpapi python docs](https://rdp.jaas.dev.bloomberg.com/job/apisdk/job/blpapi-py/job/main/lastCompletedBuild/artifact/blpapi_python_docs-badge.svg 'blpapi python docs apisdk/blpapi-py/main')](http://static-html-server.rdpsdk.ob1.bcc.bloomberg.com:8080/blpapi-docs/apisdk/blpapi-py/main/html) +[![blpapi release docs](https://badges.dev.bloomberg.com/badge/blpapi%20docs/release/blue?icon=fa-book "blpapi release docs")](https://bloomberg.github.io/blpapi-docs/) This directory contains an interface for interacting with Bloomberg API services using the Python programming language. This package is the source diff --git a/changelog.txt b/changelog.txt index d717706..6911376 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,7 @@ +Version 3.18.3: +=============== +- Stability and performance improvements + Version 3.18.2: =============== - Stability and performance improvements diff --git a/src/blpapi.egg-info/PKG-INFO b/src/blpapi.egg-info/PKG-INFO index 769baae..a0f3d92 100644 --- a/src/blpapi.egg-info/PKG-INFO +++ b/src/blpapi.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: blpapi -Version: 3.18.2 +Version: 3.18.3 Summary: Python SDK for Bloomberg BLPAPI Home-page: http://www.bloomberglabs.com/api/ Author: Bloomberg L.P. diff --git a/src/blpapi/version.py b/src/blpapi/version.py index 67974c8..c042efe 100644 --- a/src/blpapi/version.py +++ b/src/blpapi/version.py @@ -4,7 +4,7 @@ from . import versionhelper -__version__ = "3.18.2" +__version__ = "3.18.3" def print_version() -> None: From 5933c5633ce187f792960990088f4780054f6e5b Mon Sep 17 00:00:00 2001 From: Marland Sitt Date: Tue, 6 Dec 2022 15:06:08 -0800 Subject: [PATCH 13/23] Bump to v3.19.1 --- PKG-INFO | 2 +- README.md | 12 - changelog.txt | 24 ++ .../demoapps/BroadcastPublisherExample.py | 26 +- ...mentsVerificationRequestResponseExample.py | 14 +- ...tlementsVerificationSubscriptionExample.py | 5 +- examples/demoapps/GenerateTokenExample.py | 4 +- .../demoapps/InteractivePublisherExample.py | 99 +++-- .../MultipleRequestsOverrideExample.py | 4 +- examples/demoapps/RequestResponseExample.py | 7 +- .../demoapps/RequestServiceConsumerExample.py | 2 +- examples/demoapps/SecurityLookupExample.py | 2 +- .../SubscriptionWithEventPollingExample.py | 4 +- examples/demoapps/UserModeExample.py | 14 +- .../snippets/apiflds/ApiFieldsRequestUtils.py | 21 +- .../apiflds/CategorizedFieldSearchRequests.py | 30 +- .../snippets/apiflds/FieldInfoRequests.py | 12 +- .../snippets/apiflds/FieldListRequests.py | 12 +- .../snippets/apiflds/FieldSearchRequests.py | 21 +- .../requestresponse/HistoricalDataRequest.py | 27 +- .../requestresponse/IntradayBarRequests.py | 42 +- .../requestresponse/IntradayTickRequests.py | 33 +- .../requestresponse/ReferenceDataRequests.py | 40 +- .../market-data-notifier/src/authorizer.py | 3 +- .../src/event_processor.py | 3 +- .../src/token_generator.py | 4 +- .../tests/test_authorizer.py | 2 +- .../tests/test_eventprocessor.py | 4 +- .../tests/test_tokengenerator.py | 4 +- .../snippets/resolver/resolverutils.py | 6 +- .../snippets/resolver/test_resolverutils.py | 10 +- examples/unittests/snippets/test_events.py | 82 ++-- src/blpapi.egg-info/PKG-INFO | 2 +- src/blpapi/constant.py | 5 +- src/blpapi/element.py | 161 ++++++-- src/blpapi/eventformatter.py | 86 +++- src/blpapi/internals.py | 21 + src/blpapi/internals_wrap.c | 377 +++++++++++++++++- src/blpapi/message.py | 84 +++- src/blpapi/name.py | 24 +- src/blpapi/request.py | 51 ++- src/blpapi/schema.py | 16 +- src/blpapi/service.py | 26 +- src/blpapi/test/messageformatter.py | 51 ++- src/blpapi/test/testutil.py | 14 +- src/blpapi/typehints.py | 5 +- src/blpapi/utils.py | 2 +- src/blpapi/version.py | 2 +- 48 files changed, 1156 insertions(+), 346 deletions(-) diff --git a/PKG-INFO b/PKG-INFO index a0f3d92..a05792a 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: blpapi -Version: 3.18.3 +Version: 3.19.1 Summary: Python SDK for Bloomberg BLPAPI Home-page: http://www.bloomberglabs.com/api/ Author: Bloomberg L.P. diff --git a/README.md b/README.md index 825c2cd..6b1d500 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,5 @@ # Bloomberg Python API -[![Build Status](https://rdp.jaas.dev.bloomberg.com/buildStatus/icon?job=apisdk%2Fblpapi-py%2Fmain)](https://rdp.jaas.dev.bloomberg.com/job/apisdk/job/blpapi-py/job/main/) -[![failed/skipped/total unit tests](https://rdp.jaas.dev.bloomberg.com/job/apisdk/job/blpapi-py/job/main/lastCompletedBuild/artifact/failed_skipped_total_unit_tests-badge.svg 'apisdk/blpapi-py/main failed/skipped/total unit tests')](https://rdp.jaas.dev.bloomberg.com/job/apisdk/job/blpapi-py/job/main/lastCompletedBuild/testReport/) - -[![python coverage](https://rdp.jaas.dev.bloomberg.com/job/apisdk/job/blpapi-py/job/main/lastCompletedBuild/artifact/python_coverage-badge.svg 'apisdk/blpapi-py/main python coverage')](https://rdp.jaas.dev.bloomberg.com/job/apisdk/job/blpapi-py/job/main/lastCompletedBuild/cobertura/) -[![c/c++ swig coverage](https://rdp.jaas.dev.bloomberg.com/job/apisdk/job/blpapi-py/job/main/lastCompletedBuild/artifact/c_c++_swig_coverage-badge.svg 'apisdk/blpapi-py/main c/c++ swig coverage')](https://rdp.jaas.dev.bloomberg.com/job/apisdk/job/blpapi-py/job/main/lastCompletedBuild/HTML_20Coverage_20Report_20_28c_2fc_2b_2b_20swig_29/) -[![c/c++ blpapi coverage](https://rdp.jaas.dev.bloomberg.com/job/apisdk/job/blpapi-py/job/main/lastCompletedBuild/artifact/c_c++_blpapi_coverage-badge.svg 'apisdk/blpapi-py/main c/c++ blpapi coverage')](https://rdp.jaas.dev.bloomberg.com/job/apisdk/job/blpapi-py/job/main/lastCompletedBuild/HTML_20Coverage_20Report_20_28c_2fc_2b_2b_20blpapi_29/) - -[![ARTA tests and coverage](https://badges.dev.bloomberg.com/badge//ARTA%20tests%20and%20coverage/blue?icon=codecov "ARTA tests and coverage")](https://bbgithub.dev.bloomberg.com/apisdk/arta-jaas-dailies/blob/main/README.md) - -[![blpapi python docs](https://rdp.jaas.dev.bloomberg.com/job/apisdk/job/blpapi-py/job/main/lastCompletedBuild/artifact/blpapi_python_docs-badge.svg 'blpapi python docs apisdk/blpapi-py/main')](http://static-html-server.rdpsdk.ob1.bcc.bloomberg.com:8080/blpapi-docs/apisdk/blpapi-py/main/html) -[![blpapi release docs](https://badges.dev.bloomberg.com/badge/blpapi%20docs/release/blue?icon=fa-book "blpapi release docs")](https://bloomberg.github.io/blpapi-docs/) - This directory contains an interface for interacting with Bloomberg API services using the Python programming language. This package is the source installer, and requires a C/C++ compilation environment compatible with diff --git a/changelog.txt b/changelog.txt index 6911376..efa306c 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,27 @@ +Version 3.19.1: +=============== +- Stability and performance improvements + +Version 3.19.0: +=============== +- Add complete support for elements with bytearray data types ('bytes') + 'EventFormatter.setValue(Name, bytes)' can now be used to set elements + of type Bytearray and the value of these elements are retrievable via + 'Message.getElementAsBytes(Name)' or 'Element.getElementAsBytes(Name)' + or 'Element.getValueAsBytes()'. + +- Encourage usage of 'Name' in setters and getters taking the 'name' argument by string + Developers are encouraged to prefer 'Name' type parameter for methods + that accept either 'Name' or 'str' as the use of 'Name' is more + performant and functionally equivalent to 'str'. + + This recommendation is enforced for clients with strict type check enabled. + + Classes with such methods include 'Element', 'EventFormatter', 'Message', + 'MessageFormatter', 'Request', 'Service', 'Name' and 'Schema'. + +- Stability and performance improvements + Version 3.18.3: =============== - Stability and performance improvements diff --git a/examples/demoapps/BroadcastPublisherExample.py b/examples/demoapps/BroadcastPublisherExample.py index e9c75b4..7061998 100644 --- a/examples/demoapps/BroadcastPublisherExample.py +++ b/examples/demoapps/BroadcastPublisherExample.py @@ -13,6 +13,16 @@ DEFAULT_MARKET_DATA_TOPIC = "IBM Equity" DEFAULT_PAGE_TOPIC = "1245/4/5" +MARKET_DATA_EVENTS = blpapi.Name("MarketDataEvents") +HIGH = blpapi.Name("HIGH") +LOW = blpapi.Name("LOW") +MESSAGE_TYPE_ROW_UPDATE = blpapi.Name("RowUpdate") +ROW_NUM = blpapi.Name("rowNum") +SPAN_UPDATE = blpapi.Name("spanUpdate") +START_COL = blpapi.Name("startCol") +LENGTH = blpapi.Name("length") +TEXT = blpapi.Name("text") + class MyStream(object): def __init__(self, sid=""): @@ -106,10 +116,6 @@ def formatMarketData(eventFormatter, topic): # format an `Event`. For an example of formatting an `Event` using the # `Element`-based` interface of `EventFormatter`, see # `InteractivePublisherExample.formatMarketDataEvent`. - MARKET_DATA_EVENTS = blpapi.Name("MarketDataEvents") - HIGH = blpapi.Name("HIGH") - LOW = blpapi.Name("LOW") - eventFormatter.appendMessage(MARKET_DATA_EVENTS, topic) secondsStr = time.strftime("%S", time.localtime()) @@ -126,14 +132,14 @@ def formatPageData(eventFormatter, topic): # `InteractivePublisherExample.formatPageEvent`. numRows = 5 for i in range(1, numRows + 1): - eventFormatter.appendMessage("RowUpdate", topic) - eventFormatter.setElement("rowNum", i) - eventFormatter.pushElement("spanUpdate") + eventFormatter.appendMessage(MESSAGE_TYPE_ROW_UPDATE, topic) + eventFormatter.setElement(ROW_NUM, i) + eventFormatter.pushElement(SPAN_UPDATE) eventFormatter.appendElement() - eventFormatter.setElement("startCol", 1) + eventFormatter.setElement(START_COL, 1) secondsStr = time.strftime("%S", time.localtime()) - eventFormatter.setElement("length", len(secondsStr)) - eventFormatter.setElement("text", secondsStr) + eventFormatter.setElement(LENGTH, len(secondsStr)) + eventFormatter.setElement(TEXT, secondsStr) eventFormatter.popElement() eventFormatter.popElement() diff --git a/examples/demoapps/EntitlementsVerificationRequestResponseExample.py b/examples/demoapps/EntitlementsVerificationRequestResponseExample.py index 168029c..8831328 100644 --- a/examples/demoapps/EntitlementsVerificationRequestResponseExample.py +++ b/examples/demoapps/EntitlementsVerificationRequestResponseExample.py @@ -18,6 +18,10 @@ SECURITY = Name("security") EID_DATA = Name("eidData") ENTITLEMENT_CHANGED = Name("EntitlementChanged") +SECURITIES = Name("securities") +FIELDS = Name("fields") +RETURN_EIDS = Name("returnEids") +SERVICE_NAME = Name("serviceName") class EntitlementsVerificationRequestResponseExample: @@ -103,7 +107,7 @@ def _openServices(session): session.openServiceAsync(REFDATA_SVC_NAME) def _handleServiceOpened(self, session, _1, message): - serviceName = message["serviceName"] + serviceName = message[SERVICE_NAME] service = session.getService(serviceName) if serviceName == REFDATA_SVC_NAME: @@ -111,7 +115,7 @@ def _handleServiceOpened(self, session, _1, message): return def _handleServiceOpenFailure(self, session, _1, message): - serviceName = message["serviceName"] + serviceName = message[SERVICE_NAME] if serviceName == REFDATA_SVC_NAME: print(f"Failed to open service '{serviceName}', stopping...") self._stop(session) @@ -122,9 +126,9 @@ def _handleServiceOpenFailure(self, session, _1, message): def _sendRefDataRequest(self, session, refDataService): request = refDataService.createRequest("ReferenceDataRequest") requestDict = { - "securities": self._options.securities, - "fields": ["PX_LAST", "DS002"], - "returnEids": True, + SECURITIES: self._options.securities, + FIELDS: ["PX_LAST", "DS002"], + RETURN_EIDS: True, } request.fromPy(requestDict) diff --git a/examples/demoapps/EntitlementsVerificationSubscriptionExample.py b/examples/demoapps/EntitlementsVerificationSubscriptionExample.py index 5a46077..02b7b28 100644 --- a/examples/demoapps/EntitlementsVerificationSubscriptionExample.py +++ b/examples/demoapps/EntitlementsVerificationSubscriptionExample.py @@ -18,6 +18,7 @@ EID = Name("EID") ENTITLEMENT_CHANGED = Name("EntitlementChanged") +SERVICE_NAME = Name("serviceName") def parseCmdLine(): @@ -141,7 +142,7 @@ def _handleSessionTerminated(self, *_): self._exampleStoppedThreadingEvent.set() def _handleServiceOpened(self, _1, _2, message: Message): - serviceName = message.getElementAsString("serviceName") + serviceName = message.getElementAsString(SERVICE_NAME) if serviceName == self._options.service: self._subscribe() else: @@ -157,7 +158,7 @@ def _stop(self): print(exc) def _handleServiceOpenFailure(self, _1, _2, message: Message): - serviceName = message.getElementAsString("serviceName") + serviceName = message.getElementAsString(SERVICE_NAME) if serviceName == self._options.service: self._stop() else: diff --git a/examples/demoapps/GenerateTokenExample.py b/examples/demoapps/GenerateTokenExample.py index 1d8b63f..8c2c2af 100644 --- a/examples/demoapps/GenerateTokenExample.py +++ b/examples/demoapps/GenerateTokenExample.py @@ -12,6 +12,8 @@ AUTH_OPTION_USER_APP = "userapp" AUTH_OPTION_DIR = "dir" +TOKEN = blpapi.Name("token") + class AuthOptionsAction(Action): """The action that parses authorization options from user input""" @@ -102,7 +104,7 @@ def main(): for msg in event: msgType = msg.messageType() if msgType == blpapi.Names.TOKEN_GENERATION_SUCCESS: - token = msg.getElementAsString("token") + token = msg.getElementAsString(TOKEN) print(f"Token is successfully generated: {token}") elif msgType == blpapi.Names.TOKEN_GENERATION_FAILURE: print(f"Failed to generate token: {msg}") diff --git a/examples/demoapps/InteractivePublisherExample.py b/examples/demoapps/InteractivePublisherExample.py index 9e54545..b0f9f4e 100644 --- a/examples/demoapps/InteractivePublisherExample.py +++ b/examples/demoapps/InteractivePublisherExample.py @@ -8,8 +8,35 @@ import threading import time +TOPIC_PERMISSIONS = blpapi.Name("topicPermissions") RESOLVED_TOPIC = blpapi.Name("resolvedTopic") +TOPIC = blpapi.Name("topic") TOPICS = blpapi.Name("topics") +UUID = blpapi.Name("uuid") +APPLICATION_ID = blpapi.Name("applicationId") +SUBSERVICE_CODE = blpapi.Name("subServiceCode") +RESULT = blpapi.Name("result") +REASON = blpapi.Name("reason") +SOURCE = blpapi.Name("source") +CATEGORY = blpapi.Name("category") +SUBCATEGORY = blpapi.Name("subcategory") +PERMISSIONS = blpapi.Name("permissions") +PERMISSION_SERVICE = blpapi.Name("permissionService") +DESCRIPTION = blpapi.Name("description") +EIDS = blpapi.Name("eids") +NUM_ROWS = blpapi.Name("numRows") +NUM_COLS = blpapi.Name("numCols") +MESSAGE_TYPE_ROW_UPDATE = blpapi.Name("RowUpdate") +ROW_UPDATE = blpapi.Name("rowUpdate") +ROW_NUM = blpapi.Name("rowNum") +SPAN_UPDATE = blpapi.Name("spanUpdate") +START_COL = blpapi.Name("startCol") +LENGTH = blpapi.Name("length") +TEXT = blpapi.Name("text") +OPEN = blpapi.Name("OPEN") +MARKET_DATA_EVENTS = blpapi.Name("MarketDataEvents") +HIGH = blpapi.Name("HIGH") +LOW = blpapi.Name("LOW") class MyEventHandler(object): @@ -130,28 +157,28 @@ def processPermissionRequest(self, session, msg): response = service.createResponseEvent(msg.correlationId()) permission = 1 # ALLOWED: 0, DENIED: 1 ef = blpapi.EventFormatter(response) - if msg.hasElement("uuid"): - msg.getElementAsInteger("uuid") + if msg.hasElement(UUID): + msg.getElementAsInteger(UUID) permission = 0 - if msg.hasElement("applicationId"): - msg.getElementAsInteger("applicationId") + if msg.hasElement(APPLICATION_ID): + msg.getElementAsInteger(APPLICATION_ID) permission = 0 # In appendResponse the string is the name of the # operation, the correlationId indicates which request we # are responding to. - ef.appendResponse("PermissionResponse") - ef.pushElement("topicPermissions") + ef.appendResponse(blpapi.Names.PERMISSION_RESPONSE) + ef.pushElement(TOPIC_PERMISSIONS) # For each of the topics in the request, add an entry to # the response. topicsElement = msg.getElement(TOPICS).values() for topic in topicsElement: ef.appendElement() - ef.setElement("topic", topic) + ef.setElement(TOPIC, topic) if self.resolveSubServiceCode: try: - ef.setElement("subServiceCode", self.resolveSubServiceCode) + ef.setElement(SUBSERVICE_CODE, self.resolveSubServiceCode) print( f"Mapping topic {topic} to subServiceCode" f" {self.resolveSubServiceCode}" @@ -161,21 +188,21 @@ def processPermissionRequest(self, session, msg): "subServiceCode could not be set." " Resolving without subServiceCode" ) - ef.setElement("result", permission) + ef.setElement(RESULT, permission) if permission == 1: # DENIED - ef.pushElement("reason") - ef.setElement("source", "My Publisher Name") - ef.setElement("category", "NOT_AUTHORIZED") - ef.setElement("subcategory", "Publisher Controlled") + ef.pushElement(REASON) + ef.setElement(SOURCE, "My Publisher Name") + ef.setElement(CATEGORY, "NOT_AUTHORIZED") + ef.setElement(SUBCATEGORY, "Publisher Controlled") ef.setElement( - "description", "Permission denied by My Publisher Name" + DESCRIPTION, "Permission denied by My Publisher Name" ) ef.popElement() elif self.eids: - ef.pushElement("permissions") + ef.pushElement(PERMISSIONS) ef.appendElement() - ef.setElement("permissionService", "//blp/blpperm") - ef.pushElement("eids") + ef.setElement(PERMISSION_SERVICE, "//blp/blpperm") + ef.pushElement(EIDS) for eid in self.eids: ef.appendValue(eid) ef.popElement() @@ -191,18 +218,18 @@ def processPermissionRequest(self, session, msg): def formatPageRecapEvent(eventFormatter): numRows = 5 - eventFormatter.setElement("numRows", numRows) - eventFormatter.setElement("numCols", 80) - eventFormatter.pushElement("rowUpdate") + eventFormatter.setElement(NUM_ROWS, numRows) + eventFormatter.setElement(NUM_COLS, 80) + eventFormatter.pushElement(ROW_UPDATE) for i in range(1, numRows + 1): eventFormatter.appendElement() - eventFormatter.setElement("rowNum", i) - eventFormatter.pushElement("spanUpdate") + eventFormatter.setElement(ROW_NUM, i) + eventFormatter.pushElement(SPAN_UPDATE) eventFormatter.appendElement() - eventFormatter.setElement("startCol", 1) - eventFormatter.setElement("length", 10) - eventFormatter.setElement("text", "RECAP") + eventFormatter.setElement(START_COL, 1) + eventFormatter.setElement(LENGTH, 10) + eventFormatter.setElement(TEXT, "RECAP") eventFormatter.popElement() eventFormatter.popElement() eventFormatter.popElement() @@ -211,7 +238,7 @@ def formatPageRecapEvent(eventFormatter): def formatMarketDataRecapEvent(eventFormatter): - eventFormatter.setElement("OPEN", 100.0) + eventFormatter.setElement(OPEN, 100.0) def parseCmdLine(): @@ -368,7 +395,7 @@ def main(): except blpapi.Exception as exception: print( "FAILED to add active sub-service codes." - f" Exception {exception.description()}" + f" Exception {exception}" ) try: @@ -429,10 +456,6 @@ def formatMarketDataEvent(eventFormatter, topic, publishNull): # of `EventFormatter` to format an `Event`. For an example of formatting an # `Event` using `EventFormatter.fromPy`, see # `BroadcastPublisherExample.formatMarketData`. - MARKET_DATA_EVENTS = blpapi.Name("MarketDataEvents") - HIGH = blpapi.Name("HIGH") - LOW = blpapi.Name("LOW") - eventFormatter.appendMessage(MARKET_DATA_EVENTS, topic) if publishNull: eventFormatter.setElementNull(HIGH) @@ -451,18 +474,18 @@ def formatPageEvent(eventFormatter, topic, publishNull): # `BroadcastPublisherExample.formatPageData`. numRows = 5 for i in range(1, numRows + 1): - eventFormatter.appendMessage("RowUpdate", topic) + eventFormatter.appendMessage(MESSAGE_TYPE_ROW_UPDATE, topic) secondsStr = time.strftime("%S", time.localtime()) - messageDict = {"rowNum": i} + messageDict = {ROW_NUM: i} if publishNull: - messageDict["spanUpdate"] = {} + messageDict[SPAN_UPDATE] = {} else: - messageDict["spanUpdate"] = [ + messageDict[SPAN_UPDATE] = [ { - "startCol": 1, - "length": len(secondsStr), - "text": secondsStr, + START_COL: 1, + LENGTH: len(secondsStr), + TEXT: secondsStr, } ] diff --git a/examples/demoapps/MultipleRequestsOverrideExample.py b/examples/demoapps/MultipleRequestsOverrideExample.py index 7890998..84e7e6f 100644 --- a/examples/demoapps/MultipleRequestsOverrideExample.py +++ b/examples/demoapps/MultipleRequestsOverrideExample.py @@ -17,9 +17,9 @@ def main(): description="Multiple requests with override example", ) addConnectionAndAuthOptions(parser) - options = parser.parse_args() + cliOptions = parser.parse_args() - sessionOptions = createSessionOptions(options) + sessionOptions = createSessionOptions(cliOptions) session = blpapi.Session(sessionOptions) try: diff --git a/examples/demoapps/RequestResponseExample.py b/examples/demoapps/RequestResponseExample.py index bb7c3bd..5ab9944 100644 --- a/examples/demoapps/RequestResponseExample.py +++ b/examples/demoapps/RequestResponseExample.py @@ -21,6 +21,9 @@ HISTORICAL_DATA_REQUEST, ) +SERVICE_NAME = blpapi.Name("serviceName") +REASON = blpapi.Name("reason") + def parseCmdLine(): """Parse command line arguments""" @@ -63,7 +66,7 @@ def processGenericEvent(event): return True elif eventType == blpapi.Event.SERVICE_STATUS: if messageType == blpapi.Names.SERVICE_OPEN_FAILURE: - serviceName = msg.getElementAsString("serviceName") + serviceName = msg.getElementAsString(SERVICE_NAME) print(f"Failed to open {serviceName}") printContactSupportMessage(msg) @@ -148,7 +151,7 @@ def waitForResponse(session, requestType): for msg in event: print(msg) if msg.messageType == blpapi.Names.REQUEST_FAILURE: - reason = msg.getElement("reason") + reason = msg.getElement(REASON) print(f"Request failed: {reason}") printContactSupportMessage(msg) done = True diff --git a/examples/demoapps/RequestServiceConsumerExample.py b/examples/demoapps/RequestServiceConsumerExample.py index ffc53a7..6b7fdf0 100644 --- a/examples/demoapps/RequestServiceConsumerExample.py +++ b/examples/demoapps/RequestServiceConsumerExample.py @@ -53,7 +53,7 @@ def main(): fieldsElement.appendValue("DS002") # Set time stamp - request.set("timestamp", time.time()) + request.set(TIMESTAMP, time.time()) print(f"Sending Request: {request}") diff --git a/examples/demoapps/SecurityLookupExample.py b/examples/demoapps/SecurityLookupExample.py index 3be1150..00bd883 100644 --- a/examples/demoapps/SecurityLookupExample.py +++ b/examples/demoapps/SecurityLookupExample.py @@ -46,7 +46,7 @@ def __call__(self, parser, args, values, option_string=None): parser.error(f"Invalid filter option '{values}'") filters = getattr(args, self.dest) - filters.append(InstrumentsFilter(vals[0], vals[1])) + filters.append(InstrumentsFilter(blpapi.Name(vals[0]), vals[1])) def parseCmdLine(): diff --git a/examples/demoapps/SubscriptionWithEventPollingExample.py b/examples/demoapps/SubscriptionWithEventPollingExample.py index fcd77b8..eb131a3 100644 --- a/examples/demoapps/SubscriptionWithEventPollingExample.py +++ b/examples/demoapps/SubscriptionWithEventPollingExample.py @@ -14,6 +14,8 @@ ) from util.MaxEventsOption import addMaxEventsOption +SERVICE_NAME = blpapi.Name("serviceName") + def parseCmdLine(): """Parse command line arguments""" @@ -116,7 +118,7 @@ def processGenericMessage(eventType, message): return True elif eventType == blpapi.Event.SERVICE_STATUS: if messageType == Names.SERVICE_OPEN_FAILURE: - serviceName = message.getElementAsString("serviceName") + serviceName = message.getElementAsString(SERVICE_NAME) print(f"Failed to open {serviceName}") printContactSupportMessage(message) diff --git a/examples/demoapps/UserModeExample.py b/examples/demoapps/UserModeExample.py index 16de5cd..8f3d19d 100644 --- a/examples/demoapps/UserModeExample.py +++ b/examples/demoapps/UserModeExample.py @@ -14,6 +14,10 @@ from time import sleep REFDATA_SVC_NAME = "//blp/refdata" +SECURITIES = blpapi.Name("securities") +FIELDS = blpapi.Name("fields") +RETURN_EIDS = blpapi.Name("returnEids") +SERVICE_NAME = blpapi.Name("serviceName") class UserModeExample: @@ -115,7 +119,7 @@ def _handleServiceOpened( _event: blpapi.Event, message: blpapi.Message, ): - serviceName = message["serviceName"] + serviceName = message[SERVICE_NAME] self._refDataService = session.getService(serviceName) if serviceName == REFDATA_SVC_NAME: @@ -132,7 +136,7 @@ def _handleServiceOpenFailure( _event: blpapi.Event, message: blpapi.Message, ): - serviceName = message["serviceName"] + serviceName = message[SERVICE_NAME] if serviceName == REFDATA_SVC_NAME: print(f"Failed to open service '{serviceName}', stopping...") self._stop() @@ -213,9 +217,9 @@ def _sendRefDataRequest(self, identity, userId): # and in authorization handler if the service is open (after). request = self._refDataService.createRequest("ReferenceDataRequest") requestDict = { - "securities": self._options.securities, - "fields": ["PX_LAST", "DS002"], - "returnEids": True, + SECURITIES: self._options.securities, + FIELDS: ["PX_LAST", "DS002"], + RETURN_EIDS: True, } request.fromPy(requestDict) diff --git a/examples/demoapps/snippets/apiflds/ApiFieldsRequestUtils.py b/examples/demoapps/snippets/apiflds/ApiFieldsRequestUtils.py index d9013f7..6cae18a 100644 --- a/examples/demoapps/snippets/apiflds/ApiFieldsRequestUtils.py +++ b/examples/demoapps/snippets/apiflds/ApiFieldsRequestUtils.py @@ -1,3 +1,12 @@ +from blpapi import Name + +ID = Name("id") +FIELD_INFO = Name("fieldInfo") +MNEMONIC = Name("mnemonic") +DESCRIPTION = Name("description") +FIELD_ERROR = Name("fieldError") +MESSAGE = Name("message") + ID_LEN = 13 MNEMONIC_LEN = 36 DESC_LEN = 40 @@ -18,11 +27,11 @@ def printHeader(): def printField(field): - fieldId = field["id"] - if "fieldInfo" in field: - fieldInfo = field["fieldInfo"] - fieldMnemonic = fieldInfo["mnemonic"] - fieldDesc = fieldInfo["description"] + fieldId = field[ID] + if FIELD_INFO in field: + fieldInfo = field[FIELD_INFO] + fieldMnemonic = fieldInfo[MNEMONIC] + fieldDesc = fieldInfo[DESCRIPTION] print( f"{fieldId.ljust(ID_LEN)}" @@ -30,7 +39,7 @@ def printField(field): f"{fieldDesc.ljust(DESC_LEN)}" ) else: - errorMsg = field["fieldError"]["message"] + errorMsg = field[FIELD_ERROR][MESSAGE] print() print(f" ERROR: {fieldId} - {errorMsg}") diff --git a/examples/demoapps/snippets/apiflds/CategorizedFieldSearchRequests.py b/examples/demoapps/snippets/apiflds/CategorizedFieldSearchRequests.py index 762470e..192d038 100644 --- a/examples/demoapps/snippets/apiflds/CategorizedFieldSearchRequests.py +++ b/examples/demoapps/snippets/apiflds/CategorizedFieldSearchRequests.py @@ -1,28 +1,40 @@ from snippets.apiflds import ApiFieldsRequestUtils +from blpapi import Name + +EXCLUDE = Name("exclude") +FIELD_TYPE = Name("fieldType") +FIELD_DATA = Name("fieldData") +SEARCH_SPEC = Name("searchSpec") +RETURN_FIELD_DOC = Name("returnFieldDocumentation") +CATEGORY = Name("category") +CATEGORY_NAME = Name("categoryName") +CATEGORY_ID = Name("categoryId") +FIELD_SEARCH_ERROR = Name("fieldSearchError") + def createRequest(apifldsService): request = apifldsService.createRequest("CategorizedFieldSearchRequest") - request.set("searchSpec", "last price") + request.set(SEARCH_SPEC, "last price") - exclude = request.getElement("exclude") - exclude.setElement("fieldType", "Static") + exclude = request.getElement(EXCLUDE) + exclude.setElement(FIELD_TYPE, "Static") - request.set("returnFieldDocumentation", False) + request.set(RETURN_FIELD_DOC, False) return request def processResponse(event): for msg in event: - if "fieldSearchError" in msg: + if FIELD_SEARCH_ERROR in msg: print(msg) continue - categories = msg["category"] + categories = msg[CATEGORY] for category in categories: - category_name = category["categoryName"] - category_id = category["categoryId"] + category_name = category[CATEGORY_NAME] + category_id = category[CATEGORY_ID] print( f"\nCategory Name: {category_name.ljust(ApiFieldsRequestUtils.CAT_NAME_LEN)}" f"\tId: {category_id}" @@ -30,7 +42,7 @@ def processResponse(event): ApiFieldsRequestUtils.printHeader() - fields = category["fieldData"] + fields = category[FIELD_DATA] for field in fields: ApiFieldsRequestUtils.printField(field) diff --git a/examples/demoapps/snippets/apiflds/FieldInfoRequests.py b/examples/demoapps/snippets/apiflds/FieldInfoRequests.py index 52b1d39..db8d78f 100644 --- a/examples/demoapps/snippets/apiflds/FieldInfoRequests.py +++ b/examples/demoapps/snippets/apiflds/FieldInfoRequests.py @@ -1,15 +1,21 @@ from snippets.apiflds import ApiFieldsRequestUtils +from blpapi import Name + +ID = Name("id") +FIELD_DATA = Name("fieldData") +RETURN_FIELD_DOC = Name("returnFieldDocumentation") + def createRequest(apifldsService): request = apifldsService.createRequest("FieldInfoRequest") - idElement = request.getElement("id") + idElement = request.getElement(ID) idElement.appendValue("LAST_PRICE") idElement.appendValue("pq005") idElement.appendValue("zz0002") - request.set("returnFieldDocumentation", True) + request.set(RETURN_FIELD_DOC, True) return request @@ -21,7 +27,7 @@ def processResponse(event): for msg in event: ApiFieldsRequestUtils.printHeader() - fields = msg["fieldData"] + fields = msg[FIELD_DATA] for field in fields: ApiFieldsRequestUtils.printField(field) diff --git a/examples/demoapps/snippets/apiflds/FieldListRequests.py b/examples/demoapps/snippets/apiflds/FieldListRequests.py index ed35403..8fb3f21 100644 --- a/examples/demoapps/snippets/apiflds/FieldListRequests.py +++ b/examples/demoapps/snippets/apiflds/FieldListRequests.py @@ -1,10 +1,16 @@ from snippets.apiflds import ApiFieldsRequestUtils +from blpapi import Name + +FIELD_DATA = Name("fieldData") +FIELD_TYPE = Name("fieldType") +RETURN_FIELD_DOC = Name("returnFieldDocumentation") + def createRequest(apifldsService): request = apifldsService.createRequest("FieldListRequest") - request["fieldType"] = "Static" - request["returnFieldDocumentation"] = False + request[FIELD_TYPE] = "Static" + request[RETURN_FIELD_DOC] = False return request @@ -16,7 +22,7 @@ def processResponse(event): for msg in event: ApiFieldsRequestUtils.printHeader() - fields = msg.getElement("fieldData") + fields = msg.getElement(FIELD_DATA) for i in range(fields.numValues()): ApiFieldsRequestUtils.printField(fields.getValueAsElement(i)) diff --git a/examples/demoapps/snippets/apiflds/FieldSearchRequests.py b/examples/demoapps/snippets/apiflds/FieldSearchRequests.py index 64f7499..cce7bbd 100644 --- a/examples/demoapps/snippets/apiflds/FieldSearchRequests.py +++ b/examples/demoapps/snippets/apiflds/FieldSearchRequests.py @@ -1,14 +1,25 @@ +from demoapps.snippets.apiflds.CategorizedFieldSearchRequests import ( + SEARCH_SPEC, +) from snippets.apiflds import ApiFieldsRequestUtils +from blpapi import Name + +EXCLUDE = Name("exclude") +FIELD_TYPE = Name("fieldType") +FIELD_DATA = Name("fieldData") +SEARCH_SPEC = Name("searchSpec") +RETURN_FIELD_DOC = Name("returnFieldDocumentation") + def createRequest(apifldsService): request = apifldsService.createRequest("FieldSearchRequest") - request.set("searchSpec", "last price") + request.set(SEARCH_SPEC, "last price") - exclude = request.getElement("exclude") - exclude.setElement("fieldType", "Static") + exclude = request.getElement(EXCLUDE) + exclude.setElement(FIELD_TYPE, "Static") - request.set("returnFieldDocumentation", False) + request.set(RETURN_FIELD_DOC, False) return request @@ -17,7 +28,7 @@ def processResponse(event): for msg in event: ApiFieldsRequestUtils.printHeader() - fields = msg["fieldData"] + fields = msg[FIELD_DATA] for field in fields: ApiFieldsRequestUtils.printField(field) diff --git a/examples/demoapps/snippets/requestresponse/HistoricalDataRequest.py b/examples/demoapps/snippets/requestresponse/HistoricalDataRequest.py index 66b1a5f..2bc21c6 100644 --- a/examples/demoapps/snippets/requestresponse/HistoricalDataRequest.py +++ b/examples/demoapps/snippets/requestresponse/HistoricalDataRequest.py @@ -1,5 +1,16 @@ # HistoricalDataRequest.py +from blpapi import Name + +SECURITIES = Name("securities") +PERIODICITY_ADJUSTMENT = Name("periodicityAdjustment") +PERIODICITY_SELECTION = Name("periodicitySelection") +START_DATE = Name("startDate") +END_DATE = Name("endDate") +MAX_DATA_POINTS = Name("maxDataPoints") +RETURN_EIDS = Name("returnEids") +FIELDS = Name("fields") + def createRequest(service, options): # NOTE: this function uses `Request.__setitem__` to format a `Request`. See @@ -7,15 +18,15 @@ def createRequest(service, options): # for examples of alternative interfaces for formatting a `Request`. request = service.createRequest("HistoricalDataRequest") - request["securities"] = options.securities - request["fields"] = options.fields + request[SECURITIES] = options.securities + request[FIELDS] = options.fields - request["periodicityAdjustment"] = "ACTUAL" - request["periodicitySelection"] = "MONTHLY" - request["startDate"] = "20200101" - request["endDate"] = "20201231" - request["maxDataPoints"] = 100 - request["returnEids"] = True + request[PERIODICITY_ADJUSTMENT] = "ACTUAL" + request[PERIODICITY_SELECTION] = "MONTHLY" + request[START_DATE] = "20200101" + request[END_DATE] = "20201231" + request[MAX_DATA_POINTS] = 100 + request[RETURN_EIDS] = True return request diff --git a/examples/demoapps/snippets/requestresponse/IntradayBarRequests.py b/examples/demoapps/snippets/requestresponse/IntradayBarRequests.py index d30dc06..818f6f2 100644 --- a/examples/demoapps/snippets/requestresponse/IntradayBarRequests.py +++ b/examples/demoapps/snippets/requestresponse/IntradayBarRequests.py @@ -1,17 +1,23 @@ # IntradayBarRequests.py -BAR_DATA = "barData" -BAR_TICK_DATA = "barTickData" -OPEN = "open" -HIGH = "high" -LOW = "low" -CLOSE = "close" -VOLUME = "volume" -NUM_EVENTS = "numEvents" -TIME = "time" -RESPONSE_ERROR = "responseError" -CATEGORY = "category" -MESSAGE = "message" +from blpapi import Name + +BAR_DATA = Name("barData") +BAR_TICK_DATA = Name("barTickData") +OPEN = Name("open") +HIGH = Name("high") +LOW = Name("low") +CLOSE = Name("close") +VOLUME = Name("volume") +NUM_EVENTS = Name("numEvents") +TIME = Name("time") +RESPONSE_ERROR = Name("responseError") +SECURITY = Name("security") +EVENT_TYPE = Name("eventType") +INTERVAL = Name("interval") +START_DATE_TIME = Name("startDateTime") +END_DATE_TIME = Name("endDateTime") +GAP_FILL_INITIAL_BAR = Name("gapFillInitialBar") DATETIME_FORMAT = "%m/%d/%Y %H:%M" @@ -23,15 +29,15 @@ def createRequest(service, options): request = service.createRequest("IntradayBarRequest") # Only one security / eventType per request - request.set("security", options.securities[0]) - request.set("eventType", options.eventTypes[0]) - request.set("interval", options.barInterval) + request.set(SECURITY, options.securities[0]) + request.set(EVENT_TYPE, options.eventTypes[0]) + request.set(INTERVAL, options.barInterval) - request.set("startDateTime", options.startDateTime) - request.set("endDateTime", options.endDateTime) + request.set(START_DATE_TIME, options.startDateTime) + request.set(END_DATE_TIME, options.endDateTime) if options.gapFillInitialBar: - request.set("gapFillInitialBar", options.gapFillInitialBar) + request.set(GAP_FILL_INITIAL_BAR, options.gapFillInitialBar) return request diff --git a/examples/demoapps/snippets/requestresponse/IntradayTickRequests.py b/examples/demoapps/snippets/requestresponse/IntradayTickRequests.py index c2bf3d3..ae75182 100644 --- a/examples/demoapps/snippets/requestresponse/IntradayTickRequests.py +++ b/examples/demoapps/snippets/requestresponse/IntradayTickRequests.py @@ -1,14 +1,19 @@ # IntradayTickRequests.py -import blpapi - -TICK_DATA = blpapi.Name("tickData") -CONDITION_CODES = blpapi.Name("conditionCodes") -SIZE = blpapi.Name("size") -TIME = blpapi.Name("time") -TYPE = blpapi.Name("type") -VALUE = blpapi.Name("value") -RESPONSE_ERROR = blpapi.Name("responseError") +from blpapi import Name + +TICK_DATA = Name("tickData") +CONDITION_CODES = Name("conditionCodes") +SIZE = Name("size") +TIME = Name("time") +TYPE = Name("type") +VALUE = Name("value") +RESPONSE_ERROR = Name("responseError") +SECURITY = Name.getName("security") +EVENT_TYPES = Name.getName("eventTypes") +START_DATE_TIME = Name.getName("startDateTime") +END_DATE_TIME = Name.getName("endDateTime") +INCLUDE_CONDITION_CODES = Name.getName("includeConditionCodes") DATETIME_FORMAT = "%m/%d/%Y %H:%M" @@ -20,14 +25,14 @@ def createRequest(service, options): request = service.createRequest("IntradayTickRequest") requestDict = { - "security": options.securities[0], - "eventTypes": options.eventTypes, + SECURITY: options.securities[0], + EVENT_TYPES: options.eventTypes, # All times are in GMT - "startDateTime": options.startDateTime, - "endDateTime": options.endDateTime, + START_DATE_TIME: options.startDateTime, + END_DATE_TIME: options.endDateTime, } if options.conditionCodes: - requestDict["includeConditionCodes"] = True + requestDict[INCLUDE_CONDITION_CODES] = True request.fromPy(requestDict) diff --git a/examples/demoapps/snippets/requestresponse/ReferenceDataRequests.py b/examples/demoapps/snippets/requestresponse/ReferenceDataRequests.py index 530f544..ebca905 100644 --- a/examples/demoapps/snippets/requestresponse/ReferenceDataRequests.py +++ b/examples/demoapps/snippets/requestresponse/ReferenceDataRequests.py @@ -10,6 +10,12 @@ FIELD_EXCEPTIONS = blpapi.Name("fieldExceptions") FIELD_ID = blpapi.Name("fieldId") ERROR_INFO = blpapi.Name("errorInfo") +SECURITIES = blpapi.Name("securities") +FIELDS = blpapi.Name("fields") +OVERRIDES = blpapi.Name("overrides") +VALUE = blpapi.Name("value") +ROW = blpapi.Name("row") +TABLE_OVERRIDES = blpapi.Name("tableOverrides") def createRequest(service, options): @@ -20,22 +26,22 @@ def createRequest(service, options): # examples of alternative interfaces for formatting a `Request`. request = service.createRequest("ReferenceDataRequest") - securitiesElement = request.getElement("securities") + securitiesElement = request.getElement(SECURITIES) for security in options.securities: securitiesElement.appendValue(security) - fieldsElement = request.getElement("fields") + fieldsElement = request.getElement(FIELDS) for field in options.fields: fieldsElement.appendValue(field) if options.overrides: # Add overrides - overridesElement = request.getElement("overrides") + overridesElement = request.getElement(OVERRIDES) for override in options.overrides: overrideElement = overridesElement.appendElement() - overrideElement.setElement("fieldId", override.fieldId) - overrideElement.setElement("value", override.value) + overrideElement.setElement(FIELD_ID, override.fieldId) + overrideElement.setElement(VALUE, override.value) return request @@ -52,20 +58,20 @@ def createTableOverrideRequest(service, options): rate2 = (2.0, 12, "R") # R = Ramp requestDict = { - "securities": options.securities, - "fields": options.fields, - "overrides": [ - {"fieldId": "ALLOW_DYNAMIC_CASHFLOW_CALCS", "value": "Y"}, - {"fieldId": "LOSS_SEVERITY", "value": 31}, + SECURITIES: options.securities, + FIELDS: options.fields, + OVERRIDES: [ + {FIELD_ID: "ALLOW_DYNAMIC_CASHFLOW_CALCS", VALUE: "Y"}, + {FIELD_ID: "LOSS_SEVERITY", VALUE: 31}, ], - "tableOverrides": [ + TABLE_OVERRIDES: [ { - "fieldId": "DEFAULT_VECTOR", - "row": [ - {"value": ["Anchor", "PROJ"]}, - {"value": ["Type", "CDR"]}, - {"value": rate1}, - {"value": rate2}, + FIELD_ID: "DEFAULT_VECTOR", + ROW: [ + {VALUE: ["Anchor", "PROJ"]}, + {VALUE: ["Type", "CDR"]}, + {VALUE: rate1}, + {VALUE: rate2}, ], } ], diff --git a/examples/unittests/market-data-notifier/src/authorizer.py b/examples/unittests/market-data-notifier/src/authorizer.py index 5043a3b..bd217d0 100644 --- a/examples/unittests/market-data-notifier/src/authorizer.py +++ b/examples/unittests/market-data-notifier/src/authorizer.py @@ -6,7 +6,6 @@ import blpapi -AUTHORIZATION_SUCCESS = blpapi.Name("AuthorizationSuccess") TOKEN = blpapi.Name("token") # pylint: disable=too-few-public-methods, too-many-branches @@ -50,7 +49,7 @@ def _authorize(self, auth_service, identity, cid, event_queue=None): ): for msg in event: print(msg) - if msg.messageType() == AUTHORIZATION_SUCCESS: + if msg.messageType() == blpapi.Names.AUTHORIZATION_SUCCESS: return True print("Authorization failed") return False diff --git a/examples/unittests/market-data-notifier/src/event_processor.py b/examples/unittests/market-data-notifier/src/event_processor.py index e3ad2be..db6820b 100644 --- a/examples/unittests/market-data-notifier/src/event_processor.py +++ b/examples/unittests/market-data-notifier/src/event_processor.py @@ -4,6 +4,7 @@ TOKEN_SUCCESS = blpapi.Name("TokenSuccess") TOKEN_FAILURE = blpapi.Name("TokenFailure") TOKEN = blpapi.Name("token") +LAST_PRICE = blpapi.Name("LAST_PRICE") # pylint: disable=too-few-public-methods class EventProcessor: @@ -21,7 +22,7 @@ def processEvent(self, event, _): elif event.eventType() == blpapi.Event.SUBSCRIPTION_STATUS: self._notifier.log_subscription_state(msg) elif event.eventType() == blpapi.Event.SUBSCRIPTION_DATA: - last_price = msg.getElementAsFloat("LAST_PRICE") + last_price = msg.getElementAsFloat(LAST_PRICE) result = self._compute_engine.someVeryComplexComputation( last_price ) diff --git a/examples/unittests/market-data-notifier/src/token_generator.py b/examples/unittests/market-data-notifier/src/token_generator.py index cff5d79..bd117bf 100644 --- a/examples/unittests/market-data-notifier/src/token_generator.py +++ b/examples/unittests/market-data-notifier/src/token_generator.py @@ -2,8 +2,8 @@ import blpapi -TOKEN_SUCCESS = blpapi.Name("TokenGenerationSuccess") -TOKEN_FAILURE = blpapi.Name("TokenGenerationFailure") +TOKEN_SUCCESS = blpapi.Names.TOKEN_GENERATION_SUCCESS +TOKEN_FAILURE = blpapi.Names.TOKEN_GENERATION_FAILURE TOKEN = blpapi.Name("token") # pylint: disable=too-few-public-methods diff --git a/examples/unittests/market-data-notifier/tests/test_authorizer.py b/examples/unittests/market-data-notifier/tests/test_authorizer.py index 01fe1aa..e4b022d 100644 --- a/examples/unittests/market-data-notifier/tests/test_authorizer.py +++ b/examples/unittests/market-data-notifier/tests/test_authorizer.py @@ -196,7 +196,7 @@ def testAuthorizationSuccess(self): self.mock_token_generator.generate.return_value = token event = blpapi.test.createEvent(blpapi.Event.RESPONSE) - authorization_success = blpapi.Name("AuthorizationSuccess") + authorization_success = blpapi.Names.AUTHORIZATION_SUCCESS schema_def = blpapi.test.getAdminMessageDefinition( authorization_success ) diff --git a/examples/unittests/market-data-notifier/tests/test_eventprocessor.py b/examples/unittests/market-data-notifier/tests/test_eventprocessor.py index 30f02c7..8adf3e6 100644 --- a/examples/unittests/market-data-notifier/tests/test_eventprocessor.py +++ b/examples/unittests/market-data-notifier/tests/test_eventprocessor.py @@ -83,7 +83,7 @@ def testNotifierReceivesSessionStarted(self): notifier.log_session_state(). """ event = blpapi.test.createEvent(blpapi.Event.SESSION_STATUS) - session_started = blpapi.Name("SessionStarted") + session_started = blpapi.Names.SESSION_STARTED schema_def = blpapi.test.getAdminMessageDefinition(session_started) blpapi.test.appendMessage(event, schema_def) @@ -108,7 +108,7 @@ def testNotifierReceivesSubscriptionStarted(self): notifier.log_subscription_state(). """ event = blpapi.test.createEvent(blpapi.Event.SUBSCRIPTION_STATUS) - subscription_started = blpapi.Name("SubscriptionStarted") + subscription_started = blpapi.Names.SUBSCRIPTION_STARTED schema_def = blpapi.test.getAdminMessageDefinition( subscription_started ) diff --git a/examples/unittests/market-data-notifier/tests/test_tokengenerator.py b/examples/unittests/market-data-notifier/tests/test_tokengenerator.py index 3531bcd..57a8047 100644 --- a/examples/unittests/market-data-notifier/tests/test_tokengenerator.py +++ b/examples/unittests/market-data-notifier/tests/test_tokengenerator.py @@ -45,7 +45,7 @@ def testTokenGenerationSuccess(self): 6. Verify that the expected token value is generated. """ event = blpapi.test.createEvent(blpapi.Event.TOKEN_STATUS) - token_success = blpapi.Name("TokenGenerationSuccess") + token_success = blpapi.Names.TOKEN_GENERATION_SUCCESS schema_def = blpapi.test.getAdminMessageDefinition(token_success) formatter = blpapi.test.appendMessage(event, schema_def) @@ -90,7 +90,7 @@ def testTokenGenerationFailure(self): } event = blpapi.test.createEvent(blpapi.Event.TOKEN_STATUS) - token_failure = blpapi.Name("TokenGenerationFailure") + token_failure = blpapi.Names.TOKEN_GENERATION_FAILURE schema_def = blpapi.test.getAdminMessageDefinition(token_failure) formatter = blpapi.test.appendMessage(event, schema_def) diff --git a/examples/unittests/snippets/resolver/resolverutils.py b/examples/unittests/snippets/resolver/resolverutils.py index 7d12b4b..bec31ef 100644 --- a/examples/unittests/snippets/resolver/resolverutils.py +++ b/examples/unittests/snippets/resolver/resolverutils.py @@ -7,8 +7,6 @@ # are more efficient on use through the interface. By creating the # 'blpapi.Name' objects in advance we can take advantage of the efficiency # without paying the cost of constructing them when needed. -PERMISSION_REQUEST = blpapi.Name("PermissionRequest") -PERMISSION_RESPONSE = blpapi.Name("PermissionResponse") TOPIC = blpapi.Name("topic") TOPICS = blpapi.Name("topics") TOPIC_PERMISSION = blpapi.Name("topicPermissions") @@ -67,7 +65,7 @@ def handlePermissionRequest(providerSession, service, request): Only accept requests with applicationId `ALLOWED_APP_ID`. """ - assert request.messageType() == PERMISSION_REQUEST + assert request.messageType() == blpapi.Names.PERMISSION_REQUEST disallowed = 1 if ( @@ -78,7 +76,7 @@ def handlePermissionRequest(providerSession, service, request): response = service.createResponseEvent(request.correlationIds()[0]) formatter = blpapi.EventFormatter(response) - formatter.appendResponse(PERMISSION_RESPONSE) + formatter.appendResponse(blpapi.Names.PERMISSION_RESPONSE) topics = request.getElement(TOPICS) formatter.pushElement(TOPIC_PERMISSION) diff --git a/examples/unittests/snippets/resolver/test_resolverutils.py b/examples/unittests/snippets/resolver/test_resolverutils.py index b0e1b09..a0fa88e 100644 --- a/examples/unittests/snippets/resolver/test_resolverutils.py +++ b/examples/unittests/snippets/resolver/test_resolverutils.py @@ -4,6 +4,7 @@ import unittest + try: from unittest.mock import ANY, Mock except ImportError: @@ -22,8 +23,11 @@ CATEGORY = blpapi.Name("category") NOT_AUTHORIZED = blpapi.Name("NOT_AUTHORIZED") TOPIC_PERMISSIONS = blpapi.Name("topicPermissions") -PERMISSION_REQUEST = blpapi.Name("PermissionRequest") -PERMISSION_RESPONSE = blpapi.Name("PermissionResponse") +PERMISSION_REQUEST = blpapi.Names.PERMISSION_REQUEST +PERMISSION_RESPONSE = blpapi.Names.PERMISSION_RESPONSE +TOPICS = blpapi.Name("topics") +SERVICE_NAME = blpapi.Name("serviceName") +APPLICATION_ID = blpapi.Name("applicationId") ALLOWED_APP_ID = 1234 INVALID_APP_ID = 4321 @@ -38,6 +42,8 @@ def createPermissionEvent(cid, applicationId): schemaDef = blpapi.test.getAdminMessageDefinition(PERMISSION_REQUEST) + # this goes through Json converter for demonstration purposes + # and Json doesn't support Names as keys -- hence, strings. content = { "topics": ["topic1", "topic2"], "serviceName": "//blp/mytestservice", diff --git a/examples/unittests/snippets/test_events.py b/examples/unittests/snippets/test_events.py index 91cc339..3b3115a 100644 --- a/examples/unittests/snippets/test_events.py +++ b/examples/unittests/snippets/test_events.py @@ -24,7 +24,7 @@ def testSessionStarted(self): """Sample SessionStarted message""" event = blpapi.test.createEvent(blpapi.Event.SESSION_STATUS) schema = blpapi.test.getAdminMessageDefinition( - blpapi.Name("SessionStarted") + blpapi.Names.SESSION_STARTED ) formatter = blpapi.test.appendMessage(event, schema) @@ -44,7 +44,7 @@ def testSessionStartupFailure(self): """Sample SessionStartupFailure message""" event = blpapi.test.createEvent(blpapi.Event.SESSION_STATUS) schema = blpapi.test.getAdminMessageDefinition( - blpapi.Name("SessionStartupFailure") + blpapi.Names.SESSION_STARTUP_FAILURE ) formatter = blpapi.test.appendMessage(event, schema) @@ -67,7 +67,7 @@ def testSessionTerminated(self): """Sample SessionTerminated message""" event = blpapi.test.createEvent(blpapi.Event.SESSION_STATUS) schema = blpapi.test.getAdminMessageDefinition( - blpapi.Name("SessionTerminated") + blpapi.Names.SESSION_TERMINATED ) formatter = blpapi.test.appendMessage(event, schema) @@ -90,7 +90,7 @@ def testSessionConnectionUp(self): """Sample SessionConnectionUp message""" event = blpapi.test.createEvent(blpapi.Event.SESSION_STATUS) schema = blpapi.test.getAdminMessageDefinition( - blpapi.Name("SessionConnectionUp") + blpapi.Names.SESSION_CONNECTION_UP ) formatter = blpapi.test.appendMessage(event, schema) @@ -110,7 +110,7 @@ def testSessionConnectionDown(self): """Sample SessionConnectionDown message""" event = blpapi.test.createEvent(blpapi.Event.SESSION_STATUS) schema = blpapi.test.getAdminMessageDefinition( - blpapi.Name("SessionConnectionDown") + blpapi.Names.SESSION_CONNECTION_DOWN ) formatter = blpapi.test.appendMessage(event, schema) @@ -128,7 +128,7 @@ def testSessionClusterInfo(self): """Sample SessionClusterInfo message""" event = blpapi.test.createEvent(blpapi.Event.SESSION_STATUS) schema = blpapi.test.getAdminMessageDefinition( - blpapi.Name("SessionClusterInfo") + blpapi.Names.SESSION_CLUSTER_INFO ) formatter = blpapi.test.appendMessage(event, schema) @@ -149,7 +149,7 @@ def testSessionClusterUpdate(self): """Sample SessionClusterUpdate message""" event = blpapi.test.createEvent(blpapi.Event.SESSION_STATUS) schema = blpapi.test.getAdminMessageDefinition( - blpapi.Name("SessionClusterUpdate") + blpapi.Names.SESSION_CLUSTER_UPDATE ) formatter = blpapi.test.appendMessage(event, schema) @@ -172,7 +172,7 @@ def testSlowConsumerWarning(self): """Sample SlowConsumerWarning message""" event = blpapi.test.createEvent(blpapi.Event.ADMIN) schema = blpapi.test.getAdminMessageDefinition( - blpapi.Name("SlowConsumerWarning") + blpapi.Names.SLOW_CONSUMER_WARNING ) blpapi.test.appendMessage(event, schema) @@ -180,7 +180,7 @@ def testSlowConsumerWarningCleared(self): """Sample SlowConsumerWarningCleared message""" event = blpapi.test.createEvent(blpapi.Event.ADMIN) schema = blpapi.test.getAdminMessageDefinition( - blpapi.Name("SlowConsumerWarningCleared") + blpapi.Names.SLOW_CONSUMER_WARNING_CLEARED ) formatter = blpapi.test.appendMessage(event, schema) @@ -208,7 +208,7 @@ def testRequestTemplateAvailable(self): """Sample RequestTemplateAvailable message""" event = blpapi.test.createEvent(blpapi.Event.ADMIN) schema = blpapi.test.getAdminMessageDefinition( - blpapi.Name("RequestTemplateAvailable") + blpapi.Names.REQUEST_TEMPLATE_AVAILABLE ) formatter = blpapi.test.appendMessage(event, schema) @@ -225,7 +225,7 @@ def testRequestTemplatePending(self): """Sample RequestTemplatePending message""" event = blpapi.test.createEvent(blpapi.Event.ADMIN) schema = blpapi.test.getAdminMessageDefinition( - blpapi.Name("RequestTemplatePending") + blpapi.Names.REQUEST_TEMPLATE_PENDING ) blpapi.test.appendMessage(event, schema) @@ -234,7 +234,7 @@ def testRequestTemplateTerminated(self): """Sample RequestTemplateTerminated message""" event = blpapi.test.createEvent(blpapi.Event.ADMIN) schema = blpapi.test.getAdminMessageDefinition( - blpapi.Name("RequestTemplateTerminated") + blpapi.Names.REQUEST_TEMPLATE_TERMINATED ) formatter = blpapi.test.appendMessage(event, schema) @@ -261,7 +261,7 @@ def testServiceOpened(self): """Sample ServiceOpened message""" event = blpapi.test.createEvent(blpapi.Event.SERVICE_STATUS) schema = blpapi.test.getAdminMessageDefinition( - blpapi.Name("ServiceOpened") + blpapi.Names.SERVICE_OPENED ) formatter = blpapi.test.appendMessage(event, schema) @@ -276,7 +276,7 @@ def testServiceOpenFailure(self): """Sample ServiceOpenFailure message""" event = blpapi.test.createEvent(blpapi.Event.SERVICE_STATUS) schema = blpapi.test.getAdminMessageDefinition( - blpapi.Name("ServiceOpenFailure") + blpapi.Names.SERVICE_OPEN_FAILURE ) formatter = blpapi.test.appendMessage(event, schema) @@ -299,7 +299,7 @@ def testServiceRegistered(self): """Sample ServiceRegistered message""" event = blpapi.test.createEvent(blpapi.Event.SERVICE_STATUS) schema = blpapi.test.getAdminMessageDefinition( - blpapi.Name("ServiceRegistered") + blpapi.Names.SERVICE_REGISTERED ) formatter = blpapi.test.appendMessage(event, schema) @@ -314,7 +314,7 @@ def testServiceRegisterFailure(self): """Sample ServiceRegisterFailure message""" event = blpapi.test.createEvent(blpapi.Event.SERVICE_STATUS) schema = blpapi.test.getAdminMessageDefinition( - blpapi.Name("ServiceRegisterFailure") + blpapi.Names.SERVICE_REGISTER_FAILURE ) formatter = blpapi.test.appendMessage(event, schema) @@ -337,7 +337,7 @@ def testServiceDeregistered(self): """Sample ServiceDeregistered message""" event = blpapi.test.createEvent(blpapi.Event.SERVICE_STATUS) schema = blpapi.test.getAdminMessageDefinition( - blpapi.Name("ServiceDeregistered") + blpapi.Names.SERVICE_DEREGISTERED ) formatter = blpapi.test.appendMessage(event, schema) @@ -352,7 +352,7 @@ def testServiceDown(self): """Sample ServiceDown message""" event = blpapi.test.createEvent(blpapi.Event.SERVICE_STATUS) schema = blpapi.test.getAdminMessageDefinition( - blpapi.Name("ServiceDown") + blpapi.Names.SERVICE_DOWN ) formatter = blpapi.test.appendMessage(event, schema) @@ -378,9 +378,7 @@ def testServiceDown(self): def testServiceUp(self): """Sample ServiceUp message""" event = blpapi.test.createEvent(blpapi.Event.SERVICE_STATUS) - schema = blpapi.test.getAdminMessageDefinition( - blpapi.Name("ServiceUp") - ) + schema = blpapi.test.getAdminMessageDefinition(blpapi.Names.SERVICE_UP) formatter = blpapi.test.appendMessage(event, schema) @@ -406,7 +404,7 @@ def testServiceAvailabilityInfo(self): """Sample ServiceAvailabilityInfo message""" event = blpapi.test.createEvent(blpapi.Event.SERVICE_STATUS) schema = blpapi.test.getAdminMessageDefinition( - blpapi.Name("ServiceAvailabilityInfo") + blpapi.Names.SERVICE_AVAILABILITY_INFO ) formatter = blpapi.test.appendMessage(event, schema) @@ -429,7 +427,7 @@ def testTokenGenerationSuccess(self): """Sample TokenGenerationSuccess message""" event = blpapi.test.createEvent(blpapi.Event.TOKEN_STATUS) schema = blpapi.test.getAdminMessageDefinition( - blpapi.Name("TokenGenerationSuccess") + blpapi.Names.TOKEN_GENERATION_SUCCESS ) formatter = blpapi.test.appendMessage(event, schema) @@ -444,7 +442,7 @@ def testTokenGenerationFailure(self): """Sample TokenGenerationFailure message""" event = blpapi.test.createEvent(blpapi.Event.TOKEN_STATUS) schema = blpapi.test.getAdminMessageDefinition( - blpapi.Name("TokenGenerationFailure") + blpapi.Names.TOKEN_GENERATION_FAILURE ) formatter = blpapi.test.appendMessage(event, schema) @@ -471,7 +469,7 @@ def testSubscriptionStarted(self): """Sample SubscriptionStarted message""" event = blpapi.test.createEvent(blpapi.Event.SUBSCRIPTION_STATUS) schema = blpapi.test.getAdminMessageDefinition( - blpapi.Name("SubscriptionStarted") + blpapi.Names.SUBSCRIPTION_STARTED ) formatter = blpapi.test.appendMessage(event, schema) @@ -503,7 +501,7 @@ def testSubscriptionFailure(self): """Sample SubscriptionFailure message""" event = blpapi.test.createEvent(blpapi.Event.SUBSCRIPTION_STATUS) schema = blpapi.test.getAdminMessageDefinition( - blpapi.Name("SubscriptionFailure") + blpapi.Names.SUBSCRIPTION_FAILURE ) formatter = blpapi.test.appendMessage(event, schema) @@ -539,7 +537,7 @@ def testSubscriptionStreamsActivated(self): """Sample SubscriptionStreamsActivated message""" event = blpapi.test.createEvent(blpapi.Event.SUBSCRIPTION_STATUS) schema = blpapi.test.getAdminMessageDefinition( - blpapi.Name("SubscriptionStreamsActivated") + blpapi.Names.SUBSCRIPTION_STREAMS_ACTIVATED ) formatter = blpapi.test.appendMessage(event, schema) @@ -559,7 +557,7 @@ def testSubscriptionStreamsDeactivated(self): """Sample SubscriptionStreamsDeactivated message""" event = blpapi.test.createEvent(blpapi.Event.SUBSCRIPTION_STATUS) schema = blpapi.test.getAdminMessageDefinition( - blpapi.Name("SubscriptionStreamsDeactivated") + blpapi.Names.SUBSCRIPTION_STREAMS_DEACTIVATED ) formatter = blpapi.test.appendMessage(event, schema) @@ -579,7 +577,7 @@ def testSubscriptionTerminated(self): """Sample SubscriptionTerminated message""" event = blpapi.test.createEvent(blpapi.Event.SUBSCRIPTION_STATUS) schema = blpapi.test.getAdminMessageDefinition( - blpapi.Name("SubscriptionTerminated") + blpapi.Names.SUBSCRIPTION_TERMINATED ) formatter = blpapi.test.appendMessage(event, schema) @@ -606,7 +604,7 @@ def testRequestFailure(self): """Sample RequestFailure message""" event = blpapi.test.createEvent(blpapi.Event.REQUEST_STATUS) schema = blpapi.test.getAdminMessageDefinition( - blpapi.Name("RequestFailure") + blpapi.Names.REQUEST_FAILURE ) formatter = blpapi.test.appendMessage(event, schema) @@ -633,7 +631,7 @@ def testResolutionSuccess(self): """Sample ResolutionSuccess message""" event = blpapi.test.createEvent(blpapi.Event.RESOLUTION_STATUS) schema = blpapi.test.getAdminMessageDefinition( - blpapi.Name("ResolutionSuccess") + blpapi.Names.RESOLUTION_SUCCESS ) formatter = blpapi.test.appendMessage(event, schema) @@ -648,7 +646,7 @@ def testResolutionFailure(self): """Sample ResolutionFailure message""" event = blpapi.test.createEvent(blpapi.Event.RESOLUTION_STATUS) schema = blpapi.test.getAdminMessageDefinition( - blpapi.Name("ResolutionFailure") + blpapi.Names.RESOLUTION_FAILURE ) formatter = blpapi.test.appendMessage(event, schema) @@ -675,7 +673,7 @@ def testPermissionRequest(self): """Sample PermissionRequest message""" event = blpapi.test.createEvent(blpapi.Event.REQUEST) schema = blpapi.test.getAdminMessageDefinition( - blpapi.Name("PermissionRequest") + blpapi.Names.PERMISSION_REQUEST ) formatter = blpapi.test.appendMessage(event, schema) @@ -715,7 +713,7 @@ def testTopicCreated(self): """Sample TopicCreated message""" event = blpapi.test.createEvent(blpapi.Event.TOPIC_STATUS) schema = blpapi.test.getAdminMessageDefinition( - blpapi.Name("TopicCreated") + blpapi.Names.TOPIC_CREATED ) formatter = blpapi.test.appendMessage(event, schema) @@ -730,7 +728,7 @@ def testTopicCreateFailure(self): """Sample TopicCreateFailure message""" event = blpapi.test.createEvent(blpapi.Event.TOPIC_STATUS) schema = blpapi.test.getAdminMessageDefinition( - blpapi.Name("TopicCreateFailure") + blpapi.Names.TOPIC_CREATE_FAILURE ) formatter = blpapi.test.appendMessage(event, schema) @@ -754,7 +752,7 @@ def testTopicDeleted(self): """Sample TopicDeleted message""" event = blpapi.test.createEvent(blpapi.Event.TOPIC_STATUS) schema = blpapi.test.getAdminMessageDefinition( - blpapi.Name("TopicDeleted") + blpapi.Names.TOPIC_DELETED ) formatter = blpapi.test.appendMessage(event, schema) @@ -769,7 +767,7 @@ def testTopicSubscribed(self): """Sample TopicSubscribed message""" event = blpapi.test.createEvent(blpapi.Event.TOPIC_STATUS) schema = blpapi.test.getAdminMessageDefinition( - blpapi.Name("TopicSubscribed") + blpapi.Names.TOPIC_SUBSCRIBED ) formatter = blpapi.test.appendMessage(event, schema) @@ -784,7 +782,7 @@ def testTopicResubscribed(self): """Sample TopicResubscribed message""" event = blpapi.test.createEvent(blpapi.Event.TOPIC_STATUS) schema = blpapi.test.getAdminMessageDefinition( - blpapi.Name("TopicResubscribed") + blpapi.Names.TOPIC_RESUBSCRIBED ) formatter = blpapi.test.appendMessage(event, schema) @@ -803,7 +801,7 @@ def testTopicUnsubscribed(self): """Sample TopicUnsubscribed message""" event = blpapi.test.createEvent(blpapi.Event.TOPIC_STATUS) schema = blpapi.test.getAdminMessageDefinition( - blpapi.Name("TopicUnsubscribed") + blpapi.Names.TOPIC_UNSUBSCRIBED ) formatter = blpapi.test.appendMessage(event, schema) @@ -818,7 +816,7 @@ def testTopicActivated(self): """Sample TopicActivated message""" event = blpapi.test.createEvent(blpapi.Event.TOPIC_STATUS) schema = blpapi.test.getAdminMessageDefinition( - blpapi.Name("TopicActivated") + blpapi.Names.TOPIC_ACTIVATED ) formatter = blpapi.test.appendMessage(event, schema) @@ -833,7 +831,7 @@ def testTopicDeactivated(self): """Sample TopicDeactivated message""" event = blpapi.test.createEvent(blpapi.Event.TOPIC_STATUS) schema = blpapi.test.getAdminMessageDefinition( - blpapi.Name("TopicDeactivated") + blpapi.Names.TOPIC_DEACTIVATED ) formatter = blpapi.test.appendMessage(event, schema) @@ -848,7 +846,7 @@ def testTopicRecap(self): """Sample TopicRecap message""" event = blpapi.test.createEvent(blpapi.Event.TOPIC_STATUS) schema = blpapi.test.getAdminMessageDefinition( - blpapi.Name("TopicRecap") + blpapi.Names.TOPIC_RECAP ) formatter = blpapi.test.appendMessage(event, schema) diff --git a/src/blpapi.egg-info/PKG-INFO b/src/blpapi.egg-info/PKG-INFO index a0f3d92..a05792a 100644 --- a/src/blpapi.egg-info/PKG-INFO +++ b/src/blpapi.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: blpapi -Version: 3.18.3 +Version: 3.19.1 Summary: Python SDK for Bloomberg BLPAPI Home-page: http://www.bloomberglabs.com/api/ Author: Bloomberg L.P. diff --git a/src/blpapi/constant.py b/src/blpapi/constant.py index 5b9e614..f98a722 100644 --- a/src/blpapi/constant.py +++ b/src/blpapi/constant.py @@ -25,7 +25,6 @@ AnyPythonDatetime, BlpapiConstantHandle, BlpapiConstantListHandle, - BlpapiNameOrStr, ) from . import utils from . import internals @@ -268,7 +267,7 @@ def datatype(self) -> int: """ return internals.blpapi_ConstantList_datatype(self.__handle) - def hasConstant(self, name: BlpapiNameOrStr) -> bool: + def hasConstant(self, name: Name) -> bool: """ Args: name: Name of the constant @@ -287,7 +286,7 @@ def hasConstant(self, name: BlpapiNameOrStr) -> bool: ) ) - def getConstant(self, name: BlpapiNameOrStr) -> Constant: + def getConstant(self, name: Name) -> Constant: """ Args: name: Name of the constant diff --git a/src/blpapi/element.py b/src/blpapi/element.py index 48470b1..d4c8f90 100644 --- a/src/blpapi/element.py +++ b/src/blpapi/element.py @@ -13,12 +13,11 @@ from .datatype import DataType from .name import Name, getNamePair from .schema import SchemaElementDefinition -from .utils import conv2str, Iterator, isNonScalarSequence, isstr +from .utils import Iterator, isNonScalarSequence from .chandle import CHandle from . import internals from .typehints import ( - BlpapiNameOrStr, - BlpapiNameOrStrOrIndex, + BlpapiNameOrIndex, AnyPythonDatetime, SupportedElementTypes, ) @@ -98,7 +97,8 @@ class Element(CHandle): the ``getElementAs...()`` family of methods. This example shows how to get the value of the element ``city`` in the sequence element ``address``:: - city = address.getElementAsString("city") + name_city = Name("city") # Ideally defined once (globally or class level) + city = address.getElementAsString(name_city) Note: ``getElementAsXYZ(name)`` method is a shortcut to @@ -125,7 +125,8 @@ class Element(CHandle): value of the element ``city`` in the sequence element ``address`` to a string:: - address.setElement("city", "New York") + name_city = Name("city") # Ideally defined once (globally or class level) + address.setElement(name_city, "New York") Methods which specify an :class:`Element` name accept name in two forms: :class:`Name` or a string. Passing :class:`Name` is more efficient. @@ -184,7 +185,13 @@ class Element(CHandle): __stringTraits = ( internals.blpapi_Element_setElementString, internals.blpapi_Element_setValueString, - conv2str, + None, + ) + + __bytesTraits = ( + internals.blpapi_Element_setElementBytes, + internals.blpapi_Element_setValueBytes, + None, ) __defaultTraits = ( @@ -198,8 +205,10 @@ def __getTraits( value: SupportedElementTypes, ) -> Tuple[Callable, Callable, Optional[Any]]: """traits dispatcher""" - if isstr(value): + if isinstance(value, str): return Element.__stringTraits + if isinstance(value, bytes): + return Element.__bytesTraits if isinstance(value, bool): return Element.__boolTraits if isinstance(value, int): @@ -257,7 +266,7 @@ def __str__(self) -> str: return self.toString() def __getitem__( - self, nameOrIndex: BlpapiNameOrStrOrIndex + self, nameOrIndex: BlpapiNameOrIndex ) -> Union[SupportedElementTypes, "Element"]: """ Args: @@ -293,7 +302,7 @@ def __getitem__( # is name if not self.hasElement(nameOrIndex): raise KeyError( - f"Element {self.name()} " # type: ignore + f"Element {self.name()} " f"does not contain element" f" {nameOrIndex}" ) @@ -310,7 +319,7 @@ def __getitem__( def __setitem__( self, - name: BlpapiNameOrStr, + name: Name, value: Union[Mapping, Sequence, SupportedElementTypes], ) -> None: """ @@ -613,7 +622,7 @@ def toString(self, level: int = 0, spacesPerLevel: int = 4) -> str: self.__handle, level, spacesPerLevel ) - def getElement(self, nameOrIndex: BlpapiNameOrStrOrIndex) -> "Element": + def getElement(self, nameOrIndex: BlpapiNameOrIndex) -> "Element": """ Args: nameOrIndex: Sub-element identifier @@ -626,6 +635,11 @@ def getElement(self, nameOrIndex: BlpapiNameOrStrOrIndex) -> "Element": ``hasElement(nameOrIndex) != True``, or if ``nameOrIndex`` is an integer and ``nameOrIndex >= numElements()``. Also if this :class:`Element` is neither a sequence nor a choice. + + Note: + **Please use** :class:`Name` **over** :class:`str` **where possible for** + ``BlpapiNameOrStrOrIndex``. :class:`Name` **objects should be initialized + once and then reused** in order to minimize lookup cost. """ if not isinstance(nameOrIndex, int): @@ -663,7 +677,7 @@ def elements(self) -> IteratorType: return Iterator(self, Element.numElements, Element.getElement) def hasElement( - self, name: BlpapiNameOrStr, excludeNullElements: bool = False + self, name: Name, excludeNullElements: bool = False ) -> bool: """ Args: @@ -677,6 +691,11 @@ def hasElement( Raises: Exception: If ``name`` is neither a :class:`Name` nor a string. + + Note: + **Please use** :class:`Name` **over** :class:`str` **where possible for** + ``name``. :class:`Name` **objects should be initialized + once and then reused** in order to minimize lookup cost. """ self.__assertIsValid() @@ -742,6 +761,25 @@ def getValueAsString(self, index: int = 0) -> str: _ExceptionUtil.raiseOnError(res[0]) return res[1] + def getValueAsBytes(self, index: int = 0) -> bytes: + """ + Args: + index: Index of the value in the element + + Returns: + ``index``\ th entry in the :class:`Element` as bytes. + + Raises: + InvalidConversionException: If the data type of this + :class:`Element` cannot be converted to bytes. + IndexOutOfRangeException: If ``index >= numValues()``. + """ + + self.__assertIsValid() + res = internals.blpapi_Element_getValueAsBytes(self.__handle, index) + _ExceptionUtil.raiseOnError(res[0]) + return res[1] + def getValueAsDatetime(self, index: int = 0) -> AnyPythonDatetime: """ Args: @@ -885,7 +923,7 @@ def values(self) -> IteratorType: ) return Iterator(self, Element.numValues, valueGetter) - def getElementAsBool(self, name: BlpapiNameOrStr) -> bool: + def getElementAsBool(self, name: Name) -> bool: """ Args: name: Sub-element identifier @@ -898,11 +936,16 @@ def getElementAsBool(self, name: BlpapiNameOrStr) -> bool: if this :class:`Element` is neither a sequence nor a choice, or in case it has no sub-element with the specified ``name``, or in case the element's value can't be returned as a boolean. + + Note: + **Please use** :class:`Name` **over** :class:`str` **where possible for** + ``name``. :class:`Name` **objects should be initialized + once and then reused** in order to minimize lookup cost. """ return self.getElement(name).getValueAsBool() - def getElementAsString(self, name: BlpapiNameOrStr) -> str: + def getElementAsString(self, name: Name) -> str: """ Args: name: Sub-element identifier @@ -915,11 +958,38 @@ def getElementAsString(self, name: BlpapiNameOrStr) -> str: if this :class:`Element` is neither a sequence nor a choice, or in case it has no sub-element with the specified ``name``, or in case the element's value can't be returned as a string. + + Note: + **Please use** :class:`Name` **over** :class:`str` **where possible for** + ``name``. :class:`Name` **objects should be initialized + once and then reused** in order to minimize lookup cost. """ return self.getElement(name).getValueAsString() - def getElementAsDatetime(self, name: BlpapiNameOrStr) -> AnyPythonDatetime: + def getElementAsBytes(self, name: Name) -> bytes: + """ + Args: + name: Sub-element identifier + + Returns: + This element's sub-element with ``name`` as bytes + + Raises: + Exception: If ``name`` is neither a :class:`Name` nor a string, or + if this :class:`Element` is neither a sequence nor a choice, or + in case it has no sub-element with the specified ``name``, or + in case the element's value can't be returned as bytes. + + Note: + **Please use** :class:`Name` **over** :class:`str` **where possible for** + ``name``. :class:`Name` **objects should be initialized + once and then reused** in order to minimize lookup cost. + """ + + return self.getElement(name).getValueAsBytes() + + def getElementAsDatetime(self, name: Name) -> AnyPythonDatetime: """ Args: name: Sub-element identifier @@ -933,11 +1003,16 @@ def getElementAsDatetime(self, name: BlpapiNameOrStr) -> AnyPythonDatetime: if this :class:`Element` is neither a sequence nor a choice, or in case it has no sub-element with the specified ``name``, or in case the element's value can't be returned as a datetime. + + Note: + **Please use** :class:`Name` **over** :class:`str` **where possible for** + ``name``. :class:`Name` **objects should be initialized + once and then reused** in order to minimize lookup cost. """ return self.getElement(name).getValueAsDatetime() - def getElementAsInteger(self, name: BlpapiNameOrStr) -> int: + def getElementAsInteger(self, name: Name) -> int: """ Args: name: Sub-element identifier @@ -950,11 +1025,16 @@ def getElementAsInteger(self, name: BlpapiNameOrStr) -> int: if this :class:`Element` is neither a sequence nor a choice, or in case it has no sub-element with the specified ``name``, or in case the element's value can't be returned as an integer. + + Note: + **Please use** :class:`Name` **over** :class:`str` **where possible for** + ``name``. :class:`Name` **objects should be initialized + once and then reused** in order to minimize lookup cost. """ return self.getElement(name).getValueAsInteger() - def getElementAsFloat(self, name: BlpapiNameOrStr) -> float: + def getElementAsFloat(self, name: Name) -> float: """ Args: name: Sub-element identifier @@ -967,11 +1047,16 @@ def getElementAsFloat(self, name: BlpapiNameOrStr) -> float: if this :class:`Element` is neither a sequence nor a choice, or in case it has no sub-element with the specified ``name``, or in case the element's value can't be returned as a float. + + Note: + **Please use** :class:`Name` **over** :class:`str` **where possible for** + ``name``. :class:`Name` **objects should be initialized + once and then reused** in order to minimize lookup cost. """ return self.getElement(name).getValueAsFloat() - def getElementAsName(self, name: BlpapiNameOrStr) -> Name: + def getElementAsName(self, name: Name) -> Name: """ Args: name: Sub-element identifier @@ -985,12 +1070,17 @@ def getElementAsName(self, name: BlpapiNameOrStr) -> Name: in case it has no sub-element with the specified ``name``, or in case the element's value can't be returned as a :class:`Name`. + + Note: + **Please use** :class:`Name` **over** :class:`str` **where possible for** + ``name``. :class:`Name` **objects should be initialized + once and then reused** in order to minimize lookup cost. """ return self.getElement(name).getValueAsName() def getElementValue( - self, name: BlpapiNameOrStr + self, name: Name ) -> Union[SupportedElementTypes, "Element"]: """ Args: @@ -1003,13 +1093,16 @@ def getElementValue( Exception: If ``name`` is neither a :class:`Name` nor a string, or if this :class:`Element` is neither a sequence nor a choice, or in case it has no sub-element with the specified ``name``. + + Note: + **Please use** :class:`Name` **over** :class:`str` **where possible for** + ``name``. :class:`Name` **objects should be initialized + once and then reused** in order to minimize lookup cost. """ return self.getElement(name).getValue() - def setElement( - self, name: BlpapiNameOrStr, value: SupportedElementTypes - ) -> None: + def setElement(self, name: Name, value: SupportedElementTypes) -> None: """Set this Element's sub-element with 'name' to the specified 'value'. Args: @@ -1029,12 +1122,18 @@ def setElement( - integers - float - string + - bytes - datetypes (``datetime.time``, ``datetime.date`` or ``datetime.datetime``) - :class:`Name` Any other ``value`` will be converted to a string with ``str`` function and then processed in the same way as string ``value``. + + Note: + **Please use** :class:`Name` **over** :class:`str` **where possible for** + ``name``. :class:`Name` **objects should be initialized + once and then reused** in order to minimize lookup cost. """ self.__assertIsValid() @@ -1067,6 +1166,7 @@ def setValue(self, value: SupportedElementTypes, index: int = 0) -> None: - integers - float - string + - bytes - datetypes (``datetime.time``, ``datetime.date`` or ``datetime.datetime``) - :class:`Name` @@ -1108,6 +1208,8 @@ def appendValue(self, value: SupportedElementTypes) -> None: Any other ``value`` will be converted to a string with ``str`` function and then processed in the same way as string ``value``. + + Arrays of bytes are not supported. """ self.setValue(value, internals.ELEMENT_INDEX_END) @@ -1129,7 +1231,7 @@ def appendElement(self) -> "Element": _ExceptionUtil.raiseOnError(res[0]) return Element(res[1], self._getDataHolder()) - def setChoice(self, selectionName: BlpapiNameOrStr) -> "Element": + def setChoice(self, selectionName: Name) -> "Element": """Set this :class:`Element`\ 's active element to ``selectionName``. Args: @@ -1182,8 +1284,8 @@ def fromPy( value (e.g :py:class:`str` or :py:class:`int`). Note: - Although :py:class:`str`, :py:class:`bytes`, :py:class:`bytearray`, - and :py:class:`memoryview` are sub-types of + Although :py:class:`str`, :py:class:`bytearray`, and + :py:class:`memoryview` are sub-types of :py:class:`collections.abc.Sequence`, :meth:`fromPy` treats them as scalars of type string and will use them to format scalar :class:`Element`\ s. If you wish to format an array @@ -1191,6 +1293,12 @@ def fromPy( them in a different :py:class:`collections.abc.Sequence`, like :py:class:`list`. + Note: + Although :py:class:`bytes` is sub-type of + :py:class:`collections.abc.Sequence`, :meth:`fromPy` treats it as a + scalar of type :py:class:`bytes` and will use it to format scalar + :class:`Element`. Arrays of :py:class:`bytes` are not supported. + Note: Using :meth:`fromPy` to format an :class:`Element` or one of its sub-:class:`Element`\ s that has already been formatted is not @@ -1290,7 +1398,7 @@ def fromPy( def _fromPyHelper( self, value: Union[Mapping, Sequence, SupportedElementTypes], - name: Optional[BlpapiNameOrStr] = None, + name: Optional[Name] = None, path: Optional[str] = None, ) -> None: """Helper method for `fromPy`. @@ -1437,6 +1545,7 @@ def getActivePathMessage(isArrayEntry: bool = False) -> str: DataType.DATE: Element.getValueAsDatetime, DataType.TIME: Element.getValueAsDatetime, DataType.DATETIME: Element.getValueAsDatetime, + DataType.BYTEARRAY: Element.getValueAsBytes, DataType.ENUMERATION: Element.getValueAsName, DataType.SEQUENCE: Element.getValueAsElement, DataType.CHOICE: Element.getValueAsElement, diff --git a/src/blpapi/eventformatter.py b/src/blpapi/eventformatter.py index 3174da9..f237b98 100644 --- a/src/blpapi/eventformatter.py +++ b/src/blpapi/eventformatter.py @@ -19,11 +19,10 @@ from .utils import get_handle, invoke_if_valid, isNonScalarSequence from .chandle import CHandle from . import typehints # pylint: disable=unused-import -from .typehints import BlpapiNameOrStr from collections import deque from collections.abc import Mapping -from typing import Any, Callable, Optional, Deque, Tuple +from typing import Any, Callable, Deque, Optional, Tuple, Union from typing import Mapping as MappingType @@ -93,6 +92,12 @@ class EventFormatter(CHandle): None, ) + __bytesTraits = ( + internals.blpapi_EventFormatter_setValueBytes, + None, + None, + ) + __defaultTraits = ( internals.blpapi_EventFormatter_setValueString, internals.blpapi_EventFormatter_appendValueString, @@ -103,10 +108,12 @@ class EventFormatter(CHandle): @staticmethod def __getTraits( value: Any, - ) -> Tuple[Callable, Callable, Optional[Callable]]: + ) -> Tuple[Callable, Optional[Callable], Optional[Callable]]: """Returns traits for value based on its type""" if isinstance(value, str): return EventFormatter.__stringTraits + if isinstance(value, bytes): + return EventFormatter.__bytesTraits if isinstance(value, bool): return EventFormatter.__boolTraits if isinstance(value, int): @@ -142,11 +149,11 @@ def __init__(self, event: "typehints.Event") -> None: selfhandle, internals.blpapi_EventFormatter_destroy ) self.__handle = selfhandle - self.latestMessageName: Optional[BlpapiNameOrStr] = None + self.latestMessageName: Optional[Union[Name, str]] = None def appendMessage( self, - messageType: BlpapiNameOrStr, + messageType: Name, topic: "typehints.Topic", sequenceNumber: Optional[int] = None, ) -> None: @@ -166,6 +173,11 @@ def appendMessage( wrapped or ``None`` is specified) than the last value used in any previous message on this ``topic``, otherwise the behavior is undefined. + + Note: + **Please use** :class:`Name` **over** :class:`str` **where possible for** + ``name``. :class:`Name` **objects should be initialized + once and then reused** in order to minimize lookup cost. """ name = getNamePair(messageType) @@ -189,7 +201,7 @@ def appendMessage( self.latestMessageName = messageType - def appendResponse(self, operationName: BlpapiNameOrStr) -> None: + def appendResponse(self, operationName: Name) -> None: """Append an (empty) response message for the specified ``operationName``. @@ -209,6 +221,11 @@ def appendResponse(self, operationName: BlpapiNameOrStr) -> None: Note: For ``PermissionRequest`` messages, use the ``PermissionResponse`` operation name. + + Note: + **Please use** :class:`Name` **over** :class:`str` **where possible for** + ``operationName``. :class:`Name` **objects should be initialized + once and then reused** in order to minimize lookup cost. """ name = getNamePair(operationName) _ExceptionUtil.raiseOnError( @@ -300,13 +317,13 @@ def appendRecapMessage( self.latestMessageName = "" - def setElement(self, name: BlpapiNameOrStr, value: Any) -> None: + def setElement(self, name: Name, value: Any) -> None: """Set an element in the :class:`Event` referenced by this :class:`EventFormatter`. Args: name: Name of the element to set - value (bool or str or int or float or ~datetime.datetime or Name): + value (bool or str or bytes or int or float or ~datetime.datetime or Name): Value to set the element to If the ``name`` is invalid for the current message, or if @@ -318,6 +335,11 @@ def setElement(self, name: BlpapiNameOrStr, value: Any) -> None: Clients wishing to format and publish null values (e.g. for the purpose of cache management) should *not* use this function; use :meth:`setElementNull` instead. + + Note: + **Please use** :class:`Name` **over** :class:`str` **where possible for** + ``name``. :class:`Name` **objects should be initialized + once and then reused** in order to minimize lookup cost. """ traits = EventFormatter.__getTraits(value) namepair = getNamePair(name) @@ -326,7 +348,7 @@ def setElement(self, name: BlpapiNameOrStr, value: Any) -> None: traits[0](self.__handle, namepair[0], namepair[1], value) ) - def setElementNull(self, name: BlpapiNameOrStr) -> None: + def setElementNull(self, name: Name) -> None: """Create a null element with the specified ``name``. Args: @@ -336,6 +358,11 @@ def setElementNull(self, name: BlpapiNameOrStr) -> None: Whether or not fields containing null values are published to subscribers depends on the details of the service and schema configuration. + + Note: + **Please use** :class:`Name` **over** :class:`str` **where possible for** + ``name``. :class:`Name` **objects should be initialized + once and then reused** in order to minimize lookup cost. """ namepair = getNamePair(name) _ExceptionUtil.raiseOnError( @@ -344,7 +371,7 @@ def setElementNull(self, name: BlpapiNameOrStr) -> None: ) ) - def pushElement(self, name: BlpapiNameOrStr) -> None: + def pushElement(self, name: Name) -> None: """Change the level at which this :class:`EventFormatter` is operating. Args: @@ -373,6 +400,11 @@ def pushElement(self, name: BlpapiNameOrStr) -> None: The element ``name`` must identify either a choice, a sequence or an array at the current level of the schema or the behavior is undefined. + + Note: + **Please use** :class:`Name` **over** :class:`str` **where possible for** + ``name``. :class:`Name` **objects should be initialized + once and then reused** in order to minimize lookup cost. """ namepair = getNamePair(name) _ExceptionUtil.raiseOnError( @@ -400,6 +432,8 @@ def appendValue(self, value: Any) -> None: Value to append """ traits = EventFormatter.__getTraits(value) + if traits[1] is None: + raise NotImplementedError("Arrays of bytes are not supported.") value = invoke_if_valid(traits[2], value) _ExceptionUtil.raiseOnError(traits[1](self.__handle, value)) @@ -408,7 +442,7 @@ def appendElement(self) -> None: internals.blpapi_EventFormatter_appendElement(self.__handle) ) - def fromPy(self, value: MappingType[BlpapiNameOrStr, Any]) -> None: + def fromPy(self, value: MappingType[Name, Any]) -> None: """ Format this :class:`EventFormatter`\ 's underlying :class:`Event` using ``value``. @@ -437,8 +471,8 @@ def fromPy(self, value: MappingType[BlpapiNameOrStr, Any]) -> None: scalar value (e.g. :py:class:`str` or :py:class:`int`). Note: - Although :py:class:`str`, :py:class:`bytes`, :py:class:`bytearray`, - and :py:class:`memoryview` are sub-types of + Although :py:class:`str`, :py:class:`bytearray`, and + :py:class:`memoryview` are sub-types of :py:class:`collections.abc.Sequence`, :meth:`fromPy` treats them as scalars of type string and will use them to format scalar :class:`Element`\ s. If you wish to format an array @@ -446,6 +480,12 @@ def fromPy(self, value: MappingType[BlpapiNameOrStr, Any]) -> None: them in a different :py:class:`collections.abc.Sequence`, like :py:class:`list`. + Note: + Although :py:class:`bytes` is sub-type of + :py:class:`collections.abc.Sequence`, :meth:`fromPy` treats it as a + scalar of type :py:class:`bytes` and will use it to format scalar + :class:`Element`. Arrays of :py:class:`bytes` are not supported. + For null :class:`Element`\ s: * A null complex :class:`Element` is formatted using an empty @@ -454,6 +494,11 @@ def fromPy(self, value: MappingType[BlpapiNameOrStr, Any]) -> None: * An empty array :class:`Element` is formatted using an empty :py:class:`collections.abc.Sequence`. + Note: + **Please use** :class:`Name` **over** :class:`str` **where possible for** + MappingType key. :class:`Name` **objects should be initialized + once and then reused** in order to minimize lookup cost. + Note: The behavior is undefined if :meth:`fromPy` is used to format an :class:`Event` that has already been formatted. Further formatting @@ -540,8 +585,8 @@ def fromPy(self, value: MappingType[BlpapiNameOrStr, Any]) -> None: def _fromPyHelper( self, value: Any, - name: Optional[BlpapiNameOrStr] = None, - dpath: Optional[Deque[BlpapiNameOrStr]] = None, + name: Optional[Union[Name, str]] = None, + dpath: Optional[Deque[Union[Name, str]]] = None, ) -> None: """ Args: @@ -552,6 +597,11 @@ def _fromPyHelper( is ``None``, format the :class:`Event` at the current level. dpath: represents the level at which this :class:`Eventformatter` is operating + + Note: + **Please use** :class:`Name` **over** :class:`str` **where possible for** + ``name``. :class:`Name` **objects should be initialized + once and then reused** in order to minimize lookup cost. """ path = deque() if dpath is None else dpath namestr = "" if name is None else str(name) @@ -590,7 +640,7 @@ def getPathErrorMessage() -> str: elif isNonScalarSequence(value): try: - self.pushElement(namestr) + self.pushElement(Name(namestr)) except Exception as exc: raise Exception( getPathErrorMessage() + _fromPyErrorTemplate.format(exc) @@ -635,9 +685,9 @@ def getPathErrorMessage() -> str: else: try: if value is None: - self.setElementNull(namestr) + self.setElementNull(Name(namestr)) else: - self.setElement(namestr, value) + self.setElement(Name(namestr), value) except IndexOutOfRangeException: path.append(namestr) errorMsg = ( diff --git a/src/blpapi/internals.py b/src/blpapi/internals.py index bc6307c..8a868f5 100644 --- a/src/blpapi/internals.py +++ b/src/blpapi/internals.py @@ -547,6 +547,9 @@ def blpapi_Element_getValueAsElement(element, index): def blpapi_Element_getValueAsName(element, index): return _internals.blpapi_Element_getValueAsName(element, index) +def blpapi_Element_getValueAsBytes(element, index): + return _internals.blpapi_Element_getValueAsBytes(element, index) + def blpapi_Element_getChoice(element): return _internals.blpapi_Element_getChoice(element) @@ -565,6 +568,9 @@ def blpapi_Element_setValueString(element, value, index): def blpapi_Element_setValueHighPrecisionDatetime(element, value, index): return _internals.blpapi_Element_setValueHighPrecisionDatetime(element, value, index) +def blpapi_Element_setValueBytes(element, value, index): + return _internals.blpapi_Element_setValueBytes(element, value, index) + def blpapi_Element_setValueFromName(element, value, index): return _internals.blpapi_Element_setValueFromName(element, value, index) @@ -583,6 +589,9 @@ def blpapi_Element_setElementString(element, nameString, name, value): def blpapi_Element_setElementHighPrecisionDatetime(element, nameString, name, value): return _internals.blpapi_Element_setElementHighPrecisionDatetime(element, nameString, name, value) +def blpapi_Element_setElementBytes(element, nameString, name, value): + return _internals.blpapi_Element_setElementBytes(element, nameString, name, value) + def blpapi_Element_setElementFromName(element, elementName, name, buffer): return _internals.blpapi_Element_setElementFromName(element, elementName, name, buffer) @@ -646,6 +655,9 @@ def blpapi_EventFormatter_setValueString(formatter, typeString, typeName, value) def blpapi_EventFormatter_setValueFromName(formatter, typeString, typeName, value): return _internals.blpapi_EventFormatter_setValueFromName(formatter, typeString, typeName, value) +def blpapi_EventFormatter_setValueBytes(formatter, typeString, typeName, value): + return _internals.blpapi_EventFormatter_setValueBytes(formatter, typeString, typeName, value) + def blpapi_EventFormatter_setValueNull(formatter, typeString, typeName): return _internals.blpapi_EventFormatter_setValueNull(formatter, typeString, typeName) @@ -739,6 +751,9 @@ def blpapi_MessageFormatter_setValueString(formatter, typeName, value): def blpapi_MessageFormatter_setValueFromName(formatter, typeName, value): return _internals.blpapi_MessageFormatter_setValueFromName(formatter, typeName, value) +def blpapi_MessageFormatter_setValueBytes(formatter, typeName, value): + return _internals.blpapi_MessageFormatter_setValueBytes(formatter, typeName, value) + def blpapi_MessageFormatter_setValueNull(formatter, typeName): return _internals.blpapi_MessageFormatter_setValueNull(formatter, typeName) @@ -1066,6 +1081,12 @@ def blpapi_SessionOptions_flushPublishedEventsTimeout(parameters): def blpapi_SessionOptions_bandwidthSaveModeDisabled(parameters): return _internals.blpapi_SessionOptions_bandwidthSaveModeDisabled(parameters) +def blpapi_SessionOptions_setApplicationIdentityKey(parameters, applicationIdentityKey, size): + return _internals.blpapi_SessionOptions_setApplicationIdentityKey(parameters, applicationIdentityKey, size) + +def blpapi_SessionOptions_applicationIdentityKey(size, parameters): + return _internals.blpapi_SessionOptions_applicationIdentityKey(size, parameters) + def blpapi_TlsOptions_destroy(parameters): return _internals.blpapi_TlsOptions_destroy(parameters) diff --git a/src/blpapi/internals_wrap.c b/src/blpapi/internals_wrap.c index 1b445cc..58726f1 100644 --- a/src/blpapi/internals_wrap.c +++ b/src/blpapi/internals_wrap.c @@ -2711,12 +2711,13 @@ SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyO #define SWIGTYPE_p_p_char swig_types[67] #define SWIGTYPE_p_p_void swig_types[68] #define SWIGTYPE_p_short swig_types[69] -#define SWIGTYPE_p_unsigned_char swig_types[70] -#define SWIGTYPE_p_unsigned_int swig_types[71] -#define SWIGTYPE_p_unsigned_long_long swig_types[72] -#define SWIGTYPE_p_unsigned_short swig_types[73] -static swig_type_info *swig_types[75]; -static swig_module_info swig_module = {swig_types, 74, 0, 0, 0, 0}; +#define SWIGTYPE_p_size_t swig_types[70] +#define SWIGTYPE_p_unsigned_char swig_types[71] +#define SWIGTYPE_p_unsigned_int swig_types[72] +#define SWIGTYPE_p_unsigned_long_long swig_types[73] +#define SWIGTYPE_p_unsigned_short swig_types[74] +static swig_type_info *swig_types[76]; +static swig_module_info swig_module = {swig_types, 75, 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) @@ -3138,7 +3139,6 @@ int setLoggerCallbackWrapper(PyObject *cb, int severity) blpapi_HighPrecisionDatetime_t blpapi_HighPrecisionDatetime_fromTimePoint_wrapper(blpapi_TimePoint_t original) { blpapi_HighPrecisionDatetime_t highPrecisionDatetime; - blpapi_Datetime_t datetime; blpapi_HighPrecisionDatetime_fromTimePoint( &highPrecisionDatetime, @@ -3925,6 +3925,20 @@ PyObject* getScalarValue(const blpapi_Element_t* element, const int index) { } return PyString_FromString(strValue); } + case BLPAPI_DATATYPE_BYTEARRAY: { + const char* bytesValue = 0; + size_t bytesLength = 0; + if (0 != blpapi_Element_getValueAsBytes(element, + &bytesValue, + &bytesLength, + index)) { + PyErr_SetString( + PyExc_Exception, + "Internal error getting bytes"); + return NULL; + } + return PyBytes_FromStringAndSize(bytesValue, bytesLength); + } case BLPAPI_DATATYPE_DATE: case BLPAPI_DATATYPE_TIME: case BLPAPI_DATATYPE_DATETIME: { @@ -4336,7 +4350,7 @@ void dispatchEventProxy(blpapi_Event_t *event, blpapi_Session_t *session, void * PyTuple_SET_ITEM(arglist, 0, SWIG_NewPointerObj(SWIG_as_voidptr(event), SWIGTYPE_p_blpapi_Event, 0)); - result = PyEval_CallObject(eventDispatcherFunc, arglist); + result = PyObject_CallObject(eventDispatcherFunc, arglist); Py_DECREF(arglist); Py_XDECREF(result); @@ -4393,7 +4407,7 @@ void dispatchProviderEventProxy(blpapi_Event_t *event, blpapi_ProviderSession_t PyTuple_SET_ITEM(arglist, 0, SWIG_NewPointerObj(SWIG_as_voidptr(event), SWIGTYPE_p_blpapi_Event, 0)); - result = PyEval_CallObject(eventDispatcherFunc, arglist); + result = PyObject_CallObject(eventDispatcherFunc, arglist); Py_DECREF(arglist); Py_XDECREF(result); @@ -7199,6 +7213,51 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsName(PyObject *SWIGUNUSEDPAR } +SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsBytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + char **arg2 = (char **) 0 ; + size_t *arg3 = (size_t *) 0 ; + size_t arg4 ; + void *argp1 = 0 ; + int res1 = 0 ; + char *temp2 = 0 ; + size_t tempLength2 = 0 ; + size_t val4 ; + int ecode4 = 0 ; + PyObject *swig_obj[2] ; + int result; + + { + arg2 = &temp2; + arg3 = &tempLength2; + } + if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_getValueAsBytes", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsBytes" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + ecode4 = SWIG_AsVal_size_t(swig_obj[1], &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_Element_getValueAsBytes" "', argument " "4"" of type '" "size_t""'"); + } + arg4 = (size_t)(val4); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Element_getValueAsBytes((struct blpapi_Element const *)arg1,(char const **)arg2,arg3,arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + { + resultobj = SWIG_Python_AppendOutput(resultobj, PyBytes_FromStringAndSize(*arg2, *arg3)); + } + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_blpapi_Element_getChoice(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; @@ -7443,6 +7502,52 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_setValueHighPrecisionDatetime(PyObject } +SWIGINTERN PyObject *_wrap_blpapi_Element_setValueBytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + char *arg2 = (char *) 0 ; + size_t arg3 ; + size_t arg4 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val4 ; + int ecode4 = 0 ; + PyObject *swig_obj[3] ; + int result; + + if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_setValueBytes", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setValueBytes" "', argument " "1"" of type '" "blpapi_Element_t *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + { + if (swig_obj[1] == Py_None) { + arg2 = 0; + arg3 = 0; + } + else { + arg2 = PyBytes_AsString(swig_obj[1]); + arg3 = PyBytes_Size(swig_obj[1]); + } + } + ecode4 = SWIG_AsVal_size_t(swig_obj[2], &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_Element_setValueBytes" "', argument " "4"" of type '" "size_t""'"); + } + arg4 = (size_t)(val4); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Element_setValueBytes(arg1,(char const *)arg2,arg3,arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_blpapi_Element_setValueFromName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; @@ -7753,6 +7858,63 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_setElementHighPrecisionDatetime(PyObje } +SWIGINTERN PyObject *_wrap_blpapi_Element_setElementBytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; + char *arg4 = (char *) 0 ; + size_t arg5 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject *swig_obj[4] ; + int result; + + if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_setElementBytes", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setElementBytes" "', argument " "1"" of type '" "blpapi_Element_t *""'"); + } + arg1 = (blpapi_Element_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setElementBytes" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_setElementBytes" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); + } + arg3 = (blpapi_Name_t *)(argp3); + { + if (swig_obj[3] == Py_None) { + arg4 = 0; + arg5 = 0; + } + else { + arg4 = PyBytes_AsString(swig_obj[3]); + arg5 = PyBytes_Size(swig_obj[3]); + } + } + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Element_setElementBytes(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3,(char const *)arg4,arg5); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + SWIGINTERN PyObject *_wrap_blpapi_Element_setElementFromName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; @@ -8813,6 +8975,63 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueFromName(PyObject *SWIG } +SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueBytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; + char *arg2 = (char *) 0 ; + blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; + char *arg4 = (char *) 0 ; + size_t arg5 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject *swig_obj[4] ; + int result; + + if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_setValueBytes", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_setValueBytes" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); + } + arg1 = (blpapi_EventFormatter_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_setValueBytes" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_setValueBytes" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); + } + arg3 = (blpapi_Name_t *)(argp3); + { + if (swig_obj[3] == Py_None) { + arg4 = 0; + arg5 = 0; + } + else { + arg4 = PyBytes_AsString(swig_obj[3]); + arg5 = PyBytes_Size(swig_obj[3]); + } + } + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_EventFormatter_setValueBytes(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3,(char const *)arg4,arg5); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueNull(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; @@ -9936,6 +10155,52 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_setValueFromName(PyObject *SW } +SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_setValueBytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; + blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; + char *arg3 = (char *) 0 ; + size_t arg4 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[3] ; + int result; + + if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_setValueBytes", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_setValueBytes" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); + } + arg1 = (blpapi_MessageFormatter_t *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_setValueBytes" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); + } + arg2 = (blpapi_Name_t *)(argp2); + { + if (swig_obj[2] == Py_None) { + arg3 = 0; + arg4 = 0; + } + else { + arg3 = PyBytes_AsString(swig_obj[2]); + arg4 = PyBytes_Size(swig_obj[2]); + } + } + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_MessageFormatter_setValueBytes(arg1,(struct blpapi_Name const *)arg2,(char const *)arg3,arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_setValueNull(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; @@ -13177,6 +13442,89 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_bandwidthSaveModeDisabled(PyObj } +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setApplicationIdentityKey(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + char *arg2 = (char *) 0 ; + size_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; + PyObject *swig_obj[3] ; + int result; + + if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setApplicationIdentityKey", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setApplicationIdentityKey" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setApplicationIdentityKey" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_SessionOptions_setApplicationIdentityKey" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = (size_t)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_setApplicationIdentityKey(arg1,(char const *)arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_applicationIdentityKey(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + char **arg1 = (char **) 0 ; + size_t *arg2 = (size_t *) 0 ; + blpapi_SessionOptions_t *arg3 = (blpapi_SessionOptions_t *) 0 ; + char *temp1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject *swig_obj[2] ; + int result; + + arg1 = &temp1; + if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_applicationIdentityKey", 2, 2, swig_obj)) SWIG_fail; + res2 = SWIG_ConvertPtr(swig_obj[0], &argp2,SWIGTYPE_p_size_t, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_applicationIdentityKey" "', argument " "2"" of type '" "size_t *""'"); + } + arg2 = (size_t *)(argp2); + res3 = SWIG_ConvertPtr(swig_obj[1], &argp3,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_SessionOptions_applicationIdentityKey" "', argument " "3"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg3 = (blpapi_SessionOptions_t *)(argp3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_applicationIdentityKey((char const **)arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg1)); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_TlsOptions_t *arg1 = (blpapi_TlsOptions_t *) 0 ; @@ -22525,18 +22873,21 @@ static PyMethodDef SwigMethods[] = { { "blpapi_Element_getValueAsHighPrecisionDatetime", _wrap_blpapi_Element_getValueAsHighPrecisionDatetime, METH_VARARGS, NULL}, { "blpapi_Element_getValueAsElement", _wrap_blpapi_Element_getValueAsElement, METH_VARARGS, NULL}, { "blpapi_Element_getValueAsName", _wrap_blpapi_Element_getValueAsName, METH_VARARGS, NULL}, + { "blpapi_Element_getValueAsBytes", _wrap_blpapi_Element_getValueAsBytes, METH_VARARGS, NULL}, { "blpapi_Element_getChoice", _wrap_blpapi_Element_getChoice, METH_O, NULL}, { "blpapi_Element_setValueBool", _wrap_blpapi_Element_setValueBool, METH_VARARGS, NULL}, { "blpapi_Element_setValueInt32", _wrap_blpapi_Element_setValueInt32, METH_VARARGS, NULL}, { "blpapi_Element_setValueInt64", _wrap_blpapi_Element_setValueInt64, METH_VARARGS, NULL}, { "blpapi_Element_setValueString", _wrap_blpapi_Element_setValueString, METH_VARARGS, NULL}, { "blpapi_Element_setValueHighPrecisionDatetime", _wrap_blpapi_Element_setValueHighPrecisionDatetime, METH_VARARGS, NULL}, + { "blpapi_Element_setValueBytes", _wrap_blpapi_Element_setValueBytes, METH_VARARGS, NULL}, { "blpapi_Element_setValueFromName", _wrap_blpapi_Element_setValueFromName, METH_VARARGS, NULL}, { "blpapi_Element_setElementBool", _wrap_blpapi_Element_setElementBool, METH_VARARGS, NULL}, { "blpapi_Element_setElementInt32", _wrap_blpapi_Element_setElementInt32, METH_VARARGS, NULL}, { "blpapi_Element_setElementInt64", _wrap_blpapi_Element_setElementInt64, METH_VARARGS, NULL}, { "blpapi_Element_setElementString", _wrap_blpapi_Element_setElementString, METH_VARARGS, NULL}, { "blpapi_Element_setElementHighPrecisionDatetime", _wrap_blpapi_Element_setElementHighPrecisionDatetime, METH_VARARGS, NULL}, + { "blpapi_Element_setElementBytes", _wrap_blpapi_Element_setElementBytes, METH_VARARGS, NULL}, { "blpapi_Element_setElementFromName", _wrap_blpapi_Element_setElementFromName, METH_VARARGS, NULL}, { "blpapi_Element_appendElement", _wrap_blpapi_Element_appendElement, METH_O, NULL}, { "blpapi_Element_setChoice", _wrap_blpapi_Element_setChoice, METH_VARARGS, NULL}, @@ -22558,6 +22909,7 @@ static PyMethodDef SwigMethods[] = { { "blpapi_EventFormatter_setValueHighPrecisionDatetime", _wrap_blpapi_EventFormatter_setValueHighPrecisionDatetime, METH_VARARGS, NULL}, { "blpapi_EventFormatter_setValueString", _wrap_blpapi_EventFormatter_setValueString, METH_VARARGS, NULL}, { "blpapi_EventFormatter_setValueFromName", _wrap_blpapi_EventFormatter_setValueFromName, METH_VARARGS, NULL}, + { "blpapi_EventFormatter_setValueBytes", _wrap_blpapi_EventFormatter_setValueBytes, METH_VARARGS, NULL}, { "blpapi_EventFormatter_setValueNull", _wrap_blpapi_EventFormatter_setValueNull, METH_VARARGS, NULL}, { "blpapi_EventFormatter_pushElement", _wrap_blpapi_EventFormatter_pushElement, METH_VARARGS, NULL}, { "blpapi_EventFormatter_popElement", _wrap_blpapi_EventFormatter_popElement, METH_O, NULL}, @@ -22589,6 +22941,7 @@ static PyMethodDef SwigMethods[] = { { "blpapi_MessageFormatter_setValueHighPrecisionDatetime", _wrap_blpapi_MessageFormatter_setValueHighPrecisionDatetime, METH_VARARGS, NULL}, { "blpapi_MessageFormatter_setValueString", _wrap_blpapi_MessageFormatter_setValueString, METH_VARARGS, NULL}, { "blpapi_MessageFormatter_setValueFromName", _wrap_blpapi_MessageFormatter_setValueFromName, METH_VARARGS, NULL}, + { "blpapi_MessageFormatter_setValueBytes", _wrap_blpapi_MessageFormatter_setValueBytes, METH_VARARGS, NULL}, { "blpapi_MessageFormatter_setValueNull", _wrap_blpapi_MessageFormatter_setValueNull, METH_VARARGS, NULL}, { "blpapi_MessageFormatter_pushElement", _wrap_blpapi_MessageFormatter_pushElement, METH_VARARGS, NULL}, { "blpapi_MessageFormatter_popElement", _wrap_blpapi_MessageFormatter_popElement, METH_O, NULL}, @@ -22688,6 +23041,8 @@ static PyMethodDef SwigMethods[] = { { "blpapi_SessionOptions_serviceDownloadTimeout", _wrap_blpapi_SessionOptions_serviceDownloadTimeout, METH_O, NULL}, { "blpapi_SessionOptions_flushPublishedEventsTimeout", _wrap_blpapi_SessionOptions_flushPublishedEventsTimeout, METH_O, NULL}, { "blpapi_SessionOptions_bandwidthSaveModeDisabled", _wrap_blpapi_SessionOptions_bandwidthSaveModeDisabled, METH_O, NULL}, + { "blpapi_SessionOptions_setApplicationIdentityKey", _wrap_blpapi_SessionOptions_setApplicationIdentityKey, METH_VARARGS, NULL}, + { "blpapi_SessionOptions_applicationIdentityKey", _wrap_blpapi_SessionOptions_applicationIdentityKey, METH_VARARGS, NULL}, { "blpapi_TlsOptions_destroy", _wrap_blpapi_TlsOptions_destroy, METH_O, NULL}, { "blpapi_TlsOptions_createFromFiles", _wrap_blpapi_TlsOptions_createFromFiles, METH_VARARGS, NULL}, { "blpapi_TlsOptions_createFromBlobs", _wrap_blpapi_TlsOptions_createFromBlobs, METH_VARARGS, NULL}, @@ -23038,6 +23393,7 @@ static swig_type_info _swigt__p_p_blpapi_Topic = {"_p_p_blpapi_Topic", "struct b static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_p_void = {"_p_p_void", "blpapi_SchemaTypeDefinition_t *|void **", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_short = {"_p_short", "short *|blpapi_Int16_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_size_t = {"_p_size_t", "size_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "unsigned char *|blpapi_UChar_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_unsigned_int = {"_p_unsigned_int", "blpapi_UInt32_t *|unsigned int *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_unsigned_long_long = {"_p_unsigned_long_long", "blpapi_UInt64_t *|unsigned long long *", 0, 0, (void*)0, 0}; @@ -23114,6 +23470,7 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_p_char, &_swigt__p_p_void, &_swigt__p_short, + &_swigt__p_size_t, &_swigt__p_unsigned_char, &_swigt__p_unsigned_int, &_swigt__p_unsigned_long_long, @@ -23190,6 +23547,7 @@ static swig_cast_info _swigc__p_p_blpapi_Topic[] = { {&_swigt__p_p_blpapi_Topic static swig_cast_info _swigc__p_p_char[] = { {&_swigt__p_p_char, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_p_void[] = { {&_swigt__p_p_void, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_short[] = { {&_swigt__p_short, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_size_t[] = { {&_swigt__p_size_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_unsigned_char[] = { {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_unsigned_int[] = { {&_swigt__p_unsigned_int, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_unsigned_long_long[] = { {&_swigt__p_unsigned_long_long, 0, 0, 0},{0, 0, 0, 0}}; @@ -23266,6 +23624,7 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_p_char, _swigc__p_p_void, _swigc__p_short, + _swigc__p_size_t, _swigc__p_unsigned_char, _swigc__p_unsigned_int, _swigc__p_unsigned_long_long, diff --git a/src/blpapi/message.py b/src/blpapi/message.py index b269f48..785198a 100644 --- a/src/blpapi/message.py +++ b/src/blpapi/message.py @@ -15,7 +15,7 @@ from typing import Set, Optional, Any, List from blpapi.datetime import _DatetimeUtil, UTC from . import typehints # pylint: disable=unused-import -from .typehints import BlpapiNameOrStr, BlpapiNameOrStrOrIndex +from .typehints import BlpapiNameOrIndex from .typehints import BlpapiMessageHandle, AnyPythonDatetime from .typehints import SupportedElementTypes from typing import Iterator as IteratorType @@ -110,7 +110,7 @@ def __str__(self) -> str: return self.toString() - def __getitem__(self, name: BlpapiNameOrStrOrIndex) -> Any: + def __getitem__(self, name: BlpapiNameOrIndex) -> Any: """Equivalent to :meth:`asElement().__getitem__()`. """ @@ -249,9 +249,15 @@ def correlationIds(self) -> List["typehints.CorrelationId"]: return res def hasElement( - self, name: BlpapiNameOrStr, excludeNullElements: bool = False + self, name: Name, excludeNullElements: bool = False ) -> bool: - """Equivalent to asElement().hasElement(name, excludeNullElements).""" + """Equivalent to asElement().hasElement(name, excludeNullElements). + + Note: + **Please use** :class:`Name` **over** :class:`str` **where possible for** + ``name``. :class:`Name` **objects should be initialized + once and then reused** in order to minimize lookup cost. + """ return self.asElement().hasElement(name, excludeNullElements) def numElements(self) -> int: @@ -259,34 +265,80 @@ def numElements(self) -> int: `.""" return self.asElement().numElements() - def getElement(self, name: BlpapiNameOrStrOrIndex) -> Element: + def getElement(self, name: BlpapiNameOrIndex) -> Element: """Equivalent to :meth:`asElement().getElement(name) - `.""" + `. + + Note: + **Please use** :class:`Name` **over** :class:`str` **where possible for** + ``name``. :class:`Name` **objects should be initialized + once and then reused** in order to minimize lookup cost. + """ return self.asElement().getElement(name) - def getElementAsBool(self, name: BlpapiNameOrStr) -> bool: + def getElementAsBool(self, name: Name) -> bool: """Equivalent to :meth:`asElement().getElementAsBool(name) - `.""" + `. + + Note: + **Please use** :class:`Name` **over** :class:`str` **where possible for** + ``name``. :class:`Name` **objects should be initialized + once and then reused** in order to minimize lookup cost. + """ return self.asElement().getElementAsBool(name) - def getElementAsString(self, name: BlpapiNameOrStr) -> str: + def getElementAsString(self, name: Name) -> str: """Equivalent to :meth:`asElement().getElementAsString(name) - `.""" + `. + + Note: + **Please use** :class:`Name` **over** :class:`str` **where possible for** + ``name``. :class:`Name` **objects should be initialized + once and then reused** in order to minimize lookup cost. + """ return self.asElement().getElementAsString(name) - def getElementAsInteger(self, name: BlpapiNameOrStr) -> int: + def getElementAsBytes(self, name: Name) -> bytes: + """Equivalent to :meth:`asElement().getElementAsBytes(name) + `. + + Note: + **Please use** :class:`Name` **over** :class:`str` **where possible for** + ``name``. :class:`Name` **objects should be initialized + once and then reused** in order to minimize lookup cost. + """ + return self.asElement().getElementAsBytes(name) + + def getElementAsInteger(self, name: Name) -> int: """Equivalent to :meth:`asElement().getElementAsInteger(name) - `.""" + `. + + Note: + **Please use** :class:`Name` **over** :class:`str` **where possible for** + ``name``. :class:`Name` **objects should be initialized + once and then reused** in order to minimize lookup cost. + """ return self.asElement().getElementAsInteger(name) - def getElementAsFloat(self, name: BlpapiNameOrStr) -> float: + def getElementAsFloat(self, name: Name) -> float: """Equivalent to :meth:`asElement().getElementAsFloat(name) - `.""" + `. + + Note: + **Please use** :class:`Name` **over** :class:`str` **where possible for** + ``name``. :class:`Name` **objects should be initialized + once and then reused** in order to minimize lookup cost. + """ return self.asElement().getElementAsFloat(name) - def getElementAsDatetime(self, name: BlpapiNameOrStr) -> AnyPythonDatetime: + def getElementAsDatetime(self, name: Name) -> AnyPythonDatetime: """Equivalent to :meth:`asElement().getElementAsDatetime(name) - `.""" + `. + + Note: + **Please use** :class:`Name` **over** :class:`str` **where possible for** + ``name``. :class:`Name` **objects should be initialized + once and then reused** in order to minimize lookup cost.""" return self.asElement().getElementAsDatetime(name) def getRequestId(self) -> Optional[str]: diff --git a/src/blpapi/name.py b/src/blpapi/name.py index 447df82..60439b4 100644 --- a/src/blpapi/name.py +++ b/src/blpapi/name.py @@ -11,13 +11,14 @@ from .utils import conv2str, get_handle, isstr from .chandle import CHandle from . import typehints # pylint: disable=unused-import -from .typehints import BlpapiNameOrStr, BlpapiNameHandle +from .typehints import BlpapiNameHandle # pylint: disable=broad-except class Name(CHandle): - """:class:`Name` represents a string in a form which is efficient for - comparison. + """:class:`Name` represents a string in a form which is efficient for hashing and + comparison, thus providing efficient lookup when used as a key in either + ordered or hash-based containers. :class:`Name` objects are used to identify and access the classes which define the schema - :class:`SchemaTypeDefinition`, @@ -30,7 +31,7 @@ class Name(CHandle): :class:`Name` objects constructed from equal strings will always compare equally. - Where possible, :class:`Name` objects should be initialized once and then + :class:`Name` objects should be initialized once and then reused. Creating a :class:`Name` object involves a search in a container requiring multiple string comparison operations. @@ -105,6 +106,15 @@ def __str__(self) -> str: return internals.blpapi_Name_string(self.__handle) + def __repr__(self) -> str: + """ + + Return a string that this Name represents. + Container's __str__ uses contained objects' __repr__ + + """ + return f"blpapi.Name('{self}')" + def __eq__(self, other: Any) -> bool: """x.__eq__(y) <==> x==y""" s = conv2str(other) @@ -123,7 +133,7 @@ def __hash__(self) -> int: def getNamePair( - name: BlpapiNameOrStr, + name: "Name", ) -> Union[Tuple[None, BlpapiNameHandle], Tuple[str, None]]: """Create a tuple that contains a name string and blpapi_Name_t*. @@ -139,6 +149,10 @@ def getNamePair( TypeError: If ``name`` is neither a :class:`Name` nor a string For internal use only. + + Note: + :class:`Name` **objects should be initialized + once and then reused** in order to minimize lookup cost. """ if isinstance(name, Name): diff --git a/src/blpapi/request.py b/src/blpapi/request.py index b0d5c19..b9e5305 100644 --- a/src/blpapi/request.py +++ b/src/blpapi/request.py @@ -12,7 +12,6 @@ from .typehints import BlpapiRequestHandle from .element import Element from .exception import _ExceptionUtil -from .typehints import BlpapiNameOrStr from . import internals from .chandle import CHandle from . import typehints # pylint: disable=unused-import @@ -56,24 +55,48 @@ def __str__(self) -> str: return self.toString() - def __getitem__(self, name: BlpapiNameOrStr) -> Any: + def __getitem__(self, name: "typehints.Name") -> Any: """Equivalent to :meth:`asElement().__getitem__(name) - `.""" + `. + + Note: + **Please use** :class:`Name` **over** :class:`str` **where possible for** + ``name``. :class:`Name` **objects should be initialized + once and then reused** in order to minimize lookup cost. + """ return self.asElement()[name] - def __setitem__(self, name: BlpapiNameOrStr, value: Any) -> None: + def __setitem__(self, name: "typehints.Name", value: Any) -> None: """Equivalent to :meth:`asElement().__setitem__(name, value) - `.""" + `. + + Note: + **Please use** :class:`Name` **over** :class:`str` **where possible for** + ``name``. :class:`Name` **objects should be initialized + once and then reused** in order to minimize lookup cost. + """ self.asElement()[name] = value - def set(self, name: BlpapiNameOrStr, value: Any) -> None: + def set(self, name: "typehints.Name", value: Any) -> None: """Equivalent to :meth:`asElement().setElement(name, value) - `.""" + `. + + Note: + **Please use** :class:`Name` **over** :class:`str` **where possible for** + ``name``. :class:`Name` **objects should be initialized + once and then reused** in order to minimize lookup cost. + """ self.asElement().setElement(name, value) - def append(self, name: BlpapiNameOrStr, value: Any) -> None: + def append(self, name: "typehints.Name", value: Any) -> None: """Equivalent to :meth:`getElement(name).appendValue(value) - `.""" + `. + + Note: + **Please use** :class:`Name` **over** :class:`str` **where possible for** + ``name``. :class:`Name` **objects should be initialized + once and then reused** in order to minimize lookup cost. + """ self.getElement(name).appendValue(value) def fromPy(self, requestDict: Mapping) -> None: @@ -108,9 +131,15 @@ def asElement(self) -> Element: self.__element = weakref.ref(el) # type: ignore return el - def getElement(self, name: BlpapiNameOrStr) -> Element: + def getElement(self, name: "typehints.Name") -> Element: """Equivalent to :meth:`asElement().getElement(name) - `.""" + `. + + Note: + **Please use** :class:`Name` **over** :class:`str` **where possible for** + ``name``. :class:`Name` **objects should be initialized + once and then reused** in order to minimize lookup cost. + """ return self.asElement().getElement(name) def getRequestId(self) -> str: diff --git a/src/blpapi/schema.py b/src/blpapi/schema.py index 2ae95b3..66ec9e0 100644 --- a/src/blpapi/schema.py +++ b/src/blpapi/schema.py @@ -20,7 +20,7 @@ from typing import Sequence, Set, Optional from typing import Iterator as IteratorType from . import typehints # pylint: disable=unused-import -from .typehints import BlpapiNameOrStr, BlpapiNameOrStrOrIndex +from .typehints import BlpapiNameOrIndex from .typehints import BlpapiSchemaElementDefinitionHandle from .typehints import BlpapiSchemaTypeDefinitionHandle from .exception import NotFoundException, IndexOutOfRangeException @@ -343,7 +343,7 @@ def isEnumerationType(self) -> bool: ) ) - def hasElementDefinition(self, name: BlpapiNameOrStr) -> bool: + def hasElementDefinition(self, name: Name) -> bool: """ Args: name: Item identifier @@ -354,6 +354,11 @@ def hasElementDefinition(self, name: BlpapiNameOrStr) -> bool: Raises: Exception: If ``name`` is neither a :class:`Name` nor a string. + + Note: + **Please use** :class:`Name` **over** :class:`str` **where possible for** + ``name``. :class:`Name` **objects should be initialized + once and then reused** in order to minimize lookup cost. """ namepair = getNamePair(name) @@ -364,7 +369,7 @@ def hasElementDefinition(self, name: BlpapiNameOrStr) -> bool: ) def getElementDefinition( - self, nameOrIndex: BlpapiNameOrStrOrIndex + self, nameOrIndex: BlpapiNameOrIndex ) -> "SchemaElementDefinition": """ Args: @@ -378,6 +383,11 @@ def getElementDefinition( ``hasElement(nameOrIndex) != True``. IndexOutOfRangeException: If ``nameOrIndex`` is an integer and ``nameOrIndex >= numElementDefinitions()`` + + Note: + **Please use** :class:`Name` **over** :class:`str` **where possible for** + ``nameOrIndex``. :class:`Name` **objects should be initialized + once and then reused** in order to minimize lookup cost. """ if not isinstance(nameOrIndex, int): diff --git a/src/blpapi/service.py b/src/blpapi/service.py index c40f97b..06654da 100644 --- a/src/blpapi/service.py +++ b/src/blpapi/service.py @@ -11,7 +11,7 @@ from typing import Optional, Set from typing import Iterator as IteratorType from . import typehints # pylint: disable=unused-import -from .typehints import BlpapiNameOrStr, BlpapiNameOrStrOrIndex +from .typehints import BlpapiNameOrIndex from .typehints import BlpapiServiceHandle, BlpapiOperationHandle from .event import Event from .name import getNamePair @@ -248,7 +248,7 @@ def description(self) -> str: """ return internals.blpapi_Service_description(self.__handle) - def hasOperation(self, name: BlpapiNameOrStr) -> bool: + def hasOperation(self, name: "typehints.Name") -> bool: """ Returns: ``True`` if the specified ``name`` is a valid @@ -262,7 +262,7 @@ def hasOperation(self, name: BlpapiNameOrStr) -> bool: ) ) - def getOperation(self, nameOrIndex: BlpapiNameOrStrOrIndex) -> Operation: + def getOperation(self, nameOrIndex: BlpapiNameOrIndex) -> Operation: """ Args: nameOrIndex: Name or index of the operation @@ -274,6 +274,12 @@ def getOperation(self, nameOrIndex: BlpapiNameOrStrOrIndex) -> Operation: Exception: If ``nameOrIndex`` is a string or a :class:`Name` and ``hasOperation(nameOrIndex) != True``, or if ``nameOrIndex`` is an integer and ``nameOrIndex >= numOperations()``. + + + Note: + **Please use** :class:`Name` **over** :class:`str` **where possible for** + ``nameOrIndex``. :class:`Name` **objects should be initialized + once and then reused** in order to minimize lookup cost. """ if not isinstance(nameOrIndex, int): @@ -306,7 +312,7 @@ def operations(self) -> IteratorType[Operation]: self, Service.numOperations, Service.getOperation ) - def hasEventDefinition(self, name: BlpapiNameOrStr) -> bool: + def hasEventDefinition(self, name: "typehints.Name") -> bool: """ Args: name: Event identifier @@ -317,6 +323,11 @@ def hasEventDefinition(self, name: BlpapiNameOrStr) -> bool: Raises: Exception: If ``name`` is neither a :class:`Name` nor a string. + + Note: + **Please use** :class:`Name` **over** :class:`str` **where possible for** + ``name``. :class:`Name` **objects should be initialized + once and then reused** in order to minimize lookup cost. """ names = getNamePair(name) @@ -327,7 +338,7 @@ def hasEventDefinition(self, name: BlpapiNameOrStr) -> bool: ) def getEventDefinition( - self, nameOrIndex: BlpapiNameOrStrOrIndex + self, nameOrIndex: BlpapiNameOrIndex ) -> SchemaElementDefinition: """Get the definition of a specified event. @@ -343,6 +354,11 @@ def getEventDefinition( ``hasEventDefinition(nameOrIndex) != True`` IndexOutOfRangeException: If ``nameOrIndex`` is an integer and ``nameOrIndex >= numEventDefinitions()`` + + Note: + **Please use** :class:`Name` **over** :class:`str` **where possible for** + ``nameOrIndex``. :class:`Name` **objects should be initialized + once and then reused** in order to minimize lookup cost. """ if not isinstance(nameOrIndex, int): diff --git a/src/blpapi/test/messageformatter.py b/src/blpapi/test/messageformatter.py index 6e25cba..2727dbf 100644 --- a/src/blpapi/test/messageformatter.py +++ b/src/blpapi/test/messageformatter.py @@ -7,13 +7,12 @@ from functools import singledispatch, update_wrapper from datetime import date, time, datetime from json import dumps -from typing import Any, Callable, Union +from typing import Any, Callable from blpapi import internals, Name from blpapi.typehints import ( AnyPythonDatetime, BlpapiMessageFormatterHandle, - BlpapiNameOrStr, SupportedElementTypes, ) from blpapi.datetime import _DatetimeUtil @@ -26,7 +25,6 @@ MIN_32BIT_INT, MIN_64BIT_INT, MAX_64BIT_INT, - STR_TYPES, ) @@ -93,9 +91,7 @@ def __init__(self, handle: BlpapiMessageFormatterHandle) -> None: def _handle(self) -> BlpapiMessageFormatterHandle: return self.__handle - def setElement( - self, name: BlpapiNameOrStr, value: SupportedElementTypes - ) -> None: + def setElement(self, name: Name, value: SupportedElementTypes) -> None: """Set the element with the specified ``name`` to the specified ``value`` in the current :class:`blpapi.Message` referenced by this :class:`MessageFormatter`. @@ -110,6 +106,12 @@ def setElement( - The element identified by ``name`` has already been set - The ``value`` cannot be assigned to the element identified by ``name`` + + Note: + **Please use** :class:`blpapi.Name` **over** :class:`str` **where possible for** + ``name``. :class:`blpapi.Name` **objects should be initialized + once and then reused** as each :class:`blpapi.Name` instance refers to an + entry in a global static table which grows in an unbounded manner. """ if isstr(name): name = Name(conv2str(name)) # type: ignore @@ -122,7 +124,7 @@ def _setElement(self, name: Name, value: SupportedElementTypes) -> None: Args: name (Name): Identifies the element which will be set to ``value`` - value (bool or str or int or float or date or time or + value (bool or str or bytes or int or float or date or time or datetime or Name or None): The value to assign to the specified element. @@ -134,7 +136,7 @@ def _setElement(self, name: Name, value: SupportedElementTypes) -> None: ``name`` """ raise TypeError( - f"The type of value {value} is not supported. Type" + f"The type of value {value!r} is not supported. Type" f" is {type(value)}. Please refer to the" " documentation for the supported types." ) @@ -206,18 +208,25 @@ def _(self, name: Name, _: Any) -> None: ) ) - def _setElementStr(self, name: Name, value: Union[bytes, str]) -> None: + @_setElement.register(str) + def _(self, name: Name, value: str) -> None: """Dispatch method for setting string types.""" _ExceptionUtil.raiseOnError( internals.blpapi_MessageFormatter_setValueString( - self.__handle, get_handle(name), conv2str(value) + self.__handle, get_handle(name), value ) ) - for _str_type in STR_TYPES: - _setElement.register(_str_type, _setElementStr) + @_setElement.register(bytes) + def _(self, name: Name, value: bytes) -> None: + """Dispatch method for setting `bytes` types.""" + _ExceptionUtil.raiseOnError( + internals.blpapi_MessageFormatter_setValueBytes( + self.__handle, get_handle(name), value + ) + ) - def pushElement(self, name: BlpapiNameOrStr) -> None: + def pushElement(self, name: Name) -> None: """Change the level at which this :class:`MessageFormatter` is operating to the element specified by ``name``. @@ -240,12 +249,18 @@ def pushElement(self, name: BlpapiNameOrStr) -> None: Raises: Exception: If the ``name`` is invalid for the current message or if the element identified by ``name`` has already been set. + + Note: + **Please use** :class:`blpapi.Name` **over** :class:`str` **where possible for** + ``name``. :class:`blpapi.Name` **objects should be initialized + once and then reused** as each :class:`blpapi.Name` instance refers to an + entry in a global static table which grows in an unbounded manner. """ if isstr(name): name = Name(conv2str(name)) # type: ignore _ExceptionUtil.raiseOnError( internals.blpapi_MessageFormatter_pushElement( - self.__handle, get_handle(name) # type: ignore + self.__handle, get_handle(name) ) ) @@ -335,17 +350,15 @@ def _(self, value: Name) -> None: ) ) - def _appendValueStr(self, value: Union[bytes, str]) -> None: + @appendValue.register(str) + def _(self, value: str) -> None: """Dispatch method for appending string types.""" _ExceptionUtil.raiseOnError( internals.blpapi_MessageFormatter_appendValueString( - self.__handle, conv2str(value) + self.__handle, value ) ) - for _str_type in STR_TYPES: - appendValue.register(_str_type, _appendValueStr) - def appendElement(self) -> None: """Create an array :class:`blpapi.Element` and append it to the :class:`blpapi.Element` on which this :class:`MessageFormatter` is diff --git a/src/blpapi/test/testutil.py b/src/blpapi/test/testutil.py index 909c294..41627b4 100644 --- a/src/blpapi/test/testutil.py +++ b/src/blpapi/test/testutil.py @@ -10,7 +10,6 @@ from blpapi.exception import _ExceptionUtil from blpapi.utils import conv2str, get_handle, isstr from blpapi.test import MessageProperties, MessageFormatter -from blpapi.typehints import BlpapiNameOrStr def createEvent(eventType: int) -> Event: @@ -130,7 +129,7 @@ def createTopic(service: Service, isActive: bool = True) -> Topic: def getAdminMessageDefinition( - messageName: BlpapiNameOrStr, + messageName: Name, ) -> SchemaElementDefinition: """Return the definition for an admin message of the specified ``messageName``. @@ -143,14 +142,23 @@ def getAdminMessageDefinition( Raises: Exception: If ``messageName`` does not name an admin message. + + Note: + **Please use** :class:`blpapi.Name` **over** :class:`str` **where possible for** + ``messageName``. :class:`blpapi.Name` **objects should be initialized + once and then reused** as each :class:`blpapi.Name` instance refers to an + entry in a global static table which grows in an unbounded manner. """ if isstr(messageName): + # although we hint that messageName should be a Name + # it may actually be a string, if users ignore this typehint + # in this case, we need to convert it messageName = Name(conv2str(messageName)) # type: ignore ( rc, schema_element_definition_handle, ) = internals.blpapi_TestUtil_getAdminMessageDefinition( - get_handle(messageName) # type: ignore + get_handle(messageName) ) _ExceptionUtil.raiseOnError(rc) schema_definition = SchemaElementDefinition( diff --git a/src/blpapi/typehints.py b/src/blpapi/typehints.py index cc2f9ad..81ee9db 100644 --- a/src/blpapi/typehints.py +++ b/src/blpapi/typehints.py @@ -31,10 +31,9 @@ from typing import Union, Any AnyPythonDatetime = Union[datetime.datetime, datetime.date, datetime.time] -BlpapiNameOrStr = Union[str, "Name", bytes] -BlpapiNameOrStrOrIndex = Union[str, "Name", bytes, int] +BlpapiNameOrIndex = Union["Name", int] SupportedElementTypes = Union[ - BlpapiNameOrStr, bool, int, float, AnyPythonDatetime, None + "Name", str, bytes, bool, int, float, AnyPythonDatetime, None ] # placeholders for opaque handles BlpapiAbstractSessionHandle = Any diff --git a/src/blpapi/utils.py b/src/blpapi/utils.py index e4b7d1a..fb5215b 100644 --- a/src/blpapi/utils.py +++ b/src/blpapi/utils.py @@ -162,7 +162,7 @@ def wrap_func(*args: Any, **kwargs: Any) -> Any: # `Event` formatting. # pylint: disable=deprecated-class,no-name-in-module def isNonScalarSequence(obj: Any) -> bool: - scalarTypes = STR_TYPES + (bytearray, memoryview) + scalarTypes = (str, bytes, bytearray, memoryview) return isinstance(obj, Sequence) and not isinstance(obj, scalarTypes) diff --git a/src/blpapi/version.py b/src/blpapi/version.py index c042efe..394e250 100644 --- a/src/blpapi/version.py +++ b/src/blpapi/version.py @@ -4,7 +4,7 @@ from . import versionhelper -__version__ = "3.18.3" +__version__ = "3.19.1" def print_version() -> None: From 015faff5a756d186d74de4b8be33b667491f5316 Mon Sep 17 00:00:00 2001 From: Marland Sitt Date: Wed, 8 Feb 2023 13:28:51 -0800 Subject: [PATCH 14/23] Bump to v3.19.3 --- PKG-INFO | 9 ++------ changelog.txt | 14 ++++++++++++ .../snippets/apiflds/FieldSearchRequests.py | 3 --- .../requestresponse/IntradayBarRequests.py | 22 ++++++++++--------- .../requestresponse/IntradayTickRequests.py | 10 ++++----- setup.py | 9 ++++++-- src/blpapi.egg-info/PKG-INFO | 9 ++------ src/blpapi/__init__.py | 8 ++++++- src/blpapi/debug.py | 10 ++++++--- src/blpapi/exception.py | 8 +++++-- src/blpapi/internals_wrap.c | 12 ++++++---- src/blpapi/version.py | 12 +++++++++- 12 files changed, 81 insertions(+), 45 deletions(-) diff --git a/PKG-INFO b/PKG-INFO index a05792a..39f6c77 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,19 +1,14 @@ Metadata-Version: 2.1 Name: blpapi -Version: 3.19.1 +Version: 3.19.3 Summary: Python SDK for Bloomberg BLPAPI Home-page: http://www.bloomberglabs.com/api/ Author: Bloomberg L.P. Author-email: open-tech@bloomberg.net -License: UNKNOWN -Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: Intended Audience :: Financial and Insurance Industry Classifier: License :: Other/Proprietary License Classifier: Topic :: Office/Business :: Financial -Requires-Python: >=3 +Requires-Python: >=3.7 License-File: License.txt - -UNKNOWN - diff --git a/changelog.txt b/changelog.txt index efa306c..7a9c325 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,17 @@ +Version 3.19.3: +============== +- Add 'expected_cpp_sdk_version()' method that returns a minimum compatible + BLPAPI C++ SDK version. +- Drop Python 3.6 support + Installation and use of the BLPAPI Python SDK now requires a Python 3.7+ runtime. +- Add Python 3.11 support +- Stability and performance improvements + +Version 3.19.2: +=============== +- Remove Python 3.6 support from DPKG +- Stability and performance improvements + Version 3.19.1: =============== - Stability and performance improvements diff --git a/examples/demoapps/snippets/apiflds/FieldSearchRequests.py b/examples/demoapps/snippets/apiflds/FieldSearchRequests.py index cce7bbd..ba6394a 100644 --- a/examples/demoapps/snippets/apiflds/FieldSearchRequests.py +++ b/examples/demoapps/snippets/apiflds/FieldSearchRequests.py @@ -1,6 +1,3 @@ -from demoapps.snippets.apiflds.CategorizedFieldSearchRequests import ( - SEARCH_SPEC, -) from snippets.apiflds import ApiFieldsRequestUtils from blpapi import Name diff --git a/examples/demoapps/snippets/requestresponse/IntradayBarRequests.py b/examples/demoapps/snippets/requestresponse/IntradayBarRequests.py index 818f6f2..8c26fea 100644 --- a/examples/demoapps/snippets/requestresponse/IntradayBarRequests.py +++ b/examples/demoapps/snippets/requestresponse/IntradayBarRequests.py @@ -2,16 +2,18 @@ from blpapi import Name -BAR_DATA = Name("barData") -BAR_TICK_DATA = Name("barTickData") -OPEN = Name("open") -HIGH = Name("high") -LOW = Name("low") -CLOSE = Name("close") -VOLUME = Name("volume") -NUM_EVENTS = Name("numEvents") -TIME = Name("time") -RESPONSE_ERROR = Name("responseError") +# Used with `Message.toPy`, meaning they should use strings rather than `Name` +BAR_DATA = "barData" +BAR_TICK_DATA = "barTickData" +OPEN = "open" +HIGH = "high" +LOW = "low" +CLOSE = "close" +VOLUME = "volume" +NUM_EVENTS = "numEvents" +TIME = "time" +RESPONSE_ERROR = "responseError" + SECURITY = Name("security") EVENT_TYPE = Name("eventType") INTERVAL = Name("interval") diff --git a/examples/demoapps/snippets/requestresponse/IntradayTickRequests.py b/examples/demoapps/snippets/requestresponse/IntradayTickRequests.py index ae75182..4d4a9d9 100644 --- a/examples/demoapps/snippets/requestresponse/IntradayTickRequests.py +++ b/examples/demoapps/snippets/requestresponse/IntradayTickRequests.py @@ -9,11 +9,11 @@ TYPE = Name("type") VALUE = Name("value") RESPONSE_ERROR = Name("responseError") -SECURITY = Name.getName("security") -EVENT_TYPES = Name.getName("eventTypes") -START_DATE_TIME = Name.getName("startDateTime") -END_DATE_TIME = Name.getName("endDateTime") -INCLUDE_CONDITION_CODES = Name.getName("includeConditionCodes") +SECURITY = Name("security") +EVENT_TYPES = Name("eventTypes") +START_DATE_TIME = Name("startDateTime") +END_DATE_TIME = Name("endDateTime") +INCLUDE_CONDITION_CODES = Name("includeConditionCodes") DATETIME_FORMAT = "%m/%d/%Y %H:%M" diff --git a/setup.py b/setup.py index 0f68877..70a77a7 100644 --- a/setup.py +++ b/setup.py @@ -57,9 +57,12 @@ def lib_in_release(): else: blpapiLibraryName = "blpapi3_32" +extraCompileArgs = [] extraLinkArgs = [] package_data = {} -if platform == "windows": +if platform == "linux": + extraCompileArgs = ["-Werror=implicit-function-declaration"] +elif platform == "windows": extraLinkArgs = ["/MANIFEST"] # Handle the very frequent case when user need to use Visual C++ 2010 @@ -85,6 +88,7 @@ def lib_in_release(): include_dirs=[blpapiIncludes], library_dirs=[blpapiLibraryPath], libraries=[blpapiLibraryName], + extra_compile_args=extraCompileArgs, extra_link_args=extraLinkArgs, ) @@ -94,6 +98,7 @@ def lib_in_release(): include_dirs=[blpapiIncludes], library_dirs=[blpapiLibraryPath], libraries=[blpapiLibraryName], + extra_compile_args=extraCompileArgs, extra_link_args=extraLinkArgs, ) @@ -108,7 +113,7 @@ def lib_in_release(): packages=["blpapi", "blpapi.test"], package_dir={"": "src"}, package_data=package_data, - python_requires=">=3", + python_requires=">=3.7", classifiers=[ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", diff --git a/src/blpapi.egg-info/PKG-INFO b/src/blpapi.egg-info/PKG-INFO index a05792a..39f6c77 100644 --- a/src/blpapi.egg-info/PKG-INFO +++ b/src/blpapi.egg-info/PKG-INFO @@ -1,19 +1,14 @@ Metadata-Version: 2.1 Name: blpapi -Version: 3.19.1 +Version: 3.19.3 Summary: Python SDK for Bloomberg BLPAPI Home-page: http://www.bloomberglabs.com/api/ Author: Bloomberg L.P. Author-email: open-tech@bloomberg.net -License: UNKNOWN -Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: Intended Audience :: Financial and Insurance Industry Classifier: License :: Other/Proprietary License Classifier: Topic :: Office/Business :: Financial -Requires-Python: >=3 +Requires-Python: >=3.7 License-File: License.txt - -UNKNOWN - diff --git a/src/blpapi/__init__.py b/src/blpapi/__init__.py index 95ccf6c..e6142ff 100644 --- a/src/blpapi/__init__.py +++ b/src/blpapi/__init__.py @@ -63,7 +63,13 @@ from .topic import Topic from .topiclist import TopicList from .zfputil import ZfpUtil -from .version import __version__, version, cpp_sdk_version, print_version +from .version import ( + __version__, + version, + cpp_sdk_version, + expected_cpp_sdk_version, + print_version, +) # blpapi.test module from .test import * diff --git a/src/blpapi/debug.py b/src/blpapi/debug.py index 420d5d7..d7c73a7 100644 --- a/src/blpapi/debug.py +++ b/src/blpapi/debug.py @@ -16,7 +16,7 @@ def debug_load_error(error: ImportError) -> ImportError: # Try to load just the version.py version_imported = True try: - from .version import version, cpp_sdk_version + from .version import version, cpp_sdk_version, expected_cpp_sdk_version except ImportError as version_error: import_error = _version_load_error(version_error) version_imported = False @@ -25,7 +25,7 @@ def debug_load_error(error: ImportError) -> ImportError: # If the version loading succeeds, the most likely reason for a failure # is a mismatch between C++ and Python SDKs. import_error = _version_mismatch_error( - error, version(), cpp_sdk_version() + error, version(), cpp_sdk_version(), expected_cpp_sdk_version() ) # Environment diagnostics currently only works for windows @@ -104,7 +104,10 @@ def _version_load_error(error: ImportError) -> str: def _version_mismatch_error( - error: ImportError, py_version: str, cpp_version: str + error: ImportError, + py_version: str, + cpp_version: str, + expected_cpp_sdk_version: str, ) -> str: """Called when "import version" succeeds after "import internals" fails Returns some debugging message. @@ -115,6 +118,7 @@ def _version_mismatch_error( Python SDK version {py_version} Found C++ SDK version {cpp_version} +Expected C++ SDK version >= {expected_cpp_sdk_version} Download and install the latest C++ SDK from: diff --git a/src/blpapi/exception.py b/src/blpapi/exception.py index 44286cc..8e65a8e 100644 --- a/src/blpapi/exception.py +++ b/src/blpapi/exception.py @@ -129,7 +129,9 @@ def __getErrorClass(errorCode: int) -> Type: ) @staticmethod - def raiseException(errorCode: int, description: str = None) -> None: + def raiseException( + errorCode: int, description: Optional[str] = None + ) -> None: """Throw the appropriate exception for the specified 'errorCode'.""" if description is None: description = internals.blpapi_getLastErrorDescription(errorCode) @@ -139,7 +141,9 @@ def raiseException(errorCode: int, description: str = None) -> None: raise errorClass(description, errorCode) @staticmethod - def raiseOnError(errorCode: int, description: str = None) -> None: + def raiseOnError( + errorCode: int, description: Optional[str] = None + ) -> None: """Throw the appropriate exception for the specified 'errorCode' if the 'errorCode != 0'. """ diff --git a/src/blpapi/internals_wrap.c b/src/blpapi/internals_wrap.c index 58726f1..b2a1b36 100644 --- a/src/blpapi/internals_wrap.c +++ b/src/blpapi/internals_wrap.c @@ -3946,8 +3946,9 @@ PyObject* getScalarValue(const blpapi_Element_t* element, const int index) { static PyObject* datetimeUtil = NULL; static PyObject* convertToNative = NULL; blpapi_HighPrecisionDatetime_t highPrecisionDatetimeBuffer; - PyObject* highPrecisionDatetimePyObj; - PyObject* pyDatetimeResult; + PyObject* datetimePyObj = NULL; + PyObject* highPrecisionDatetimePyObj = NULL; + PyObject* pyDatetimeResult = NULL; // initialize static variables once if (convertToNative == NULL) { @@ -4008,11 +4009,14 @@ PyObject* getScalarValue(const blpapi_Element_t* element, const int index) { "Internal error getting HighPrecisionDatetime"); return NULL; } + + datetimePyObj = Py_BuildValue("(O)", + highPrecisionDatetimePyObj); pyDatetimeResult = PyObject_Call( convertToNative, - Py_BuildValue("(O)", - highPrecisionDatetimePyObj), + datetimePyObj, NULL); + Py_DECREF(datetimePyObj); Py_DECREF(highPrecisionDatetimePyObj); return pyDatetimeResult; } diff --git a/src/blpapi/version.py b/src/blpapi/version.py index 394e250..9b3ab26 100644 --- a/src/blpapi/version.py +++ b/src/blpapi/version.py @@ -4,13 +4,15 @@ from . import versionhelper -__version__ = "3.19.1" +__version__ = "3.19.3" +__expected_cpp_sdk_version__ = "3.19.1" def print_version() -> None: """Print version information of BLPAPI python module and blpapi C++ SDK""" print("Python BLPAPI SDK version: ", version()) print("C++ BLPAPI SDK version: ", cpp_sdk_version()) + print("Expected C++ SDK version >= ", expected_cpp_sdk_version()) def version() -> str: @@ -32,3 +34,11 @@ def cpp_sdk_version() -> str: if commit_id != "Unknown": version_string += " (" + commit_id + ")" return version_string + + +def expected_cpp_sdk_version() -> str: + """ + Returns: + str: Expected (minimum compatible) BLPAPI C++ SDK dependency version + """ + return __expected_cpp_sdk_version__ From ec021c459196f5a5e50e2654897d839bc2d0c912 Mon Sep 17 00:00:00 2001 From: Marland Sitt Date: Tue, 18 Jul 2023 20:26:44 -0700 Subject: [PATCH 15/23] Bump to v3.20.1 --- PKG-INFO | 2 +- changelog.txt | 24 +- examples/demoapps/ApiFieldsExample.py | 2 - ...mentsVerificationRequestResponseExample.py | 2 - .../MultipleRequestsOverrideExample.py | 1 - .../demoapps/RequestServiceProviderExample.py | 1 - .../SubscriptionWithEventPollingExample.py | 1 - examples/demoapps/UserModeExample.py | 1 - .../demoapps/util/ConnectionAndAuthOptions.py | 59 ++- .../demoapps/util/events/SessionRouter.py | 1 - .../market-data-notifier/src/appconfig.py | 1 - .../market-data-notifier/src/application.py | 1 + .../market-data-notifier/src/authorizer.py | 1 + .../src/compute_engine.py | 1 + .../src/event_processor.py | 1 + .../market-data-notifier/src/notifier.py | 1 + .../market-data-notifier/src/subscriber.py | 1 + .../src/token_generator.py | 1 + examples/unittests/snippets/test_events.py | 2 + src/blpapi.egg-info/PKG-INFO | 2 +- src/blpapi/__init__.py | 2 +- src/blpapi/auth.py | 19 +- src/blpapi/datetime.py | 7 +- src/blpapi/element.py | 26 +- src/blpapi/event.py | 3 +- src/blpapi/internals.py | 24 +- src/blpapi/internals_wrap.c | 384 ++++++++++++++---- src/blpapi/name.py | 7 +- src/blpapi/providersession.py | 4 +- src/blpapi/schema.py | 8 +- src/blpapi/session.py | 40 +- src/blpapi/sessionoptions.py | 133 +++++- src/blpapi/test/messageformatter.py | 1 + src/blpapi/version.py | 4 +- 34 files changed, 588 insertions(+), 180 deletions(-) diff --git a/PKG-INFO b/PKG-INFO index 39f6c77..fafa6cf 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: blpapi -Version: 3.19.3 +Version: 3.20.1 Summary: Python SDK for Bloomberg BLPAPI Home-page: http://www.bloomberglabs.com/api/ Author: Bloomberg L.P. diff --git a/changelog.txt b/changelog.txt index 7a9c325..a93f1ab 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,21 @@ +Version 3.20.1: +=============== +- Support for application identity key (AIK) + The application identity key (AIK) is obtained through Bloomberg for registered + applications. It uniquely identifies the registered application for a given Session + and can be provided by 'SessionOptions.setApplicationIdentityKey'. + +- Stability and performance improvements + +Version 3.20.0: +=============== +- Add SOCKS5 proxy support + Users can configure, per endpoint in `SessionOptions`, a single SOCKS5 + proxy host by using `Socks5Config` class. SOCKS5 authentication is not + supported. + +- Stability and performance improvements + Version 3.19.3: ============== - Add 'expected_cpp_sdk_version()' method that returns a minimum compatible @@ -77,13 +95,13 @@ Version 3.17.0: to convert a 'Message' to 'dict' with 'Message.toPy'. 'Message's and 'Request's have 'dict'-like behavior with '__getitem__' and '__setitem__'. - + - A new method 'correlationId()' is added to 'blpapi.Message' A new method 'Message.correlationId()' is added to return the single CorrelationId associated with the message or None if the message has no CorrelationIds. If the message has multiple CorrelationIds, the first one is returned. - + - Constants for common used `Names` A new utility class `blpapi.Names` has been added with common message names. @@ -174,7 +192,7 @@ Version 3.15.0: - Simplified existing multi-phased approach to authorization so that both token generation and authorization can be done by the SDK. - If 'AuthOptions' instance is provided to the session through the - newly introduced 'setSessionIdentityOptions' (part of'SessionOptions'), + newly introduced 'setSessionIdentityOptions' (part of 'SessionOptions'), both token generation and subsequent authorization will be done by the SDK. Successfully authorized identity would become the default identity for the session that's used for all future requests unless diff --git a/examples/demoapps/ApiFieldsExample.py b/examples/demoapps/ApiFieldsExample.py index 8e73a05..e919cc7 100644 --- a/examples/demoapps/ApiFieldsExample.py +++ b/examples/demoapps/ApiFieldsExample.py @@ -99,7 +99,6 @@ def main(): if eventType == blpapi.Event.REQUEST_STATUS: for msg in event: if msg.messageType() == blpapi.Names.REQUEST_FAILURE: - # Request has failed, exit print(msg) done = True @@ -108,7 +107,6 @@ def main(): blpapi.Event.RESPONSE, blpapi.Event.PARTIAL_RESPONSE, ]: - processResponse(options.requestType, event) # Received the final response, no further response events are diff --git a/examples/demoapps/EntitlementsVerificationRequestResponseExample.py b/examples/demoapps/EntitlementsVerificationRequestResponseExample.py index 8831328..b4be7c1 100644 --- a/examples/demoapps/EntitlementsVerificationRequestResponseExample.py +++ b/examples/demoapps/EntitlementsVerificationRequestResponseExample.py @@ -77,7 +77,6 @@ def _handleException(self, session, _2, exception): self._stop(session) def _handleSessionStarted(self, session, _1, _2): - # Add the authorization message handlers after the session # started to only react to the authorization messages of users, # i.e., avoid those of the session identity. @@ -217,7 +216,6 @@ def _distributeResponses(self, userIdentifier, identity): self._distributeResponse(event, userIdentifier, identity) def _distributeResponse(self, event, userIdentifier, identity): - for msg in event: if msg.hasElement(RESPONSE_ERROR, excludeNullElements=True): continue diff --git a/examples/demoapps/MultipleRequestsOverrideExample.py b/examples/demoapps/MultipleRequestsOverrideExample.py index 84e7e6f..594ca17 100644 --- a/examples/demoapps/MultipleRequestsOverrideExample.py +++ b/examples/demoapps/MultipleRequestsOverrideExample.py @@ -11,7 +11,6 @@ def main(): - parser = ArgumentParser( formatter_class=RawTextHelpFormatter, description="Multiple requests with override example", diff --git a/examples/demoapps/RequestServiceProviderExample.py b/examples/demoapps/RequestServiceProviderExample.py index 3db7e0e..6886be0 100644 --- a/examples/demoapps/RequestServiceProviderExample.py +++ b/examples/demoapps/RequestServiceProviderExample.py @@ -36,7 +36,6 @@ def parseCmdLine(): def processEvent(event, session): - print("Server received an event") if event.eventType() == blpapi.Event.REQUEST: diff --git a/examples/demoapps/SubscriptionWithEventPollingExample.py b/examples/demoapps/SubscriptionWithEventPollingExample.py index eb131a3..0d70a24 100644 --- a/examples/demoapps/SubscriptionWithEventPollingExample.py +++ b/examples/demoapps/SubscriptionWithEventPollingExample.py @@ -83,7 +83,6 @@ def processSubscriptionEvents(session, maxEvents): f"Received init paint with RequestId {msg.getRequestId()}" ) else: - # SESSION_STATUS events can happen at any time and # should be handled as the session can be terminated, # e.g. session identity can be revoked at a later diff --git a/examples/demoapps/UserModeExample.py b/examples/demoapps/UserModeExample.py index 8f3d19d..ae10c94 100644 --- a/examples/demoapps/UserModeExample.py +++ b/examples/demoapps/UserModeExample.py @@ -77,7 +77,6 @@ def _handleSessionStarted( _event: blpapi.Event, _msg: blpapi.Message, ): - # Add the authorization messages handlers after the session # started to only react to the authorization messages of users, # i.e., avoid those of the session identity. diff --git a/examples/demoapps/util/ConnectionAndAuthOptions.py b/examples/demoapps/util/ConnectionAndAuthOptions.py index 416e69c..ff84b6f 100644 --- a/examples/demoapps/util/ConnectionAndAuthOptions.py +++ b/examples/demoapps/util/ConnectionAndAuthOptions.py @@ -1,5 +1,6 @@ from blpapi_import_helper import blpapi from argparse import Action +from collections import namedtuple _SESSION_IDENTITY_AUTH_OPTIONS = "sessionIdentityAuthOptions" @@ -69,16 +70,38 @@ def __call__(self, parser, args, values, option_string=None): setattr(args, _SESSION_IDENTITY_AUTH_OPTIONS, authOptions) +HostPort = namedtuple("HostPort", ["host", "port"]) +ServerAddress = namedtuple("ServerAddress", ["endpoint", "socks5"]) + + class HostAction(Action): """The action that parses host options from user input""" - def __call__(self, parser, args, values, option_string=None): - vals = values.split(":", 1) + @staticmethod + def _parseHostPort(parser, value): + vals = value.split(":", 1) if len(vals) != 2: + parser.error(f"Invalid host option '{value}'") + + maxPortValue = 65535 + if int(vals[1]) <= 0 or int(vals[1]) > maxPortValue: + parser.error( + f"Invalid port '{value}', value must be 1 through {maxPortValue}" + ) + return HostPort(vals[0], vals[1]) + + def __call__(self, parser, args, values, option_string=None): + endpointSocks5 = values.split("/", 1) + if len(endpointSocks5) == 0 or len(endpointSocks5) > 2: parser.error(f"Invalid host option '{values}'") + endpoint = HostAction._parseHostPort(parser, endpointSocks5[0]) + socks5 = None + if len(endpointSocks5) == 2: + socks5 = HostAction._parseHostPort(parser, endpointSocks5[1]) + hosts = getattr(args, self.dest) - hosts.append((vals[0], int(vals[1]))) + hosts.append(ServerAddress(endpoint, socks5)) class UserIdIpAction(Action): @@ -106,8 +129,9 @@ def addConnectionAndAuthOptions(parser, forClientServerSetup=False): "-H", "--host", dest="hosts", - help="server name or IP (default: 127.0.0.1:8194). Can be specified multiple times.", - metavar="host:port", + help="Endpoint host:port and optional SOCKS5 host:port to use to connect" + " (default: localhost:8194). Can be specified multiple times.", + metavar="host:port[/socks5Host:socks5Port]", action=HostAction, default=[], ) @@ -291,8 +315,20 @@ def createSessionOptions(options): ) else: sessionOptions = blpapi.SessionOptions() - for idx, host in enumerate(options.hosts): - sessionOptions.setServerAddress(host[0], host[1], idx) + for idx, serverAddress in enumerate(options.hosts): + socks5Config = ( + blpapi.Socks5Config( + serverAddress.socks5.host, int(serverAddress.socks5.port) + ) + if serverAddress.socks5 + else None + ) + sessionOptions.setServerAddress( + serverAddress.endpoint.host, + int(serverAddress.endpoint.port), + idx, + socks5Config, + ) if tlsOptions: sessionOptions.setTlsOptions(tlsOptions) @@ -300,9 +336,16 @@ def createSessionOptions(options): sessionOptions.setSessionIdentityOptions( options.sessionIdentityAuthOptions ) + + def serverAddressToString(server: ServerAddress): + tostr = ":".join(server.endpoint) + if server.socks5: + tostr = f"{tostr}/{':'.join(server.socks5)}" + return tostr + print( f"Connecting to " - f"{', '.join([h[0] + ':' + str(h[1]) for h in sessionOptions.serverAddresses()])}" + f"{', '.join([serverAddressToString(h) for h in options.hosts])}" ) return sessionOptions diff --git a/examples/demoapps/util/events/SessionRouter.py b/examples/demoapps/util/events/SessionRouter.py index 1e2cb5d..44cf6b1 100644 --- a/examples/demoapps/util/events/SessionRouter.py +++ b/examples/demoapps/util/events/SessionRouter.py @@ -11,7 +11,6 @@ def printEvent(event: blpapi.Event): class SessionRouter: - EventHandler = Callable[[blpapi.AbstractSession, blpapi.Event], None] MessageHandler = Callable[ [blpapi.AbstractSession, blpapi.Event, blpapi.Message], None diff --git a/examples/unittests/market-data-notifier/src/appconfig.py b/examples/unittests/market-data-notifier/src/appconfig.py index d794cdf..222c3de 100644 --- a/examples/unittests/market-data-notifier/src/appconfig.py +++ b/examples/unittests/market-data-notifier/src/appconfig.py @@ -7,7 +7,6 @@ class AuthOptionsAction(Action): # pylint: disable=too-few-public-methods """Parse authorization args from user input.""" def __call__(self, parser, args, values, option_string=None): - value = values vals = value.split("=", 1) diff --git a/examples/unittests/market-data-notifier/src/application.py b/examples/unittests/market-data-notifier/src/application.py index d9b1ae5..d09f9b0 100644 --- a/examples/unittests/market-data-notifier/src/application.py +++ b/examples/unittests/market-data-notifier/src/application.py @@ -2,6 +2,7 @@ from __future__ import print_function + # pylint: disable=too-few-public-methods class Application: """Custom application for demonstration purposes.""" diff --git a/examples/unittests/market-data-notifier/src/authorizer.py b/examples/unittests/market-data-notifier/src/authorizer.py index bd217d0..faaf1d9 100644 --- a/examples/unittests/market-data-notifier/src/authorizer.py +++ b/examples/unittests/market-data-notifier/src/authorizer.py @@ -8,6 +8,7 @@ TOKEN = blpapi.Name("token") + # pylint: disable=too-few-public-methods, too-many-branches class Authorizer: """Helper for authorization.""" diff --git a/examples/unittests/market-data-notifier/src/compute_engine.py b/examples/unittests/market-data-notifier/src/compute_engine.py index 6497ab8..9aaa203 100644 --- a/examples/unittests/market-data-notifier/src/compute_engine.py +++ b/examples/unittests/market-data-notifier/src/compute_engine.py @@ -1,5 +1,6 @@ """Dummy 'compute engine' for testing purposes""" + # pylint: disable=too-few-public-methods, no-init, no-self-use class ComputeEngine: """A class that does some 'financial computation'.""" diff --git a/examples/unittests/market-data-notifier/src/event_processor.py b/examples/unittests/market-data-notifier/src/event_processor.py index db6820b..eb7f64b 100644 --- a/examples/unittests/market-data-notifier/src/event_processor.py +++ b/examples/unittests/market-data-notifier/src/event_processor.py @@ -6,6 +6,7 @@ TOKEN = blpapi.Name("token") LAST_PRICE = blpapi.Name("LAST_PRICE") + # pylint: disable=too-few-public-methods class EventProcessor: """Custom EventHandler implementation for demonstration purposes.""" diff --git a/examples/unittests/market-data-notifier/src/notifier.py b/examples/unittests/market-data-notifier/src/notifier.py index 8d5efee..21db227 100644 --- a/examples/unittests/market-data-notifier/src/notifier.py +++ b/examples/unittests/market-data-notifier/src/notifier.py @@ -1,6 +1,7 @@ """Sample class for testing purposes.""" from __future__ import print_function + # pylint: disable=no-init,no-self-use class Notifier: """ diff --git a/examples/unittests/market-data-notifier/src/subscriber.py b/examples/unittests/market-data-notifier/src/subscriber.py index 2bc5a35..fdf49e4 100644 --- a/examples/unittests/market-data-notifier/src/subscriber.py +++ b/examples/unittests/market-data-notifier/src/subscriber.py @@ -2,6 +2,7 @@ import blpapi + # pylint: disable=too-few-public-methods,too-many-arguments class Subscriber: """Custom Subscriber implementation for demonstration purposes.""" diff --git a/examples/unittests/market-data-notifier/src/token_generator.py b/examples/unittests/market-data-notifier/src/token_generator.py index bd117bf..6c01700 100644 --- a/examples/unittests/market-data-notifier/src/token_generator.py +++ b/examples/unittests/market-data-notifier/src/token_generator.py @@ -6,6 +6,7 @@ TOKEN_FAILURE = blpapi.Names.TOKEN_GENERATION_FAILURE TOKEN = blpapi.Name("token") + # pylint: disable=too-few-public-methods class TokenGenerator: """Generates a token for later authorization.""" diff --git a/examples/unittests/snippets/test_events.py b/examples/unittests/snippets/test_events.py index 3b3115a..a8f2bf7 100644 --- a/examples/unittests/snippets/test_events.py +++ b/examples/unittests/snippets/test_events.py @@ -100,6 +100,7 @@ def testSessionConnectionUp(self): "serverId": "ny-hostname", "encryptionStatus": "Clear", "compressionStatus": "Uncompressed", + "socks5Proxy": "socks5Host:1080", } formatter.formatMessageDict(content) @@ -118,6 +119,7 @@ def testSessionConnectionDown(self): content = { "server": "12.34.56.78:8194", "serverId": "ny-hostname", + "socks5Proxy": "socks5Host:1080", } formatter.formatMessageDict(content) diff --git a/src/blpapi.egg-info/PKG-INFO b/src/blpapi.egg-info/PKG-INFO index 39f6c77..fafa6cf 100644 --- a/src/blpapi.egg-info/PKG-INFO +++ b/src/blpapi.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: blpapi -Version: 3.19.3 +Version: 3.20.1 Summary: Python SDK for Bloomberg BLPAPI Home-page: http://www.bloomberglabs.com/api/ Author: Bloomberg L.P. diff --git a/src/blpapi/__init__.py b/src/blpapi/__init__.py index e6142ff..6af8ceb 100644 --- a/src/blpapi/__init__.py +++ b/src/blpapi/__init__.py @@ -58,7 +58,7 @@ SubscriptionPreprocessError, SubscriptionPreprocessMode, ) -from .sessionoptions import SessionOptions, TlsOptions +from .sessionoptions import SessionOptions, TlsOptions, Socks5Config from .subscriptionlist import SubscriptionList from .topic import Topic from .topiclist import TopicList diff --git a/src/blpapi/auth.py b/src/blpapi/auth.py index cbd2587..027337e 100644 --- a/src/blpapi/auth.py +++ b/src/blpapi/auth.py @@ -2,6 +2,7 @@ """Provide a configuration to specify the settings used for authorization.""" +from __future__ import annotations from typing import Callable, Union from .typehints import ( BlpapiAuthOptionsHandle, @@ -24,7 +25,7 @@ class AuthOptions(CHandle): def __init__( self, handle: BlpapiAuthOptionsHandle, - **kwargs: Union[BlpapiAuthAppHandle, BlpapiAuthTokenHandle] + **kwargs: Union[BlpapiAuthAppHandle, BlpapiAuthTokenHandle], ) -> None: """For internal use only.""" noop = lambda *args: None @@ -37,7 +38,7 @@ def __init__( self._token_dtor = internals.blpapi_AuthToken_destroy @classmethod - def createWithUser(cls: Callable, user: "AuthUser") -> "AuthOptions": + def createWithUser(cls: Callable, user: AuthUser) -> AuthOptions: """Creates an :class:`AuthOptions` instance for User Mode with the Operating System Login (Domain/User), Active Directory, or Email. @@ -59,7 +60,7 @@ def createWithUser(cls: Callable, user: "AuthUser") -> "AuthOptions": return cls(authOptions_handle) @classmethod - def createWithApp(cls: Callable, appName: str) -> "AuthOptions": + def createWithApp(cls: Callable, appName: str) -> AuthOptions: """Create an :class:`AuthOptions` instance for Application Mode. Args: @@ -79,7 +80,7 @@ def createWithApp(cls: Callable, appName: str) -> "AuthOptions": return cls(authOptions_handle, app_handle=app_handle) @classmethod - def createWithToken(cls: Callable, token: str) -> "AuthOptions": + def createWithToken(cls: Callable, token: str) -> AuthOptions: """Create an :class:`AuthOptions` instance for Manual Token Mode. Args: @@ -100,8 +101,8 @@ def createWithToken(cls: Callable, token: str) -> "AuthOptions": @classmethod def createWithUserAndApp( - cls: Callable, user: "AuthUser", appName: str - ) -> "AuthOptions": + cls: Callable, user: AuthUser, appName: str + ) -> AuthOptions: """Create an :class:`AuthOptions` instance for User and Application Mode. @@ -164,7 +165,7 @@ def __init__(self, handle: BlpapiAuthUserHandle) -> None: self.__handle = handle # pylint: disable=unused-private-member @classmethod - def createWithLogonName(cls: Callable) -> "AuthUser": + def createWithLogonName(cls: Callable) -> AuthUser: """Creates an :class:`AuthUser` instance configured for Operating System Login (Domain/User) authorization mode (OS_LOGON). @@ -178,7 +179,7 @@ def createWithLogonName(cls: Callable) -> "AuthUser": @classmethod def createWithActiveDirectoryProperty( cls: Callable, propertyName: str - ) -> "AuthUser": + ) -> AuthUser: """Creates an :class:`AuthUser` instance configured for Active Directory authorization mode (DIRECTORY_SERVICE). @@ -204,7 +205,7 @@ def createWithActiveDirectoryProperty( @classmethod def createWithManualOptions( cls: Callable, userId: str, ipAddress: str - ) -> "AuthUser": + ) -> AuthUser: """Creates an :class:`AuthUser` instance configured for manual authorization. diff --git a/src/blpapi/datetime.py b/src/blpapi/datetime.py index f64c5d8..52a9a61 100644 --- a/src/blpapi/datetime.py +++ b/src/blpapi/datetime.py @@ -2,6 +2,7 @@ """Utilities that deal with blpapi.Datetime data type""" +from __future__ import annotations import datetime as _dt from typing import Any, Optional @@ -76,15 +77,15 @@ def __hash__(self) -> int: """x.__hash__() <==> hash(x)""" return self.getOffsetInMinutes() - def __eq__(self, other: "FixedOffset") -> bool: # type: ignore # mypy wants us to accept arbitrary object and check isinstance() + def __eq__(self, other: FixedOffset) -> bool: # type: ignore # mypy wants us to accept arbitrary object and check isinstance() """Let the equality operator work based on the time delta.""" return self.getOffsetInMinutes() == other.getOffsetInMinutes() - def __lt__(self, other: "FixedOffset") -> bool: + def __lt__(self, other: FixedOffset) -> bool: """Let the comparison operator work based on the time delta.""" return self.getOffsetInMinutes() < other.getOffsetInMinutes() - def __le__(self, other: "FixedOffset") -> bool: + def __le__(self, other: FixedOffset) -> bool: """Let the comparison operator work based on the time delta.""" return self.getOffsetInMinutes() <= other.getOffsetInMinutes() diff --git a/src/blpapi/element.py b/src/blpapi/element.py index d4c8f90..d68cc1b 100644 --- a/src/blpapi/element.py +++ b/src/blpapi/element.py @@ -7,6 +7,7 @@ """ +from __future__ import annotations from .exception import _ExceptionUtil from .exception import UnsupportedOperationException from .datetime import _DatetimeUtil @@ -36,6 +37,7 @@ Union, ) + # pylint: disable=protected-access,too-many-return-statements,too-many-public-methods class ElementIterator(IteratorABC): """An iterator over the objects within an :class:`Element`. @@ -45,11 +47,11 @@ class ElementIterator(IteratorABC): value(s). """ - def __init__(self, element: "Element") -> None: + def __init__(self, element: Element) -> None: self._element = element self._index = 0 - def __next__(self) -> Union[SupportedElementTypes, "Element"]: + def __next__(self) -> Union[SupportedElementTypes, Element]: i = self._index self._index += 1 @@ -233,7 +235,7 @@ def __init__( self, handle: "typehints.BlpapiElementHandle", dataHolder: Optional[ - Union["Element", "typehints.Message", "typehints.Request"] + Union[Element, "typehints.Message", "typehints.Request"] ], ) -> None: noop = lambda *args: None @@ -243,7 +245,7 @@ def __init__( def _getDataHolder( self, - ) -> Optional[Union["Element", "typehints.Message", "typehints.Request"]]: + ) -> Optional[Union[Element, "typehints.Message", "typehints.Request"]]: """Return the owner of underlying data. For internal use.""" return self if self.__dataHolder is None else self.__dataHolder @@ -267,7 +269,7 @@ def __str__(self) -> str: def __getitem__( self, nameOrIndex: BlpapiNameOrIndex - ) -> Union[SupportedElementTypes, "Element"]: + ) -> Union[SupportedElementTypes, Element]: """ Args: nameOrIndex: The :class:`Name` identifying the @@ -622,7 +624,7 @@ def toString(self, level: int = 0, spacesPerLevel: int = 4) -> str: self.__handle, level, spacesPerLevel ) - def getElement(self, nameOrIndex: BlpapiNameOrIndex) -> "Element": + def getElement(self, nameOrIndex: BlpapiNameOrIndex) -> Element: """ Args: nameOrIndex: Sub-element identifier @@ -709,7 +711,7 @@ def hasElement( ) return bool(res) - def getChoice(self) -> "Element": + def getChoice(self) -> Element: """ Returns: The selection name of this element as :class:`Element`. @@ -859,7 +861,7 @@ def getValueAsName(self, index: int = 0) -> Name: _ExceptionUtil.raiseOnError(res[0]) return Name._createInternally(res[1]) - def getValueAsElement(self, index: int = 0) -> "Element": + def getValueAsElement(self, index: int = 0) -> Element: """ Args: index: Index of the value in the element @@ -880,7 +882,7 @@ def getValueAsElement(self, index: int = 0) -> "Element": def getValue( self, index: int = 0 - ) -> Union[SupportedElementTypes, "Element"]: + ) -> Union[SupportedElementTypes, Element]: """ Args: index: Index of the value in the element @@ -1081,7 +1083,7 @@ def getElementAsName(self, name: Name) -> Name: def getElementValue( self, name: Name - ) -> Union[SupportedElementTypes, "Element"]: + ) -> Union[SupportedElementTypes, Element]: """ Args: name: Sub-element identifier @@ -1214,7 +1216,7 @@ def appendValue(self, value: SupportedElementTypes) -> None: self.setValue(value, internals.ELEMENT_INDEX_END) - def appendElement(self) -> "Element": + def appendElement(self) -> Element: """Append a new element to this array :class:`Element`. Returns: @@ -1231,7 +1233,7 @@ def appendElement(self) -> "Element": _ExceptionUtil.raiseOnError(res[0]) return Element(res[1], self._getDataHolder()) - def setChoice(self, selectionName: Name) -> "Element": + def setChoice(self, selectionName: Name) -> Element: """Set this :class:`Element`\ 's active element to ``selectionName``. Args: diff --git a/src/blpapi/event.py b/src/blpapi/event.py index 4f54225..a54fd2e 100644 --- a/src/blpapi/event.py +++ b/src/blpapi/event.py @@ -32,6 +32,7 @@ raise Exception("Failed to get token") """ +from __future__ import annotations from typing import Iterator as IteratorType, Optional, Set from collections.abc import Iterator as IteratorABC from .message import Message @@ -51,7 +52,7 @@ class MessageIterator(CHandle, IteratorABC): :class:`Event` and :class:`Message` objects. """ - def __init__(self, event: "Event") -> None: + def __init__(self, event: Event) -> None: selfhandle = internals.blpapi_MessageIterator_create(get_handle(event)) super(MessageIterator, self).__init__( selfhandle, internals.blpapi_MessageIterator_destroy diff --git a/src/blpapi/internals.py b/src/blpapi/internals.py index 8a868f5..75b0146 100644 --- a/src/blpapi/internals.py +++ b/src/blpapi/internals.py @@ -228,6 +228,9 @@ def blpapi_Message_printHelper(message, level, spacesPerLevel): def blpapi_SessionOptions_printHelper(sessionOptions, level, spacesPerLevel): return _internals.blpapi_SessionOptions_printHelper(sessionOptions, level, spacesPerLevel) +def blpapi_Socks5Config_printHelper(socks5Config, level, spacesPerLevel): + return _internals.blpapi_Socks5Config_printHelper(socks5Config, level, spacesPerLevel) + def blpapi_TestUtil_serializeServiceHelper(service): return _internals.blpapi_TestUtil_serializeServiceHelper(service) @@ -919,6 +922,12 @@ def blpapi_AuthToken_destroy(token): def blpapi_getLastErrorDescription(resultCode): return _internals.blpapi_getLastErrorDescription(resultCode) +def blpapi_Socks5Config_create(hostname, hostname_size, port): + return _internals.blpapi_Socks5Config_create(hostname, hostname_size, port) + +def blpapi_Socks5Config_destroy(socks5Config): + return _internals.blpapi_Socks5Config_destroy(socks5Config) + def blpapi_SessionOptions_create(): return _internals.blpapi_SessionOptions_create() @@ -934,6 +943,9 @@ def blpapi_SessionOptions_setServerPort(parameters, serverPort): def blpapi_SessionOptions_setServerAddress(parameters, serverHost, serverPort, index): return _internals.blpapi_SessionOptions_setServerAddress(parameters, serverHost, serverPort, index) +def blpapi_SessionOptions_setServerAddressWithProxy(parameters, serverHost, serverPort, socks5Config, index): + return _internals.blpapi_SessionOptions_setServerAddressWithProxy(parameters, serverHost, serverPort, socks5Config, index) + def blpapi_SessionOptions_removeServerAddress(parameters, index): return _internals.blpapi_SessionOptions_removeServerAddress(parameters, index) @@ -1015,8 +1027,8 @@ def blpapi_SessionOptions_serverPort(parameters): def blpapi_SessionOptions_numServerAddresses(parameters): return _internals.blpapi_SessionOptions_numServerAddresses(parameters) -def blpapi_SessionOptions_getServerAddress(parameters, index): - return _internals.blpapi_SessionOptions_getServerAddress(parameters, index) +def blpapi_SessionOptions_getServerAddressWithProxy(parameters, index): + return _internals.blpapi_SessionOptions_getServerAddressWithProxy(parameters, index) def blpapi_SessionOptions_connectTimeout(parameters): return _internals.blpapi_SessionOptions_connectTimeout(parameters) @@ -1081,11 +1093,11 @@ def blpapi_SessionOptions_flushPublishedEventsTimeout(parameters): def blpapi_SessionOptions_bandwidthSaveModeDisabled(parameters): return _internals.blpapi_SessionOptions_bandwidthSaveModeDisabled(parameters) -def blpapi_SessionOptions_setApplicationIdentityKey(parameters, applicationIdentityKey, size): - return _internals.blpapi_SessionOptions_setApplicationIdentityKey(parameters, applicationIdentityKey, size) +def blpapi_SessionOptions_setApplicationIdentityKey(parameters, applicationIdentityKey): + return _internals.blpapi_SessionOptions_setApplicationIdentityKey(parameters, applicationIdentityKey) -def blpapi_SessionOptions_applicationIdentityKey(size, parameters): - return _internals.blpapi_SessionOptions_applicationIdentityKey(size, parameters) +def blpapi_SessionOptions_applicationIdentityKey(parameters): + return _internals.blpapi_SessionOptions_applicationIdentityKey(parameters) def blpapi_TlsOptions_destroy(parameters): return _internals.blpapi_TlsOptions_destroy(parameters) diff --git a/src/blpapi/internals_wrap.c b/src/blpapi/internals_wrap.c index b2a1b36..7d7ce0d 100644 --- a/src/blpapi/internals_wrap.c +++ b/src/blpapi/internals_wrap.c @@ -2676,48 +2676,49 @@ SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyO #define SWIGTYPE_p_blpapi_ServiceRegistrationOptions swig_types[32] #define SWIGTYPE_p_blpapi_Session swig_types[33] #define SWIGTYPE_p_blpapi_SessionOptions swig_types[34] -#define SWIGTYPE_p_blpapi_StreamWriter_t swig_types[35] -#define SWIGTYPE_p_blpapi_SubscriptionItrerator swig_types[36] -#define SWIGTYPE_p_blpapi_SubscriptionList swig_types[37] -#define SWIGTYPE_p_blpapi_TimePoint swig_types[38] -#define SWIGTYPE_p_blpapi_TlsOptions swig_types[39] -#define SWIGTYPE_p_blpapi_Topic swig_types[40] -#define SWIGTYPE_p_blpapi_TopicList swig_types[41] -#define SWIGTYPE_p_char swig_types[42] -#define SWIGTYPE_p_double swig_types[43] -#define SWIGTYPE_p_f_p_q_const__struct_blpapi_CorrelationId_t__p_q_const__char_int_p_q_const__char_p_void__void swig_types[44] -#define SWIGTYPE_p_f_p_struct_blpapi_Event_p_struct_blpapi_ProviderSession_p_void__void swig_types[45] -#define SWIGTYPE_p_float swig_types[46] -#define SWIGTYPE_p_int swig_types[47] -#define SWIGTYPE_p_intArray swig_types[48] -#define SWIGTYPE_p_long_long swig_types[49] -#define SWIGTYPE_p_p_blpapi_AuthApplication swig_types[50] -#define SWIGTYPE_p_p_blpapi_AuthOptions swig_types[51] -#define SWIGTYPE_p_p_blpapi_AuthToken swig_types[52] -#define SWIGTYPE_p_p_blpapi_AuthUser swig_types[53] -#define SWIGTYPE_p_p_blpapi_Element swig_types[54] -#define SWIGTYPE_p_p_blpapi_Event swig_types[55] -#define SWIGTYPE_p_p_blpapi_Identity swig_types[56] -#define SWIGTYPE_p_p_blpapi_Message swig_types[57] -#define SWIGTYPE_p_p_blpapi_MessageFormatter swig_types[58] -#define SWIGTYPE_p_p_blpapi_MessageProperties swig_types[59] -#define SWIGTYPE_p_p_blpapi_Name swig_types[60] -#define SWIGTYPE_p_p_blpapi_Operation swig_types[61] -#define SWIGTYPE_p_p_blpapi_Request swig_types[62] -#define SWIGTYPE_p_p_blpapi_RequestTemplate swig_types[63] -#define SWIGTYPE_p_p_blpapi_SchemaElementDefinition swig_types[64] -#define SWIGTYPE_p_p_blpapi_Service swig_types[65] -#define SWIGTYPE_p_p_blpapi_Topic swig_types[66] -#define SWIGTYPE_p_p_char swig_types[67] -#define SWIGTYPE_p_p_void swig_types[68] -#define SWIGTYPE_p_short swig_types[69] -#define SWIGTYPE_p_size_t swig_types[70] -#define SWIGTYPE_p_unsigned_char swig_types[71] -#define SWIGTYPE_p_unsigned_int swig_types[72] -#define SWIGTYPE_p_unsigned_long_long swig_types[73] -#define SWIGTYPE_p_unsigned_short swig_types[74] -static swig_type_info *swig_types[76]; -static swig_module_info swig_module = {swig_types, 75, 0, 0, 0, 0}; +#define SWIGTYPE_p_blpapi_Socks5Config swig_types[35] +#define SWIGTYPE_p_blpapi_StreamWriter_t swig_types[36] +#define SWIGTYPE_p_blpapi_SubscriptionItrerator swig_types[37] +#define SWIGTYPE_p_blpapi_SubscriptionList swig_types[38] +#define SWIGTYPE_p_blpapi_TimePoint swig_types[39] +#define SWIGTYPE_p_blpapi_TlsOptions swig_types[40] +#define SWIGTYPE_p_blpapi_Topic swig_types[41] +#define SWIGTYPE_p_blpapi_TopicList swig_types[42] +#define SWIGTYPE_p_char swig_types[43] +#define SWIGTYPE_p_double swig_types[44] +#define SWIGTYPE_p_f_p_q_const__struct_blpapi_CorrelationId_t__p_q_const__char_int_p_q_const__char_p_void__void swig_types[45] +#define SWIGTYPE_p_f_p_struct_blpapi_Event_p_struct_blpapi_ProviderSession_p_void__void swig_types[46] +#define SWIGTYPE_p_float swig_types[47] +#define SWIGTYPE_p_int swig_types[48] +#define SWIGTYPE_p_intArray swig_types[49] +#define SWIGTYPE_p_long_long swig_types[50] +#define SWIGTYPE_p_p_blpapi_AuthApplication swig_types[51] +#define SWIGTYPE_p_p_blpapi_AuthOptions swig_types[52] +#define SWIGTYPE_p_p_blpapi_AuthToken swig_types[53] +#define SWIGTYPE_p_p_blpapi_AuthUser swig_types[54] +#define SWIGTYPE_p_p_blpapi_Element swig_types[55] +#define SWIGTYPE_p_p_blpapi_Event swig_types[56] +#define SWIGTYPE_p_p_blpapi_Identity swig_types[57] +#define SWIGTYPE_p_p_blpapi_Message swig_types[58] +#define SWIGTYPE_p_p_blpapi_MessageFormatter swig_types[59] +#define SWIGTYPE_p_p_blpapi_MessageProperties swig_types[60] +#define SWIGTYPE_p_p_blpapi_Name swig_types[61] +#define SWIGTYPE_p_p_blpapi_Operation swig_types[62] +#define SWIGTYPE_p_p_blpapi_Request swig_types[63] +#define SWIGTYPE_p_p_blpapi_RequestTemplate swig_types[64] +#define SWIGTYPE_p_p_blpapi_SchemaElementDefinition swig_types[65] +#define SWIGTYPE_p_p_blpapi_Service swig_types[66] +#define SWIGTYPE_p_p_blpapi_Topic swig_types[67] +#define SWIGTYPE_p_p_char swig_types[68] +#define SWIGTYPE_p_p_void swig_types[69] +#define SWIGTYPE_p_short swig_types[70] +#define SWIGTYPE_p_size_t swig_types[71] +#define SWIGTYPE_p_unsigned_char swig_types[72] +#define SWIGTYPE_p_unsigned_int swig_types[73] +#define SWIGTYPE_p_unsigned_long_long swig_types[74] +#define SWIGTYPE_p_unsigned_short swig_types[75] +static swig_type_info *swig_types[77]; +static swig_module_info swig_module = {swig_types, 76, 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) @@ -2974,6 +2975,24 @@ void blpapi_SessionOptions_printHelper( *output_size = stream.size; } +void blpapi_Socks5Config_printHelper( + blpapi_Socks5Config_t *socks5Config, + int level, + int spacesPerLevel, + char **output_allocated, + int *output_size) +{ + StreamWriterData stream = {0}; + blpapi_Socks5Config_print( + socks5Config, + cstr_StreamWriter, + &stream, + level, + spacesPerLevel); + *output_allocated = stream.stream; + *output_size = stream.size; +} + void blpapi_TestUtil_serializeServiceHelper( blpapi_Service_t *service, char **output_allocated, @@ -5140,6 +5159,56 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_printHelper(PyObject *SWIGUNUSE } +SWIGINTERN PyObject *_wrap_blpapi_Socks5Config_printHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Socks5Config_t *arg1 = (blpapi_Socks5Config_t *) 0 ; + int arg2 ; + int arg3 ; + char **arg4 = (char **) 0 ; + int *arg5 = (int *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + char *temp4 = 0 ; + int tempn4 ; + PyObject *swig_obj[3] ; + + arg4 = &temp4; arg5 = &tempn4; + if (!SWIG_Python_UnpackTuple(args, "blpapi_Socks5Config_printHelper", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Socks5Config, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Socks5Config_printHelper" "', argument " "1"" of type '" "blpapi_Socks5Config_t *""'"); + } + arg1 = (blpapi_Socks5Config_t *)(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Socks5Config_printHelper" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Socks5Config_printHelper" "', argument " "3"" of type '" "int""'"); + } + arg3 = (int)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_Socks5Config_printHelper(arg1,arg2,arg3,arg4,arg5); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + if (*arg4) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtrAndSize(*arg4,*arg5)); + free(*arg4); + } + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_blpapi_TestUtil_serializeServiceHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; @@ -11763,6 +11832,77 @@ SWIGINTERN PyObject *_wrap_blpapi_getLastErrorDescription(PyObject *SWIGUNUSEDPA } +SWIGINTERN PyObject *_wrap_blpapi_Socks5Config_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + char *arg1 = (char *) 0 ; + size_t arg2 ; + unsigned short arg3 ; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + unsigned short val3 ; + int ecode3 = 0 ; + PyObject *swig_obj[3] ; + blpapi_Socks5Config_t *result = 0 ; + + if (!SWIG_Python_UnpackTuple(args, "blpapi_Socks5Config_create", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Socks5Config_create" "', argument " "1"" of type '" "char const *""'"); + } + arg1 = (char *)(buf1); + ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Socks5Config_create" "', argument " "2"" of type '" "size_t""'"); + } + arg2 = (size_t)(val2); + ecode3 = SWIG_AsVal_unsigned_SS_short(swig_obj[2], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Socks5Config_create" "', argument " "3"" of type '" "unsigned short""'"); + } + arg3 = (unsigned short)(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (blpapi_Socks5Config_t *)blpapi_Socks5Config_create((char const *)arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Socks5Config, 0 | 0 ); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return resultobj; +fail: + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_Socks5Config_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_Socks5Config_t *arg1 = (blpapi_Socks5Config_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Socks5Config, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Socks5Config_destroy" "', argument " "1"" of type '" "blpapi_Socks5Config_t *""'"); + } + arg1 = (blpapi_Socks5Config_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + blpapi_Socks5Config_destroy(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SessionOptions_t *result = 0 ; @@ -11930,6 +12070,67 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setServerAddress(PyObject *SWIG } +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setServerAddressWithProxy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + char *arg2 = (char *) 0 ; + unsigned short arg3 ; + blpapi_Socks5Config_t *arg4 = (blpapi_Socks5Config_t *) 0 ; + size_t arg5 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + unsigned short val3 ; + int ecode3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + size_t val5 ; + int ecode5 = 0 ; + PyObject *swig_obj[5] ; + int result; + + if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setServerAddressWithProxy", 5, 5, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setServerAddressWithProxy" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setServerAddressWithProxy" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + ecode3 = SWIG_AsVal_unsigned_SS_short(swig_obj[2], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_SessionOptions_setServerAddressWithProxy" "', argument " "3"" of type '" "unsigned short""'"); + } + arg3 = (unsigned short)(val3); + res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_blpapi_Socks5Config, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_SessionOptions_setServerAddressWithProxy" "', argument " "4"" of type '" "blpapi_Socks5Config_t const *""'"); + } + arg4 = (blpapi_Socks5Config_t *)(argp4); + ecode5 = SWIG_AsVal_size_t(swig_obj[4], &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_SessionOptions_setServerAddressWithProxy" "', argument " "5"" of type '" "size_t""'"); + } + arg5 = (size_t)(val5); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_setServerAddressWithProxy(arg1,(char const *)arg2,arg3,(struct blpapi_Socks5Config const *)arg4,arg5); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_removeServerAddress(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; @@ -12837,42 +13038,50 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_numServerAddresses(PyObject *SW } -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_getServerAddress(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_getServerAddressWithProxy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; char **arg2 = (char **) 0 ; unsigned short *arg3 = (unsigned short *) 0 ; - size_t arg4 ; + char **arg4 = (char **) 0 ; + unsigned short *arg5 = (unsigned short *) 0 ; + size_t arg6 ; void *argp1 = 0 ; int res1 = 0 ; char *temp2 = 0 ; unsigned short temp3 ; - size_t val4 ; - int ecode4 = 0 ; + char *temp4 = 0 ; + unsigned short temp5 ; + size_t val6 ; + int ecode6 = 0 ; PyObject *swig_obj[2] ; int result; arg2 = &temp2; arg3 = &temp3; - if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_getServerAddress", 2, 2, swig_obj)) SWIG_fail; + arg4 = &temp4; + arg5 = &temp5; + if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_getServerAddressWithProxy", 2, 2, swig_obj)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_getServerAddress" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_getServerAddressWithProxy" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode4 = SWIG_AsVal_size_t(swig_obj[1], &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_SessionOptions_getServerAddress" "', argument " "4"" of type '" "size_t""'"); + ecode6 = SWIG_AsVal_size_t(swig_obj[1], &val6); + if (!SWIG_IsOK(ecode6)) { + SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "blpapi_SessionOptions_getServerAddressWithProxy" "', argument " "6"" of type '" "size_t""'"); } - arg4 = (size_t)(val4); + arg6 = (size_t)(val6); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_getServerAddress(arg1,(char const **)arg2,arg3,arg4); + result = (int)blpapi_SessionOptions_getServerAddressWithProxy(arg1,(char const **)arg2,arg3,(char const **)arg4,arg5,arg6); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); resultobj = SWIG_Python_AppendOutput(resultobj, PyInt_FromLong(*arg3)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg4)); + resultobj = SWIG_Python_AppendOutput(resultobj, PyInt_FromLong(*arg5)); return resultobj; fail: return NULL; @@ -13453,40 +13662,41 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setApplicationIdentityKey(PyObj size_t arg3 ; void *argp1 = 0 ; int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[3] ; + PyObject *asAscii2 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setApplicationIdentityKey", 3, 3, swig_obj)) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setApplicationIdentityKey", 2, 2, swig_obj)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setApplicationIdentityKey" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setApplicationIdentityKey" "', argument " "2"" of type '" "char const *""'"); + { + if (swig_obj[1] == Py_None) { + arg2 = 0; + arg3 = 0; + } + else { + if(PyUnicode_Check(swig_obj[1])) { + asAscii2 = PyUnicode_AsASCIIString(swig_obj[1]); + arg2 = PyString_AsString(asAscii2); + arg3 = PyString_Size(asAscii2); + } + else { + arg2 = PyString_AsString(swig_obj[1]); + arg3 = PyString_Size(swig_obj[1]); + } + } } - arg2 = (char *)(buf2); - ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_SessionOptions_setApplicationIdentityKey" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)blpapi_SessionOptions_setApplicationIdentityKey(arg1,(char const *)arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -13497,21 +13707,17 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_applicationIdentityKey(PyObject size_t *arg2 = (size_t *) 0 ; blpapi_SessionOptions_t *arg3 = (blpapi_SessionOptions_t *) 0 ; char *temp1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; + size_t temp2 ; void *argp3 = 0 ; int res3 = 0 ; - PyObject *swig_obj[2] ; + PyObject *swig_obj[1] ; int result; arg1 = &temp1; - if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_applicationIdentityKey", 2, 2, swig_obj)) SWIG_fail; - res2 = SWIG_ConvertPtr(swig_obj[0], &argp2,SWIGTYPE_p_size_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_applicationIdentityKey" "', argument " "2"" of type '" "size_t *""'"); - } - arg2 = (size_t *)(argp2); - res3 = SWIG_ConvertPtr(swig_obj[1], &argp3,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + arg2 = &temp2; + if (!args) SWIG_fail; + swig_obj[0] = args; + res3 = SWIG_ConvertPtr(swig_obj[0], &argp3,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_SessionOptions_applicationIdentityKey" "', argument " "3"" of type '" "blpapi_SessionOptions_t *""'"); } @@ -13522,7 +13728,9 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_applicationIdentityKey(PyObject SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg1)); + { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtrAndSize(*arg1, *arg2)); + } return resultobj; fail: return NULL; @@ -22795,6 +23003,7 @@ static PyMethodDef SwigMethods[] = { { "blpapi_SchemaTypeDefinition_printHelper", _wrap_blpapi_SchemaTypeDefinition_printHelper, METH_VARARGS, NULL}, { "blpapi_Message_printHelper", _wrap_blpapi_Message_printHelper, METH_VARARGS, NULL}, { "blpapi_SessionOptions_printHelper", _wrap_blpapi_SessionOptions_printHelper, METH_VARARGS, NULL}, + { "blpapi_Socks5Config_printHelper", _wrap_blpapi_Socks5Config_printHelper, METH_VARARGS, NULL}, { "blpapi_TestUtil_serializeServiceHelper", _wrap_blpapi_TestUtil_serializeServiceHelper, METH_O, NULL}, { "blpapi_SchemaTypeDefinition_hasElementDefinition", _wrap_blpapi_SchemaTypeDefinition_hasElementDefinition, METH_VARARGS, NULL}, { "blpapi_ConstantList_hasConstant", _wrap_blpapi_ConstantList_hasConstant, METH_VARARGS, NULL}, @@ -22991,11 +23200,14 @@ static PyMethodDef SwigMethods[] = { { "blpapi_AuthToken_copy", _wrap_blpapi_AuthToken_copy, METH_VARARGS, NULL}, { "blpapi_AuthToken_destroy", _wrap_blpapi_AuthToken_destroy, METH_O, NULL}, { "blpapi_getLastErrorDescription", _wrap_blpapi_getLastErrorDescription, METH_O, NULL}, + { "blpapi_Socks5Config_create", _wrap_blpapi_Socks5Config_create, METH_VARARGS, NULL}, + { "blpapi_Socks5Config_destroy", _wrap_blpapi_Socks5Config_destroy, METH_O, NULL}, { "blpapi_SessionOptions_create", _wrap_blpapi_SessionOptions_create, METH_NOARGS, NULL}, { "blpapi_SessionOptions_destroy", _wrap_blpapi_SessionOptions_destroy, METH_O, NULL}, { "blpapi_SessionOptions_setServerHost", _wrap_blpapi_SessionOptions_setServerHost, METH_VARARGS, NULL}, { "blpapi_SessionOptions_setServerPort", _wrap_blpapi_SessionOptions_setServerPort, METH_VARARGS, NULL}, { "blpapi_SessionOptions_setServerAddress", _wrap_blpapi_SessionOptions_setServerAddress, METH_VARARGS, NULL}, + { "blpapi_SessionOptions_setServerAddressWithProxy", _wrap_blpapi_SessionOptions_setServerAddressWithProxy, METH_VARARGS, NULL}, { "blpapi_SessionOptions_removeServerAddress", _wrap_blpapi_SessionOptions_removeServerAddress, METH_VARARGS, NULL}, { "blpapi_SessionOptions_setConnectTimeout", _wrap_blpapi_SessionOptions_setConnectTimeout, METH_VARARGS, NULL}, { "blpapi_SessionOptions_setDefaultServices", _wrap_blpapi_SessionOptions_setDefaultServices, METH_VARARGS, NULL}, @@ -23023,7 +23235,7 @@ static PyMethodDef SwigMethods[] = { { "blpapi_SessionOptions_serverHost", _wrap_blpapi_SessionOptions_serverHost, METH_O, NULL}, { "blpapi_SessionOptions_serverPort", _wrap_blpapi_SessionOptions_serverPort, METH_O, NULL}, { "blpapi_SessionOptions_numServerAddresses", _wrap_blpapi_SessionOptions_numServerAddresses, METH_O, NULL}, - { "blpapi_SessionOptions_getServerAddress", _wrap_blpapi_SessionOptions_getServerAddress, METH_VARARGS, NULL}, + { "blpapi_SessionOptions_getServerAddressWithProxy", _wrap_blpapi_SessionOptions_getServerAddressWithProxy, METH_VARARGS, NULL}, { "blpapi_SessionOptions_connectTimeout", _wrap_blpapi_SessionOptions_connectTimeout, METH_O, NULL}, { "blpapi_SessionOptions_defaultServices", _wrap_blpapi_SessionOptions_defaultServices, METH_O, NULL}, { "blpapi_SessionOptions_defaultSubscriptionService", _wrap_blpapi_SessionOptions_defaultSubscriptionService, METH_O, NULL}, @@ -23046,7 +23258,7 @@ static PyMethodDef SwigMethods[] = { { "blpapi_SessionOptions_flushPublishedEventsTimeout", _wrap_blpapi_SessionOptions_flushPublishedEventsTimeout, METH_O, NULL}, { "blpapi_SessionOptions_bandwidthSaveModeDisabled", _wrap_blpapi_SessionOptions_bandwidthSaveModeDisabled, METH_O, NULL}, { "blpapi_SessionOptions_setApplicationIdentityKey", _wrap_blpapi_SessionOptions_setApplicationIdentityKey, METH_VARARGS, NULL}, - { "blpapi_SessionOptions_applicationIdentityKey", _wrap_blpapi_SessionOptions_applicationIdentityKey, METH_VARARGS, NULL}, + { "blpapi_SessionOptions_applicationIdentityKey", _wrap_blpapi_SessionOptions_applicationIdentityKey, METH_O, NULL}, { "blpapi_TlsOptions_destroy", _wrap_blpapi_TlsOptions_destroy, METH_O, NULL}, { "blpapi_TlsOptions_createFromFiles", _wrap_blpapi_TlsOptions_createFromFiles, METH_VARARGS, NULL}, { "blpapi_TlsOptions_createFromBlobs", _wrap_blpapi_TlsOptions_createFromBlobs, METH_VARARGS, NULL}, @@ -23362,6 +23574,7 @@ static swig_type_info _swigt__p_blpapi_Service = {"_p_blpapi_Service", "blpapi_S static swig_type_info _swigt__p_blpapi_ServiceRegistrationOptions = {"_p_blpapi_ServiceRegistrationOptions", "struct blpapi_ServiceRegistrationOptions *|blpapi_ServiceRegistrationOptions_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_blpapi_Session = {"_p_blpapi_Session", "struct blpapi_Session *|blpapi_Session_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_blpapi_SessionOptions = {"_p_blpapi_SessionOptions", "struct blpapi_SessionOptions *|blpapi_SessionOptions_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_blpapi_Socks5Config = {"_p_blpapi_Socks5Config", "struct blpapi_Socks5Config *|blpapi_Socks5Config_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_blpapi_StreamWriter_t = {"_p_blpapi_StreamWriter_t", "blpapi_StreamWriter_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_blpapi_SubscriptionItrerator = {"_p_blpapi_SubscriptionItrerator", "struct blpapi_SubscriptionItrerator *|blpapi_SubscriptionIterator_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_blpapi_SubscriptionList = {"_p_blpapi_SubscriptionList", "struct blpapi_SubscriptionList *|blpapi_SubscriptionList_t *", 0, 0, (void*)0, 0}; @@ -23439,6 +23652,7 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_blpapi_ServiceRegistrationOptions, &_swigt__p_blpapi_Session, &_swigt__p_blpapi_SessionOptions, + &_swigt__p_blpapi_Socks5Config, &_swigt__p_blpapi_StreamWriter_t, &_swigt__p_blpapi_SubscriptionItrerator, &_swigt__p_blpapi_SubscriptionList, @@ -23516,6 +23730,7 @@ static swig_cast_info _swigc__p_blpapi_Service[] = { {&_swigt__p_blpapi_Service static swig_cast_info _swigc__p_blpapi_ServiceRegistrationOptions[] = { {&_swigt__p_blpapi_ServiceRegistrationOptions, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_blpapi_Session[] = { {&_swigt__p_blpapi_Session, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_blpapi_SessionOptions[] = { {&_swigt__p_blpapi_SessionOptions, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_blpapi_Socks5Config[] = { {&_swigt__p_blpapi_Socks5Config, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_blpapi_StreamWriter_t[] = { {&_swigt__p_blpapi_StreamWriter_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_blpapi_SubscriptionItrerator[] = { {&_swigt__p_blpapi_SubscriptionItrerator, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_blpapi_SubscriptionList[] = { {&_swigt__p_blpapi_SubscriptionList, 0, 0, 0},{0, 0, 0, 0}}; @@ -23593,6 +23808,7 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_blpapi_ServiceRegistrationOptions, _swigc__p_blpapi_Session, _swigc__p_blpapi_SessionOptions, + _swigc__p_blpapi_Socks5Config, _swigc__p_blpapi_StreamWriter_t, _swigc__p_blpapi_SubscriptionItrerator, _swigc__p_blpapi_SubscriptionList, diff --git a/src/blpapi/name.py b/src/blpapi/name.py index 60439b4..5222512 100644 --- a/src/blpapi/name.py +++ b/src/blpapi/name.py @@ -6,6 +6,7 @@ form for efficient string comparison. """ +from __future__ import annotations from typing import Any, Optional, Tuple, Union from . import internals from .utils import conv2str, get_handle, isstr @@ -51,7 +52,7 @@ class Name(CHandle): """ @staticmethod - def findName(nameString: str) -> Optional["Name"]: + def findName(nameString: str) -> Optional[Name]: """ Args: nameString: String represented by an existing :class:`Name` @@ -78,7 +79,7 @@ def hasName(nameString: str) -> bool: return bool(internals.blpapi_Name_hasName(nameString)) @staticmethod - def _createInternally(handle: BlpapiNameHandle) -> "Name": + def _createInternally(handle: BlpapiNameHandle) -> Name: return Name(None, handle) def __init__( @@ -133,7 +134,7 @@ def __hash__(self) -> int: def getNamePair( - name: "Name", + name: Name, ) -> Union[Tuple[None, BlpapiNameHandle], Tuple[str, None]]: """Create a tuple that contains a name string and blpapi_Name_t*. diff --git a/src/blpapi/providersession.py b/src/blpapi/providersession.py index 8436a6d..8340406 100644 --- a/src/blpapi/providersession.py +++ b/src/blpapi/providersession.py @@ -57,6 +57,7 @@ publishers that do not maintain per-topic state. """ +from __future__ import annotations from weakref import ref, ReferenceType # pylint: disable=unused-import from typing import Optional, Callable, Sequence import sys @@ -78,6 +79,7 @@ from . import typehints # pylint: disable=unused-import from .typehints import BlpapiEventHandle + # pylint: disable=line-too-long,too-many-lines # pylint: disable=protected-access,too-many-public-methods,bare-except,too-many-function-args class ServiceRegistrationOptions( @@ -317,7 +319,7 @@ def __init__( self, options: Optional[SessionOptions] = None, eventHandler: Optional[ - Callable[[Event, "ProviderSession"], None] + Callable[[Event, ProviderSession], None] ] = None, eventDispatcher: Optional["typehints.EventDispatcher"] = None, ) -> None: diff --git a/src/blpapi/schema.py b/src/blpapi/schema.py index 66ec9e0..38c8a86 100644 --- a/src/blpapi/schema.py +++ b/src/blpapi/schema.py @@ -17,6 +17,7 @@ permitted to be associated with that identifier. """ +from __future__ import annotations from typing import Sequence, Set, Optional from typing import Iterator as IteratorType from . import typehints # pylint: disable=unused-import @@ -29,6 +30,7 @@ from . import utils from . import internals + # pylint: disable=protected-access,too-few-public-methods class SchemaStatus(metaclass=utils.MetaClassForClassesWithEnums): """The possible deprecation statuses of a schema element or type.""" @@ -132,7 +134,7 @@ def status(self) -> int: return internals.blpapi_SchemaElementDefinition_status(self.__handle) - def typeDefinition(self) -> "SchemaTypeDefinition": + def typeDefinition(self) -> SchemaTypeDefinition: """ Returns: The type of values contained in this element. @@ -370,7 +372,7 @@ def hasElementDefinition(self, name: Name) -> bool: def getElementDefinition( self, nameOrIndex: BlpapiNameOrIndex - ) -> "SchemaElementDefinition": + ) -> SchemaElementDefinition: """ Args: nameOrIndex: Name or index of the element @@ -412,7 +414,7 @@ def getElementDefinition( raise IndexOutOfRangeException(errMessage, 0) return SchemaElementDefinition(res, self.__sessions) - def elementDefinitions(self) -> IteratorType["SchemaElementDefinition"]: + def elementDefinitions(self) -> IteratorType[SchemaElementDefinition]: """ Returns: Iterator over :class:`SchemaElementDefinition`\ s defined by this diff --git a/src/blpapi/session.py b/src/blpapi/session.py index 9a36c19..9e42f7a 100644 --- a/src/blpapi/session.py +++ b/src/blpapi/session.py @@ -5,6 +5,7 @@ This component implements a consumer session for getting services. """ +from __future__ import annotations from weakref import ref, ReferenceType # pylint: disable=unused-import from typing import Optional, Callable, List import sys @@ -12,7 +13,6 @@ import os import functools import atexit -from typing import NamedTuple from enum import Enum from .abstractsession import AbstractSession from .event import Event @@ -136,7 +136,7 @@ def __dispatchEvent( def __init__( self, options: Optional[SessionOptions] = None, - eventHandler: Optional[Callable[[Event, "Session"], None]] = None, + eventHandler: Optional[Callable[[Event, Session], None]] = None, eventDispatcher: Optional["typehints.EventDispatcher"] = None, ) -> None: """Create a consumer :class:`Session`. @@ -319,7 +319,7 @@ def tryNextEvent(self) -> Optional[Event]: @staticmethod def _createErrorAppender( - errorList: List["SubscriptionPreprocessError"], + errorList: List[SubscriptionPreprocessError], ) -> Callable: def errorAppender( correlationId: CorrelationId, @@ -344,7 +344,7 @@ def subscribe( identity: Optional["typehints.Identity"] = None, requestLabel: str = "", mode: SubscriptionPreprocessMode = SubscriptionPreprocessMode.FAIL_ON_FIRST_ERROR, - ) -> Optional[List["SubscriptionPreprocessError"]]: + ) -> Optional[List[SubscriptionPreprocessError]]: """Begin subscriptions for each entry in the specified list. Args: @@ -389,7 +389,7 @@ def subscribe( ) ) elif subMode == SubscriptionPreprocessMode.RETURN_INDIVIDUAL_ERRORS: - errorList = [] # type: ignore + errorList: List[SubscriptionPreprocessError] = [] errorAppender = Session._createErrorAppender(errorList) _ExceptionUtil.raiseOnError( internals.blpapi_Session_subscribeEx_helper( @@ -448,7 +448,7 @@ def resubscribe( requestLabel: str = "", resubscriptionId: Optional[int] = None, mode: SubscriptionPreprocessMode = SubscriptionPreprocessMode.FAIL_ON_FIRST_ERROR, - ) -> Optional[List["SubscriptionPreprocessError"]]: + ) -> Optional[List[SubscriptionPreprocessError]]: """Modify subscriptions in ``subscriptionList``. Args: @@ -504,7 +504,7 @@ def resubscribe( ) ) elif subMode == SubscriptionPreprocessMode.RETURN_INDIVIDUAL_ERRORS: - errorList = [] # type: ignore + errorList: List[SubscriptionPreprocessError] = [] errorAppender = Session._createErrorAppender(errorList) if resubscriptionId is None: @@ -767,10 +767,10 @@ def createSnapshotRequestTemplate( return reqTemplate -class SubscriptionPreprocessError(NamedTuple): +class SubscriptionPreprocessError: """Class representing an error due to an invalid subscription.""" - class ErrorCode(Enum): # type: ignore + class ErrorCode(Enum): """The error codes used by :class:`SubscriptionPreprocessError`.""" SUBSCRIPTIONPREPROCESS_INVALID_SUBSCRIPTION_STRING = ( @@ -783,17 +783,17 @@ class ErrorCode(Enum): # type: ignore ) """Error due to misuse of correlation id, such as using a duplicate.""" - correlationId: CorrelationId - """:class:`CorrelationId` of the subscription.""" - - subscriptionString: str - """The subscription string.""" - - errorCode: ErrorCode # type: ignore - """Error code representing the error.""" - - description: str - """Description of the error.""" + def __init__( + self, + correlationId: CorrelationId, + subscriptionString: str, + errorCode: SubscriptionPreprocessError.ErrorCode, + description: str, + ) -> None: + self.correlationId = correlationId + self.subscriptionString = subscriptionString + self.errorCode = errorCode + self.description = description def __str__(self) -> str: return ( diff --git a/src/blpapi/sessionoptions.py b/src/blpapi/sessionoptions.py index 1d1ccc6..8792604 100644 --- a/src/blpapi/sessionoptions.py +++ b/src/blpapi/sessionoptions.py @@ -20,6 +20,7 @@ """ +from __future__ import annotations from typing import Iterator, Optional, Sequence, Tuple, Union from .typehints import BlpapiTlsOptionsHandle from .exception import _ExceptionUtil @@ -32,6 +33,56 @@ from . import typehints # pylint: disable=unused-import +class Socks5Config(CHandle): + """Configuration to be used to specify a SOCKS5 proxy""" + + def __init__(self, hostname: str, port: int) -> None: + """ + Args: + hostname: hostname of the SOCKS5 proxy + port: port of the SOCKS5 proxy. Must be between 1 and 65535 + + Creates an object that defines a SOCKS5 proxy. + """ + SessionOptions._validatePort(port) + + self.__handle = internals.blpapi_Socks5Config_create( + hostname, len(hostname), port + ) + super(Socks5Config, self).__init__( + self.__handle, internals.blpapi_Socks5Config_destroy + ) + + def __str__(self) -> str: + """x.__str__() <==> str(x) + + Returns a string representation of this :class:`Socks5Config`. Calling + 'str(socks5Config)' is equivalent to calling 'socks5Config.toString()' + with default parameters. + + """ + return self.toString() + + def toString(self, level: int = 0, spacesPerLevel: int = 4) -> str: + """Formats this :class:`Socks5Config` to the string. + + Args: + level: Indentation level + spacesPerLevel: Number of spaces per indentation level for + this and all nested objects + + Returns: + This object formatted as a string + + If ``level`` is negative, suppresses indentation of the first line. If + ``spacesPerLevel`` is negative, formats the entire output on one line, + suppressing all but the initial indentation (as governed by ``level``). + """ + return internals.blpapi_Socks5Config_printHelper( + self.__handle, level, spacesPerLevel + ) + + # pylint: disable=too-many-public-methods class SessionOptions(CHandle, metaclass=utils.MetaClassForClassesWithEnums): """Options which the user can specify when creating a session. @@ -91,11 +142,12 @@ def setServerPort(self, serverPort: int) -> None: """Set the port to connect to when using the server API. Args: - serverPort: Server port + serverPort: Server port. Must be between 1 and 65535 Set the port to connect to when using the server API to the specified ``serverPort``. The default is ``8194``. """ + SessionOptions._validatePort(serverPort) _ExceptionUtil.raiseOnError( internals.blpapi_SessionOptions_setServerPort( @@ -104,22 +156,32 @@ def setServerPort(self, serverPort: int) -> None: ) def setServerAddress( - self, serverHost: str, serverPort: int, index: int + self, + serverHost: str, + serverPort: int, + index: int, + socks5Config: Optional[Socks5Config] = None, ) -> None: """Set the server address at the specified ``index``. Args: serverHost: Server host - serverPort: Server port + serverPort: Server port. Must be between 1 and 65535 index: Index to set the address at + socks5Config: Optional. SOCKS5 proxy configuration Set the server address at the specified ``index`` using the specified ``serverHost`` and ``serverPort``. """ + SessionOptions._validatePort(serverPort) _ExceptionUtil.raiseOnError( - internals.blpapi_SessionOptions_setServerAddress( - self.__handle, serverHost, serverPort, index + internals.blpapi_SessionOptions_setServerAddressWithProxy( + self.__handle, + serverHost, + serverPort, + get_handle(socks5Config), + index, ) ) @@ -545,7 +607,7 @@ def setServiceDownloadTimeout(self, timeoutMsecs: int) -> None: ) _ExceptionUtil.raiseOnError(err) - def setTlsOptions(self, tlsOptions: "TlsOptions") -> None: + def setTlsOptions(self, tlsOptions: TlsOptions) -> None: """Set the TLS options Args: @@ -567,6 +629,37 @@ def setBandwidthSaveModeDisabled(self, isDisabled: bool) -> None: ) ) + def setApplicationIdentityKey(self, applicationIdentityKey: str) -> None: + """Sets the application identity key (AIK) which uniquely identifies + this application for this session. + + Args: + applicationIdentityKey: The application identity key to set. + """ + + _ExceptionUtil.raiseOnError( + internals.blpapi_SessionOptions_setApplicationIdentityKey( + self.__handle, applicationIdentityKey + ) + ) + + def applicationIdentityKey(self) -> str: + """ + Returns: + The application identity key (AIK) which uniquely identifies + this application for this session. + """ + + ( + result, + aik, + ) = internals.blpapi_SessionOptions_applicationIdentityKey( + self.__handle + ) + + _ExceptionUtil.raiseOnError(result) + return aik + def serverHost(self) -> str: """ Returns: @@ -593,23 +686,32 @@ def numServerAddresses(self) -> int: self.__handle ) - def getServerAddress(self, index: int) -> Tuple[str, int]: + def getServerAddress( + self, index: int + ) -> Tuple[str, int, Optional[Socks5Config]]: """ Returns: - Server name and port indexed by ``index``. + Server name, port and optional SOCKS5 proxy configuration indexed + by ``index``. """ ( errorCode, host, port, - ) = internals.blpapi_SessionOptions_getServerAddress( + socks5Host, + socks5Port, + ) = internals.blpapi_SessionOptions_getServerAddressWithProxy( self.__handle, index ) _ExceptionUtil.raiseOnError(errorCode) - return host, port + return ( + host, + port, + Socks5Config(socks5Host, socks5Port) if socks5Host else None, + ) def serverAddresses(self) -> Iterator: """ @@ -850,6 +952,13 @@ def toString(self, level: int = 0, spacesPerLevel: int = 4) -> str: self.__handle, level, spacesPerLevel ) + @staticmethod + def _validatePort(port: int) -> None: + if port < 1 or port > 65535: + raise ValueError( + f"port out of range:{port}. Must be beetween 1 and 65535" + ) + class TlsOptions(CHandle): """SSL configuration options @@ -903,7 +1012,7 @@ def createFromFiles( clientCredentialsFilename: str, clientCredentialsPassword: str, trustedCertificatesFilename: str, - ) -> "TlsOptions": + ) -> TlsOptions: """ Args: clientCredentialsFilename: Path to the file with the client @@ -928,7 +1037,7 @@ def createFromBlobs( clientCredentials: Union[bytes, bytearray], clientCredentialsPassword: str, trustedCertificates: Union[bytes, bytearray], - ) -> "TlsOptions": + ) -> TlsOptions: """ Args: clientCredentials: Blob with the client diff --git a/src/blpapi/test/messageformatter.py b/src/blpapi/test/messageformatter.py index 2727dbf..d2506d4 100644 --- a/src/blpapi/test/messageformatter.py +++ b/src/blpapi/test/messageformatter.py @@ -37,6 +37,7 @@ def _singledispatchmethod(arg_index: int) -> Callable: def _singleDispatchMethodImpl(func: Callable) -> Callable: """Implementation of `_singledispatchmethod`.""" dispatcher = singledispatch(func) + # `dispatcher` is `func` wrapped by singledispatch # `dispatcher` has an attribute `register()`, which is a decorator, # which registers the typed funcs to call based on the arg passed to diff --git a/src/blpapi/version.py b/src/blpapi/version.py index 9b3ab26..553ee84 100644 --- a/src/blpapi/version.py +++ b/src/blpapi/version.py @@ -4,8 +4,8 @@ from . import versionhelper -__version__ = "3.19.3" -__expected_cpp_sdk_version__ = "3.19.1" +__version__ = "3.20.1" +__expected_cpp_sdk_version__ = "3.20.2" def print_version() -> None: From d6c43b954c9fde2ccc7f5796d05a5b300c0db8e8 Mon Sep 17 00:00:00 2001 From: Marland Sitt Date: Thu, 27 Jun 2024 14:10:14 -0700 Subject: [PATCH 16/23] v3.21.0 --- MANIFEST.in | 3 +- NOTES | 234 ----------- PKG-INFO | 4 +- changelog.txt | 194 ++++----- pyproject.toml | 9 - setup.cfg | 1 - setup.py | 44 ++- src/blpapi.egg-info/PKG-INFO | 4 +- src/blpapi.egg-info/SOURCES.txt | 2 - src/blpapi/__init__.py | 10 + src/blpapi/debug.py | 10 + src/blpapi/identity.py | 2 - src/blpapi/internals_wrap.c | 594 +++++++++------------------- src/blpapi/message.py | 4 +- src/blpapi/name.py | 11 +- src/blpapi/providersession.py | 4 + src/blpapi/request.py | 6 +- src/blpapi/session.py | 20 +- src/blpapi/subscriptionlist.py | 2 +- src/blpapi/test/messageformatter.py | 14 +- src/blpapi/test/testutil.py | 7 +- src/blpapi/topic.py | 7 +- src/blpapi/utils.py | 1 - src/blpapi/version.py | 4 +- 24 files changed, 406 insertions(+), 785 deletions(-) delete mode 100644 NOTES delete mode 100644 pyproject.toml diff --git a/MANIFEST.in b/MANIFEST.in index 9e96a53..de74c32 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,5 @@ -include README.md changelog.txt NOTES License.txt +include README.md changelog.txt License.txt +exclude pyproject.toml recursive-include examples *.py README.md diagram.png recursive-exclude examples/demoapps-internal * diff --git a/NOTES b/NOTES deleted file mode 100644 index 04ccd62..0000000 --- a/NOTES +++ /dev/null @@ -1,234 +0,0 @@ -This document outlines most obvious differences between Bloomberg C++ SDK and -this Python SDK. - - -Different APIs -============== - -Below is a list of APIs that have different parameters or enhanced -functionality: - -class 'Constant' ----------------- - -C++: constructor accepts a handle. - -Python: constructor accepts a handle and a list of relevant sessions, to make -sure objects of type 'Constant' are destroyed before the relevant sessions. - - -C++: overloaded methods with name 'getValueAs', together with methods -'getValueAsChar', 'getValueAsInt32', 'getValueAsInt64', 'getValueAsFloat32', -'getValueAsFloat64', 'getValueAsDatetime', 'getValueAsString'. - -Python: methods 'getValueAsInteger', 'getValueAsFloat', 'getValueAsDatetime', -'getValueAsString', that return integers, floats, datetime objects, strings, -and method 'getValue' that returns value of the constant as it is stored, -without conversion. - - -class 'ConstantList' --------------------- - -C++: constructor accepts a handle. - -Python: constructor accepts a handle and a list of relevant sessions, to make -sure objects of type 'Constant' are destroyed before the relevant sessions. - -In addition, in Python, objects of type ConstantList support iterator -interface, to iterate over constants they store. - - -class 'CorrelationId' ---------------------- - -C++: method 'swap' that swaps two CorrelationID objects. - -Python: none. - - -C++: method 'valueType'. - -Python: method that does the same has different name, 'type'. - - -class Datetime --------------- - -In Python SDK, two methods exist to convert between objects of this type and -standard Python classes from datetime module, -blpapi._DatetimeUtil.convertToNative, and -blpapi._DatetimeUtil.convertToBlpapi. No separate Datetime class is defined. - -class 'Element' ---------------- - -C++: overloaded methods with name 'GetElement' that return an element based on -its name or position for sequences or choices. - -Python: two separate methods: 'GetElement' that returns an element by its name -and method 'GetElementAt' that returns an element at the specified position. - - -C++: overloaded methods with name 'getValueAs', together with methods -'getValueAsBool', 'getValueAsChar', 'getValueAsInt32', 'getValueAsInt64', -'getValueAsFloat32', 'getValueAsFloat64', 'getValueAsDatetime', -'getValueAsString', 'getValueAsElement', 'getValueAsName'. - -Python: methods 'getValueAsBool', 'getValueAsInteger', 'getValueAsFloat', -'getValueAsDatetime', 'getValueAsString', 'getValueAsName', -'getValueAsElement' that return value of the element converted to the relevant -data types, and method 'getValue' that returns value of the (sub)element as it -is stored, without conversion. - - -C++: methods 'getElementAsBool', 'getElementAsChar', 'getElementAsInt32', -'getElementAsInt64', 'getElementAsFloat32', 'getElementAsFloat64', -'getElementAsDatetime', 'getElementAsString', 'getElementAsName'. - -Python: methods 'getElementAsBool', 'getElementAsString', -'getElementAsDatetime', 'getElementAsInteger', 'getElementAsFloat', -'getElementAsName' that return a value of the specified subelement converted -to the relevant data types, and method 'getElementValue' that returns the -value without conversion. - - -C++: overloaded methods 'setElement', 'setValue', 'appendValue' for bool, -char, Int32, Int64, Float32, Float64, Datetime, const char*, Name date types. - -Python: methods 'setElement', 'setValue', 'appendValue' that treat bools as -BLPAPI_DATATYPE_BOOL, ints as BLPAPI_DATATYPE_INT32, longs as -BLPAPI_DATATYPE_INT64, floats as BLPAPI_DATATYPE_FLOAT64, Datetimes as -BLPAPI_DATATYPE_DATETIME. Everything else is treated as/converted to -BLPAPI_DATATYPE_STRING. - - -Also, this class in the Python implementation support methods 'elements' and -'values' to iterate over elements in this object and values stored in it. - - -class 'Event' -------------- - -C++: constructor accepts a handle. - -Python: constructor accepts a handle and a list of relevant sessions, to make -sure objects of this type are destroyed before the relevant sessions. - - -In addition, in Python, objects of this type support iterator interface, to -iterate over messages they store. - - -class 'EventHandler' --------------------- - -Not defined in Python code. Examples of event handlers can be found in -'MktdataPublisher.py' and 'PagePublisherExample.py' files in examples -directory. - - -class 'Identity' ----------------- - -C++: constructor accepts a handle - -Python: constructor accepts a handle and a list of relevant sessions, to make -sure objects of this type are destroyed before the relevant sessions. - - -class 'Message' ---------------- - -C++: methods 'numCorrelationIds', 'correlationId'. - -Python: method 'correlationIds', that return a list of correlation IDs. - - -class 'Name' ------------- - -C++: class method 'findName' returns 'Name()' when it cannot find the name. - -Python: class method 'findName' returns None when it cannot find the name. - - -class 'Request' ---------------- - -C++: constructor accepts a handle. - -Python: constructor accepts a handle and a list of relevant sessions, to make -sure objects of this type are destroyed before the relevant sessions. - - -class 'SchemaElementDefinition' -------------------------------- - -C++: constructor accepts a handle. - -Python: constructor accepts a handle and a list of relevant sessions, to make -sure objects of this type are destroyed before the relevant sessions. - - -C++: methods 'numAlternateNames', 'getAlternateName'. - -Python: method 'alternateNames', that returns a list of Name objects. - - -class 'SchemaTypeDefinition' ---------------------------- - -C++: constructor accepts a handle. - -Python: constructor accepts a handle and a list of relevant sessions, to make -sure objects of this type are destroyed before the relevant sessions. - - -class 'Operation' ------------------ - -C++: constructor accepts a handle. - -Python: constructor accepts a handle and a list of relevant sessions, to make -sure objects of this type are destroyed before the relevant sessions. - - -C++: method 'responseDefinition'. - -Python: method 'getResponseDefinitionAt'. - - -In addition, in Python, objects of this type support iterator interface, to -iterate over responses they store. - - -class 'Service' ---------------- - -C++: constructor accepts a handle. - -Python: constructor accepts a handle and a list of relevant sessions, to make -sure objects of this type are destroyed before the relevant sessions. - - -C++: overloaded methods 'getOperation'. - -Python: methods 'getOperation' and 'getOperationAt'. - - -C++: overloaded method 'getEventDefinition'. - -Python: methods 'getEventDefinition' and 'getEventDefinitionAt'. - - -In addition, in Python, objects of this type support iterator interface. - - -General notes -------------- - -In most cases, where a class defines method print() that sends formatted -output to a stream, a replacement method is defined in the Python SDK, -toString(), that returns a formatted string. - diff --git a/PKG-INFO b/PKG-INFO index fafa6cf..e63d379 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: blpapi -Version: 3.20.1 +Version: 3.21.0 Summary: Python SDK for Bloomberg BLPAPI Home-page: http://www.bloomberglabs.com/api/ Author: Bloomberg L.P. @@ -10,5 +10,5 @@ Classifier: Intended Audience :: Developers Classifier: Intended Audience :: Financial and Insurance Industry Classifier: License :: Other/Proprietary License Classifier: Topic :: Office/Business :: Financial -Requires-Python: >=3.7 +Requires-Python: >=3.8 License-File: License.txt diff --git a/changelog.txt b/changelog.txt index a93f1ab..2af1642 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,21 @@ +Version 3.21.0: +=============== +- Horizontal scaling of requests + User requests will now be load-balanced across all connections for clients + using clustered farms. There is no change to the way clients send requests and + receive responses. +- Stability and performance improvements + +Version 3.20.3: +=============== +- Drop Python 3.7 support + Installation and use of the BLPAPI Python SDK now requires a Python 3.8+ runtime. +- Stability and performance improvements + +Version 3.20.2: +=============== +- Stability and performance improvements + Version 3.20.1: =============== - Support for application identity key (AIK) @@ -19,9 +37,9 @@ Version 3.20.0: Version 3.19.3: ============== - Add 'expected_cpp_sdk_version()' method that returns a minimum compatible - BLPAPI C++ SDK version. + BLPAPI C++ SDK version. - Drop Python 3.6 support - Installation and use of the BLPAPI Python SDK now requires a Python 3.7+ runtime. + Installation and use of the BLPAPI Python SDK now requires a Python 3.7+ runtime. - Add Python 3.11 support - Stability and performance improvements @@ -37,20 +55,20 @@ Version 3.19.1: Version 3.19.0: =============== - Add complete support for elements with bytearray data types ('bytes') - 'EventFormatter.setValue(Name, bytes)' can now be used to set elements - of type Bytearray and the value of these elements are retrievable via - 'Message.getElementAsBytes(Name)' or 'Element.getElementAsBytes(Name)' - or 'Element.getValueAsBytes()'. + 'EventFormatter.setValue(Name, bytes)' can now be used to set elements + of type Bytearray and the value of these elements are retrievable via + 'Message.getElementAsBytes(Name)' or 'Element.getElementAsBytes(Name)' + or 'Element.getValueAsBytes()'. - Encourage usage of 'Name' in setters and getters taking the 'name' argument by string - Developers are encouraged to prefer 'Name' type parameter for methods - that accept either 'Name' or 'str' as the use of 'Name' is more - performant and functionally equivalent to 'str'. + Developers are encouraged to prefer 'Name' type parameter for methods + that accept either 'Name' or 'str' as the use of 'Name' is more + performant and functionally equivalent to 'str'. - This recommendation is enforced for clients with strict type check enabled. + This recommendation is enforced for clients with strict type check enabled. - Classes with such methods include 'Element', 'EventFormatter', 'Message', - 'MessageFormatter', 'Request', 'Service', 'Name' and 'Schema'. + Classes with such methods include 'Element', 'EventFormatter', 'Message', + 'MessageFormatter', 'Request', 'Service', 'Name' and 'Schema'. - Stability and performance improvements @@ -69,17 +87,17 @@ Version 3.18.1: Version 3.18.0: =============== - Improved 'Session.subcribe' and 'Session.resubscribe' interface - The current 'Session.subscribe' and 'Session.resubscribe' raise an - exception when one of the subscriptions is invalid, e.g., subscribe - with a duplicate 'CorrelationId'. A new set of overloads are added - with parameter 'SubscriptionPreprocessMode', which could be - - 'FAIL_ON_FIRST_ERROR': an exception is raised on the first - invalid subscription in the list, and the entire batch will be - considered failed. - - 'RETURN_INDIVIDUAL_ERRORS': instead of raising exceptions, a - list of 'SubscriptionPreprocessError' is returned, each - representing an error due to an invalid subscription in the list. - The valid subscriptions will move forward. + The current 'Session.subscribe' and 'Session.resubscribe' raise an + exception when one of the subscriptions is invalid, e.g., subscribe + with a duplicate 'CorrelationId'. A new set of overloads are added + with parameter 'SubscriptionPreprocessMode', which could be + - 'FAIL_ON_FIRST_ERROR': an exception is raised on the first + invalid subscription in the list, and the entire batch will be + considered failed. + - 'RETURN_INDIVIDUAL_ERRORS': instead of raising exceptions, a + list of 'SubscriptionPreprocessError' is returned, each + representing an error due to an invalid subscription in the list. + The valid subscriptions will move forward. - Stability and performance improvements @@ -90,35 +108,35 @@ Version 3.17.1: Version 3.17.0: =============== - Native-type formatting and message consumption - Add ability to format 'Event's and 'Request's from native Python types - using methods 'EventFormatter.fromPy' and 'Request.fromPy'. Add ability - to convert a 'Message' to 'dict' with 'Message.toPy'. 'Message's and - 'Request's have 'dict'-like behavior with '__getitem__' and - '__setitem__'. + Add ability to format 'Event's and 'Request's from native Python types + using methods 'EventFormatter.fromPy' and 'Request.fromPy'. Add ability + to convert a 'Message' to 'dict' with 'Message.toPy'. 'Message's and + 'Request's have 'dict'-like behavior with '__getitem__' and + '__setitem__'. - A new method 'correlationId()' is added to 'blpapi.Message' - A new method 'Message.correlationId()' is added to return the - single CorrelationId associated with the message or None if the - message has no CorrelationIds. If the message has multiple - CorrelationIds, the first one is returned. + A new method 'Message.correlationId()' is added to return the + single CorrelationId associated with the message or None if the + message has no CorrelationIds. If the message has multiple + CorrelationIds, the first one is returned. - Constants for common used `Names` - A new utility class `blpapi.Names` has been added with common - message names. + A new utility class `blpapi.Names` has been added with common + message names. - Revamped examples - The 'examples' directory now contains 'demoapps' and 'unittests' - subdirectories. The 'demoapps' directory contains a consolidated set of - example applications. Within 'demoapps', the 'snippets' directory contains - sample code for creating and sending requests, and for processing - responses. Also within 'demoapps', the 'util' directory contains common - code shared between examples. The 'unittests' directory has been renamed - from 'mock-test-examples' and contains sample code for using the mock - testing interface. + The 'examples' directory now contains 'demoapps' and 'unittests' + subdirectories. The 'demoapps' directory contains a consolidated set of + example applications. Within 'demoapps', the 'snippets' directory contains + sample code for creating and sending requests, and for processing + responses. Also within 'demoapps', the 'util' directory contains common + code shared between examples. The 'unittests' directory has been renamed + from 'mock-test-examples' and contains sample code for using the mock + testing interface. - End of Python 2 support - Installation and use of BLPAPI Python now requires a Python 3.6+ - runtime. + Installation and use of BLPAPI Python now requires a Python 3.6+ + runtime. - Stability and performance improvements @@ -149,27 +167,27 @@ Version 3.16.1: Version 3.16.0: =============== - Attributes are no longer supported in 'blpapi.ResolutionList' - Support for attributes during resolution was never fully implemented - and is now deprecated. + Support for attributes during resolution was never fully implemented + and is now deprecated. - Provide users ability to unit test applications offline using testing frameworks - The new utility module 'blpapi.test' can be used to create test events - and test messages. The test messages can be generated using Python - dictionaries, XML, JSON, or they can be built in a similar way to how - messages are normally constructed in the SDK. + The new utility module 'blpapi.test' can be used to create test events + and test messages. The test messages can be generated using Python + dictionaries, XML, JSON, or they can be built in a similar way to how + messages are normally constructed in the SDK. - Added unique request id to network interactions - A new, globally unique, request id has been added to network - interactions. The request id is a string that can be obtained by - calling 'Request.getRequestId()' before sending a request, and - 'Message.getRequestId()' for messages delivered to the application. + A new, globally unique, request id has been added to network + interactions. The request id is a string that can be obtained by + calling 'Request.getRequestId()' before sending a request, and + 'Message.getRequestId()' for messages delivered to the application. - Not all requests and messages will have a request id, notably - subscription data messages will *not* have a request id except - for recaps. + Not all requests and messages will have a request id, notably + subscription data messages will *not* have a request id except + for recaps. - This unique identifier will be useful when contacting support as it - will help quickly locate the interactions related to that event. + This unique identifier will be useful when contacting support as it + will help quickly locate the interactions related to that event. - Stability and performance improvements @@ -186,24 +204,24 @@ Version 3.15.1: Version 3.15.0: =============== - Provided a simplified interface to handle authentication and authorization - - Simplified authentication settings through the new set of strongly-typed - overloads described with 'AuthOptions' class. - - - Simplified existing multi-phased approach to authorization so that both - token generation and authorization can be done by the SDK. - - If 'AuthOptions' instance is provided to the session through the - newly introduced 'setSessionIdentityOptions' (part of 'SessionOptions'), - both token generation and subsequent authorization will be done by the - SDK. Successfully authorized identity would become the default - identity for the session that's used for all future requests unless - a different one is specified explicitly. - - - Additionally, two new session methods that simplify creation of - additional identities have been introduced: - - 'generateAuthorizedIdentity' - generates authorized identity - based on the provided 'AuthOptions'. - - 'getAuthorizedIdentity' - returns authorized identity that's - associated with the 'generateAuthorizedIdentity' call. + - Simplified authentication settings through the new set of strongly-typed + overloads described with 'AuthOptions' class. + + - Simplified existing multi-phased approach to authorization so that both + token generation and authorization can be done by the SDK. + - If 'AuthOptions' instance is provided to the session through the + newly introduced 'setSessionIdentityOptions' (part of 'SessionOptions'), + both token generation and subsequent authorization will be done by the + SDK. Successfully authorized identity would become the default + identity for the session that's used for all future requests unless + a different one is specified explicitly. + + - Additionally, two new session methods that simplify creation of + additional identities have been introduced: + - 'generateAuthorizedIdentity' - generates authorized identity + based on the provided 'AuthOptions'. + - 'getAuthorizedIdentity' - returns authorized identity that's + associated with the 'generateAuthorizedIdentity' call. - Improved usage of network bandwidth through support for compression @@ -227,9 +245,9 @@ Version 3.14.0: Version 3.13.1: =============== - Conversions to string using print helpers ignore null-terminators - Previously, when converting an e.g., Element to string explicitly, - or when printing it, null-terminators embedded in strings - would cause the resulting string to be truncated to the first one. + Previously, when converting an e.g., Element to string explicitly, + or when printing it, null-terminators embedded in strings + would cause the resulting string to be truncated to the first one. - Format docstrings to be rendered by the Sphinx documentation generator - Stability and performance improvements @@ -269,8 +287,8 @@ Version 3.12.0: - Add SessionOptions.toString() and SessionOptions.__str__ - Add version helpers - Python3.7 compatibility - - Deprecated the named parameter 'async' for blpapi.EventFormatter.stop in - favor of 'async_'. 'async' is a reserved keyword with Python3.7. + - Deprecated the named parameter 'async' for blpapi.EventFormatter.stop in + favor of 'async_'. 'async' is a reserved keyword with Python3.7. Version 3.11.0: =============== @@ -281,14 +299,14 @@ Version 3.11.0: Version 3.10.0: =============== - Documentation change - Clarify the meaning of integer priorities in 'ProviderSession'. Greater - values indicate higher priorities. + Clarify the meaning of integer priorities in 'ProviderSession'. Greater + values indicate higher priorities. - Add support for 3.10 features - - Provide access to the Message recap type - - Enable configuration of service timeouts in SessionOptions - - Add support for publisher terminated subscriptions - For more details on these features, please refer to the C++ release notes + - Provide access to the Message recap type + - Enable configuration of service timeouts in SessionOptions + - Add support for publisher terminated subscriptions + For more details on these features, please refer to the C++ release notes Version 3.9.2: ============== diff --git a/pyproject.toml b/pyproject.toml deleted file mode 100644 index 1301504..0000000 --- a/pyproject.toml +++ /dev/null @@ -1,9 +0,0 @@ -[tool.black] -line-length = 79 -extend-exclude = ''' -/( - | docs -)/ -| src/blpapi/internals.py -| src/blpapi/versionhelper.py -''' diff --git a/setup.cfg b/setup.cfg index 56ae624..8587248 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,7 +3,6 @@ doc_files = README.md examples changelog.txt - NOTES [metadata] license_files = diff --git a/setup.py b/setup.py index 70a77a7..66b3722 100644 --- a/setup.py +++ b/setup.py @@ -102,18 +102,56 @@ def lib_in_release(): extra_link_args=extraLinkArgs, ) +extensions = [blpapi_wrap, versionhelper_wrap] +packages = ["blpapi", "blpapi.test"] + +# INTERNAL ONLY START +# see automation/prepare_release.py +internal_build = os.environ.get("BLPAPI_PY_INTERNAL_BUILD", False) +if internal_build: + internalutils_path = "src/blpapi/internalutils" + if not ( + os.path.exists(internalutils_path) + and os.path.isdir(internalutils_path) + ): + error_msg = """Tried to build the internal Bloomberg build of the +BLPAPI Python SDK, but failed to find the internalutils subdirectory. + +If you are not a Bloomberg developer, this will not work, and you should unset +the BLPAPI_PY_INTERNAL_BUILD environment variable to continue. internalutils +provide some default configurations for use only within Bloomberg networks. + +If you are a Bloomberg developer, either unset the BLPAPI_PY_INTERNAL_BUILD +environment variable to build the public release, or ensure the internalutils +subdirectory is present. +""" + raise ImportError(error_msg) + + internalutils_wrap = Extension( + "blpapi.internalutils._bindings", + sources=["src/blpapi/internalutils/bindings_wrap.c"], + include_dirs=[blpapiIncludes], + library_dirs=[blpapiLibraryPath], + libraries=[blpapiLibraryName], + extra_compile_args=extraCompileArgs, + extra_link_args=extraLinkArgs, + ) + extensions.append(internalutils_wrap) + packages.append("blpapi.internalutils") +# INTERNAL ONLY END + setup( name="blpapi", version=find_version_number(), author="Bloomberg L.P.", author_email="open-tech@bloomberg.net", description="Python SDK for Bloomberg BLPAPI", - ext_modules=[blpapi_wrap, versionhelper_wrap], + ext_modules=extensions, url="http://www.bloomberglabs.com/api/", - packages=["blpapi", "blpapi.test"], + packages=packages, package_dir={"": "src"}, package_data=package_data, - python_requires=">=3.7", + python_requires=">=3.8", classifiers=[ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", diff --git a/src/blpapi.egg-info/PKG-INFO b/src/blpapi.egg-info/PKG-INFO index fafa6cf..e63d379 100644 --- a/src/blpapi.egg-info/PKG-INFO +++ b/src/blpapi.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: blpapi -Version: 3.20.1 +Version: 3.21.0 Summary: Python SDK for Bloomberg BLPAPI Home-page: http://www.bloomberglabs.com/api/ Author: Bloomberg L.P. @@ -10,5 +10,5 @@ Classifier: Intended Audience :: Developers Classifier: Intended Audience :: Financial and Insurance Industry Classifier: License :: Other/Proprietary License Classifier: Topic :: Office/Business :: Financial -Requires-Python: >=3.7 +Requires-Python: >=3.8 License-File: License.txt diff --git a/src/blpapi.egg-info/SOURCES.txt b/src/blpapi.egg-info/SOURCES.txt index 4b554aa..b7fc54b 100644 --- a/src/blpapi.egg-info/SOURCES.txt +++ b/src/blpapi.egg-info/SOURCES.txt @@ -1,9 +1,7 @@ License.txt MANIFEST.in -NOTES README.md changelog.txt -pyproject.toml setup.cfg setup.py examples/demoapps/ApiFieldsExample.py diff --git a/src/blpapi/__init__.py b/src/blpapi/__init__.py index 6af8ceb..8ea6f56 100644 --- a/src/blpapi/__init__.py +++ b/src/blpapi/__init__.py @@ -71,6 +71,16 @@ print_version, ) +# INTERNAL ONLY START +# see automation/prepare_release.py +try: + from . import internalutils # blpapi.internalutils submodule +except ImportError as error: + # internalutils is not available, most likely because this is a public release + # simply continue silently + pass +# INTERNAL ONLY END + # blpapi.test module from .test import * diff --git a/src/blpapi/debug.py b/src/blpapi/debug.py index d7c73a7..5783e1c 100644 --- a/src/blpapi/debug.py +++ b/src/blpapi/debug.py @@ -99,6 +99,11 @@ def _version_load_error(error: ImportError) -> str: If the C++ SDK is already installed, please ensure that the path to the library was added to {_linker_env()} before entering the interpreter. +If you are trying to build and install from source, you may instead find it +easier to simply install the wheel directly from pip, which will come bundled +with a compatible version of the C++ SDK. Simply run: +`pip install blpapi --index-url=https://bcms.bloomberg.com/pip/simple` + """ return msg @@ -127,5 +132,10 @@ def _version_mismatch_error( If a recent version of the C++ SDK is already installed, please ensure that the path to the library is added to {_linker_env()} before entering the interpreter. +If you are trying to build and install from source, you may instead find it +easier to simply install the wheel directly from pip, which will come bundled +with a compatible version of the C++ SDK. Simply run: +`pip install blpapi --index-url=https://bcms.bloomberg.com/pip/simple` + """ return msg diff --git a/src/blpapi/identity.py b/src/blpapi/identity.py index a6c3451..ad6168d 100644 --- a/src/blpapi/identity.py +++ b/src/blpapi/identity.py @@ -59,8 +59,6 @@ def __init__( self.__handle = handle # pylint: disable=unused-private-member self.__sessions = sessions # pylint: disable=unused-private-member - internals.blpapi_Identity_addRef(self.__handle) - def hasEntitlements( self, service: "typehints.Service", diff --git a/src/blpapi/internals_wrap.c b/src/blpapi/internals_wrap.c index 7d7ce0d..5379a5e 100644 --- a/src/blpapi/internals_wrap.c +++ b/src/blpapi/internals_wrap.c @@ -3121,8 +3121,9 @@ void loggerCallbackWrapper(blpapi_UInt64_t threadId, result = PyObject_CallFunction(loggerCallback, "KiOss", threadId, severity, datetime_obj, category, message); - PyGILState_Release(gilstate); Py_XDECREF(result); + Py_CLEAR(datetime_obj); + PyGILState_Release(gilstate); } int setLoggerCallbackWrapper(PyObject *cb, int severity) @@ -4617,6 +4618,7 @@ void blpapi_SubscriptionPreprocess_handleErrorPy( description); Py_XDECREF(result); + Py_CLEAR(cidPyObject); SWIG_PYTHON_THREAD_END_BLOCK; } @@ -10916,7 +10918,10 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_subscribeEx_helper(PyObject *SWIGUNUSE int res2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; - PyObject *asAscii4 = 0 ; + int res4 ; + char *buf4 = 0 ; + size_t size4 = 0 ; + int alloc4 = 0 ; PyObject *swig_obj[5] ; int result; @@ -10936,23 +10941,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_subscribeEx_helper(PyObject *SWIGUNUSE SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_subscribeEx_helper" "', argument " "3"" of type '" "blpapi_Identity_t const *""'"); } arg3 = (blpapi_Identity_t *)(argp3); - { - if (swig_obj[3] == Py_None) { - arg4 = 0; - arg5 = 0; - } - else { - if(PyUnicode_Check(swig_obj[3])) { - asAscii4 = PyUnicode_AsASCIIString(swig_obj[3]); - arg4 = PyString_AsString(asAscii4); - arg5 = PyString_Size(asAscii4); - } - else { - arg4 = PyString_AsString(swig_obj[3]); - arg5 = PyString_Size(swig_obj[3]); - } - } - } + res4 = SWIG_AsCharPtrAndSize(swig_obj[3], &buf4, &size4, &alloc4); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Session_subscribeEx_helper" "', argument " "4"" of type '" "char const *""'"); + } + arg4 = (char *)(buf4); + arg5 = (int)(size4 - 1); { arg6 = swig_obj[4]; } @@ -10962,18 +10956,10 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_subscribeEx_helper(PyObject *SWIGUNUSE SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - { - if(asAscii4) { - Py_DECREF(asAscii4); - } - } + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); return resultobj; fail: - { - if(asAscii4) { - Py_DECREF(asAscii4); - } - } + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); return NULL; } @@ -10989,7 +10975,10 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_resubscribeEx_helper(PyObject *SWIGUNU int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject *asAscii3 = 0 ; + int res3 ; + char *buf3 = 0 ; + size_t size3 = 0 ; + int alloc3 = 0 ; PyObject *swig_obj[4] ; int result; @@ -11004,23 +10993,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_resubscribeEx_helper(PyObject *SWIGUNU SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_resubscribeEx_helper" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); } arg2 = (blpapi_SubscriptionList_t *)(argp2); - { - if (swig_obj[2] == Py_None) { - arg3 = 0; - arg4 = 0; - } - else { - if(PyUnicode_Check(swig_obj[2])) { - asAscii3 = PyUnicode_AsASCIIString(swig_obj[2]); - arg3 = PyString_AsString(asAscii3); - arg4 = PyString_Size(asAscii3); - } - else { - arg3 = PyString_AsString(swig_obj[2]); - arg4 = PyString_Size(swig_obj[2]); - } - } - } + res3 = SWIG_AsCharPtrAndSize(swig_obj[2], &buf3, &size3, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_resubscribeEx_helper" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = (char *)(buf3); + arg4 = (int)(size3 - 1); { arg5 = swig_obj[3]; } @@ -11030,18 +11008,10 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_resubscribeEx_helper(PyObject *SWIGUNU SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - { - if(asAscii3) { - Py_DECREF(asAscii3); - } - } + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return resultobj; fail: - { - if(asAscii3) { - Py_DECREF(asAscii3); - } - } + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return NULL; } @@ -11060,7 +11030,10 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_resubscribeWithIdEx_helper(PyObject *S int res2 = 0 ; int val3 ; int ecode3 = 0 ; - PyObject *asAscii4 = 0 ; + int res4 ; + char *buf4 = 0 ; + size_t size4 = 0 ; + int alloc4 = 0 ; PyObject *swig_obj[5] ; int result; @@ -11080,23 +11053,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_resubscribeWithIdEx_helper(PyObject *S SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Session_resubscribeWithIdEx_helper" "', argument " "3"" of type '" "int""'"); } arg3 = (int)(val3); - { - if (swig_obj[3] == Py_None) { - arg4 = 0; - arg5 = 0; - } - else { - if(PyUnicode_Check(swig_obj[3])) { - asAscii4 = PyUnicode_AsASCIIString(swig_obj[3]); - arg4 = PyString_AsString(asAscii4); - arg5 = PyString_Size(asAscii4); - } - else { - arg4 = PyString_AsString(swig_obj[3]); - arg5 = PyString_Size(swig_obj[3]); - } - } - } + res4 = SWIG_AsCharPtrAndSize(swig_obj[3], &buf4, &size4, &alloc4); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Session_resubscribeWithIdEx_helper" "', argument " "4"" of type '" "char const *""'"); + } + arg4 = (char *)(buf4); + arg5 = (int)(size4 - 1); { arg6 = swig_obj[4]; } @@ -11106,18 +11068,10 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_resubscribeWithIdEx_helper(PyObject *S SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - { - if(asAscii4) { - Py_DECREF(asAscii4); - } - } + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); return resultobj; fail: - { - if(asAscii4) { - Py_DECREF(asAscii4); - } - } + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); return NULL; } @@ -13662,7 +13616,10 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setApplicationIdentityKey(PyObj size_t arg3 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject *asAscii2 = 0 ; + int res2 ; + char *buf2 = 0 ; + size_t size2 = 0 ; + int alloc2 = 0 ; PyObject *swig_obj[2] ; int result; @@ -13672,31 +13629,22 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setApplicationIdentityKey(PyObj SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setApplicationIdentityKey" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); } arg1 = (blpapi_SessionOptions_t *)(argp1); - { - if (swig_obj[1] == Py_None) { - arg2 = 0; - arg3 = 0; - } - else { - if(PyUnicode_Check(swig_obj[1])) { - asAscii2 = PyUnicode_AsASCIIString(swig_obj[1]); - arg2 = PyString_AsString(asAscii2); - arg3 = PyString_Size(asAscii2); - } - else { - arg2 = PyString_AsString(swig_obj[1]); - arg3 = PyString_Size(swig_obj[1]); - } - } - } + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, &size2, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setApplicationIdentityKey" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + arg3 = (size_t)(size2 - 1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)blpapi_SessionOptions_setApplicationIdentityKey(arg1,(char const *)arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -18299,7 +18247,10 @@ SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_cancel(PyObject *SWIGUNUSEDPAR int arg5 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject *asAscii4 = 0 ; + int res4 ; + char *buf4 = 0 ; + size_t size4 = 0 ; + int alloc4 = 0 ; PyObject *swig_obj[3] ; int result; @@ -18333,23 +18284,12 @@ SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_cancel(PyObject *SWIGUNUSEDPAR } } } - { - if (swig_obj[2] == Py_None) { - arg4 = 0; - arg5 = 0; - } - else { - if(PyUnicode_Check(swig_obj[2])) { - asAscii4 = PyUnicode_AsASCIIString(swig_obj[2]); - arg4 = PyString_AsString(asAscii4); - arg5 = PyString_Size(asAscii4); - } - else { - arg4 = PyString_AsString(swig_obj[2]); - arg5 = PyString_Size(swig_obj[2]); - } - } - } + res4 = SWIG_AsCharPtrAndSize(swig_obj[2], &buf4, &size4, &alloc4); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_AbstractSession_cancel" "', argument " "4"" of type '" "char const *""'"); + } + arg4 = (char *)(buf4); + arg5 = (int)(size4 - 1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)blpapi_AbstractSession_cancel(arg1,(struct blpapi_CorrelationId_t_ const *)arg2,arg3,(char const *)arg4,arg5); @@ -18359,21 +18299,13 @@ SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_cancel(PyObject *SWIGUNUSEDPAR { if(arg2) free(arg2); } - { - if(asAscii4) { - Py_DECREF(asAscii4); - } - } + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); return resultobj; fail: { if(arg2) free(arg2); } - { - if(asAscii4) { - Py_DECREF(asAscii4); - } - } + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); return NULL; } @@ -18397,7 +18329,10 @@ SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_sendAuthorizationRequest(PyObj int res4 = 0 ; void *argp5 = 0 ; int res5 = 0 ; - PyObject *asAscii6 = 0 ; + int res6 ; + char *buf6 = 0 ; + size_t size6 = 0 ; + int alloc6 = 0 ; PyObject *swig_obj[6] ; int result; @@ -18427,41 +18362,22 @@ SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_sendAuthorizationRequest(PyObj SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "blpapi_AbstractSession_sendAuthorizationRequest" "', argument " "5"" of type '" "blpapi_EventQueue_t *""'"); } arg5 = (blpapi_EventQueue_t *)(argp5); - { - if (swig_obj[5] == Py_None) { - arg6 = 0; - arg7 = 0; - } - else { - if(PyUnicode_Check(swig_obj[5])) { - asAscii6 = PyUnicode_AsASCIIString(swig_obj[5]); - arg6 = PyString_AsString(asAscii6); - arg7 = PyString_Size(asAscii6); - } - else { - arg6 = PyString_AsString(swig_obj[5]); - arg7 = PyString_Size(swig_obj[5]); - } - } - } + res6 = SWIG_AsCharPtrAndSize(swig_obj[5], &buf6, &size6, &alloc6); + if (!SWIG_IsOK(res6)) { + SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "blpapi_AbstractSession_sendAuthorizationRequest" "', argument " "6"" of type '" "char const *""'"); + } + arg6 = (char *)(buf6); + arg7 = (int)(size6 - 1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)blpapi_AbstractSession_sendAuthorizationRequest(arg1,(struct blpapi_Request const *)arg2,arg3,arg4,arg5,(char const *)arg6,arg7); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - { - if(asAscii6) { - Py_DECREF(asAscii6); - } - } + if (alloc6 == SWIG_NEWOBJ) free((char*)buf6); return resultobj; fail: - { - if(asAscii6) { - Py_DECREF(asAscii6); - } - } + if (alloc6 == SWIG_NEWOBJ) free((char*)buf6); return NULL; } @@ -18992,7 +18908,10 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_subscribe(PyObject *SWIGUNUSEDPARM(sel int res2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; - PyObject *asAscii4 = 0 ; + int res4 ; + char *buf4 = 0 ; + size_t size4 = 0 ; + int alloc4 = 0 ; PyObject *swig_obj[4] ; int result; @@ -19012,41 +18931,22 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_subscribe(PyObject *SWIGUNUSEDPARM(sel SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_subscribe" "', argument " "3"" of type '" "blpapi_Identity_t const *""'"); } arg3 = (blpapi_Identity_t *)(argp3); - { - if (swig_obj[3] == Py_None) { - arg4 = 0; - arg5 = 0; - } - else { - if(PyUnicode_Check(swig_obj[3])) { - asAscii4 = PyUnicode_AsASCIIString(swig_obj[3]); - arg4 = PyString_AsString(asAscii4); - arg5 = PyString_Size(asAscii4); - } - else { - arg4 = PyString_AsString(swig_obj[3]); - arg5 = PyString_Size(swig_obj[3]); - } - } - } + res4 = SWIG_AsCharPtrAndSize(swig_obj[3], &buf4, &size4, &alloc4); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Session_subscribe" "', argument " "4"" of type '" "char const *""'"); + } + arg4 = (char *)(buf4); + arg5 = (int)(size4 - 1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)blpapi_Session_subscribe(arg1,(struct blpapi_SubscriptionList const *)arg2,(struct blpapi_Identity const *)arg3,(char const *)arg4,arg5); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - { - if(asAscii4) { - Py_DECREF(asAscii4); - } - } + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); return resultobj; fail: - { - if(asAscii4) { - Py_DECREF(asAscii4); - } - } + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); return NULL; } @@ -19066,7 +18966,10 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_subscribeEx(PyObject *SWIGUNUSEDPARM(s int res2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; - PyObject *asAscii4 = 0 ; + int res4 ; + char *buf4 = 0 ; + size_t size4 = 0 ; + int alloc4 = 0 ; int res7 ; PyObject *swig_obj[6] ; int result; @@ -19087,23 +18990,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_subscribeEx(PyObject *SWIGUNUSEDPARM(s SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_subscribeEx" "', argument " "3"" of type '" "blpapi_Identity_t const *""'"); } arg3 = (blpapi_Identity_t *)(argp3); - { - if (swig_obj[3] == Py_None) { - arg4 = 0; - arg5 = 0; - } - else { - if(PyUnicode_Check(swig_obj[3])) { - asAscii4 = PyUnicode_AsASCIIString(swig_obj[3]); - arg4 = PyString_AsString(asAscii4); - arg5 = PyString_Size(asAscii4); - } - else { - arg4 = PyString_AsString(swig_obj[3]); - arg5 = PyString_Size(swig_obj[3]); - } - } - } + res4 = SWIG_AsCharPtrAndSize(swig_obj[3], &buf4, &size4, &alloc4); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Session_subscribeEx" "', argument " "4"" of type '" "char const *""'"); + } + arg4 = (char *)(buf4); + arg5 = (int)(size4 - 1); { int res = SWIG_ConvertFunctionPtr(swig_obj[4], (void**)(&arg6), SWIGTYPE_p_f_p_q_const__struct_blpapi_CorrelationId_t__p_q_const__char_int_p_q_const__char_p_void__void); if (!SWIG_IsOK(res)) { @@ -19120,18 +19012,10 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_subscribeEx(PyObject *SWIGUNUSEDPARM(s SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - { - if(asAscii4) { - Py_DECREF(asAscii4); - } - } + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); return resultobj; fail: - { - if(asAscii4) { - Py_DECREF(asAscii4); - } - } + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); return NULL; } @@ -19146,7 +19030,10 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_resubscribe(PyObject *SWIGUNUSEDPARM(s int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject *asAscii3 = 0 ; + int res3 ; + char *buf3 = 0 ; + size_t size3 = 0 ; + int alloc3 = 0 ; PyObject *swig_obj[3] ; int result; @@ -19161,41 +19048,22 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_resubscribe(PyObject *SWIGUNUSEDPARM(s SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_resubscribe" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); } arg2 = (blpapi_SubscriptionList_t *)(argp2); - { - if (swig_obj[2] == Py_None) { - arg3 = 0; - arg4 = 0; - } - else { - if(PyUnicode_Check(swig_obj[2])) { - asAscii3 = PyUnicode_AsASCIIString(swig_obj[2]); - arg3 = PyString_AsString(asAscii3); - arg4 = PyString_Size(asAscii3); - } - else { - arg3 = PyString_AsString(swig_obj[2]); - arg4 = PyString_Size(swig_obj[2]); - } - } - } + res3 = SWIG_AsCharPtrAndSize(swig_obj[2], &buf3, &size3, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_resubscribe" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = (char *)(buf3); + arg4 = (int)(size3 - 1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)blpapi_Session_resubscribe(arg1,(struct blpapi_SubscriptionList const *)arg2,(char const *)arg3,arg4); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - { - if(asAscii3) { - Py_DECREF(asAscii3); - } - } + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return resultobj; fail: - { - if(asAscii3) { - Py_DECREF(asAscii3); - } - } + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return NULL; } @@ -19212,7 +19080,10 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_resubscribeEx(PyObject *SWIGUNUSEDPARM int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject *asAscii3 = 0 ; + int res3 ; + char *buf3 = 0 ; + size_t size3 = 0 ; + int alloc3 = 0 ; int res6 ; PyObject *swig_obj[5] ; int result; @@ -19228,23 +19099,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_resubscribeEx(PyObject *SWIGUNUSEDPARM SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_resubscribeEx" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); } arg2 = (blpapi_SubscriptionList_t *)(argp2); - { - if (swig_obj[2] == Py_None) { - arg3 = 0; - arg4 = 0; - } - else { - if(PyUnicode_Check(swig_obj[2])) { - asAscii3 = PyUnicode_AsASCIIString(swig_obj[2]); - arg3 = PyString_AsString(asAscii3); - arg4 = PyString_Size(asAscii3); - } - else { - arg3 = PyString_AsString(swig_obj[2]); - arg4 = PyString_Size(swig_obj[2]); - } - } - } + res3 = SWIG_AsCharPtrAndSize(swig_obj[2], &buf3, &size3, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_resubscribeEx" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = (char *)(buf3); + arg4 = (int)(size3 - 1); { int res = SWIG_ConvertFunctionPtr(swig_obj[3], (void**)(&arg5), SWIGTYPE_p_f_p_q_const__struct_blpapi_CorrelationId_t__p_q_const__char_int_p_q_const__char_p_void__void); if (!SWIG_IsOK(res)) { @@ -19261,18 +19121,10 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_resubscribeEx(PyObject *SWIGUNUSEDPARM SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - { - if(asAscii3) { - Py_DECREF(asAscii3); - } - } + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return resultobj; fail: - { - if(asAscii3) { - Py_DECREF(asAscii3); - } - } + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return NULL; } @@ -19290,7 +19142,10 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_resubscribeWithId(PyObject *SWIGUNUSED int res2 = 0 ; int val3 ; int ecode3 = 0 ; - PyObject *asAscii4 = 0 ; + int res4 ; + char *buf4 = 0 ; + size_t size4 = 0 ; + int alloc4 = 0 ; PyObject *swig_obj[4] ; int result; @@ -19310,41 +19165,22 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_resubscribeWithId(PyObject *SWIGUNUSED SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Session_resubscribeWithId" "', argument " "3"" of type '" "int""'"); } arg3 = (int)(val3); - { - if (swig_obj[3] == Py_None) { - arg4 = 0; - arg5 = 0; - } - else { - if(PyUnicode_Check(swig_obj[3])) { - asAscii4 = PyUnicode_AsASCIIString(swig_obj[3]); - arg4 = PyString_AsString(asAscii4); - arg5 = PyString_Size(asAscii4); - } - else { - arg4 = PyString_AsString(swig_obj[3]); - arg5 = PyString_Size(swig_obj[3]); - } - } - } + res4 = SWIG_AsCharPtrAndSize(swig_obj[3], &buf4, &size4, &alloc4); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Session_resubscribeWithId" "', argument " "4"" of type '" "char const *""'"); + } + arg4 = (char *)(buf4); + arg5 = (int)(size4 - 1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)blpapi_Session_resubscribeWithId(arg1,(struct blpapi_SubscriptionList const *)arg2,arg3,(char const *)arg4,arg5); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - { - if(asAscii4) { - Py_DECREF(asAscii4); - } - } + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); return resultobj; fail: - { - if(asAscii4) { - Py_DECREF(asAscii4); - } - } + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); return NULL; } @@ -19364,7 +19200,10 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_resubscribeWithIdEx(PyObject *SWIGUNUS int res2 = 0 ; int val3 ; int ecode3 = 0 ; - PyObject *asAscii4 = 0 ; + int res4 ; + char *buf4 = 0 ; + size_t size4 = 0 ; + int alloc4 = 0 ; int res7 ; PyObject *swig_obj[6] ; int result; @@ -19385,23 +19224,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_resubscribeWithIdEx(PyObject *SWIGUNUS SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Session_resubscribeWithIdEx" "', argument " "3"" of type '" "int""'"); } arg3 = (int)(val3); - { - if (swig_obj[3] == Py_None) { - arg4 = 0; - arg5 = 0; - } - else { - if(PyUnicode_Check(swig_obj[3])) { - asAscii4 = PyUnicode_AsASCIIString(swig_obj[3]); - arg4 = PyString_AsString(asAscii4); - arg5 = PyString_Size(asAscii4); - } - else { - arg4 = PyString_AsString(swig_obj[3]); - arg5 = PyString_Size(swig_obj[3]); - } - } - } + res4 = SWIG_AsCharPtrAndSize(swig_obj[3], &buf4, &size4, &alloc4); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Session_resubscribeWithIdEx" "', argument " "4"" of type '" "char const *""'"); + } + arg4 = (char *)(buf4); + arg5 = (int)(size4 - 1); { int res = SWIG_ConvertFunctionPtr(swig_obj[4], (void**)(&arg6), SWIGTYPE_p_f_p_q_const__struct_blpapi_CorrelationId_t__p_q_const__char_int_p_q_const__char_p_void__void); if (!SWIG_IsOK(res)) { @@ -19418,18 +19246,10 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_resubscribeWithIdEx(PyObject *SWIGUNUS SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - { - if(asAscii4) { - Py_DECREF(asAscii4); - } - } + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); return resultobj; fail: - { - if(asAscii4) { - Py_DECREF(asAscii4); - } - } + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); return NULL; } @@ -19444,7 +19264,10 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_unsubscribe(PyObject *SWIGUNUSEDPARM(s int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject *asAscii3 = 0 ; + int res3 ; + char *buf3 = 0 ; + size_t size3 = 0 ; + int alloc3 = 0 ; PyObject *swig_obj[3] ; int result; @@ -19459,41 +19282,22 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_unsubscribe(PyObject *SWIGUNUSEDPARM(s SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_unsubscribe" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); } arg2 = (blpapi_SubscriptionList_t *)(argp2); - { - if (swig_obj[2] == Py_None) { - arg3 = 0; - arg4 = 0; - } - else { - if(PyUnicode_Check(swig_obj[2])) { - asAscii3 = PyUnicode_AsASCIIString(swig_obj[2]); - arg3 = PyString_AsString(asAscii3); - arg4 = PyString_Size(asAscii3); - } - else { - arg3 = PyString_AsString(swig_obj[2]); - arg4 = PyString_Size(swig_obj[2]); - } - } - } + res3 = SWIG_AsCharPtrAndSize(swig_obj[2], &buf3, &size3, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_unsubscribe" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = (char *)(buf3); + arg4 = (int)(size3 - 1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)blpapi_Session_unsubscribe(arg1,(struct blpapi_SubscriptionList const *)arg2,(char const *)arg3,arg4); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - { - if(asAscii3) { - Py_DECREF(asAscii3); - } - } + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return resultobj; fail: - { - if(asAscii3) { - Py_DECREF(asAscii3); - } - } + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return NULL; } @@ -19567,7 +19371,10 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_sendRequest(PyObject *SWIGUNUSEDPARM(s int res4 = 0 ; void *argp5 = 0 ; int res5 = 0 ; - PyObject *asAscii6 = 0 ; + int res6 ; + char *buf6 = 0 ; + size_t size6 = 0 ; + int alloc6 = 0 ; PyObject *swig_obj[6] ; int result; @@ -19597,41 +19404,22 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_sendRequest(PyObject *SWIGUNUSEDPARM(s SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "blpapi_Session_sendRequest" "', argument " "5"" of type '" "blpapi_EventQueue_t *""'"); } arg5 = (blpapi_EventQueue_t *)(argp5); - { - if (swig_obj[5] == Py_None) { - arg6 = 0; - arg7 = 0; - } - else { - if(PyUnicode_Check(swig_obj[5])) { - asAscii6 = PyUnicode_AsASCIIString(swig_obj[5]); - arg6 = PyString_AsString(asAscii6); - arg7 = PyString_Size(asAscii6); - } - else { - arg6 = PyString_AsString(swig_obj[5]); - arg7 = PyString_Size(swig_obj[5]); - } - } - } + res6 = SWIG_AsCharPtrAndSize(swig_obj[5], &buf6, &size6, &alloc6); + if (!SWIG_IsOK(res6)) { + SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "blpapi_Session_sendRequest" "', argument " "6"" of type '" "char const *""'"); + } + arg6 = (char *)(buf6); + arg7 = (int)(size6 - 1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)blpapi_Session_sendRequest(arg1,(struct blpapi_Request const *)arg2,arg3,arg4,arg5,(char const *)arg6,arg7); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_From_int((int)(result)); - { - if(asAscii6) { - Py_DECREF(asAscii6); - } - } + if (alloc6 == SWIG_NEWOBJ) free((char*)buf6); return resultobj; fail: - { - if(asAscii6) { - Py_DECREF(asAscii6); - } - } + if (alloc6 == SWIG_NEWOBJ) free((char*)buf6); return NULL; } @@ -22738,7 +22526,10 @@ SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_setGroupId(PyObject unsigned int arg3 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject *asAscii2 = 0 ; + int res2 ; + char *buf2 = 0 ; + size_t size2 = 0 ; + int alloc2 = 0 ; PyObject *swig_obj[2] ; if (!SWIG_Python_UnpackTuple(args, "blpapi_ServiceRegistrationOptions_setGroupId", 2, 2, swig_obj)) SWIG_fail; @@ -22747,23 +22538,12 @@ SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_setGroupId(PyObject SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_setGroupId" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); } arg1 = (blpapi_ServiceRegistrationOptions_t *)(argp1); - { - if (swig_obj[1] == Py_None) { - arg2 = 0; - arg3 = 0; - } - else { - if(PyUnicode_Check(swig_obj[1])) { - asAscii2 = PyUnicode_AsASCIIString(swig_obj[1]); - arg2 = PyString_AsString(asAscii2); - arg3 = PyString_Size(asAscii2); - } - else { - arg2 = PyString_AsString(swig_obj[1]); - arg3 = PyString_Size(swig_obj[1]); - } - } - } + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, &size2, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ServiceRegistrationOptions_setGroupId" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + arg3 = (unsigned int)(size2 - 1); { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); @@ -22775,18 +22555,10 @@ SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_setGroupId(PyObject SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_Py_Void(); - { - if(asAscii2) { - Py_DECREF(asAscii2); - } - } + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - { - if(asAscii2) { - Py_DECREF(asAscii2); - } - } + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } diff --git a/src/blpapi/message.py b/src/blpapi/message.py index 785198a..0a2d37c 100644 --- a/src/blpapi/message.py +++ b/src/blpapi/message.py @@ -98,7 +98,7 @@ def __init__( else: self.__sessions = event._sessions() - self.__element = None + self.__element: Optional[weakref.ReferenceType] = None def __str__(self) -> str: """x.__str__() <==> str(x) @@ -372,7 +372,7 @@ def asElement(self) -> Element: el = Element( internals.blpapi_Message_elements(self.__handle), self ) - self.__element = weakref.ref(el) # type: ignore + self.__element = weakref.ref(el) return el def toString(self, level: int = 0, spacesPerLevel: int = 4) -> str: diff --git a/src/blpapi/name.py b/src/blpapi/name.py index 5222512..18112dc 100644 --- a/src/blpapi/name.py +++ b/src/blpapi/name.py @@ -118,11 +118,12 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: """x.__eq__(y) <==> x==y""" + if not isstr(other): + return self.__handle == get_handle(other) + s = conv2str(other) - if s is not None: - p = internals.blpapi_Name_equalsStr(self.__handle, s) - return p != 0 - return self.__handle == get_handle(other) + p = internals.blpapi_Name_equalsStr(self.__handle, s) + return p != 0 def __ne__(self, other: Any) -> bool: """x.__ne__(y) <==> x!=y""" @@ -134,7 +135,7 @@ def __hash__(self) -> int: def getNamePair( - name: Name, + name: Union[Name, str], ) -> Union[Tuple[None, BlpapiNameHandle], Tuple[str, None]]: """Create a tuple that contains a name string and blpapi_Name_t*. diff --git a/src/blpapi/providersession.py b/src/blpapi/providersession.py index 8340406..1da2b07 100644 --- a/src/blpapi/providersession.py +++ b/src/blpapi/providersession.py @@ -156,6 +156,10 @@ def setGroupId(self, groupId: str) -> None: ``MAX_GROUP_ID_SIZE`` (=64) only the first ``MAX_GROUP_ID_SIZE`` chars are considered as Group Id. """ + + if groupId is None: + raise ValueError("groupId must not be None") + internals.blpapi_ServiceRegistrationOptions_setGroupId( self.__handle, groupId ) diff --git a/src/blpapi/request.py b/src/blpapi/request.py index b9e5305..f016c55 100644 --- a/src/blpapi/request.py +++ b/src/blpapi/request.py @@ -8,7 +8,7 @@ """ import weakref -from typing import Any, Mapping, Set +from typing import Any, Mapping, Optional, Set from .typehints import BlpapiRequestHandle from .element import Element from .exception import _ExceptionUtil @@ -43,7 +43,7 @@ def __init__( super(Request, self).__init__(handle, internals.blpapi_Request_destroy) self.__handle = handle self.__sessions = sessions - self.__element = None + self.__element: Optional[weakref.ReferenceType] = None def __str__(self) -> str: """x.__str__() <==> str(x) @@ -128,7 +128,7 @@ def asElement(self) -> Element: el = Element( internals.blpapi_Request_elements(self.__handle), self ) - self.__element = weakref.ref(el) # type: ignore + self.__element = weakref.ref(el) return el def getElement(self, name: "typehints.Name") -> Element: diff --git a/src/blpapi/session.py b/src/blpapi/session.py index 9e42f7a..40d87d4 100644 --- a/src/blpapi/session.py +++ b/src/blpapi/session.py @@ -7,7 +7,7 @@ from __future__ import annotations from weakref import ref, ReferenceType # pylint: disable=unused-import -from typing import Optional, Callable, List +from typing import Optional, Callable, Any, List import sys import traceback import os @@ -198,8 +198,12 @@ def __init__( ) _destroy = internals.Session_destroyHelper + # note: AbstractSession destroy passes AbstractSession handle - _dtor = lambda hndl: _destroy(self.__handle, self.__handlerProxy) + def _dtor(_: Any) -> None: + atexit.unregister(self.stop) + _destroy(self.__handle, self.__handlerProxy) + atexit.register(self.stop) # we must stop session before shutdown AbstractSession.__init__( @@ -342,7 +346,7 @@ def subscribe( self, subscriptionList: "typehints.SubscriptionList", identity: Optional["typehints.Identity"] = None, - requestLabel: str = "", + requestLabel: Optional[str] = None, mode: SubscriptionPreprocessMode = SubscriptionPreprocessMode.FAIL_ON_FIRST_ERROR, ) -> Optional[List[SubscriptionPreprocessError]]: """Begin subscriptions for each entry in the specified list. @@ -445,7 +449,7 @@ def unsubscribe( def resubscribe( self, subscriptionList: "typehints.SubscriptionList", - requestLabel: str = "", + requestLabel: Optional[str] = None, resubscriptionId: Optional[int] = None, mode: SubscriptionPreprocessMode = SubscriptionPreprocessMode.FAIL_ON_FIRST_ERROR, ) -> Optional[List[SubscriptionPreprocessError]]: @@ -568,7 +572,7 @@ def sendRequest( identity: Optional["typehints.Identity"] = None, correlationId: Optional[CorrelationId] = None, eventQueue: Optional["typehints.EventQueue"] = None, - requestLabel: str = "", + requestLabel: Optional[str] = None, ) -> CorrelationId: """Send the specified ``request``. @@ -749,14 +753,16 @@ def createSnapshotRequestTemplate( cidArg = correlationId identityArg = identity - # we changed the order of last two arguments + # We changed the order of last two arguments, but # old clients may have them swapped at call site. # This detects the swap and calls the method correctly. + # It causes mypy to complain about an unreachable statement + # so we add # type: ignore to suppress it # Note: cid may never be None, only identity is allowed None # Hence, in the swapped case identity must be of type CorrelationId if isinstance(identity, CorrelationId): - cidArg = identity + cidArg = identity # type: ignore identityArg = correlationId rc, template = internals.blpapi_Session_createSnapshotRequestTemplate( diff --git a/src/blpapi/subscriptionlist.py b/src/blpapi/subscriptionlist.py index d4762db..5b45527 100644 --- a/src/blpapi/subscriptionlist.py +++ b/src/blpapi/subscriptionlist.py @@ -145,7 +145,7 @@ def __init__(self) -> None: def add( self, - topic: str, + topic: Optional[str], fields: Union[str, Sequence[str], None] = None, options: Union[str, Sequence[str], Mapping, None] = None, correlationId: Optional[CorrelationId] = None, diff --git a/src/blpapi/test/messageformatter.py b/src/blpapi/test/messageformatter.py index d2506d4..4ab258a 100644 --- a/src/blpapi/test/messageformatter.py +++ b/src/blpapi/test/messageformatter.py @@ -26,6 +26,7 @@ MIN_64BIT_INT, MAX_64BIT_INT, ) +from blpapi.chandle import CHandle def _singledispatchmethod(arg_index: int) -> Callable: @@ -59,7 +60,7 @@ def _wrapper(*args: Any, **kw: Any) -> Any: return _singleDispatchMethodImpl -class MessageFormatter: +class MessageFormatter(CHandle): """:class:`MessageFormatter` is used to populate/format a message. It supports writing only once to each field. Attempting to set an already set element will fail. @@ -87,6 +88,9 @@ class MessageFormatter: def __init__(self, handle: BlpapiMessageFormatterHandle) -> None: """For internal use only.""" + super(MessageFormatter, self).__init__( + handle, internals.blpapi_MessageFormatter_destroy + ) self.__handle = handle def _handle(self) -> BlpapiMessageFormatterHandle: @@ -114,6 +118,10 @@ def setElement(self, name: Name, value: SupportedElementTypes) -> None: once and then reused** as each :class:`blpapi.Name` instance refers to an entry in a global static table which grows in an unbounded manner. """ + + # Although the function type hint is `name: Name` because we want to encourage using Names, + # clients may actually pass a string, so we check and convert if needed + # mypy complains that conv2str doesn't take Name, which we can ignore after isstr check if isstr(name): name = Name(conv2str(name)) # type: ignore self._setElement(name, value) @@ -257,6 +265,10 @@ def pushElement(self, name: Name) -> None: once and then reused** as each :class:`blpapi.Name` instance refers to an entry in a global static table which grows in an unbounded manner. """ + + # Although the function type hint is `name: Name` because we want to encourage using Names, + # clients may actually pass a string, so we check and convert if needed + # mypy complains that conv2str doesn't take Name, which we can ignore after isstr check if isstr(name): name = Name(conv2str(name)) # type: ignore _ExceptionUtil.raiseOnError( diff --git a/src/blpapi/test/testutil.py b/src/blpapi/test/testutil.py index 41627b4..2106168 100644 --- a/src/blpapi/test/testutil.py +++ b/src/blpapi/test/testutil.py @@ -149,10 +149,11 @@ def getAdminMessageDefinition( once and then reused** as each :class:`blpapi.Name` instance refers to an entry in a global static table which grows in an unbounded manner. """ + + # Although the function type hint is `name: Name` because we want to encourage using Names, + # clients may actually pass a string, so we check and convert if needed + # mypy complains that conv2str doesn't take Name, which we can ignore after isstr check if isstr(messageName): - # although we hint that messageName should be a Name - # it may actually be a string, if users ignore this typehint - # in this case, we need to convert it messageName = Name(conv2str(messageName)) # type: ignore ( rc, diff --git a/src/blpapi/topic.py b/src/blpapi/topic.py index be814e5..e438fc1 100644 --- a/src/blpapi/topic.py +++ b/src/blpapi/topic.py @@ -36,11 +36,8 @@ def __init__( A :class:`Topic` created with ``handle`` set to ``None`` is not a valid topic and must be assigned to from a valid topic before it can be used. """ - selfhandle = handle - if handle is not None: - selfhandle = internals.blpapi_Topic_create(handle) - super(Topic, self).__init__(selfhandle, internals.blpapi_Topic_destroy) - self.__handle = selfhandle + super(Topic, self).__init__(handle, internals.blpapi_Topic_destroy) + self.__handle = handle self.__sessions = sessions if sessions is not None else set() def isValid(self) -> bool: diff --git a/src/blpapi/utils.py b/src/blpapi/utils.py index fb5215b..a07d69f 100644 --- a/src/blpapi/utils.py +++ b/src/blpapi/utils.py @@ -177,7 +177,6 @@ def conv2str(s: Union[bytes, str]) -> str: return s.decode() if isinstance(s, str): return s - return None def isstr(s: Any) -> bool: diff --git a/src/blpapi/version.py b/src/blpapi/version.py index 553ee84..6156308 100644 --- a/src/blpapi/version.py +++ b/src/blpapi/version.py @@ -4,8 +4,8 @@ from . import versionhelper -__version__ = "3.20.1" -__expected_cpp_sdk_version__ = "3.20.2" +__version__ = "3.21.0" +__expected_cpp_sdk_version__ = "3.21" def print_version() -> None: From 9070af6e17a87e93dc936f346ecb360c7458c350 Mon Sep 17 00:00:00 2001 From: Marland Sitt Date: Thu, 27 Jun 2024 14:11:56 -0700 Subject: [PATCH 17/23] v3.23.0 --- PKG-INFO | 2 +- changelog.txt | 16 +++ examples/demoapps/ApiFieldsExample.py | 1 + .../demoapps/BroadcastPublisherExample.py | 1 + examples/demoapps/ContributionsExample.py | 1 + ...mentsVerificationRequestResponseExample.py | 3 + ...tlementsVerificationSubscriptionExample.py | 1 + examples/demoapps/GenerateTokenExample.py | 1 + .../demoapps/InteractivePublisherExample.py | 1 + .../MultipleRequestsOverrideExample.py | 1 + examples/demoapps/RequestResponseExample.py | 1 + .../demoapps/RequestServiceConsumerExample.py | 1 + .../demoapps/RequestServiceProviderExample.py | 1 + examples/demoapps/SecurityLookupExample.py | 12 +- .../SnapshotRequestTemplateExample.py | 1 + examples/demoapps/SubscriptionExample.py | 5 + .../SubscriptionWithEventPollingExample.py | 1 + examples/demoapps/UserModeExample.py | 1 + src/blpapi.egg-info/PKG-INFO | 2 +- src/blpapi/abstractsession.py | 12 ++ src/blpapi/internals.py | 9 ++ src/blpapi/internals_wrap.c | 115 ++++++++++++++++++ src/blpapi/message.py | 4 + src/blpapi/sessionoptions.py | 26 ++++ src/blpapi/version.py | 8 +- 25 files changed, 214 insertions(+), 13 deletions(-) diff --git a/PKG-INFO b/PKG-INFO index e63d379..9cc63d7 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: blpapi -Version: 3.21.0 +Version: 3.23.0 Summary: Python SDK for Bloomberg BLPAPI Home-page: http://www.bloomberglabs.com/api/ Author: Bloomberg L.P. diff --git a/changelog.txt b/changelog.txt index 2af1642..5b56245 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,19 @@ +Version 3.23.0: +=============== +- Stability and performance improvements + +Version 3.22.0: +=============== +- Added support for a named session + Users can now name a session by setting a 'sessionName' in + 'SessionOptions'. The name can be used to identify the log lines pertaining + to a given session and it can be retrieved via 'Session.sessionName()' method. +- Added names to threads provided by BLPAPI + Threads that are created by 'Session' are now named according to the + following scheme: blp. Component is a brief + descriptor of the thread function, for internal use. +- Stability and performance improvements + Version 3.21.0: =============== - Horizontal scaling of requests diff --git a/examples/demoapps/ApiFieldsExample.py b/examples/demoapps/ApiFieldsExample.py index e919cc7..d20dcfd 100644 --- a/examples/demoapps/ApiFieldsExample.py +++ b/examples/demoapps/ApiFieldsExample.py @@ -76,6 +76,7 @@ def main(): options = parser.parse_args() sessionOptions = createSessionOptions(options) + sessionOptions.setSessionName("apifields") session = blpapi.Session(sessionOptions) diff --git a/examples/demoapps/BroadcastPublisherExample.py b/examples/demoapps/BroadcastPublisherExample.py index 7061998..68f607b 100644 --- a/examples/demoapps/BroadcastPublisherExample.py +++ b/examples/demoapps/BroadcastPublisherExample.py @@ -153,6 +153,7 @@ def main(): # Create a Session sessionOptions = createSessionOptions(options) + sessionOptions.setSessionName("broadcastpublisherexample") session = blpapi.ProviderSession( sessionOptions, myEventHandler.processEvent ) diff --git a/examples/demoapps/ContributionsExample.py b/examples/demoapps/ContributionsExample.py index 8da0b9c..a60b207 100644 --- a/examples/demoapps/ContributionsExample.py +++ b/examples/demoapps/ContributionsExample.py @@ -165,6 +165,7 @@ def main(): options = parseCmdLine() sessionOptions = createSessionOptions(options) + sessionOptions.setSessionName("contributions") stop = Event() myEventHandler = MyEventHandler(stop) diff --git a/examples/demoapps/EntitlementsVerificationRequestResponseExample.py b/examples/demoapps/EntitlementsVerificationRequestResponseExample.py index b4be7c1..db7b194 100644 --- a/examples/demoapps/EntitlementsVerificationRequestResponseExample.py +++ b/examples/demoapps/EntitlementsVerificationRequestResponseExample.py @@ -64,6 +64,9 @@ def createAndStartSession(self): # authorize. This may cause the session to stop and the example # to terminate if the identity is revoked. sessionOptions = createSessionOptions(self._options) + sessionOptions.setSessionName( + "entitlementsverificationrequestresponse" + ) session = Session(sessionOptions, self._router.processEvent) session.startAsync() diff --git a/examples/demoapps/EntitlementsVerificationSubscriptionExample.py b/examples/demoapps/EntitlementsVerificationSubscriptionExample.py index 02b7b28..91658a6 100644 --- a/examples/demoapps/EntitlementsVerificationSubscriptionExample.py +++ b/examples/demoapps/EntitlementsVerificationSubscriptionExample.py @@ -81,6 +81,7 @@ def _createAndStartSession(self): # This may cause the session to stop and the example to terminate if # the identity is revoked. sessionOptions = createSessionOptions(self._options) + sessionOptions.setSessionName("entitlementsverificationsubscription") self._session = Session(sessionOptions, self._router.processEvent) self._session.startAsync() diff --git a/examples/demoapps/GenerateTokenExample.py b/examples/demoapps/GenerateTokenExample.py index 8c2c2af..c95c2fb 100644 --- a/examples/demoapps/GenerateTokenExample.py +++ b/examples/demoapps/GenerateTokenExample.py @@ -86,6 +86,7 @@ def main(): sessionOptions.setServerHost(options.host) sessionOptions.setServerPort(int(options.port)) sessionOptions.setAuthenticationOptions(options.authOptions) + sessionOptions.setSessionName("generatetoken") print(f"Connecting to {options.host}:{options.port}") session = blpapi.Session(sessionOptions) diff --git a/examples/demoapps/InteractivePublisherExample.py b/examples/demoapps/InteractivePublisherExample.py index b0f9f4e..89e9b4d 100644 --- a/examples/demoapps/InteractivePublisherExample.py +++ b/examples/demoapps/InteractivePublisherExample.py @@ -370,6 +370,7 @@ def main(): ) sessionOptions = createSessionOptions(options) + sessionOptions.setSessionName("interactivepublisher") session = blpapi.ProviderSession( sessionOptions, myEventHandler.processEvent ) diff --git a/examples/demoapps/MultipleRequestsOverrideExample.py b/examples/demoapps/MultipleRequestsOverrideExample.py index 594ca17..7121168 100644 --- a/examples/demoapps/MultipleRequestsOverrideExample.py +++ b/examples/demoapps/MultipleRequestsOverrideExample.py @@ -19,6 +19,7 @@ def main(): cliOptions = parser.parse_args() sessionOptions = createSessionOptions(cliOptions) + sessionOptions.setSessionName("multiplerequestsoverride") session = blpapi.Session(sessionOptions) try: diff --git a/examples/demoapps/RequestResponseExample.py b/examples/demoapps/RequestResponseExample.py index 5ab9944..1daa8bd 100644 --- a/examples/demoapps/RequestResponseExample.py +++ b/examples/demoapps/RequestResponseExample.py @@ -185,6 +185,7 @@ def main(): options = parseCmdLine() sessionOptions = createSessionOptions(options) + sessionOptions.setSessionName("requestresponse") session = blpapi.Session(sessionOptions) try: diff --git a/examples/demoapps/RequestServiceConsumerExample.py b/examples/demoapps/RequestServiceConsumerExample.py index 6b7fdf0..6ec4898 100644 --- a/examples/demoapps/RequestServiceConsumerExample.py +++ b/examples/demoapps/RequestServiceConsumerExample.py @@ -28,6 +28,7 @@ def parseCmdLine(): def main(): options = parseCmdLine() sessionOptions = createSessionOptions(options) + sessionOptions.setSessionName("requestserviceconsumer") session = blpapi.Session(sessionOptions) try: diff --git a/examples/demoapps/RequestServiceProviderExample.py b/examples/demoapps/RequestServiceProviderExample.py index 6886be0..0b67b0f 100644 --- a/examples/demoapps/RequestServiceProviderExample.py +++ b/examples/demoapps/RequestServiceProviderExample.py @@ -97,6 +97,7 @@ def processEvent(event, session): def main(): options = parseCmdLine() sessionOptions = createSessionOptions(options) + sessionOptions.setSessionName("requestserviceprovider") providerSession = blpapi.ProviderSession(sessionOptions, processEvent) diff --git a/examples/demoapps/SecurityLookupExample.py b/examples/demoapps/SecurityLookupExample.py index 00bd883..0c8ba5b 100644 --- a/examples/demoapps/SecurityLookupExample.py +++ b/examples/demoapps/SecurityLookupExample.py @@ -156,15 +156,16 @@ def waitForResponse(session, requestType): print("Processing Response") processResponseEvent(event, requestType) done = True + elif eventType == blpapi.Event.REQUEST_STATUS: + for msg in event: + if msg.messageType() == REQUEST_FAILURE: + print(f"Request failed: {msg}") + done = True else: for msg in event: - if eventType == blpapi.Event.REQUEST_STATUS: - if msg.messageType() == REQUEST_FAILURE: - print(f"Request failed: {msg}") - done = True + print(msg) if eventType == blpapi.Event.SESSION_STATUS: if msg.messageType() == SESSION_TERMINATED: - print(f"Session terminated: {msg}") done = True @@ -183,6 +184,7 @@ def main(): options = parseCmdLine() sessionOptions = createSessionOptions(options) + sessionOptions.setSessionName("securitylookupexample") session = blpapi.Session(sessionOptions) try: diff --git a/examples/demoapps/SnapshotRequestTemplateExample.py b/examples/demoapps/SnapshotRequestTemplateExample.py index c4e5288..f2fb1ed 100644 --- a/examples/demoapps/SnapshotRequestTemplateExample.py +++ b/examples/demoapps/SnapshotRequestTemplateExample.py @@ -146,6 +146,7 @@ def run(self): sessionOptions = createSessionOptions(options) setSubscriptionSessionOptions(sessionOptions, options) + sessionOptions.setSessionName("snapshotrequesttemplateexample") session = blpapi.Session(sessionOptions, self.processEvent) try: diff --git a/examples/demoapps/SubscriptionExample.py b/examples/demoapps/SubscriptionExample.py index 3c75d35..9a46ca2 100644 --- a/examples/demoapps/SubscriptionExample.py +++ b/examples/demoapps/SubscriptionExample.py @@ -78,6 +78,10 @@ def processMiscEvents(self, event): if msg.messageType() == blpapi.Names.SESSION_TERMINATED: print("Session terminated") return + else: + print(msg) + else: + print(msg) def processEvent(self, event, _session): try: @@ -123,6 +127,7 @@ def main(): sessionOptions = createSessionOptions(options) setSubscriptionSessionOptions(sessionOptions, options) sessionOptions.setMaxEventQueueSize(options.eventQueueSize) + sessionOptions.setSessionName("subscription") handler = SubscriptionEventHandler() session = blpapi.Session(sessionOptions, handler.processEvent) diff --git a/examples/demoapps/SubscriptionWithEventPollingExample.py b/examples/demoapps/SubscriptionWithEventPollingExample.py index 0d70a24..23b97d0 100644 --- a/examples/demoapps/SubscriptionWithEventPollingExample.py +++ b/examples/demoapps/SubscriptionWithEventPollingExample.py @@ -142,6 +142,7 @@ def main(): sessionOptions = createSessionOptions(options) setSubscriptionSessionOptions(sessionOptions, options) + sessionOptions.setSessionName("subscriptionwitheventpolling") session = blpapi.Session(sessionOptions) try: diff --git a/examples/demoapps/UserModeExample.py b/examples/demoapps/UserModeExample.py index ae10c94..5ef50b4 100644 --- a/examples/demoapps/UserModeExample.py +++ b/examples/demoapps/UserModeExample.py @@ -59,6 +59,7 @@ def createAndStartSession(self): # authorize. This may cause the session to stop and the example # to terminate, if the identity is revoked. sessionOptions = createSessionOptions(self._options) + sessionOptions.setSessionName("usermode") self._session = Session(sessionOptions, self._router.processEvent) self._session.startAsync() diff --git a/src/blpapi.egg-info/PKG-INFO b/src/blpapi.egg-info/PKG-INFO index e63d379..9cc63d7 100644 --- a/src/blpapi.egg-info/PKG-INFO +++ b/src/blpapi.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: blpapi -Version: 3.21.0 +Version: 3.23.0 Summary: Python SDK for Bloomberg BLPAPI Home-page: http://www.bloomberglabs.com/api/ Author: Bloomberg L.P. diff --git a/src/blpapi/abstractsession.py b/src/blpapi/abstractsession.py index a4c6c47..3e4294b 100644 --- a/src/blpapi/abstractsession.py +++ b/src/blpapi/abstractsession.py @@ -426,6 +426,18 @@ def getAuthorizedIdentity( _ExceptionUtil.raiseOnError(retcode) return Identity(identity_handle, (self,)) + def sessionName(self) -> str: + """ + Returns: + The session name. + """ + (result, sessionName) = internals.blpapi_AbstractSession_sessionName( + self.__handle + ) + + _ExceptionUtil.raiseOnError(result) + return sessionName + __copyright__ = """ Copyright 2019. Bloomberg Finance L.P. diff --git a/src/blpapi/internals.py b/src/blpapi/internals.py index 75b0146..6301801 100644 --- a/src/blpapi/internals.py +++ b/src/blpapi/internals.py @@ -1099,6 +1099,12 @@ def blpapi_SessionOptions_setApplicationIdentityKey(parameters, applicationIdent def blpapi_SessionOptions_applicationIdentityKey(parameters): return _internals.blpapi_SessionOptions_applicationIdentityKey(parameters) +def blpapi_SessionOptions_setSessionName(parameters, sessionName): + return _internals.blpapi_SessionOptions_setSessionName(parameters, sessionName) + +def blpapi_SessionOptions_sessionName(parameters): + return _internals.blpapi_SessionOptions_sessionName(parameters) + def blpapi_TlsOptions_destroy(parameters): return _internals.blpapi_TlsOptions_destroy(parameters) @@ -1522,6 +1528,9 @@ def blpapi_AbstractSession_generateAuthorizedIdentityAsync(session, authOptions, def blpapi_AbstractSession_getAuthorizedIdentity(session, cid): return _internals.blpapi_AbstractSession_getAuthorizedIdentity(session, cid) +def blpapi_AbstractSession_sessionName(session): + return _internals.blpapi_AbstractSession_sessionName(session) + def blpapi_Session_start(session): return _internals.blpapi_Session_start(session) diff --git a/src/blpapi/internals_wrap.c b/src/blpapi/internals_wrap.c index 5379a5e..ffbbe69 100644 --- a/src/blpapi/internals_wrap.c +++ b/src/blpapi/internals_wrap.c @@ -13685,6 +13685,82 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_applicationIdentityKey(PyObject } +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setSessionName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; + char *arg2 = (char *) 0 ; + size_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + size_t size2 = 0 ; + int alloc2 = 0 ; + PyObject *swig_obj[2] ; + int result; + + if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setSessionName", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setSessionName" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg1 = (blpapi_SessionOptions_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, &size2, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setSessionName" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + arg3 = (size_t)(size2 - 1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_setSessionName(arg1,(char const *)arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_sessionName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + char **arg1 = (char **) 0 ; + size_t *arg2 = (size_t *) 0 ; + blpapi_SessionOptions_t *arg3 = (blpapi_SessionOptions_t *) 0 ; + char *temp1 = 0 ; + size_t temp2 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject *swig_obj[1] ; + int result; + + arg1 = &temp1; + arg2 = &temp2; + if (!args) SWIG_fail; + swig_obj[0] = args; + res3 = SWIG_ConvertPtr(swig_obj[0], &argp3,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_SessionOptions_sessionName" "', argument " "3"" of type '" "blpapi_SessionOptions_t *""'"); + } + arg3 = (blpapi_SessionOptions_t *)(argp3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_sessionName((char const **)arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtrAndSize(*arg1, *arg2)); + } + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_TlsOptions_t *arg1 = (blpapi_TlsOptions_t *) 0 ; @@ -18718,6 +18794,42 @@ SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_getAuthorizedIdentity(PyObject } +SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_sessionName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; + char **arg2 = (char **) 0 ; + size_t *arg3 = (size_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + char *temp2 = 0 ; + size_t temp3 ; + PyObject *swig_obj[1] ; + int result; + + arg2 = &temp2; + arg3 = &temp3; + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_sessionName" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); + } + arg1 = (blpapi_AbstractSession_t *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_AbstractSession_sessionName(arg1,(char const **)arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_int((int)(result)); + { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtrAndSize(*arg2, *arg3)); + } + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_blpapi_Session_start(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; @@ -23031,6 +23143,8 @@ static PyMethodDef SwigMethods[] = { { "blpapi_SessionOptions_bandwidthSaveModeDisabled", _wrap_blpapi_SessionOptions_bandwidthSaveModeDisabled, METH_O, NULL}, { "blpapi_SessionOptions_setApplicationIdentityKey", _wrap_blpapi_SessionOptions_setApplicationIdentityKey, METH_VARARGS, NULL}, { "blpapi_SessionOptions_applicationIdentityKey", _wrap_blpapi_SessionOptions_applicationIdentityKey, METH_O, NULL}, + { "blpapi_SessionOptions_setSessionName", _wrap_blpapi_SessionOptions_setSessionName, METH_VARARGS, NULL}, + { "blpapi_SessionOptions_sessionName", _wrap_blpapi_SessionOptions_sessionName, METH_O, NULL}, { "blpapi_TlsOptions_destroy", _wrap_blpapi_TlsOptions_destroy, METH_O, NULL}, { "blpapi_TlsOptions_createFromFiles", _wrap_blpapi_TlsOptions_createFromFiles, METH_VARARGS, NULL}, { "blpapi_TlsOptions_createFromBlobs", _wrap_blpapi_TlsOptions_createFromBlobs, METH_VARARGS, NULL}, @@ -23193,6 +23307,7 @@ static PyMethodDef SwigMethods[] = { { "blpapi_AbstractSession_createIdentity", _wrap_blpapi_AbstractSession_createIdentity, METH_O, NULL}, { "blpapi_AbstractSession_generateAuthorizedIdentityAsync", _wrap_blpapi_AbstractSession_generateAuthorizedIdentityAsync, METH_VARARGS, NULL}, { "blpapi_AbstractSession_getAuthorizedIdentity", _wrap_blpapi_AbstractSession_getAuthorizedIdentity, METH_VARARGS, NULL}, + { "blpapi_AbstractSession_sessionName", _wrap_blpapi_AbstractSession_sessionName, METH_O, NULL}, { "blpapi_Session_start", _wrap_blpapi_Session_start, METH_O, NULL}, { "blpapi_Session_startAsync", _wrap_blpapi_Session_startAsync, METH_O, NULL}, { "blpapi_Session_stop", _wrap_blpapi_Session_stop, METH_O, NULL}, diff --git a/src/blpapi/message.py b/src/blpapi/message.py index 0a2d37c..3df9637 100644 --- a/src/blpapi/message.py +++ b/src/blpapi/message.py @@ -88,6 +88,10 @@ def __init__( event: Event that this message belongs to sessions: Sessions that this object is associated with """ + + if handle is None: + raise ValueError("Handle should not be None") + internals.blpapi_Message_addRef(handle) super(Message, self).__init__(handle, internals.blpapi_Message_release) self.__handle = handle diff --git a/src/blpapi/sessionoptions.py b/src/blpapi/sessionoptions.py index 8792604..c07dc56 100644 --- a/src/blpapi/sessionoptions.py +++ b/src/blpapi/sessionoptions.py @@ -660,6 +660,32 @@ def applicationIdentityKey(self) -> str: _ExceptionUtil.raiseOnError(result) return aik + def setSessionName(self, sessionName: str) -> None: + """Set the session name which can be used to identify the log + lines pertaining to the session. + + Args: + sessionName: The session name to set. + """ + + _ExceptionUtil.raiseOnError( + internals.blpapi_SessionOptions_setSessionName( + self.__handle, sessionName + ) + ) + + def sessionName(self) -> str: + """ + Returns: + The session name. + """ + (result, sessionName) = internals.blpapi_SessionOptions_sessionName( + self.__handle + ) + + _ExceptionUtil.raiseOnError(result) + return sessionName + def serverHost(self) -> str: """ Returns: diff --git a/src/blpapi/version.py b/src/blpapi/version.py index 6156308..fffde46 100644 --- a/src/blpapi/version.py +++ b/src/blpapi/version.py @@ -4,8 +4,8 @@ from . import versionhelper -__version__ = "3.21.0" -__expected_cpp_sdk_version__ = "3.21" +__version__ = "3.23.0" +__expected_cpp_sdk_version__ = "3.23" def print_version() -> None: @@ -29,10 +29,6 @@ def cpp_sdk_version() -> str: str: BLPAPI C++ SDK dependency version """ version_string = ".".join(map(str, versionhelper.blpapi_getVersionInfo())) - - commit_id = versionhelper.blpapi_getVersionIdentifier() - if commit_id != "Unknown": - version_string += " (" + commit_id + ")" return version_string From b1e0c0366f174066b6be11ca6b0f984ee0ba08fd Mon Sep 17 00:00:00 2001 From: Marland Sitt Date: Thu, 27 Jun 2024 14:12:44 -0700 Subject: [PATCH 18/23] v3.23.1 --- PKG-INFO | 2 +- changelog.txt | 4 +++ examples/demoapps/SubscriptionExample.py | 33 +++++++++++------------- src/blpapi.egg-info/PKG-INFO | 2 +- src/blpapi/version.py | 4 +-- 5 files changed, 23 insertions(+), 22 deletions(-) diff --git a/PKG-INFO b/PKG-INFO index 9cc63d7..f0ee258 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: blpapi -Version: 3.23.0 +Version: 3.23.1 Summary: Python SDK for Bloomberg BLPAPI Home-page: http://www.bloomberglabs.com/api/ Author: Bloomberg L.P. diff --git a/changelog.txt b/changelog.txt index 5b56245..f3494dd 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,7 @@ +Version 3.23.1: +=============== +- Stability and performance improvements + Version 3.23.0: =============== - Stability and performance improvements diff --git a/examples/demoapps/SubscriptionExample.py b/examples/demoapps/SubscriptionExample.py index 9a46ca2..12e0833 100644 --- a/examples/demoapps/SubscriptionExample.py +++ b/examples/demoapps/SubscriptionExample.py @@ -62,26 +62,23 @@ def processMiscEvents(self, event): + "when SlowConsumerWarning message was delivered, " + "it is now safe to continue as normal.\n" ) - elif msg.messageType() == blpapi.Names.DATA_LOSS: - print(msg) - topic = msg.correlationId().value() - print( - f"{blpapi.Names.DATA_LOSS} - The application is too slow to " - + "process events and the event queue is overflowing. " - + f"Data is lost for topic {topic}.\n" - ) - elif event.eventType() == blpapi.Event.SESSION_STATUS: - # SESSION_STATUS events can happen at any time and - # should be handled as the session can be terminated, - # e.g. session identity can be revoked at a later - # time, which terminates the session. - if msg.messageType() == blpapi.Names.SESSION_TERMINATED: - print("Session terminated") - return - else: - print(msg) else: print(msg) + if msg.messageType() == blpapi.Names.DATA_LOSS: + topic = msg.correlationId().value() + print( + f"{blpapi.Names.DATA_LOSS} - The application is too slow to " + + "process events and the event queue is overflowing. " + + f"Data is lost for topic {topic}.\n" + ) + elif event.eventType() == blpapi.Event.SESSION_STATUS: + # SESSION_STATUS events can happen at any time and + # should be handled as the session can be terminated, + # e.g. session identity can be revoked at a later + # time, which terminates the session. + if msg.messageType() == blpapi.Names.SESSION_TERMINATED: + print("Session terminated") + return def processEvent(self, event, _session): try: diff --git a/src/blpapi.egg-info/PKG-INFO b/src/blpapi.egg-info/PKG-INFO index 9cc63d7..f0ee258 100644 --- a/src/blpapi.egg-info/PKG-INFO +++ b/src/blpapi.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: blpapi -Version: 3.23.0 +Version: 3.23.1 Summary: Python SDK for Bloomberg BLPAPI Home-page: http://www.bloomberglabs.com/api/ Author: Bloomberg L.P. diff --git a/src/blpapi/version.py b/src/blpapi/version.py index fffde46..49e54e1 100644 --- a/src/blpapi/version.py +++ b/src/blpapi/version.py @@ -4,8 +4,8 @@ from . import versionhelper -__version__ = "3.23.0" -__expected_cpp_sdk_version__ = "3.23" +__version__ = "3.23.1" +__expected_cpp_sdk_version__ = "3.23.2" def print_version() -> None: From c200da6964810088763b9a776a98050b8d726506 Mon Sep 17 00:00:00 2001 From: Marland Sitt Date: Thu, 27 Jun 2024 14:13:20 -0700 Subject: [PATCH 19/23] v3.24.2 --- PKG-INFO | 7 +- changelog.txt | 26 +++++ .../src/event_processor.py | 1 + .../market-data-notifier/src/notifier.py | 1 + examples/unittests/snippets/test_events.py | 41 +------ src/blpapi.egg-info/PKG-INFO | 7 +- src/blpapi/abstractsession.py | 22 ++-- src/blpapi/constant.py | 4 +- src/blpapi/debug_environment.py | 1 + src/blpapi/element.py | 102 +++++++++--------- src/blpapi/eventdispatcher.py | 2 +- src/blpapi/eventformatter.py | 18 ++-- src/blpapi/internals.py | 2 +- src/blpapi/internals_wrap.c | 4 + src/blpapi/message.py | 4 +- src/blpapi/names.py | 2 - src/blpapi/providersession.py | 22 ++-- src/blpapi/resolutionlist.py | 6 +- src/blpapi/schema.py | 4 +- src/blpapi/service.py | 26 ++--- src/blpapi/session.py | 16 +-- src/blpapi/sessionoptions.py | 2 +- src/blpapi/subscriptionlist.py | 6 +- src/blpapi/topiclist.py | 12 +-- src/blpapi/version.py | 4 +- 25 files changed, 172 insertions(+), 170 deletions(-) diff --git a/PKG-INFO b/PKG-INFO index f0ee258..f553859 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,10 +1,12 @@ Metadata-Version: 2.1 Name: blpapi -Version: 3.23.1 +Version: 3.24.2 Summary: Python SDK for Bloomberg BLPAPI Home-page: http://www.bloomberglabs.com/api/ Author: Bloomberg L.P. Author-email: open-tech@bloomberg.net +License: UNKNOWN +Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: Intended Audience :: Financial and Insurance Industry @@ -12,3 +14,6 @@ Classifier: License :: Other/Proprietary License Classifier: Topic :: Office/Business :: Financial Requires-Python: >=3.8 License-File: License.txt + +UNKNOWN + diff --git a/changelog.txt b/changelog.txt index f3494dd..0389be8 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,29 @@ +Version 3.24.2: +=============== +- Stability and performance improvements + +Version 3.24.1: +================ +- Added 'serverId' in subscription stream messages + 'serverId', which identifies the endpoint where a subscription is established, + has been added to 'SubscriptionStreamsActivated' and 'SubscriptionStreamsDeactivated' messages. +- Stability and performance improvements + +Version 3.23.12: +================ +- Stability and performance improvements + +Version 3.23.11: +=============== +- Versioning scheme change + BLPAPI now uses a versioning scheme that provides information about + the year and month the release was made. For example, '3.23.11' is the SDK + version 3 released in November of 2023. + - Automated cluster management for the public cloud + SDK now supports clustered configurations in the public cloud + that take advantage of horizontal scaling capabilities +- Stability and performance improvements + Version 3.23.1: =============== - Stability and performance improvements diff --git a/examples/unittests/market-data-notifier/src/event_processor.py b/examples/unittests/market-data-notifier/src/event_processor.py index eb7f64b..9a849e6 100644 --- a/examples/unittests/market-data-notifier/src/event_processor.py +++ b/examples/unittests/market-data-notifier/src/event_processor.py @@ -1,4 +1,5 @@ """Simple class for handling incoming events from a session""" + import blpapi TOKEN_SUCCESS = blpapi.Name("TokenSuccess") diff --git a/examples/unittests/market-data-notifier/src/notifier.py b/examples/unittests/market-data-notifier/src/notifier.py index 21db227..e459c50 100644 --- a/examples/unittests/market-data-notifier/src/notifier.py +++ b/examples/unittests/market-data-notifier/src/notifier.py @@ -1,4 +1,5 @@ """Sample class for testing purposes.""" + from __future__ import print_function diff --git a/examples/unittests/snippets/test_events.py b/examples/unittests/snippets/test_events.py index a8f2bf7..886db6e 100644 --- a/examples/unittests/snippets/test_events.py +++ b/examples/unittests/snippets/test_events.py @@ -120,46 +120,7 @@ def testSessionConnectionDown(self): "server": "12.34.56.78:8194", "serverId": "ny-hostname", "socks5Proxy": "socks5Host:1080", - } - - formatter.formatMessageDict(content) - for msg in event: - self.assertEqual(content, msg.toPy()) - - def testSessionClusterInfo(self): - """Sample SessionClusterInfo message""" - event = blpapi.test.createEvent(blpapi.Event.SESSION_STATUS) - schema = blpapi.test.getAdminMessageDefinition( - blpapi.Names.SESSION_CLUSTER_INFO - ) - - formatter = blpapi.test.appendMessage(event, schema) - - content = { - "name": "clustername", - "endpoints": [ - {"address": "12.34.56.78:8194"}, - {"address": "98.76.54.32:8194"}, - ], - } - - formatter.formatMessageDict(content) - for msg in event: - self.assertEqual(content, msg.toPy()) - - def testSessionClusterUpdate(self): - """Sample SessionClusterUpdate message""" - event = blpapi.test.createEvent(blpapi.Event.SESSION_STATUS) - schema = blpapi.test.getAdminMessageDefinition( - blpapi.Names.SESSION_CLUSTER_UPDATE - ) - - formatter = blpapi.test.appendMessage(event, schema) - - content = { - "name": "clustername", - "endpointsAdded": [{"address": "12.34.56.78:8194"}], - "endpointsRemoved": [{"address": "98.76.54.32:8194"}], + "description": "Connection down description", } formatter.formatMessageDict(content) diff --git a/src/blpapi.egg-info/PKG-INFO b/src/blpapi.egg-info/PKG-INFO index f0ee258..f553859 100644 --- a/src/blpapi.egg-info/PKG-INFO +++ b/src/blpapi.egg-info/PKG-INFO @@ -1,10 +1,12 @@ Metadata-Version: 2.1 Name: blpapi -Version: 3.23.1 +Version: 3.24.2 Summary: Python SDK for Bloomberg BLPAPI Home-page: http://www.bloomberglabs.com/api/ Author: Bloomberg L.P. Author-email: open-tech@bloomberg.net +License: UNKNOWN +Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: Intended Audience :: Financial and Insurance Industry @@ -12,3 +14,6 @@ Classifier: License :: Other/Proprietary License Classifier: Topic :: Office/Business :: Financial Requires-Python: >=3.8 License-File: License.txt + +UNKNOWN + diff --git a/src/blpapi/abstractsession.py b/src/blpapi/abstractsession.py index 3e4294b..4e6b790 100644 --- a/src/blpapi/abstractsession.py +++ b/src/blpapi/abstractsession.py @@ -31,7 +31,7 @@ class AbstractSession(CHandle): - """A common interface shared between publish and consumer sessions. + r"""A common interface shared between publish and consumer sessions. This class provides an abstract session which defines shared interface between publish and consumer requests for Bloomberg. @@ -74,12 +74,12 @@ class AbstractSession(CHandle): (even though ``startAsync()`` itself will not block). This becomes more significant when Session generated - :class:`CorrelationId`\ s are in use. For example, if a call to + :class:`CorrelationId`\s are in use. For example, if a call to ``subscribe()`` which returns a Session generated :class:`CorrelationId` - has not completed before the first :class:`Event`\ s which contain that + has not completed before the first :class:`Event`\s which contain that :class:`CorrelationId` arrive the application may not be able to interpret those events correctly. For this reason, it is preferable to use user - generated :class:`CorrelationId`\ s when using asynchronous Sessions. This + generated :class:`CorrelationId`\s when using asynchronous Sessions. This issue does not arise when using a synchronous Session as long as the calls to ``subscribe()`` etc are made on the same thread as the calls to ``nextEvent()``. @@ -105,8 +105,8 @@ def __init__( if self.__class__ is AbstractSession: raise NotImplementedError( - "Don't instantiate this class directly.\ - Create sessions using one of the concrete subclasses of this class." + "Don't instantiate this class directly." + "Create sessions using one of the concrete subclasses of this class." ) super(AbstractSession, self).__init__(handle, dtor) # type: ignore self.__handle = handle @@ -144,7 +144,7 @@ def openService(self, serviceName: str) -> bool: def openServiceAsync( self, serviceName: str, correlationId: Optional[CorrelationId] = None ) -> CorrelationId: - """Begin the process to open the service and return immediately. + r"""Begin the process to open the service and return immediately. Args: serviceName: Name of the service @@ -157,7 +157,7 @@ def openServiceAsync( Begin the process to open the service identified by the specified ``serviceName`` and return immediately. The optional specified - ``correlationId`` is used to track :class:`Event`\ s generated as a + ``correlationId`` is used to track :class:`Event`\s generated as a result of this call. The ``serviceName`` must contain a fully qualified service name. That @@ -183,7 +183,7 @@ def sendAuthorizationRequest( correlationId: Optional[CorrelationId] = None, eventQueue: Optional["typehints.EventQueue"] = None, ) -> CorrelationId: - """Send the specified ``authorizationRequest``. + r"""Send the specified ``authorizationRequest``. Args: request: Authorization request to send @@ -201,14 +201,14 @@ def sendAuthorizationRequest( ``correlationId`` is supplied, it is used; otherwise create a :class:`CorrelationId`. The actual :class:`CorrelationId` used is returned. If the optionally specified ``eventQueue`` is supplied all - :class:`Event`\ s relating to this :class:`Request` will arrive on that + :class:`Event`\s relating to this :class:`Request` will arrive on that :class:`EventQueue`. The underlying user information must remain valid until the Request has completed successfully or failed. A successful request will generate zero or more - :attr:`~Event.PARTIAL_RESPONSE` :class:`Message`\ s followed by + :attr:`~Event.PARTIAL_RESPONSE` :class:`Message`\s followed by exactly one :attr:`~Event.RESPONSE` :class:`Message`. Once the final :attr:`~Event.RESPONSE` :class:`Message` has been received the specified ``identity`` will have been updated to contain the users diff --git a/src/blpapi/constant.py b/src/blpapi/constant.py index f98a722..1a94adb 100644 --- a/src/blpapi/constant.py +++ b/src/blpapi/constant.py @@ -33,9 +33,9 @@ class Constant: - """Represents the value of a schema enumeration constant. + r"""Represents the value of a schema enumeration constant. - Constants can be any of the following :class:`DataType`\ s: + Constants can be any of the following :class:`DataType`\s: :attr:`~DataType.BOOL`, :attr:`~DataType.CHAR`, :attr:`~DataType.BYTE`, :attr:`~DataType.INT32`, :attr:`~DataType.INT64`, :attr:`~DataType.FLOAT32`, :attr:`~DataType.FLOAT64`, diff --git a/src/blpapi/debug_environment.py b/src/blpapi/debug_environment.py index 05f0e63..cc88998 100644 --- a/src/blpapi/debug_environment.py +++ b/src/blpapi/debug_environment.py @@ -2,6 +2,7 @@ Print various potentially useful information to debug environment setup related issues """ + import platform import sys import os diff --git a/src/blpapi/element.py b/src/blpapi/element.py index d68cc1b..1fa5f29 100644 --- a/src/blpapi/element.py +++ b/src/blpapi/element.py @@ -40,10 +40,10 @@ # pylint: disable=protected-access,too-many-return-statements,too-many-public-methods class ElementIterator(IteratorABC): - """An iterator over the objects within an :class:`Element`. + r"""An iterator over the objects within an :class:`Element`. If the :class:`Element` is a sequence or choice, this iterates over its - sub-:class:`Element`\ s. Otherwise, iterate over the :class:`Element`\ 's + sub-:class:`Element`\s. Otherwise, iterate over the :class:`Element`'s value(s). """ @@ -273,8 +273,8 @@ def __getitem__( """ Args: nameOrIndex: The :class:`Name` identifying the - :class:`Element` to retrieve from this :class:`Element`\ , or - the index to retrieve the value from this :class:`Element`\ . + :class:`Element` to retrieve from this :class:`Element`, or + the index to retrieve the value from this :class:`Element`. Returns: If a :class:`Name` or :py:class:`str` is used, and the @@ -324,17 +324,17 @@ def __setitem__( name: Name, value: Union[Mapping, Sequence, SupportedElementTypes], ) -> None: - """ + r""" Args: name: The :class:`Name` identifying one of this - :class:`Element`\ 's sub-:class:`Element`\ s. + :class:`Element`'s sub-:class:`Element`\s. value: Used to format the :class:`Element`. See :meth:`fromPy` for more details. Raises: Exception: - If ``name`` does not identify one of this :class:`Element`\ 's - sub-:class:`Element`\ s. + If ``name`` does not identify one of this :class:`Element`'s + sub-:class:`Element`\s. Exception: If the :class:`Element` identified by ``name`` is has been previously formatted. @@ -342,15 +342,15 @@ def __setitem__( If the :class:`Element` identified by ``name`` cannot be formatted by ``value`` (See :meth:`fromPy` for more details). - Format this :class:`Element`\ 's sub-:class:`Element` identified by + Format this :class:`Element`'s sub-:class:`Element` identified by ``name`` with ``value``. See :meth:`fromPy` for more details. Note: - :class:`Element`\ s that have been previously formatted in any way + :class:`Element`\s that have been previously formatted in any way cannot be formatted further with this method. To further format an - :class:`Element`\ , use the get/set/append Element/Value methods. + :class:`Element`, use the get/set/append Element/Value methods. Note: - :class:`Element`\ s cannot be modified by index. + :class:`Element`\s cannot be modified by index. """ if isinstance(name, int): raise Exception("Elements cannot be formatted by index") @@ -358,22 +358,22 @@ def __setitem__( self.getElement(name).fromPy(value) def __iter__(self) -> IteratorType: - """ + r""" Returns: An iterator over the contents of this :class:`Element`. If this :class:`Element` is a complex type (see :meth:`isComplexType`), - return an iterator over the :class:`Element`\ s in this + return an iterator over the :class:`Element`\s in this :class:`Element`. Otherwise, return an iterator over this - :class:`Element`\ 's value(s). + :class:`Element`'s value(s). """ return ElementIterator(self) def __len__(self) -> int: - """ + r""" Returns: If this :class:`Element` is a complex type (see :meth:`isComplexType`), return the number of - :class:`Element`\ s in this :class:`Element`. Otherwise, return the + :class:`Element`\s in this :class:`Element`. Otherwise, return the number of values in this :class:`Element`. """ if self.isComplexType(): @@ -534,7 +534,7 @@ def isNullValue(self, position: int = 0) -> bool: return False # unreachable def toPy(self) -> Union[Dict, List, SupportedElementTypes]: - """ + r""" Returns: A :py:class:`dict`, :py:class:`list`, or value representation of this :class:`Element`. This is a deep copy containing only native @@ -544,7 +544,7 @@ def toPy(self) -> Union[Dict, List, SupportedElementTypes]: If an :class:`Element` is * a complex type, it is converted to a :py:class:`dict` whose keys are - the :py:class:`str` names of its sub-:class:`Element`\ s. + the :py:class:`str` names of its sub-:class:`Element`\s. * an array, it is converted to a :py:class:`list` of the :class:`Element`'s values. * null, it is converted an empty :py:class:`dict`. @@ -726,12 +726,12 @@ def getChoice(self) -> Element: return Element(res[1], self._getDataHolder()) def getValueAsBool(self, index: int = 0) -> bool: - """ + r""" Args: index: Index of the value in the element Returns: - ``index``\ th entry in the :class:`Element` as a boolean. + ``index``\th entry in the :class:`Element` as a boolean. Raises: InvalidConversionException: If the data type of this @@ -745,12 +745,12 @@ def getValueAsBool(self, index: int = 0) -> bool: return bool(res[1]) def getValueAsString(self, index: int = 0) -> str: - """ + r""" Args: index: Index of the value in the element Returns: - ``index``\ th entry in the :class:`Element` as a string. + ``index``\th entry in the :class:`Element` as a string. Raises: InvalidConversionException: If the data type of this @@ -764,12 +764,12 @@ def getValueAsString(self, index: int = 0) -> str: return res[1] def getValueAsBytes(self, index: int = 0) -> bytes: - """ + r""" Args: index: Index of the value in the element Returns: - ``index``\ th entry in the :class:`Element` as bytes. + ``index``\th entry in the :class:`Element` as bytes. Raises: InvalidConversionException: If the data type of this @@ -783,12 +783,12 @@ def getValueAsBytes(self, index: int = 0) -> bytes: return res[1] def getValueAsDatetime(self, index: int = 0) -> AnyPythonDatetime: - """ + r""" Args: index: Index of the value in the element Returns: - datetime.time or datetime.date or datetime.datetime: ``index``\ th + datetime.time or datetime.date or datetime.datetime: ``index``\th entry in the :class:`Element` as one of the datetime types. Raises: @@ -805,12 +805,12 @@ def getValueAsDatetime(self, index: int = 0) -> AnyPythonDatetime: return _DatetimeUtil.convertToNative(res[1]) def getValueAsInteger(self, index: int = 0) -> int: - """ + r""" Args: index: Index of the value in the element Returns: - ``index``\ th entry in the :class:`Element` as a integer + ``index``\th entry in the :class:`Element` as a integer Raises: InvalidConversionException: If the data type of this @@ -824,12 +824,12 @@ def getValueAsInteger(self, index: int = 0) -> int: return res[1] def getValueAsFloat(self, index: int = 0) -> float: - """ + r""" Args: index: Index of the value in the element Returns: - ``index``\ th entry in the :class:`Element` as a float. + ``index``\th entry in the :class:`Element` as a float. Raises: InvalidConversionException: If the data type of this @@ -843,12 +843,12 @@ def getValueAsFloat(self, index: int = 0) -> float: return res[1] def getValueAsName(self, index: int = 0) -> Name: - """ + r""" Args: index: Index of the value in the element Returns: - ``index``\ th entry in the :class:`Element` as a Name. + ``index``\th entry in the :class:`Element` as a Name. Raises: InvalidConversionException: If the data type of this @@ -862,12 +862,12 @@ def getValueAsName(self, index: int = 0) -> Name: return Name._createInternally(res[1]) def getValueAsElement(self, index: int = 0) -> Element: - """ + r""" Args: index: Index of the value in the element Returns: - ``index``\ th entry in the :class:`Element` as a Element. + ``index``\th entry in the :class:`Element` as a Element. Raises: InvalidConversionException: If the data type of this @@ -883,12 +883,12 @@ def getValueAsElement(self, index: int = 0) -> Element: def getValue( self, index: int = 0 ) -> Union[SupportedElementTypes, Element]: - """ + r""" Args: index: Index of the value in the element Returns: - ``index``\ th entry in the :class:`Element` defined by this + ``index``\th entry in the :class:`Element` defined by this element's datatype. Raises: @@ -1149,7 +1149,7 @@ def setElement(self, name: Name, value: SupportedElementTypes) -> None: ) def setValue(self, value: SupportedElementTypes, index: int = 0) -> None: - """Set the specified ``index``\ th entry in this :class:`Element` to + r"""Set the specified ``index``\th entry in this :class:`Element` to the ``value``. Args: @@ -1157,7 +1157,7 @@ def setValue(self, value: SupportedElementTypes, index: int = 0) -> None: value: Value to set the sub-element to Raises: - Exception: If this :class:`Element`\ 's datatype can't be + Exception: If this :class:`Element`'s datatype can't be initialized with the type of the specified ``value``, or if ``index >= numValues()``. @@ -1184,14 +1184,14 @@ def setValue(self, value: SupportedElementTypes, index: int = 0) -> None: _ExceptionUtil.raiseOnError(traits[1](self.__handle, value, index)) def appendValue(self, value: SupportedElementTypes) -> None: - """Append the specified ``value`` to this :class:`Element`\ s entries + r"""Append the specified ``value`` to this :class:`Element`\s entries at the end. Args: value: Value to append Raises: - Exception: If this :class:`Element`\ 's datatype can't be + Exception: If this :class:`Element`'s datatype can't be initialized from the type of the specified ``value``, or if the current size of this :class:`Element` (:meth:`numValues()`) is equal to the maximum defined by @@ -1217,14 +1217,14 @@ def appendValue(self, value: SupportedElementTypes) -> None: self.setValue(value, internals.ELEMENT_INDEX_END) def appendElement(self) -> Element: - """Append a new element to this array :class:`Element`. + r"""Append a new element to this array :class:`Element`. Returns: The newly appended element Raises: Exception: If this :class:`Element` is not an array of sequence or - choice :class:`Element`\ s. + choice :class:`Element`\s. """ @@ -1234,7 +1234,7 @@ def appendElement(self) -> Element: return Element(res[1], self._getDataHolder()) def setChoice(self, selectionName: Name) -> Element: - """Set this :class:`Element`\ 's active element to ``selectionName``. + """Set this :class:`Element`'s active element to ``selectionName``. Args: selectionName: Name of the element to set the active choice @@ -1258,7 +1258,7 @@ def setChoice(self, selectionName: Name) -> Element: def fromPy( self, value: Union[Mapping, Sequence, SupportedElementTypes] ) -> None: - """Format this :class:`Element` with the provided native Python value. + r"""Format this :class:`Element` with the provided native Python value. Args: value: Used to format this :class:`Element` @@ -1275,10 +1275,10 @@ def fromPy( * a complex type, it is formatted using a :py:class:`collections.abc.Mapping` (e.g. :py:class:`dict`) whose - keys are the :py:class:`str` names of its sub-:class:`Element`\ s. + keys are the :py:class:`str` names of its sub-:class:`Element`\s. * an array, it is formatted using a :py:class:`collections.abc.Sequence` (e.g. :py:class:`list`) of the - :class:`Element`\ 's values (see note below for more detais). + :class:`Element`'s values (see note below for more detais). * null, it is formatted using an empty :py:class:`collections.abc.Mapping`. @@ -1290,7 +1290,7 @@ def fromPy( :py:class:`memoryview` are sub-types of :py:class:`collections.abc.Sequence`, :meth:`fromPy` treats them as scalars of type string and will use them to format scalar - :class:`Element`\ s. If you wish to format an array + :class:`Element`\s. If you wish to format an array :class:`Element` with instances of the aforementioned types, put them in a different :py:class:`collections.abc.Sequence`, like :py:class:`list`. @@ -1303,7 +1303,7 @@ def fromPy( Note: Using :meth:`fromPy` to format an :class:`Element` or one of its - sub-:class:`Element`\ s that has already been formatted is not + sub-:class:`Element`\s that has already been formatted is not supported. To further format an :class:`Element`, use the get/set/append Element/Value methods. @@ -1371,8 +1371,8 @@ def fromPy( exampleElement.fromPy(exampleElementAsDict) :meth:`fromPy` can also be called with - :class:`collections.abc.Sequence`\ s and scalar values to format array - :class:`Element`\ s and scalar :class:`Element`\ s, respectively. + :class:`collections.abc.Sequence`\s and scalar values to format array + :class:`Element`\s and scalar :class:`Element`\s, respectively. .. code-block:: python diff --git a/src/blpapi/eventdispatcher.py b/src/blpapi/eventdispatcher.py index f2392f8..936f545 100644 --- a/src/blpapi/eventdispatcher.py +++ b/src/blpapi/eventdispatcher.py @@ -55,7 +55,7 @@ def stop(self, async_: bool = False, **kwargs: bool) -> int: """Stop generating callbacks. Args: - async\_ : Whether to execute this method asynchronously + async\\_ : Whether to execute this method asynchronously Stop generating callbacks for events from sessions associated with this :class:`EventDispatcher`. If the specified ``async_`` is ``False`` (the diff --git a/src/blpapi/eventformatter.py b/src/blpapi/eventformatter.py index f237b98..30d85ef 100644 --- a/src/blpapi/eventformatter.py +++ b/src/blpapi/eventformatter.py @@ -27,18 +27,18 @@ class EventFormatter(CHandle): - """:class:`EventFormatter` is used to populate :class:`Event`\ s for + r""":class:`EventFormatter` is used to populate :class:`Event`\s for publishing. An :class:`EventFormatter` is created from an :class:`Event` obtained from :class:`~Service.createPublishEvent()` on :class:`Service`. Once the - :class:`Message` or :class:`Message`\ s have been appended to the + :class:`Message` or :class:`Message`\s have been appended to the :class:`Event` using the :class:`EventFormatter` the :class:`Event` can be published using :meth:`~ProviderSession.publish()` on the :class:`ProviderSession`. :class:`EventFormatter` objects cannot be copied to ensure that there is - no ambiguity about what happens if two :class:`EventFormatter`\ s are both + no ambiguity about what happens if two :class:`EventFormatter`\s are both formatting the same :class:`Event`. The :class:`EventFormatter` supports appending message of the same type @@ -133,7 +133,7 @@ def __getTraits( return EventFormatter.__defaultTraits def __init__(self, event: "typehints.Event") -> None: - """Create an :class:`EventFormatter` to create :class:`Message`\ s in + r"""Create an :class:`EventFormatter` to create :class:`Message`\s in the specified ``event``. Args: @@ -443,8 +443,8 @@ def appendElement(self) -> None: ) def fromPy(self, value: MappingType[Name, Any]) -> None: - """ - Format this :class:`EventFormatter`\ 's underlying :class:`Event` using + r""" + Format this :class:`EventFormatter`'s underlying :class:`Event` using ``value``. Args: @@ -462,7 +462,7 @@ def fromPy(self, value: MappingType[Name, Any]) -> None: * a complex type, it is formatted using a :py:class:`collections.abc.Mapping` whose keys are the names of its - sub-:class:`Element`\ s. + sub-:class:`Element`\s. * an array, it is formatted using a :py:class:`collections.abc.Sequence` of the :class:`Element`'s values (see note below for more details). @@ -475,7 +475,7 @@ def fromPy(self, value: MappingType[Name, Any]) -> None: :py:class:`memoryview` are sub-types of :py:class:`collections.abc.Sequence`, :meth:`fromPy` treats them as scalars of type string and will use them to format scalar - :class:`Element`\ s. If you wish to format an array + :class:`Element`\s. If you wish to format an array :class:`Element` with instances of the aforementioned types, put them in a different :py:class:`collections.abc.Sequence`, like :py:class:`list`. @@ -486,7 +486,7 @@ def fromPy(self, value: MappingType[Name, Any]) -> None: scalar of type :py:class:`bytes` and will use it to format scalar :class:`Element`. Arrays of :py:class:`bytes` are not supported. - For null :class:`Element`\ s: + For null :class:`Element`\s: * A null complex :class:`Element` is formatted using an empty :py:class:`collections.abc.Mapping`. diff --git a/src/blpapi/internals.py b/src/blpapi/internals.py index 6301801..1910883 100644 --- a/src/blpapi/internals.py +++ b/src/blpapi/internals.py @@ -389,7 +389,7 @@ def value(self): Returns: int or long or object: The value of this CorrelationId object. - The return value depends on this :class:`CorrelationId`\ 's value + The return value depends on this :class:`CorrelationId`'s value type and could be: - Integer (``type() == CorrelationId.INT_TYPE`` diff --git a/src/blpapi/internals_wrap.c b/src/blpapi/internals_wrap.c index ffbbe69..a7e3e70 100644 --- a/src/blpapi/internals_wrap.c +++ b/src/blpapi/internals_wrap.c @@ -3083,14 +3083,18 @@ PyObject *blpapi_DiagnosticsUtil_memoryInfo_wrapper() PyObject *diagnostics_str; if (len < 0) { + SWIG_PYTHON_THREAD_BEGIN_BLOCK; PyErr_SetString(PyExc_RuntimeError, "blpapi_DiagnosticsUtil_memoryInfo error"); + SWIG_PYTHON_THREAD_END_BLOCK; return NULL; } buffer_length = len + 1; buffer = (char *) malloc(buffer_length); blpapi_DiagnosticsUtil_memoryInfo(buffer, buffer_length); + SWIG_PYTHON_THREAD_BEGIN_BLOCK; diagnostics_str = PyString_FromString(buffer); + SWIG_PYTHON_THREAD_END_BLOCK; free(buffer); return diagnostics_str; diff --git a/src/blpapi/message.py b/src/blpapi/message.py index 3df9637..89e85f5 100644 --- a/src/blpapi/message.py +++ b/src/blpapi/message.py @@ -40,7 +40,7 @@ class Message(CHandle, metaclass=MetaClassForClassesWithEnums): :class:`Message` objects are obtained by iterating an :class:`Event`. Each :class:`Message` is associated with a :class:`Service` and with one or more :class:`CorrelationId` values. The :class:`Message` contents are - represented as an :class:`Element` and all :class:`Element`\ 's accessors + represented as an :class:`Element` and all :class:`Element`'s accessors could be used to access the data. The possible fragment types are: @@ -223,7 +223,7 @@ def correlationId(self) -> Optional["typehints.CorrelationId"]: return internals.blpapi_Message_correlationId(self.__handle, 0) def correlationIds(self) -> List["typehints.CorrelationId"]: - """ + r""" Returns: Correlation ids associated with this message. diff --git a/src/blpapi/names.py b/src/blpapi/names.py index a38a137..b2ed1ed 100644 --- a/src/blpapi/names.py +++ b/src/blpapi/names.py @@ -29,8 +29,6 @@ class Names: SESSION_STARTUP_FAILURE = Name("SessionStartupFailure") SESSION_CONNECTION_UP = Name("SessionConnectionUp") SESSION_CONNECTION_DOWN = Name("SessionConnectionDown") - SESSION_CLUSTER_INFO = Name("SessionClusterInfo") - SESSION_CLUSTER_UPDATE = Name("SessionClusterUpdate") SERVICE_OPENED = Name("ServiceOpened") SERVICE_OPEN_FAILURE = Name("ServiceOpenFailure") SERVICE_REGISTERED = Name("ServiceRegistered") diff --git a/src/blpapi/providersession.py b/src/blpapi/providersession.py index 1da2b07..1a0f65d 100644 --- a/src/blpapi/providersession.py +++ b/src/blpapi/providersession.py @@ -523,11 +523,11 @@ def nextEvent(self, timeout: int = 0) -> Event: return Event(event, {self}) def tryNextEvent(self) -> Optional[Event]: - """ + r""" Returns: Next available event for this session - If there are :class:`Event`\ s available for the session, return the + If there are :class:`Event`\s available for the session, return the next :class:`Event` If there is no event available for the :class:`Session`, return ``None``. This method never blocks. """ @@ -593,7 +593,7 @@ def registerServiceAsync( correlationId: Optional[CorrelationId] = None, options: Optional[ServiceRegistrationOptions] = None, ) -> CorrelationId: - """Begin the process of registering the service immediately. + r"""Begin the process of registering the service immediately. Args: uri: Name of the service @@ -609,8 +609,8 @@ def registerServiceAsync( specified ``uri`` and return immediately. The optionally specified ``identity`` is used to verify permissions to provide the service being registered. The optionally specified ``correlationId`` is used to track - :class:`Event`\ s generated as a result of this call. The actual ``correlationId`` - that will identify :class:`Event`\ s generated as a result of this call is + :class:`Event`\s generated as a result of this call. The actual ``correlationId`` + that will identify :class:`Event`\s generated as a result of this call is returned. The optionally specified ``options`` is used to specify the group ID and service priority of the service being registered. @@ -649,7 +649,7 @@ def resolve( resolveMode: int = DONT_REGISTER_SERVICES, identity: Optional["typehints.Identity"] = None, ) -> None: - """Resolve the topics in the specified ``resolutionList``. + r"""Resolve the topics in the specified ``resolutionList``. Args: resolutionList: List of topics to resolve @@ -674,7 +674,7 @@ def resolve( :attr:`~Event.RESOLUTION_STATUS` events and, if ``resolveMode`` is :attr:`AUTO_REGISTER_SERVICES`, zero or more :attr:`~Event.SERVICE_STATUS` events are generated. If this is an - asynchronous :class:`ProviderSession` then these :class:`Event`\ s may + asynchronous :class:`ProviderSession` then these :class:`Event`\s may be processed by the registered ``eventHandler`` before :meth:`resolve()` has returned. @@ -811,7 +811,7 @@ def createTopics( resolveMode: int = DONT_REGISTER_SERVICES, identity: Optional["typehints.Identity"] = None, ) -> None: - """Create the topics in the specified ``topicList``. + r"""Create the topics in the specified ``topicList``. Args: topicList: List of topics to create @@ -828,7 +828,7 @@ def createTopics( :attr:`~Event.RESOLUTION_STATUS` events, zero or more :attr:`~Event.SERVICE_STATUS` events and one or more :attr:`~Event.TOPIC_STATUS` events are generated. If this is an - asynchronous :class:`ProviderSession` then these :class:`Event`\ s may + asynchronous :class:`ProviderSession` then these :class:`Event`\s may be processed by the registered ``eventHandler`` before :meth:`createTopics()` has returned. @@ -851,7 +851,7 @@ def createTopicsAsync( resolveMode: int = DONT_REGISTER_SERVICES, identity: Optional["typehints.Identity"] = None, ) -> None: - """Create the topics in the specified ``topicList``. + r"""Create the topics in the specified ``topicList``. Args: topicList: List of topics to create @@ -868,7 +868,7 @@ def createTopicsAsync( :attr:`~Event.RESOLUTION_STATUS` events, zero or more :attr:`~Event.SERVICE_STATUS` events and one or more :attr:`~Event.TOPIC_STATUS` events are generated. If this is an - asynchronous :class:`ProviderSession` then these :class:`Event`\ s may + asynchronous :class:`ProviderSession` then these :class:`Event`\s may be processed by the registered ``eventHandler`` before :meth:`createTopics()` has returned. diff --git a/src/blpapi/resolutionlist.py b/src/blpapi/resolutionlist.py index 1e3b36c..478179e 100644 --- a/src/blpapi/resolutionlist.py +++ b/src/blpapi/resolutionlist.py @@ -269,17 +269,17 @@ def message(self, correlationId: CorrelationId) -> Message: return Message(message, sessions=self._sessions()) def messageAt(self, index: int) -> Message: - """ + r""" Args: index: Index of an entry in this list Returns: Message received during resolution of the topic - specified ``index``\ th entry in this :class:`ResolutionList`. + specified ``index``\th entry in this :class:`ResolutionList`. Raises: Exception: If ``index >= size()`` or if the status of the - ``index``\ th entry is not ``RESOLVED`` an exception is raised. + ``index``\th entry is not ``RESOLVED`` an exception is raised. Note: The :class:`Message` returned can be used when creating an instance diff --git a/src/blpapi/schema.py b/src/blpapi/schema.py index 38c8a86..bd8e70f 100644 --- a/src/blpapi/schema.py +++ b/src/blpapi/schema.py @@ -415,9 +415,9 @@ def getElementDefinition( return SchemaElementDefinition(res, self.__sessions) def elementDefinitions(self) -> IteratorType[SchemaElementDefinition]: - """ + r""" Returns: - Iterator over :class:`SchemaElementDefinition`\ s defined by this + Iterator over :class:`SchemaElementDefinition`\s defined by this :class:`SchemaTypeDefinition`. """ diff --git a/src/blpapi/service.py b/src/blpapi/service.py index 06654da..92757a1 100644 --- a/src/blpapi/service.py +++ b/src/blpapi/service.py @@ -120,11 +120,11 @@ def _sessions(self) -> Set["typehints.AbstractSession"]: class Service(CHandle): - """Defines a service which provides access to API data. + r"""Defines a service which provides access to API data. A :class:`Service` object is obtained from a :class:`Session` and contains - the :class:`Operation`\ s (each of which contains its own schema) and the - schema for :class:`Event`\ s which this :class:`Service` may produce. A + the :class:`Operation`\s (each of which contains its own schema) and the + schema for :class:`Event`\s which this :class:`Service` may produce. A :class:`Service` object is also used to create :class:`Request` objects used with a :class:`Session` to issue requests. @@ -172,12 +172,12 @@ def toString(self, level: int = 0, spacesPerLevel: int = 4) -> str: ) def createPublishEvent(self) -> Event: - """ + r""" Returns: :class:`Event` suitable for publishing to this :class:`Service` - Use an :class:`EventFormatter` to add :class:`Message`\ s to the + Use an :class:`EventFormatter` to add :class:`Message`\s to the :class:`Event` and set fields. """ @@ -188,12 +188,12 @@ def createPublishEvent(self) -> Event: return Event(event, self.__sessions) def createAdminEvent(self) -> Event: - """ + r""" Returns: An :attr:`~Event.ADMIN` :class:`Event` suitable for publishing to this :class:`Service` - Use an :class:`EventFormatter` to add :class:`Message`\ s to the + Use an :class:`EventFormatter` to add :class:`Message`\s to the :class:`Event` and set fields. **DEPRECATED** @@ -214,7 +214,7 @@ def createAdminEvent(self) -> Event: def createResponseEvent( self, correlationId: "typehints.CorrelationId" ) -> Event: - """Create a :attr:`~Event.RESPONSE` :class:`Event` to answer the + r"""Create a :attr:`~Event.RESPONSE` :class:`Event` to answer the request. Args: @@ -224,7 +224,7 @@ def createResponseEvent( Returns: The created response event. - Use an :class:`EventFormatter` to add :class:`Message`\ s to the + Use an :class:`EventFormatter` to add :class:`Message`\s to the :class:`Event` and set fields. """ @@ -296,17 +296,17 @@ def getOperation(self, nameOrIndex: BlpapiNameOrIndex) -> Operation: return Operation(operation, self.__sessions) def numOperations(self) -> int: - """ + r""" Returns: - The number of :class:`Operation`\ s defined by this + The number of :class:`Operation`\s defined by this :class:`Service`. """ return internals.blpapi_Service_numOperations(self.__handle) def operations(self) -> IteratorType[Operation]: - """ + r""" Returns: - Iterator over :class:`Operation`\ s defined by this :class:`Service` + Iterator over :class:`Operation`\s defined by this :class:`Service` """ return utils.Iterator( self, Service.numOperations, Service.getOperation diff --git a/src/blpapi/session.py b/src/blpapi/session.py index 40d87d4..e4fa716 100644 --- a/src/blpapi/session.py +++ b/src/blpapi/session.py @@ -47,7 +47,7 @@ class SubscriptionPreprocessMode(Enum): class Session(AbstractSession, metaclass=MetaClassForClassesWithEnums): - """Consumer session for making requests for Bloomberg services. + r"""Consumer session for making requests for Bloomberg services. This class provides a consumer session for making requests for Bloomberg services. For information on generic session operations, see the parent @@ -91,12 +91,12 @@ class Session(AbstractSession, metaclass=MetaClassForClassesWithEnums): returned (even though :meth:`startAsync()` itself will not block). This becomes more significant when Session generated - :class:`CorrelationId`\ s are in use. For example, if a call to + :class:`CorrelationId`\s are in use. For example, if a call to :meth:`subscribe()` which returns a Session generated - :class:`CorrelationId` has not completed before the first :class:`Event`\ s + :class:`CorrelationId` has not completed before the first :class:`Event`\s which contain that :class:`CorrelationId` arrive the application may not be able to interpret those events correctly. For this reason, it is preferable - to use user generated :class:`CorrelationId`\ s when using asynchronous + to use user generated :class:`CorrelationId`\s when using asynchronous Sessions. This issue does not arise when using a synchronous Session as long as the calls to :meth:`subscribe()` etc. are made on the same thread as the calls to :meth:`nextEvent()`. @@ -308,11 +308,11 @@ def nextEvent(self, timeout: int = 0) -> Event: return Event(event, {self}) def tryNextEvent(self) -> Optional[Event]: - """ + r""" Returns: Event: Next available event for this session - If there are :class:`Event`\ s available for the session, return the + If there are :class:`Event`\s available for the session, return the next :class:`Event` If there is no event available for the :class:`Session`, return ``None``. This method never blocks. """ @@ -574,7 +574,7 @@ def sendRequest( eventQueue: Optional["typehints.EventQueue"] = None, requestLabel: Optional[str] = None, ) -> CorrelationId: - """Send the specified ``request``. + r"""Send the specified ``request``. Args: request: Request to send @@ -602,7 +602,7 @@ def sendRequest( this operation. A successful request will generate zero or more - :class:`~Event.PARTIAL_RESPONSE` :class:`Message`\ s followed by + :class:`~Event.PARTIAL_RESPONSE` :class:`Message`\s followed by exactly one :class:`~Event.RESPONSE` :class:`Message`. Once the final :class:`~Event.RESPONSE` :class:`Message` has been received the :class:`CorrelationId` associated with this request may be re-used. If diff --git a/src/blpapi/sessionoptions.py b/src/blpapi/sessionoptions.py index c07dc56..fd22e13 100644 --- a/src/blpapi/sessionoptions.py +++ b/src/blpapi/sessionoptions.py @@ -288,7 +288,7 @@ def setAllowMultipleCorrelatorsPerMsg( presented with the same message multiple times when you use the ``MessageIterator``, each time with a different :class:`CorrelationId`. If you specify ``True`` for this then a :class:`Message` may be - presented with multiple :class:`CorrelationId`\ 's. + presented with multiple :class:`CorrelationId`'s. """ internals.blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg( diff --git a/src/blpapi/subscriptionlist.py b/src/blpapi/subscriptionlist.py index 5b45527..781c60c 100644 --- a/src/blpapi/subscriptionlist.py +++ b/src/blpapi/subscriptionlist.py @@ -220,12 +220,12 @@ def size(self) -> int: return internals.blpapi_SubscriptionList_size(self.__handle) def correlationIdAt(self, index: int) -> CorrelationId: - """ + r""" Args: index: Index of the entry in the list Returns: - Correlation id of the ``index``\ th entry. + Correlation id of the ``index``\th entry. Raises: Exception: If ``index >= size()``. @@ -290,7 +290,7 @@ def isResolvedTopicAt(self, index: int) -> bool: index: Index of the entry in the list Returns: - ``True`` if the ``index``\ th entry in this + ``True`` if the ``index``th entry in this ``SubscriptionList`` object was created using :meth:`addResolved()` and ``False`` if it was created using :meth:`add()`. An exception is thrown if ``index >= size()``. diff --git a/src/blpapi/topiclist.py b/src/blpapi/topiclist.py index b865948..6a3e104 100644 --- a/src/blpapi/topiclist.py +++ b/src/blpapi/topiclist.py @@ -115,12 +115,12 @@ def add( ) def correlationIdAt(self, index: int) -> CorrelationId: - """ + r""" Args: index: Index of the entry in the list Returns: - Correlation id of the ``index``\ th entry. + Correlation id of the ``index``\th entry. Raises: Exception: If ``index >= size()``. @@ -151,12 +151,12 @@ def topicString(self, correlationId: CorrelationId) -> str: return topic def topicStringAt(self, index: int) -> str: - """ + r""" Args: index: Index of the entry Returns: - The full topic string of the ``index``\ th entry in this list. + The full topic string of the ``index``\th entry in this list. Raises: Exception: If ``index >= size()``. @@ -189,12 +189,12 @@ def status(self, correlationId: CorrelationId) -> int: return status def statusAt(self, index: int) -> int: - """ + r""" Args: index: Index of the entry Returns: - Status of the ``index``\ th entry in this list. This may be + Status of the ``index``\th entry in this list. This may be :attr:`NOT_CREATED`, :attr:`CREATED` and :attr:`FAILURE`. Raises: diff --git a/src/blpapi/version.py b/src/blpapi/version.py index 49e54e1..28c55b4 100644 --- a/src/blpapi/version.py +++ b/src/blpapi/version.py @@ -4,8 +4,8 @@ from . import versionhelper -__version__ = "3.23.1" -__expected_cpp_sdk_version__ = "3.23.2" +__version__ = "3.24.2" +__expected_cpp_sdk_version__ = "3.24.2" def print_version() -> None: From 1b368844ac7f31c63099d90c0b83aaddd12493fc Mon Sep 17 00:00:00 2001 From: Marland Sitt Date: Thu, 27 Jun 2024 14:14:05 -0700 Subject: [PATCH 20/23] v3.24.4 --- PKG-INFO | 7 +------ changelog.txt | 8 ++++++++ src/blpapi.egg-info/PKG-INFO | 7 +------ src/blpapi.egg-info/SOURCES.txt | 1 + src/blpapi/py.typed | 0 src/blpapi/version.py | 4 ++-- 6 files changed, 13 insertions(+), 14 deletions(-) create mode 100644 src/blpapi/py.typed diff --git a/PKG-INFO b/PKG-INFO index f553859..3bc4f7c 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,12 +1,10 @@ Metadata-Version: 2.1 Name: blpapi -Version: 3.24.2 +Version: 3.24.4 Summary: Python SDK for Bloomberg BLPAPI Home-page: http://www.bloomberglabs.com/api/ Author: Bloomberg L.P. Author-email: open-tech@bloomberg.net -License: UNKNOWN -Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: Intended Audience :: Financial and Insurance Industry @@ -14,6 +12,3 @@ Classifier: License :: Other/Proprietary License Classifier: Topic :: Office/Business :: Financial Requires-Python: >=3.8 License-File: License.txt - -UNKNOWN - diff --git a/changelog.txt b/changelog.txt index 0389be8..1a7c9bf 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,11 @@ +Version 3.24.4: +=============== +- Stability and performance improvements + +Version 3.24.3: +=============== +- Stability and performance improvements + Version 3.24.2: =============== - Stability and performance improvements diff --git a/src/blpapi.egg-info/PKG-INFO b/src/blpapi.egg-info/PKG-INFO index f553859..3bc4f7c 100644 --- a/src/blpapi.egg-info/PKG-INFO +++ b/src/blpapi.egg-info/PKG-INFO @@ -1,12 +1,10 @@ Metadata-Version: 2.1 Name: blpapi -Version: 3.24.2 +Version: 3.24.4 Summary: Python SDK for Bloomberg BLPAPI Home-page: http://www.bloomberglabs.com/api/ Author: Bloomberg L.P. Author-email: open-tech@bloomberg.net -License: UNKNOWN -Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: Intended Audience :: Financial and Insurance Industry @@ -14,6 +12,3 @@ Classifier: License :: Other/Proprietary License Classifier: Topic :: Office/Business :: Financial Requires-Python: >=3.8 License-File: License.txt - -UNKNOWN - diff --git a/src/blpapi.egg-info/SOURCES.txt b/src/blpapi.egg-info/SOURCES.txt index b7fc54b..2345db9 100644 --- a/src/blpapi.egg-info/SOURCES.txt +++ b/src/blpapi.egg-info/SOURCES.txt @@ -84,6 +84,7 @@ src/blpapi/message.py src/blpapi/name.py src/blpapi/names.py src/blpapi/providersession.py +src/blpapi/py.typed src/blpapi/request.py src/blpapi/requesttemplate.py src/blpapi/resolutionlist.py diff --git a/src/blpapi/py.typed b/src/blpapi/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/src/blpapi/version.py b/src/blpapi/version.py index 28c55b4..6d21723 100644 --- a/src/blpapi/version.py +++ b/src/blpapi/version.py @@ -4,8 +4,8 @@ from . import versionhelper -__version__ = "3.24.2" -__expected_cpp_sdk_version__ = "3.24.2" +__version__ = "3.24.4" +__expected_cpp_sdk_version__ = "3.24.4" def print_version() -> None: From f026588b20575e95a68fe1bdcbd9415b861fd8a4 Mon Sep 17 00:00:00 2001 From: Marland Sitt Date: Wed, 22 Jan 2025 21:50:45 -0800 Subject: [PATCH 21/23] v3.24.6 --- PKG-INFO | 2 +- changelog.txt | 8 ++++++++ examples/demoapps/GenerateTokenExample.py | 2 ++ examples/demoapps/RequestResponseExample.py | 1 + examples/demoapps/SecurityLookupExample.py | 1 + .../demoapps/util/ConnectionAndAuthOptions.py | 2 ++ src/blpapi.egg-info/PKG-INFO | 2 +- src/blpapi/debug.py | 1 + src/blpapi/element.py | 15 ++++++++++++++- src/blpapi/providersession.py | 8 +++++++- src/blpapi/session.py | 6 ++++++ src/blpapi/version.py | 4 ++-- 12 files changed, 46 insertions(+), 6 deletions(-) diff --git a/PKG-INFO b/PKG-INFO index 3bc4f7c..243de33 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: blpapi -Version: 3.24.4 +Version: 3.24.6 Summary: Python SDK for Bloomberg BLPAPI Home-page: http://www.bloomberglabs.com/api/ Author: Bloomberg L.P. diff --git a/changelog.txt b/changelog.txt index 1a7c9bf..df29772 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,11 @@ +Version 3.24.6: +=============== +- Stability and performance improvements + +Version 3.24.5: +=============== +- Stability and performance improvements + Version 3.24.4: =============== - Stability and performance improvements diff --git a/examples/demoapps/GenerateTokenExample.py b/examples/demoapps/GenerateTokenExample.py index c95c2fb..ec2d143 100644 --- a/examples/demoapps/GenerateTokenExample.py +++ b/examples/demoapps/GenerateTokenExample.py @@ -21,6 +21,8 @@ class AuthOptionsAction(Action): def __call__(self, parser, args, values, option_string=None): vals = values.split("=", 1) + authOptions = None + if vals[0] == AUTH_OPTION_USER: authOptions = AUTH_USER elif vals[0] == AUTH_OPTION_APP and len(vals) == 2: diff --git a/examples/demoapps/RequestResponseExample.py b/examples/demoapps/RequestResponseExample.py index 1daa8bd..daae611 100644 --- a/examples/demoapps/RequestResponseExample.py +++ b/examples/demoapps/RequestResponseExample.py @@ -104,6 +104,7 @@ def sendRequest(options, session): """Sends a request based on the request type.""" service = session.getService(options.service) requestType = options.requestType + request = None if requestType == INTRADAY_BAR_REQUEST: request = IntradayBarRequests.createRequest(service, options) elif requestType == INTRADAY_TICK_REQUEST: diff --git a/examples/demoapps/SecurityLookupExample.py b/examples/demoapps/SecurityLookupExample.py index 0c8ba5b..e3b2255 100644 --- a/examples/demoapps/SecurityLookupExample.py +++ b/examples/demoapps/SecurityLookupExample.py @@ -111,6 +111,7 @@ def sendRequest(options, session): """Sends a request based on the request type.""" instrumentsService = session.getService(INSTRUMENT_SERVICE) requestType = options.requestType + request = None if requestType == CURVE_LIST_REQUEST: request = CurveListRequests.createRequest( instrumentsService, diff --git a/examples/demoapps/util/ConnectionAndAuthOptions.py b/examples/demoapps/util/ConnectionAndAuthOptions.py index ff84b6f..cb1b953 100644 --- a/examples/demoapps/util/ConnectionAndAuthOptions.py +++ b/examples/demoapps/util/ConnectionAndAuthOptions.py @@ -12,6 +12,8 @@ class AuthOptionsAction(Action): def __call__(self, parser, args, values, option_string=None): vals = values.split("=", 1) + authOptions = None + auth_type = vals[0] if auth_type == "user": authUser = blpapi.AuthUser.createWithLogonName() diff --git a/src/blpapi.egg-info/PKG-INFO b/src/blpapi.egg-info/PKG-INFO index 3bc4f7c..243de33 100644 --- a/src/blpapi.egg-info/PKG-INFO +++ b/src/blpapi.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: blpapi -Version: 3.24.4 +Version: 3.24.6 Summary: Python SDK for Bloomberg BLPAPI Home-page: http://www.bloomberglabs.com/api/ Author: Bloomberg L.P. diff --git a/src/blpapi/debug.py b/src/blpapi/debug.py index 5783e1c..2141b90 100644 --- a/src/blpapi/debug.py +++ b/src/blpapi/debug.py @@ -15,6 +15,7 @@ def debug_load_error(error: ImportError) -> ImportError: """ # Try to load just the version.py version_imported = True + import_error = "" try: from .version import version, cpp_sdk_version, expected_cpp_sdk_version except ImportError as version_error: diff --git a/src/blpapi/element.py b/src/blpapi/element.py index 1fa5f29..af75f54 100644 --- a/src/blpapi/element.py +++ b/src/blpapi/element.py @@ -238,6 +238,17 @@ def __init__( Union[Element, "typehints.Message", "typehints.Request"] ], ) -> None: + """Create an :class:`Element` object. + + Args: + handle: Handle to the internal implementation + dataHolder: The internal owner of underlying data + + If the specified ``handle`` is ``None``, create an uninitialized + :class:`Element`. The only valid operations to perform on an + uninitialized :class:`Element` are assignment, :meth:`isValid()`, and + destruction. + """ noop = lambda *args: None super(Element, self).__init__(handle, noop) self.__handle = handle @@ -450,7 +461,9 @@ def isArray(self) -> bool: def isValid(self) -> bool: """ Returns: - ``True`` if this :class:`Element` is valid. + ``True`` if this :class:`Element` is valid. An :class:`Element` + constructed using ``None`` for the ``handle`` is not valid until + the :class:`Element` has had a value assigned to it. """ return self.__handle is not None diff --git a/src/blpapi/providersession.py b/src/blpapi/providersession.py index 1a0f65d..e24f231 100644 --- a/src/blpapi/providersession.py +++ b/src/blpapi/providersession.py @@ -59,7 +59,7 @@ from __future__ import annotations from weakref import ref, ReferenceType # pylint: disable=unused-import -from typing import Optional, Callable, Sequence +from typing import Optional, Callable, Sequence, Any import sys import traceback import os @@ -398,6 +398,12 @@ def __init__( _dtor, ) + def _session_handle(self) -> Any: + """This is for internal implementation only""" + # `_handle()` returns `blpapi_AbstractSession_t *`, but there are times + # when we need `blpapi_ProviderSession_t *` instead. + return self.__handle + def start(self) -> bool: """Start this :class:`Session` in synchronous mode. diff --git a/src/blpapi/session.py b/src/blpapi/session.py index e4fa716..4ba0d8e 100644 --- a/src/blpapi/session.py +++ b/src/blpapi/session.py @@ -212,6 +212,12 @@ def _dtor(_: Any) -> None: _dtor, ) + def _session_handle(self) -> Any: + """This is for internal implementation only""" + # `_handle()` returns `blpapi_AbstractSession_t *`, but there are times + # when we need `blpapi_Session_t *` instead. + return self.__handle + def start(self) -> bool: """Start this :class:`Session` in synchronous mode. diff --git a/src/blpapi/version.py b/src/blpapi/version.py index 6d21723..afc881a 100644 --- a/src/blpapi/version.py +++ b/src/blpapi/version.py @@ -4,8 +4,8 @@ from . import versionhelper -__version__ = "3.24.4" -__expected_cpp_sdk_version__ = "3.24.4" +__version__ = "3.24.6" +__expected_cpp_sdk_version__ = "3.24.6" def print_version() -> None: From f37f0fb0679e85c982cc412d82ed6544a267e96a Mon Sep 17 00:00:00 2001 From: Marland Sitt Date: Wed, 22 Jan 2025 21:52:45 -0800 Subject: [PATCH 22/23] v3.24.10 --- PKG-INFO | 2 +- README.md | 6 +- changelog.txt | 36 + .../demoapps/InteractivePublisherExample.py | 2 +- setup.py | 148 +- src/blpapi.egg-info/PKG-INFO | 2 +- src/blpapi.egg-info/SOURCES.txt | 8 +- src/blpapi/__init__.py | 32 +- src/blpapi/abstractsession.py | 25 +- src/blpapi/chandle.py | 10 + src/blpapi/correlationid.py | 265 + src/blpapi/ctypesutils.py | 137 + src/blpapi/datatype.py | 34 +- src/blpapi/datetime.py | 49 + src/blpapi/element.py | 68 +- src/blpapi/event.py | 28 +- src/blpapi/eventformatter.py | 2 +- src/blpapi/exception.py | 14 +- src/blpapi/ffi_utils.c | 337 + src/blpapi/identity.py | 27 +- src/blpapi/internals.py | 9219 +++++- src/blpapi/internals_wrap.c | 24620 ---------------- src/blpapi/logging.py | 74 +- src/blpapi/message.py | 23 +- src/blpapi/name.py | 6 +- src/blpapi/providersession.py | 49 +- src/blpapi/py.typed | 0 src/blpapi/pycbhelpers.py | 108 + src/blpapi/resolutionlist.py | 4 +- src/blpapi/schema.py | 10 +- src/blpapi/service.py | 5 +- src/blpapi/session.py | 54 +- src/blpapi/sessionoptions.py | 15 +- src/blpapi/subscriptionlist.py | 26 +- src/blpapi/test/messageproperties.py | 2 +- src/blpapi/test/testutil.py | 3 +- src/blpapi/topic.py | 13 +- src/blpapi/topiclist.py | 4 +- src/blpapi/utils.py | 14 +- src/blpapi/version.py | 9 +- src/blpapi/versionhelper.py | 73 - src/blpapi/versionhelper_wrap.c | 3571 --- 42 files changed, 9196 insertions(+), 29938 deletions(-) create mode 100644 src/blpapi/correlationid.py create mode 100644 src/blpapi/ctypesutils.py create mode 100644 src/blpapi/ffi_utils.c delete mode 100644 src/blpapi/internals_wrap.c delete mode 100644 src/blpapi/py.typed create mode 100644 src/blpapi/pycbhelpers.py delete mode 100644 src/blpapi/versionhelper.py delete mode 100644 src/blpapi/versionhelper_wrap.c diff --git a/PKG-INFO b/PKG-INFO index 243de33..08e7efb 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: blpapi -Version: 3.24.6 +Version: 3.24.10 Summary: Python SDK for Bloomberg BLPAPI Home-page: http://www.bloomberglabs.com/api/ Author: Bloomberg L.P. diff --git a/README.md b/README.md index 6b1d500..68b2a55 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Users are encouraged to install using `pip` directly, as documented in This SDK requires the following products: -- CPython version 2.7 or higher +- CPython version 3.8 or higher - Bloomberg C++ SDK same major and minor version as the Python SDK @@ -138,8 +138,8 @@ line. `u`; a string `s` received from an SDK function can be converted to a `unicode` object by calling `s.decode('utf-8')`. -- Python Bloomberg SDK types do not provide support for the Python `copy` or - `pickle` modules. +- Python Bloomberg SDK types do not support directly for the Python `copy` or + `pickle` modules. However, `.toPy` method for messages is available. ## Copyright and License diff --git a/changelog.txt b/changelog.txt index df29772..2cf20c3 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,39 @@ +Version 3.24.10: +================ +- Stability and performance improvements + +Version 3.24.9.3a1: +================ +- Stability and performance improvements + +Version 3.24.9.2-alpha: +================ +- Stability and performance improvements + +Version 3.24.9: +=============== +- Stability and performance improvements + +Version 3.24.8.3: +=============== +- Stability and performance improvements + +Version 3.24.8.2: +=============== +- Stability and performance improvements + +Version 3.24.8: +=============== +- Stability and performance improvements + +Version 3.24.7.1: +=============== +- Stability and performance improvements + +Version 3.24.7: +=============== +- Stability and performance improvements + Version 3.24.6: =============== - Stability and performance improvements diff --git a/examples/demoapps/InteractivePublisherExample.py b/examples/demoapps/InteractivePublisherExample.py index 89e9b4d..794adbb 100644 --- a/examples/demoapps/InteractivePublisherExample.py +++ b/examples/demoapps/InteractivePublisherExample.py @@ -118,7 +118,7 @@ def processTopicStatusEvent(self, session, event): elif msgType == blpapi.Names.TOPIC_ACTIVATED: with self.mutex: self.activeTopics.append(topic) - self.condition.notifyAll() + self.condition.notify_all() elif msgType == blpapi.Names.TOPIC_RECAP: # Here we send a recap in response to a Recap request. diff --git a/setup.py b/setup.py index 66b3722..c72cc91 100644 --- a/setup.py +++ b/setup.py @@ -8,10 +8,24 @@ import platform as plat import re import codecs - from sys import argv +from shutil import copyfile from setuptools import setup, Extension + +def override_get_tag(): + from wheel.bdist_wheel import bdist_wheel + + # bdist_wheel upon seeing an extension module will (wrongly) assume + # that not only platform needs to be fixed, but also interpreter. + # This makes sure we create no-py-specific wheel + class BDistWheel(bdist_wheel): + def get_tag(self): + return (self.python_tag, "none", self.plat_name.replace("-", "_")) + + return {"bdist_wheel": BDistWheel} + + os.chdir(os.path.dirname(os.path.realpath(__file__))) platform = plat.system().lower() @@ -31,6 +45,50 @@ def find_version_number(): raise RuntimeError("Unable to find version string.") +package_data = {} +cmdclass = {} +if "bdist_wheel" in argv: + libpath = os.getenv("BLPAPI_DEPENDENCY") + if libpath: + libname = os.path.basename(libpath) + assert os.path.exists( + libpath + ), f"Could not find blpapi library at {libpath}" + # copy, as package_data only supports local files + copyfile(libpath, f"./src/blpapi/{libname}") + package_data = {"blpapi": [libname, "py.typed"]} + else: + print("BLPAPI_DEPENDENCY environment variable isn't defined") + cmdclass = override_get_tag() + +packages = ["blpapi", "blpapi.test"] + +# INTERNAL ONLY START +# see automation/prepare_release.py +internal_build = os.environ.get("BLPAPI_PY_INTERNAL_BUILD", False) +if internal_build: + internalutils_path = "src/blpapi/internalutils" + if not ( + os.path.exists(internalutils_path) + and os.path.isdir(internalutils_path) + ): + error_msg = """Tried to build the internal Bloomberg build of the +BLPAPI Python SDK, but failed to find the internalutils subdirectory. + +If you are not a Bloomberg developer, this will not work, and you should unset +the BLPAPI_PY_INTERNAL_BUILD environment variable to continue. internalutils +provide some default configurations for use only within Bloomberg networks. + +If you are a Bloomberg developer, either unset the BLPAPI_PY_INTERNAL_BUILD +environment variable to build the public release, or ensure the internalutils +subdirectory is present. +""" + raise ImportError(error_msg) + + packages.append("blpapi.internalutils") +# INTERNAL ONLY END + + def lib_in_release(): """Returns the right library folder name for each platform""" if platform == "windows": @@ -42,7 +100,7 @@ def lib_in_release(): raise Exception("Platform '" + platform + "' isn't supported") -blpapiRoot = os.environ.get("BLPAPI_ROOT") +blpapiRoot = os.environ.get("BLPAPI_ROOT", ".") blpapiIncludesVar = os.environ.get("BLPAPI_INCDIR") blpapiLibVar = os.environ.get("BLPAPI_LIBDIR") @@ -50,101 +108,31 @@ def lib_in_release(): "BLPAPI_ROOT (or BLPAPI_INCDIR/BLPAPI_LIBDIR) " + "environment variable isn't defined" ) - +blpapiLibraryPath = blpapiLibVar or os.path.join(blpapiRoot, lib_in_release()) +blpapiIncludes = blpapiIncludesVar or os.path.join(blpapiRoot, "include") is64bit = plat.architecture()[0] == "64bit" if is64bit: blpapiLibraryName = "blpapi3_64" else: blpapiLibraryName = "blpapi3_32" - -extraCompileArgs = [] -extraLinkArgs = [] -package_data = {} -if platform == "linux": - extraCompileArgs = ["-Werror=implicit-function-declaration"] -elif platform == "windows": - extraLinkArgs = ["/MANIFEST"] - - # Handle the very frequent case when user need to use Visual C++ 2010 - # with Python that wants to use Visual C++ 2008. - if plat.python_compiler().startswith("MSC v.1500"): - if (not "VS90COMNTOOLS" in os.environ) and ( - "VS100COMNTOOLS" in os.environ - ): - os.environ["VS90COMNTOOLS"] = os.environ["VS100COMNTOOLS"] - - if "bdist_wheel" in argv: - # get src/blpapi/*.dll - package_data = { - "blpapi": ["blpapi3_64.dll" if is64bit else "blpapi3_32.dll"] - } - -blpapiLibraryPath = blpapiLibVar or os.path.join(blpapiRoot, lib_in_release()) -blpapiIncludes = blpapiIncludesVar or os.path.join(blpapiRoot, "include") - +extraLinkArgs = ["/MANIFEST"] if platform == "windows" else [] blpapi_wrap = Extension( - "blpapi._internals", - sources=["src/blpapi/internals_wrap.c"], - include_dirs=[blpapiIncludes], - library_dirs=[blpapiLibraryPath], - libraries=[blpapiLibraryName], - extra_compile_args=extraCompileArgs, - extra_link_args=extraLinkArgs, -) - -versionhelper_wrap = Extension( - "blpapi._versionhelper", - sources=["src/blpapi/versionhelper_wrap.c"], + "blpapi.ffiutils", + sources=["src/blpapi/ffi_utils.c"], include_dirs=[blpapiIncludes], library_dirs=[blpapiLibraryPath], libraries=[blpapiLibraryName], - extra_compile_args=extraCompileArgs, + extra_compile_args=[], extra_link_args=extraLinkArgs, ) - -extensions = [blpapi_wrap, versionhelper_wrap] -packages = ["blpapi", "blpapi.test"] - -# INTERNAL ONLY START -# see automation/prepare_release.py -internal_build = os.environ.get("BLPAPI_PY_INTERNAL_BUILD", False) -if internal_build: - internalutils_path = "src/blpapi/internalutils" - if not ( - os.path.exists(internalutils_path) - and os.path.isdir(internalutils_path) - ): - error_msg = """Tried to build the internal Bloomberg build of the -BLPAPI Python SDK, but failed to find the internalutils subdirectory. - -If you are not a Bloomberg developer, this will not work, and you should unset -the BLPAPI_PY_INTERNAL_BUILD environment variable to continue. internalutils -provide some default configurations for use only within Bloomberg networks. - -If you are a Bloomberg developer, either unset the BLPAPI_PY_INTERNAL_BUILD -environment variable to build the public release, or ensure the internalutils -subdirectory is present. -""" - raise ImportError(error_msg) - - internalutils_wrap = Extension( - "blpapi.internalutils._bindings", - sources=["src/blpapi/internalutils/bindings_wrap.c"], - include_dirs=[blpapiIncludes], - library_dirs=[blpapiLibraryPath], - libraries=[blpapiLibraryName], - extra_compile_args=extraCompileArgs, - extra_link_args=extraLinkArgs, - ) - extensions.append(internalutils_wrap) - packages.append("blpapi.internalutils") -# INTERNAL ONLY END +extensions = [blpapi_wrap] setup( name="blpapi", version=find_version_number(), author="Bloomberg L.P.", author_email="open-tech@bloomberg.net", + cmdclass=cmdclass, description="Python SDK for Bloomberg BLPAPI", ext_modules=extensions, url="http://www.bloomberglabs.com/api/", diff --git a/src/blpapi.egg-info/PKG-INFO b/src/blpapi.egg-info/PKG-INFO index 243de33..08e7efb 100644 --- a/src/blpapi.egg-info/PKG-INFO +++ b/src/blpapi.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: blpapi -Version: 3.24.6 +Version: 3.24.10 Summary: Python SDK for Bloomberg BLPAPI Home-page: http://www.bloomberglabs.com/api/ Author: Bloomberg L.P. diff --git a/src/blpapi.egg-info/SOURCES.txt b/src/blpapi.egg-info/SOURCES.txt index 2345db9..826e054 100644 --- a/src/blpapi.egg-info/SOURCES.txt +++ b/src/blpapi.egg-info/SOURCES.txt @@ -59,13 +59,13 @@ examples/unittests/snippets/test_events.py examples/unittests/snippets/test_refdata.py examples/unittests/snippets/resolver/resolverutils.py examples/unittests/snippets/resolver/test_resolverutils.py -src/blpapi/internals_wrap.c -src/blpapi/versionhelper_wrap.c src/blpapi/__init__.py src/blpapi/abstractsession.py src/blpapi/auth.py src/blpapi/chandle.py src/blpapi/constant.py +src/blpapi/correlationid.py +src/blpapi/ctypesutils.py src/blpapi/datatype.py src/blpapi/datetime.py src/blpapi/debug.py @@ -76,6 +76,7 @@ src/blpapi/event.py src/blpapi/eventdispatcher.py src/blpapi/eventformatter.py src/blpapi/exception.py +src/blpapi/ffi_utils.c src/blpapi/highresclock.py src/blpapi/identity.py src/blpapi/internals.py @@ -84,7 +85,7 @@ src/blpapi/message.py src/blpapi/name.py src/blpapi/names.py src/blpapi/providersession.py -src/blpapi/py.typed +src/blpapi/pycbhelpers.py src/blpapi/request.py src/blpapi/requesttemplate.py src/blpapi/resolutionlist.py @@ -98,7 +99,6 @@ src/blpapi/topiclist.py src/blpapi/typehints.py src/blpapi/utils.py src/blpapi/version.py -src/blpapi/versionhelper.py src/blpapi/zfputil.py src/blpapi.egg-info/PKG-INFO src/blpapi.egg-info/SOURCES.txt diff --git a/src/blpapi/__init__.py b/src/blpapi/__init__.py index 8ea6f56..4bb8b78 100644 --- a/src/blpapi/__init__.py +++ b/src/blpapi/__init__.py @@ -4,27 +4,9 @@ # pylint: disable=raise-missing-from # pylint: disable=no-member -import platform - -if platform.system().lower() == "windows": - import glob - import os - - blpapi_dir = os.path.abspath(os.path.dirname(__file__)) - is_64bit = platform.architecture()[0].startswith("64") - dll_glob = "*64.dll" if is_64bit else "*32.dll" - - # Attempt to read dlls at the root of blpapi installation - # We do not copy the dlls for the source distribution so they are not - # guaranteed to be there. - # In that case, the next block is going to be skipped entirely. - for filename in glob.glob(os.path.join(blpapi_dir, dll_glob)): - from ctypes import CDLL - - CDLL(os.path.abspath(filename)) try: - from .internals import CorrelationId + from .internals import BDatetime except ImportError as error: # The most likely reason for a failure here is a failure to locate the # shared object for the C++ library. Provide a meaningful error message. @@ -35,6 +17,7 @@ from .abstractsession import AbstractSession from .auth import AuthOptions, AuthUser from .constant import Constant, ConstantList +from .correlationid import CorrelationId from .datatype import DataType from .datetime import FixedOffset from .element import Element @@ -71,6 +54,17 @@ print_version, ) +from .pycbhelpers import ( + voidFromPyObject, + pyObjectFromVoid, +) +from .internals import ( + libblpapict, + charPtrWithSizeFromPyStr, + charPtrFromPyStr, + getPODFromOutput, +) + # INTERNAL ONLY START # see automation/prepare_release.py try: diff --git a/src/blpapi/abstractsession.py b/src/blpapi/abstractsession.py index 4e6b790..1dfbfa8 100644 --- a/src/blpapi/abstractsession.py +++ b/src/blpapi/abstractsession.py @@ -19,13 +19,17 @@ # pylint: disable=protected-access from typing import Callable, Union, Sequence, Optional from . import typehints # pylint: disable=unused-import -from .typehints import BlpapiAbstractSessionHandle +from .typehints import ( + BlpapiAbstractSessionHandle, + BlpapiSessionHandle, + BlpapiProviderSessionHandle, +) from . import exception from .exception import _ExceptionUtil from .identity import Identity from .service import Service from . import internals -from .internals import CorrelationId +from .correlationid import CorrelationId from .utils import get_handle from .chandle import CHandle @@ -87,13 +91,15 @@ class AbstractSession(CHandle): def __init__( self, - handle: Optional[BlpapiAbstractSessionHandle] = None, - dtor: Optional[Callable] = None, + sessionHandle: Union[BlpapiSessionHandle, BlpapiProviderSessionHandle], + abstractSessionHandle: BlpapiAbstractSessionHandle, + dtor: Callable, ) -> None: """Instantiate an :class:`AbstractSession` with the specified handle. Args: - handle: Handle to the underlying session + sessionHandle: Handle to the underlying session + abstractSessionHandle: Handle to the underlying abstract session Raises: NotImplementedError: If this class is instantiated directly @@ -108,8 +114,8 @@ def __init__( "Don't instantiate this class directly." "Create sessions using one of the concrete subclasses of this class." ) - super(AbstractSession, self).__init__(handle, dtor) # type: ignore - self.__handle = handle + super(AbstractSession, self).__init__(sessionHandle, dtor) + self.__handle = abstractSessionHandle def openService(self, serviceName: str) -> bool: """Open the service identified by the specified ``serviceName``. @@ -239,7 +245,8 @@ def sendAuthorizationRequest( return correlationId def cancel( - self, correlationId: Union[CorrelationId, Sequence[CorrelationId]] + self, + correlationId: Union[CorrelationId, Sequence[CorrelationId], None], ) -> None: """Cancel request(s) with a single ``correlationId`` or a list. @@ -262,6 +269,8 @@ def cancel( as this method returns it is preferable not to aggressively re-use correlation IDs, particularly with an asynchronous Session. """ + if correlationId is None: + return if isinstance(correlationId, list): cids = correlationId else: diff --git a/src/blpapi/chandle.py b/src/blpapi/chandle.py index 264e518..c0cce9b 100644 --- a/src/blpapi/chandle.py +++ b/src/blpapi/chandle.py @@ -6,6 +6,7 @@ It handles the life of an object with a handle from C layer. """ +from ctypes import c_void_p from typing import Callable, Any @@ -14,12 +15,15 @@ class CHandle: def __init__(self, handle: Any, dtor: Callable) -> None: """Set the handle and the dtor""" + # None case is for tests + assert isinstance(handle, c_void_p) or handle is None self.__handle = handle self._dtor = dtor def __del__(self) -> None: """Destroy the object""" try: + # print('destorying chandle', self.__handle, 'using', self._dtor) self.destroy() except (NameError, AttributeError): pass @@ -35,6 +39,12 @@ def _handle(self) -> Any: """Return the internal implementation.""" return self.__handle + def isValid(self) -> bool: + """Returns: + ``True`` if this class holds a handle and the handle is not None. + """ + return self.__handle is not None and self.__handle.value is not None + __copyright__ = """ Copyright 2020. Bloomberg Finance L.P. diff --git a/src/blpapi/correlationid.py b/src/blpapi/correlationid.py new file mode 100644 index 0000000..968e652 --- /dev/null +++ b/src/blpapi/correlationid.py @@ -0,0 +1,265 @@ +from ctypes import ( + byref, + c_uint16, + c_void_p, + sizeof, +) +from . import internals +from . import pycbhelpers +from .ctypesutils import safePOD, py_objectFromVoid +from typing import Any + + +class CorrelationId: + r""" + A key used to identify individual subscriptions or requests. + + Two :class:`CorrelationId` objects are considered equal if they have the same + :meth:`type()` and: + + - Hold the same (not just equal!) objects, if the type is :attr:`OBJECT_TYPE`. + - Hold equal integers, if the type is :attr:`INT_TYPE` or :attr:`AUTOGEN_TYPE`. + + If the type is :attr:`UNSET_TYPE`, then the two :class:`CorrelationId` objects + are always equal (as the value of both will necessarily be ``None``). + + It is possible that a user constructed :class:`CorrelationId` and a + :class:`CorrelationId` generated by the API could return the same result for + :meth:`value()`. However, they will not compare equal because they have a + different :meth:`type()`. + + :class:`CorrelationId` objects are passed to many of the :class:`Session` + object methods which initiate asynchronous operations and are obtained from + :class:`Message` objects which are delivered as a result of those asynchronous + operations. + + When subscribing or requesting information, an application has the choice of + providing a :class:`CorrelationId` they construct themselves or allowing the + session to construct one for them. If the application supplies a + :class:`CorrelationId`, it must not re-use the value contained in it in another + :class:`CorrelationId`, whilst the original request or subscription is still + active. + + The ``xxx_TYPE`` class attributes represent the possible types of + :class:`CorrelationId`. + """ + + UNSET_TYPE = internals.CORRELATION_TYPE_UNSET + """The :class:`CorrelationId` is unset. That is, it was created by the + default :class:`CorrelationId` constructor.""" + + INT_TYPE = internals.CORRELATION_TYPE_INT + """The :class:`CorrelationId` was created from an :class:`int` or + :class:`long` supplied by the user.""" + + OBJECT_TYPE = internals.CORRELATION_TYPE_POINTER + """The :class:`CorrelationId` was created from an object supplied by + the user.""" + + AUTOGEN_TYPE = internals.CORRELATION_TYPE_AUTOGEN + """The :class:`CorrelationId` was created internally by API.""" + + MAX_CLASS_ID = internals.CORRELATION_MAX_CLASS_ID + """The maximum value allowed for ``classId``.""" + + STRUCT_SZ = sizeof(internals.CidStruct) + + __TYPE_NAMES = { + UNSET_TYPE: "UNSET", + INT_TYPE: "INTEGER", + OBJECT_TYPE: "OBJECT", + AUTOGEN_TYPE: "AUTOGEN", + } + + @staticmethod + def cidFromCPtr(ptr: int) -> "CorrelationId": + # used in _subscriptionPreprocessProxy + cid = internals.CidStruct.from_buffer_copy( + internals.CidStruct.from_address(ptr) + ) + return CorrelationId(cid) + + def __init__(self, *argv: Any, **_kwargs: Any) -> None: + r""" + ``CorrelationId([value[, classId=0]])`` constructs a :class:`CorrelationId` + object. + If ``value`` is an integer (either :class:`int` or :class:`long`) then the + created :class:`CorrelationId` will have type :attr:`INT_TYPE`. Otherwise, it + will have type :attr:`OBJECT_TYPE`. + If no arguments are specified, then the type will be :attr:`UNSET_TYPE`. + The maximum allowed ``classId`` value is :attr:`MAX_CLASS_ID`. + """ + argc = len(argv) + assert argc >= 0 and argc <= 2 + if argc == 0: # this is empty/default + self.flags = internals.CidFlags( + CorrelationId.STRUCT_SZ, CorrelationId.UNSET_TYPE, 0, 0 + ) + self.rawvalue = internals.CidValue(0) + elif isinstance(argv[0], int): # this is int + classid = ( + safePOD(argv[1], c_uint16).value + if argc > 1 and isinstance(argv[1], int) + else 0 + ) + self.flags = internals.CidFlags( + CorrelationId.STRUCT_SZ, CorrelationId.INT_TYPE, classid, 0 + ) + self.rawvalue = internals.CidValue(intValue=argv[0]) + elif isinstance(argv[0], internals.CidStruct): # this came from C + self.flags = argv[0].flags + if self.flags.valueType != CorrelationId.OBJECT_TYPE: + # this is an in-place value int/autogen, just store it + self.rawvalue = argv[0].rawvalue + else: + # this is an object, we need to handle lifetime + if ( + internals.is_known_obj(byref(argv[0].rawvalue.ptrValue)) + == 0 + ): + # must be recap + self.rawvalue = argv[0].rawvalue + # we must become co-owners and bump using C++ manager + pv = self.rawvalue.ptrValue + pv.manager( + byref(pv), + byref(argv[0].rawvalue.ptrValue), + internals.ManagedPtr.COPY, + ) + else: # it is a proper py-object + pyobj = CorrelationId._objectFromStruct(argv[0]) + self.rawvalue = internals.cidValueForObj(pyobj) + else: # this is a py-object, including None + classid = ( + safePOD(argv[1], c_uint16).value + if argc > 1 and isinstance(argv[1], int) + else 0 + ) + + self.flags = internals.CidFlags( + CorrelationId.STRUCT_SZ, CorrelationId.OBJECT_TYPE, classid, 0 + ) + self.rawvalue = internals.cidValueForObj(argv[0]) + + self.thestruct = internals.CidStruct( + flags=self.flags, rawvalue=self.rawvalue + ) + + def __del__(self) -> None: + if self.type() != CorrelationId.OBJECT_TYPE: + return + + # this is safe for py-object, recaps, and even None + pv = self.rawvalue.ptrValue + pv.manager(byref(pv), None, internals.ManagedPtr.DESTROY) # dec ref. + + def type(self) -> int: + r""" + Returns: + int: The type of this CorrelationId object (see the ``xxx_TYPE`` class + attributes) + """ + return self.thestruct.flags.valueType + + def classId(self) -> int: + r""" + Returns: + int: The user defined classification of this :class:`CorrelationId` + object + """ + return self.thestruct.flags.classId + + def _asInt(self) -> int: + return self.thestruct.rawvalue.intValue + + def value(self) -> Any: + """ + Returns: + int or long or object: The value of this CorrelationId object. + + The return value depends on this :class:`CorrelationId`'s value + type and could be: + + - Integer (``type() == CorrelationId.INT_TYPE`` + or ``type() == CorrelationId.AUTOGEN_TYPE``) + - Object (``type() == CorrelationId.OBJECT_TYPE``) + - ``None`` (``type() == CorrelationId.UNSET_TYPE``) + """ + valueType = self.type() + if ( + valueType == CorrelationId.INT_TYPE + or valueType == CorrelationId.AUTOGEN_TYPE + ): + return self._asInt() + elif valueType == CorrelationId.OBJECT_TYPE: + return self._asObject() + else: + return None + + @staticmethod + def _objectFromStruct(cid: internals.CidStruct) -> Any: + if cid.flags.valueType == CorrelationId.OBJECT_TYPE: + if internals.is_known_obj(byref(cid.rawvalue.ptrValue)) == 0: + # must be recaps then + return None + + pyobj = py_objectFromVoid(c_void_p(cid.rawvalue.ptrValue.pointer)) + # py_object is a thin wrapper, it does not bump the ref.count + # but this is fine, the receiver of this will + return pyobj.value + return None + + def _asObject(self) -> Any: + return CorrelationId._objectFromStruct(self.thestruct) + + def __repr__(self) -> str: + if self.type() == CorrelationId.OBJECT_TYPE: + return f"CorrelationId(flags={self.thestruct.flags}, rawvalue.ptrValue=object)" + return f"CorrelationId(flags={self.thestruct.flags}, rawvalue.intValue={self._asInt()})" + + def __str__(self) -> str: + """x.__str__() <==> str(x)""" + valueType = self.type() + valueTypeName = CorrelationId.__TYPE_NAMES[valueType] + + if valueType == CorrelationId.UNSET_TYPE: + return valueTypeName + else: + return f"({valueTypeName}: {self.value()!r}, ClassId: {self.classId()})" + + def __hash__(self) -> int: + if self.type() == CorrelationId.OBJECT_TYPE: + return hash( + ( + self.type(), + self.classId(), + self.thestruct.rawvalue.ptrValue.pointer, + ) + ) + return hash((self.type(), self.classId(), self._asInt())) + + def __eq__(self, other: Any) -> bool: + """x.__eq__(y) <==> x==y""" + try: + if self is other: + return True + if other is None: + return False + if self.type() != other.type(): + return False + if self.classId() != other.classId(): + return False + if self.type() == CorrelationId.OBJECT_TYPE: + # we care about it being SAME object, not just equal/equivalent + return self._asObject() is other._asObject() + return self._asInt() == other._asInt() + except Exception: # pylint: disable=broad-exception-caught + return NotImplemented + + def __ne__(self, other: Any) -> bool: + """x.__ne__(y) <==> x!=y""" + equal = self.__eq__(other) + return NotImplemented if equal is NotImplemented else not equal # type: ignore + + +pycbhelpers.correlationIdWrapper = CorrelationId.cidFromCPtr diff --git a/src/blpapi/ctypesutils.py b/src/blpapi/ctypesutils.py new file mode 100644 index 0000000..49f4beb --- /dev/null +++ b/src/blpapi/ctypesutils.py @@ -0,0 +1,137 @@ +from ctypes import ( + c_void_p, + POINTER, + cast, + py_object, + c_char, + c_uint16, +) +from typing import Any, Callable, Union, Optional, Tuple + + +def voidFromPyObject(obj: Any) -> c_void_p: + # an alternative would be c_void_p.from_buffer(py_object(obj)) + # use .value to get the address as an int + return c_void_p(id(obj)) + + +def voidFromPyFunction(cb: Callable) -> c_void_p: + return voidFromPyObject(cb) + + +def py_objectFromVoid(voidp: c_void_p) -> py_object: + return cast(voidp, py_object) + + +def pyObjectFromVoid(voidp: c_void_p) -> Any: + return py_objectFromVoid(voidp).value + + +_LIMITS = {c_uint16: [0, 0xFFFF]} + + +def safePOD(value: Union[int, float], ctype: Any) -> Any: + limits = _LIMITS[ctype] + if value <= limits[1] and value >= limits[0]: + return ctype(value) + raise OverflowError() + + +def getHandleFromPtr(outp: int) -> Optional[c_void_p]: + """Get c_void_p handle or None + + Some C interface functions will return NULL, when that happens we want + to return a None pointer in Python, rather than a c_void_p holding the + NULL value. + """ + return c_void_p(outp) if outp else None + + +def getHandleFromOutput(outp: Any, retCode: int) -> c_void_p: + """Get c_void_p handle + + Special case: C layer populates the buffer with NULL. + The following statements are true (tested separately) + 1) outp is not None and type(outp) is POINTER(c_void_p) + 2) outp.contents is not None and type(outp.contents) is c_void_p + 3) but outp.contents.value is None, so its type is the NoneType not int + + i.e., it is always safe to access outp.contents as a valid c_void_p + """ + # if retCode != 0 there is no chance this None + # is used as handle by caller + return outp.contents if retCode == 0 else None + + +def getStrFromC( + value: Optional[bytes], dflt: Optional[str] = None +) -> Optional[str]: + """When restype = c_char_p ctypes will: + 1) provide a None for nullptr + 2) provide empty bytes object for empty string + 3) provide non-empty bytes object for non-empty string. + [2 and 3] are safe to decode. + We assume all such are null-terminated and not funny unicode""" + return value.decode() if value is not None else dflt + + +def getStrFromOutput( + outp: Any, retCode: int, dflt: Optional[str] = None +) -> Optional[str]: + if retCode != 0: + return dflt + value = outp.contents.value + return value.decode() if value is not None else dflt + + +def getSizedStrFromOutput( + outp: Any, outsz: Any, retCode: int, dflt: Optional[str] = None +) -> Optional[str]: + if retCode != 0: + return dflt + if not outp.contents.value or not outsz.contents.value: + return "" + return getSizedStrFromBuffer(outp.contents, outsz.contents.value) + + +def getSizedStrFromBuffer(outp: Any, outsz: Any) -> str: + return getSizedBytesFromBuffer(outp, outsz).decode() + + +def getSizedBytesFromOutput( + outp: Any, outsz: Any, retCode: int, dflt: Optional[bytes] = None +) -> Optional[bytes]: + if retCode != 0: + return dflt + if not outp.contents.value or not outsz.contents.value: + return b"" + return getSizedBytesFromBuffer(outp.contents, outsz.contents.value) + + +def getSizedBytesFromBuffer(outp: Any, outsz: int) -> bytes: + return bytes(cast(outp, POINTER(c_char * outsz)).contents) + + +def getPODFromOutput(outp: Any, retCode: int) -> Any: + return outp.contents.value if retCode == 0 else None + + +def getStructFromOutput(outp: Any, retCode: int) -> Any: + return outp.contents if retCode == 0 else None + + +def charPtrFromPyStr(val: Union[str, bytes, None]) -> bytes: + """Use for immutable null-terminated input strings + Works with None""" + return val.encode() if str == type(val) else val # type: ignore + + +def charPtrWithSizeFromPyStr( + val: Union[str, bytes, bytearray, None] +) -> Tuple[Optional[bytes], int]: + if str == type(val): + bts = val.encode() + return bts, len(bts) + if val is None: + return None, 0 + return val, len(val) # type: ignore diff --git a/src/blpapi/datatype.py b/src/blpapi/datatype.py index cd14eaa..08c183b 100644 --- a/src/blpapi/datatype.py +++ b/src/blpapi/datatype.py @@ -16,39 +16,39 @@ class DataType(metaclass=utils.MetaClassForClassesWithEnums): :class:`Element`. """ - BOOL = internals.DATATYPE_BOOL # type: ignore + BOOL = internals.DATATYPE_BOOL """Boolean""" - CHAR = internals.DATATYPE_CHAR # type: ignore + CHAR = internals.DATATYPE_CHAR """Char""" - BYTE = internals.DATATYPE_BYTE # type: ignore + BYTE = internals.DATATYPE_BYTE """Unsigned 8 bit value""" - INT32 = internals.DATATYPE_INT32 # type: ignore + INT32 = internals.DATATYPE_INT32 """32 bit Integer""" - INT64 = internals.DATATYPE_INT64 # type: ignore + INT64 = internals.DATATYPE_INT64 """64 bit Integer""" - FLOAT32 = internals.DATATYPE_FLOAT32 # type: ignore + FLOAT32 = internals.DATATYPE_FLOAT32 """32 bit Floating point""" - FLOAT64 = internals.DATATYPE_FLOAT64 # type: ignore + FLOAT64 = internals.DATATYPE_FLOAT64 """64 bit Floating point""" - STRING = internals.DATATYPE_STRING # type: ignore + STRING = internals.DATATYPE_STRING """ASCIIZ string""" - BYTEARRAY = internals.DATATYPE_BYTEARRAY # type: ignore + BYTEARRAY = internals.DATATYPE_BYTEARRAY """Opaque binary data""" - DATE = internals.DATATYPE_DATE # type: ignore + DATE = internals.DATATYPE_DATE """Date""" - TIME = internals.DATATYPE_TIME # type: ignore + TIME = internals.DATATYPE_TIME """Timestamp""" - DECIMAL = internals.DATATYPE_DECIMAL # type: ignore + DECIMAL = internals.DATATYPE_DECIMAL """Currently Unsupported""" - DATETIME = internals.DATATYPE_DATETIME # type: ignore + DATETIME = internals.DATATYPE_DATETIME """Date and time""" - ENUMERATION = internals.DATATYPE_ENUMERATION # type: ignore + ENUMERATION = internals.DATATYPE_ENUMERATION """An opaque enumeration""" - SEQUENCE = internals.DATATYPE_SEQUENCE # type: ignore + SEQUENCE = internals.DATATYPE_SEQUENCE """Sequence type""" - CHOICE = internals.DATATYPE_CHOICE # type: ignore + CHOICE = internals.DATATYPE_CHOICE """Choice type""" - CORRELATION_ID = internals.DATATYPE_CORRELATION_ID # type: ignore + CORRELATION_ID = internals.DATATYPE_CORRELATION_ID """Used for some internal messages""" diff --git a/src/blpapi/datetime.py b/src/blpapi/datetime.py index 52a9a61..38e2425 100644 --- a/src/blpapi/datetime.py +++ b/src/blpapi/datetime.py @@ -97,6 +97,55 @@ def __le__(self, other: FixedOffset) -> bool: class _DatetimeUtil(object): """Utility methods that deal with BLPAPI dates and times.""" + @staticmethod + def toPyTimeFromInts( + parts: int, + offset: int, + year: int, + month: int, + day: int, + hours: int, + minutes: int, + seconds: int, + useconds: int, + ) -> AnyPythonDatetime: + hasDate = ( + parts & internals.DATETIME_DATE_PART + == internals.DATETIME_DATE_PART + ) + hasTime = parts & internals.DATETIME_TIMEFRACSECONDS_PART != 0 + + tzinfo = ( + FixedOffset(offset) + if parts & internals.DATETIME_OFFSET_PART + else None + ) + + if hasDate and hasTime: + return _dt.datetime( + year, + month, + day, + hours, + minutes, + seconds, + useconds, + tzinfo, + ) + elif hasDate: + # Skip an offset, because it's not informative if there is a + # date without time + return _dt.date(year, month, day) + elif hasTime: + return _dt.time( + hours, + minutes, + seconds, + useconds, + tzinfo, + ) + return _dt.datetime.now() # unreachable + @staticmethod def convertToNative( blpapiDatetimeObj: BlpapiDatetime, diff --git a/src/blpapi/element.py b/src/blpapi/element.py index af75f54..dc857e7 100644 --- a/src/blpapi/element.py +++ b/src/blpapi/element.py @@ -251,7 +251,6 @@ def __init__( """ noop = lambda *args: None super(Element, self).__init__(handle, noop) - self.__handle = handle self.__dataHolder = dataHolder def _getDataHolder( @@ -421,7 +420,7 @@ def name(self) -> Name: self.__assertIsValid() return Name._createInternally( - internals.blpapi_Element_name(self.__handle) + internals.blpapi_Element_name(self._handle()) ) def datatype(self) -> int: @@ -434,7 +433,7 @@ def datatype(self) -> int: """ self.__assertIsValid() - return internals.blpapi_Element_datatype(self.__handle) + return internals.blpapi_Element_datatype(self._handle()) def isComplexType(self) -> bool: """ @@ -444,7 +443,7 @@ def isComplexType(self) -> bool: """ self.__assertIsValid() - return bool(internals.blpapi_Element_isComplexType(self.__handle)) + return bool(internals.blpapi_Element_isComplexType(self._handle())) def isArray(self) -> bool: """ @@ -456,16 +455,16 @@ def isArray(self) -> bool: """ self.__assertIsValid() - return bool(internals.blpapi_Element_isArray(self.__handle)) + return bool(internals.blpapi_Element_isArray(self._handle())) - def isValid(self) -> bool: + def isValid(self) -> bool: # pylint: disable=useless-parent-delegation """ Returns: ``True`` if this :class:`Element` is valid. An :class:`Element` constructed using ``None`` for the ``handle`` is not valid until the :class:`Element` has had a value assigned to it. """ - return self.__handle is not None + return super().isValid() def isNull(self) -> bool: """ @@ -473,7 +472,7 @@ def isNull(self) -> bool: ``True`` if this :class:`Element` has a null value. """ self.__assertIsValid() - return bool(internals.blpapi_Element_isNull(self.__handle)) + return bool(internals.blpapi_Element_isNull(self._handle())) def isReadOnly(self) -> bool: """ @@ -481,7 +480,7 @@ def isReadOnly(self) -> bool: ``True`` if this :class:`Element` cannot be modified. """ self.__assertIsValid() - return bool(internals.blpapi_Element_isReadOnly(self.__handle)) + return bool(internals.blpapi_Element_isReadOnly(self._handle())) def elementDefinition(self) -> "typehints.SchemaElementDefinition": """ @@ -492,7 +491,7 @@ def elementDefinition(self) -> "typehints.SchemaElementDefinition": """ self.__assertIsValid() return SchemaElementDefinition( - internals.blpapi_Element_definition(self.__handle), + internals.blpapi_Element_definition(self._handle()), self._sessions(), ) @@ -509,7 +508,7 @@ def numValues(self) -> int: """ self.__assertIsValid() - return internals.blpapi_Element_numValues(self.__handle) + return internals.blpapi_Element_numValues(self._handle()) def numElements(self) -> int: """ @@ -524,7 +523,7 @@ def numElements(self) -> int: """ self.__assertIsValid() - return internals.blpapi_Element_numElements(self.__handle) + return internals.blpapi_Element_numElements(self._handle()) def isNullValue(self, position: int = 0) -> bool: """ @@ -540,7 +539,7 @@ def isNullValue(self, position: int = 0) -> bool: """ self.__assertIsValid() - res = internals.blpapi_Element_isNullValue(self.__handle, position) + res = internals.blpapi_Element_isNullValue(self._handle(), position) if res in (0, 1): return bool(res) _ExceptionUtil.raiseOnError(res) @@ -613,7 +612,7 @@ def toPy(self) -> Union[Dict, List, SupportedElementTypes]: } """ - return internals.blpapi_Element_toPy(self.__handle) + return internals.blpapi_Element_toPy(self._handle()) def toString(self, level: int = 0, spacesPerLevel: int = 4) -> str: """Format this :class:`Element` to the string at the specified @@ -634,7 +633,7 @@ def toString(self, level: int = 0, spacesPerLevel: int = 4) -> str: self.__assertIsValid() return internals.blpapi_Element_printHelper( - self.__handle, level, spacesPerLevel + self._handle(), level, spacesPerLevel ) def getElement(self, nameOrIndex: BlpapiNameOrIndex) -> Element: @@ -661,12 +660,14 @@ def getElement(self, nameOrIndex: BlpapiNameOrIndex) -> Element: self.__assertIsValid() name = getNamePair(nameOrIndex) res = internals.blpapi_Element_getElement( - self.__handle, name[0], name[1] + self._handle(), name[0], name[1] ) _ExceptionUtil.raiseOnError(res[0]) return Element(res[1], self._getDataHolder()) self.__assertIsValid() - res = internals.blpapi_Element_getElementAt(self.__handle, nameOrIndex) + res = internals.blpapi_Element_getElementAt( + self._handle(), nameOrIndex + ) _ExceptionUtil.raiseOnError(res[0]) return Element(res[1], self._getDataHolder()) @@ -716,7 +717,7 @@ def hasElement( self.__assertIsValid() namepair = getNamePair(name) res = internals.blpapi_Element_hasElementEx( - self.__handle, + self._handle(), namepair[0], namepair[1], 1 if excludeNullElements else 0, @@ -734,7 +735,7 @@ def getChoice(self) -> Element: """ self.__assertIsValid() - res = internals.blpapi_Element_getChoice(self.__handle) + res = internals.blpapi_Element_getChoice(self._handle()) _ExceptionUtil.raiseOnError(res[0]) return Element(res[1], self._getDataHolder()) @@ -753,7 +754,7 @@ def getValueAsBool(self, index: int = 0) -> bool: """ self.__assertIsValid() - res = internals.blpapi_Element_getValueAsBool(self.__handle, index) + res = internals.blpapi_Element_getValueAsBool(self._handle(), index) _ExceptionUtil.raiseOnError(res[0]) return bool(res[1]) @@ -772,7 +773,7 @@ def getValueAsString(self, index: int = 0) -> str: """ self.__assertIsValid() - res = internals.blpapi_Element_getValueAsString(self.__handle, index) + res = internals.blpapi_Element_getValueAsString(self._handle(), index) _ExceptionUtil.raiseOnError(res[0]) return res[1] @@ -791,7 +792,7 @@ def getValueAsBytes(self, index: int = 0) -> bytes: """ self.__assertIsValid() - res = internals.blpapi_Element_getValueAsBytes(self.__handle, index) + res = internals.blpapi_Element_getValueAsBytes(self._handle(), index) _ExceptionUtil.raiseOnError(res[0]) return res[1] @@ -812,9 +813,14 @@ def getValueAsDatetime(self, index: int = 0) -> AnyPythonDatetime: self.__assertIsValid() res = internals.blpapi_Element_getValueAsHighPrecisionDatetime( - self.__handle, index + self._handle(), index ) _ExceptionUtil.raiseOnError(res[0]) + # Return `None` when the `datetime` has no parts because our + # `convertToNative` function will raise an exception if there are + # no parts + if not res[1].datetime.parts: + return None # type: ignore return _DatetimeUtil.convertToNative(res[1]) def getValueAsInteger(self, index: int = 0) -> int: @@ -832,7 +838,7 @@ def getValueAsInteger(self, index: int = 0) -> int: """ self.__assertIsValid() - res = internals.blpapi_Element_getValueAsInt64(self.__handle, index) + res = internals.blpapi_Element_getValueAsInt64(self._handle(), index) _ExceptionUtil.raiseOnError(res[0]) return res[1] @@ -851,7 +857,7 @@ def getValueAsFloat(self, index: int = 0) -> float: """ self.__assertIsValid() - res = internals.blpapi_Element_getValueAsFloat64(self.__handle, index) + res = internals.blpapi_Element_getValueAsFloat64(self._handle(), index) _ExceptionUtil.raiseOnError(res[0]) return res[1] @@ -870,7 +876,7 @@ def getValueAsName(self, index: int = 0) -> Name: """ self.__assertIsValid() - res = internals.blpapi_Element_getValueAsName(self.__handle, index) + res = internals.blpapi_Element_getValueAsName(self._handle(), index) _ExceptionUtil.raiseOnError(res[0]) return Name._createInternally(res[1]) @@ -889,7 +895,7 @@ def getValueAsElement(self, index: int = 0) -> Element: """ self.__assertIsValid() - res = internals.blpapi_Element_getValueAsElement(self.__handle, index) + res = internals.blpapi_Element_getValueAsElement(self._handle(), index) _ExceptionUtil.raiseOnError(res[0]) return Element(res[1], self._getDataHolder()) @@ -1158,7 +1164,7 @@ def setElement(self, name: Name, value: SupportedElementTypes) -> None: if traits[2] is not None: value = traits[2](value) _ExceptionUtil.raiseOnError( - traits[0](self.__handle, namepair[0], namepair[1], value) + traits[0](self._handle(), namepair[0], namepair[1], value) ) def setValue(self, value: SupportedElementTypes, index: int = 0) -> None: @@ -1194,7 +1200,7 @@ def setValue(self, value: SupportedElementTypes, index: int = 0) -> None: traits = Element.__getTraits(value) if traits[2] is not None: value = traits[2](value) - _ExceptionUtil.raiseOnError(traits[1](self.__handle, value, index)) + _ExceptionUtil.raiseOnError(traits[1](self._handle(), value, index)) def appendValue(self, value: SupportedElementTypes) -> None: r"""Append the specified ``value`` to this :class:`Element`\s entries @@ -1242,7 +1248,7 @@ def appendElement(self) -> Element: """ self.__assertIsValid() - res = internals.blpapi_Element_appendElement(self.__handle) + res = internals.blpapi_Element_appendElement(self._handle()) _ExceptionUtil.raiseOnError(res[0]) return Element(res[1], self._getDataHolder()) @@ -1263,7 +1269,7 @@ def setChoice(self, selectionName: Name) -> Element: self.__assertIsValid() name = getNamePair(selectionName) res = internals.blpapi_Element_setChoice( - self.__handle, name[0], name[1], 0 + self._handle(), name[0], name[1], 0 ) _ExceptionUtil.raiseOnError(res[0]) return Element(res[1], self._getDataHolder()) diff --git a/src/blpapi/event.py b/src/blpapi/event.py index a54fd2e..7c1187d 100644 --- a/src/blpapi/event.py +++ b/src/blpapi/event.py @@ -93,33 +93,33 @@ class Event(CHandle, metaclass=utils.MetaClassForClassesWithEnums): The class attributes represent the possible types of event. """ - ADMIN = internals.EVENTTYPE_ADMIN # type: ignore + ADMIN = internals.EVENTTYPE_ADMIN """Admin event""" - SESSION_STATUS = internals.EVENTTYPE_SESSION_STATUS # type: ignore + SESSION_STATUS = internals.EVENTTYPE_SESSION_STATUS """Status updates for a session""" - SUBSCRIPTION_STATUS = internals.EVENTTYPE_SUBSCRIPTION_STATUS # type: ignore + SUBSCRIPTION_STATUS = internals.EVENTTYPE_SUBSCRIPTION_STATUS """Status updates for a subscription""" - REQUEST_STATUS = internals.EVENTTYPE_REQUEST_STATUS # type: ignore + REQUEST_STATUS = internals.EVENTTYPE_REQUEST_STATUS """Status updates for a request""" - RESPONSE = internals.EVENTTYPE_RESPONSE # type: ignore + RESPONSE = internals.EVENTTYPE_RESPONSE """The final (possibly only) response to a request""" - PARTIAL_RESPONSE = internals.EVENTTYPE_PARTIAL_RESPONSE # type: ignore + PARTIAL_RESPONSE = internals.EVENTTYPE_PARTIAL_RESPONSE """A partial response to a request""" - SUBSCRIPTION_DATA = internals.EVENTTYPE_SUBSCRIPTION_DATA # type: ignore + SUBSCRIPTION_DATA = internals.EVENTTYPE_SUBSCRIPTION_DATA """Data updates resulting from a subscription""" - SERVICE_STATUS = internals.EVENTTYPE_SERVICE_STATUS # type: ignore + SERVICE_STATUS = internals.EVENTTYPE_SERVICE_STATUS """Status updates for a service""" - TIMEOUT = internals.EVENTTYPE_TIMEOUT # type: ignore + TIMEOUT = internals.EVENTTYPE_TIMEOUT """An Event returned from nextEvent() if it timed out""" - AUTHORIZATION_STATUS = internals.EVENTTYPE_AUTHORIZATION_STATUS # type: ignore + AUTHORIZATION_STATUS = internals.EVENTTYPE_AUTHORIZATION_STATUS """Status updates for user authorization""" - RESOLUTION_STATUS = internals.EVENTTYPE_RESOLUTION_STATUS # type: ignore + RESOLUTION_STATUS = internals.EVENTTYPE_RESOLUTION_STATUS """Status updates for a resolution operation""" - TOPIC_STATUS = internals.EVENTTYPE_TOPIC_STATUS # type: ignore + TOPIC_STATUS = internals.EVENTTYPE_TOPIC_STATUS """Status updates about topics for service providers""" - TOKEN_STATUS = internals.EVENTTYPE_TOKEN_STATUS # type: ignore + TOKEN_STATUS = internals.EVENTTYPE_TOKEN_STATUS """Status updates for a generate token request""" - REQUEST = internals.EVENTTYPE_REQUEST # type: ignore + REQUEST = internals.EVENTTYPE_REQUEST """Request event""" UNKNOWN = -1 """Unknown event""" diff --git a/src/blpapi/eventformatter.py b/src/blpapi/eventformatter.py index 30d85ef..2ef3293 100644 --- a/src/blpapi/eventformatter.py +++ b/src/blpapi/eventformatter.py @@ -442,7 +442,7 @@ def appendElement(self) -> None: internals.blpapi_EventFormatter_appendElement(self.__handle) ) - def fromPy(self, value: MappingType[Name, Any]) -> None: + def fromPy(self, value: MappingType) -> None: r""" Format this :class:`EventFormatter`'s underlying :class:`Event` using ``value``. diff --git a/src/blpapi/exception.py b/src/blpapi/exception.py index 8e65a8e..b2fa88a 100644 --- a/src/blpapi/exception.py +++ b/src/blpapi/exception.py @@ -109,13 +109,13 @@ class _ExceptionUtil: """Internal exception generating class.""" __errorClasses = { - internals.INVALIDSTATE_CLASS: InvalidStateException, # type: ignore - internals.INVALIDARG_CLASS: InvalidArgumentException, # type: ignore - internals.CNVERROR_CLASS: InvalidConversionException, # type: ignore - internals.BOUNDSERROR_CLASS: IndexOutOfRangeException, # type: ignore - internals.NOTFOUND_CLASS: NotFoundException, # type: ignore - internals.FLDNOTFOUND_CLASS: FieldNotFoundException, # type: ignore - internals.UNSUPPORTED_CLASS: UnsupportedOperationException, # type: ignore + internals.INVALIDSTATE_CLASS: InvalidStateException, + internals.INVALIDARG_CLASS: InvalidArgumentException, + internals.CNVERROR_CLASS: InvalidConversionException, + internals.BOUNDSERROR_CLASS: IndexOutOfRangeException, + internals.NOTFOUND_CLASS: NotFoundException, + internals.FLDNOTFOUND_CLASS: FieldNotFoundException, + internals.UNSUPPORTED_CLASS: UnsupportedOperationException, } @staticmethod diff --git a/src/blpapi/ffi_utils.c b/src/blpapi/ffi_utils.c new file mode 100644 index 0000000..e202e04 --- /dev/null +++ b/src/blpapi/ffi_utils.c @@ -0,0 +1,337 @@ +#define Py_LIMITED_API 0x03080000 +#include + +#include "blpapi_element.h" +#include "blpapi_correlationid.h" + +#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__) +#define PEXPRT __declspec(dllexport) +#else +#define PEXPRT +#endif + +PEXPRT PyObject* blpapi_Element_toPy(blpapi_Element_t *element); + +// this is only needed for windows as the linker will add an /EXPORT +void PyInit_ffiutils(void) { +} + +PyObject* getScalarValue(const blpapi_Element_t* element, const int index) { + const int datatype = blpapi_Element_datatype(element); + + switch (datatype) { + case BLPAPI_DATATYPE_BOOL: { + blpapi_Bool_t boolBuffer; + if (0 != blpapi_Element_getValueAsBool(element, + &boolBuffer, + index)) { + PyErr_SetString( + PyExc_Exception, + "Internal error getting bool"); + return NULL; + } + return PyBool_FromLong(boolBuffer); + } + case BLPAPI_DATATYPE_BYTE: + case BLPAPI_DATATYPE_INT32: + case BLPAPI_DATATYPE_INT64: { + blpapi_Int64_t int64Buffer; + if (0 != blpapi_Element_getValueAsInt64(element, + &int64Buffer, + index)) { + PyErr_SetString( + PyExc_Exception, + "Internal error getting int"); + return NULL; + } + return PyLong_FromLongLong(int64Buffer); + } + case BLPAPI_DATATYPE_FLOAT32: + case BLPAPI_DATATYPE_FLOAT64: { + blpapi_Float64_t floatBuffer; + if (0 != blpapi_Element_getValueAsFloat64(element, + &floatBuffer, + index)) { + PyErr_SetString( + PyExc_Exception, + "Internal error getting float"); + return NULL; + } + return PyFloat_FromDouble(floatBuffer); + } + case BLPAPI_DATATYPE_CHAR: + case BLPAPI_DATATYPE_STRING: + case BLPAPI_DATATYPE_ENUMERATION: { + const char* strValue; + if (0 != blpapi_Element_getValueAsString(element, + &strValue, + index)) { + PyErr_SetString( + PyExc_Exception, + "Internal error getting string"); + return NULL; + } + return PyUnicode_FromString(strValue); + } + case BLPAPI_DATATYPE_BYTEARRAY: { + const char* bytesValue = 0; + size_t bytesLength = 0; + if (0 != blpapi_Element_getValueAsBytes(element, + &bytesValue, + &bytesLength, + index)) { + PyErr_SetString( + PyExc_Exception, + "Internal error getting bytes"); + return NULL; + } + return PyBytes_FromStringAndSize(bytesValue, bytesLength); + } + case BLPAPI_DATATYPE_DATE: + case BLPAPI_DATATYPE_TIME: + case BLPAPI_DATATYPE_DATETIME: { + static PyObject* blpapiDatetimeModule = NULL; + static PyObject* datetimeUtil = NULL; + static PyObject* convertToPyTime = NULL; + blpapi_HighPrecisionDatetime_t highPrecisionDatetimeBuffer; + + /* + Py_LIMITED_API blocks the use of macros from datetime.h + we need to call conversion code from python... + */ + // initialize static variables once + if (convertToPyTime == NULL) { + blpapiDatetimeModule = + PyImport_ImportModule("blpapi.datetime"); + if (blpapiDatetimeModule == NULL) { + PyErr_SetString( + PyExc_Exception, + "Internal error getting blpapi.datetime"); + return NULL; + } + datetimeUtil = + PyObject_GetAttr(blpapiDatetimeModule, + PyUnicode_FromString("_DatetimeUtil")); + if (datetimeUtil == NULL) { + Py_DECREF(blpapiDatetimeModule); + PyErr_SetString( + PyExc_Exception, + "Internal error getting _DatetimeUtil"); + return NULL; + } + convertToPyTime = PyObject_GetAttr( + datetimeUtil, PyUnicode_FromString("toPyTimeFromInts")); + if (convertToPyTime == NULL) { + Py_DECREF(blpapiDatetimeModule); + Py_DECREF(datetimeUtil); + PyErr_SetString( + PyExc_Exception, + "Internal error getting 'toPyTimeFromInts'"); + return NULL; + } + } + + if (blpapi_Element_getValueAsHighPrecisionDatetime( + element, + &highPrecisionDatetimeBuffer, + index) != 0) { + PyErr_SetString( + PyExc_Exception, + "Internal error getting datetime"); + return NULL; + } + + // Return `None` when the `datetime` has no parts because our + if (!highPrecisionDatetimeBuffer.datetime.parts) { + Py_RETURN_NONE; // inc ref and return + } + + return PyObject_CallFunction( + convertToPyTime, "iiiiiiiii", + highPrecisionDatetimeBuffer.datetime.parts, + highPrecisionDatetimeBuffer.datetime.offset, + highPrecisionDatetimeBuffer.datetime.year, + highPrecisionDatetimeBuffer.datetime.month, + highPrecisionDatetimeBuffer.datetime.day, + highPrecisionDatetimeBuffer.datetime.hours, + highPrecisionDatetimeBuffer.datetime.minutes, + highPrecisionDatetimeBuffer.datetime.seconds, + (highPrecisionDatetimeBuffer.datetime.milliSeconds * 1000) + + (highPrecisionDatetimeBuffer.picoseconds / 1000000) + ); + } + case BLPAPI_DATATYPE_SEQUENCE: + case BLPAPI_DATATYPE_CHOICE: + default: { + PyErr_SetString(PyExc_Exception, "Internal datatype error"); + return NULL; + } + } +} + +PyObject* complexElementToPy(blpapi_Element_t *element) { + PyObject* pyDict = PyDict_New(); + PyObject* subElementPy = NULL; + unsigned int i; + if (pyDict == NULL) { + goto ERROR; + } + + for (i = 0; i < blpapi_Element_numElements(element); ++i) { + blpapi_Element_t* subElement; + const char* name; + if (0 != blpapi_Element_getElementAt(element, &subElement, i)) { + PyErr_SetString(PyExc_Exception, + "Internal error in `Element.toPy`"); + goto ERROR; + } + name = blpapi_Element_nameString(subElement); + subElementPy = blpapi_Element_toPy(subElement); + if (subElementPy == NULL) { + goto ERROR; + } + // does not steal ref to value + if (PyDict_SetItemString(pyDict, name, subElementPy)) { + goto ERROR; + } + Py_DECREF(subElementPy); + } + return pyDict; +ERROR: + Py_XDECREF(pyDict); + Py_XDECREF(subElementPy); + // Ensure that we set an error before returning NULL + if (PyErr_Occurred() == NULL) { + PyErr_SetString( + PyExc_Exception, + "Internal error converting a complex Element"); + } + return NULL; +} + +PyObject* arrayElementToPy(blpapi_Element_t *element) { + const unsigned int numValues = blpapi_Element_numValues(element); + PyObject* pyList = PyList_New(numValues); + PyObject* pyValue = NULL; + + const blpapi_SchemaElementDefinition_t* definition + = blpapi_Element_definition(element); + const blpapi_SchemaTypeDefinition_t* typeDefinition + = blpapi_SchemaElementDefinition_type(definition); + + unsigned int i; + if (pyList == NULL) { + goto ERROR; + } + + // complex values + if (blpapi_SchemaTypeDefinition_isComplexType(typeDefinition)) { + for (i = 0; i < numValues; ++i) { + blpapi_Element_t* result; + if (0 != blpapi_Element_getValueAsElement(element, &result, i)) { + PyErr_SetString( + PyExc_Exception, + "Internal error in blpapi_Element_getValueAsElement"); + goto ERROR; + } + pyValue = blpapi_Element_toPy(result); + if (pyValue == NULL) { + goto ERROR; + } + // see https://docs.python.org/3/c-api/list.html#c.PyList_SetItem + PyList_SetItem(pyList, i, pyValue); + } + } + else { + // non complex values + for (i = 0; i < numValues; ++i) { + pyValue = getScalarValue(element, i); + if (pyValue == NULL) { + goto ERROR; + } + PyList_SetItem(pyList, i, pyValue); + } + } + return pyList; + +ERROR: + Py_XDECREF(pyList); + Py_XDECREF(pyValue); + // Ensure that we set an error before returning NULL + if (PyErr_Occurred() == NULL) { + PyErr_SetString( + PyExc_Exception, + "Internal error converting an array Element"); + } + return NULL; +} + +PyObject* blpapi_Element_toPy(blpapi_Element_t *element) { + if (blpapi_Element_isComplexType(element)) { + return complexElementToPy(element); + } + else if (blpapi_Element_isArray(element)) { + return arrayElementToPy(element); + } + else if (blpapi_Element_isNull(element)) { + Py_RETURN_NONE; // inc ref and return + } + else { + return getScalarValue(element, 0); + } +} + +/* decrefs allow python code to decrement ref. count of objects, + even if they are not yet pointed to by blpapi_ManagedPtr_t struct. +*/ +PEXPRT void incref(PyObject *obj); +void incref(PyObject *obj) +{ + PyGILState_STATE s = PyGILState_Ensure(); + Py_XINCREF(obj); + PyGILState_Release(s); +} + +/* This function implements the interface for managing objects from C. + We are ensuring GIL in this implementation, but those calls + can be nested and will not cause a deadlock if a call to managerFunc + is interrupted by GC that needs to decref. + Note: INCREF/DECREF are not atomic in the C-sense, but will not be + interrupted by Python interpreted thread. + */ +PEXPRT int managerFunc(void * mptr, void * sptr, int operation) +{ + PyGILState_STATE s = PyGILState_Ensure(); + + blpapi_ManagedPtr_t * managedPtr = (blpapi_ManagedPtr_t *) mptr; + blpapi_ManagedPtr_t * srcPtr = (blpapi_ManagedPtr_t *) sptr; + + if (operation == BLPAPI_MANAGEDPTR_COPY) { + managedPtr->pointer = srcPtr->pointer; + managedPtr->manager = srcPtr->manager; + Py_XINCREF((PyObject *) (managedPtr->pointer)); + } + else if (operation == BLPAPI_MANAGEDPTR_DESTROY) { + Py_XDECREF((PyObject *) (managedPtr->pointer)); + } + + PyGILState_Release(s); + return 0; +} + +/* Used to set the function pointer to our manager inside cid structure */ +PEXPRT void setmptr(void *s); +void setmptr(void *s) { + blpapi_ManagedPtr_t *p = (blpapi_ManagedPtr_t *) s; + p->manager = (blpapi_ManagedPtr_ManagerFunction_t ) &managerFunc; +} + +/* Used to check if the manager used by a cid is the one we set. +If it is not the same, it must be a C++ cb set for recaps. +This function will be removed when recap cids are fixed. +*/ +PEXPRT int is_known_obj(void *s); +int is_known_obj(void *s) { + blpapi_ManagedPtr_t *p = (blpapi_ManagedPtr_t *) s; + return p->manager == (blpapi_ManagedPtr_ManagerFunction_t ) &managerFunc; +} diff --git a/src/blpapi/identity.py b/src/blpapi/identity.py index ad6168d..6a3f761 100644 --- a/src/blpapi/identity.py +++ b/src/blpapi/identity.py @@ -5,6 +5,7 @@ This component provides an identification of a user and implements the access to the entitlements. """ +from ctypes import c_int from typing import List, Sequence, Tuple, Union from .typehints import BlpapiIdentityHandle from .element import Element @@ -35,11 +36,11 @@ class Identity(CHandle, metaclass=utils.MetaClassForClassesWithEnums): The class attributes represent the various seat types. """ - INVALID_SEAT = internals.SEATTYPE_INVALID_SEAT # type: ignore + INVALID_SEAT = internals.SEATTYPE_INVALID_SEAT """Unknown seat type""" - BPS = internals.SEATTYPE_BPS # type: ignore + BPS = internals.SEATTYPE_BPS """Bloomberg Professional Service""" - NONBPS = internals.SEATTYPE_NONBPS # type: ignore + NONBPS = internals.SEATTYPE_NONBPS """Non-BPS""" def __init__( @@ -90,9 +91,7 @@ def hasEntitlements( else: # Otherwise, assume entitlements is a list, or tuple, etc numberOfEIDs = len(entitlements) - carrayOfEIDs = internals.intArray(numberOfEIDs) - for i, eid in enumerate(entitlements): - carrayOfEIDs[i] = eid + carrayOfEIDs = (c_int * numberOfEIDs)(*entitlements) res = internals.blpapi_Identity_hasEntitlements( self.__handle, get_handle(service), @@ -127,9 +126,8 @@ def getFailedEntitlements( """ if isinstance(entitlements, Element): maxFailedEIDs = entitlements.numValues() - failedEIDs = internals.intArray(maxFailedEIDs) - failedEIDsSize = internals.intArray(1) - failedEIDsSize[0] = maxFailedEIDs + failedEIDs = (c_int * maxFailedEIDs)() + failedEIDsSize = c_int(maxFailedEIDs) res = internals.blpapi_Identity_hasEntitlements( self.__handle, get_handle(service), @@ -142,13 +140,10 @@ def getFailedEntitlements( else: # Otherwise, assume entitlements is a list, or tuple, etc numberOfEIDs = len(entitlements) - carrayOfEIDs = internals.intArray(numberOfEIDs) - for i, eid in enumerate(entitlements): - carrayOfEIDs[i] = eid + carrayOfEIDs = (c_int * numberOfEIDs)(*entitlements) maxFailedEIDs = numberOfEIDs - failedEIDs = internals.intArray(maxFailedEIDs) - failedEIDsSize = internals.intArray(1) - failedEIDsSize[0] = maxFailedEIDs + failedEIDs = (c_int * maxFailedEIDs)() + failedEIDsSize = c_int(maxFailedEIDs) res = internals.blpapi_Identity_hasEntitlements( self.__handle, get_handle(service), @@ -159,7 +154,7 @@ def getFailedEntitlements( failedEIDsSize, ) result = [] - for i in range(failedEIDsSize[0]): + for i in range(failedEIDsSize.value): result.append(failedEIDs[i]) return (True if res else False, result) diff --git a/src/blpapi/internals.py b/src/blpapi/internals.py index 1910883..a3ddddc 100644 --- a/src/blpapi/internals.py +++ b/src/blpapi/internals.py @@ -1,15 +1,7 @@ -# This file was automatically generated by SWIG (http://www.swig.org). -# Version 4.0.1 -# -# Do not make changes to this file unless you know what you are doing--modify -# the SWIG interface file instead. - """ -This module defines internals of BLPAPI-Py and the following classes: -- CorrelationId: a key to track requests and subscriptions - -Copyright 2012. Bloomberg Finance L.P. +This module defines C-wrappers for BLPAPI +Copyright 2023. Bloomberg Finance L.P. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the @@ -18,7 +10,6 @@ furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -28,1822 +19,8376 @@ IN THE SOFTWARE. """ -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 platform +import glob +import os +from typing import Optional, List, Callable, Any + +# Note: all functions here assume we are given an opaque handle, +# not the python wrapper object, even though paramter names don't have "handle" suffix + +from ctypes import ( + CDLL, + PyDLL, + CFUNCTYPE, + POINTER, + Structure, + byref, + cast, + c_char, + c_char_p, + c_double, + c_float, + c_int, + c_int16, + c_int64, + c_size_t, + c_uint, + c_uint16, + c_uint32, + c_uint64, + c_uint8, + c_void_p, + create_string_buffer, + pointer, + py_object, +) +from ctypes import Union as CUnion +from io import StringIO + +from .ctypesutils import ( + charPtrWithSizeFromPyStr, + charPtrFromPyStr, + getHandleFromPtr, + getHandleFromOutput, + getSizedStrFromOutput, + getStrFromC, + getStrFromOutput, + getPODFromOutput, + getStructFromOutput, + getSizedStrFromBuffer, + getSizedBytesFromOutput, + voidFromPyObject, + voidFromPyFunction, +) + + +# ============= Library loading +def _loadLibrary() -> Any: + """Load blpapi shared library/dll""" + bitness = "64" if platform.architecture()[0].startswith("64") else "32" + prefix = "" if platform.system().lower() == "windows" else "lib" + libsuffix = ".dll" if platform.system().lower() == "windows" else ".so" + topysuffix = ".pyd" if platform.system().lower() == "windows" else ".so" + libname = f"{prefix}blpapi3_{bitness}{libsuffix}" + + # it is either next to this file (we are in wheel) + # or the usual locations (including set LD_LIBRARY_PATH) + try: + libpath = os.path.join( + os.path.abspath(os.path.dirname(__file__)), libname + ) + lib = CDLL(libpath) + except OSError: + lib = CDLL(libname) -# Import the low-level C/C++ module -if __package__ or "." in __name__: - from . import _internals -else: - import _internals + for filename in glob.glob( + os.path.join( + os.path.abspath(os.path.dirname(__file__)), + "ffiutils.*" + topysuffix, + ) + ): + toPy = PyDLL(filename) + break + return lib, toPy -try: - import builtins as __builtin__ -except ImportError: - import __builtin__ -def _swig_repr(self): - try: - strthis = "proxy of " + self.this.__repr__() - except __builtin__.Exception: - strthis = "" - return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) - - -def _swig_setattr_nondynamic_instance_variable(set): - def set_instance_attr(self, name, value): - if name == "thisown": - self.this.own(value) - elif name == "this": - set(self, name, value) - elif hasattr(self, name) and isinstance(getattr(type(self), name), property): - set(self, name, value) - else: - raise AttributeError("You cannot add instance attributes to %s" % self) - return set_instance_attr +libblpapict, libffastcalls = _loadLibrary() +libffastcalls.blpapi_Element_toPy.restype = py_object +libffastcalls.incref.argtypes = [py_object] +incref = libffastcalls.incref -def _swig_setattr_nondynamic_class_variable(set): - def set_class_attr(cls, name, value): - if hasattr(cls, name) and not isinstance(getattr(cls, name), property): - set(cls, name, value) - else: - raise AttributeError("You cannot add class attributes to %s" % cls) - return set_class_attr - - -def _swig_add_metaclass(metaclass): - """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass""" - def wrapper(cls): - return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy()) - return wrapper - - -class _SwigNonDynamicMeta(type): - """Meta class to enforce nondynamic attributes (no new attributes) for a class""" - __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__) - - -ELEMENTDEFINITION_UNBOUNDED = _internals.ELEMENTDEFINITION_UNBOUNDED -ELEMENT_INDEX_END = _internals.ELEMENT_INDEX_END -SERVICEREGISTRATIONOPTIONS_PRIORITY_MEDIUM = _internals.SERVICEREGISTRATIONOPTIONS_PRIORITY_MEDIUM -SERVICEREGISTRATIONOPTIONS_PRIORITY_HIGH = _internals.SERVICEREGISTRATIONOPTIONS_PRIORITY_HIGH -CORRELATION_TYPE_UNSET = _internals.CORRELATION_TYPE_UNSET -CORRELATION_TYPE_INT = _internals.CORRELATION_TYPE_INT -CORRELATION_TYPE_POINTER = _internals.CORRELATION_TYPE_POINTER -CORRELATION_TYPE_AUTOGEN = _internals.CORRELATION_TYPE_AUTOGEN -CORRELATION_MAX_CLASS_ID = _internals.CORRELATION_MAX_CLASS_ID -MANAGEDPTR_COPY = _internals.MANAGEDPTR_COPY -MANAGEDPTR_DESTROY = _internals.MANAGEDPTR_DESTROY -DATETIME_YEAR_PART = _internals.DATETIME_YEAR_PART -DATETIME_MONTH_PART = _internals.DATETIME_MONTH_PART -DATETIME_DAY_PART = _internals.DATETIME_DAY_PART -DATETIME_OFFSET_PART = _internals.DATETIME_OFFSET_PART -DATETIME_HOURS_PART = _internals.DATETIME_HOURS_PART -DATETIME_MINUTES_PART = _internals.DATETIME_MINUTES_PART -DATETIME_SECONDS_PART = _internals.DATETIME_SECONDS_PART -DATETIME_MILLISECONDS_PART = _internals.DATETIME_MILLISECONDS_PART -DATETIME_FRACSECONDS_PART = _internals.DATETIME_FRACSECONDS_PART -DATETIME_DATE_PART = _internals.DATETIME_DATE_PART -DATETIME_TIME_PART = _internals.DATETIME_TIME_PART -DATETIME_TIMEMILLI_PART = _internals.DATETIME_TIMEMILLI_PART -DATETIME_TIMEFRACSECONDS_PART = _internals.DATETIME_TIMEFRACSECONDS_PART -EVENTTYPE_ADMIN = _internals.EVENTTYPE_ADMIN -EVENTTYPE_SESSION_STATUS = _internals.EVENTTYPE_SESSION_STATUS -EVENTTYPE_SUBSCRIPTION_STATUS = _internals.EVENTTYPE_SUBSCRIPTION_STATUS -EVENTTYPE_REQUEST_STATUS = _internals.EVENTTYPE_REQUEST_STATUS -EVENTTYPE_RESPONSE = _internals.EVENTTYPE_RESPONSE -EVENTTYPE_PARTIAL_RESPONSE = _internals.EVENTTYPE_PARTIAL_RESPONSE -EVENTTYPE_SUBSCRIPTION_DATA = _internals.EVENTTYPE_SUBSCRIPTION_DATA -EVENTTYPE_SERVICE_STATUS = _internals.EVENTTYPE_SERVICE_STATUS -EVENTTYPE_TIMEOUT = _internals.EVENTTYPE_TIMEOUT -EVENTTYPE_AUTHORIZATION_STATUS = _internals.EVENTTYPE_AUTHORIZATION_STATUS -EVENTTYPE_RESOLUTION_STATUS = _internals.EVENTTYPE_RESOLUTION_STATUS -EVENTTYPE_TOPIC_STATUS = _internals.EVENTTYPE_TOPIC_STATUS -EVENTTYPE_TOKEN_STATUS = _internals.EVENTTYPE_TOKEN_STATUS -EVENTTYPE_REQUEST = _internals.EVENTTYPE_REQUEST -STATUS_ACTIVE = _internals.STATUS_ACTIVE -STATUS_DEPRECATED = _internals.STATUS_DEPRECATED -STATUS_INACTIVE = _internals.STATUS_INACTIVE -STATUS_PENDING_DEPRECATION = _internals.STATUS_PENDING_DEPRECATION -SUBSCRIPTIONSTATUS_UNSUBSCRIBED = _internals.SUBSCRIPTIONSTATUS_UNSUBSCRIBED -SUBSCRIPTIONSTATUS_SUBSCRIBING = _internals.SUBSCRIPTIONSTATUS_SUBSCRIBING -SUBSCRIPTIONSTATUS_SUBSCRIBED = _internals.SUBSCRIPTIONSTATUS_SUBSCRIBED -SUBSCRIPTIONSTATUS_CANCELLED = _internals.SUBSCRIPTIONSTATUS_CANCELLED -SUBSCRIPTIONSTATUS_PENDING_CANCELLATION = _internals.SUBSCRIPTIONSTATUS_PENDING_CANCELLATION -CLIENTMODE_AUTO = _internals.CLIENTMODE_AUTO -CLIENTMODE_DAPI = _internals.CLIENTMODE_DAPI -CLIENTMODE_SAPI = _internals.CLIENTMODE_SAPI -CLIENTMODE_COMPAT_33X = _internals.CLIENTMODE_COMPAT_33X -RESOLVEMODE_DONT_REGISTER_SERVICES = _internals.RESOLVEMODE_DONT_REGISTER_SERVICES -RESOLVEMODE_AUTO_REGISTER_SERVICES = _internals.RESOLVEMODE_AUTO_REGISTER_SERVICES -SEATTYPE_INVALID_SEAT = _internals.SEATTYPE_INVALID_SEAT -SEATTYPE_BPS = _internals.SEATTYPE_BPS -SEATTYPE_NONBPS = _internals.SEATTYPE_NONBPS -SERVICEREGISTRATIONOPTIONS_PRIORITY_LOW = _internals.SERVICEREGISTRATIONOPTIONS_PRIORITY_LOW -REGISTRATIONPARTS_DEFAULT = _internals.REGISTRATIONPARTS_DEFAULT -REGISTRATIONPARTS_PUBLISHING = _internals.REGISTRATIONPARTS_PUBLISHING -REGISTRATIONPARTS_OPERATIONS = _internals.REGISTRATIONPARTS_OPERATIONS -REGISTRATIONPARTS_SUBSCRIBER_RESOLUTION = _internals.REGISTRATIONPARTS_SUBSCRIBER_RESOLUTION -REGISTRATIONPARTS_PUBLISHER_RESOLUTION = _internals.REGISTRATIONPARTS_PUBLISHER_RESOLUTION -TOPICLIST_NOT_CREATED = _internals.TOPICLIST_NOT_CREATED -TOPICLIST_CREATED = _internals.TOPICLIST_CREATED -TOPICLIST_FAILURE = _internals.TOPICLIST_FAILURE -RESOLUTIONLIST_UNRESOLVED = _internals.RESOLUTIONLIST_UNRESOLVED -RESOLUTIONLIST_RESOLVED = _internals.RESOLUTIONLIST_RESOLVED -RESOLUTIONLIST_RESOLUTION_FAILURE_BAD_SERVICE = _internals.RESOLUTIONLIST_RESOLUTION_FAILURE_BAD_SERVICE -RESOLUTIONLIST_RESOLUTION_FAILURE_SERVICE_AUTHORIZATION_FAILED = _internals.RESOLUTIONLIST_RESOLUTION_FAILURE_SERVICE_AUTHORIZATION_FAILED -RESOLUTIONLIST_RESOLUTION_FAILURE_BAD_TOPIC = _internals.RESOLUTIONLIST_RESOLUTION_FAILURE_BAD_TOPIC -RESOLUTIONLIST_RESOLUTION_FAILURE_TOPIC_AUTHORIZATION_FAILED = _internals.RESOLUTIONLIST_RESOLUTION_FAILURE_TOPIC_AUTHORIZATION_FAILED -MESSAGE_FRAGMENT_NONE = _internals.MESSAGE_FRAGMENT_NONE -MESSAGE_FRAGMENT_START = _internals.MESSAGE_FRAGMENT_START -MESSAGE_FRAGMENT_INTERMEDIATE = _internals.MESSAGE_FRAGMENT_INTERMEDIATE -MESSAGE_FRAGMENT_END = _internals.MESSAGE_FRAGMENT_END -MESSAGE_RECAPTYPE_NONE = _internals.MESSAGE_RECAPTYPE_NONE -MESSAGE_RECAPTYPE_SOLICITED = _internals.MESSAGE_RECAPTYPE_SOLICITED -MESSAGE_RECAPTYPE_UNSOLICITED = _internals.MESSAGE_RECAPTYPE_UNSOLICITED -ZFPUTIL_REMOTE_8194 = _internals.ZFPUTIL_REMOTE_8194 -ZFPUTIL_REMOTE_8196 = _internals.ZFPUTIL_REMOTE_8196 -IDENTITYUTIL_USERTYPE_UNKNOWN = _internals.IDENTITYUTIL_USERTYPE_UNKNOWN -IDENTITYUTIL_USERTYPE_APP_PORTAL = _internals.IDENTITYUTIL_USERTYPE_APP_PORTAL -IDENTITYUTIL_USERTYPE_SANDBOX_EXCEL = _internals.IDENTITYUTIL_USERTYPE_SANDBOX_EXCEL -SUBSCRIPTIONPREPROCESS_INVALID_SUBSCRIPTION_STRING = _internals.SUBSCRIPTIONPREPROCESS_INVALID_SUBSCRIPTION_STRING -SUBSCRIPTIONPREPROCESS_CORRELATIONID_ERROR = _internals.SUBSCRIPTIONPREPROCESS_CORRELATIONID_ERROR -DATATYPE_BOOL = _internals.DATATYPE_BOOL -DATATYPE_CHAR = _internals.DATATYPE_CHAR -DATATYPE_BYTE = _internals.DATATYPE_BYTE -DATATYPE_INT32 = _internals.DATATYPE_INT32 -DATATYPE_INT64 = _internals.DATATYPE_INT64 -DATATYPE_FLOAT32 = _internals.DATATYPE_FLOAT32 -DATATYPE_FLOAT64 = _internals.DATATYPE_FLOAT64 -DATATYPE_STRING = _internals.DATATYPE_STRING -DATATYPE_BYTEARRAY = _internals.DATATYPE_BYTEARRAY -DATATYPE_DATE = _internals.DATATYPE_DATE -DATATYPE_TIME = _internals.DATATYPE_TIME -DATATYPE_DECIMAL = _internals.DATATYPE_DECIMAL -DATATYPE_DATETIME = _internals.DATATYPE_DATETIME -DATATYPE_ENUMERATION = _internals.DATATYPE_ENUMERATION -DATATYPE_SEQUENCE = _internals.DATATYPE_SEQUENCE -DATATYPE_CHOICE = _internals.DATATYPE_CHOICE -DATATYPE_CORRELATION_ID = _internals.DATATYPE_CORRELATION_ID -blpapi_Logging_SEVERITY_OFF = _internals.blpapi_Logging_SEVERITY_OFF -blpapi_Logging_SEVERITY_FATAL = _internals.blpapi_Logging_SEVERITY_FATAL -blpapi_Logging_SEVERITY_ERROR = _internals.blpapi_Logging_SEVERITY_ERROR -blpapi_Logging_SEVERITY_WARN = _internals.blpapi_Logging_SEVERITY_WARN -blpapi_Logging_SEVERITY_INFO = _internals.blpapi_Logging_SEVERITY_INFO -blpapi_Logging_SEVERITY_DEBUG = _internals.blpapi_Logging_SEVERITY_DEBUG -blpapi_Logging_SEVERITY_TRACE = _internals.blpapi_Logging_SEVERITY_TRACE - -def setLoggerCallbackWrapper(cb, severity): - return _internals.setLoggerCallbackWrapper(cb, severity) - -def blpapi_HighPrecisionDatetime_fromTimePoint_wrapper(original): - return _internals.blpapi_HighPrecisionDatetime_fromTimePoint_wrapper(original) - -def blpapi_Logging_registerCallback(callback, thresholdSeverity): - return _internals.blpapi_Logging_registerCallback(callback, thresholdSeverity) - -def blpapi_Logging_logTestMessage(severity): - return _internals.blpapi_Logging_logTestMessage(severity) - -def blpapi_DiagnosticsUtil_memoryInfo_wrapper(): - return _internals.blpapi_DiagnosticsUtil_memoryInfo_wrapper() - -def blpapi_EventDispatcher_stop(handle, asynch): - return _internals.blpapi_EventDispatcher_stop(handle, asynch) - -def blpapi_Service_printHelper(service, level, spacesPerLevel): - return _internals.blpapi_Service_printHelper(service, level, spacesPerLevel) - -def blpapi_SchemaElementDefinition_printHelper(item, level, spacesPerLevel): - return _internals.blpapi_SchemaElementDefinition_printHelper(item, level, spacesPerLevel) - -def blpapi_SchemaTypeDefinition_printHelper(item, level, spacesPerLevel): - return _internals.blpapi_SchemaTypeDefinition_printHelper(item, level, spacesPerLevel) - -def blpapi_Message_printHelper(message, level, spacesPerLevel): - return _internals.blpapi_Message_printHelper(message, level, spacesPerLevel) - -def blpapi_SessionOptions_printHelper(sessionOptions, level, spacesPerLevel): - return _internals.blpapi_SessionOptions_printHelper(sessionOptions, level, spacesPerLevel) - -def blpapi_Socks5Config_printHelper(socks5Config, level, spacesPerLevel): - return _internals.blpapi_Socks5Config_printHelper(socks5Config, level, spacesPerLevel) - -def blpapi_TestUtil_serializeServiceHelper(service): - return _internals.blpapi_TestUtil_serializeServiceHelper(service) - -def blpapi_SchemaTypeDefinition_hasElementDefinition(type, nameString, name): - return _internals.blpapi_SchemaTypeDefinition_hasElementDefinition(type, nameString, name) - -def blpapi_ConstantList_hasConstant(list, nameString, name): - return _internals.blpapi_ConstantList_hasConstant(list, nameString, name) - -def blpapi_Service_hasEventDefinition(service, nameString, name): - return _internals.blpapi_Service_hasEventDefinition(service, nameString, name) - -def blpapi_Service_hasOperation(service, nameString, name): - return _internals.blpapi_Service_hasOperation(service, nameString, name) - -def blpapi_SubscriptionList_addHelper(list, topic, correlationId, fields, options): - return _internals.blpapi_SubscriptionList_addHelper(list, topic, correlationId, fields, options) - -def blpapi_Name_hasName(nameString): - return _internals.blpapi_Name_hasName(nameString) - -def blpapi_TopicList_createFromResolutionList(_from): - return _internals.blpapi_TopicList_createFromResolutionList(_from) -class intArray(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, nelements): - _internals.intArray_swiginit(self, _internals.new_intArray(nelements)) - __swig_destroy__ = _internals.delete_intArray - - def __getitem__(self, index): - return _internals.intArray___getitem__(self, index) - - def __setitem__(self, index, value): - return _internals.intArray___setitem__(self, index, value) - - def cast(self): - return _internals.intArray_cast(self) +libffastcalls.setmptr.argtypes = [c_void_p] +setmptr = libffastcalls.setmptr - @staticmethod - def frompointer(t): - return _internals.intArray_frompointer(t) +libffastcalls.is_known_obj.restype = c_int +libffastcalls.is_known_obj.argtypes = [c_void_p] +is_known_obj = libffastcalls.is_known_obj -# Register intArray in _internals: -_internals.intArray_swigregister(intArray) +from .pycbhelpers import ( + any_printer, + anySessionEventHandlerWrapper, + anySessionSubErrorHandlerWrapper, + StreamWrapper, +) -def intArray_frompointer(t): - return _internals.intArray_frompointer(t) +class BDatetime(Structure): + _fields_ = [ + ("parts", c_uint8), + ("hours", c_uint8), + ("minutes", c_uint8), + ("seconds", c_uint8), + ("milliSeconds", c_uint16), + ("month", c_uint8), + ("day", c_uint8), + ("year", c_uint16), + ("offset", c_int16), + ] -def new_topicPtrArray(nelements): - return _internals.new_topicPtrArray(nelements) -def delete_topicPtrArray(ary): - return _internals.delete_topicPtrArray(ary) +class HighPrecisionDatetime(Structure): + _fields_ = [ + ("datetime", BDatetime), + ("picoseconds", c_uint32), + ] + + +class TimePoint(Structure): + _fields_ = [ + ("d_value", c_int64), + ] + + +class CidFlags(Structure): + _fields_ = [ + ("size", c_uint, 8), + ("valueType", c_uint, 4), + ("classId", c_uint, 16), + ("reserved", c_uint, 4), + ] + + def __str__(self) -> str: + return f"[valtype: {self.valueType}, classid: {self.classId}, sz: {self.size}]" + + +class ManagedPtrData(CUnion): + _fields_ = [("intValue", c_int), ("ptr", c_void_p)] + + +ManagedPtr_ManagerFunction_t = CFUNCTYPE(c_int, c_void_p, c_void_p, c_int) + + +class ManagedPtr(Structure): + _fields_ = [ + ("pointer", c_void_p), + ("userData", ManagedPtrData * 4), + ("manager", ManagedPtr_ManagerFunction_t), + ] + + COPY = 1 + DESTROY = -1 + + def __str__(self) -> str: + return f"[ptr: {hex(self.pointer)}, ud[0]: {hex(self.userData[0].ptr)}, ud[1]: {hex(self.userData[1].ptr)}, ud[2]: {self.userData[2].ptr}, ud[3]: {self.userData[3].ptr}, mgr: {cast(self.manager, c_void_p)}]" + + +class CidValue(CUnion): + _fields_ = [("intValue", c_uint64), ("ptrValue", ManagedPtr)] + + def __str__(self) -> str: + return f"[int: {self.intValue}, ptr: {self.ptrValue}]" + + +class CidStruct(Structure): + _fields_ = [("flags", CidFlags), ("rawvalue", CidValue)] + + empty_arr = (ManagedPtrData * 4)() # empty value + + +def cidValueForObj(pyobj: Optional[Any]) -> CidValue: + ptr = c_void_p(id(pyobj)) + mptr = ManagedPtr( + pointer=ptr, + userData=CidStruct.empty_arr, + manager=ManagedPtr_ManagerFunction_t(), + ) + setmptr(byref(mptr)) + + # we always bump here, as we don't know how it is to be used + # could use ptrValue.manager as well at this point + incref(pyobj) + + # DANGER ZONE: since we decoupled the lifecycle of CidStruct + # and CorrelationId, if this CidValue isn't used by a CorrelationId + # then we WILL leak pyobj as nothing will decref it. + return CidValue(ptrValue=mptr) + + +##################### Constants + +UNKNOWN_CLASS = 0x00000 +INVALIDSTATE_CLASS = 0x10000 +INVALIDARG_CLASS = 0x20000 +IOERROR_CLASS = 0x30000 +CNVERROR_CLASS = 0x40000 +BOUNDSERROR_CLASS = 0x50000 +NOTFOUND_CLASS = 0x60000 +FLDNOTFOUND_CLASS = 0x70000 +UNSUPPORTED_CLASS = 0x80000 + +ERROR_UNKNOWN = UNKNOWN_CLASS | 1 +ERROR_ILLEGAL_ARG = INVALIDARG_CLASS | 2 +ERROR_ILLEGAL_ACCESS = UNSUPPORTED_CLASS | 3 +ERROR_INVALID_SESSION = INVALIDARG_CLASS | 4 +ERROR_DUPLICATE_CORRELATIONID = INVALIDARG_CLASS | 5 +ERROR_INTERNAL_ERROR = UNKNOWN_CLASS | 6 +ERROR_RESOLVE_FAILED = IOERROR_CLASS | 7 +ERROR_CONNECT_FAILED = IOERROR_CLASS | 8 +ERROR_ILLEGAL_STATE = INVALIDSTATE_CLASS | 9 +ERROR_CODEC_FAILURE = UNKNOWN_CLASS | 10 +ERROR_INDEX_OUT_OF_RANGE = BOUNDSERROR_CLASS | 11 +ERROR_INVALID_CONVERSION = CNVERROR_CLASS | 12 +ERROR_ITEM_NOT_FOUND = NOTFOUND_CLASS | 13 +ERROR_IO_ERROR = IOERROR_CLASS | 14 +ERROR_CORRELATION_NOT_FOUND = NOTFOUND_CLASS | 15 +ERROR_SERVICE_NOT_FOUND = NOTFOUND_CLASS | 16 +ERROR_LOGON_LOOKUP_FAILED = UNKNOWN_CLASS | 17 +ERROR_DS_LOOKUP_FAILED = UNKNOWN_CLASS | 18 +ERROR_UNSUPPORTED_OPERATION = UNSUPPORTED_CLASS | 19 +ERROR_DS_PROPERTY_NOT_FOUND = NOTFOUND_CLASS | 20 +ERROR_MSG_TOO_LARGE = INVALIDARG_CLASS | 21 + +CLIENTMODE_AUTO = 0 +CLIENTMODE_DAPI = 1 +CLIENTMODE_SAPI = 2 +CLIENTMODE_COMPAT_33X = 16 + +CORRELATION_TYPE_UNSET = 0 +CORRELATION_TYPE_INT = 1 +CORRELATION_TYPE_POINTER = 2 +CORRELATION_TYPE_AUTOGEN = 3 +CORRELATION_MAX_CLASS_ID = 65535 + +DATATYPE_BOOL = 1 # Bool +DATATYPE_CHAR = 2 # Char +DATATYPE_BYTE = 3 # Unsigned 8 bit value +DATATYPE_INT32 = 4 # 32 bit Integer +DATATYPE_INT64 = 5 # 64 bit Integer +DATATYPE_FLOAT32 = 6 # 32 bit Floating point - IEEE +DATATYPE_FLOAT64 = 7 # 64 bit Floating point - IEEE +DATATYPE_STRING = 8 # ASCIIZ string +DATATYPE_BYTEARRAY = 9 # Opaque binary data +DATATYPE_DATE = 10 # Date +DATATYPE_TIME = 11 # Timestamp +DATATYPE_DECIMAL = 12 # +DATATYPE_DATETIME = 13 # Date and time +DATATYPE_ENUMERATION = 14 # An opaque enumeration +DATATYPE_SEQUENCE = 15 # Sequence type +DATATYPE_CHOICE = 16 # Choice type +DATATYPE_CORRELATION_ID = 17 # Used for some internal messages + +DATETIME_YEAR_PART = 0x1 +DATETIME_MONTH_PART = 0x2 +DATETIME_DAY_PART = 0x4 +DATETIME_OFFSET_PART = 0x8 +DATETIME_HOURS_PART = 0x10 +DATETIME_MINUTES_PART = 0x20 +DATETIME_SECONDS_PART = 0x40 +DATETIME_MILLISECONDS_PART = 0x80 +DATETIME_FRACSECONDS_PART = 0x80 +DATETIME_DATE_PART = ( + DATETIME_YEAR_PART | DATETIME_MONTH_PART | DATETIME_DAY_PART +) +DATETIME_TIME_PART = ( + DATETIME_HOURS_PART | DATETIME_MINUTES_PART | DATETIME_SECONDS_PART +) +DATETIME_TIMEMILLI_PART = DATETIME_TIME_PART | DATETIME_MILLISECONDS_PART +DATETIME_TIMEFRACSECONDS_PART = DATETIME_TIME_PART | DATETIME_FRACSECONDS_PART + +ELEMENTDEFINITION_UNBOUNDED = -1 +ELEMENT_INDEX_END = 0xFFFFFFFF + +EVENTTYPE_ADMIN = 1 +EVENTTYPE_SESSION_STATUS = 2 +EVENTTYPE_SUBSCRIPTION_STATUS = 3 +EVENTTYPE_REQUEST_STATUS = 4 +EVENTTYPE_RESPONSE = 5 +EVENTTYPE_PARTIAL_RESPONSE = 6 +EVENTTYPE_SUBSCRIPTION_DATA = 8 +EVENTTYPE_SERVICE_STATUS = 9 +EVENTTYPE_TIMEOUT = 10 +EVENTTYPE_AUTHORIZATION_STATUS = 11 +EVENTTYPE_RESOLUTION_STATUS = 12 +EVENTTYPE_TOPIC_STATUS = 13 +EVENTTYPE_TOKEN_STATUS = 14 +EVENTTYPE_REQUEST = 15 + +MESSAGE_FRAGMENT_NONE = 0 +MESSAGE_FRAGMENT_START = 1 +MESSAGE_FRAGMENT_INTERMEDIATE = 2 +MESSAGE_FRAGMENT_END = 3 +MESSAGE_RECAPTYPE_NONE = 0 +MESSAGE_RECAPTYPE_SOLICITED = 1 +MESSAGE_RECAPTYPE_UNSOLICITED = 2 + +REGISTRATIONPARTS_DEFAULT = 0x1 +REGISTRATIONPARTS_PUBLISHING = 0x2 +REGISTRATIONPARTS_OPERATIONS = 0x4 +REGISTRATIONPARTS_SUBSCRIBER_RESOLUTION = 0x8 +REGISTRATIONPARTS_PUBLISHER_RESOLUTION = 0x10 + +RESOLVEMODE_DONT_REGISTER_SERVICES = 0 +RESOLVEMODE_AUTO_REGISTER_SERVICES = 1 + +RESOLUTIONLIST_UNRESOLVED = 0 +RESOLUTIONLIST_RESOLVED = 1 +RESOLUTIONLIST_RESOLUTION_FAILURE_BAD_SERVICE = 2 +RESOLUTIONLIST_RESOLUTION_FAILURE_SERVICE_AUTHORIZATION_FAILED = 3 +RESOLUTIONLIST_RESOLUTION_FAILURE_BAD_TOPIC = 4 +RESOLUTIONLIST_RESOLUTION_FAILURE_TOPIC_AUTHORIZATION_FAILED = 5 + +SEATTYPE_INVALID_SEAT = -1 +SEATTYPE_BPS = 0 +SEATTYPE_NONBPS = 1 + +_INT_MAX = 2147483647 +SERVICEREGISTRATIONOPTIONS_PRIORITY_LOW = 0 +SERVICEREGISTRATIONOPTIONS_PRIORITY_MEDIUM = _INT_MAX // 2 +SERVICEREGISTRATIONOPTIONS_PRIORITY_HIGH = _INT_MAX + +# schema status +STATUS_ACTIVE = 0 +STATUS_DEPRECATED = 1 +STATUS_INACTIVE = 2 +STATUS_PENDING_DEPRECATION = 3 + +SUBSCRIPTIONSTATUS_UNSUBSCRIBED = 0 +SUBSCRIPTIONSTATUS_SUBSCRIBING = 1 +SUBSCRIPTIONSTATUS_SUBSCRIBED = 2 +SUBSCRIPTIONSTATUS_CANCELLED = 3 +SUBSCRIPTIONSTATUS_PENDING_CANCELLATION = 4 + +SUBSCRIPTIONPREPROCESS_INVALID_SUBSCRIPTION_STRING = 1 +SUBSCRIPTIONPREPROCESS_CORRELATIONID_ERROR = 2 + +TOPICLIST_NOT_CREATED = 0 +TOPICLIST_CREATED = 1 +TOPICLIST_FAILURE = 2 + +ZFPUTIL_REMOTE_8194 = 8194 +ZFPUTIL_REMOTE_8196 = 8196 + +blpapi_Logging_SEVERITY_OFF = 0 +blpapi_Logging_SEVERITY_FATAL = 1 +blpapi_Logging_SEVERITY_ERROR = 2 +blpapi_Logging_SEVERITY_WARN = 3 +blpapi_Logging_SEVERITY_INFO = 4 +blpapi_Logging_SEVERITY_DEBUG = 5 +blpapi_Logging_SEVERITY_TRACE = 6 + +##################### Functions + +l_blpapi_AbstractSession_cancel = ( + libblpapict.blpapi_AbstractSession_cancel +) # int +l_blpapi_AbstractSession_cancel.argtypes = [ + c_void_p, + c_void_p, + c_size_t, + c_char_p, + c_int, +] +l_blpapi_AbstractSession_createIdentity = ( + libblpapict.blpapi_AbstractSession_createIdentity +) +l_blpapi_AbstractSession_createIdentity.restype = c_void_p +l_blpapi_AbstractSession_generateAuthorizedIdentityAsync = ( + libblpapict.blpapi_AbstractSession_generateAuthorizedIdentityAsync +) # int +l_blpapi_AbstractSession_generateToken = ( + libblpapict.blpapi_AbstractSession_generateToken +) # int +l_blpapi_AbstractSession_generateManualToken = ( + libblpapict.blpapi_AbstractSession_generateManualToken +) # int +l_blpapi_AbstractSession_getAuthorizedIdentity = ( + libblpapict.blpapi_AbstractSession_getAuthorizedIdentity +) # int +l_blpapi_AbstractSession_openService = ( + libblpapict.blpapi_AbstractSession_openService +) # int +l_blpapi_AbstractSession_openServiceAsync = ( + libblpapict.blpapi_AbstractSession_openServiceAsync +) # int +l_blpapi_AbstractSession_getService = ( + libblpapict.blpapi_AbstractSession_getService +) # int +l_blpapi_AbstractSession_sendAuthorizationRequest = ( + libblpapict.blpapi_AbstractSession_sendAuthorizationRequest +) # int +l_blpapi_AbstractSession_sessionName = ( + libblpapict.blpapi_AbstractSession_sessionName +) # int + +l_blpapi_AuthApplication_create = ( + libblpapict.blpapi_AuthApplication_create +) # int +l_blpapi_AuthApplication_destroy = libblpapict.blpapi_AuthApplication_destroy +l_blpapi_AuthApplication_destroy.restype = None + +l_blpapi_AuthOptions_create_default = ( + libblpapict.blpapi_AuthOptions_create_default +) # int +l_blpapi_AuthOptions_create_forAppMode = ( + libblpapict.blpapi_AuthOptions_create_forAppMode +) # int +l_blpapi_AuthOptions_create_forToken = ( + libblpapict.blpapi_AuthOptions_create_forToken +) # int +l_blpapi_AuthOptions_create_forUserAndAppMode = ( + libblpapict.blpapi_AuthOptions_create_forUserAndAppMode +) # int +l_blpapi_AuthOptions_create_forUserMode = ( + libblpapict.blpapi_AuthOptions_create_forUserMode +) # int +l_blpapi_AuthOptions_destroy = libblpapict.blpapi_AuthOptions_destroy +l_blpapi_AuthOptions_destroy.restype = None + +l_blpapi_AuthToken_create = libblpapict.blpapi_AuthToken_create # int +l_blpapi_AuthToken_destroy = libblpapict.blpapi_AuthToken_destroy +l_blpapi_AuthToken_destroy.restype = None + +l_blpapi_AuthUser_createWithActiveDirectoryProperty = ( + libblpapict.blpapi_AuthUser_createWithActiveDirectoryProperty +) # int +l_blpapi_AuthUser_createWithLogonName = ( + libblpapict.blpapi_AuthUser_createWithLogonName +) # int +l_blpapi_AuthUser_createWithManualOptions = ( + libblpapict.blpapi_AuthUser_createWithManualOptions +) # int +l_blpapi_AuthUser_destroy = libblpapict.blpapi_AuthUser_destroy +l_blpapi_AuthUser_destroy.restype = None + +l_blpapi_Constant_datatype = libblpapict.blpapi_Constant_datatype # int +l_blpapi_Constant_description = libblpapict.blpapi_Constant_description +l_blpapi_Constant_description.restype = c_char_p +l_blpapi_Constant_getValueAsChar = ( + libblpapict.blpapi_Constant_getValueAsChar +) # int +l_blpapi_Constant_getValueAsDatetime = ( + libblpapict.blpapi_Constant_getValueAsDatetime +) # int +l_blpapi_Constant_getValueAsFloat32 = ( + libblpapict.blpapi_Constant_getValueAsFloat32 +) # int +l_blpapi_Constant_getValueAsFloat64 = ( + libblpapict.blpapi_Constant_getValueAsFloat64 +) # int +l_blpapi_Constant_getValueAsInt32 = ( + libblpapict.blpapi_Constant_getValueAsInt32 +) # int +l_blpapi_Constant_getValueAsInt64 = ( + libblpapict.blpapi_Constant_getValueAsInt64 +) # int +l_blpapi_Constant_getValueAsString = ( + libblpapict.blpapi_Constant_getValueAsString +) # int +l_blpapi_Constant_name = libblpapict.blpapi_Constant_name +l_blpapi_Constant_name.restype = c_void_p +l_blpapi_Constant_status = libblpapict.blpapi_Constant_status # int + +l_blpapi_ConstantList_datatype = ( + libblpapict.blpapi_ConstantList_datatype +) # int +l_blpapi_ConstantList_description = libblpapict.blpapi_ConstantList_description +l_blpapi_ConstantList_description.restype = c_char_p +l_blpapi_ConstantList_getConstant = libblpapict.blpapi_ConstantList_getConstant +l_blpapi_ConstantList_getConstant.restype = c_void_p +l_blpapi_ConstantList_getConstantAt = ( + libblpapict.blpapi_ConstantList_getConstantAt +) +l_blpapi_ConstantList_getConstantAt.restype = c_void_p +l_blpapi_ConstantList_name = libblpapict.blpapi_ConstantList_name +l_blpapi_ConstantList_name.restype = c_void_p +l_blpapi_ConstantList_numConstants = ( + libblpapict.blpapi_ConstantList_numConstants +) # int +l_blpapi_ConstantList_status = libblpapict.blpapi_ConstantList_status # int + +l_blpapi_DiagnosticsUtil_memoryInfo = ( + libblpapict.blpapi_DiagnosticsUtil_memoryInfo +) # int + +l_blpapi_Element_appendElement = ( + libblpapict.blpapi_Element_appendElement +) # int +l_blpapi_Element_datatype = libblpapict.blpapi_Element_datatype # int +l_blpapi_Element_definition = libblpapict.blpapi_Element_definition +l_blpapi_Element_definition.restype = c_void_p +l_blpapi_Element_getChoice = libblpapict.blpapi_Element_getChoice # int +l_blpapi_Element_getElement = libblpapict.blpapi_Element_getElement # int +l_blpapi_Element_getElementAt = libblpapict.blpapi_Element_getElementAt # int +l_blpapi_Element_getValueAsBool = ( + libblpapict.blpapi_Element_getValueAsBool +) # int +l_blpapi_Element_getValueAsBytes = ( + libblpapict.blpapi_Element_getValueAsBytes +) # int +l_blpapi_Element_getValueAsChar = ( + libblpapict.blpapi_Element_getValueAsChar +) # int +l_blpapi_Element_getValueAsElement = ( + libblpapict.blpapi_Element_getValueAsElement +) # int +l_blpapi_Element_getValueAsFloat32 = ( + libblpapict.blpapi_Element_getValueAsFloat32 +) # int +l_blpapi_Element_getValueAsFloat64 = ( + libblpapict.blpapi_Element_getValueAsFloat64 +) # int +l_blpapi_Element_getValueAsHighPrecisionDatetime = ( + libblpapict.blpapi_Element_getValueAsHighPrecisionDatetime +) # int +l_blpapi_Element_getValueAsInt32 = ( + libblpapict.blpapi_Element_getValueAsInt32 +) # int +l_blpapi_Element_getValueAsInt64 = ( + libblpapict.blpapi_Element_getValueAsInt64 +) # int +l_blpapi_Element_getValueAsName = ( + libblpapict.blpapi_Element_getValueAsName +) # int +l_blpapi_Element_getValueAsString = ( + libblpapict.blpapi_Element_getValueAsString +) # int +l_blpapi_Element_hasElementEx = libblpapict.blpapi_Element_hasElementEx # int +l_blpapi_Element_isArray = libblpapict.blpapi_Element_isArray # int +l_blpapi_Element_isComplexType = ( + libblpapict.blpapi_Element_isComplexType +) # int +l_blpapi_Element_isNull = libblpapict.blpapi_Element_isNull # int +l_blpapi_Element_isNullValue = libblpapict.blpapi_Element_isNullValue # int +l_blpapi_Element_isReadOnly = libblpapict.blpapi_Element_isReadOnly # int +l_blpapi_Element_name = libblpapict.blpapi_Element_name +l_blpapi_Element_name.restype = c_void_p +l_blpapi_Element_numElements = libblpapict.blpapi_Element_numElements +l_blpapi_Element_numElements.restype = c_size_t +l_blpapi_Element_numValues = libblpapict.blpapi_Element_numValues +l_blpapi_Element_numValues.restype = c_size_t +l_blpapi_Element_print = libblpapict.blpapi_Element_print # int +l_blpapi_Element_setChoice = libblpapict.blpapi_Element_setChoice # int +l_blpapi_Element_setElementBool = ( + libblpapict.blpapi_Element_setElementBool +) # int +l_blpapi_Element_setElementBytes = ( + libblpapict.blpapi_Element_setElementBytes +) # int +l_blpapi_Element_setElementFloat32 = ( + libblpapict.blpapi_Element_setElementFloat32 +) # int +l_blpapi_Element_setElementFloat64 = ( + libblpapict.blpapi_Element_setElementFloat64 +) # int +l_blpapi_Element_setElementFromName = ( + libblpapict.blpapi_Element_setElementFromName +) # int +l_blpapi_Element_setElementHighPrecisionDatetime = ( + libblpapict.blpapi_Element_setElementHighPrecisionDatetime +) # int +l_blpapi_Element_setElementInt32 = ( + libblpapict.blpapi_Element_setElementInt32 +) # int +l_blpapi_Element_setElementInt64 = ( + libblpapict.blpapi_Element_setElementInt64 +) # int +l_blpapi_Element_setElementString = ( + libblpapict.blpapi_Element_setElementString +) # int +l_blpapi_Element_setValueBool = libblpapict.blpapi_Element_setValueBool # int +l_blpapi_Element_setValueBytes = ( + libblpapict.blpapi_Element_setValueBytes +) # int +l_blpapi_Element_setValueFloat32 = ( + libblpapict.blpapi_Element_setValueFloat32 +) # int +l_blpapi_Element_setValueFloat64 = ( + libblpapict.blpapi_Element_setValueFloat64 +) # int +l_blpapi_Element_setValueFromName = ( + libblpapict.blpapi_Element_setValueFromName +) # int +l_blpapi_Element_setValueHighPrecisionDatetime = ( + libblpapict.blpapi_Element_setValueHighPrecisionDatetime +) # int +l_blpapi_Element_setValueInt32 = ( + libblpapict.blpapi_Element_setValueInt32 +) # int +l_blpapi_Element_setValueInt64 = ( + libblpapict.blpapi_Element_setValueInt64 +) # int +l_blpapi_Element_setValueString = ( + libblpapict.blpapi_Element_setValueString +) # int + +l_blpapi_Event_eventType = libblpapict.blpapi_Event_eventType # int +l_blpapi_Event_release = libblpapict.blpapi_Event_release # int + +l_blpapi_EventDispatcher_create = libblpapict.blpapi_EventDispatcher_create +l_blpapi_EventDispatcher_create.restype = c_void_p +l_blpapi_EventDispatcher_destroy = libblpapict.blpapi_EventDispatcher_destroy +l_blpapi_EventDispatcher_destroy.restype = None +l_blpapi_EventDispatcher_start = ( + libblpapict.blpapi_EventDispatcher_start +) # int +l_blpapi_EventDispatcher_stop = libblpapict.blpapi_EventDispatcher_stop # int + +l_blpapi_EventFormatter_appendElement = ( + libblpapict.blpapi_EventFormatter_appendElement +) # int +l_blpapi_EventFormatter_appendFragmentedRecapMessage = ( + libblpapict.blpapi_EventFormatter_appendFragmentedRecapMessage +) # int +l_blpapi_EventFormatter_appendFragmentedRecapMessage.argtypes = [ + c_void_p, + c_char_p, + c_void_p, + c_void_p, + c_void_p, + c_int, +] +l_blpapi_EventFormatter_appendFragmentedRecapMessageSeq = ( + libblpapict.blpapi_EventFormatter_appendFragmentedRecapMessageSeq +) # int +l_blpapi_EventFormatter_appendFragmentedRecapMessageSeq.argtypes = [ + c_void_p, + c_char_p, + c_void_p, + c_void_p, + c_int, + c_uint, +] +l_blpapi_EventFormatter_appendMessage = ( + libblpapict.blpapi_EventFormatter_appendMessage +) # int +l_blpapi_EventFormatter_appendMessageSeq = ( + libblpapict.blpapi_EventFormatter_appendMessageSeq +) # int +l_blpapi_EventFormatter_appendRecapMessage = ( + libblpapict.blpapi_EventFormatter_appendRecapMessage +) # int +l_blpapi_EventFormatter_appendRecapMessageSeq = ( + libblpapict.blpapi_EventFormatter_appendRecapMessageSeq +) # int +l_blpapi_EventFormatter_appendResponse = ( + libblpapict.blpapi_EventFormatter_appendResponse +) # int +l_blpapi_EventFormatter_appendValueBool = ( + libblpapict.blpapi_EventFormatter_appendValueBool +) # int +l_blpapi_EventFormatter_appendValueChar = ( + libblpapict.blpapi_EventFormatter_appendValueChar +) # int +l_blpapi_EventFormatter_appendValueDatetime = ( + libblpapict.blpapi_EventFormatter_appendValueDatetime +) # int +l_blpapi_EventFormatter_appendValueFloat32 = ( + libblpapict.blpapi_EventFormatter_appendValueFloat32 +) # int +l_blpapi_EventFormatter_appendValueFloat64 = ( + libblpapict.blpapi_EventFormatter_appendValueFloat64 +) # int +l_blpapi_EventFormatter_appendValueFromName = ( + libblpapict.blpapi_EventFormatter_appendValueFromName +) # int +l_blpapi_EventFormatter_appendValueInt32 = ( + libblpapict.blpapi_EventFormatter_appendValueInt32 +) # int +l_blpapi_EventFormatter_appendValueInt64 = ( + libblpapict.blpapi_EventFormatter_appendValueInt64 +) # int +l_blpapi_EventFormatter_appendValueString = ( + libblpapict.blpapi_EventFormatter_appendValueString +) # int +l_blpapi_EventFormatter_create = libblpapict.blpapi_EventFormatter_create +l_blpapi_EventFormatter_create.restype = c_void_p +l_blpapi_EventFormatter_destroy = libblpapict.blpapi_EventFormatter_destroy +l_blpapi_EventFormatter_destroy.restype = None +l_blpapi_EventFormatter_popElement = ( + libblpapict.blpapi_EventFormatter_popElement +) # int +l_blpapi_EventFormatter_pushElement = ( + libblpapict.blpapi_EventFormatter_pushElement +) # int +l_blpapi_EventFormatter_setValueBool = ( + libblpapict.blpapi_EventFormatter_setValueBool +) # int +l_blpapi_EventFormatter_setValueBytes = ( + libblpapict.blpapi_EventFormatter_setValueBytes +) # int +l_blpapi_EventFormatter_setValueChar = ( + libblpapict.blpapi_EventFormatter_setValueChar +) # int +l_blpapi_EventFormatter_setValueDatetime = ( + libblpapict.blpapi_EventFormatter_setValueDatetime +) # int +l_blpapi_EventFormatter_setValueFloat32 = ( + libblpapict.blpapi_EventFormatter_setValueFloat32 +) # int +l_blpapi_EventFormatter_setValueFloat64 = ( + libblpapict.blpapi_EventFormatter_setValueFloat64 +) # int +l_blpapi_EventFormatter_setValueFromName = ( + libblpapict.blpapi_EventFormatter_setValueFromName +) # int +l_blpapi_EventFormatter_setValueHighPrecisionDatetime = ( + libblpapict.blpapi_EventFormatter_setValueHighPrecisionDatetime +) # int +l_blpapi_EventFormatter_appendValueHighPrecisionDatetime = ( + libblpapict.blpapi_EventFormatter_appendValueHighPrecisionDatetime +) # int +l_blpapi_EventFormatter_setValueInt32 = ( + libblpapict.blpapi_EventFormatter_setValueInt32 +) # int +l_blpapi_EventFormatter_setValueInt64 = ( + libblpapict.blpapi_EventFormatter_setValueInt64 +) # int +l_blpapi_EventFormatter_setValueNull = ( + libblpapict.blpapi_EventFormatter_setValueNull +) # int +l_blpapi_EventFormatter_setValueString = ( + libblpapict.blpapi_EventFormatter_setValueString +) # int + +l_blpapi_EventQueue_create = libblpapict.blpapi_EventQueue_create +l_blpapi_EventQueue_create.restype = c_void_p +l_blpapi_EventQueue_destroy = libblpapict.blpapi_EventQueue_destroy # int +l_blpapi_EventQueue_nextEvent = libblpapict.blpapi_EventQueue_nextEvent +l_blpapi_EventQueue_nextEvent.restype = c_void_p +l_blpapi_EventQueue_purge = libblpapict.blpapi_EventQueue_purge # int +l_blpapi_EventQueue_tryNextEvent = ( + libblpapict.blpapi_EventQueue_tryNextEvent +) # int + +l_blpapi_HighPrecisionDatetime_fromTimePoint = ( + libblpapict.blpapi_HighPrecisionDatetime_fromTimePoint +) # int + +l_blpapi_HighResolutionClock_now = ( + libblpapict.blpapi_HighResolutionClock_now +) # int + +l_blpapi_Identity_getSeatType = libblpapict.blpapi_Identity_getSeatType # int +l_blpapi_Identity_hasEntitlements = ( + libblpapict.blpapi_Identity_hasEntitlements +) # int +l_blpapi_Identity_isAuthorized = ( + libblpapict.blpapi_Identity_isAuthorized +) # int +l_blpapi_Identity_release = libblpapict.blpapi_Identity_release +l_blpapi_Identity_release.restype = None + +l_blpapi_Logging_logTestMessage = libblpapict.blpapi_Logging_logTestMessage +l_blpapi_Logging_logTestMessage.restype = None +l_blpapi_Logging_registerCallback = ( + libblpapict.blpapi_Logging_registerCallback +) # int + +l_blpapi_MessageFormatter_FormatMessageJson = ( + libblpapict.blpapi_MessageFormatter_FormatMessageJson +) # int +l_blpapi_MessageFormatter_FormatMessageXml = ( + libblpapict.blpapi_MessageFormatter_FormatMessageXml +) # int +l_blpapi_MessageFormatter_appendElement = ( + libblpapict.blpapi_MessageFormatter_appendElement +) # int +l_blpapi_MessageFormatter_appendValueBool = ( + libblpapict.blpapi_MessageFormatter_appendValueBool +) # int +l_blpapi_MessageFormatter_appendValueChar = ( + libblpapict.blpapi_MessageFormatter_appendValueChar +) # int +l_blpapi_MessageFormatter_appendValueDatetime = ( + libblpapict.blpapi_MessageFormatter_appendValueDatetime +) # int +l_blpapi_MessageFormatter_appendValueFloat32 = ( + libblpapict.blpapi_MessageFormatter_appendValueFloat32 +) # int +l_blpapi_MessageFormatter_appendValueFloat64 = ( + libblpapict.blpapi_MessageFormatter_appendValueFloat64 +) # int +l_blpapi_MessageFormatter_appendValueFromName = ( + libblpapict.blpapi_MessageFormatter_appendValueFromName +) # int +l_blpapi_MessageFormatter_appendValueHighPrecisionDatetime = ( + libblpapict.blpapi_MessageFormatter_appendValueHighPrecisionDatetime +) # int +l_blpapi_MessageFormatter_appendValueInt32 = ( + libblpapict.blpapi_MessageFormatter_appendValueInt32 +) # int +l_blpapi_MessageFormatter_appendValueInt64 = ( + libblpapict.blpapi_MessageFormatter_appendValueInt64 +) # int +l_blpapi_MessageFormatter_appendValueString = ( + libblpapict.blpapi_MessageFormatter_appendValueString +) # int +l_blpapi_MessageFormatter_destroy = ( + libblpapict.blpapi_MessageFormatter_destroy +) # int +l_blpapi_MessageFormatter_popElement = ( + libblpapict.blpapi_MessageFormatter_popElement +) # int +l_blpapi_MessageFormatter_pushElement = ( + libblpapict.blpapi_MessageFormatter_pushElement +) # int +l_blpapi_MessageFormatter_setValueBool = ( + libblpapict.blpapi_MessageFormatter_setValueBool +) # int +l_blpapi_MessageFormatter_setValueBytes = ( + libblpapict.blpapi_MessageFormatter_setValueBytes +) # int +l_blpapi_MessageFormatter_setValueChar = ( + libblpapict.blpapi_MessageFormatter_setValueBool +) # int +l_blpapi_MessageFormatter_setValueDatetime = ( + libblpapict.blpapi_MessageFormatter_setValueDatetime +) # int +l_blpapi_MessageFormatter_setValueFloat32 = ( + libblpapict.blpapi_MessageFormatter_setValueFloat32 +) # int +l_blpapi_MessageFormatter_setValueFloat64 = ( + libblpapict.blpapi_MessageFormatter_setValueFloat64 +) # int +l_blpapi_MessageFormatter_setValueFromName = ( + libblpapict.blpapi_MessageFormatter_setValueFromName +) # int +l_blpapi_MessageFormatter_setValueHighPrecisionDatetime = ( + libblpapict.blpapi_MessageFormatter_setValueHighPrecisionDatetime +) # int +l_blpapi_MessageFormatter_setValueInt32 = ( + libblpapict.blpapi_MessageFormatter_setValueInt32 +) # int +l_blpapi_MessageFormatter_setValueInt64 = ( + libblpapict.blpapi_MessageFormatter_setValueInt64 +) # int +l_blpapi_MessageFormatter_setValueNull = ( + libblpapict.blpapi_MessageFormatter_setValueNull +) # int +l_blpapi_MessageFormatter_setValueString = ( + libblpapict.blpapi_MessageFormatter_setValueString +) # int + +l_blpapi_MessageIterator_create = libblpapict.blpapi_MessageIterator_create +l_blpapi_MessageIterator_create.restype = c_void_p +l_blpapi_MessageIterator_destroy = libblpapict.blpapi_MessageIterator_destroy +l_blpapi_MessageIterator_destroy.restype = None +l_blpapi_MessageIterator_next = libblpapict.blpapi_MessageIterator_next # int + +l_blpapi_Message_addRef = libblpapict.blpapi_Message_addRef # int +l_blpapi_Message_correlationId = libblpapict.blpapi_Message_correlationId +l_blpapi_Message_correlationId.restype = CidStruct +l_blpapi_Message_elements = libblpapict.blpapi_Message_elements +l_blpapi_Message_elements.restype = c_void_p +l_blpapi_Message_fragmentType = libblpapict.blpapi_Message_fragmentType # int +l_blpapi_Message_getRequestId = libblpapict.blpapi_Message_getRequestId # int +l_blpapi_Message_messageType = libblpapict.blpapi_Message_messageType +l_blpapi_Message_messageType.restype = c_void_p +l_blpapi_Message_numCorrelationIds = ( + libblpapict.blpapi_Message_numCorrelationIds +) # int +l_blpapi_Message_print = libblpapict.blpapi_Message_print # int +l_blpapi_Message_recapType = libblpapict.blpapi_Message_recapType # int +l_blpapi_Message_release = libblpapict.blpapi_Message_release # int +l_blpapi_Message_service = libblpapict.blpapi_Message_service +l_blpapi_Message_service.restype = c_void_p +l_blpapi_Message_timeReceived = libblpapict.blpapi_Message_timeReceived # int + +l_blpapi_MessageProperties_create = ( + libblpapict.blpapi_MessageProperties_create +) # int +l_blpapi_MessageProperties_destroy = ( + libblpapict.blpapi_MessageProperties_destroy +) +l_blpapi_MessageProperties_destroy.restype = None +l_blpapi_MessageProperties_setCorrelationIds = ( + libblpapict.blpapi_MessageProperties_setCorrelationIds +) # int +l_blpapi_MessageProperties_setRecapType = ( + libblpapict.blpapi_MessageProperties_setRecapType +) # int +l_blpapi_MessageProperties_setRequestId = ( + libblpapict.blpapi_MessageProperties_setRequestId +) # int +l_blpapi_MessageProperties_setService = ( + libblpapict.blpapi_MessageProperties_setService +) # int +l_blpapi_MessageProperties_setTimeReceived = ( + libblpapict.blpapi_MessageProperties_setTimeReceived +) # int + +l_blpapi_Name_create = libblpapict.blpapi_Name_create +l_blpapi_Name_create.restype = c_void_p +l_blpapi_Name_destroy = libblpapict.blpapi_Name_destroy +l_blpapi_Name_destroy.restype = None +l_blpapi_Name_equalsStr = libblpapict.blpapi_Name_equalsStr # int +l_blpapi_Name_findName = libblpapict.blpapi_Name_findName +l_blpapi_Name_findName.restype = c_void_p +l_blpapi_Name_length = libblpapict.blpapi_Name_length +l_blpapi_Name_length.restype = c_size_t +l_blpapi_Name_string = libblpapict.blpapi_Name_string +l_blpapi_Name_string.restype = c_char_p + +l_blpapi_Operation_description = libblpapict.blpapi_Operation_description +l_blpapi_Operation_description.restype = c_char_p +l_blpapi_Operation_name = libblpapict.blpapi_Operation_name +l_blpapi_Operation_name.restype = c_char_p +l_blpapi_Operation_numResponseDefinitions = ( + libblpapict.blpapi_Operation_numResponseDefinitions +) # int +l_blpapi_Operation_requestDefinition = ( + libblpapict.blpapi_Operation_requestDefinition +) # int +l_blpapi_Operation_responseDefinition = ( + libblpapict.blpapi_Operation_responseDefinition +) # int + +l_blpapi_ProviderSession_activateSubServiceCodeRange = ( + libblpapict.blpapi_ProviderSession_activateSubServiceCodeRange +) # int +l_blpapi_ProviderSession_create = libblpapict.blpapi_ProviderSession_create +l_blpapi_ProviderSession_create.restype = c_void_p +l_blpapi_ProviderSession_createTopics = ( + libblpapict.blpapi_ProviderSession_createTopics +) # int +l_blpapi_ProviderSession_createTopicsAsync = ( + libblpapict.blpapi_ProviderSession_createTopicsAsync +) # int +l_blpapi_ProviderSession_createServiceStatusTopic = ( + libblpapict.blpapi_ProviderSession_createServiceStatusTopic +) # int +l_blpapi_ProviderSession_deactivateSubServiceCodeRange = ( + libblpapict.blpapi_ProviderSession_deactivateSubServiceCodeRange +) # int +l_blpapi_ProviderSession_deleteTopics = ( + libblpapict.blpapi_ProviderSession_deleteTopics +) # int +l_blpapi_ProviderSession_deregisterService = ( + libblpapict.blpapi_ProviderSession_deregisterService +) # int +l_blpapi_ProviderSession_destroy = libblpapict.blpapi_ProviderSession_destroy +l_blpapi_ProviderSession_destroy.restype = None +l_blpapi_ProviderSession_flushPublishedEvents = ( + libblpapict.blpapi_ProviderSession_flushPublishedEvents +) # int +l_blpapi_ProviderSession_getAbstractSession = ( + libblpapict.blpapi_ProviderSession_getAbstractSession +) +l_blpapi_ProviderSession_getAbstractSession.restype = c_void_p +l_blpapi_ProviderSession_getTopic = ( + libblpapict.blpapi_ProviderSession_getTopic +) # int +l_blpapi_ProviderSession_nextEvent = ( + libblpapict.blpapi_ProviderSession_nextEvent +) # int +l_blpapi_ProviderSession_publish = ( + libblpapict.blpapi_ProviderSession_publish +) # int +l_blpapi_ProviderSession_registerService = ( + libblpapict.blpapi_ProviderSession_registerService +) # int +l_blpapi_ProviderSession_registerServiceAsync = ( + libblpapict.blpapi_ProviderSession_registerServiceAsync +) # int +l_blpapi_ProviderSession_resolve = ( + libblpapict.blpapi_ProviderSession_resolve +) # int +l_blpapi_ProviderSession_resolveAsync = ( + libblpapict.blpapi_ProviderSession_resolveAsync +) # int +l_blpapi_ProviderSession_sendResponse = ( + libblpapict.blpapi_ProviderSession_sendResponse +) # int +l_blpapi_ProviderSession_start = ( + libblpapict.blpapi_ProviderSession_start +) # int +l_blpapi_ProviderSession_startAsync = ( + libblpapict.blpapi_ProviderSession_startAsync +) # int +l_blpapi_ProviderSession_stop = libblpapict.blpapi_ProviderSession_stop # int +l_blpapi_ProviderSession_stopAsync = ( + libblpapict.blpapi_ProviderSession_stopAsync +) # int +l_blpapi_ProviderSession_terminateSubscriptionsOnTopics = ( + libblpapict.blpapi_ProviderSession_terminateSubscriptionsOnTopics +) # int +l_blpapi_ProviderSession_tryNextEvent = ( + libblpapict.blpapi_ProviderSession_tryNextEvent +) # int + +l_blpapi_RequestTemplate_release = ( + libblpapict.blpapi_RequestTemplate_release +) # int + +l_blpapi_Request_destroy = libblpapict.blpapi_Request_destroy +l_blpapi_Request_destroy.restype = None +l_blpapi_Request_elements = libblpapict.blpapi_Request_elements +l_blpapi_Request_elements.restype = c_void_p +l_blpapi_Request_getRequestId = libblpapict.blpapi_Request_getRequestId # int + +l_blpapi_ResolutionList_extractAttributeFromResolutionSuccess = ( + libblpapict.blpapi_ResolutionList_extractAttributeFromResolutionSuccess +) +l_blpapi_ResolutionList_extractAttributeFromResolutionSuccess.restype = ( + c_void_p +) + +l_blpapi_ResolutionList_create = libblpapict.blpapi_ResolutionList_create +l_blpapi_ResolutionList_create.restype = c_void_p + +l_blpapi_ResolutionList_destroy = libblpapict.blpapi_ResolutionList_destroy +l_blpapi_ResolutionList_destroy.restype = None +l_blpapi_ResolutionList_add = libblpapict.blpapi_ResolutionList_add # int +l_blpapi_ResolutionList_addFromMessage = ( + libblpapict.blpapi_ResolutionList_addFromMessage +) # int +l_blpapi_ResolutionList_addAttribute = ( + libblpapict.blpapi_ResolutionList_addAttribute +) # int +l_blpapi_ResolutionList_correlationIdAt = ( + libblpapict.blpapi_ResolutionList_correlationIdAt +) # int +l_blpapi_ResolutionList_topicString = ( + libblpapict.blpapi_ResolutionList_topicString +) # int +l_blpapi_ResolutionList_topicStringAt = ( + libblpapict.blpapi_ResolutionList_topicStringAt +) # int +l_blpapi_ResolutionList_status = ( + libblpapict.blpapi_ResolutionList_status +) # int +l_blpapi_ResolutionList_statusAt = ( + libblpapict.blpapi_ResolutionList_statusAt +) # int +l_blpapi_ResolutionList_attribute = ( + libblpapict.blpapi_ResolutionList_attribute +) # int +l_blpapi_ResolutionList_attributeAt = ( + libblpapict.blpapi_ResolutionList_attributeAt +) # int +l_blpapi_ResolutionList_message = ( + libblpapict.blpapi_ResolutionList_message +) # int +l_blpapi_ResolutionList_messageAt = ( + libblpapict.blpapi_ResolutionList_messageAt +) # int +l_blpapi_ResolutionList_size = libblpapict.blpapi_ResolutionList_size # int + +l_blpapi_SchemaElementDefinition_description = ( + libblpapict.blpapi_SchemaElementDefinition_description +) +l_blpapi_SchemaElementDefinition_description.restype = c_char_p +l_blpapi_SchemaElementDefinition_getAlternateName = ( + libblpapict.blpapi_SchemaElementDefinition_getAlternateName +) +l_blpapi_SchemaElementDefinition_getAlternateName.restype = c_void_p +l_blpapi_SchemaElementDefinition_name = ( + libblpapict.blpapi_SchemaElementDefinition_name +) +l_blpapi_SchemaElementDefinition_name.restype = c_void_p +l_blpapi_SchemaElementDefinition_print = ( + libblpapict.blpapi_SchemaElementDefinition_print +) # int +l_blpapi_SchemaElementDefinition_status = ( + libblpapict.blpapi_SchemaElementDefinition_status +) # int +l_blpapi_SchemaElementDefinition_type = ( + libblpapict.blpapi_SchemaElementDefinition_type +) +l_blpapi_SchemaElementDefinition_type.restype = c_void_p + +l_blpapi_SchemaTypeDefinition_datatype = ( + libblpapict.blpapi_SchemaTypeDefinition_datatype +) # int +l_blpapi_SchemaTypeDefinition_description = ( + libblpapict.blpapi_SchemaTypeDefinition_description +) +l_blpapi_SchemaTypeDefinition_description.restype = c_char_p +l_blpapi_SchemaTypeDefinition_isComplexType = ( + libblpapict.blpapi_SchemaTypeDefinition_isComplexType +) +l_blpapi_SchemaTypeDefinition_enumeration = ( + libblpapict.blpapi_SchemaTypeDefinition_enumeration +) +l_blpapi_SchemaTypeDefinition_enumeration.restype = c_void_p +l_blpapi_SchemaTypeDefinition_getElementDefinition = ( + libblpapict.blpapi_SchemaTypeDefinition_getElementDefinition +) +l_blpapi_SchemaTypeDefinition_getElementDefinition.restype = c_void_p +l_blpapi_SchemaTypeDefinition_getElementDefinitionAt = ( + libblpapict.blpapi_SchemaTypeDefinition_getElementDefinitionAt +) +l_blpapi_SchemaTypeDefinition_getElementDefinitionAt.restype = c_void_p +l_blpapi_SchemaTypeDefinition_isComplexType = ( + libblpapict.blpapi_SchemaTypeDefinition_isComplexType +) # int +l_blpapi_SchemaTypeDefinition_isEnumerationType = ( + libblpapict.blpapi_SchemaTypeDefinition_isEnumerationType +) # int +l_blpapi_SchemaTypeDefinition_isSimpleType = ( + libblpapict.blpapi_SchemaTypeDefinition_isSimpleType +) # int +l_blpapi_SchemaElementDefinition_maxValues = ( + libblpapict.blpapi_SchemaElementDefinition_maxValues +) +l_blpapi_SchemaElementDefinition_maxValues.restype = c_size_t +l_blpapi_SchemaElementDefinition_minValues = ( + libblpapict.blpapi_SchemaElementDefinition_minValues +) +l_blpapi_SchemaElementDefinition_minValues.restype = c_size_t +l_blpapi_SchemaElementDefinition_numAlternateNames = ( + libblpapict.blpapi_SchemaElementDefinition_numAlternateNames +) +l_blpapi_SchemaElementDefinition_numAlternateNames.restype = c_size_t +l_blpapi_SchemaTypeDefinition_name = ( + libblpapict.blpapi_SchemaTypeDefinition_name +) +l_blpapi_SchemaTypeDefinition_name.restype = c_void_p +l_blpapi_SchemaTypeDefinition_numElementDefinitions = ( + libblpapict.blpapi_SchemaTypeDefinition_numElementDefinitions +) +l_blpapi_SchemaTypeDefinition_numElementDefinitions.restype = c_size_t +l_blpapi_SchemaTypeDefinition_print = ( + libblpapict.blpapi_SchemaTypeDefinition_print +) # int +l_blpapi_SchemaTypeDefinition_status = ( + libblpapict.blpapi_SchemaTypeDefinition_status +) # int + +l_blpapi_Service_addRef = libblpapict.blpapi_Service_addRef # int +l_blpapi_Service_authorizationServiceName = ( + libblpapict.blpapi_Service_authorizationServiceName +) +l_blpapi_Service_authorizationServiceName.restype = c_char_p +l_blpapi_Service_createAdminEvent = ( + libblpapict.blpapi_Service_createAdminEvent +) # int +l_blpapi_Service_createAuthorizationRequest = ( + libblpapict.blpapi_Service_createAuthorizationRequest +) # int +l_blpapi_Service_createPublishEvent = ( + libblpapict.blpapi_Service_createPublishEvent +) # int +l_blpapi_Service_createRequest = ( + libblpapict.blpapi_Service_createRequest +) # int +l_blpapi_Service_createResponseEvent = ( + libblpapict.blpapi_Service_createResponseEvent +) # int +l_blpapi_Service_description = libblpapict.blpapi_Service_description +l_blpapi_Service_description.restype = c_char_p +l_blpapi_Service_getEventDefinition = ( + libblpapict.blpapi_Service_getEventDefinition +) # int +l_blpapi_Service_getEventDefinitionAt = ( + libblpapict.blpapi_Service_getEventDefinitionAt +) # int +l_blpapi_Service_getOperation = libblpapict.blpapi_Service_getOperation # int +l_blpapi_Service_getOperationAt = ( + libblpapict.blpapi_Service_getOperationAt +) # int +l_blpapi_Service_name = libblpapict.blpapi_Service_name +l_blpapi_Service_name.restype = c_char_p +l_blpapi_Service_numEventDefinitions = ( + libblpapict.blpapi_Service_numEventDefinitions +) # int +l_blpapi_Service_numOperations = ( + libblpapict.blpapi_Service_numOperations +) # int +l_blpapi_Service_print = libblpapict.blpapi_Service_print # int +l_blpapi_Service_release = libblpapict.blpapi_Service_release +l_blpapi_Service_release.restype = None + +l_blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange = ( + libblpapict.blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange +) # int +l_blpapi_ServiceRegistrationOptions_create = ( + libblpapict.blpapi_ServiceRegistrationOptions_create +) +l_blpapi_ServiceRegistrationOptions_create.restype = c_void_p +l_blpapi_ServiceRegistrationOptions_destroy = ( + libblpapict.blpapi_ServiceRegistrationOptions_destroy +) +l_blpapi_ServiceRegistrationOptions_destroy.restype = None +l_blpapi_ServiceRegistrationOptions_getGroupId = ( + libblpapict.blpapi_ServiceRegistrationOptions_getGroupId +) # int +l_blpapi_ServiceRegistrationOptions_getGroupId.argtypes = [ + c_void_p, + c_char_p, + POINTER(c_int), +] +l_blpapi_ServiceRegistrationOptions_getServicePriority = ( + libblpapict.blpapi_ServiceRegistrationOptions_getServicePriority +) # int +l_blpapi_ServiceRegistrationOptions_setGroupId = ( + libblpapict.blpapi_ServiceRegistrationOptions_setGroupId +) +l_blpapi_ServiceRegistrationOptions_setGroupId.restype = None +l_blpapi_ServiceRegistrationOptions_getPartsToRegister = ( + libblpapict.blpapi_ServiceRegistrationOptions_getPartsToRegister +) # int +l_blpapi_ServiceRegistrationOptions_setPartsToRegister = ( + libblpapict.blpapi_ServiceRegistrationOptions_setPartsToRegister +) +l_blpapi_ServiceRegistrationOptions_setPartsToRegister.restype = None +l_blpapi_ServiceRegistrationOptions_setServicePriority = ( + libblpapict.blpapi_ServiceRegistrationOptions_setServicePriority +) # int +l_blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges = ( + libblpapict.blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges +) +l_blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges.restype = ( + None +) + +l_blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg = ( + libblpapict.blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg +) # int +l_blpapi_SessionOptions_applicationIdentityKey = ( + libblpapict.blpapi_SessionOptions_applicationIdentityKey +) # int +l_blpapi_SessionOptions_authenticationOptions = ( + libblpapict.blpapi_SessionOptions_authenticationOptions +) +l_blpapi_SessionOptions_authenticationOptions.restype = c_char_p +l_blpapi_SessionOptions_autoRestartOnDisconnection = ( + libblpapict.blpapi_SessionOptions_autoRestartOnDisconnection +) # int +l_blpapi_SessionOptions_bandwidthSaveModeDisabled = ( + libblpapict.blpapi_SessionOptions_bandwidthSaveModeDisabled +) # int +l_blpapi_SessionOptions_clientMode = ( + libblpapict.blpapi_SessionOptions_clientMode +) # int +l_blpapi_SessionOptions_connectTimeout = ( + libblpapict.blpapi_SessionOptions_connectTimeout +) +l_blpapi_SessionOptions_connectTimeout.restype = c_uint32 +l_blpapi_SessionOptions_create = libblpapict.blpapi_SessionOptions_create +l_blpapi_SessionOptions_create.restype = c_void_p +l_blpapi_SessionOptions_defaultKeepAliveInactivityTime = ( + libblpapict.blpapi_SessionOptions_defaultKeepAliveInactivityTime +) # int +l_blpapi_SessionOptions_defaultKeepAliveResponseTimeout = ( + libblpapict.blpapi_SessionOptions_defaultKeepAliveResponseTimeout +) # int +l_blpapi_SessionOptions_defaultServices = ( + libblpapict.blpapi_SessionOptions_defaultServices +) +l_blpapi_SessionOptions_defaultServices.restype = c_char_p +l_blpapi_SessionOptions_defaultSubscriptionService = ( + libblpapict.blpapi_SessionOptions_defaultSubscriptionService +) +l_blpapi_SessionOptions_defaultSubscriptionService.restype = c_char_p +l_blpapi_SessionOptions_defaultTopicPrefix = ( + libblpapict.blpapi_SessionOptions_defaultTopicPrefix +) +l_blpapi_SessionOptions_defaultTopicPrefix.restype = c_char_p +l_blpapi_SessionOptions_destroy = libblpapict.blpapi_SessionOptions_destroy +l_blpapi_SessionOptions_destroy.restype = None +l_blpapi_SessionOptions_flushPublishedEventsTimeout = ( + libblpapict.blpapi_SessionOptions_flushPublishedEventsTimeout +) # int +l_blpapi_SessionOptions_getServerAddressWithProxy = ( + libblpapict.blpapi_SessionOptions_getServerAddressWithProxy +) # int +l_blpapi_SessionOptions_keepAliveEnabled = ( + libblpapict.blpapi_SessionOptions_keepAliveEnabled +) # int +l_blpapi_SessionOptions_maxEventQueueSize = ( + libblpapict.blpapi_SessionOptions_maxEventQueueSize +) +l_blpapi_SessionOptions_maxEventQueueSize.restype = c_size_t +l_blpapi_SessionOptions_maxPendingRequests = ( + libblpapict.blpapi_SessionOptions_maxPendingRequests +) # int +l_blpapi_SessionOptions_numServerAddresses = ( + libblpapict.blpapi_SessionOptions_numServerAddresses +) # int +l_blpapi_SessionOptions_numStartAttempts = ( + libblpapict.blpapi_SessionOptions_numStartAttempts +) # int +l_blpapi_SessionOptions_print = libblpapict.blpapi_SessionOptions_print # int +l_blpapi_SessionOptions_print.argtypes = [ + c_void_p, + c_void_p, + c_void_p, # as py_object it segfaults, we cast in any_printer instead + c_int, + c_int, +] +l_blpapi_SessionOptions_recordSubscriptionDataReceiveTimes = ( + libblpapict.blpapi_SessionOptions_recordSubscriptionDataReceiveTimes +) # int +l_blpapi_SessionOptions_removeServerAddress = ( + libblpapict.blpapi_SessionOptions_removeServerAddress +) # int +l_blpapi_SessionOptions_serverHost = ( + libblpapict.blpapi_SessionOptions_serverHost +) +l_blpapi_SessionOptions_serverHost.restype = c_char_p +l_blpapi_SessionOptions_serverPort = ( + libblpapict.blpapi_SessionOptions_serverPort +) +l_blpapi_SessionOptions_serverPort.restype = c_uint32 +l_blpapi_SessionOptions_serviceCheckTimeout = ( + libblpapict.blpapi_SessionOptions_serviceCheckTimeout +) # int +l_blpapi_SessionOptions_serviceDownloadTimeout = ( + libblpapict.blpapi_SessionOptions_serviceDownloadTimeout +) # int +l_blpapi_SessionOptions_sessionName = ( + libblpapict.blpapi_SessionOptions_sessionName +) # int +l_blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg = ( + libblpapict.blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg +) +l_blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg.restype = None +l_blpapi_SessionOptions_setApplicationIdentityKey = ( + libblpapict.blpapi_SessionOptions_setApplicationIdentityKey +) # int +l_blpapi_SessionOptions_setAuthenticationOptions = ( + libblpapict.blpapi_SessionOptions_setAuthenticationOptions +) +l_blpapi_SessionOptions_setAuthenticationOptions.restype = None +l_blpapi_SessionOptions_setAutoRestartOnDisconnection = ( + libblpapict.blpapi_SessionOptions_setAutoRestartOnDisconnection +) +l_blpapi_SessionOptions_setAutoRestartOnDisconnection.restype = None +l_blpapi_SessionOptions_setBandwidthSaveModeDisabled = ( + libblpapict.blpapi_SessionOptions_setBandwidthSaveModeDisabled +) # int +l_blpapi_SessionOptions_setClientMode = ( + libblpapict.blpapi_SessionOptions_setClientMode +) +l_blpapi_SessionOptions_setClientMode.restype = None +l_blpapi_SessionOptions_setConnectTimeout = ( + libblpapict.blpapi_SessionOptions_setConnectTimeout +) # int +l_blpapi_SessionOptions_setDefaultKeepAliveInactivityTime = ( + libblpapict.blpapi_SessionOptions_setDefaultKeepAliveInactivityTime +) # int +l_blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout = ( + libblpapict.blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout +) # int +l_blpapi_SessionOptions_setDefaultServices = ( + libblpapict.blpapi_SessionOptions_setDefaultServices +) # int +l_blpapi_SessionOptions_setDefaultSubscriptionService = ( + libblpapict.blpapi_SessionOptions_setDefaultSubscriptionService +) # int +l_blpapi_SessionOptions_setDefaultTopicPrefix = ( + libblpapict.blpapi_SessionOptions_setDefaultTopicPrefix +) +l_blpapi_SessionOptions_setDefaultTopicPrefix.restype = None +l_blpapi_SessionOptions_setFlushPublishedEventsTimeout = ( + libblpapict.blpapi_SessionOptions_setFlushPublishedEventsTimeout +) # int +l_blpapi_SessionOptions_setKeepAliveEnabled = ( + libblpapict.blpapi_SessionOptions_setKeepAliveEnabled +) # int +l_blpapi_SessionOptions_setMaxEventQueueSize = ( + libblpapict.blpapi_SessionOptions_setMaxEventQueueSize +) +l_blpapi_SessionOptions_setMaxEventQueueSize.restype = None +l_blpapi_SessionOptions_setMaxPendingRequests = ( + libblpapict.blpapi_SessionOptions_setMaxPendingRequests +) +l_blpapi_SessionOptions_setMaxPendingRequests.restype = None +l_blpapi_SessionOptions_setNumStartAttempts = ( + libblpapict.blpapi_SessionOptions_setNumStartAttempts +) +l_blpapi_SessionOptions_setNumStartAttempts.restype = None +l_blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes = ( + libblpapict.blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes +) +l_blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes.restype = None +l_blpapi_SessionOptions_setServerAddress = ( + libblpapict.blpapi_SessionOptions_setServerAddress +) # int +l_blpapi_SessionOptions_setServerAddressWithProxy = ( + libblpapict.blpapi_SessionOptions_setServerAddressWithProxy +) # int +l_blpapi_SessionOptions_setServerHost = ( + libblpapict.blpapi_SessionOptions_setServerHost +) # int +l_blpapi_SessionOptions_setServerPort = ( + libblpapict.blpapi_SessionOptions_setServerPort +) # int +l_blpapi_SessionOptions_setServiceCheckTimeout = ( + libblpapict.blpapi_SessionOptions_setServiceCheckTimeout +) # int +l_blpapi_SessionOptions_setServiceDownloadTimeout = ( + libblpapict.blpapi_SessionOptions_setServiceDownloadTimeout +) # int +l_blpapi_SessionOptions_setSessionIdentityOptions = ( + libblpapict.blpapi_SessionOptions_setSessionIdentityOptions +) # int +l_blpapi_SessionOptions_setSessionName = ( + libblpapict.blpapi_SessionOptions_setSessionName +) # int +l_blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark = ( + libblpapict.blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark +) # int +l_blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark = ( + libblpapict.blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark +) # int +l_blpapi_SessionOptions_setTlsOptions = ( + libblpapict.blpapi_SessionOptions_setTlsOptions +) +l_blpapi_SessionOptions_setTlsOptions.restype = None +l_blpapi_SessionOptions_slowConsumerWarningHiWaterMark = ( + libblpapict.blpapi_SessionOptions_slowConsumerWarningHiWaterMark +) +l_blpapi_SessionOptions_slowConsumerWarningHiWaterMark.restype = c_float +l_blpapi_SessionOptions_slowConsumerWarningLoWaterMark = ( + libblpapict.blpapi_SessionOptions_slowConsumerWarningLoWaterMark +) +l_blpapi_SessionOptions_slowConsumerWarningLoWaterMark.restype = c_float + +l_blpapi_Session_create = libblpapict.blpapi_Session_create +l_blpapi_Session_create.restype = c_void_p +l_blpapi_Session_createSnapshotRequestTemplate = ( + libblpapict.blpapi_Session_createSnapshotRequestTemplate +) # int +l_blpapi_Session_createSnapshotRequestTemplate.argtypes = [ + c_void_p, + c_void_p, + c_char_p, + c_void_p, + c_void_p, +] +l_blpapi_Session_destroy = libblpapict.blpapi_Session_destroy +l_blpapi_Session_destroy.restype = None +l_blpapi_Session_getAbstractSession = ( + libblpapict.blpapi_Session_getAbstractSession +) +l_blpapi_Session_getAbstractSession.restype = c_void_p +l_blpapi_Session_nextEvent = libblpapict.blpapi_Session_nextEvent # int +l_blpapi_Session_resubscribe = libblpapict.blpapi_Session_resubscribe # int +l_blpapi_Session_resubscribeEx = ( + libblpapict.blpapi_Session_resubscribeEx +) # int +l_blpapi_Session_resubscribeWithId = ( + libblpapict.blpapi_Session_resubscribeWithId +) # int +l_blpapi_Session_resubscribeWithIdEx = ( + libblpapict.blpapi_Session_resubscribeWithIdEx +) # int +l_blpapi_Session_sendRequest = libblpapict.blpapi_Session_sendRequest # int +l_blpapi_Session_sendRequestTemplate = ( + libblpapict.blpapi_Session_sendRequestTemplate +) # int +l_blpapi_Session_setStatusCorrelationId = ( + libblpapict.blpapi_Session_setStatusCorrelationId +) # int +l_blpapi_Session_start = libblpapict.blpapi_Session_start # int +l_blpapi_Session_startAsync = libblpapict.blpapi_Session_startAsync # int +l_blpapi_Session_stop = libblpapict.blpapi_Session_stop # int +l_blpapi_Session_stopAsync = libblpapict.blpapi_Session_stopAsync # int +l_blpapi_Session_subscribe = libblpapict.blpapi_Session_subscribe # int +l_blpapi_Session_subscribeEx = libblpapict.blpapi_Session_subscribeEx # int +l_blpapi_Session_tryNextEvent = libblpapict.blpapi_Session_tryNextEvent # int +l_blpapi_Session_unsubscribe = libblpapict.blpapi_Session_unsubscribe # int + +l_blpapi_Socks5Config_create = libblpapict.blpapi_Socks5Config_create +l_blpapi_Socks5Config_create.restype = c_void_p +l_blpapi_Socks5Config_destroy = libblpapict.blpapi_Socks5Config_destroy +l_blpapi_Socks5Config_destroy.restype = None +l_blpapi_Socks5Config_print = libblpapict.blpapi_Socks5Config_print # int + +l_blpapi_SubscriptionList_add = libblpapict.blpapi_SubscriptionList_add # int +l_blpapi_SubscriptionList_add.argtypes = [ + c_void_p, + c_char_p, + c_void_p, + c_void_p, + c_void_p, + c_size_t, + c_size_t, +] +l_blpapi_SubscriptionList_addResolved = ( + libblpapict.blpapi_SubscriptionList_addResolved +) # int +l_blpapi_SubscriptionList_append = ( + libblpapict.blpapi_SubscriptionList_append +) # int +l_blpapi_SubscriptionList_clear = ( + libblpapict.blpapi_SubscriptionList_clear +) # int +l_blpapi_SubscriptionList_correlationIdAt = ( + libblpapict.blpapi_SubscriptionList_correlationIdAt +) # int +l_blpapi_SubscriptionList_create = libblpapict.blpapi_SubscriptionList_create +l_blpapi_SubscriptionList_create.restype = c_void_p +l_blpapi_SubscriptionList_destroy = libblpapict.blpapi_SubscriptionList_destroy +l_blpapi_SubscriptionList_destroy.restype = None +l_blpapi_SubscriptionList_isResolvedAt = ( + libblpapict.blpapi_SubscriptionList_isResolvedAt +) # int +l_blpapi_SubscriptionList_size = ( + libblpapict.blpapi_SubscriptionList_size +) # int +l_blpapi_SubscriptionList_topicStringAt = ( + libblpapict.blpapi_SubscriptionList_topicStringAt +) # int + +l_blpapi_TestUtil_appendMessage = ( + libblpapict.blpapi_TestUtil_appendMessage +) # int +l_blpapi_TestUtil_createEvent = libblpapict.blpapi_TestUtil_createEvent # int +l_blpapi_TestUtil_createTopic = libblpapict.blpapi_TestUtil_createTopic # int +l_blpapi_TestUtil_deserializeService = ( + libblpapict.blpapi_TestUtil_deserializeService +) # int +l_blpapi_TestUtil_getAdminMessageDefinition = ( + libblpapict.blpapi_TestUtil_getAdminMessageDefinition +) # int +l_blpapi_TestUtil_serializeService = ( + libblpapict.blpapi_TestUtil_serializeService +) # int + +l_blpapi_TlsOptions_createFromBlobs = ( + libblpapict.blpapi_TlsOptions_createFromBlobs +) +l_blpapi_TlsOptions_createFromBlobs.restype = c_void_p +l_blpapi_TlsOptions_createFromFiles = ( + libblpapict.blpapi_TlsOptions_createFromFiles +) +l_blpapi_TlsOptions_createFromFiles.restype = c_void_p +l_blpapi_TlsOptions_destroy = libblpapict.blpapi_TlsOptions_destroy +l_blpapi_TlsOptions_destroy.restype = None +l_blpapi_TlsOptions_setCrlFetchTimeoutMs = ( + libblpapict.blpapi_TlsOptions_setCrlFetchTimeoutMs +) +l_blpapi_TlsOptions_setCrlFetchTimeoutMs.restype = None +l_blpapi_TlsOptions_setTlsHandshakeTimeoutMs = ( + libblpapict.blpapi_TlsOptions_setTlsHandshakeTimeoutMs +) +l_blpapi_TlsOptions_setTlsHandshakeTimeoutMs.restype = None + +l_blpapi_Topic_compare = libblpapict.blpapi_Topic_compare # int +l_blpapi_Topic_destroy = libblpapict.blpapi_Topic_destroy +l_blpapi_Topic_destroy.restype = None +l_blpapi_Topic_isActive = libblpapict.blpapi_Topic_isActive # int +l_blpapi_Topic_service = libblpapict.blpapi_Topic_service +l_blpapi_Topic_service.restype = c_void_p + +l_blpapi_TopicList_add = libblpapict.blpapi_TopicList_add # int +l_blpapi_TopicList_addFromMessage = ( + libblpapict.blpapi_TopicList_addFromMessage +) # int +l_blpapi_TopicList_correlationIdAt = ( + libblpapict.blpapi_TopicList_correlationIdAt +) # int +l_blpapi_TopicList_correlationIdAt.argtypes = [c_void_p, c_void_p, c_size_t] +l_blpapi_TopicList_create = libblpapict.blpapi_TopicList_create +l_blpapi_TopicList_create.restype = c_void_p +l_blpapi_TopicList_destroy = libblpapict.blpapi_TopicList_destroy +l_blpapi_TopicList_destroy.restype = None +l_blpapi_TopicList_message = libblpapict.blpapi_TopicList_message # int +l_blpapi_TopicList_messageAt = libblpapict.blpapi_TopicList_messageAt # int +l_blpapi_TopicList_size = libblpapict.blpapi_TopicList_size # int +l_blpapi_TopicList_status = libblpapict.blpapi_TopicList_status # int +l_blpapi_TopicList_statusAt = libblpapict.blpapi_TopicList_statusAt # int +l_blpapi_TopicList_topicString = ( + libblpapict.blpapi_TopicList_topicString +) # int +l_blpapi_TopicList_topicStringAt = ( + libblpapict.blpapi_TopicList_topicStringAt +) # int + +l_blpapi_ZfpUtil_getOptionsForLeasedLines = ( + libblpapict.blpapi_ZfpUtil_getOptionsForLeasedLines +) # int + +l_blpapi_getLastErrorDescription = libblpapict.blpapi_getLastErrorDescription +l_blpapi_getLastErrorDescription.restype = c_char_p + +l_blpapi_getVersionInfo = libblpapict.blpapi_getVersionInfo +l_blpapi_getVersionInfo.restype = None +l_blpapi_getVersionInfo.argtypes = [ + POINTER(c_int), + POINTER(c_int), + POINTER(c_int), + POINTER(c_int), +] + + +# signature: int blpapi_AbstractSession_cancel(blpapi_AbstractSession_t *session,const blpapi_CorrelationId_t *correlationIds,size_t numCorrelationIds,const char *requestLabel,int requestLabelLen); +def _blpapi_AbstractSession_cancel(session, correlationIds, requestLabel): + szcids = len(correlationIds) + if szcids > 1: + arraytype = CidStruct * szcids + ptrs = arraytype(*[c.thestruct for c in correlationIds]) + oneptr = pointer(ptrs) + elif szcids == 1: + oneptr = byref(correlationIds[0].thestruct) + else: + oneptr = c_void_p() + + label, sz = charPtrWithSizeFromPyStr(requestLabel) + retCode = l_blpapi_AbstractSession_cancel( + session, + oneptr, + c_size_t(szcids), + label, + sz, # int + ) + return retCode + + +# signature: blpapi_Identity_t *blpapi_AbstractSession_createIdentity(blpapi_AbstractSession_t *session); +def _blpapi_AbstractSession_createIdentity(session): + return getHandleFromPtr(l_blpapi_AbstractSession_createIdentity(session)) + + +# signature: int blpapi_AbstractSession_generateAuthorizedIdentityAsync(blpapi_AbstractSession_t *session,const blpapi_AuthOptions_t *authOptions,blpapi_CorrelationId_t *cid); +def _blpapi_AbstractSession_generateAuthorizedIdentityAsync( + session, authOptions, cid +): + # the C layer will OVERWRITE cid with autogen for unset + cidp = pointer(cid.thestruct) + + return l_blpapi_AbstractSession_generateAuthorizedIdentityAsync( + session, authOptions, cidp + ) + + +# signature: int blpapi_AbstractSession_generateManualToken(blpapi_AbstractSession_t *session,blpapi_CorrelationId_t *correlationId,const char *user,const char *manualIp,blpapi_EventQueue_t *eventQueue); +def _blpapi_AbstractSession_generateManualToken( + session, correlationId, user, manualIp, eventQueue +): + return l_blpapi_AbstractSession_generateManualToken( + session, + byref(correlationId.thestruct), + charPtrFromPyStr(user), + charPtrFromPyStr(manualIp), + eventQueue, + ) + + +# signature: int blpapi_AbstractSession_generateToken(blpapi_AbstractSession_t *session,blpapi_CorrelationId_t *correlationId,blpapi_EventQueue_t *eventQueue); +def _blpapi_AbstractSession_generateToken(session, correlationId, eventQueue): + return l_blpapi_AbstractSession_generateToken( + session, byref(correlationId.thestruct), eventQueue + ) + + +# signature: int blpapi_AbstractSession_getAuthorizedIdentity(blpapi_AbstractSession_t *session,const blpapi_CorrelationId_t *cid,blpapi_Identity_t **identity); +def _blpapi_AbstractSession_getAuthorizedIdentity(session, cid): + out = c_void_p() + outp = pointer(out) + retCode = l_blpapi_AbstractSession_getAuthorizedIdentity( + session, byref(cid.thestruct), outp + ) + return retCode, getHandleFromOutput(outp, retCode) + + +# signature: int blpapi_AbstractSession_getService(blpapi_AbstractSession_t *session,blpapi_Service_t **service,const char *serviceIdentifier); +def _blpapi_AbstractSession_getService(session, serviceIdentifier): + out = c_void_p() + outp = pointer(out) + retCode = l_blpapi_AbstractSession_getService( + session, outp, charPtrFromPyStr(serviceIdentifier) + ) + return retCode, getHandleFromOutput(outp, retCode) + + +# signature: int blpapi_AbstractSession_openService(blpapi_AbstractSession_t *session, const char *serviceIdentifier); +def _blpapi_AbstractSession_openService(session, serviceIdentifier): + return l_blpapi_AbstractSession_openService( + session, charPtrFromPyStr(serviceIdentifier) + ) + + +# signature: int blpapi_AbstractSession_openServiceAsync(blpapi_AbstractSession_t *session,const char *serviceIdentifier,blpapi_CorrelationId_t *correlationId); +def _blpapi_AbstractSession_openServiceAsync( + session, serviceIdentifier, correlationId +): + # the C layer will OVERWRITE cid with autogen for unset + cidp = pointer(correlationId.thestruct) + + return l_blpapi_AbstractSession_openServiceAsync( + session, charPtrFromPyStr(serviceIdentifier), cidp + ) -def topicPtrArray_getitem(ary, index): - return _internals.topicPtrArray_getitem(ary, index) -def topicPtrArray_setitem(ary, index, value): - return _internals.topicPtrArray_setitem(ary, index, value) +# signature: int blpapi_AbstractSession_sendAuthorizationRequest(...) +def _blpapi_AbstractSession_sendAuthorizationRequest( + session, request, identity, correlationId, eventQueue, requestLabel +): + # the C layer will OVERWRITE cid with autogen for unset + cidp = pointer(correlationId.thestruct) -def CorrelationId_t_equals(cid1, cid2): - return _internals.CorrelationId_t_equals(cid1, cid2) -class CorrelationId(object): - r""" - A key used to identify individual subscriptions or requests. + label, sz = charPtrWithSizeFromPyStr(requestLabel) + return l_blpapi_AbstractSession_sendAuthorizationRequest( + session, request, identity, cidp, eventQueue, label, sz # int + ) - Two :class:`CorrelationId` objects are considered equal if they have the same - :meth:`type()` and: - - Hold the same (not just equal!) objects, if the type is :attr:`OBJECT_TYPE`. - - Hold equal integers, if the type is :attr:`INT_TYPE` or :attr:`AUTOGEN_TYPE`. +# signature: int blpapi_AbstractSession_sessionName(blpapi_AbstractSession_t *session,const char **sessionName,size_t *size); +def _blpapi_AbstractSession_sessionName(session): + out = c_char_p() + szout = c_size_t() + outp = pointer(out) + szoutp = pointer(szout) + retCode = l_blpapi_AbstractSession_sessionName(session, outp, szoutp) + return retCode, getSizedStrFromOutput(outp, szoutp, retCode) - If the type is :attr:`UNSET_TYPE`, then the two :class:`CorrelationId` objects - are always equal (as the value of both will necessarily be ``None``). - It is possible that a user constructed :class:`CorrelationId` and a - :class:`CorrelationId` generated by the API could return the same result for - :meth:`value()`. However, they will not compare equal because they have a - different :meth:`type()`. +# signature: int blpapi_AuthApplication_copy(blpapi_AuthApplication_t *lhs, const blpapi_AuthApplication_t *rhs); +def _blpapi_AuthApplication_copy(lhs, rhs): + raise NotImplementedError("not called") - :class:`CorrelationId` objects are passed to many of the :class:`Session` - object methods which initiate asynchronous operations and are obtained from - :class:`Message` objects which are delivered as a result of those asynchronous - operations. - When subscribing or requesting information, an application has the choice of - providing a :class:`CorrelationId` they construct themselves or allowing the - session to construct one for them. If the application supplies a - :class:`CorrelationId`, it must not re-use the value contained in it in another - :class:`CorrelationId`, whilst the original request or subscription is still - active. +# signature: int blpapi_AuthApplication_create(blpapi_AuthApplication_t **app, const char *appName); +def _blpapi_AuthApplication_create(appName): + authapphandle = c_void_p() + outp = pointer(authapphandle) + retCode = l_blpapi_AuthApplication_create(outp, charPtrFromPyStr(appName)) + return retCode, getHandleFromOutput(outp, retCode) - The ``xxx_TYPE`` class attributes represent the possible types of - :class:`CorrelationId`. - """ - thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") - __repr__ = _swig_repr - value = property(_internals.CorrelationId_value_get) +# signature: void blpapi_AuthApplication_destroy(blpapi_AuthApplication_t *app); +def _blpapi_AuthApplication_destroy(app): + l_blpapi_AuthApplication_destroy(app) - UNSET_TYPE = _internals.CORRELATION_TYPE_UNSET - """The :class:`CorrelationId` is unset. That is, it was created by the - default :class:`CorrelationId` constructor.""" - INT_TYPE = _internals.CORRELATION_TYPE_INT - """The :class:`CorrelationId` was created from an :class:`int` or - :class:`long` supplied by the user.""" +# signature: int blpapi_AuthApplication_duplicate(blpapi_AuthApplication_t **app, const blpapi_AuthApplication_t *dup); +def _blpapi_AuthApplication_duplicate(dup): + raise NotImplementedError("not called") - OBJECT_TYPE = _internals.CORRELATION_TYPE_POINTER - """The :class:`CorrelationId` was created from an object supplied by - the user.""" - AUTOGEN_TYPE = _internals.CORRELATION_TYPE_AUTOGEN - """The :class:`CorrelationId` was created internally by API.""" +# signature: int blpapi_AuthOptions_copy(blpapi_AuthOptions_t *lhs, const blpapi_AuthOptions_t *rhs); +def _blpapi_AuthOptions_copy(lhs, rhs): + raise NotImplementedError("not called") - MAX_CLASS_ID = _internals.CORRELATION_MAX_CLASS_ID - """The maximum value allowed for ``classId``.""" - __TYPE_NAMES = { - _internals.CORRELATION_TYPE_UNSET: "UNSET", - _internals.CORRELATION_TYPE_INT: "INTEGER", - _internals.CORRELATION_TYPE_POINTER: "OBJECT", - _internals.CORRELATION_TYPE_AUTOGEN: "AUTOGEN" - } +# signature: int blpapi_AuthOptions_create_default(blpapi_AuthOptions_t **options); +def _blpapi_AuthOptions_create_default(): + out = c_void_p() + outp = pointer(out) + retCode = l_blpapi_AuthOptions_create_default(outp) + return retCode, getHandleFromOutput(outp, retCode) - def __str__(self): - """x.__str__() <==> str(x)""" - valueType = self.type() - valueTypeName = CorrelationId.__TYPE_NAMES[valueType] - if valueType == CorrelationId.UNSET_TYPE: - return valueTypeName - else: - return f"({valueTypeName}: {self.value()!r}, ClassId: {self.classId()})" - - def __hash__(self): - return hash((self.type(), self.classId(), self.__toInteger())) - - def __eq__(self, other): - """x.__eq__(y) <==> x==y""" - try: - return bool(CorrelationId_t_equals(self, other)) - except Exception: - return NotImplemented - - def __ne__(self, other): - """x.__ne__(y) <==> x!=y""" - equal = self.__eq__(other) - return NotImplemented if equal is NotImplemented else not equal - - def value(self): - """ - Returns: - int or long or object: The value of this CorrelationId object. - - The return value depends on this :class:`CorrelationId`'s value - type and could be: - - - Integer (``type() == CorrelationId.INT_TYPE`` - or ``type() == CorrelationId.AUTOGEN_TYPE``) - - Object (``type() == CorrelationId.OBJECT_TYPE``) - - ``None`` (``type() == CorrelationId.UNSET_TYPE``) - """ - valueType = self.type() - if valueType == CorrelationId.INT_TYPE \ - or valueType == CorrelationId.AUTOGEN_TYPE: - return self.__asInteger() - elif valueType == CorrelationId.OBJECT_TYPE: - return self.__asObject() +# signature: int blpapi_AuthOptions_create_forAppMode(blpapi_AuthOptions_t **options, const blpapi_AuthApplication_t *app); +def _blpapi_AuthOptions_create_forAppMode(app): + out = c_void_p() + outp = pointer(out) + retCode = l_blpapi_AuthOptions_create_forAppMode(outp, app) + return retCode, getHandleFromOutput(outp, retCode) + + +# signature: int blpapi_AuthOptions_create_forToken(blpapi_AuthOptions_t **options, const blpapi_AuthToken_t *token); +def _blpapi_AuthOptions_create_forToken(token): + out = c_void_p() + outp = pointer(out) + retCode = l_blpapi_AuthOptions_create_forToken(outp, token) + return retCode, getHandleFromOutput(outp, retCode) + + +# signature: int blpapi_AuthOptions_create_forUserAndAppMode(blpapi_AuthOptions_t **options,const blpapi_AuthUser_t *user,const blpapi_AuthApplication_t *app); +def _blpapi_AuthOptions_create_forUserAndAppMode(user, app): + out = c_void_p() + outp = pointer(out) + retCode = l_blpapi_AuthOptions_create_forUserAndAppMode(outp, user, app) + return retCode, getHandleFromOutput(outp, retCode) + + +# signature: int blpapi_AuthOptions_create_forUserMode(blpapi_AuthOptions_t **options, const blpapi_AuthUser_t *user); +def _blpapi_AuthOptions_create_forUserMode(user): + out = c_void_p() + outp = pointer(out) + retCode = l_blpapi_AuthOptions_create_forUserMode(outp, user) + return retCode, getHandleFromOutput(outp, retCode) + + +# signature: void blpapi_AuthOptions_destroy(blpapi_AuthOptions_t *options); +def _blpapi_AuthOptions_destroy(options): + l_blpapi_AuthOptions_destroy(options) + + +# signature: int blpapi_AuthOptions_duplicate(blpapi_AuthOptions_t **options, const blpapi_AuthOptions_t *dup); +def _blpapi_AuthOptions_duplicate(dup): + raise NotImplementedError("not called") + + +# signature: int blpapi_AuthToken_copy(blpapi_AuthToken_t *lhs, const blpapi_AuthToken_t *rhs); +def _blpapi_AuthToken_copy(lhs, rhs): + raise NotImplementedError("not called") + + +# signature: int blpapi_AuthToken_create(blpapi_AuthToken_t **token, const char *tokenStr); +def _blpapi_AuthToken_create(tokenStr): + out = c_void_p() + outp = pointer(out) + retCode = l_blpapi_AuthToken_create(outp, charPtrFromPyStr(tokenStr)) + return retCode, getHandleFromOutput(outp, retCode) + + +# signature: void blpapi_AuthToken_destroy(blpapi_AuthToken_t *token); +def _blpapi_AuthToken_destroy(token): + l_blpapi_AuthToken_destroy(token) + + +# signature: int blpapi_AuthToken_duplicate(blpapi_AuthToken_t **token, const blpapi_AuthToken_t *dup); +def _blpapi_AuthToken_duplicate(dup): + raise NotImplementedError("not called") + + +# signature: int blpapi_AuthUser_copy(blpapi_AuthUser_t *lhs, const blpapi_AuthUser_t *rhs); +def _blpapi_AuthUser_copy(lhs, rhs): + raise NotImplementedError("not called") + + +# signature: int blpapi_AuthUser_createWithActiveDirectoryProperty(blpapi_AuthUser_t **user, const char *propertyName); +def _blpapi_AuthUser_createWithActiveDirectoryProperty(propertyName): + out = c_void_p() + outp = pointer(out) + retCode = l_blpapi_AuthUser_createWithActiveDirectoryProperty( + outp, charPtrFromPyStr(propertyName) + ) + return retCode, getHandleFromOutput(outp, retCode) + + +# signature: int blpapi_AuthUser_createWithLogonName(blpapi_AuthUser_t **user); +def _blpapi_AuthUser_createWithLogonName(): + out = c_void_p() + outp = pointer(out) + retCode = l_blpapi_AuthUser_createWithLogonName(outp) + return retCode, getHandleFromOutput(outp, retCode) + + +# signature: int blpapi_AuthUser_createWithManualOptions(blpapi_AuthUser_t **user, const char *userId, const char *ipAddress); +def _blpapi_AuthUser_createWithManualOptions(userId, ipAddress): + out = c_void_p() + outp = pointer(out) + retCode = l_blpapi_AuthUser_createWithManualOptions( + outp, charPtrFromPyStr(userId), charPtrFromPyStr(ipAddress) + ) + return retCode, getHandleFromOutput(outp, retCode) + + +# signature: void blpapi_AuthUser_destroy(blpapi_AuthUser_t *user); +def _blpapi_AuthUser_destroy(user): + l_blpapi_AuthUser_destroy(user) + + +# signature: int blpapi_AuthUser_duplicate(blpapi_AuthUser_t **user, const blpapi_AuthUser_t *dup); +def _blpapi_AuthUser_duplicate(dup): + raise NotImplementedError("not called") + + +# signature: int blpapi_ConstantList_datatype(const blpapi_ConstantList_t *constant); +def _blpapi_ConstantList_datatype(constant): + return l_blpapi_ConstantList_datatype(constant) + + +# signature: const char *blpapi_ConstantList_description(const blpapi_ConstantList_t *list); +def _blpapi_ConstantList_description(clist): + assert clist is not None and clist.value is not None + return getStrFromC(l_blpapi_ConstantList_description(clist)) + + +# signature: blpapi_Constant_t *blpapi_ConstantList_getConstant(const blpapi_ConstantList_t *constant,const char *nameString,const blpapi_Name_t *name); +def _blpapi_ConstantList_getConstant(constant, nameString, name): + value = l_blpapi_ConstantList_getConstant( + constant, charPtrFromPyStr(nameString), name + ) + return getHandleFromPtr(value) + + +# signature: blpapi_Constant_t *blpapi_ConstantList_getConstantAt(const blpapi_ConstantList_t *constant, size_t index); +def _blpapi_ConstantList_getConstantAt(constant, index): + return getHandleFromPtr( + l_blpapi_ConstantList_getConstantAt(constant, c_size_t(index)) + ) + + +# signature: +def _blpapi_ConstantList_hasConstant(slist, nameString, name): + constant = _blpapi_ConstantList_getConstant(slist, nameString, name) + return constant is not None and constant.value is not None + + +# signature: blpapi_Name_t *blpapi_ConstantList_name(const blpapi_ConstantList_t *list); +def _blpapi_ConstantList_name(clist): + return getHandleFromPtr(l_blpapi_ConstantList_name(clist)) + + +# signature: int blpapi_ConstantList_numConstants(const blpapi_ConstantList_t *list); +def _blpapi_ConstantList_numConstants(slist): + return l_blpapi_ConstantList_numConstants(slist) + + +# signature: int blpapi_ConstantList_status(const blpapi_ConstantList_t *list); +def _blpapi_ConstantList_status(slist): + return l_blpapi_ConstantList_status(slist) + + +# signature: int blpapi_Constant_datatype(const blpapi_Constant_t *constant); +def _blpapi_Constant_datatype(constant): + return l_blpapi_Constant_datatype(constant) + + +# signature: const char *blpapi_Constant_description(const blpapi_Constant_t *constant); +def _blpapi_Constant_description(constant): + return getStrFromC(l_blpapi_Constant_description(constant)) + + +# signature: int blpapi_Constant_getValueAsChar(const blpapi_Constant_t *constant, blpapi_Char_t *buffer); +def _blpapi_Constant_getValueAsChar(constant): + out = c_char() + outp = pointer(out) + retCode = l_blpapi_Constant_getValueAsChar(constant, outp) + return retCode, getStrFromOutput(outp, retCode) + + +# signature: int blpapi_Constant_getValueAsDatetime(const blpapi_Constant_t *constant, blpapi_Datetime_t *buffer); +def _blpapi_Constant_getValueAsDatetime(constant): + out = BDatetime() + outp = pointer(out) + retCode = l_blpapi_Constant_getValueAsDatetime(constant, outp) + return retCode, out if retCode == 0 else None + + +# signature: int blpapi_Constant_getValueAsFloat32(const blpapi_Constant_t *constant, blpapi_Float32_t *buffer); +def _blpapi_Constant_getValueAsFloat32(constant): + out = c_float() + outp = pointer(out) + retCode = l_blpapi_Constant_getValueAsFloat32(constant, outp) + return retCode, getPODFromOutput(outp, retCode) + + +# signature: int blpapi_Constant_getValueAsFloat64(const blpapi_Constant_t *constant, blpapi_Float64_t *buffer); +def _blpapi_Constant_getValueAsFloat64(constant): + out = c_double() + outp = pointer(out) + retCode = l_blpapi_Constant_getValueAsFloat64(constant, outp) + return retCode, getPODFromOutput(outp, retCode) + + +# signature: int blpapi_Constant_getValueAsInt32(const blpapi_Constant_t *constant, blpapi_Int32_t *buffer); +def _blpapi_Constant_getValueAsInt32(constant): + out = c_int() + outp = pointer(out) + retCode = l_blpapi_Constant_getValueAsInt32(constant, outp) + return retCode, getPODFromOutput(outp, retCode) + + +# signature: int blpapi_Constant_getValueAsInt64(const blpapi_Constant_t *constant, blpapi_Int64_t *buffer); +def _blpapi_Constant_getValueAsInt64(constant): + out = c_int64() + outp = pointer(out) + retCode = l_blpapi_Constant_getValueAsInt64(constant, outp) + return retCode, getPODFromOutput(outp, retCode) + + +# signature: int blpapi_Constant_getValueAsString(const blpapi_Constant_t *constant, const char **buffer); +def _blpapi_Constant_getValueAsString(constant): + out = c_char_p() + outp = pointer(out) + retCode = l_blpapi_Constant_getValueAsString(constant, outp) + return retCode, getStrFromOutput(outp, retCode) + + +# signature: blpapi_Name_t *blpapi_Constant_name(const blpapi_Constant_t *constant); +def _blpapi_Constant_name(constant): + return getHandleFromPtr(l_blpapi_Constant_name(constant)) + + +# signature: int blpapi_Constant_status(const blpapi_Constant_t *constant); +def _blpapi_Constant_status(constant): + return l_blpapi_Constant_status(constant) + + +# signature: +def _blpapi_DiagnosticsUtil_memoryInfo_wrapper(): + outp = c_void_p() + sz = l_blpapi_DiagnosticsUtil_memoryInfo(outp, c_size_t(0)) + if sz < 0: + return None + sz += 1 + outp = create_string_buffer(sz) + sz = l_blpapi_DiagnosticsUtil_memoryInfo(outp, c_size_t(sz)) + return getSizedStrFromBuffer(outp, sz) if sz >= 0 else None + + +# signature: int blpapi_Element_appendElement(blpapi_Element_t *element, blpapi_Element_t **appendedElement); +def _blpapi_Element_appendElement(element): + out = c_void_p() + outp = pointer(out) + retCode = l_blpapi_Element_appendElement(element, outp) + return retCode, getHandleFromOutput(outp, retCode) + + +# signature: int blpapi_Element_datatype(const blpapi_Element_t *element); +def _blpapi_Element_datatype(element): + return l_blpapi_Element_datatype(element) + + +# signature: blpapi_SchemaElementDefinition_t *blpapi_Element_definition(const blpapi_Element_t *element); +def _blpapi_Element_definition(element): + return getHandleFromPtr(l_blpapi_Element_definition(element)) + + +# signature: int blpapi_Element_getChoice(const blpapi_Element_t *element, blpapi_Element_t **result); +def _blpapi_Element_getChoice(element): + out = c_void_p() + outp = pointer(out) + retCode = l_blpapi_Element_getChoice(element, outp) + return retCode, getHandleFromOutput(outp, retCode) + + +# signature: int blpapi_Element_getElementAt(const blpapi_Element_t *element,blpapi_Element_t **result,size_t position); +def _blpapi_Element_getElement(element, nameString, name): + out = c_void_p() + outp = pointer(out) + retCode = l_blpapi_Element_getElement( + element, outp, charPtrFromPyStr(nameString), name + ) + return retCode, getHandleFromOutput(outp, retCode) + + +# signature: int blpapi_Element_getElementAt(const blpapi_Element_t *element,blpapi_Element_t **result,size_t position); +def _blpapi_Element_getElementAt(element, position): + out = c_void_p() + outp = pointer(out) + retCode = l_blpapi_Element_getElementAt(element, outp, position) + return retCode, getHandleFromOutput(outp, retCode) + + +# signature: int blpapi_Element_getValueAsBool(const blpapi_Element_t *element, blpapi_Bool_t *buffer, size_t index); +def _blpapi_Element_getValueAsBool(element, index): + out = c_int() # int as boolean + outp = pointer(out) + retCode = l_blpapi_Element_getValueAsBool(element, outp, c_size_t(index)) + return retCode, getPODFromOutput(outp, retCode) + + +# signature: int blpapi_Element_getValueAsBytes(const blpapi_Element_t *element,const char **buffer,size_t *length,size_t index); +def _blpapi_Element_getValueAsBytes(element, index): + out = c_char_p() + outp = pointer(out) + szout = c_size_t() + szoutp = pointer(szout) + retCode = l_blpapi_Element_getValueAsBytes( + element, outp, szoutp, c_size_t(index) + ) + return retCode, getSizedBytesFromOutput(outp, szoutp, retCode) + + +# signature: int blpapi_Element_getValueAsChar(const blpapi_Element_t *element, blpapi_Char_t *buffer, size_t index); +def _blpapi_Element_getValueAsChar(element, index): + out = c_char() + outp = pointer(out) + retCode = l_blpapi_Element_getValueAsChar(element, outp, c_size_t(index)) + return retCode, getStrFromOutput(outp, retCode) + + +# signature: int blpapi_Element_getValueAsDatetime(const blpapi_Element_t *element,blpapi_Datetime_t *buffer,size_t index); +def _blpapi_Element_getValueAsDatetime(element, index): + raise NotImplementedError("not called") + + +# signature: int blpapi_Element_getValueAsElement(const blpapi_Element_t *element,blpapi_Element_t **buffer,size_t index); +def _blpapi_Element_getValueAsElement(element, index): + out = c_void_p() + outp = pointer(out) + retCode = l_blpapi_Element_getValueAsElement( + element, outp, c_size_t(index) + ) + return retCode, getHandleFromOutput(outp, retCode) + + +# signature: int blpapi_Element_getValueAsFloat64(const blpapi_Element_t *element,blpapi_Float64_t *buffer,size_t index); +def _blpapi_Element_getValueAsFloat64(element, index): + out = c_double() + outp = pointer(out) + retCode = l_blpapi_Element_getValueAsFloat64( + element, outp, c_size_t(index) + ) + return retCode, getPODFromOutput(outp, retCode) + + +# signature: int blpapi_Element_getValueAsHighPrecisionDatetime(const blpapi_Element_t *element,blpapi_HighPrecisionDatetime_t *buffer,size_t index); +def _blpapi_Element_getValueAsHighPrecisionDatetime(element, index): + out = HighPrecisionDatetime() + outp = pointer(out) + retCode = l_blpapi_Element_getValueAsHighPrecisionDatetime( + element, outp, c_size_t(index) + ) + return retCode, getStructFromOutput(outp, retCode) + + +# signature: int blpapi_Element_getValueAsInt32(const blpapi_Element_t *element, blpapi_Int32_t *buffer, size_t index); +def _blpapi_Element_getValueAsInt32(element, index): + out = c_int() + outp = pointer(out) + retCode = l_blpapi_Element_getValueAsInt32(element, outp, c_size_t(index)) + return retCode, getPODFromOutput(outp, retCode) + + +# signature: int blpapi_Element_getValueAsInt64(const blpapi_Element_t *element, blpapi_Int64_t *buffer, size_t index); +def _blpapi_Element_getValueAsInt64(element, index): + out = c_int64() + outp = pointer(out) + retCode = l_blpapi_Element_getValueAsInt64(element, outp, c_size_t(index)) + return retCode, getPODFromOutput(outp, retCode) + + +# signature: int blpapi_Element_getValueAsName(const blpapi_Element_t *element, blpapi_Name_t **buffer, size_t index); +def _blpapi_Element_getValueAsName(element, index): + out = c_void_p() + outp = pointer(out) + retCode = l_blpapi_Element_getValueAsName(element, outp, c_size_t(index)) + return retCode, getHandleFromOutput(outp, retCode) + + +# signature: int blpapi_Element_getValueAsString(const blpapi_Element_t *element, const char **buffer, size_t index); +def _blpapi_Element_getValueAsString(element, index): + out = c_char_p() + outp = pointer(out) + retCode = l_blpapi_Element_getValueAsString(element, outp, c_size_t(index)) + return retCode, getStrFromOutput(outp, retCode) + + +# signature: int blpapi_Element_hasElementEx(const blpapi_Element_t *element,const char *nameString,const blpapi_Name_t *name,int excludeNullElements,int reserved); +def _blpapi_Element_hasElementEx( + element, nameString, name, excludeNullElements, reserved +): + return l_blpapi_Element_hasElementEx( + element, + charPtrFromPyStr(nameString), + name, + excludeNullElements, + reserved, + ) + + +# signature: int blpapi_Element_isArray(const blpapi_Element_t *element); +def _blpapi_Element_isArray(element): + return l_blpapi_Element_isArray(element) + + +# signature: int blpapi_Element_isComplexType(const blpapi_Element_t *element); +def _blpapi_Element_isComplexType(element): + return l_blpapi_Element_isComplexType(element) + + +# signature: int blpapi_Element_isNullValue(const blpapi_Element_t *element, size_t position); +def _blpapi_Element_isNull(element): + return l_blpapi_Element_isNull(element) + + +# signature: int blpapi_Element_isNullValue(const blpapi_Element_t *element, size_t position); +def _blpapi_Element_isNullValue(element, position): + return l_blpapi_Element_isNullValue(element, position) + + +# signature: int blpapi_Element_isReadOnly(const blpapi_Element_t *element); +def _blpapi_Element_isReadOnly(element): + return l_blpapi_Element_isReadOnly(element) + + +# signature: blpapi_Name_t *blpapi_Element_name(const blpapi_Element_t *element); +def _blpapi_Element_name(element): + return getHandleFromPtr(l_blpapi_Element_name(element)) + + +# signature: const char *blpapi_Element_nameString(const blpapi_Element_t *element); +def _blpapi_Element_nameString(element): + raise NotImplementedError("not called") + + +# signature: size_t blpapi_Element_numElements(const blpapi_Element_t *element); +def _blpapi_Element_numElements(element): + return l_blpapi_Element_numElements(element) + + +# signature: size_t blpapi_Element_numValues(const blpapi_Element_t *element); +def _blpapi_Element_numValues(element): + return l_blpapi_Element_numValues(element) + + +# signature: +def _blpapi_Element_printHelper(element, level, spacesPerLevel): + return any_printer(element, l_blpapi_Element_print, level, spacesPerLevel) + + +# signature: int blpapi_Element_setChoice(blpapi_Element_t *element,blpapi_Element_t **resultElement,const char *nameCstr,const blpapi_Name_t *name,size_t index); +def _blpapi_Element_setChoice(element, nameCstr, name, index): + out = c_void_p() + outp = pointer(out) + retCode = l_blpapi_Element_setChoice( + element, outp, charPtrFromPyStr(nameCstr), name, c_size_t(index) + ) + return retCode, getHandleFromOutput(outp, retCode) + + +# signature: int blpapi_Element_setElementBool(blpapi_Element_t *element,const char *nameString,const blpapi_Name_t *name,blpapi_Bool_t value); +def _blpapi_Element_setElementBool(element, nameString, name, value): + return l_blpapi_Element_setElementBool( + element, charPtrFromPyStr(nameString), name, c_int(value) + ) + + +# signature: int blpapi_Element_setElementBytes(blpapi_Element_t *element,const char *nameString,const blpapi_Name_t *name,const char *value,size_t length); +def _blpapi_Element_setElementBytes(element, nameString, name, value): + valuePtr, sz = charPtrWithSizeFromPyStr(value) + return l_blpapi_Element_setElementBytes( + element, charPtrFromPyStr(nameString), name, valuePtr, c_size_t(sz) + ) + + +# signature: int blpapi_Element_setElementFloat32(blpapi_Element_t *element,const char *nameString,const blpapi_Name_t *name,blpapi_Float32_t value); +def _blpapi_Element_setElementFloat(element, nameString, name, value): + # The C interface will not silently discard precision to store a 64-bit + # float in a field whose schema type is 32-bit, however all Python floats + # are 64-bit, so we explicitly allow narrowing to 32 bits if necessary. + + retCode, field = _blpapi_Element_getElement(element, nameString, name) + if retCode == 0 and (field is not None and field.value is not None): + # Able to get field, consider its datatype + if l_blpapi_Element_datatype(field) == DATATYPE_FLOAT32: + retCode = l_blpapi_Element_setElementFloat32( + element, charPtrFromPyStr(nameString), name, c_float(value) + ) else: - return None + retCode = l_blpapi_Element_setElementFloat64( + element, charPtrFromPyStr(nameString), name, c_double(value) + ) + return retCode + + # Unable to get field. Try to set element anyway + retCode = l_blpapi_Element_setElementFloat64( + element, charPtrFromPyStr(nameString), name, c_double(value) + ) + if retCode: + retCode = l_blpapi_Element_setElementFloat32( + element, charPtrFromPyStr(nameString), name, c_float(value) + ) + return retCode + + +# signature: int blpapi_Element_setElementFromName(blpapi_Element_t *element,const char *elementName,const blpapi_Name_t *name,const blpapi_Name_t *buffer); +def _blpapi_Element_setElementFromName(element, elementName, name, buffer): + return l_blpapi_Element_setElementFromName( + element, charPtrFromPyStr(elementName), name, buffer + ) + + +# signature: int blpapi_Element_setElementHighPrecisionDatetime(blpapi_Element_t *element,const char *nameString,const blpapi_Name_t *name,const blpapi_HighPrecisionDatetime_t *value); +def _blpapi_Element_setElementHighPrecisionDatetime( + element, nameString, name, value +): + return l_blpapi_Element_setElementHighPrecisionDatetime( + element, charPtrFromPyStr(nameString), name, byref(value) + ) + + +# signature: int blpapi_Element_setElementInt32(blpapi_Element_t *element,const char *nameString,const blpapi_Name_t *name,blpapi_Int32_t value); +def _blpapi_Element_setElementInt32(element, nameString, name, value): + return l_blpapi_Element_setElementInt32( + element, charPtrFromPyStr(nameString), name, c_int(value) + ) + + +# signature: int blpapi_Element_setElementInt64(blpapi_Element_t *element,const char *nameString,const blpapi_Name_t *name,blpapi_Int64_t value); +def _blpapi_Element_setElementInt64(element, nameString, name, value): + return l_blpapi_Element_setElementInt64( + element, charPtrFromPyStr(nameString), name, c_int64(value) + ) + + +# signature: int blpapi_Element_setElementString(blpapi_Element_t *element,const char *nameString,const blpapi_Name_t *name,const char *value); +def _blpapi_Element_setElementString(element, nameString, name, value): + return l_blpapi_Element_setElementString( + element, charPtrFromPyStr(nameString), name, charPtrFromPyStr(value) + ) + + +# signature: int blpapi_Element_setValueBool(blpapi_Element_t *element, blpapi_Bool_t value, size_t index); +def _blpapi_Element_setValueBool(element, value, index): + return l_blpapi_Element_setValueBool( + element, c_int(value), c_size_t(index) + ) + + +# signature: int blpapi_Element_setValueBytes(blpapi_Element_t *element,const char *value,size_t length,size_t index); +def _blpapi_Element_setValueBytes(element, value, index): + valuePtr, sz = charPtrWithSizeFromPyStr(value) + return l_blpapi_Element_setValueBytes( + element, valuePtr, c_size_t(sz), c_size_t(index) + ) + + +# signature: int blpapi_Element_setValueFloat32(blpapi_Element_t *element, blpapi_Float32_t value, size_t index); +def _blpapi_Element_setValueFloat(element, value, index): + # The C interface will not silently discard precision to store a 64-bit + # float in a field whose schema type is 32-bit, however all Python floats + # are 64-bit, so we explicitly allow narrowing to 32 bits if necessary. + + # Consider field datatype + if l_blpapi_Element_datatype(element) == DATATYPE_FLOAT32: + retCode = l_blpapi_Element_setValueFloat32( + element, c_float(value), c_size_t(index) + ) + else: + retCode = l_blpapi_Element_setValueFloat64( + element, c_double(value), c_size_t(index) + ) + return retCode + + +# signature: int blpapi_Element_setValueFromName(blpapi_Element_t *element, const blpapi_Name_t *value, size_t index); +def _blpapi_Element_setValueFromName(element, value, index): + return l_blpapi_Element_setValueFromName(element, value, c_size_t(index)) + + +# signature: int blpapi_Element_setValueHighPrecisionDatetime(blpapi_Element_t *element,const blpapi_HighPrecisionDatetime_t *value,size_t index); +def _blpapi_Element_setValueHighPrecisionDatetime(element, value, index): + return l_blpapi_Element_setValueHighPrecisionDatetime( + element, byref(value), c_size_t(index) + ) + + +# signature: int blpapi_Element_setValueInt32(blpapi_Element_t *element, blpapi_Int32_t value, size_t index); +def _blpapi_Element_setValueInt32(element, value, index): + return l_blpapi_Element_setValueInt32( + element, c_int(value), c_size_t(index) + ) + + +# signature: int blpapi_Element_setValueInt64(blpapi_Element_t *element, blpapi_Int64_t value, size_t index); +def _blpapi_Element_setValueInt64(element, value, index): + return l_blpapi_Element_setValueInt64( + element, c_int64(value), c_size_t(index) + ) + + +# signature: int blpapi_Element_setValueString(blpapi_Element_t *element, const char *value, size_t index); +def _blpapi_Element_setValueString(element, value, index): + return l_blpapi_Element_setValueString( + element, charPtrFromPyStr(value), c_size_t(index) + ) + + +# signature: +def _blpapi_Element_toPy(element): + return libffastcalls.blpapi_Element_toPy(element) + + +# signature: blpapi_EventDispatcher_t *blpapi_EventDispatcher_create(size_t numDispatcherThreads); +def _blpapi_EventDispatcher_create(numDispatcherThreads): + return getHandleFromPtr( + l_blpapi_EventDispatcher_create(c_size_t(numDispatcherThreads)) + ) - def _handle(self): - return self +# signature: void blpapi_EventDispatcher_destroy(blpapi_EventDispatcher_t *handle); +def _blpapi_EventDispatcher_destroy(handle): + l_blpapi_EventDispatcher_destroy(handle) + + +# signature: int blpapi_EventDispatcher_start(blpapi_EventDispatcher_t *handle); +def _blpapi_EventDispatcher_start(handle): + return l_blpapi_EventDispatcher_start(handle) + + +# signature: int blpapi_EventDispatcher_stop(blpapi_EventDispatcher_t *handle, int async); +def _blpapi_EventDispatcher_stop(handle, asynch): + return l_blpapi_EventDispatcher_stop(handle, c_int(asynch)) - def __init__(self, *args): - r""" - ``CorrelationId([value[, classId=0]])`` constructs a :class:`CorrelationId` - object. - If ``value`` is an integer (either :class:`int` or :class:`long`) then the - created :class:`CorrelationId` will have type :attr:`INT_TYPE`. Otherwise, it - will have type :attr:`OBJECT_TYPE`. +# signature: int blpapi_EventFormatter_appendElement(blpapi_EventFormatter_t *formatter); +def _blpapi_EventFormatter_appendElement(formatter): + return l_blpapi_EventFormatter_appendElement(formatter) - If no arguments are specified, then the type will be :attr:`UNSET_TYPE`. - The maximum allowed ``classId`` value is :attr:`MAX_CLASS_ID`. - """ - _internals.CorrelationId_swiginit(self, _internals.new_CorrelationId(*args)) - __swig_destroy__ = _internals.delete_CorrelationId +# signature: int blpapi_EventFormatter_appendFragmentedRecapMessage(blpapi_EventFormatter_t *formatter,const char *typeString,blpapi_Name_t *typeName,const blpapi_Topic_t *topic,const blpapi_CorrelationId_t *cid,int fragmentType); +def _blpapi_EventFormatter_appendFragmentedRecapMessage( + formatter, typeString, typeName, topic, cid, fragmentType +): + return l_blpapi_EventFormatter_appendFragmentedRecapMessage( + formatter, + charPtrFromPyStr(typeString), + typeName, + topic, + byref(cid.thestruct) if cid is not None else None, + fragmentType, + ) - def type(self): - r""" - Returns: - int: The type of this CorrelationId object (see the ``xxx_TYPE`` class - attributes) - """ - return _internals.CorrelationId_type(self) - def classId(self): - r""" - Returns: - int: The user defined classification of this :class:`CorrelationId` - object - """ - return _internals.CorrelationId_classId(self) +# signature: int blpapi_EventFormatter_appendFragmentedRecapMessageSeq(blpapi_EventFormatter_t *formatter,const char *typeString,blpapi_Name_t *typeName,const blpapi_Topic_t *topic,int fragmentType,unsigned int sequenceNumber); +def _blpapi_EventFormatter_appendFragmentedRecapMessageSeq( + formatter, typeString, typeName, topic, fragmentType, sequenceNumber +): + return l_blpapi_EventFormatter_appendFragmentedRecapMessageSeq( + formatter, + charPtrFromPyStr(typeString), + typeName, + topic, + fragmentType, + c_uint32(sequenceNumber), + ) - def __asObject(self): - return _internals.CorrelationId___asObject(self) - def __asInteger(self): - return _internals.CorrelationId___asInteger(self) +# signature: int blpapi_EventFormatter_appendMessage(blpapi_EventFormatter_t *formatter,const char *typeString,blpapi_Name_t *typeName,const blpapi_Topic_t *topic); +def _blpapi_EventFormatter_appendMessage( + formatter, typeString, typeName, topic +): + return l_blpapi_EventFormatter_appendMessage( + formatter, charPtrFromPyStr(typeString), typeName, topic + ) - def __toInteger(self): - return _internals.CorrelationId___toInteger(self) -# Register CorrelationId in _internals: -_internals.CorrelationId_swigregister(CorrelationId) +# signature: int blpapi_EventFormatter_appendMessageSeq(blpapi_EventFormatter_t *formatter,const char *typeString,blpapi_Name_t *typeName,const blpapi_Topic_t *topic,unsigned int sequenceNumber,unsigned int); +def _blpapi_EventFormatter_appendMessageSeq( + formatter, typeString, typeName, topic, sequenceNumber, aUIntArg +): + return l_blpapi_EventFormatter_appendMessageSeq( + formatter, + charPtrFromPyStr(typeString), + typeName, + topic, + c_uint32(sequenceNumber), + c_uint(aUIntArg), + ) -class blpapi_CorrelationId_t__value(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): - _internals.blpapi_CorrelationId_t__value_swiginit(self, _internals.new_blpapi_CorrelationId_t__value()) - __swig_destroy__ = _internals.delete_blpapi_CorrelationId_t__value +# signature: int blpapi_EventFormatter_appendRecapMessage(blpapi_EventFormatter_t *formatter,const blpapi_Topic_t *topic,const blpapi_CorrelationId_t *cid); +def _blpapi_EventFormatter_appendRecapMessage(formatter, topic, cid): + return l_blpapi_EventFormatter_appendRecapMessage( + formatter, + topic, + byref(cid.thestruct) if cid is not None else None, + ) -# Register blpapi_CorrelationId_t__value in _internals: -_internals.blpapi_CorrelationId_t__value_swigregister(blpapi_CorrelationId_t__value) +# signature: int blpapi_EventFormatter_appendRecapMessageSeq(blpapi_EventFormatter_t *formatter,const blpapi_Topic_t *topic,const blpapi_CorrelationId_t *cid,unsigned int sequenceNumber,unsigned int); +def _blpapi_EventFormatter_appendRecapMessageSeq( + formatter, topic, cid, sequenceNumber, aUIntArg +): + return l_blpapi_EventFormatter_appendRecapMessageSeq( + formatter, + topic, + byref(cid.thestruct) if cid is not None else None, + c_uint32(sequenceNumber), + c_uint(aUIntArg), + ) -def blpapi_Element_toPy(element): - return _internals.blpapi_Element_toPy(element) -def blpapi_Element_setElementFloat(element, nameString, name, value): - return _internals.blpapi_Element_setElementFloat(element, nameString, name, value) +# signature: int blpapi_EventFormatter_appendResponse(blpapi_EventFormatter_t *formatter,const char *typeString,blpapi_Name_t *typeName); +def _blpapi_EventFormatter_appendResponse(formatter, typeString, typeName): + return l_blpapi_EventFormatter_appendResponse( + formatter, charPtrFromPyStr(typeString), typeName + ) -def blpapi_Element_setValueFloat(element, value, index): - return _internals.blpapi_Element_setValueFloat(element, value, index) -def blpapi_Element_printHelper(element, level, spacesPerLevel): - return _internals.blpapi_Element_printHelper(element, level, spacesPerLevel) +# signature: int blpapi_EventFormatter_appendValueBool(blpapi_EventFormatter_t *formatter, blpapi_Bool_t value); +def _blpapi_EventFormatter_appendValueBool(formatter, value): + return l_blpapi_EventFormatter_appendValueBool( + formatter, c_int(value) + ) # int as boolean + + +# signature: int blpapi_EventFormatter_appendValueChar(blpapi_EventFormatter_t *formatter, char value); +def _blpapi_EventFormatter_appendValueChar(formatter, value): + return l_blpapi_EventFormatter_appendValueChar(formatter, c_char(value)) + + +# signature: int blpapi_EventFormatter_appendValueFloat32(blpapi_EventFormatter_t *formatter, blpapi_Float32_t value); +def _blpapi_EventFormatter_appendValueFloat(formatter, value): + # The C interface will not silently discard precision to store a 64-bit + # float in a field whose schema type is 32-bit, however all Python floats + # are 64-bit, so we explicitly allow narrowing to 32 bits if necessary. + + retCode = l_blpapi_EventFormatter_appendValueFloat64( + formatter, c_double(value) + ) + if retCode: + retCode = l_blpapi_EventFormatter_appendValueFloat32( + formatter, c_float(value) + ) + return retCode + + +# signature: int blpapi_EventFormatter_appendValueFromName(blpapi_EventFormatter_t *formatter, const blpapi_Name_t *value); +def _blpapi_EventFormatter_appendValueFromName(formatter, value): + return l_blpapi_EventFormatter_appendValueFromName(formatter, value) + + +# signature: int blpapi_EventFormatter_appendValueHighPrecisionDatetime(blpapi_EventFormatter_t *formatter,const blpapi_HighPrecisionDatetime_t *value); +def _blpapi_EventFormatter_appendValueHighPrecisionDatetime(formatter, value): + return l_blpapi_EventFormatter_appendValueHighPrecisionDatetime( + formatter, byref(value) + ) + + +# signature: int blpapi_EventFormatter_appendValueInt32(blpapi_EventFormatter_t *formatter, blpapi_Int32_t value); +def _blpapi_EventFormatter_appendValueInt32(formatter, value): + return l_blpapi_EventFormatter_appendValueInt32(formatter, c_int(value)) + + +# signature: int blpapi_EventFormatter_appendValueInt64(blpapi_EventFormatter_t *formatter, blpapi_Int64_t value); +def _blpapi_EventFormatter_appendValueInt64(formatter, value): + return l_blpapi_EventFormatter_appendValueInt64(formatter, c_int64(value)) + + +# signature: int blpapi_EventFormatter_appendValueString(blpapi_EventFormatter_t *formatter, const char *value); +def _blpapi_EventFormatter_appendValueString(formatter, value): + return l_blpapi_EventFormatter_appendValueString( + formatter, charPtrFromPyStr(value) + ) + + +# signature: blpapi_EventFormatter_t *blpapi_EventFormatter_create(blpapi_Event_t *event); +def _blpapi_EventFormatter_create(event): + return getHandleFromPtr(l_blpapi_EventFormatter_create(event)) + + +# signature: void blpapi_EventFormatter_destroy(blpapi_EventFormatter_t *victim); +def _blpapi_EventFormatter_destroy(victim): + l_blpapi_EventFormatter_destroy(victim) + + +# signature: int blpapi_EventFormatter_popElement(blpapi_EventFormatter_t *formatter); +def _blpapi_EventFormatter_popElement(formatter): + return l_blpapi_EventFormatter_popElement(formatter) + + +# signature: int blpapi_EventFormatter_pushElement(blpapi_EventFormatter_t *formatter,const char *typeString,const blpapi_Name_t *typeName); +def _blpapi_EventFormatter_pushElement(formatter, typeString, typeName): + return l_blpapi_EventFormatter_pushElement( + formatter, charPtrFromPyStr(typeString), typeName + ) -def blpapi_Element_name(element): - return _internals.blpapi_Element_name(element) -def blpapi_Element_nameString(element): - return _internals.blpapi_Element_nameString(element) +# signature: int blpapi_EventFormatter_setValueBool(blpapi_EventFormatter_t *formatter,const char *typeString,const blpapi_Name_t *typeName,blpapi_Bool_t value); +def _blpapi_EventFormatter_setValueBool( + formatter, typeString, typeName, value +): + return l_blpapi_EventFormatter_setValueBool( + formatter, charPtrFromPyStr(typeString), typeName, c_int(value) + ) # int as boolean + + +# signature: int blpapi_EventFormatter_setValueBytes(blpapi_EventFormatter_t *formatter,const char *typeString,const blpapi_Name_t *typeName,const char *value,size_t length); +def _blpapi_EventFormatter_setValueBytes( + formatter, typeString, typeName, value +): + valuePtr, sz = charPtrWithSizeFromPyStr(value) + return l_blpapi_EventFormatter_setValueBytes( + formatter, + charPtrFromPyStr(typeString), + typeName, + valuePtr, + c_size_t(sz), + ) -def blpapi_Element_definition(element): - return _internals.blpapi_Element_definition(element) -def blpapi_Element_datatype(element): - return _internals.blpapi_Element_datatype(element) +# signature: int blpapi_EventFormatter_setValueChar(blpapi_EventFormatter_t *formatter,const char *typeString,const blpapi_Name_t *typeName,char value); +def _blpapi_EventFormatter_setValueChar( + formatter, typeString, typeName, value +): + return l_blpapi_EventFormatter_setValueChar( + formatter, + charPtrFromPyStr(typeString), + typeName, + c_char(value), + ) -def blpapi_Element_isComplexType(element): - return _internals.blpapi_Element_isComplexType(element) -def blpapi_Element_isArray(element): - return _internals.blpapi_Element_isArray(element) +# signature: int blpapi_EventFormatter_setValueFloat32(blpapi_EventFormatter_t *formatter,const char *typeString,const blpapi_Name_t *typeName,blpapi_Float32_t value); +def _blpapi_EventFormatter_setValueFloat( + formatter, typeString, typeName, value +): + # The C interface will not silently discard precision to store a 64-bit + # float in a field whose schema type is 32-bit, however all Python floats + # are 64-bit, so we explicitly allow narrowing to 32 bits if necessary. -def blpapi_Element_isReadOnly(element): - return _internals.blpapi_Element_isReadOnly(element) + retCode = l_blpapi_EventFormatter_setValueFloat64( + formatter, charPtrFromPyStr(typeString), typeName, c_double(value) + ) + if retCode: + retCode = l_blpapi_EventFormatter_setValueFloat32( + formatter, charPtrFromPyStr(typeString), typeName, c_float(value) + ) + return retCode -def blpapi_Element_numValues(element): - return _internals.blpapi_Element_numValues(element) -def blpapi_Element_numElements(element): - return _internals.blpapi_Element_numElements(element) +# signature: int blpapi_EventFormatter_setValueFromName(blpapi_EventFormatter_t *formatter,const char *typeString,const blpapi_Name_t *typeName,const blpapi_Name_t *value); +def _blpapi_EventFormatter_setValueFromName( + formatter, typeString, typeName, value +): + return l_blpapi_EventFormatter_setValueFromName( + formatter, charPtrFromPyStr(typeString), typeName, value + ) -def blpapi_Element_isNullValue(element, position): - return _internals.blpapi_Element_isNullValue(element, position) -def blpapi_Element_isNull(element): - return _internals.blpapi_Element_isNull(element) +# signature: int blpapi_EventFormatter_setValueHighPrecisionDatetime(blpapi_EventFormatter_t *formatter,const char *typeString,const blpapi_Name_t *typeName,const blpapi_HighPrecisionDatetime_t *value); +def _blpapi_EventFormatter_setValueHighPrecisionDatetime( + formatter, typeString, typeName, value +): + return l_blpapi_EventFormatter_setValueHighPrecisionDatetime( + formatter, charPtrFromPyStr(typeString), typeName, byref(value) + ) -def blpapi_Element_getElementAt(element, position): - return _internals.blpapi_Element_getElementAt(element, position) -def blpapi_Element_getElement(element, nameString, name): - return _internals.blpapi_Element_getElement(element, nameString, name) +# signature: int blpapi_EventFormatter_setValueInt32(blpapi_EventFormatter_t *formatter,const char *typeString,const blpapi_Name_t *typeName,blpapi_Int32_t value); +def _blpapi_EventFormatter_setValueInt32( + formatter, typeString, typeName, value +): + return l_blpapi_EventFormatter_setValueInt32( + formatter, charPtrFromPyStr(typeString), typeName, c_int(value) + ) -def blpapi_Element_hasElementEx(element, nameString, name, excludeNullElements, reserved): - return _internals.blpapi_Element_hasElementEx(element, nameString, name, excludeNullElements, reserved) -def blpapi_Element_getValueAsBool(element, index): - return _internals.blpapi_Element_getValueAsBool(element, index) +# signature: int blpapi_EventFormatter_setValueInt64(blpapi_EventFormatter_t *formatter,const char *typeString,const blpapi_Name_t *typeName,blpapi_Int64_t value); +def _blpapi_EventFormatter_setValueInt64( + formatter, typeString, typeName, value +): + return l_blpapi_EventFormatter_setValueInt64( + formatter, charPtrFromPyStr(typeString), typeName, c_int64(value) + ) -def blpapi_Element_getValueAsChar(element, index): - return _internals.blpapi_Element_getValueAsChar(element, index) -def blpapi_Element_getValueAsInt32(element, index): - return _internals.blpapi_Element_getValueAsInt32(element, index) +# signature: int blpapi_EventFormatter_setValueNull(blpapi_EventFormatter_t *formatter,const char *typeString,const blpapi_Name_t *typeName); +def _blpapi_EventFormatter_setValueNull(formatter, typeString, typeName): + return l_blpapi_EventFormatter_setValueNull( + formatter, + charPtrFromPyStr(typeString), + typeName, + ) -def blpapi_Element_getValueAsInt64(element, index): - return _internals.blpapi_Element_getValueAsInt64(element, index) -def blpapi_Element_getValueAsFloat64(element, index): - return _internals.blpapi_Element_getValueAsFloat64(element, index) +# signature: int blpapi_EventFormatter_setValueString(blpapi_EventFormatter_t *formatter,const char *typeString,const blpapi_Name_t *typeName,const char *value); +def _blpapi_EventFormatter_setValueString( + formatter, typeString, typeName, value +): + return l_blpapi_EventFormatter_setValueString( + formatter, + charPtrFromPyStr(typeString), + typeName, + charPtrFromPyStr(value), + ) + + +# signature: blpapi_EventQueue_t *blpapi_EventQueue_create(void); +def _blpapi_EventQueue_create(): + return getHandleFromPtr(l_blpapi_EventQueue_create()) + + +# signature: int blpapi_EventQueue_destroy(blpapi_EventQueue_t *eventQueue); +def _blpapi_EventQueue_destroy(eventQueue): + return l_blpapi_EventQueue_destroy(eventQueue) + + +# signature: blpapi_Event_t *blpapi_EventQueue_nextEvent(blpapi_EventQueue_t *eventQueue, int timeout); +def _blpapi_EventQueue_nextEvent(eventQueue, timeout): + return getHandleFromPtr(l_blpapi_EventQueue_nextEvent(eventQueue, timeout)) + + +# signature: int blpapi_EventQueue_purge(blpapi_EventQueue_t *eventQueue); +def _blpapi_EventQueue_purge(eventQueue): + return l_blpapi_EventQueue_purge(eventQueue) + + +# signature: int blpapi_EventQueue_tryNextEvent(blpapi_EventQueue_t *eventQueue, blpapi_Event_t **eventPointer); +def _blpapi_EventQueue_tryNextEvent(eventQueue): + out = c_void_p() + outp = pointer(out) + retCode = l_blpapi_EventQueue_tryNextEvent(eventQueue, outp) + return retCode, getHandleFromOutput(outp, retCode) + + +# signature: int blpapi_Event_eventType(const blpapi_Event_t *event); +def _blpapi_Event_eventType(event): + return l_blpapi_Event_eventType(event) -def blpapi_Element_getValueAsString(element, index): - return _internals.blpapi_Element_getValueAsString(element, index) -def blpapi_Element_getValueAsDatetime(element, index): - return _internals.blpapi_Element_getValueAsDatetime(element, index) +# signature: int blpapi_Event_release(const blpapi_Event_t *event); +def _blpapi_Event_release(event): + return l_blpapi_Event_release(event) -def blpapi_Element_getValueAsHighPrecisionDatetime(element, index): - return _internals.blpapi_Element_getValueAsHighPrecisionDatetime(element, index) -def blpapi_Element_getValueAsElement(element, index): - return _internals.blpapi_Element_getValueAsElement(element, index) +# signature: int blpapi_HighPrecisionDatetime_compare(const blpapi_HighPrecisionDatetime_t *lhs,const blpapi_HighPrecisionDatetime_t *rhs); +def _blpapi_HighPrecisionDatetime_compare(lhs, rhs): + raise NotImplementedError("not called") -def blpapi_Element_getValueAsName(element, index): - return _internals.blpapi_Element_getValueAsName(element, index) -def blpapi_Element_getValueAsBytes(element, index): - return _internals.blpapi_Element_getValueAsBytes(element, index) +# signature: int blpapi_HighPrecisionDatetime_fromTimePoint(blpapi_HighPrecisionDatetime_t *datetime,const blpapi_TimePoint_t *timePoint,short offset); +def _blpapi_HighPrecisionDatetime_fromTimePoint(timepoint, offset): + out = HighPrecisionDatetime() + outp = pointer(out) + retCode = l_blpapi_HighPrecisionDatetime_fromTimePoint( + outp, byref(timepoint), c_int16(offset) + ) + return retCode, getStructFromOutput(outp, retCode) -def blpapi_Element_getChoice(element): - return _internals.blpapi_Element_getChoice(element) -def blpapi_Element_setValueBool(element, value, index): - return _internals.blpapi_Element_setValueBool(element, value, index) +# signature: +def _blpapi_HighPrecisionDatetime_fromTimePoint_wrapper(timepoint): + _, result = _blpapi_HighPrecisionDatetime_fromTimePoint(timepoint, 0) + return result -def blpapi_Element_setValueInt32(element, value, index): - return _internals.blpapi_Element_setValueInt32(element, value, index) -def blpapi_Element_setValueInt64(element, value, index): - return _internals.blpapi_Element_setValueInt64(element, value, index) +# signature: int blpapi_HighPrecisionDatetime_print(const blpapi_HighPrecisionDatetime_t *datetime,blpapi_StreamWriter_t streamWriter,void *stream,int level,int spacesPerLevel); +def _blpapi_HighPrecisionDatetime_print( + datetime, streamWriter, stream, level, spacesPerLevel +): + raise NotImplementedError("not called") -def blpapi_Element_setValueString(element, value, index): - return _internals.blpapi_Element_setValueString(element, value, index) -def blpapi_Element_setValueHighPrecisionDatetime(element, value, index): - return _internals.blpapi_Element_setValueHighPrecisionDatetime(element, value, index) +# signature: int blpapi_HighResolutionClock_now(blpapi_TimePoint_t *timePoint); +def _blpapi_HighResolutionClock_now(): + out = TimePoint() + outp = pointer(out) + retCode = l_blpapi_HighResolutionClock_now(outp) + return retCode, getStructFromOutput(outp, retCode) -def blpapi_Element_setValueBytes(element, value, index): - return _internals.blpapi_Element_setValueBytes(element, value, index) -def blpapi_Element_setValueFromName(element, value, index): - return _internals.blpapi_Element_setValueFromName(element, value, index) +# signature: int blpapi_Identity_addRef(blpapi_Identity_t *handle); +def _blpapi_Identity_addRef(handle): + raise NotImplementedError("not called") # only needed on copy -def blpapi_Element_setElementBool(element, nameString, name, value): - return _internals.blpapi_Element_setElementBool(element, nameString, name, value) -def blpapi_Element_setElementInt32(element, nameString, name, value): - return _internals.blpapi_Element_setElementInt32(element, nameString, name, value) +# signature: int blpapi_Identity_getSeatType(const blpapi_Identity_t *handle, int *seatType); +def _blpapi_Identity_getSeatType(handle): + out = c_int() + outp = pointer(out) + retCode = l_blpapi_Identity_getSeatType(handle, outp) + return retCode, getPODFromOutput(outp, retCode) -def blpapi_Element_setElementInt64(element, nameString, name, value): - return _internals.blpapi_Element_setElementInt64(element, nameString, name, value) -def blpapi_Element_setElementString(element, nameString, name, value): - return _internals.blpapi_Element_setElementString(element, nameString, name, value) +# signature: int blpapi_Identity_hasEntitlements(const blpapi_Identity_t *handle,const blpapi_Service_t *service,const blpapi_Element_t *eidElement,const int *entitlementIds,size_t numEntitlements,int *failedEntitlements,int *failedEntitlementsCount); +def _blpapi_Identity_hasEntitlements( + handle, + service, + eidElement, + entitlementIds, + numEntitlements, + failedEntitlements, + failedEntitlementsCount, +): + return l_blpapi_Identity_hasEntitlements( + handle, + service, + eidElement, + c_void_p() if entitlementIds is None else byref(entitlementIds), + c_size_t(numEntitlements), + ( + c_void_p() + if failedEntitlements is None + else pointer(failedEntitlements) + ), + ( + c_void_p() + if failedEntitlementsCount is None + else pointer(failedEntitlementsCount) + ), + ) -def blpapi_Element_setElementHighPrecisionDatetime(element, nameString, name, value): - return _internals.blpapi_Element_setElementHighPrecisionDatetime(element, nameString, name, value) -def blpapi_Element_setElementBytes(element, nameString, name, value): - return _internals.blpapi_Element_setElementBytes(element, nameString, name, value) +# signature: int blpapi_Identity_isAuthorized(const blpapi_Identity_t *handle, const blpapi_Service_t *service); +def _blpapi_Identity_isAuthorized(handle, service): + return l_blpapi_Identity_isAuthorized(handle, service) -def blpapi_Element_setElementFromName(element, elementName, name, buffer): - return _internals.blpapi_Element_setElementFromName(element, elementName, name, buffer) -def blpapi_Element_appendElement(element): - return _internals.blpapi_Element_appendElement(element) +# signature: void blpapi_Identity_release(blpapi_Identity_t *handle); +def _blpapi_Identity_release(handle): + l_blpapi_Identity_release(handle) + -def blpapi_Element_setChoice(element, nameCstr, name, index): - return _internals.blpapi_Element_setChoice(element, nameCstr, name, index) +# signature: void blpapi_Logging_logTestMessage(blpapi_Logging_Severity_t severity); +def _blpapi_Logging_logTestMessage(severity): + l_blpapi_Logging_logTestMessage(severity) -def blpapi_EventFormatter_setValueFloat(formatter, typeString, typeName, value): - return _internals.blpapi_EventFormatter_setValueFloat(formatter, typeString, typeName, value) -def blpapi_EventFormatter_appendValueFloat(formatter, value): - return _internals.blpapi_EventFormatter_appendValueFloat(formatter, value) +class LoggingCallbackWrapper: + # typedef void (*blpapi_Logging_Func_t)( + # blpapi_UInt64_t threadId, + # int severity, + # blpapi_Datetime_t timestamp, + # const char *category, + # const char *message); + _cftype = CFUNCTYPE(None, c_uint64, c_int, BDatetime, c_char_p, c_char_p) -def blpapi_EventFormatter_create(event): - return _internals.blpapi_EventFormatter_create(event) + @staticmethod + def get(cb: Optional[Callable]) -> Callable: + return ( + LoggingCallbackWrapper._cftype(cb) + if cb is not None + else c_void_p(0) + ) + + +# signature: blpapi_Logging_registerCallback(logging_cb, int); +def _blpapi_Logging_registerCallback(callback, thresholdSeverity): + proxy = LoggingCallbackWrapper.get(callback) + return l_blpapi_Logging_registerCallback(proxy, thresholdSeverity), proxy + + +# signature: int blpapi_MessageFormatter_FormatMessageJson(blpapi_MessageFormatter_t *formatter, const char *message); +def _blpapi_MessageFormatter_FormatMessageJson(formatter, message): + return l_blpapi_MessageFormatter_FormatMessageJson( + formatter, charPtrFromPyStr(message) + ) + + +# signature: int blpapi_MessageFormatter_FormatMessageXml(blpapi_MessageFormatter_t *formatter, const char *message); +def _blpapi_MessageFormatter_FormatMessageXml(formatter, message): + return l_blpapi_MessageFormatter_FormatMessageXml( + formatter, charPtrFromPyStr(message) + ) + + +# signature: int blpapi_MessageFormatter_appendElement(blpapi_MessageFormatter_t *formatter); +def _blpapi_MessageFormatter_appendElement(formatter): + return l_blpapi_MessageFormatter_appendElement(formatter) + + +# signature: int blpapi_MessageFormatter_appendValueBool(blpapi_MessageFormatter_t *formatter, blpapi_Bool_t value); +def _blpapi_MessageFormatter_appendValueBool(formatter, value): + return l_blpapi_MessageFormatter_appendValueBool( + formatter, c_int(value) + ) # int as boolean + + +# signature: int blpapi_MessageFormatter_appendValueChar(blpapi_MessageFormatter_t *formatter, char value); +def _blpapi_MessageFormatter_appendValueChar(formatter, value): + return l_blpapi_MessageFormatter_appendValueChar(formatter, c_char(value)) + + +# signature: int blpapi_MessageFormatter_appendValueDatetime(blpapi_MessageFormatter_t *formatter, const blpapi_Datetime_t *value); +def _blpapi_MessageFormatter_appendValueDatetime(formatter, value): + return l_blpapi_MessageFormatter_appendValueDatetime( + formatter, byref(value) + ) + + +# signature: int blpapi_MessageFormatter_appendValueFloat32(blpapi_MessageFormatter_t *formatter, blpapi_Float32_t value); +def _blpapi_MessageFormatter_appendValueFloat(formatter, value): + # The C interface will not silently discard precision to store a 64-bit + # float in a field whose schema type is 32-bit, however all Python floats + # are 64-bit, so we explicitly allow narrowing to 32 bits if necessary. + + retCode = l_blpapi_MessageFormatter_appendValueFloat64( + formatter, c_double(value) + ) + if retCode: + retCode = l_blpapi_MessageFormatter_appendValueFloat32( + formatter, c_float(value) + ) + return retCode + + +# signature: int blpapi_MessageFormatter_appendValueFloat32(blpapi_MessageFormatter_t *formatter, blpapi_Float32_t value); +def _blpapi_MessageFormatter_appendValueFloat32(formatter, value): + return l_blpapi_MessageFormatter_appendValueFloat32( + formatter, c_float(value) + ) + + +# signature: int blpapi_MessageFormatter_appendValueFloat64(blpapi_MessageFormatter_t *formatter, blpapi_Float64_t value); +def _blpapi_MessageFormatter_appendValueFloat64(formatter, value): + return l_blpapi_MessageFormatter_appendValueFloat64( + formatter, c_double(value) + ) + + +# signature: int blpapi_MessageFormatter_appendValueFromName(blpapi_MessageFormatter_t *formatter, const blpapi_Name_t *value); +def _blpapi_MessageFormatter_appendValueFromName(formatter, value): + return l_blpapi_MessageFormatter_appendValueFromName(formatter, value) + + +# signature: int blpapi_MessageFormatter_appendValueHighPrecisionDatetime(blpapi_MessageFormatter_t *formatter,const blpapi_HighPrecisionDatetime_t *value); +def _blpapi_MessageFormatter_appendValueHighPrecisionDatetime( + formatter, value +): + return l_blpapi_MessageFormatter_appendValueHighPrecisionDatetime( + formatter, byref(value) + ) + + +# signature: int blpapi_MessageFormatter_appendValueInt32(blpapi_MessageFormatter_t *formatter, blpapi_Int32_t value); +def _blpapi_MessageFormatter_appendValueInt32(formatter, value): + return l_blpapi_MessageFormatter_appendValueInt32(formatter, value) -def blpapi_EventFormatter_destroy(victim): - return _internals.blpapi_EventFormatter_destroy(victim) -def blpapi_EventFormatter_appendMessage(formatter, typeString, typeName, topic): - return _internals.blpapi_EventFormatter_appendMessage(formatter, typeString, typeName, topic) +# signature: int blpapi_MessageFormatter_appendValueInt64(blpapi_MessageFormatter_t *formatter, blpapi_Int64_t value); +def _blpapi_MessageFormatter_appendValueInt64(formatter, value): + return l_blpapi_MessageFormatter_appendValueInt64( + formatter, c_int64(value) + ) -def blpapi_EventFormatter_appendMessageSeq(formatter, typeString, typeName, topic, sequenceNumber, arg6): - return _internals.blpapi_EventFormatter_appendMessageSeq(formatter, typeString, typeName, topic, sequenceNumber, arg6) -def blpapi_EventFormatter_appendResponse(formatter, typeString, typeName): - return _internals.blpapi_EventFormatter_appendResponse(formatter, typeString, typeName) +# signature: int blpapi_MessageFormatter_appendValueString(blpapi_MessageFormatter_t *formatter, const char *value); +def _blpapi_MessageFormatter_appendValueString(formatter, value): + return l_blpapi_MessageFormatter_appendValueString( + formatter, charPtrFromPyStr(value) + ) -def blpapi_EventFormatter_appendRecapMessage(formatter, topic, cid): - return _internals.blpapi_EventFormatter_appendRecapMessage(formatter, topic, cid) -def blpapi_EventFormatter_appendRecapMessageSeq(formatter, topic, cid, sequenceNumber, arg5): - return _internals.blpapi_EventFormatter_appendRecapMessageSeq(formatter, topic, cid, sequenceNumber, arg5) +# signature: int blpapi_MessageFormatter_assign(blpapi_MessageFormatter_t **lhs, const blpapi_MessageFormatter_t *rhs); +def _blpapi_MessageFormatter_assign(rhs): + raise NotImplementedError("not called") -def blpapi_EventFormatter_appendFragmentedRecapMessage(formatter, typeString, typeName, topic, cid, fragmentType): - return _internals.blpapi_EventFormatter_appendFragmentedRecapMessage(formatter, typeString, typeName, topic, cid, fragmentType) -def blpapi_EventFormatter_appendFragmentedRecapMessageSeq(formatter, typeString, typeName, topic, fragmentType, sequenceNumber): - return _internals.blpapi_EventFormatter_appendFragmentedRecapMessageSeq(formatter, typeString, typeName, topic, fragmentType, sequenceNumber) +# signature: int blpapi_MessageFormatter_copy(blpapi_MessageFormatter_t **formatter,const blpapi_MessageFormatter_t *original); +def _blpapi_MessageFormatter_copy(original): + raise NotImplementedError("not called") -def blpapi_EventFormatter_setValueBool(formatter, typeString, typeName, value): - return _internals.blpapi_EventFormatter_setValueBool(formatter, typeString, typeName, value) -def blpapi_EventFormatter_setValueChar(formatter, typeString, typeName, value): - return _internals.blpapi_EventFormatter_setValueChar(formatter, typeString, typeName, value) +# signature: int blpapi_MessageFormatter_destroy(blpapi_MessageFormatter_t *formatter); +def _blpapi_MessageFormatter_destroy(formatter): + return l_blpapi_MessageFormatter_destroy(formatter) -def blpapi_EventFormatter_setValueInt32(formatter, typeString, typeName, value): - return _internals.blpapi_EventFormatter_setValueInt32(formatter, typeString, typeName, value) -def blpapi_EventFormatter_setValueInt64(formatter, typeString, typeName, value): - return _internals.blpapi_EventFormatter_setValueInt64(formatter, typeString, typeName, value) +# signature: int blpapi_MessageFormatter_popElement(blpapi_MessageFormatter_t *formatter); +def _blpapi_MessageFormatter_popElement(formatter): + return l_blpapi_MessageFormatter_popElement(formatter) -def blpapi_EventFormatter_setValueHighPrecisionDatetime(formatter, typeString, typeName, value): - return _internals.blpapi_EventFormatter_setValueHighPrecisionDatetime(formatter, typeString, typeName, value) -def blpapi_EventFormatter_setValueString(formatter, typeString, typeName, value): - return _internals.blpapi_EventFormatter_setValueString(formatter, typeString, typeName, value) +# signature: int blpapi_MessageFormatter_pushElement(blpapi_MessageFormatter_t *formatter, const blpapi_Name_t *typeName); +def _blpapi_MessageFormatter_pushElement(formatter, typeName): + return l_blpapi_MessageFormatter_pushElement(formatter, typeName) -def blpapi_EventFormatter_setValueFromName(formatter, typeString, typeName, value): - return _internals.blpapi_EventFormatter_setValueFromName(formatter, typeString, typeName, value) -def blpapi_EventFormatter_setValueBytes(formatter, typeString, typeName, value): - return _internals.blpapi_EventFormatter_setValueBytes(formatter, typeString, typeName, value) +# signature: int blpapi_MessageFormatter_setValueBool(blpapi_MessageFormatter_t *formatter,const blpapi_Name_t *typeName,blpapi_Bool_t value); +def _blpapi_MessageFormatter_setValueBool(formatter, typeName, value): + return l_blpapi_MessageFormatter_setValueBool( + formatter, typeName, c_int(value) + ) # int as boolean -def blpapi_EventFormatter_setValueNull(formatter, typeString, typeName): - return _internals.blpapi_EventFormatter_setValueNull(formatter, typeString, typeName) -def blpapi_EventFormatter_pushElement(formatter, typeString, typeName): - return _internals.blpapi_EventFormatter_pushElement(formatter, typeString, typeName) +# signature: int blpapi_MessageFormatter_setValueBytes(blpapi_MessageFormatter_t *formatter,const blpapi_Name_t *typeName,const char *value,size_t length); +def _blpapi_MessageFormatter_setValueBytes(formatter, typeName, value): + valuePtr, sz = charPtrWithSizeFromPyStr(value) + return l_blpapi_MessageFormatter_setValueBytes( + formatter, typeName, valuePtr, c_size_t(sz) + ) -def blpapi_EventFormatter_popElement(formatter): - return _internals.blpapi_EventFormatter_popElement(formatter) -def blpapi_EventFormatter_appendValueBool(formatter, value): - return _internals.blpapi_EventFormatter_appendValueBool(formatter, value) +# signature: int blpapi_MessageFormatter_setValueChar(blpapi_MessageFormatter_t *formatter,const blpapi_Name_t *typeName,char value); +def _blpapi_MessageFormatter_setValueChar(formatter, typeName, value): + return l_blpapi_MessageFormatter_setValueChar( + formatter, typeName, c_char(value) + ) -def blpapi_EventFormatter_appendValueChar(formatter, value): - return _internals.blpapi_EventFormatter_appendValueChar(formatter, value) -def blpapi_EventFormatter_appendValueInt32(formatter, value): - return _internals.blpapi_EventFormatter_appendValueInt32(formatter, value) +# signature: int blpapi_MessageFormatter_setValueDatetime(blpapi_MessageFormatter_t *formatter,const blpapi_Name_t *typeName,const blpapi_Datetime_t *value); +def _blpapi_MessageFormatter_setValueDatetime(formatter, typeName, value): + return l_blpapi_MessageFormatter_setValueDatetime( + formatter, typeName, byref(value) + ) -def blpapi_EventFormatter_appendValueInt64(formatter, value): - return _internals.blpapi_EventFormatter_appendValueInt64(formatter, value) -def blpapi_EventFormatter_appendValueHighPrecisionDatetime(formatter, value): - return _internals.blpapi_EventFormatter_appendValueHighPrecisionDatetime(formatter, value) +# signature: int blpapi_MessageFormatter_setValueFloat32(blpapi_MessageFormatter_t *formatter,const blpapi_Name_t *typeName,blpapi_Float32_t value); +def _blpapi_MessageFormatter_setValueFloat(formatter, typeName, value): + # The C interface will not silently discard precision to store a 64-bit + # float in a field whose schema type is 32-bit, however all Python floats + # are 64-bit, so we explicitly allow narrowing to 32 bits if necessary. -def blpapi_EventFormatter_appendValueString(formatter, value): - return _internals.blpapi_EventFormatter_appendValueString(formatter, value) + retCode = l_blpapi_MessageFormatter_setValueFloat64( + formatter, typeName, c_double(value) + ) + if retCode: + retCode = l_blpapi_MessageFormatter_setValueFloat32( + formatter, typeName, c_float(value) + ) + return retCode -def blpapi_EventFormatter_appendValueFromName(formatter, value): - return _internals.blpapi_EventFormatter_appendValueFromName(formatter, value) -def blpapi_EventFormatter_appendElement(formatter): - return _internals.blpapi_EventFormatter_appendElement(formatter) +# signature: int blpapi_MessageFormatter_setValueFloat32(blpapi_MessageFormatter_t *formatter,const blpapi_Name_t *typeName,blpapi_Float32_t value); +def _blpapi_MessageFormatter_setValueFloat32(formatter, typeName, value): + return l_blpapi_MessageFormatter_appendValueFloat32( + formatter, typeName, c_float(value) + ) -def Session_createHelper(parameters, eventHandlerFunc, dispatcher): - return _internals.Session_createHelper(parameters, eventHandlerFunc, dispatcher) -def Session_destroyHelper(sessionHandle, eventHandlerFunc): - return _internals.Session_destroyHelper(sessionHandle, eventHandlerFunc) +# signature: int blpapi_MessageFormatter_setValueFloat64(blpapi_MessageFormatter_t *formatter,const blpapi_Name_t *typeName,blpapi_Float64_t value); +def _blpapi_MessageFormatter_setValueFloat64(formatter, typeName, value): + return l_blpapi_MessageFormatter_appendValueFloat64( + formatter, typeName, c_double(value) + ) -def blpapi_EventDispatcher_create(numDispatcherThreads): - return _internals.blpapi_EventDispatcher_create(numDispatcherThreads) -def blpapi_EventDispatcher_destroy(handle): - return _internals.blpapi_EventDispatcher_destroy(handle) +# signature: int blpapi_MessageFormatter_setValueFromName(blpapi_MessageFormatter_t *formatter,const blpapi_Name_t *typeName,const blpapi_Name_t *value); +def _blpapi_MessageFormatter_setValueFromName(formatter, typeName, value): + return l_blpapi_MessageFormatter_setValueFromName( + formatter, typeName, value + ) -def blpapi_EventDispatcher_start(handle): - return _internals.blpapi_EventDispatcher_start(handle) -def ProviderSession_createHelper(parameters, eventHandlerFunc, dispatcher): - return _internals.ProviderSession_createHelper(parameters, eventHandlerFunc, dispatcher) +# signature: int blpapi_MessageFormatter_setValueHighPrecisionDatetime(blpapi_MessageFormatter_t *formatter,const blpapi_Name_t *typeName,const blpapi_HighPrecisionDatetime_t *value); +def _blpapi_MessageFormatter_setValueHighPrecisionDatetime( + formatter, typeName, value +): + return l_blpapi_MessageFormatter_setValueHighPrecisionDatetime( + formatter, typeName, byref(value) + ) -def ProviderSession_destroyHelper(sessionHandle, eventHandlerFunc): - return _internals.ProviderSession_destroyHelper(sessionHandle, eventHandlerFunc) -def ProviderSession_terminateSubscriptionsOnTopic(sessionHandle, topic, message): - return _internals.ProviderSession_terminateSubscriptionsOnTopic(sessionHandle, topic, message) +# signature: int blpapi_MessageFormatter_setValueInt32(blpapi_MessageFormatter_t *formatter,const blpapi_Name_t *typeName,blpapi_Int32_t value); +def _blpapi_MessageFormatter_setValueInt32(formatter, typeName, value): + return l_blpapi_MessageFormatter_setValueInt32(formatter, typeName, value) -def blpapi_MessageFormatter_setValueFloat(formatter, typeName, value): - return _internals.blpapi_MessageFormatter_setValueFloat(formatter, typeName, value) -def blpapi_MessageFormatter_appendValueFloat(formatter, value): - return _internals.blpapi_MessageFormatter_appendValueFloat(formatter, value) +# signature: int blpapi_MessageFormatter_setValueInt64(blpapi_MessageFormatter_t *formatter,const blpapi_Name_t *typeName,blpapi_Int64_t value); +def _blpapi_MessageFormatter_setValueInt64(formatter, typeName, value): + return l_blpapi_MessageFormatter_setValueInt64( + formatter, typeName, c_int64(value) + ) -def blpapi_MessageFormatter_setValueBool(formatter, typeName, value): - return _internals.blpapi_MessageFormatter_setValueBool(formatter, typeName, value) -def blpapi_MessageFormatter_setValueChar(formatter, typeName, value): - return _internals.blpapi_MessageFormatter_setValueChar(formatter, typeName, value) +# signature: int blpapi_MessageFormatter_setValueNull(blpapi_MessageFormatter_t *formatter, const blpapi_Name_t *typeName); +def _blpapi_MessageFormatter_setValueNull(formatter, typeName): + return l_blpapi_MessageFormatter_setValueNull(formatter, typeName) -def blpapi_MessageFormatter_setValueInt32(formatter, typeName, value): - return _internals.blpapi_MessageFormatter_setValueInt32(formatter, typeName, value) -def blpapi_MessageFormatter_setValueInt64(formatter, typeName, value): - return _internals.blpapi_MessageFormatter_setValueInt64(formatter, typeName, value) +# signature: int blpapi_MessageFormatter_setValueString(blpapi_MessageFormatter_t *formatter,const blpapi_Name_t *typeName,const char *value); +def _blpapi_MessageFormatter_setValueString(formatter, typeName, value): + return l_blpapi_MessageFormatter_setValueString( + formatter, typeName, charPtrFromPyStr(value) + ) -def blpapi_MessageFormatter_setValueFloat32(formatter, typeName, value): - return _internals.blpapi_MessageFormatter_setValueFloat32(formatter, typeName, value) -def blpapi_MessageFormatter_setValueFloat64(formatter, typeName, value): - return _internals.blpapi_MessageFormatter_setValueFloat64(formatter, typeName, value) +# signature: blpapi_MessageIterator_t *blpapi_MessageIterator_create(const blpapi_Event_t *event); +def _blpapi_MessageIterator_create(event): + return getHandleFromPtr(l_blpapi_MessageIterator_create(event)) -def blpapi_MessageFormatter_setValueDatetime(formatter, typeName, value): - return _internals.blpapi_MessageFormatter_setValueDatetime(formatter, typeName, value) -def blpapi_MessageFormatter_setValueHighPrecisionDatetime(formatter, typeName, value): - return _internals.blpapi_MessageFormatter_setValueHighPrecisionDatetime(formatter, typeName, value) +# signature: void blpapi_MessageIterator_destroy(blpapi_MessageIterator_t *iterator); +def _blpapi_MessageIterator_destroy(iterator): + l_blpapi_MessageIterator_destroy(iterator) -def blpapi_MessageFormatter_setValueString(formatter, typeName, value): - return _internals.blpapi_MessageFormatter_setValueString(formatter, typeName, value) -def blpapi_MessageFormatter_setValueFromName(formatter, typeName, value): - return _internals.blpapi_MessageFormatter_setValueFromName(formatter, typeName, value) +# signature: int blpapi_MessageIterator_next(blpapi_MessageIterator_t *iterator, blpapi_Message_t **result); +def _blpapi_MessageIterator_next(iterator): + message_pp = c_void_p() + outp = pointer(message_pp) + retCode = l_blpapi_MessageIterator_next(iterator, outp) + return retCode, getHandleFromOutput(outp, retCode) -def blpapi_MessageFormatter_setValueBytes(formatter, typeName, value): - return _internals.blpapi_MessageFormatter_setValueBytes(formatter, typeName, value) -def blpapi_MessageFormatter_setValueNull(formatter, typeName): - return _internals.blpapi_MessageFormatter_setValueNull(formatter, typeName) +# signature: int blpapi_MessageProperties_assign(blpapi_MessageProperties_t *lhs,const blpapi_MessageProperties_t *rhs); +def _blpapi_MessageProperties_assign(lhs, rhs): + raise NotImplementedError("not called") -def blpapi_MessageFormatter_pushElement(formatter, typeName): - return _internals.blpapi_MessageFormatter_pushElement(formatter, typeName) -def blpapi_MessageFormatter_popElement(formatter): - return _internals.blpapi_MessageFormatter_popElement(formatter) +# signature: int blpapi_MessageProperties_copy(blpapi_MessageProperties_t **dest,const blpapi_MessageProperties_t *src); +def _blpapi_MessageProperties_copy(src): + raise NotImplementedError("not called") -def blpapi_MessageFormatter_appendValueBool(formatter, value): - return _internals.blpapi_MessageFormatter_appendValueBool(formatter, value) -def blpapi_MessageFormatter_appendValueChar(formatter, value): - return _internals.blpapi_MessageFormatter_appendValueChar(formatter, value) +# signature: int blpapi_MessageProperties_create(blpapi_MessageProperties_t **messageProperties); +def _blpapi_MessageProperties_create(): + out = c_void_p() + outp = pointer(out) + retCode = l_blpapi_MessageProperties_create(outp) # int + return retCode, getHandleFromOutput(outp, retCode) -def blpapi_MessageFormatter_appendValueInt32(formatter, value): - return _internals.blpapi_MessageFormatter_appendValueInt32(formatter, value) -def blpapi_MessageFormatter_appendValueInt64(formatter, value): - return _internals.blpapi_MessageFormatter_appendValueInt64(formatter, value) +# signature: void blpapi_MessageProperties_destroy(blpapi_MessageProperties_t *messageProperties); +def _blpapi_MessageProperties_destroy(messageProperties): + l_blpapi_MessageProperties_destroy(messageProperties) -def blpapi_MessageFormatter_appendValueFloat32(formatter, value): - return _internals.blpapi_MessageFormatter_appendValueFloat32(formatter, value) -def blpapi_MessageFormatter_appendValueFloat64(formatter, value): - return _internals.blpapi_MessageFormatter_appendValueFloat64(formatter, value) +# signature: int blpapi_MessageProperties_setCorrelationIds(blpapi_MessageProperties_t *messageProperties,const blpapi_CorrelationId_t *correlationIds,size_t numCorrelationIds); +def _blpapi_MessageProperties_setCorrelationIds( + messageProperties, correlationIds +): + szcids = len(correlationIds) + if szcids > 1: + arraytype = CidStruct * szcids + ptrs = arraytype(*[c.thestruct for c in correlationIds]) + oneptr = byref(ptrs) + elif szcids == 1: + oneptr = byref(correlationIds[0].thestruct) + else: + oneptr = c_void_p() # pass null, the C SDK will check and reject -def blpapi_MessageFormatter_appendValueDatetime(formatter, value): - return _internals.blpapi_MessageFormatter_appendValueDatetime(formatter, value) + return l_blpapi_MessageProperties_setCorrelationIds( + messageProperties, oneptr, c_size_t(szcids) + ) -def blpapi_MessageFormatter_appendValueHighPrecisionDatetime(formatter, value): - return _internals.blpapi_MessageFormatter_appendValueHighPrecisionDatetime(formatter, value) -def blpapi_MessageFormatter_appendValueString(formatter, value): - return _internals.blpapi_MessageFormatter_appendValueString(formatter, value) +# signature: int blpapi_MessageProperties_setRecapType(blpapi_MessageProperties_t *messageProperties,int recap,int fragment); +def _blpapi_MessageProperties_setRecapType(messageProperties, recap, fragment): + return l_blpapi_MessageProperties_setRecapType( + messageProperties, recap, fragment + ) -def blpapi_MessageFormatter_appendValueFromName(formatter, value): - return _internals.blpapi_MessageFormatter_appendValueFromName(formatter, value) -def blpapi_MessageFormatter_appendElement(formatter): - return _internals.blpapi_MessageFormatter_appendElement(formatter) +# signature: int blpapi_MessageProperties_setRequestId(blpapi_MessageProperties_t *messageProperties, const char *requestId); +def _blpapi_MessageProperties_setRequestId(messageProperties, requestId): + return l_blpapi_MessageProperties_setRequestId( + messageProperties, charPtrFromPyStr(requestId) + ) -def blpapi_MessageFormatter_FormatMessageJson(formatter, message): - return _internals.blpapi_MessageFormatter_FormatMessageJson(formatter, message) -def blpapi_MessageFormatter_FormatMessageXml(formatter, message): - return _internals.blpapi_MessageFormatter_FormatMessageXml(formatter, message) +# signature: int blpapi_MessageProperties_setService(blpapi_MessageProperties_t *messageProperties,const blpapi_Service_t *service); +def _blpapi_MessageProperties_setService(messageProperties, service): + return l_blpapi_MessageProperties_setService(messageProperties, service) -def blpapi_MessageFormatter_copy(original): - return _internals.blpapi_MessageFormatter_copy(original) -def blpapi_MessageFormatter_assign(rhs): - return _internals.blpapi_MessageFormatter_assign(rhs) +# signature: int blpapi_MessageProperties_setTimeReceived(blpapi_MessageProperties_t *messageProperties,const blpapi_HighPrecisionDatetime_t *timestamp); +def _blpapi_MessageProperties_setTimeReceived(messageProperties, timestamp): + return l_blpapi_MessageProperties_setTimeReceived( + messageProperties, byref(timestamp) + ) -def blpapi_MessageFormatter_destroy(formatter): - return _internals.blpapi_MessageFormatter_destroy(formatter) -def blpapi_Session_subscribeEx_helper(session, subscriptionList, identity, requestLabel, errorAppenderCb): - return _internals.blpapi_Session_subscribeEx_helper(session, subscriptionList, identity, requestLabel, errorAppenderCb) +# signature: int blpapi_Message_addRef(const blpapi_Message_t *message); +def _blpapi_Message_addRef(message): + return l_blpapi_Message_addRef(message) -def blpapi_Session_resubscribeEx_helper(session, resubscriptionList, requestLabel, errorAppenderCb): - return _internals.blpapi_Session_resubscribeEx_helper(session, resubscriptionList, requestLabel, errorAppenderCb) -def blpapi_Session_resubscribeWithIdEx_helper(session, resubscriptionList, resubscriptionId, requestLabel, errorAppenderCb): - return _internals.blpapi_Session_resubscribeWithIdEx_helper(session, resubscriptionList, resubscriptionId, requestLabel, errorAppenderCb) +# signature: blpapi_CorrelationId_t blpapi_Message_correlationId(const blpapi_Message_t *message, size_t index); +def _blpapi_Message_correlationId(message, index): + # C does return ABIUtil::ptr(message)->correlationId(index).impl(); + # i.e., we need to bump the ref. -- the caller will wrap this in CorrelationId + cid = l_blpapi_Message_correlationId(message, c_size_t(index)) + return cid -def blpapi_AuthOptions_create_default(): - return _internals.blpapi_AuthOptions_create_default() -def blpapi_AuthOptions_create_forUserMode(user): - return _internals.blpapi_AuthOptions_create_forUserMode(user) +# signature: blpapi_Element_t *blpapi_Message_elements(const blpapi_Message_t *message); +def _blpapi_Message_elements(message): + return getHandleFromPtr(l_blpapi_Message_elements(message)) -def blpapi_AuthOptions_create_forAppMode(app): - return _internals.blpapi_AuthOptions_create_forAppMode(app) -def blpapi_AuthOptions_create_forUserAndAppMode(user, app): - return _internals.blpapi_AuthOptions_create_forUserAndAppMode(user, app) +# signature: int blpapi_Message_fragmentType(const blpapi_Message_t *message); +def _blpapi_Message_fragmentType(message): + return l_blpapi_Message_fragmentType(message) -def blpapi_AuthOptions_create_forToken(token): - return _internals.blpapi_AuthOptions_create_forToken(token) -def blpapi_AuthOptions_duplicate(dup): - return _internals.blpapi_AuthOptions_duplicate(dup) +# signature: int blpapi_Message_getRequestId(const blpapi_Message_t *message, const char **requestId); +def _blpapi_Message_getRequestId(message): + out = c_char_p() + outp = pointer(out) + retCode = l_blpapi_Message_getRequestId(message, outp) # int + return retCode, getStrFromOutput(outp, retCode) -def blpapi_AuthOptions_copy(lhs, rhs): - return _internals.blpapi_AuthOptions_copy(lhs, rhs) -def blpapi_AuthOptions_destroy(options): - return _internals.blpapi_AuthOptions_destroy(options) +# signature: blpapi_Name_t *blpapi_Message_messageType(const blpapi_Message_t *message); +def _blpapi_Message_messageType(message): + return getHandleFromPtr(l_blpapi_Message_messageType(message)) -def blpapi_AuthUser_createWithLogonName(): - return _internals.blpapi_AuthUser_createWithLogonName() -def blpapi_AuthUser_createWithActiveDirectoryProperty(propertyName): - return _internals.blpapi_AuthUser_createWithActiveDirectoryProperty(propertyName) +# signature: int blpapi_Message_numCorrelationIds(const blpapi_Message_t *message); +def _blpapi_Message_numCorrelationIds(message): + return l_blpapi_Message_numCorrelationIds(message) -def blpapi_AuthUser_createWithManualOptions(userId, ipAddress): - return _internals.blpapi_AuthUser_createWithManualOptions(userId, ipAddress) -def blpapi_AuthUser_duplicate(dup): - return _internals.blpapi_AuthUser_duplicate(dup) +# signature: +def _blpapi_Message_printHelper(message, level, spacesPerLevel): + return any_printer(message, l_blpapi_Message_print, level, spacesPerLevel) -def blpapi_AuthUser_copy(lhs, rhs): - return _internals.blpapi_AuthUser_copy(lhs, rhs) -def blpapi_AuthUser_destroy(user): - return _internals.blpapi_AuthUser_destroy(user) +# signature: int blpapi_Message_recapType(const blpapi_Message_t *message); +def _blpapi_Message_recapType(message): + return l_blpapi_Message_recapType(message) -def blpapi_AuthApplication_create(appName): - return _internals.blpapi_AuthApplication_create(appName) -def blpapi_AuthApplication_duplicate(dup): - return _internals.blpapi_AuthApplication_duplicate(dup) +# signature: int blpapi_Message_release(const blpapi_Message_t *message); +def _blpapi_Message_release(message): + return l_blpapi_Message_release(message) -def blpapi_AuthApplication_copy(lhs, rhs): - return _internals.blpapi_AuthApplication_copy(lhs, rhs) -def blpapi_AuthApplication_destroy(app): - return _internals.blpapi_AuthApplication_destroy(app) +# signature: blpapi_Service_t *blpapi_Message_service(const blpapi_Message_t *message); +def _blpapi_Message_service(message): + service = l_blpapi_Message_service(message) + return getHandleFromPtr(service) -def blpapi_AuthToken_create(tokenStr): - return _internals.blpapi_AuthToken_create(tokenStr) -def blpapi_AuthToken_duplicate(dup): - return _internals.blpapi_AuthToken_duplicate(dup) +# signature: int blpapi_Message_timeReceived(const blpapi_Message_t *message, blpapi_TimePoint_t *timeReceived); +def _blpapi_Message_timeReceived(message): + out = TimePoint() + outp = pointer(out) + retCode = l_blpapi_Message_timeReceived(message, outp) + return retCode, getStructFromOutput(outp, retCode) -def blpapi_AuthToken_copy(lhs, rhs): - return _internals.blpapi_AuthToken_copy(lhs, rhs) -def blpapi_AuthToken_destroy(token): - return _internals.blpapi_AuthToken_destroy(token) -UNKNOWN_CLASS = _internals.UNKNOWN_CLASS -INVALIDSTATE_CLASS = _internals.INVALIDSTATE_CLASS -INVALIDARG_CLASS = _internals.INVALIDARG_CLASS -IOERROR_CLASS = _internals.IOERROR_CLASS -CNVERROR_CLASS = _internals.CNVERROR_CLASS -BOUNDSERROR_CLASS = _internals.BOUNDSERROR_CLASS -NOTFOUND_CLASS = _internals.NOTFOUND_CLASS -FLDNOTFOUND_CLASS = _internals.FLDNOTFOUND_CLASS -UNSUPPORTED_CLASS = _internals.UNSUPPORTED_CLASS -ERROR_UNKNOWN = _internals.ERROR_UNKNOWN -ERROR_ILLEGAL_ARG = _internals.ERROR_ILLEGAL_ARG -ERROR_ILLEGAL_ACCESS = _internals.ERROR_ILLEGAL_ACCESS -ERROR_INVALID_SESSION = _internals.ERROR_INVALID_SESSION -ERROR_DUPLICATE_CORRELATIONID = _internals.ERROR_DUPLICATE_CORRELATIONID -ERROR_INTERNAL_ERROR = _internals.ERROR_INTERNAL_ERROR -ERROR_RESOLVE_FAILED = _internals.ERROR_RESOLVE_FAILED -ERROR_CONNECT_FAILED = _internals.ERROR_CONNECT_FAILED -ERROR_ILLEGAL_STATE = _internals.ERROR_ILLEGAL_STATE -ERROR_CODEC_FAILURE = _internals.ERROR_CODEC_FAILURE -ERROR_INDEX_OUT_OF_RANGE = _internals.ERROR_INDEX_OUT_OF_RANGE -ERROR_INVALID_CONVERSION = _internals.ERROR_INVALID_CONVERSION -ERROR_ITEM_NOT_FOUND = _internals.ERROR_ITEM_NOT_FOUND -ERROR_IO_ERROR = _internals.ERROR_IO_ERROR -ERROR_CORRELATION_NOT_FOUND = _internals.ERROR_CORRELATION_NOT_FOUND -ERROR_SERVICE_NOT_FOUND = _internals.ERROR_SERVICE_NOT_FOUND -ERROR_LOGON_LOOKUP_FAILED = _internals.ERROR_LOGON_LOOKUP_FAILED -ERROR_DS_LOOKUP_FAILED = _internals.ERROR_DS_LOOKUP_FAILED -ERROR_UNSUPPORTED_OPERATION = _internals.ERROR_UNSUPPORTED_OPERATION -ERROR_DS_PROPERTY_NOT_FOUND = _internals.ERROR_DS_PROPERTY_NOT_FOUND -ERROR_MSG_TOO_LARGE = _internals.ERROR_MSG_TOO_LARGE +# signature: const char *blpapi_Message_topicName(const blpapi_Message_t *message); +def _blpapi_Message_topicName(message): # pylint: disable=unused-argument + return "" # that is what C does -def blpapi_getLastErrorDescription(resultCode): - return _internals.blpapi_getLastErrorDescription(resultCode) -def blpapi_Socks5Config_create(hostname, hostname_size, port): - return _internals.blpapi_Socks5Config_create(hostname, hostname_size, port) +# signature: blpapi_Name_t *blpapi_Name_create(const char *nameString); +def _blpapi_Name_create(nameString): + return getHandleFromPtr(l_blpapi_Name_create(charPtrFromPyStr(nameString))) -def blpapi_Socks5Config_destroy(socks5Config): - return _internals.blpapi_Socks5Config_destroy(socks5Config) -def blpapi_SessionOptions_create(): - return _internals.blpapi_SessionOptions_create() +# signature: void blpapi_Name_destroy(blpapi_Name_t *name); +def _blpapi_Name_destroy(name): + l_blpapi_Name_destroy(name) -def blpapi_SessionOptions_destroy(parameters): - return _internals.blpapi_SessionOptions_destroy(parameters) -def blpapi_SessionOptions_setServerHost(parameters, serverHost): - return _internals.blpapi_SessionOptions_setServerHost(parameters, serverHost) +# signature: int blpapi_Name_equalsStr(const blpapi_Name_t *name, const char *string); +def _blpapi_Name_equalsStr(name, string): + return l_blpapi_Name_equalsStr(name, charPtrFromPyStr(string)) -def blpapi_SessionOptions_setServerPort(parameters, serverPort): - return _internals.blpapi_SessionOptions_setServerPort(parameters, serverPort) -def blpapi_SessionOptions_setServerAddress(parameters, serverHost, serverPort, index): - return _internals.blpapi_SessionOptions_setServerAddress(parameters, serverHost, serverPort, index) +# signature: blpapi_Name_t *blpapi_Name_findName(const char *nameString); +def _blpapi_Name_findName(nameString): + return getHandleFromPtr( + l_blpapi_Name_findName(charPtrFromPyStr(nameString)) + ) -def blpapi_SessionOptions_setServerAddressWithProxy(parameters, serverHost, serverPort, socks5Config, index): - return _internals.blpapi_SessionOptions_setServerAddressWithProxy(parameters, serverHost, serverPort, socks5Config, index) -def blpapi_SessionOptions_removeServerAddress(parameters, index): - return _internals.blpapi_SessionOptions_removeServerAddress(parameters, index) +# signature: +def _blpapi_Name_hasName(nameString): + handle = _blpapi_Name_findName(nameString) + return 0 if handle is None else 1 -def blpapi_SessionOptions_setConnectTimeout(parameters, timeoutInMilliseconds): - return _internals.blpapi_SessionOptions_setConnectTimeout(parameters, timeoutInMilliseconds) -def blpapi_SessionOptions_setDefaultServices(parameters, defaultServices): - return _internals.blpapi_SessionOptions_setDefaultServices(parameters, defaultServices) +# signature: size_t blpapi_Name_length(const blpapi_Name_t *name); +def _blpapi_Name_length(name): + return l_blpapi_Name_length(name) -def blpapi_SessionOptions_setDefaultSubscriptionService(parameters, serviceIdentifier): - return _internals.blpapi_SessionOptions_setDefaultSubscriptionService(parameters, serviceIdentifier) -def blpapi_SessionOptions_setDefaultTopicPrefix(parameters, prefix): - return _internals.blpapi_SessionOptions_setDefaultTopicPrefix(parameters, prefix) +# signature: const char *blpapi_Name_string(const blpapi_Name_t *name); +def _blpapi_Name_string(name): + # C does not check the pointer, simply reinterpret_casts it + # c_void_p().value and c_void_p(0).value are None + if name is None or name.value is None: + return None + return getStrFromC(l_blpapi_Name_string(name)) -def blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg(parameters, allowMultipleCorrelatorsPerMsg): - return _internals.blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg(parameters, allowMultipleCorrelatorsPerMsg) -def blpapi_SessionOptions_setClientMode(parameters, clientMode): - return _internals.blpapi_SessionOptions_setClientMode(parameters, clientMode) +# signature: const char *blpapi_Operation_description(blpapi_Operation_t *operation); +def _blpapi_Operation_description(operation): + # tests assume empty string + return getStrFromC(l_blpapi_Operation_description(operation), "") -def blpapi_SessionOptions_setMaxPendingRequests(parameters, maxPendingRequests): - return _internals.blpapi_SessionOptions_setMaxPendingRequests(parameters, maxPendingRequests) -def blpapi_SessionOptions_setAutoRestartOnDisconnection(parameters, autoRestart): - return _internals.blpapi_SessionOptions_setAutoRestartOnDisconnection(parameters, autoRestart) +# signature: const char *blpapi_Operation_name(blpapi_Operation_t *operation); +def _blpapi_Operation_name(operation): + return getStrFromC(l_blpapi_Operation_name(operation)) -def blpapi_SessionOptions_setSessionIdentityOptions(parameters, authOptions, cid): - return _internals.blpapi_SessionOptions_setSessionIdentityOptions(parameters, authOptions, cid) -def blpapi_SessionOptions_setAuthenticationOptions(parameters, authOptions): - return _internals.blpapi_SessionOptions_setAuthenticationOptions(parameters, authOptions) +# signature: int blpapi_Operation_numResponseDefinitions(blpapi_Operation_t *operation); +def _blpapi_Operation_numResponseDefinitions(operation): + return l_blpapi_Operation_numResponseDefinitions(operation) -def blpapi_SessionOptions_setNumStartAttempts(parameters, numStartAttempts): - return _internals.blpapi_SessionOptions_setNumStartAttempts(parameters, numStartAttempts) -def blpapi_SessionOptions_setMaxEventQueueSize(parameters, maxEventQueueSize): - return _internals.blpapi_SessionOptions_setMaxEventQueueSize(parameters, maxEventQueueSize) +# signature: int blpapi_Operation_requestDefinition(blpapi_Operation_t *operation,blpapi_SchemaElementDefinition_t **requestDefinition); +def _blpapi_Operation_requestDefinition(operation): + out = c_void_p() + outp = pointer(out) + retCode = l_blpapi_Operation_requestDefinition(operation, outp) + return retCode, getHandleFromOutput(outp, retCode) -def blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark(parameters, hiWaterMark): - return _internals.blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark(parameters, hiWaterMark) -def blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark(parameters, loWaterMark): - return _internals.blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark(parameters, loWaterMark) +# signature: int blpapi_Operation_responseDefinition(blpapi_Operation_t *operation,blpapi_SchemaElementDefinition_t **responseDefinition,size_t index); +def _blpapi_Operation_responseDefinition(operation, index): + out = c_void_p() + outp = pointer(out) + retCode = l_blpapi_Operation_responseDefinition( + operation, outp, c_size_t(index) + ) + return retCode, getHandleFromOutput(outp, retCode) -def blpapi_SessionOptions_setDefaultKeepAliveInactivityTime(parameters, inactivityMsecs): - return _internals.blpapi_SessionOptions_setDefaultKeepAliveInactivityTime(parameters, inactivityMsecs) -def blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout(parameters, timeoutMsecs): - return _internals.blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout(parameters, timeoutMsecs) +# signature: int blpapi_Operation_responseDefinitionFromName(blpapi_Operation_t *operation,blpapi_SchemaElementDefinition_t **responseDefinition,const blpapi_Name_t *name); +def _blpapi_Operation_responseDefinitionFromName(operation, name): + raise NotImplementedError("not called") -def blpapi_SessionOptions_setKeepAliveEnabled(parameters, isEnabled): - return _internals.blpapi_SessionOptions_setKeepAliveEnabled(parameters, isEnabled) -def blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes(parameters, shouldRecord): - return _internals.blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes(parameters, shouldRecord) +# signature: int blpapi_ProviderSession_activateSubServiceCodeRange(blpapi_ProviderSession_t *session,const char *serviceName,int begin,int end,int priority); +def _blpapi_ProviderSession_activateSubServiceCodeRange( + session, serviceName, begin, end, priority +): + return l_blpapi_ProviderSession_activateSubServiceCodeRange( + session, charPtrFromPyStr(serviceName), begin, end, priority + ) -def blpapi_SessionOptions_setServiceCheckTimeout(paramaters, timeoutMsecs): - return _internals.blpapi_SessionOptions_setServiceCheckTimeout(paramaters, timeoutMsecs) -def blpapi_SessionOptions_setServiceDownloadTimeout(paramaters, timeoutMsecs): - return _internals.blpapi_SessionOptions_setServiceDownloadTimeout(paramaters, timeoutMsecs) +# signature: int blpapi_ProviderSession_createServiceStatusTopic(blpapi_ProviderSession_t *session,const blpapi_Service_t *service,blpapi_Topic_t **topic); +def _blpapi_ProviderSession_createServiceStatusTopic(session, service): + out = c_void_p() + outp = pointer(out) + retCode = l_blpapi_ProviderSession_createServiceStatusTopic( + session, service, outp + ) + return retCode, getHandleFromOutput(outp, retCode) -def blpapi_SessionOptions_setTlsOptions(paramaters, tlsOptions): - return _internals.blpapi_SessionOptions_setTlsOptions(paramaters, tlsOptions) -def blpapi_SessionOptions_setFlushPublishedEventsTimeout(paramaters, timeoutMsecs): - return _internals.blpapi_SessionOptions_setFlushPublishedEventsTimeout(paramaters, timeoutMsecs) +# signature: int blpapi_ProviderSession_createTopics(blpapi_ProviderSession_t *session,blpapi_TopicList_t *topicList,int resolveMode,const blpapi_Identity_t *identity); +def _blpapi_ProviderSession_createTopic(session, message): + raise NotImplementedError("not called") -def blpapi_SessionOptions_setBandwidthSaveModeDisabled(parameters, disableBandwidthSaveMode): - return _internals.blpapi_SessionOptions_setBandwidthSaveModeDisabled(parameters, disableBandwidthSaveMode) -def blpapi_SessionOptions_serverHost(parameters): - return _internals.blpapi_SessionOptions_serverHost(parameters) +# signature: int blpapi_ProviderSession_createTopics(blpapi_ProviderSession_t *session,blpapi_TopicList_t *topicList,int resolveMode,const blpapi_Identity_t *identity); +def _blpapi_ProviderSession_createTopics( + session, topicList, resolveMode, identity +): + return l_blpapi_ProviderSession_createTopics( + session, topicList, c_int(resolveMode), identity + ) -def blpapi_SessionOptions_serverPort(parameters): - return _internals.blpapi_SessionOptions_serverPort(parameters) -def blpapi_SessionOptions_numServerAddresses(parameters): - return _internals.blpapi_SessionOptions_numServerAddresses(parameters) +# signature: int blpapi_ProviderSession_createTopicsAsync(blpapi_ProviderSession_t *session,const blpapi_TopicList_t *topicList,int resolveMode,const blpapi_Identity_t *identity); +def _blpapi_ProviderSession_createTopicsAsync( + session, topicList, resolveMode, identity +): + return l_blpapi_ProviderSession_createTopicsAsync( + session, topicList, c_int(resolveMode), identity + ) -def blpapi_SessionOptions_getServerAddressWithProxy(parameters, index): - return _internals.blpapi_SessionOptions_getServerAddressWithProxy(parameters, index) -def blpapi_SessionOptions_connectTimeout(parameters): - return _internals.blpapi_SessionOptions_connectTimeout(parameters) +# signature: int blpapi_ProviderSession_deactivateSubServiceCodeRange(blpapi_ProviderSession_t *session,const char *serviceName,int begin,int end); +def _blpapi_ProviderSession_deactivateSubServiceCodeRange( + session, serviceName, begin, end +): + return l_blpapi_ProviderSession_deactivateSubServiceCodeRange( + session, charPtrFromPyStr(serviceName), begin, end + ) + -def blpapi_SessionOptions_defaultServices(parameters): - return _internals.blpapi_SessionOptions_defaultServices(parameters) +# signature: int blpapi_ProviderSession_deleteTopics(blpapi_ProviderSession_t *session,const blpapi_Topic_t **topics,size_t numTopics); +def _blpapi_ProviderSession_deleteTopics(session, topics): + # topics is a python list of handles by now + sz = len(topics) + arraytpe = c_void_p * sz + topicsp = arraytpe(*topics) + return l_blpapi_ProviderSession_deleteTopics( + session, topicsp, c_size_t(sz) + ) -def blpapi_SessionOptions_defaultSubscriptionService(parameters): - return _internals.blpapi_SessionOptions_defaultSubscriptionService(parameters) -def blpapi_SessionOptions_defaultTopicPrefix(parameters): - return _internals.blpapi_SessionOptions_defaultTopicPrefix(parameters) +# signature: int blpapi_ProviderSession_deregisterService(blpapi_ProviderSession_t *session, const char *serviceName); +def _blpapi_ProviderSession_deregisterService(session, serviceName): + return l_blpapi_ProviderSession_deregisterService( + session, charPtrFromPyStr(serviceName) + ) + -def blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg(parameters): - return _internals.blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg(parameters) +# signature: int blpapi_ProviderSession_flushPublishedEvents(blpapi_ProviderSession_t *session, int *allFlushed, int timeoutMsecs); +def _blpapi_ProviderSession_flushPublishedEvents(session, timeoutMsecs): + out = c_int() + outp = pointer(out) + retCode = l_blpapi_ProviderSession_flushPublishedEvents( + session, outp, timeoutMsecs + ) + return retCode, getPODFromOutput(outp, retCode) -def blpapi_SessionOptions_clientMode(parameters): - return _internals.blpapi_SessionOptions_clientMode(parameters) -def blpapi_SessionOptions_maxPendingRequests(parameters): - return _internals.blpapi_SessionOptions_maxPendingRequests(parameters) +# signature: blpapi_AbstractSession_t *blpapi_ProviderSession_getAbstractSession(blpapi_ProviderSession_t *session); +def _blpapi_ProviderSession_getAbstractSession(session): + return getHandleFromPtr( + l_blpapi_ProviderSession_getAbstractSession(session) + ) -def blpapi_SessionOptions_autoRestartOnDisconnection(parameters): - return _internals.blpapi_SessionOptions_autoRestartOnDisconnection(parameters) -def blpapi_SessionOptions_authenticationOptions(parameters): - return _internals.blpapi_SessionOptions_authenticationOptions(parameters) +# signature: int blpapi_ProviderSession_getTopic(blpapi_ProviderSession_t *session,const blpapi_Message_t *message,blpapi_Topic_t **topic); +def _blpapi_ProviderSession_getTopic(session, message): + out = c_void_p() + outp = pointer(out) + retCode = l_blpapi_ProviderSession_getTopic(session, message, outp) + return retCode, getHandleFromOutput(outp, retCode) -def blpapi_SessionOptions_numStartAttempts(parameters): - return _internals.blpapi_SessionOptions_numStartAttempts(parameters) -def blpapi_SessionOptions_maxEventQueueSize(parameters): - return _internals.blpapi_SessionOptions_maxEventQueueSize(parameters) +# signature: int blpapi_ProviderSession_nextEvent(blpapi_ProviderSession_t *session,blpapi_Event_t **eventPointer,unsigned int timeoutInMilliseconds); +def _blpapi_ProviderSession_nextEvent(session, timeoutInMilliseconds): + eventptr = c_void_p() + outp = pointer(eventptr) + retCode = l_blpapi_ProviderSession_nextEvent( + session, outp, c_uint(timeoutInMilliseconds) + ) + return retCode, getHandleFromOutput(outp, retCode) + + +# signature: int blpapi_ProviderSession_publish(blpapi_ProviderSession_t *session, blpapi_Event_t *event); +def _blpapi_ProviderSession_publish(session, event): + return l_blpapi_ProviderSession_publish(session, event) -def blpapi_SessionOptions_slowConsumerWarningHiWaterMark(parameters): - return _internals.blpapi_SessionOptions_slowConsumerWarningHiWaterMark(parameters) -def blpapi_SessionOptions_slowConsumerWarningLoWaterMark(parameters): - return _internals.blpapi_SessionOptions_slowConsumerWarningLoWaterMark(parameters) +# signature: int blpapi_ProviderSession_registerService(blpapi_ProviderSession_t *session,const char *serviceName,const blpapi_Identity_t *identity,blpapi_ServiceRegistrationOptions_t *registrationOptions); +def _blpapi_ProviderSession_registerService( + session, serviceName, identity, registrationOptions +): + return l_blpapi_ProviderSession_registerService( + session, charPtrFromPyStr(serviceName), identity, registrationOptions + ) -def blpapi_SessionOptions_defaultKeepAliveInactivityTime(parameters): - return _internals.blpapi_SessionOptions_defaultKeepAliveInactivityTime(parameters) -def blpapi_SessionOptions_defaultKeepAliveResponseTimeout(parameters): - return _internals.blpapi_SessionOptions_defaultKeepAliveResponseTimeout(parameters) +# signature: int blpapi_ProviderSession_registerServiceAsync(blpapi_ProviderSession_t *session,const char *serviceName,const blpapi_Identity_t *identity,blpapi_CorrelationId_t *correlationId,blpapi_ServiceRegistrationOptions_t *registrationOptions); +def _blpapi_ProviderSession_registerServiceAsync( + session, serviceName, identity, correlationId, registrationOptions +): + # the C layer will OVERWRITE cid with autogen for unset + cidp = pointer(correlationId.thestruct) -def blpapi_SessionOptions_keepAliveEnabled(parameters): - return _internals.blpapi_SessionOptions_keepAliveEnabled(parameters) + return l_blpapi_ProviderSession_registerServiceAsync( + session, + charPtrFromPyStr(serviceName), + identity, + cidp, + registrationOptions, + ) -def blpapi_SessionOptions_recordSubscriptionDataReceiveTimes(parameters): - return _internals.blpapi_SessionOptions_recordSubscriptionDataReceiveTimes(parameters) -def blpapi_SessionOptions_serviceCheckTimeout(parameters): - return _internals.blpapi_SessionOptions_serviceCheckTimeout(parameters) +# signature: int blpapi_ProviderSession_resolve(blpapi_ProviderSession_t *session,blpapi_ResolutionList_t *resolutionList,int resolveMode,const blpapi_Identity_t *identity); +def _blpapi_ProviderSession_resolve( + session, resolutionList, resolveMode, identity +): + return l_blpapi_ProviderSession_resolve( + session, resolutionList, c_int(resolveMode), identity + ) -def blpapi_SessionOptions_serviceDownloadTimeout(parameters): - return _internals.blpapi_SessionOptions_serviceDownloadTimeout(parameters) -def blpapi_SessionOptions_flushPublishedEventsTimeout(parameters): - return _internals.blpapi_SessionOptions_flushPublishedEventsTimeout(parameters) +# signature: int blpapi_ProviderSession_resolveAsync(blpapi_ProviderSession_t *session,const blpapi_ResolutionList_t *resolutionList,int resolveMode,const blpapi_Identity_t *identity); +def _blpapi_ProviderSession_resolveAsync( + session, resolutionList, resolveMode, identity +): + return l_blpapi_ProviderSession_resolveAsync( + session, resolutionList, c_int(resolveMode), identity + ) -def blpapi_SessionOptions_bandwidthSaveModeDisabled(parameters): - return _internals.blpapi_SessionOptions_bandwidthSaveModeDisabled(parameters) -def blpapi_SessionOptions_setApplicationIdentityKey(parameters, applicationIdentityKey): - return _internals.blpapi_SessionOptions_setApplicationIdentityKey(parameters, applicationIdentityKey) +# signature: int blpapi_ProviderSession_sendResponse(blpapi_ProviderSession_t *session,blpapi_Event_t *event,int isPartialResponse); +def _blpapi_ProviderSession_sendResponse(session, event, isPartialResponse): + return l_blpapi_ProviderSession_sendResponse( + session, event, c_int(isPartialResponse) + ) -def blpapi_SessionOptions_applicationIdentityKey(parameters): - return _internals.blpapi_SessionOptions_applicationIdentityKey(parameters) -def blpapi_SessionOptions_setSessionName(parameters, sessionName): - return _internals.blpapi_SessionOptions_setSessionName(parameters, sessionName) +# signature: int blpapi_ProviderSession_start(blpapi_ProviderSession_t *session); +def _blpapi_ProviderSession_start(session): + return l_blpapi_ProviderSession_start(session) -def blpapi_SessionOptions_sessionName(parameters): - return _internals.blpapi_SessionOptions_sessionName(parameters) -def blpapi_TlsOptions_destroy(parameters): - return _internals.blpapi_TlsOptions_destroy(parameters) +# signature: int blpapi_ProviderSession_startAsync(blpapi_ProviderSession_t *session); +def _blpapi_ProviderSession_startAsync(session): + return l_blpapi_ProviderSession_startAsync(session) -def blpapi_TlsOptions_createFromFiles(clientCredentialsFileName, clientCredentialsPassword, trustedCertificatesFileName): - return _internals.blpapi_TlsOptions_createFromFiles(clientCredentialsFileName, clientCredentialsPassword, trustedCertificatesFileName) -def blpapi_TlsOptions_createFromBlobs(clientCredentialsRawData, clientCredentialsPassword, trustedCertificatesRawData): - return _internals.blpapi_TlsOptions_createFromBlobs(clientCredentialsRawData, clientCredentialsPassword, trustedCertificatesRawData) +# signature: int blpapi_ProviderSession_stop(blpapi_ProviderSession_t *session); +def _blpapi_ProviderSession_stop(session): + return l_blpapi_ProviderSession_stop(session) -def blpapi_TlsOptions_setTlsHandshakeTimeoutMs(paramaters, tlsHandshakeTimeoutMs): - return _internals.blpapi_TlsOptions_setTlsHandshakeTimeoutMs(paramaters, tlsHandshakeTimeoutMs) -def blpapi_TlsOptions_setCrlFetchTimeoutMs(paramaters, crlFetchTimeoutMs): - return _internals.blpapi_TlsOptions_setCrlFetchTimeoutMs(paramaters, crlFetchTimeoutMs) +# signature: int blpapi_ProviderSession_stopAsync(blpapi_ProviderSession_t *session); +def _blpapi_ProviderSession_stopAsync(session): + return l_blpapi_ProviderSession_stopAsync(session) -def blpapi_Name_create(nameString): - return _internals.blpapi_Name_create(nameString) -def blpapi_Name_destroy(name): - return _internals.blpapi_Name_destroy(name) +def _blpapi_ProviderSession_terminateSubscriptionsOnTopic( + session, topic, message +): + return _blpapi_ProviderSession_terminateSubscriptionsOnTopics( + session, [topic], message + ) -def blpapi_Name_equalsStr(name, string): - return _internals.blpapi_Name_equalsStr(name, string) -def blpapi_Name_string(name): - return _internals.blpapi_Name_string(name) +# signature: int blpapi_ProviderSession_terminateSubscriptionsOnTopics(blpapi_ProviderSession_t *session,const blpapi_Topic_t **topics,size_t numTopics,const char *message); +def _blpapi_ProviderSession_terminateSubscriptionsOnTopics( + session, topics, message +): + # we put handles in providersession inside topics + sz = len(topics) + arraytype = c_void_p * sz + topicsp = arraytype(*topics) + return l_blpapi_ProviderSession_terminateSubscriptionsOnTopics( + session, topicsp, c_size_t(sz), charPtrFromPyStr(message) + ) -def blpapi_Name_length(name): - return _internals.blpapi_Name_length(name) -def blpapi_Name_findName(nameString): - return _internals.blpapi_Name_findName(nameString) +# signature: int blpapi_ProviderSession_tryNextEvent(blpapi_ProviderSession_t *session, blpapi_Event_t **eventPointer); +def _blpapi_ProviderSession_tryNextEvent(session): + out = c_void_p() + outp = pointer(out) + retCode = l_blpapi_ProviderSession_tryNextEvent(session, outp) + return retCode, getHandleFromOutput(outp, retCode) -def blpapi_SubscriptionList_create(): - return _internals.blpapi_SubscriptionList_create() -def blpapi_SubscriptionList_destroy(list): - return _internals.blpapi_SubscriptionList_destroy(list) +# signature: int blpapi_RequestTemplate_release(const blpapi_RequestTemplate_t *requestTemplate); +def _blpapi_RequestTemplate_release(requestTemplate): + return l_blpapi_RequestTemplate_release(requestTemplate) -def blpapi_SubscriptionList_addResolved(list, subscriptionString, correlationId): - return _internals.blpapi_SubscriptionList_addResolved(list, subscriptionString, correlationId) -def blpapi_SubscriptionList_clear(list): - return _internals.blpapi_SubscriptionList_clear(list) +# signature: void blpapi_Request_destroy(blpapi_Request_t *request); +def _blpapi_Request_destroy(request): + l_blpapi_Request_destroy(request) -def blpapi_SubscriptionList_append(dest, src): - return _internals.blpapi_SubscriptionList_append(dest, src) -def blpapi_SubscriptionList_size(list): - return _internals.blpapi_SubscriptionList_size(list) +# signature: blpapi_Element_t *blpapi_Request_elements(blpapi_Request_t *request); +def _blpapi_Request_elements(request): + return getHandleFromPtr(l_blpapi_Request_elements(request)) -def blpapi_SubscriptionList_correlationIdAt(list, index): - return _internals.blpapi_SubscriptionList_correlationIdAt(list, index) -def blpapi_SubscriptionList_topicStringAt(list, index): - return _internals.blpapi_SubscriptionList_topicStringAt(list, index) +# signature: int blpapi_Request_getRequestId(const blpapi_Request_t *request, const char **requestId); +def _blpapi_Request_getRequestId(request): + out = c_char_p() + outp = pointer(out) + retCode = l_blpapi_Request_getRequestId(request, outp) + if retCode != 0: + return retCode, None + return (retCode, getStrFromOutput(outp, retCode)) -def blpapi_SubscriptionList_isResolvedAt(list, index): - return _internals.blpapi_SubscriptionList_isResolvedAt(list, index) -class blpapi_TimePoint(object): - thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") - __repr__ = _swig_repr - d_value = property(_internals.blpapi_TimePoint_d_value_get, _internals.blpapi_TimePoint_d_value_set) - def __init__(self): - _internals.blpapi_TimePoint_swiginit(self, _internals.new_blpapi_TimePoint()) - __swig_destroy__ = _internals.delete_blpapi_TimePoint +# signature: void blpapi_Request_setPreferredRoute(blpapi_Request_t *request, blpapi_CorrelationId_t *correlationId); +def _blpapi_Request_setPreferredRoute(request, correlationId): + raise NotImplementedError("not called") -# Register blpapi_TimePoint in _internals: -_internals.blpapi_TimePoint_swigregister(blpapi_TimePoint) +# signature: int blpapi_ResolutionList_add(blpapi_ResolutionList_t *list,const char *topic,const blpapi_CorrelationId_t *correlationId); +def _blpapi_ResolutionList_add(resolution_list, topic, correlationId): + return l_blpapi_ResolutionList_add( + resolution_list, + charPtrFromPyStr(topic), + byref(correlationId.thestruct), + ) -def blpapi_TimePointUtil_nanosecondsBetween(start, end): - return _internals.blpapi_TimePointUtil_nanosecondsBetween(start, end) -class blpapi_Datetime_tag(object): - thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") - __repr__ = _swig_repr - parts = property(_internals.blpapi_Datetime_tag_parts_get, _internals.blpapi_Datetime_tag_parts_set) - hours = property(_internals.blpapi_Datetime_tag_hours_get, _internals.blpapi_Datetime_tag_hours_set) - minutes = property(_internals.blpapi_Datetime_tag_minutes_get, _internals.blpapi_Datetime_tag_minutes_set) - seconds = property(_internals.blpapi_Datetime_tag_seconds_get, _internals.blpapi_Datetime_tag_seconds_set) - milliSeconds = property(_internals.blpapi_Datetime_tag_milliSeconds_get, _internals.blpapi_Datetime_tag_milliSeconds_set) - month = property(_internals.blpapi_Datetime_tag_month_get, _internals.blpapi_Datetime_tag_month_set) - day = property(_internals.blpapi_Datetime_tag_day_get, _internals.blpapi_Datetime_tag_day_set) - year = property(_internals.blpapi_Datetime_tag_year_get, _internals.blpapi_Datetime_tag_year_set) - offset = property(_internals.blpapi_Datetime_tag_offset_get, _internals.blpapi_Datetime_tag_offset_set) - def __init__(self): - _internals.blpapi_Datetime_tag_swiginit(self, _internals.new_blpapi_Datetime_tag()) - __swig_destroy__ = _internals.delete_blpapi_Datetime_tag +# signature: int blpapi_ResolutionList_addAttribute(blpapi_ResolutionList_t *list, const blpapi_Name_t *name); +def _blpapi_ResolutionList_addAttribute(resolution_list, name): + return l_blpapi_ResolutionList_addAttribute(resolution_list, name) -# Register blpapi_Datetime_tag in _internals: -_internals.blpapi_Datetime_tag_swigregister(blpapi_Datetime_tag) -class blpapi_HighPrecisionDatetime_tag(object): - thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") - __repr__ = _swig_repr - datetime = property(_internals.blpapi_HighPrecisionDatetime_tag_datetime_get, _internals.blpapi_HighPrecisionDatetime_tag_datetime_set) - picoseconds = property(_internals.blpapi_HighPrecisionDatetime_tag_picoseconds_get, _internals.blpapi_HighPrecisionDatetime_tag_picoseconds_set) +# signature: int blpapi_ResolutionList_addFromMessage(blpapi_ResolutionList_t *list,const blpapi_Message_t *topic,const blpapi_CorrelationId_t *correlationId); +def _blpapi_ResolutionList_addFromMessage(resolution_list, topic, cid): + return l_blpapi_ResolutionList_addFromMessage( + resolution_list, + topic, + byref(cid.thestruct), + ) - def __init__(self): - _internals.blpapi_HighPrecisionDatetime_tag_swiginit(self, _internals.new_blpapi_HighPrecisionDatetime_tag()) - __swig_destroy__ = _internals.delete_blpapi_HighPrecisionDatetime_tag -# Register blpapi_HighPrecisionDatetime_tag in _internals: -_internals.blpapi_HighPrecisionDatetime_tag_swigregister(blpapi_HighPrecisionDatetime_tag) +# signature: int blpapi_ResolutionList_attribute(const blpapi_ResolutionList_t *list,blpapi_Element_t **element,const blpapi_Name_t *attribute,const blpapi_CorrelationId_t *id); +def _blpapi_ResolutionList_attribute(resolution_list, attribute, cid): + out = c_void_p() + outp = pointer(out) + rc = l_blpapi_ResolutionList_attribute( + resolution_list, + outp, + attribute, + byref(cid.thestruct), + ) + return rc, getHandleFromOutput(outp, rc) -def blpapi_HighPrecisionDatetime_compare(lhs, rhs): - return _internals.blpapi_HighPrecisionDatetime_compare(lhs, rhs) -def blpapi_HighPrecisionDatetime_print(datetime, streamWriter, stream, level, spacesPerLevel): - return _internals.blpapi_HighPrecisionDatetime_print(datetime, streamWriter, stream, level, spacesPerLevel) +# signature: int blpapi_ResolutionList_attributeAt(const blpapi_ResolutionList_t *list,blpapi_Element_t **element,const blpapi_Name_t *attribute,size_t index); +def _blpapi_ResolutionList_attributeAt(resolution_list, attribute, index): + out = c_void_p() + outp = pointer(out) + rc = l_blpapi_ResolutionList_attributeAt( + resolution_list, outp, attribute, c_size_t(index) + ) -def blpapi_HighPrecisionDatetime_fromTimePoint(datetime, offset): - return _internals.blpapi_HighPrecisionDatetime_fromTimePoint(datetime, offset) + return rc, getHandleFromOutput(outp, rc) -def blpapi_Constant_name(constant): - return _internals.blpapi_Constant_name(constant) -def blpapi_Constant_description(constant): - return _internals.blpapi_Constant_description(constant) +# signature: int blpapi_ResolutionList_correlationIdAt(const blpapi_ResolutionList_t *list,blpapi_CorrelationId_t *result,size_t index); +def _blpapi_ResolutionList_correlationIdAt(resolution_list, index): + cid = CidStruct() + cid_p = pointer(cid) + rc = l_blpapi_ResolutionList_correlationIdAt( + resolution_list, cid_p, c_size_t(index) + ) + if rc == 0: + # C will do: *result = rlImpl->correlationId(index).impl(), + # i.e., we need to bump the reference + # the caller will wrap this in CorrelationId + return rc, cid + return rc, None -def blpapi_Constant_status(constant): - return _internals.blpapi_Constant_status(constant) -def blpapi_Constant_datatype(constant): - return _internals.blpapi_Constant_datatype(constant) +# signature: blpapi_ResolutionList_t *blpapi_ResolutionList_create(blpapi_ResolutionList_t *from); +def _blpapi_ResolutionList_create(_from): + from_p = c_void_p() if _from is None else _from + return getHandleFromPtr(l_blpapi_ResolutionList_create(from_p)) -def blpapi_Constant_getValueAsChar(constant): - return _internals.blpapi_Constant_getValueAsChar(constant) -def blpapi_Constant_getValueAsInt32(constant): - return _internals.blpapi_Constant_getValueAsInt32(constant) +# signature: void blpapi_ResolutionList_destroy(blpapi_ResolutionList_t *list); +def _blpapi_ResolutionList_destroy(resolution_list): + l_blpapi_ResolutionList_destroy(resolution_list) -def blpapi_Constant_getValueAsInt64(constant): - return _internals.blpapi_Constant_getValueAsInt64(constant) -def blpapi_Constant_getValueAsFloat32(constant): - return _internals.blpapi_Constant_getValueAsFloat32(constant) +# signature: blpapi_Element_t *blpapi_ResolutionList_extractAttributeFromResolutionSuccess(const blpapi_Message_t *message, const blpapi_Name_t *attribute); +def _blpapi_ResolutionList_extractAttributeFromResolutionSuccess( + message, attribute +): + raise DeprecationWarning() -def blpapi_Constant_getValueAsFloat64(constant): - return _internals.blpapi_Constant_getValueAsFloat64(constant) -def blpapi_Constant_getValueAsDatetime(constant): - return _internals.blpapi_Constant_getValueAsDatetime(constant) +# signature: int blpapi_ResolutionList_message(const blpapi_ResolutionList_t *list,blpapi_Message_t **element,const blpapi_CorrelationId_t *id); +def _blpapi_ResolutionList_message(resolution_list, cid): + out = c_void_p() + outp = pointer(out) + rc = l_blpapi_ResolutionList_message( + resolution_list, outp, byref(cid.thestruct) + ) + return rc, getHandleFromOutput(outp, rc) -def blpapi_Constant_getValueAsString(constant): - return _internals.blpapi_Constant_getValueAsString(constant) -def blpapi_ConstantList_name(list): - return _internals.blpapi_ConstantList_name(list) +# signature: int blpapi_ResolutionList_messageAt(const blpapi_ResolutionList_t *list,blpapi_Message_t **element,size_t index); +def _blpapi_ResolutionList_messageAt(resolution_list, index): + out = c_void_p() + outp = pointer(out) + rc = l_blpapi_ResolutionList_messageAt( + resolution_list, outp, c_size_t(index) + ) + return rc, getHandleFromOutput(outp, rc) -def blpapi_ConstantList_description(list): - return _internals.blpapi_ConstantList_description(list) -def blpapi_ConstantList_numConstants(list): - return _internals.blpapi_ConstantList_numConstants(list) +# signature: int blpapi_ResolutionList_size(const blpapi_ResolutionList_t *list); +def _blpapi_ResolutionList_size(resolution_list): + return l_blpapi_ResolutionList_size(resolution_list) -def blpapi_ConstantList_datatype(constant): - return _internals.blpapi_ConstantList_datatype(constant) -def blpapi_ConstantList_status(list): - return _internals.blpapi_ConstantList_status(list) +# signature: int blpapi_ResolutionList_status(const blpapi_ResolutionList_t *list,int *status,const blpapi_CorrelationId_t *id); +def _blpapi_ResolutionList_status(resolution_list, cid): + out = c_int() + outp = pointer(out) + rc = l_blpapi_ResolutionList_status( + resolution_list, outp, byref(cid.thestruct) + ) -def blpapi_ConstantList_getConstant(constant, nameString, name): - return _internals.blpapi_ConstantList_getConstant(constant, nameString, name) + return rc, getPODFromOutput(outp, rc) -def blpapi_ConstantList_getConstantAt(constant, index): - return _internals.blpapi_ConstantList_getConstantAt(constant, index) -def blpapi_SchemaElementDefinition_name(field): - return _internals.blpapi_SchemaElementDefinition_name(field) +# signature: int blpapi_ResolutionList_statusAt(const blpapi_ResolutionList_t *list, int *status, size_t index); +def _blpapi_ResolutionList_statusAt(resolution_list, index): + out = c_int() + outp = pointer(out) + rc = l_blpapi_ResolutionList_statusAt(resolution_list, outp, index) -def blpapi_SchemaElementDefinition_description(field): - return _internals.blpapi_SchemaElementDefinition_description(field) + return rc, out.value -def blpapi_SchemaElementDefinition_status(field): - return _internals.blpapi_SchemaElementDefinition_status(field) -def blpapi_SchemaElementDefinition_type(field): - return _internals.blpapi_SchemaElementDefinition_type(field) +# signature: int blpapi_ResolutionList_topicString(const blpapi_ResolutionList_t *list,const char **topic,const blpapi_CorrelationId_t *id); +def _blpapi_ResolutionList_topicString(resolution_list, cid): + out = c_char_p() + outp = pointer(out) + rc = l_blpapi_ResolutionList_topicString( + resolution_list, outp, byref(cid.thestruct) + ) + return rc, getStrFromOutput(outp, rc) -def blpapi_SchemaElementDefinition_numAlternateNames(field): - return _internals.blpapi_SchemaElementDefinition_numAlternateNames(field) -def blpapi_SchemaElementDefinition_getAlternateName(field, index): - return _internals.blpapi_SchemaElementDefinition_getAlternateName(field, index) +# signature: int blpapi_ResolutionList_topicStringAt(const blpapi_ResolutionList_t *list, const char **topic, size_t index); +def _blpapi_ResolutionList_topicStringAt(resolution_list, index): + out = c_char_p() + outp = pointer(out) + rc = l_blpapi_ResolutionList_topicStringAt(resolution_list, outp, index) + return rc, getStrFromOutput(outp, rc) -def blpapi_SchemaElementDefinition_minValues(field): - return _internals.blpapi_SchemaElementDefinition_minValues(field) -def blpapi_SchemaElementDefinition_maxValues(field): - return _internals.blpapi_SchemaElementDefinition_maxValues(field) +# signature: const char *blpapi_SchemaElementDefinition_description(const blpapi_SchemaElementDefinition_t *field); +def _blpapi_SchemaElementDefinition_description(field): + ds = l_blpapi_SchemaElementDefinition_description(field) + return getStrFromC(ds) -def blpapi_SchemaTypeDefinition_name(type): - return _internals.blpapi_SchemaTypeDefinition_name(type) -def blpapi_SchemaTypeDefinition_description(type): - return _internals.blpapi_SchemaTypeDefinition_description(type) +# signature: blpapi_Name_t *blpapi_SchemaElementDefinition_getAlternateName(const blpapi_SchemaElementDefinition_t *field, size_t index); +def _blpapi_SchemaElementDefinition_getAlternateName(field, index): + return getHandleFromPtr( + l_blpapi_SchemaElementDefinition_getAlternateName( + field, c_size_t(index) + ) + ) -def blpapi_SchemaTypeDefinition_status(type): - return _internals.blpapi_SchemaTypeDefinition_status(type) -def blpapi_SchemaTypeDefinition_datatype(type): - return _internals.blpapi_SchemaTypeDefinition_datatype(type) +# signature: size_t blpapi_SchemaElementDefinition_maxValues(const blpapi_SchemaElementDefinition_t *field); +def _blpapi_SchemaElementDefinition_maxValues(field): + return l_blpapi_SchemaElementDefinition_maxValues(field) -def blpapi_SchemaTypeDefinition_isComplexType(type): - return _internals.blpapi_SchemaTypeDefinition_isComplexType(type) -def blpapi_SchemaTypeDefinition_isSimpleType(type): - return _internals.blpapi_SchemaTypeDefinition_isSimpleType(type) +# signature: size_t blpapi_SchemaElementDefinition_minValues(const blpapi_SchemaElementDefinition_t *field); +def _blpapi_SchemaElementDefinition_minValues(field): + return l_blpapi_SchemaElementDefinition_minValues(field) -def blpapi_SchemaTypeDefinition_isEnumerationType(type): - return _internals.blpapi_SchemaTypeDefinition_isEnumerationType(type) -def blpapi_SchemaTypeDefinition_numElementDefinitions(type): - return _internals.blpapi_SchemaTypeDefinition_numElementDefinitions(type) +# signature: blpapi_Name_t *blpapi_SchemaElementDefinition_name(const blpapi_SchemaElementDefinition_t *field); +def _blpapi_SchemaElementDefinition_name(field): + return getHandleFromPtr(l_blpapi_SchemaElementDefinition_name(field)) -def blpapi_SchemaTypeDefinition_getElementDefinition(type, nameString, name): - return _internals.blpapi_SchemaTypeDefinition_getElementDefinition(type, nameString, name) -def blpapi_SchemaTypeDefinition_getElementDefinitionAt(type, index): - return _internals.blpapi_SchemaTypeDefinition_getElementDefinitionAt(type, index) +# signature: size_t blpapi_SchemaElementDefinition_numAlternateNames(const blpapi_SchemaElementDefinition_t *field); +def _blpapi_SchemaElementDefinition_numAlternateNames(field): + return l_blpapi_SchemaElementDefinition_numAlternateNames(field) -def blpapi_SchemaTypeDefinition_enumeration(element): - return _internals.blpapi_SchemaTypeDefinition_enumeration(element) -def blpapi_Request_destroy(request): - return _internals.blpapi_Request_destroy(request) +# signature: +def _blpapi_SchemaElementDefinition_printHelper(item, level, spacesPerLevel): + return any_printer( + item, l_blpapi_SchemaElementDefinition_print, level, spacesPerLevel + ) -def blpapi_Request_elements(request): - return _internals.blpapi_Request_elements(request) -def blpapi_Request_setPreferredRoute(request, correlationId): - return _internals.blpapi_Request_setPreferredRoute(request, correlationId) +# signature: int blpapi_SchemaElementDefinition_status(const blpapi_SchemaElementDefinition_t *field); +def _blpapi_SchemaElementDefinition_status(field): + return l_blpapi_SchemaElementDefinition_status(field) -def blpapi_Request_getRequestId(request): - return _internals.blpapi_Request_getRequestId(request) -def blpapi_RequestTemplate_release(requestTemplate): - return _internals.blpapi_RequestTemplate_release(requestTemplate) +# signature: blpapi_SchemaTypeDefinition_t *blpapi_SchemaElementDefinition_type(const blpapi_SchemaElementDefinition_t *field); +def _blpapi_SchemaElementDefinition_type(field): + return getHandleFromPtr(l_blpapi_SchemaElementDefinition_type(field)) -def blpapi_Operation_name(operation): - return _internals.blpapi_Operation_name(operation) -def blpapi_Operation_description(operation): - return _internals.blpapi_Operation_description(operation) +# signature: int blpapi_SchemaTypeDefinition_datatype(const blpapi_SchemaTypeDefinition_t *type); +def _blpapi_SchemaTypeDefinition_datatype(stype): + return l_blpapi_SchemaTypeDefinition_datatype(stype) -def blpapi_Operation_requestDefinition(operation): - return _internals.blpapi_Operation_requestDefinition(operation) -def blpapi_Operation_numResponseDefinitions(operation): - return _internals.blpapi_Operation_numResponseDefinitions(operation) +# signature: const char *blpapi_SchemaTypeDefinition_description(const blpapi_SchemaTypeDefinition_t *type); +def _blpapi_SchemaTypeDefinition_description(stype): + ds = l_blpapi_SchemaTypeDefinition_description(stype) + return getStrFromC(ds) -def blpapi_Operation_responseDefinition(operation, index): - return _internals.blpapi_Operation_responseDefinition(operation, index) -def blpapi_Operation_responseDefinitionFromName(operation, name): - return _internals.blpapi_Operation_responseDefinitionFromName(operation, name) +# signature: blpapi_ConstantList_t *blpapi_SchemaTypeDefinition_enumeration(const blpapi_SchemaTypeDefinition_t *element); +def _blpapi_SchemaTypeDefinition_enumeration(element): + return getHandleFromPtr(l_blpapi_SchemaTypeDefinition_enumeration(element)) -def blpapi_Service_name(service): - return _internals.blpapi_Service_name(service) -def blpapi_Service_description(service): - return _internals.blpapi_Service_description(service) +# signature: blpapi_SchemaTypeDefinition_getElementDefinition(const blpapi_SchemaTypeDefinition_t *type,const char *nameString,const blpapi_Name_t *name); +def _blpapi_SchemaTypeDefinition_getElementDefinition(stype, nameString, name): + return getHandleFromPtr( + l_blpapi_SchemaTypeDefinition_getElementDefinition( + stype, charPtrFromPyStr(nameString), name + ) + ) -def blpapi_Service_numOperations(service): - return _internals.blpapi_Service_numOperations(service) -def blpapi_Service_numEventDefinitions(service): - return _internals.blpapi_Service_numEventDefinitions(service) +# signature: blpapi_SchemaTypeDefinition_getElementDefinitionAt(const blpapi_SchemaTypeDefinition_t *type, size_t index); +def _blpapi_SchemaTypeDefinition_getElementDefinitionAt(stype, index): + return getHandleFromPtr( + l_blpapi_SchemaTypeDefinition_getElementDefinitionAt( + stype, c_size_t(index) + ) + ) -def blpapi_Service_addRef(service): - return _internals.blpapi_Service_addRef(service) -def blpapi_Service_release(service): - return _internals.blpapi_Service_release(service) +# signature: +def _blpapi_SchemaTypeDefinition_hasElementDefinition(stype, nameString, name): + return l_blpapi_SchemaTypeDefinition_getElementDefinition( + stype, charPtrFromPyStr(nameString), name + ) -def blpapi_Service_authorizationServiceName(service): - return _internals.blpapi_Service_authorizationServiceName(service) -def blpapi_Service_getOperation(service, nameString, name): - return _internals.blpapi_Service_getOperation(service, nameString, name) +# signature: int blpapi_SchemaTypeDefinition_isComplexType(const blpapi_SchemaTypeDefinition_t *type); +def _blpapi_SchemaTypeDefinition_isComplexType(stype): + return l_blpapi_SchemaTypeDefinition_isComplexType(stype) -def blpapi_Service_getOperationAt(service, index): - return _internals.blpapi_Service_getOperationAt(service, index) -def blpapi_Service_getEventDefinition(service, nameString, name): - return _internals.blpapi_Service_getEventDefinition(service, nameString, name) +# signature: int blpapi_SchemaTypeDefinition_isEnumerationType(const blpapi_SchemaTypeDefinition_t *type); +def _blpapi_SchemaTypeDefinition_isEnumerationType(stype): + return l_blpapi_SchemaTypeDefinition_isEnumerationType(stype) -def blpapi_Service_getEventDefinitionAt(service, index): - return _internals.blpapi_Service_getEventDefinitionAt(service, index) -def blpapi_Service_createRequest(service, operation): - return _internals.blpapi_Service_createRequest(service, operation) +# signature: int blpapi_SchemaTypeDefinition_isSimpleType(const blpapi_SchemaTypeDefinition_t *type); +def _blpapi_SchemaTypeDefinition_isSimpleType(stype): + return l_blpapi_SchemaTypeDefinition_isSimpleType(stype) -def blpapi_Service_createAuthorizationRequest(service, operation): - return _internals.blpapi_Service_createAuthorizationRequest(service, operation) -def blpapi_Service_createPublishEvent(service): - return _internals.blpapi_Service_createPublishEvent(service) +# signature: blpapi_Name_t *blpapi_SchemaTypeDefinition_name(const blpapi_SchemaTypeDefinition_t *type); +def _blpapi_SchemaTypeDefinition_name(stype): + return getHandleFromPtr(l_blpapi_SchemaTypeDefinition_name(stype)) -def blpapi_Service_createAdminEvent(service): - return _internals.blpapi_Service_createAdminEvent(service) -def blpapi_Service_createResponseEvent(service, correlationId): - return _internals.blpapi_Service_createResponseEvent(service, correlationId) +# signature: size_t blpapi_SchemaTypeDefinition_numElementDefinitions(const blpapi_SchemaTypeDefinition_t *type); +def _blpapi_SchemaTypeDefinition_numElementDefinitions(stype): + return l_blpapi_SchemaTypeDefinition_numElementDefinitions(stype) -def blpapi_Message_messageType(message): - return _internals.blpapi_Message_messageType(message) -def blpapi_Message_topicName(message): - return _internals.blpapi_Message_topicName(message) +# signature: +def _blpapi_SchemaTypeDefinition_printHelper(item, level, spacesPerLevel): + return any_printer( + item, l_blpapi_SchemaTypeDefinition_print, level, spacesPerLevel + ) -def blpapi_Message_service(message): - return _internals.blpapi_Message_service(message) -def blpapi_Message_numCorrelationIds(message): - return _internals.blpapi_Message_numCorrelationIds(message) +# signature: int blpapi_SchemaTypeDefinition_status(const blpapi_SchemaTypeDefinition_t *type); +def _blpapi_SchemaTypeDefinition_status(stype): + return l_blpapi_SchemaTypeDefinition_status(stype) -def blpapi_Message_correlationId(message, index): - return _internals.blpapi_Message_correlationId(message, index) -def blpapi_Message_getRequestId(message): - return _internals.blpapi_Message_getRequestId(message) +# signature: int blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange(blpapi_ServiceRegistrationOptions_t *parameters,int start,int end,int priority); +def _blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange( + parameters, start, end, priority +): + return l_blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange( + parameters, start, end, priority + ) # all ints -def blpapi_Message_elements(message): - return _internals.blpapi_Message_elements(message) -def blpapi_Message_fragmentType(message): - return _internals.blpapi_Message_fragmentType(message) +# signature: void blpapi_ServiceRegistrationOptions_copy(blpapi_ServiceRegistrationOptions_t *lhs,const blpapi_ServiceRegistrationOptions_t *rhs); +def _blpapi_ServiceRegistrationOptions_copy(lhs, rhs): + raise NotImplementedError("not called") -def blpapi_Message_recapType(message): - return _internals.blpapi_Message_recapType(message) -def blpapi_Message_addRef(message): - return _internals.blpapi_Message_addRef(message) +# signature: blpapi_ServiceRegistrationOptions_t *blpapi_ServiceRegistrationOptions_create(void); +def _blpapi_ServiceRegistrationOptions_create(): + return getHandleFromPtr(l_blpapi_ServiceRegistrationOptions_create()) -def blpapi_Message_release(message): - return _internals.blpapi_Message_release(message) -def blpapi_Message_timeReceived(message): - return _internals.blpapi_Message_timeReceived(message) +# signature: void blpapi_ServiceRegistrationOptions_destroy(blpapi_ServiceRegistrationOptions_t *parameters); +def _blpapi_ServiceRegistrationOptions_destroy(parameters): + l_blpapi_ServiceRegistrationOptions_destroy(parameters) -def blpapi_Event_eventType(event): - return _internals.blpapi_Event_eventType(event) -def blpapi_Event_release(event): - return _internals.blpapi_Event_release(event) +# signature: blpapi_ServiceRegistrationOptions_duplicate(const blpapi_ServiceRegistrationOptions_t *parameters); +def _blpapi_ServiceRegistrationOptions_duplicate(parameters): + raise NotImplementedError("not called") -def blpapi_EventQueue_create(): - return _internals.blpapi_EventQueue_create() -def blpapi_EventQueue_destroy(eventQueue): - return _internals.blpapi_EventQueue_destroy(eventQueue) +BLPAPI_MAX_GROUP_ID_SIZE = 64 -def blpapi_EventQueue_nextEvent(eventQueue, timeout): - return _internals.blpapi_EventQueue_nextEvent(eventQueue, timeout) -def blpapi_EventQueue_purge(eventQueue): - return _internals.blpapi_EventQueue_purge(eventQueue) +# signature: int blpapi_ServiceRegistrationOptions_getGroupId(blpapi_ServiceRegistrationOptions_t *parameters,char *groupdIdBuffer,int *groupIdLength); +def _blpapi_ServiceRegistrationOptions_getGroupId(parameters): + outp = create_string_buffer(BLPAPI_MAX_GROUP_ID_SIZE) + sz = c_int() + szp = pointer(sz) + retCode = l_blpapi_ServiceRegistrationOptions_getGroupId( + parameters, outp, szp + ) + if retCode != 0: + return None + return retCode, getSizedStrFromBuffer(outp, sz.value) -def blpapi_EventQueue_tryNextEvent(eventQueue): - return _internals.blpapi_EventQueue_tryNextEvent(eventQueue) -def blpapi_MessageIterator_create(event): - return _internals.blpapi_MessageIterator_create(event) +# signature: int blpapi_ServiceRegistrationOptions_getPartsToRegister(blpapi_ServiceRegistrationOptions_t *parameters); +def _blpapi_ServiceRegistrationOptions_getPartsToRegister(parameters): + return l_blpapi_ServiceRegistrationOptions_getPartsToRegister(parameters) -def blpapi_MessageIterator_destroy(iterator): - return _internals.blpapi_MessageIterator_destroy(iterator) -def blpapi_MessageIterator_next(iterator): - return _internals.blpapi_MessageIterator_next(iterator) +# signature: int blpapi_ServiceRegistrationOptions_getServicePriority(blpapi_ServiceRegistrationOptions_t *parameters); +def _blpapi_ServiceRegistrationOptions_getServicePriority(parameters): + return l_blpapi_ServiceRegistrationOptions_getServicePriority(parameters) -def blpapi_Identity_release(handle): - return _internals.blpapi_Identity_release(handle) -def blpapi_Identity_addRef(handle): - return _internals.blpapi_Identity_addRef(handle) +# signature: void blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges(blpapi_ServiceRegistrationOptions_t *parameters); +def _blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges( + parameters, +): + l_blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges( + parameters + ) -def blpapi_Identity_hasEntitlements(handle, service, eidElement, entitlementIds, numEntitlements, failedEntitlements, failedEntitlementsCount): - return _internals.blpapi_Identity_hasEntitlements(handle, service, eidElement, entitlementIds, numEntitlements, failedEntitlements, failedEntitlementsCount) -def blpapi_Identity_isAuthorized(handle, service): - return _internals.blpapi_Identity_isAuthorized(handle, service) +# signature: void blpapi_ServiceRegistrationOptions_setGroupId(blpapi_ServiceRegistrationOptions_t *parameters,const char *groupId,unsigned int groupIdLength); +def _blpapi_ServiceRegistrationOptions_setGroupId(parameters, groupId): + gid, sz = charPtrWithSizeFromPyStr(groupId) + l_blpapi_ServiceRegistrationOptions_setGroupId(parameters, gid, c_uint(sz)) -def blpapi_Identity_getSeatType(handle): - return _internals.blpapi_Identity_getSeatType(handle) -def blpapi_HighResolutionClock_now(): - return _internals.blpapi_HighResolutionClock_now() +# signature: void blpapi_ServiceRegistrationOptions_setPartsToRegister(blpapi_ServiceRegistrationOptions_t *parameters, int parts); +def _blpapi_ServiceRegistrationOptions_setPartsToRegister(parameters, parts): + l_blpapi_ServiceRegistrationOptions_setPartsToRegister(parameters, parts) -def blpapi_AbstractSession_cancel(session, correlationIds, requestLabel): - return _internals.blpapi_AbstractSession_cancel(session, correlationIds, requestLabel) -def blpapi_AbstractSession_sendAuthorizationRequest(session, request, identity, correlationId, eventQueue, requestLabel): - return _internals.blpapi_AbstractSession_sendAuthorizationRequest(session, request, identity, correlationId, eventQueue, requestLabel) +# signature: int blpapi_ServiceRegistrationOptions_setServicePriority(blpapi_ServiceRegistrationOptions_t *parameters, int priority); +def _blpapi_ServiceRegistrationOptions_setServicePriority( + parameters, priority +): + return l_blpapi_ServiceRegistrationOptions_setServicePriority( + parameters, priority + ) -def blpapi_AbstractSession_openService(session, serviceIdentifier): - return _internals.blpapi_AbstractSession_openService(session, serviceIdentifier) -def blpapi_AbstractSession_openServiceAsync(session, serviceIdentifier, correlationId): - return _internals.blpapi_AbstractSession_openServiceAsync(session, serviceIdentifier, correlationId) +# signature: int blpapi_Service_addRef(blpapi_Service_t *service); +def _blpapi_Service_addRef(service): + return l_blpapi_Service_addRef(service) -def blpapi_AbstractSession_generateToken(session, correlationId, eventQueue): - return _internals.blpapi_AbstractSession_generateToken(session, correlationId, eventQueue) -def blpapi_AbstractSession_generateManualToken(session, correlationId, user, manualIp, eventQueue): - return _internals.blpapi_AbstractSession_generateManualToken(session, correlationId, user, manualIp, eventQueue) +# signature: const char *blpapi_Service_authorizationServiceName(blpapi_Service_t *service); +def _blpapi_Service_authorizationServiceName(service): + return getStrFromC(l_blpapi_Service_authorizationServiceName(service)) -def blpapi_AbstractSession_getService(session, serviceIdentifier): - return _internals.blpapi_AbstractSession_getService(session, serviceIdentifier) -def blpapi_AbstractSession_createIdentity(session): - return _internals.blpapi_AbstractSession_createIdentity(session) +# signature: int blpapi_Service_createAdminEvent(blpapi_Service_t *service, blpapi_Event_t **event); +def _blpapi_Service_createAdminEvent(service): + out = c_void_p() + outp = pointer(out) + retCode = l_blpapi_Service_createAdminEvent(service, outp) + return retCode, getHandleFromOutput(outp, retCode) -def blpapi_AbstractSession_generateAuthorizedIdentityAsync(session, authOptions, cid): - return _internals.blpapi_AbstractSession_generateAuthorizedIdentityAsync(session, authOptions, cid) -def blpapi_AbstractSession_getAuthorizedIdentity(session, cid): - return _internals.blpapi_AbstractSession_getAuthorizedIdentity(session, cid) +# signature: int blpapi_Service_createAuthorizationRequest(blpapi_Service_t *service,blpapi_Request_t **request,const char *operation); +def _blpapi_Service_createAuthorizationRequest(service, operation): + out = c_void_p() + outp = pointer(out) + retCode = l_blpapi_Service_createAuthorizationRequest( + service, outp, charPtrFromPyStr(operation) + ) + return retCode, getHandleFromOutput(outp, retCode) -def blpapi_AbstractSession_sessionName(session): - return _internals.blpapi_AbstractSession_sessionName(session) -def blpapi_Session_start(session): - return _internals.blpapi_Session_start(session) +# signature: int blpapi_Service_createPublishEvent(blpapi_Service_t *service, blpapi_Event_t **event); +def _blpapi_Service_createPublishEvent(service): + out = c_void_p() + outp = pointer(out) + retCode = l_blpapi_Service_createPublishEvent(service, outp) + return retCode, getHandleFromOutput(outp, retCode) -def blpapi_Session_startAsync(session): - return _internals.blpapi_Session_startAsync(session) -def blpapi_Session_stop(session): - return _internals.blpapi_Session_stop(session) +# signature: int blpapi_Service_createRequest(blpapi_Service_t *service,blpapi_Request_t **request,const char *operation); +def _blpapi_Service_createRequest(service, operation): + out = c_void_p() + outp = pointer(out) + retCode = l_blpapi_Service_createRequest( + service, outp, charPtrFromPyStr(operation) + ) + return retCode, getHandleFromOutput(outp, retCode) -def blpapi_Session_stopAsync(session): - return _internals.blpapi_Session_stopAsync(session) -def blpapi_Session_nextEvent(session, timeoutInMilliseconds): - return _internals.blpapi_Session_nextEvent(session, timeoutInMilliseconds) +# signature: int blpapi_Service_createResponseEvent(blpapi_Service_t *service,const blpapi_CorrelationId_t *correlationId,blpapi_Event_t **event); +def _blpapi_Service_createResponseEvent(service, correlationId): + out = c_void_p() + outp = pointer(out) + retCode = l_blpapi_Service_createResponseEvent( + service, byref(correlationId.thestruct), outp + ) + return retCode, getHandleFromOutput(outp, retCode) -def blpapi_Session_tryNextEvent(session): - return _internals.blpapi_Session_tryNextEvent(session) -def blpapi_Session_subscribe(session, subscriptionList, handle, requestLabel): - return _internals.blpapi_Session_subscribe(session, subscriptionList, handle, requestLabel) +# signature: const char *blpapi_Service_description(blpapi_Service_t *service); +def _blpapi_Service_description(service): + return getStrFromC(l_blpapi_Service_description(service)) -def blpapi_Session_subscribeEx(session, subscriptionList, handle, requestLabel, errorHandler, userData): - return _internals.blpapi_Session_subscribeEx(session, subscriptionList, handle, requestLabel, errorHandler, userData) -def blpapi_Session_resubscribe(session, resubscriptionList, requestLabel): - return _internals.blpapi_Session_resubscribe(session, resubscriptionList, requestLabel) +# signature: int blpapi_Service_getEventDefinition(blpapi_Service_t *service,blpapi_SchemaElementDefinition_t **result,const char *nameString,const blpapi_Name_t *name); +def _blpapi_Service_getEventDefinition(service, nameString, name): + out = c_void_p() + outp = pointer(out) + retCode = l_blpapi_Service_getEventDefinition( + service, outp, charPtrFromPyStr(nameString), name + ) + return retCode, getHandleFromOutput(outp, retCode) -def blpapi_Session_resubscribeEx(session, resubscriptionList, requestLabel, errorHandler, userData): - return _internals.blpapi_Session_resubscribeEx(session, resubscriptionList, requestLabel, errorHandler, userData) -def blpapi_Session_resubscribeWithId(session, resubscriptionList, resubscriptionId, requestLabel): - return _internals.blpapi_Session_resubscribeWithId(session, resubscriptionList, resubscriptionId, requestLabel) +# signature: int blpapi_Service_getEventDefinitionAt(blpapi_Service_t *service,blpapi_SchemaElementDefinition_t **result,size_t index); +def _blpapi_Service_getEventDefinitionAt(service, index): + out = c_void_p() + outp = pointer(out) + retCode = l_blpapi_Service_getEventDefinitionAt( + service, outp, c_size_t(index) + ) + return retCode, getHandleFromOutput(outp, retCode) -def blpapi_Session_resubscribeWithIdEx(session, resubscriptionList, resubscriptionId, requestLabel, errorHandler, userData): - return _internals.blpapi_Session_resubscribeWithIdEx(session, resubscriptionList, resubscriptionId, requestLabel, errorHandler, userData) -def blpapi_Session_unsubscribe(session, unsubscriptionList, requestLabel): - return _internals.blpapi_Session_unsubscribe(session, unsubscriptionList, requestLabel) +# signature: int blpapi_Service_getOperation(blpapi_Service_t *service,blpapi_Operation_t **operation,const char *nameString,const blpapi_Name_t *name); +def _blpapi_Service_getOperation(service, nameString, name): + out = c_void_p() + outp = pointer(out) + retCode = l_blpapi_Service_getOperation( + service, outp, charPtrFromPyStr(nameString), name + ) + return retCode, getHandleFromOutput(outp, retCode) -def blpapi_Session_setStatusCorrelationId(session, service, identity, correlationId): - return _internals.blpapi_Session_setStatusCorrelationId(session, service, identity, correlationId) -def blpapi_Session_sendRequest(session, request, correlationId, identity, eventQueue, requestLabel): - return _internals.blpapi_Session_sendRequest(session, request, correlationId, identity, eventQueue, requestLabel) +# signature: int blpapi_Service_getOperationAt(blpapi_Service_t *service,blpapi_Operation_t **operation,size_t index); +def _blpapi_Service_getOperationAt(service, index): + out = c_void_p() + outp = pointer(out) + retCode = l_blpapi_Service_getOperationAt(service, outp, index) + return retCode, getHandleFromOutput(outp, retCode) -def blpapi_Session_sendRequestTemplate(session, requestTemplate, correlationId): - return _internals.blpapi_Session_sendRequestTemplate(session, requestTemplate, correlationId) -def blpapi_Session_createSnapshotRequestTemplate(session, subscriptionString, identity, correlationId): - return _internals.blpapi_Session_createSnapshotRequestTemplate(session, subscriptionString, identity, correlationId) +# signature: +def _blpapi_Service_hasEventDefinition(service, nameString, name): + return ( + 0 == _blpapi_Service_getEventDefinition(service, nameString, name)[0] + ) -def blpapi_Session_getAbstractSession(session): - return _internals.blpapi_Session_getAbstractSession(session) -def blpapi_ResolutionList_extractAttributeFromResolutionSuccess(message, attribute): - return _internals.blpapi_ResolutionList_extractAttributeFromResolutionSuccess(message, attribute) +# signature: +def _blpapi_Service_hasOperation(service, nameString, name): + return 0 == _blpapi_Service_getOperation(service, nameString, name)[0] -def blpapi_ResolutionList_create(_from): - return _internals.blpapi_ResolutionList_create(_from) -def blpapi_ResolutionList_destroy(list): - return _internals.blpapi_ResolutionList_destroy(list) +# signature: const char *blpapi_Service_name(blpapi_Service_t *service); +def _blpapi_Service_name(service): + return getStrFromC(l_blpapi_Service_name(service)) -def blpapi_ResolutionList_add(list, topic, correlationId): - return _internals.blpapi_ResolutionList_add(list, topic, correlationId) -def blpapi_ResolutionList_addFromMessage(list, topic, correlationId): - return _internals.blpapi_ResolutionList_addFromMessage(list, topic, correlationId) +# signature: int blpapi_Service_numEventDefinitions(blpapi_Service_t *service); +def _blpapi_Service_numEventDefinitions(service): + return l_blpapi_Service_numEventDefinitions(service) -def blpapi_ResolutionList_addAttribute(list, name): - return _internals.blpapi_ResolutionList_addAttribute(list, name) -def blpapi_ResolutionList_correlationIdAt(list, index): - return _internals.blpapi_ResolutionList_correlationIdAt(list, index) +# signature: int blpapi_Service_numOperations(blpapi_Service_t *service); +def _blpapi_Service_numOperations(service): + return l_blpapi_Service_numOperations(service) -def blpapi_ResolutionList_topicString(list, id): - return _internals.blpapi_ResolutionList_topicString(list, id) -def blpapi_ResolutionList_topicStringAt(list, index): - return _internals.blpapi_ResolutionList_topicStringAt(list, index) +# signature: +def _blpapi_Service_printHelper(service, level, spacesPerLevel): + return any_printer(service, l_blpapi_Service_print, level, spacesPerLevel) -def blpapi_ResolutionList_status(list, id): - return _internals.blpapi_ResolutionList_status(list, id) -def blpapi_ResolutionList_statusAt(list, index): - return _internals.blpapi_ResolutionList_statusAt(list, index) +# signature: void blpapi_Service_release(blpapi_Service_t *service); +def _blpapi_Service_release(service): + l_blpapi_Service_release(service) -def blpapi_ResolutionList_attribute(list, attribute, id): - return _internals.blpapi_ResolutionList_attribute(list, attribute, id) -def blpapi_ResolutionList_attributeAt(list, attribute, index): - return _internals.blpapi_ResolutionList_attributeAt(list, attribute, index) +# signature: int blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg(blpapi_SessionOptions_t *parameters); +def _blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg(parameters): + return l_blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg(parameters) -def blpapi_ResolutionList_message(list, id): - return _internals.blpapi_ResolutionList_message(list, id) -def blpapi_ResolutionList_messageAt(list, index): - return _internals.blpapi_ResolutionList_messageAt(list, index) +# signature: int blpapi_SessionOptions_applicationIdentityKey(const char **applicationIdentityKey,size_t *size,blpapi_SessionOptions_t *parameters); +def _blpapi_SessionOptions_applicationIdentityKey(parameters): + out = c_char_p() + outp = pointer(out) + szout = c_size_t() + szoutp = pointer(szout) + retCode = l_blpapi_SessionOptions_applicationIdentityKey( + outp, szoutp, parameters + ) + return retCode, getSizedStrFromOutput(outp, szoutp, retCode) -def blpapi_ResolutionList_size(list): - return _internals.blpapi_ResolutionList_size(list) -def blpapi_TestUtil_createEvent(eventType): - return _internals.blpapi_TestUtil_createEvent(eventType) +# signature: const char *blpapi_SessionOptions_authenticationOptions(blpapi_SessionOptions_t *parameters); +def _blpapi_SessionOptions_authenticationOptions(parameters): + return getStrFromC( + l_blpapi_SessionOptions_authenticationOptions(parameters) + ) -def blpapi_TestUtil_deserializeService(schema, schemaLength): - return _internals.blpapi_TestUtil_deserializeService(schema, schemaLength) -def blpapi_TestUtil_serializeService(streamWriter, stream, service): - return _internals.blpapi_TestUtil_serializeService(streamWriter, stream, service) +# signature: int blpapi_SessionOptions_autoRestartOnDisconnection(blpapi_SessionOptions_t *parameters); +def _blpapi_SessionOptions_autoRestartOnDisconnection(parameters): + return l_blpapi_SessionOptions_autoRestartOnDisconnection(parameters) -def blpapi_TestUtil_appendMessage(event, messageType, properties): - return _internals.blpapi_TestUtil_appendMessage(event, messageType, properties) -def blpapi_TestUtil_createTopic(service, isActive): - return _internals.blpapi_TestUtil_createTopic(service, isActive) +# signature: int blpapi_SessionOptions_bandwidthSaveModeDisabled(blpapi_SessionOptions_t *parameters); +def _blpapi_SessionOptions_bandwidthSaveModeDisabled(parameters): + return l_blpapi_SessionOptions_bandwidthSaveModeDisabled(parameters) -def blpapi_TestUtil_getAdminMessageDefinition(messageName): - return _internals.blpapi_TestUtil_getAdminMessageDefinition(messageName) -def blpapi_MessageProperties_create(): - return _internals.blpapi_MessageProperties_create() +# signature: int blpapi_SessionOptions_clientMode(blpapi_SessionOptions_t *parameters); +def _blpapi_SessionOptions_clientMode(parameters): + return l_blpapi_SessionOptions_clientMode(parameters) -def blpapi_MessageProperties_destroy(messageProperties): - return _internals.blpapi_MessageProperties_destroy(messageProperties) -def blpapi_MessageProperties_copy(src): - return _internals.blpapi_MessageProperties_copy(src) +# signature: unsigned int blpapi_SessionOptions_connectTimeout(blpapi_SessionOptions_t *parameters); +def _blpapi_SessionOptions_connectTimeout(parameters): + return l_blpapi_SessionOptions_connectTimeout(parameters) -def blpapi_MessageProperties_assign(lhs, rhs): - return _internals.blpapi_MessageProperties_assign(lhs, rhs) -def blpapi_MessageProperties_setCorrelationIds(messageProperties, correlationIds): - return _internals.blpapi_MessageProperties_setCorrelationIds(messageProperties, correlationIds) +# signature: blpapi_SessionOptions_t *blpapi_SessionOptions_create(void); +def _blpapi_SessionOptions_create(): + return getHandleFromPtr(l_blpapi_SessionOptions_create()) -def blpapi_MessageProperties_setRecapType(messageProperties, recap, fragment): - return _internals.blpapi_MessageProperties_setRecapType(messageProperties, recap, fragment) -def blpapi_MessageProperties_setTimeReceived(messageProperties, timestamp): - return _internals.blpapi_MessageProperties_setTimeReceived(messageProperties, timestamp) +# signature: int blpapi_SessionOptions_defaultKeepAliveInactivityTime(blpapi_SessionOptions_t *parameters); +def _blpapi_SessionOptions_defaultKeepAliveInactivityTime(parameters): + return l_blpapi_SessionOptions_defaultKeepAliveInactivityTime(parameters) -def blpapi_MessageProperties_setService(messageProperties, service): - return _internals.blpapi_MessageProperties_setService(messageProperties, service) -def blpapi_MessageProperties_setRequestId(messageProperties, requestId): - return _internals.blpapi_MessageProperties_setRequestId(messageProperties, requestId) +# signature: int blpapi_SessionOptions_defaultKeepAliveResponseTimeout(blpapi_SessionOptions_t *parameters); +def _blpapi_SessionOptions_defaultKeepAliveResponseTimeout(parameters): + return l_blpapi_SessionOptions_defaultKeepAliveResponseTimeout(parameters) -def blpapi_Topic_create(_from): - return _internals.blpapi_Topic_create(_from) -def blpapi_Topic_destroy(victim): - return _internals.blpapi_Topic_destroy(victim) +# signature: const char *blpapi_SessionOptions_defaultServices(blpapi_SessionOptions_t *parameters); +def _blpapi_SessionOptions_defaultServices(parameters): + return getStrFromC(l_blpapi_SessionOptions_defaultServices(parameters)) -def blpapi_Topic_compare(lhs, rhs): - return _internals.blpapi_Topic_compare(lhs, rhs) -def blpapi_Topic_service(topic): - return _internals.blpapi_Topic_service(topic) +# signature: const char *blpapi_SessionOptions_defaultSubscriptionService(blpapi_SessionOptions_t *parameters); +def _blpapi_SessionOptions_defaultSubscriptionService(parameters): + return getStrFromC( + l_blpapi_SessionOptions_defaultSubscriptionService(parameters) + ) -def blpapi_Topic_isActive(topic): - return _internals.blpapi_Topic_isActive(topic) -def blpapi_TopicList_create(_from): - return _internals.blpapi_TopicList_create(_from) +# signature: const char *blpapi_SessionOptions_defaultTopicPrefix(blpapi_SessionOptions_t *parameters); +def _blpapi_SessionOptions_defaultTopicPrefix(parameters): + return getStrFromC(l_blpapi_SessionOptions_defaultTopicPrefix(parameters)) -def blpapi_TopicList_destroy(list): - return _internals.blpapi_TopicList_destroy(list) -def blpapi_TopicList_add(list, topic, correlationId): - return _internals.blpapi_TopicList_add(list, topic, correlationId) +# signature: void blpapi_SessionOptions_destroy(blpapi_SessionOptions_t *parameters); +def _blpapi_SessionOptions_destroy(parameters): + l_blpapi_SessionOptions_destroy(parameters) -def blpapi_TopicList_addFromMessage(list, topic, correlationId): - return _internals.blpapi_TopicList_addFromMessage(list, topic, correlationId) -def blpapi_TopicList_correlationIdAt(list, index): - return _internals.blpapi_TopicList_correlationIdAt(list, index) +# signature: int blpapi_SessionOptions_flushPublishedEventsTimeout(blpapi_SessionOptions_t *parameters); +def _blpapi_SessionOptions_flushPublishedEventsTimeout(parameters): + return l_blpapi_SessionOptions_flushPublishedEventsTimeout(parameters) -def blpapi_TopicList_topicString(list, id): - return _internals.blpapi_TopicList_topicString(list, id) -def blpapi_TopicList_topicStringAt(list, index): - return _internals.blpapi_TopicList_topicStringAt(list, index) +# signature: int blpapi_SessionOptions_getServerAddressWithProxy(blpapi_SessionOptions_t *parameters,const char **serverHost,unsigned short *serverPort,const char **socks5Host,unsigned short *sock5Port,size_t index); +def _blpapi_SessionOptions_getServerAddressWithProxy(parameters, index): + hostout = c_char_p() + hostoutp = pointer(hostout) + portout = c_uint16() + portoutp = pointer(portout) + s5hostout = c_char_p() + s5hostoutp = pointer(s5hostout) + s5portout = c_uint16() + s5portoutp = pointer(s5portout) + retCode = l_blpapi_SessionOptions_getServerAddressWithProxy( + parameters, hostoutp, portoutp, s5hostoutp, s5portoutp, c_size_t(index) + ) + return ( + retCode, + getStrFromOutput(hostoutp, retCode), + getPODFromOutput(portoutp, retCode), + getStrFromOutput(s5hostoutp, retCode), + getPODFromOutput(s5portoutp, retCode), + ) -def blpapi_TopicList_status(list, id): - return _internals.blpapi_TopicList_status(list, id) -def blpapi_TopicList_statusAt(list, index): - return _internals.blpapi_TopicList_statusAt(list, index) +# signature: int blpapi_SessionOptions_keepAliveEnabled(blpapi_SessionOptions_t *parameters); +def _blpapi_SessionOptions_keepAliveEnabled(parameters): + return l_blpapi_SessionOptions_keepAliveEnabled(parameters) -def blpapi_TopicList_message(list, id): - return _internals.blpapi_TopicList_message(list, id) -def blpapi_TopicList_messageAt(list, index): - return _internals.blpapi_TopicList_messageAt(list, index) +# signature: size_t blpapi_SessionOptions_maxEventQueueSize(blpapi_SessionOptions_t *parameters); +def _blpapi_SessionOptions_maxEventQueueSize(parameters): + return l_blpapi_SessionOptions_maxEventQueueSize(parameters) -def blpapi_TopicList_size(list): - return _internals.blpapi_TopicList_size(list) -def blpapi_ProviderSession_create(parameters, handler, dispatcher, userData): - return _internals.blpapi_ProviderSession_create(parameters, handler, dispatcher, userData) +# signature: int blpapi_SessionOptions_maxPendingRequests(blpapi_SessionOptions_t *parameters); +def _blpapi_SessionOptions_maxPendingRequests(parameters): + return l_blpapi_SessionOptions_maxPendingRequests(parameters) -def blpapi_ProviderSession_destroy(session): - return _internals.blpapi_ProviderSession_destroy(session) -def blpapi_ProviderSession_start(session): - return _internals.blpapi_ProviderSession_start(session) +# signature: int blpapi_SessionOptions_numServerAddresses(blpapi_SessionOptions_t *parameters); +def _blpapi_SessionOptions_numServerAddresses(parameters): + return l_blpapi_SessionOptions_numServerAddresses(parameters) -def blpapi_ProviderSession_startAsync(session): - return _internals.blpapi_ProviderSession_startAsync(session) -def blpapi_ProviderSession_stop(session): - return _internals.blpapi_ProviderSession_stop(session) +# signature: int blpapi_SessionOptions_numStartAttempts(blpapi_SessionOptions_t *parameters); +def _blpapi_SessionOptions_numStartAttempts(parameters): + return l_blpapi_SessionOptions_numStartAttempts(parameters) -def blpapi_ProviderSession_stopAsync(session): - return _internals.blpapi_ProviderSession_stopAsync(session) -def blpapi_ProviderSession_nextEvent(session, timeoutInMilliseconds): - return _internals.blpapi_ProviderSession_nextEvent(session, timeoutInMilliseconds) +# signature: +def _blpapi_SessionOptions_printHelper(sessionOptions, level, spacesPerLevel): + return any_printer( + sessionOptions, l_blpapi_SessionOptions_print, level, spacesPerLevel + ) -def blpapi_ProviderSession_tryNextEvent(session): - return _internals.blpapi_ProviderSession_tryNextEvent(session) -def blpapi_ProviderSession_registerService(session, serviceName, identity, registrationOptions): - return _internals.blpapi_ProviderSession_registerService(session, serviceName, identity, registrationOptions) +# signature: int blpapi_SessionOptions_recordSubscriptionDataReceiveTimes(blpapi_SessionOptions_t *parameters); +def _blpapi_SessionOptions_recordSubscriptionDataReceiveTimes(parameters): + return l_blpapi_SessionOptions_recordSubscriptionDataReceiveTimes( + parameters + ) -def blpapi_ProviderSession_activateSubServiceCodeRange(session, serviceName, begin, end, priority): - return _internals.blpapi_ProviderSession_activateSubServiceCodeRange(session, serviceName, begin, end, priority) -def blpapi_ProviderSession_deactivateSubServiceCodeRange(session, serviceName, begin, end): - return _internals.blpapi_ProviderSession_deactivateSubServiceCodeRange(session, serviceName, begin, end) +# signature: int blpapi_SessionOptions_removeServerAddress(blpapi_SessionOptions_t *parameters, size_t index); +def _blpapi_SessionOptions_removeServerAddress(parameters, index): + return l_blpapi_SessionOptions_removeServerAddress( + parameters, c_size_t(index) + ) -def blpapi_ProviderSession_registerServiceAsync(session, serviceName, identity, correlationId, registrationOptions): - return _internals.blpapi_ProviderSession_registerServiceAsync(session, serviceName, identity, correlationId, registrationOptions) -def blpapi_ProviderSession_deregisterService(session, serviceName): - return _internals.blpapi_ProviderSession_deregisterService(session, serviceName) +# signature: const char *blpapi_SessionOptions_serverHost(blpapi_SessionOptions_t *parameters); +def _blpapi_SessionOptions_serverHost(parameters): + return getStrFromC(l_blpapi_SessionOptions_serverHost(parameters)) -def blpapi_ProviderSession_resolve(session, resolutionList, resolveMode, identity): - return _internals.blpapi_ProviderSession_resolve(session, resolutionList, resolveMode, identity) -def blpapi_ProviderSession_resolveAsync(session, resolutionList, resolveMode, identity): - return _internals.blpapi_ProviderSession_resolveAsync(session, resolutionList, resolveMode, identity) +# signature: unsigned int blpapi_SessionOptions_serverPort(blpapi_SessionOptions_t *parameters); +def _blpapi_SessionOptions_serverPort(parameters): + return l_blpapi_SessionOptions_serverPort(parameters) -def blpapi_ProviderSession_createTopics(session, topicList, resolveMode, identity): - return _internals.blpapi_ProviderSession_createTopics(session, topicList, resolveMode, identity) -def blpapi_ProviderSession_createTopicsAsync(session, topicList, resolveMode, identity): - return _internals.blpapi_ProviderSession_createTopicsAsync(session, topicList, resolveMode, identity) +# signature: int blpapi_SessionOptions_serviceCheckTimeout(blpapi_SessionOptions_t *parameters); +def _blpapi_SessionOptions_serviceCheckTimeout(parameters): + return l_blpapi_SessionOptions_serviceCheckTimeout(parameters) -def blpapi_ProviderSession_getTopic(session, message): - return _internals.blpapi_ProviderSession_getTopic(session, message) -def blpapi_ProviderSession_createTopic(session, message): - return _internals.blpapi_ProviderSession_createTopic(session, message) +# signature: int blpapi_SessionOptions_serviceDownloadTimeout(blpapi_SessionOptions_t *parameters); +def _blpapi_SessionOptions_serviceDownloadTimeout(parameters): + return l_blpapi_SessionOptions_serviceDownloadTimeout(parameters) -def blpapi_ProviderSession_createServiceStatusTopic(session, service): - return _internals.blpapi_ProviderSession_createServiceStatusTopic(session, service) -def blpapi_ProviderSession_deleteTopics(session, topics, numTopics): - return _internals.blpapi_ProviderSession_deleteTopics(session, topics, numTopics) +# signature: int blpapi_SessionOptions_sessionName(const char **sessionName,size_t *size,blpapi_SessionOptions_t *parameters); +def _blpapi_SessionOptions_sessionName(parameters): + out = c_char_p() + outp = pointer(out) + szout = c_size_t() + szoutp = pointer(szout) + retCode = l_blpapi_SessionOptions_sessionName(outp, szoutp, parameters) + return retCode, getSizedStrFromOutput(outp, szoutp, retCode) -def blpapi_ProviderSession_terminateSubscriptionsOnTopics(session, topics, numTopics, message): - return _internals.blpapi_ProviderSession_terminateSubscriptionsOnTopics(session, topics, numTopics, message) -def blpapi_ProviderSession_publish(session, event): - return _internals.blpapi_ProviderSession_publish(session, event) +# signature: void blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg(blpapi_SessionOptions_t *parameters,int allowMultipleCorrelatorsPerMsg); +def _blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg( + parameters, allowMultipleCorrelatorsPerMsg +): + l_blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg( + parameters, allowMultipleCorrelatorsPerMsg + ) -def blpapi_ProviderSession_sendResponse(session, event, isPartialResponse): - return _internals.blpapi_ProviderSession_sendResponse(session, event, isPartialResponse) -def blpapi_ProviderSession_getAbstractSession(session): - return _internals.blpapi_ProviderSession_getAbstractSession(session) +# signature: int blpapi_SessionOptions_setApplicationIdentityKey(blpapi_SessionOptions_t *parameters,const char *applicationIdentityKey,size_t size); +def _blpapi_SessionOptions_setApplicationIdentityKey( + parameters, applicationIdentityKey +): + aik, sz = charPtrWithSizeFromPyStr(applicationIdentityKey) + return l_blpapi_SessionOptions_setApplicationIdentityKey( + parameters, + aik, + c_size_t(sz), + ) -def blpapi_ProviderSession_flushPublishedEvents(session, timeoutMsecs): - return _internals.blpapi_ProviderSession_flushPublishedEvents(session, timeoutMsecs) -def blpapi_ServiceRegistrationOptions_create(): - return _internals.blpapi_ServiceRegistrationOptions_create() +# signature: void blpapi_SessionOptions_setAuthenticationOptions(blpapi_SessionOptions_t *parameters, const char *authOptions); +def _blpapi_SessionOptions_setAuthenticationOptions(parameters, authOptions): + l_blpapi_SessionOptions_setAuthenticationOptions( + parameters, charPtrFromPyStr(authOptions) + ) -def blpapi_ServiceRegistrationOptions_duplicate(parameters): - return _internals.blpapi_ServiceRegistrationOptions_duplicate(parameters) -def blpapi_ServiceRegistrationOptions_destroy(parameters): - return _internals.blpapi_ServiceRegistrationOptions_destroy(parameters) +# signature: void blpapi_SessionOptions_setAutoRestartOnDisconnection(blpapi_SessionOptions_t *parameters, int autoRestart); +def _blpapi_SessionOptions_setAutoRestartOnDisconnection( + parameters, autoRestart +): + l_blpapi_SessionOptions_setAutoRestartOnDisconnection( + parameters, autoRestart + ) -def blpapi_ServiceRegistrationOptions_copy(lhs, rhs): - return _internals.blpapi_ServiceRegistrationOptions_copy(lhs, rhs) -def blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange(parameters, start, end, priority): - return _internals.blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange(parameters, start, end, priority) +# signature: int blpapi_SessionOptions_setBandwidthSaveModeDisabled(blpapi_SessionOptions_t *parameters, int disableBandwidthSaveMode); +def _blpapi_SessionOptions_setBandwidthSaveModeDisabled( + parameters, disableBandwidthSaveMode +): + return l_blpapi_SessionOptions_setBandwidthSaveModeDisabled( + parameters, disableBandwidthSaveMode + ) -def blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges(parameters): - return _internals.blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges(parameters) -def blpapi_ServiceRegistrationOptions_setGroupId(parameters, groupId): - return _internals.blpapi_ServiceRegistrationOptions_setGroupId(parameters, groupId) +# signature: void blpapi_SessionOptions_setClientMode(blpapi_SessionOptions_t *parameters, int clientMode); +def _blpapi_SessionOptions_setClientMode(parameters, clientMode): + l_blpapi_SessionOptions_setClientMode(parameters, clientMode) -def blpapi_ServiceRegistrationOptions_setServicePriority(parameters, priority): - return _internals.blpapi_ServiceRegistrationOptions_setServicePriority(parameters, priority) -def blpapi_ServiceRegistrationOptions_setPartsToRegister(parameters, parts): - return _internals.blpapi_ServiceRegistrationOptions_setPartsToRegister(parameters, parts) +# signature: int blpapi_SessionOptions_setConnectTimeout(blpapi_SessionOptions_t *parameters,unsigned int timeoutInMilliseconds); +def _blpapi_SessionOptions_setConnectTimeout( + parameters, timeoutInMilliseconds +): + return l_blpapi_SessionOptions_setConnectTimeout( + parameters, c_uint32(timeoutInMilliseconds) + ) -def blpapi_ServiceRegistrationOptions_getGroupId(parameters): - return _internals.blpapi_ServiceRegistrationOptions_getGroupId(parameters) -def blpapi_ServiceRegistrationOptions_getServicePriority(parameters): - return _internals.blpapi_ServiceRegistrationOptions_getServicePriority(parameters) +# signature: int blpapi_SessionOptions_setDefaultKeepAliveInactivityTime(blpapi_SessionOptions_t *parameters, int inactivityMsecs); +def _blpapi_SessionOptions_setDefaultKeepAliveInactivityTime( + parameters, inactivityMsecs +): + return l_blpapi_SessionOptions_setDefaultKeepAliveInactivityTime( + parameters, inactivityMsecs + ) -def blpapi_ServiceRegistrationOptions_getPartsToRegister(parameters): - return _internals.blpapi_ServiceRegistrationOptions_getPartsToRegister(parameters) -def blpapi_ZfpUtil_getOptionsForLeasedLines(sessionOptions, tlsOptions, remote): - return _internals.blpapi_ZfpUtil_getOptionsForLeasedLines(sessionOptions, tlsOptions, remote) +# signature: int blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout(blpapi_SessionOptions_t *parameters, int timeoutMsecs); +def _blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout( + parameters, timeoutMsecs +): + return l_blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout( + parameters, timeoutMsecs + ) + + +# signature: int blpapi_SessionOptions_setDefaultServices(blpapi_SessionOptions_t *parameters, const char *defaultServices); +def _blpapi_SessionOptions_setDefaultServices(parameters, defaultServices): + return l_blpapi_SessionOptions_setDefaultServices( + parameters, charPtrFromPyStr(defaultServices) + ) + + +# signature: int blpapi_SessionOptions_setDefaultSubscriptionService(blpapi_SessionOptions_t *parameters, const char *serviceIdentifier); +def _blpapi_SessionOptions_setDefaultSubscriptionService( + parameters, serviceIdentifier +): + return l_blpapi_SessionOptions_setDefaultSubscriptionService( + parameters, charPtrFromPyStr(serviceIdentifier) + ) + + +# signature: void blpapi_SessionOptions_setDefaultTopicPrefix(blpapi_SessionOptions_t *parameters, const char *prefix); +def _blpapi_SessionOptions_setDefaultTopicPrefix(parameters, topicPrefix): + l_blpapi_SessionOptions_setDefaultTopicPrefix( + parameters, charPtrFromPyStr(topicPrefix) + ) + + +# signature: int blpapi_SessionOptions_setFlushPublishedEventsTimeout(blpapi_SessionOptions_t *paramaters, int timeoutMsecs); +def _blpapi_SessionOptions_setFlushPublishedEventsTimeout( + paramaters, timeoutMsecs +): + return l_blpapi_SessionOptions_setFlushPublishedEventsTimeout( + paramaters, timeoutMsecs + ) + + +# signature: int blpapi_SessionOptions_setKeepAliveEnabled(blpapi_SessionOptions_t *parameters, int isEnabled); +def _blpapi_SessionOptions_setKeepAliveEnabled(parameters, isEnabled): + return l_blpapi_SessionOptions_setKeepAliveEnabled(parameters, isEnabled) + + +# signature: void blpapi_SessionOptions_setMaxEventQueueSize(blpapi_SessionOptions_t *parameters, size_t maxEventQueueSize); +def _blpapi_SessionOptions_setMaxEventQueueSize(parameters, maxEventQueueSize): + l_blpapi_SessionOptions_setMaxEventQueueSize( + parameters, c_size_t(maxEventQueueSize) + ) + + +# signature: void blpapi_SessionOptions_setMaxPendingRequests(blpapi_SessionOptions_t *parameters, int maxPendingRequests); +def _blpapi_SessionOptions_setMaxPendingRequests( + parameters, maxPendingRequests +): + l_blpapi_SessionOptions_setMaxPendingRequests( + parameters, maxPendingRequests + ) + + +# signature: void blpapi_SessionOptions_setNumStartAttempts(blpapi_SessionOptions_t *parameters, int numStartAttempts); +def _blpapi_SessionOptions_setNumStartAttempts(parameters, numStartAttempts): + l_blpapi_SessionOptions_setNumStartAttempts(parameters, numStartAttempts) + + +# signature: void blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes(blpapi_SessionOptions_t *parameters, int shouldRecord); +def _blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes( + parameters, shouldRecord +): + l_blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes( + parameters, shouldRecord + ) + +# signature: int blpapi_SessionOptions_setServerAddress(blpapi_SessionOptions_t *parameters,const char *serverHost,unsigned short serverPort,size_t index); +def _blpapi_SessionOptions_setServerAddress( + parameters, serverHost, serverPort, index +): + return l_blpapi_SessionOptions_setServerAddress( + parameters, + charPtrFromPyStr(serverHost), + c_uint16(serverPort), + c_size_t(index), + ) + + +# signature: int blpapi_SessionOptions_setServerAddressWithProxy(blpapi_SessionOptions_t *parameters,const char *serverHost,unsigned short serverPort,const blpapi_Socks5Config_t *socks5Config,size_t index); +def _blpapi_SessionOptions_setServerAddressWithProxy( + parameters, serverHost, serverPort, socks5Config, index +): + # parameters is the handle to SessionOptions + # socks5Config if any would be a handle to Socks5Config + return l_blpapi_SessionOptions_setServerAddressWithProxy( + parameters, + charPtrFromPyStr(serverHost), + c_uint16(serverPort), + socks5Config, + c_size_t(index), + ) + + +# signature: int blpapi_SessionOptions_setServerHost(blpapi_SessionOptions_t *parameters, const char *serverHost); +def _blpapi_SessionOptions_setServerHost(parameters, serverHost): + return l_blpapi_SessionOptions_setServerHost( + parameters, charPtrFromPyStr(serverHost) + ) + + +# signature: int blpapi_SessionOptions_setServerPort(blpapi_SessionOptions_t *parameters, unsigned short serverPort); +def _blpapi_SessionOptions_setServerPort(parameters, serverPort): + return l_blpapi_SessionOptions_setServerPort( + parameters, c_uint16(serverPort) + ) + + +# signature: int blpapi_SessionOptions_setServiceCheckTimeout(blpapi_SessionOptions_t *paramaters, int timeoutMsecs); +def _blpapi_SessionOptions_setServiceCheckTimeout(paramaters, timeoutMsecs): + return l_blpapi_SessionOptions_setServiceCheckTimeout( + paramaters, timeoutMsecs + ) + + +# signature: int blpapi_SessionOptions_setServiceDownloadTimeout(blpapi_SessionOptions_t *paramaters, int timeoutMsecs); +def _blpapi_SessionOptions_setServiceDownloadTimeout(paramaters, timeoutMsecs): + return l_blpapi_SessionOptions_setServiceDownloadTimeout( + paramaters, timeoutMsecs + ) + + +# signature: int blpapi_SessionOptions_setSessionIdentityOptions(blpapi_SessionOptions_t *parameters,const blpapi_AuthOptions_t *authOptions,blpapi_CorrelationId_t *cid); +def _blpapi_SessionOptions_setSessionIdentityOptions( + parameters, authOptions, cid +): + # the C layer will OVERWRITE cid with autogen for unset + cidp = pointer(cid.thestruct) + retCode = l_blpapi_SessionOptions_setSessionIdentityOptions( + parameters, authOptions, cidp + ) + return retCode, cid if retCode == 0 else None + + +# signature: int blpapi_SessionOptions_setSessionName(blpapi_SessionOptions_t *parameters,const char *sessionName,size_t size); +def _blpapi_SessionOptions_setSessionName(parameters, sessionName): + sn, sz = charPtrWithSizeFromPyStr(sessionName) + return l_blpapi_SessionOptions_setSessionName( + parameters, + sn, + c_size_t(sz), + ) + + +# signature: int blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark(blpapi_SessionOptions_t *parameters, float hiWaterMark); +def _blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark( + parameters, hiWaterMark +): + return l_blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark( + parameters, c_float(hiWaterMark) + ) + + +# signature: int blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark(blpapi_SessionOptions_t *parameters, float loWaterMark); +def _blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark( + parameters, loWaterMark +): + return l_blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark( + parameters, c_float(loWaterMark) + ) + + +# signature: void blpapi_SessionOptions_setTlsOptions(blpapi_SessionOptions_t *paramaters,const blpapi_TlsOptions_t *tlsOptions); +def _blpapi_SessionOptions_setTlsOptions(paramaters, tlsOptions): + l_blpapi_SessionOptions_setTlsOptions(paramaters, tlsOptions) + + +# signature: float blpapi_SessionOptions_slowConsumerWarningHiWaterMark(blpapi_SessionOptions_t *parameters); +def _blpapi_SessionOptions_slowConsumerWarningHiWaterMark(parameters): + return l_blpapi_SessionOptions_slowConsumerWarningHiWaterMark(parameters) + + +# signature: float blpapi_SessionOptions_slowConsumerWarningLoWaterMark(blpapi_SessionOptions_t *parameters); +def _blpapi_SessionOptions_slowConsumerWarningLoWaterMark(parameters): + return l_blpapi_SessionOptions_slowConsumerWarningLoWaterMark(parameters) + + +# signature: int blpapi_Session_createSnapshotRequestTemplate(blpapi_RequestTemplate_t **requestTemplate,blpapi_Session_t *session,const char *subscriptionString,const blpapi_Identity_t *identity,blpapi_CorrelationId_t *correlationId); +def _blpapi_Session_createSnapshotRequestTemplate( + session, subscriptionString, identity, correlationId +): + # the C layer will OVERWRITE cid with autogen for unset + out = c_void_p() + outp = pointer(out) + idp = c_void_p() if identity is None else identity + + cidp = pointer(correlationId.thestruct) + + retCode = l_blpapi_Session_createSnapshotRequestTemplate( + outp, + session, + charPtrFromPyStr(subscriptionString), + idp, + cidp, + ) + return retCode, getHandleFromOutput(outp, retCode) + + +# signature: blpapi_AbstractSession_t *blpapi_Session_getAbstractSession(blpapi_Session_t *session); +def _blpapi_Session_getAbstractSession(session): + return getHandleFromPtr(l_blpapi_Session_getAbstractSession(session)) + + +# signature: int blpapi_Session_nextEvent(blpapi_Session_t *session,blpapi_Event_t **eventPointer,unsigned int timeoutInMilliseconds); +def _blpapi_Session_nextEvent(session, timeoutInMilliseconds): + eventptr = c_void_p() + outp = pointer(eventptr) + retCode = l_blpapi_Session_nextEvent( + session, outp, c_uint(timeoutInMilliseconds) + ) + return retCode, getHandleFromOutput(outp, retCode) + + +# signature: int blpapi_Session_resubscribe(blpapi_Session_t *session,const blpapi_SubscriptionList_t *resubscriptionList,const char *requestLabel,int requestLabelLen); +def _blpapi_Session_resubscribe(session, resubscriptionList, requestLabel): + label, sz = charPtrWithSizeFromPyStr(requestLabel) + return l_blpapi_Session_resubscribe(session, resubscriptionList, label, sz) + + +# signature: int blpapi_Session_resubscribeEx(blpapi_Session_t *session,const blpapi_SubscriptionList_t *resubscriptionList,const char *requestLabel,int requestLabelLen,blpapi_SubscriptionPreprocessErrorHandler_t errorHandler,void *userData); +def _blpapi_Session_resubscribeEx( + session, resubscriptionList, requestLabel, errorHandler, userData +): + label, sz = charPtrWithSizeFromPyStr(requestLabel) + return l_blpapi_Session_resubscribeEx( + session, resubscriptionList, label, c_int(sz), errorHandler, userData + ) + + +# signature: +def _blpapi_Session_resubscribeEx_helper( + session, resubscriptionList, requestLabel, errorAppenderCb +): + proxy = anySessionSubErrorHandlerWrapper.get() + userdata = voidFromPyFunction(errorAppenderCb) + return _blpapi_Session_resubscribeEx( + session, resubscriptionList, requestLabel, proxy, userdata + ) + + +# signature: int blpapi_Session_resubscribeWithId(blpapi_Session_t *session,const blpapi_SubscriptionList_t *resubscriptionList,int resubscriptionId,const char *requestLabel,int requestLabelLen); +def _blpapi_Session_resubscribeWithId( + session, resubscriptionList, resubscriptionId, requestLabel +): + label, sz = charPtrWithSizeFromPyStr(requestLabel) + return l_blpapi_Session_resubscribeWithId( + session, + resubscriptionList, + resubscriptionId, # int + label, + sz, + ) + + +# signature: int blpapi_Session_resubscribeWithIdEx(blpapi_Session_t *session,const blpapi_SubscriptionList_t *resubscriptionList,int resubscriptionId,const char *requestLabel,int requestLabelLen,blpapi_SubscriptionPreprocessErrorHandler_t errorHandler,void *userData); +def _blpapi_Session_resubscribeWithIdEx( + session, + resubscriptionList, + resubscriptionId, + requestLabel, + errorHandler, + userdata, +): + label, sz = charPtrWithSizeFromPyStr(requestLabel) + return l_blpapi_Session_resubscribeWithIdEx( + session, + resubscriptionList, + c_int(resubscriptionId), + label, + c_int(sz), + errorHandler, + userdata, + ) + + +# signature: +def _blpapi_Session_resubscribeWithIdEx_helper( + session, + resubscriptionList, + resubscriptionId, + requestLabel, + errorAppenderCb, +): + proxy = anySessionSubErrorHandlerWrapper.get() + userdata = voidFromPyFunction(errorAppenderCb) + return _blpapi_Session_resubscribeWithIdEx( + session, + resubscriptionList, + resubscriptionId, + requestLabel, + proxy, + userdata, + ) + + +# signature: int blpapi_Session_sendRequest(blpapi_Session_t *session,const blpapi_Request_t *request,blpapi_CorrelationId_t *correlationId,blpapi_Identity_t *identity,blpapi_EventQueue_t *eventQueue,const char *requestLabel,int requestLabelLen); +def _blpapi_Session_sendRequest( + session, request, correlationId, identity, eventQueue, requestLabel +): + # the C layer will OVERWRITE cid with autogen for unset + cidp = pointer(correlationId.thestruct) + + label, sz = charPtrWithSizeFromPyStr(requestLabel) + return l_blpapi_Session_sendRequest( + session, + request, + cidp, + identity, + eventQueue, + label, + sz, # int + ) + + +# signature: int blpapi_Session_sendRequestTemplate(blpapi_Session_t *session,const blpapi_RequestTemplate_t *requestTemplate,blpapi_CorrelationId_t *correlationId); +def _blpapi_Session_sendRequestTemplate( + session, requestTemplate, correlationId +): + # the C layer will OVERWRITE cid with autogen for unset + cidp = pointer(correlationId.thestruct) + + return l_blpapi_Session_sendRequestTemplate( + session, + requestTemplate, + cidp, + ) + + +# signature: int blpapi_Session_setStatusCorrelationId(blpapi_Session_t *session,const blpapi_Service_t *service,const blpapi_Identity_t *identity,const blpapi_CorrelationId_t *correlationId); +def _blpapi_Session_setStatusCorrelationId( + session, service, identity, correlationId +): + return l_blpapi_Session_setStatusCorrelationId( + session, service, identity, byref(correlationId.thestruct) + ) + + +# signature: int blpapi_Session_start(blpapi_Session_t *session); +def _blpapi_Session_start(session): + return l_blpapi_Session_start(session) + + +# signature: int blpapi_Session_startAsync(blpapi_Session_t *session); +def _blpapi_Session_startAsync(session): + return l_blpapi_Session_startAsync(session) + + +# signature: int blpapi_Session_stop(blpapi_Session_t *session); +def _blpapi_Session_stop(session): + return l_blpapi_Session_stop(session) + + +# signature: int blpapi_Session_stopAsync(blpapi_Session_t *session); +def _blpapi_Session_stopAsync(session): + return l_blpapi_Session_stopAsync(session) + + +# signature: int blpapi_Session_subscribe(blpapi_Session_t *session,const blpapi_SubscriptionList_t *subscriptionList,const blpapi_Identity_t *handle,const char *requestLabel,int requestLabelLen); +def _blpapi_Session_subscribe(session, subscriptionList, handle, requestLabel): + # handle is identity + label, sz = charPtrWithSizeFromPyStr(requestLabel) + return l_blpapi_Session_subscribe( + session, subscriptionList, handle, label, sz # int + ) + + +# signature: int blpapi_Session_subscribeEx(blpapi_Session_t *session,const blpapi_SubscriptionList_t *subscriptionList,const blpapi_Identity_t *handle,const char *requestLabel,int requestLabelLen,blpapi_SubscriptionPreprocessErrorHandler_t errorHandler,void *userData); +def _blpapi_Session_subscribeEx( + session, subscriptionList, handle, requestLabel, errorHandler, userData +): + label, sz = charPtrWithSizeFromPyStr(requestLabel) + return l_blpapi_Session_subscribeEx( + session, + subscriptionList, + handle, + label, + c_int(sz), + errorHandler, + userData, + ) + + +# signature: +def _blpapi_Session_subscribeEx_helper( + session, subscriptionList, identity, requestLabel, errorAppenderCb +): + proxy = anySessionSubErrorHandlerWrapper.get() + userdata = voidFromPyFunction(errorAppenderCb) + return _blpapi_Session_subscribeEx( + session, subscriptionList, identity, requestLabel, proxy, userdata + ) + + +# signature: int blpapi_Session_tryNextEvent(blpapi_Session_t *session, blpapi_Event_t **eventPointer); +def _blpapi_Session_tryNextEvent(session): + eventptr = c_void_p() + outp = pointer(eventptr) + retCode = l_blpapi_Session_tryNextEvent(session, outp) + return retCode, getHandleFromOutput(outp, retCode) + + +# signature: int blpapi_Session_unsubscribe(blpapi_Session_t *session,const blpapi_SubscriptionList_t *unsubscriptionList,const char *requestLabel,int requestLabelLen); +def _blpapi_Session_unsubscribe(session, unsubscriptionList, requestLabel): + label, sz = charPtrWithSizeFromPyStr(requestLabel) + return l_blpapi_Session_unsubscribe( + session, unsubscriptionList, label, sz # sz is int + ) + + +# signature: blpapi_Socks5Config_t *blpapi_Socks5Config_create(const char *hostname, size_t hostname_size, unsigned short port); +def _blpapi_Socks5Config_create(hostname, port): + hn, sz = charPtrWithSizeFromPyStr(hostname) + return getHandleFromPtr( + l_blpapi_Socks5Config_create(hn, c_size_t(sz), c_uint16(port)) + ) + + +# signature: void blpapi_Socks5Config_destroy(blpapi_Socks5Config_t *socks5Config); +def _blpapi_Socks5Config_destroy(socks5Config): + l_blpapi_Socks5Config_destroy(socks5Config) + + +# signature: +def _blpapi_Socks5Config_printHelper(socks5Config, level, spacesPerLevel): + return any_printer( + socks5Config, l_blpapi_Socks5Config_print, level, spacesPerLevel + ) + + +# signature: +def _blpapi_SubscriptionList_addHelper(slist, topic, correlationId): + return l_blpapi_SubscriptionList_add( + slist, + charPtrFromPyStr(topic), + byref(correlationId.thestruct), + None, + None, + 0, + 0, + ) + + +# signature: int blpapi_SubscriptionList_addResolved(blpapi_SubscriptionList_t *list,const char *subscriptionString,const blpapi_CorrelationId_t *correlationId); +def _blpapi_SubscriptionList_addResolved( + slist, subscriptionString, correlationId +): + return l_blpapi_SubscriptionList_addResolved( + slist, + charPtrFromPyStr(subscriptionString), + byref(correlationId.thestruct), + ) + + +# signature: int blpapi_SubscriptionList_append(blpapi_SubscriptionList_t *dest, const blpapi_SubscriptionList_t *src); +def _blpapi_SubscriptionList_append(dest, src): + return l_blpapi_SubscriptionList_append(dest, src) + + +# signature: int blpapi_SubscriptionList_clear(blpapi_SubscriptionList_t *list); +def _blpapi_SubscriptionList_clear(slist): + return l_blpapi_SubscriptionList_clear(slist) + + +# signature: int blpapi_SubscriptionList_correlationIdAt(const blpapi_SubscriptionList_t *list,blpapi_CorrelationId_t *result,size_t index); +def _blpapi_SubscriptionList_correlationIdAt(slist, index): + cid = CidStruct() + cidp = pointer(cid) + retCode = l_blpapi_SubscriptionList_correlationIdAt( + slist, cidp, c_size_t(index) + ) + if retCode == 0: + # C doese *result = list->d_impl.subscription(index).d_correlationId.impl(); + # i.e., we need to bump ref + # the caller will wrap this in CorrelationId + return retCode, cid + return retCode, None + + +# signature: blpapi_SubscriptionList_t *blpapi_SubscriptionList_create(void); +def _blpapi_SubscriptionList_create(): + return getHandleFromPtr(l_blpapi_SubscriptionList_create()) + + +# signature: void blpapi_SubscriptionList_destroy(blpapi_SubscriptionList_t *list); +def _blpapi_SubscriptionList_destroy(slist): + l_blpapi_SubscriptionList_destroy(slist) + + +# signature: int blpapi_SubscriptionList_isResolvedAt(blpapi_SubscriptionList_t *list, int *result, size_t index); +def _blpapi_SubscriptionList_isResolvedAt(slist, index): + out = c_int() + outp = pointer(out) + retCode = l_blpapi_SubscriptionList_isResolvedAt( + slist, outp, c_size_t(index) + ) + return retCode, getPODFromOutput(outp, retCode) != 0 + + +# signature: int blpapi_SubscriptionList_size(const blpapi_SubscriptionList_t *list); +def _blpapi_SubscriptionList_size(slist): + return l_blpapi_SubscriptionList_size(slist) # int + + +# signature: int blpapi_SubscriptionList_topicStringAt(blpapi_SubscriptionList_t *list, const char **result, size_t index); +def _blpapi_SubscriptionList_topicStringAt(slist, index): + out = c_char_p() + outp = pointer(out) + retCode = l_blpapi_SubscriptionList_topicStringAt( + slist, outp, c_size_t(index) + ) + return retCode, getStrFromOutput(outp, retCode) + + +# signature: int blpapi_TestUtil_appendMessage(blpapi_MessageFormatter_t **formatter,blpapi_Event_t *event,const blpapi_SchemaElementDefinition_t *messageType,const blpapi_MessageProperties_t *properties); +def _blpapi_TestUtil_appendMessage(event, messageType, properties): + out = c_void_p() + outp = pointer(out) + retCode = l_blpapi_TestUtil_appendMessage( + outp, event, messageType, properties + ) # int + return retCode, getHandleFromOutput(outp, retCode) + + +# signature: int blpapi_TestUtil_createEvent(blpapi_Event_t **event, int eventType); +def _blpapi_TestUtil_createEvent(eventType): + out = c_void_p() + outp = pointer(out) + retCode = l_blpapi_TestUtil_createEvent(outp, eventType) # int + return retCode, getHandleFromOutput(outp, retCode) + + +# signature: int blpapi_TestUtil_createTopic(blpapi_Topic_t **topic, const blpapi_Service_t *service, int isActive); +def _blpapi_TestUtil_createTopic(service, isActive): + out = c_void_p() + outp = pointer(out) + retCode = l_blpapi_TestUtil_createTopic(outp, service, isActive) # int + return retCode, getHandleFromOutput(outp, retCode) + + +# signature: int blpapi_TestUtil_deserializeService(const char *schema, size_t schemaLength, blpapi_Service_t **service); +def _blpapi_TestUtil_deserializeService( + schema, schemaLength +): # pylint: disable=unused-argument + out = c_void_p() + outp = pointer(out) + schemac, sz = charPtrWithSizeFromPyStr(schema) + retCode = l_blpapi_TestUtil_deserializeService( + schemac, c_size_t(sz), outp + ) # int + return retCode, getHandleFromOutput(outp, retCode) + + +# signature: int blpapi_TestUtil_getAdminMessageDefinition(blpapi_SchemaElementDefinition_t **definition,blpapi_Name_t *messageName); +def _blpapi_TestUtil_getAdminMessageDefinition(messageName): + out = c_void_p() + outp = pointer(out) + retCode = l_blpapi_TestUtil_getAdminMessageDefinition( + outp, messageName + ) # int + return retCode, getHandleFromOutput(outp, retCode) + + +# signature: +def _blpapi_TestUtil_serializeServiceHelper(service): + out = StringIO() + writer = StreamWrapper() + outparam = voidFromPyObject(out) + retCode = l_blpapi_TestUtil_serializeService( + writer.get(), outparam, service + ) + if retCode: + return None + out.seek(0) + return out.read() + + +# signature: long long blpapi_TimePointUtil_nanosecondsBetween(const blpapi_TimePoint_t *start, const blpapi_TimePoint_t *end); +def _blpapi_TimePointUtil_nanosecondsBetween(start, end): + raise NotImplementedError("not called") + + +# signature: blpapi_TlsOptions_t *blpapi_TlsOptions_createFromBlobs(const char *clientCredentialsRawData,int clientCredentialsRawDataLength,const char *clientCredentialsPassword,const char *trustedCertificatesRawData,int trustedCertificatesRawDataLength); +def _blpapi_TlsOptions_createFromBlobs( + clientCredentialsRawData, + clientCredentialsPassword, + trustedCertificatesRawData, +): + cc, ccsz = charPtrWithSizeFromPyStr(clientCredentialsRawData) + tc, tcsz = charPtrWithSizeFromPyStr(trustedCertificatesRawData) + return getHandleFromPtr( + l_blpapi_TlsOptions_createFromBlobs( + cc, ccsz, charPtrFromPyStr(clientCredentialsPassword), tc, tcsz + ) + ) + + +# signature: blpapi_TlsOptions_t *blpapi_TlsOptions_createFromFiles(const char *clientCredentialsFileName,const char *clientCredentialsPassword,const char *trustedCertificatesFileName); +def _blpapi_TlsOptions_createFromFiles( + clientCredentialsFileName, + clientCredentialsPassword, + trustedCertificatesFileName, +): + return getHandleFromPtr( + l_blpapi_TlsOptions_createFromFiles( + charPtrFromPyStr(clientCredentialsFileName), + charPtrFromPyStr(clientCredentialsPassword), + charPtrFromPyStr(trustedCertificatesFileName), + ) + ) + + +# signature: void blpapi_TlsOptions_destroy(blpapi_TlsOptions_t *parameters); +def _blpapi_TlsOptions_destroy(parameters): + l_blpapi_TlsOptions_destroy(parameters) + + +# signature: void blpapi_TlsOptions_setCrlFetchTimeoutMs(blpapi_TlsOptions_t *paramaters, int crlFetchTimeoutMs); +def _blpapi_TlsOptions_setCrlFetchTimeoutMs(paramaters, crlFetchTimeoutMs): + l_blpapi_TlsOptions_setCrlFetchTimeoutMs(paramaters, crlFetchTimeoutMs) + + +# signature: void blpapi_TlsOptions_setTlsHandshakeTimeoutMs(blpapi_TlsOptions_t *paramaters, int tlsHandshakeTimeoutMs); +def _blpapi_TlsOptions_setTlsHandshakeTimeoutMs( + paramaters, tlsHandshakeTimeoutMs +): + l_blpapi_TlsOptions_setTlsHandshakeTimeoutMs( + paramaters, tlsHandshakeTimeoutMs + ) + + +# signature: int blpapi_TopicList_add(blpapi_TopicList_t *list,const char *topic,const blpapi_CorrelationId_t *correlationId); +def _blpapi_TopicList_add(topic_list, topic, correlationId): + return l_blpapi_TopicList_add( + topic_list, + charPtrFromPyStr(topic), + byref(correlationId.thestruct), + ) + + +# signature: int blpapi_TopicList_addFromMessage(blpapi_TopicList_t *list,const blpapi_Message_t *topic,const blpapi_CorrelationId_t *correlationId); +def _blpapi_TopicList_addFromMessage(topic_list, message, correlationId): + return l_blpapi_TopicList_addFromMessage( + topic_list, message, byref(correlationId.thestruct) + ) + + +# signature: int blpapi_TopicList_correlationIdAt(const blpapi_TopicList_t *list,blpapi_CorrelationId_t *result,size_t index); +def _blpapi_TopicList_correlationIdAt(topic_list, index): + cid = CidStruct() + cidp = pointer(cid) + retCode = l_blpapi_TopicList_correlationIdAt( + topic_list, cidp, c_size_t(index) + ) + if retCode == 0: + # C does *result = rlImpl->correlationId(index).impl(); + # i.e, we need to bump ref. + # the caller will wrap this in CorrelationId + return retCode, cid + return retCode, None + + +# signature: blpapi_TopicList_t *blpapi_TopicList_create(blpapi_TopicList_t *from); +def _blpapi_TopicList_create(_from): + fromp = c_void_p() if _from is None else _from + return getHandleFromPtr(l_blpapi_TopicList_create(fromp)) + + +# signature: +def _blpapi_TopicList_createFromResolutionList(_from): + return getHandleFromPtr(l_blpapi_TopicList_create(_from)) + + +# signature: void blpapi_TopicList_destroy(blpapi_TopicList_t *list); +def _blpapi_TopicList_destroy(topic_list): + l_blpapi_TopicList_destroy(topic_list) + + +# signature: int blpapi_TopicList_message(const blpapi_TopicList_t *list,blpapi_Message_t **element,const blpapi_CorrelationId_t *id); +def _blpapi_TopicList_message(topic_list, cid): + out = c_void_p() + outp = pointer(out) + retCode = l_blpapi_TopicList_message( + topic_list, outp, byref(cid.thestruct) + ) + return retCode, getHandleFromOutput(outp, retCode) + + +# signature: int blpapi_TopicList_messageAt(const blpapi_TopicList_t *list,blpapi_Message_t **element,size_t index); +def _blpapi_TopicList_messageAt(topic_list, index): + out = c_void_p() + outp = pointer(out) + retCode = l_blpapi_TopicList_messageAt(topic_list, outp, index) + return retCode, getHandleFromOutput(outp, retCode) + + +# signature: int blpapi_TopicList_size(const blpapi_TopicList_t *list); +def _blpapi_TopicList_size(topic_list): + return l_blpapi_TopicList_size(topic_list) # int + + +# signature: int blpapi_TopicList_status(const blpapi_TopicList_t *list,int *status,const blpapi_CorrelationId_t *id); +def _blpapi_TopicList_status(topic_list, cid): + out = c_int() + outp = pointer(out) + retCode = l_blpapi_TopicList_status(topic_list, outp, byref(cid.thestruct)) + return retCode, getPODFromOutput(outp, retCode) + + +# signature: int blpapi_TopicList_statusAt(const blpapi_TopicList_t *list, int *status, size_t index); +def _blpapi_TopicList_statusAt(topic_list, index): + out = c_int() + outp = pointer(out) + retCode = l_blpapi_TopicList_statusAt(topic_list, outp, index) + return retCode, getPODFromOutput(outp, retCode) + + +# signature: int blpapi_TopicList_topicString(const blpapi_TopicList_t *list,const char **topic,const blpapi_CorrelationId_t *id); +def _blpapi_TopicList_topicString(topic_list, cid): + out = c_char_p() + outp = pointer(out) + retCode = l_blpapi_TopicList_topicString( + topic_list, outp, byref(cid.thestruct) + ) + return retCode, getStrFromOutput(outp, retCode) + + +# signature: int blpapi_TopicList_topicStringAt(const blpapi_TopicList_t *list, const char **topic, size_t index); +def _blpapi_TopicList_topicStringAt(topic_list, index): + out = c_char_p() + outp = pointer(out) + retCode = l_blpapi_TopicList_topicStringAt(topic_list, outp, index) + return retCode, getStrFromOutput(outp, retCode) + + +# signature: int blpapi_Topic_compare(const blpapi_Topic_t *lhs, const blpapi_Topic_t *rhs); +def _blpapi_Topic_compare(lhs, rhs): + return l_blpapi_Topic_compare(lhs, rhs) + + +# signature: blpapi_Topic_t *blpapi_Topic_create(blpapi_Topic_t *from); +def _blpapi_Topic_create(_from): + raise NotImplementedError("not called") + + +# signature: void blpapi_Topic_destroy(blpapi_Topic_t *victim); +def _blpapi_Topic_destroy(victim): + l_blpapi_Topic_destroy(victim) + + +# signature: int blpapi_Topic_isActive(const blpapi_Topic_t *topic); +def _blpapi_Topic_isActive(topic): + return l_blpapi_Topic_isActive(topic) != 0 + + +# signature: blpapi_Service_t *blpapi_Topic_service(const blpapi_Topic_t *topic); +def _blpapi_Topic_service(topic): + return getHandleFromPtr(l_blpapi_Topic_service(topic)) + + +# signature: int blpapi_ZfpUtil_getOptionsForLeasedLines(blpapi_SessionOptions_t *sessionOptions,const blpapi_TlsOptions_t *tlsOptions,int remote); +def _blpapi_ZfpUtil_getOptionsForLeasedLines( + sessionOptions, tlsOptions, remote +): + return l_blpapi_ZfpUtil_getOptionsForLeasedLines( + sessionOptions, tlsOptions, remote + ) + + +# signature: const char *blpapi_getLastErrorDescription(int resultCode); +def _blpapi_getLastErrorDescription(resultCode): + return getStrFromC(l_blpapi_getLastErrorDescription(resultCode)) + + +def _blpapi_getVersionInfo(): + major = c_int() + majorp = pointer(major) + minor = c_int() + minorp = pointer(minor) + patch = c_int() + patchp = pointer(patch) + build = c_int() + buildp = pointer(build) + + l_blpapi_getVersionInfo(majorp, minorp, patchp, buildp) + + return ".".join( + [ + str(major.value), + str(minor.value), + str(patch.value), + str(build.value), + ] + ) + + +def _ProviderSession_createHelper(parameters, eventHandlerFunc, dispatcher): + # parameters is a handle to SessionOptions + # eventHandlerFunc is python callback + # dispatcher is a handle to dispatcher, which we honestly hope to be None! + # returns handle to Session + hasHandler = eventHandlerFunc is not None + if hasHandler: + handlerparam = anySessionEventHandlerWrapper.get() + userdata = voidFromPyFunction(eventHandlerFunc) + else: + handlerparam = c_void_p(0) + userdata = c_void_p(0) + handle = l_blpapi_ProviderSession_create( + parameters, + handlerparam, + dispatcher, + userdata, + ) + return getHandleFromPtr(handle) + + +def _ProviderSession_destroyHelper(sessionHandle, _eventHandlerFunc): + l_blpapi_ProviderSession_destroy(sessionHandle) + + +def _Session_createHelper(parameters, eventHandlerFunc, dispatcher): + # parameters is a handle to SessionOptions + # eventHandlerFunc is python callback + # dispatcher is a handle to dispatcher, which we honestly hope to be None! + # returns handle to Session + hasHandler = eventHandlerFunc is not None + if hasHandler: + handlerparam = anySessionEventHandlerWrapper.get() + userdata = voidFromPyFunction(eventHandlerFunc) + else: + handlerparam = c_void_p(0) + userdata = c_void_p(0) + + handle = l_blpapi_Session_create( + parameters, + handlerparam, + dispatcher, + userdata, + ) + # returns address of control block of shared_ptr + return getHandleFromPtr(handle) + + +def _Session_destroyHelper(sessionHandle, _eventHandlerFunc): + l_blpapi_Session_destroy(sessionHandle) + + +blpapi_AbstractSession_cancel = _blpapi_AbstractSession_cancel +blpapi_AbstractSession_createIdentity = _blpapi_AbstractSession_createIdentity +blpapi_AbstractSession_generateAuthorizedIdentityAsync = ( + _blpapi_AbstractSession_generateAuthorizedIdentityAsync +) +blpapi_AbstractSession_generateManualToken = ( + _blpapi_AbstractSession_generateManualToken +) +blpapi_AbstractSession_generateToken = _blpapi_AbstractSession_generateToken +blpapi_AbstractSession_getAuthorizedIdentity = ( + _blpapi_AbstractSession_getAuthorizedIdentity +) +blpapi_AbstractSession_getService = _blpapi_AbstractSession_getService +blpapi_AbstractSession_openService = _blpapi_AbstractSession_openService +blpapi_AbstractSession_openServiceAsync = ( + _blpapi_AbstractSession_openServiceAsync +) +blpapi_AbstractSession_sendAuthorizationRequest = ( + _blpapi_AbstractSession_sendAuthorizationRequest +) +blpapi_AbstractSession_sessionName = _blpapi_AbstractSession_sessionName +blpapi_AuthApplication_copy = _blpapi_AuthApplication_copy +blpapi_AuthApplication_create = _blpapi_AuthApplication_create +blpapi_AuthApplication_destroy = _blpapi_AuthApplication_destroy +blpapi_AuthApplication_duplicate = _blpapi_AuthApplication_duplicate +blpapi_AuthOptions_copy = _blpapi_AuthOptions_copy +blpapi_AuthOptions_create_default = _blpapi_AuthOptions_create_default +blpapi_AuthOptions_create_forAppMode = _blpapi_AuthOptions_create_forAppMode +blpapi_AuthOptions_create_forToken = _blpapi_AuthOptions_create_forToken +blpapi_AuthOptions_create_forUserAndAppMode = ( + _blpapi_AuthOptions_create_forUserAndAppMode +) +blpapi_AuthOptions_create_forUserMode = _blpapi_AuthOptions_create_forUserMode +blpapi_AuthOptions_destroy = _blpapi_AuthOptions_destroy +blpapi_AuthOptions_duplicate = _blpapi_AuthOptions_duplicate +blpapi_AuthToken_copy = _blpapi_AuthToken_copy +blpapi_AuthToken_create = _blpapi_AuthToken_create +blpapi_AuthToken_destroy = _blpapi_AuthToken_destroy +blpapi_AuthToken_duplicate = _blpapi_AuthToken_duplicate +blpapi_AuthUser_copy = _blpapi_AuthUser_copy +blpapi_AuthUser_createWithActiveDirectoryProperty = ( + _blpapi_AuthUser_createWithActiveDirectoryProperty +) +blpapi_AuthUser_createWithLogonName = _blpapi_AuthUser_createWithLogonName +blpapi_AuthUser_createWithManualOptions = ( + _blpapi_AuthUser_createWithManualOptions +) +blpapi_AuthUser_destroy = _blpapi_AuthUser_destroy +blpapi_AuthUser_duplicate = _blpapi_AuthUser_duplicate +blpapi_ConstantList_datatype = _blpapi_ConstantList_datatype +blpapi_ConstantList_description = _blpapi_ConstantList_description +blpapi_ConstantList_getConstant = _blpapi_ConstantList_getConstant +blpapi_ConstantList_getConstantAt = _blpapi_ConstantList_getConstantAt +blpapi_ConstantList_hasConstant = _blpapi_ConstantList_hasConstant +blpapi_ConstantList_name = _blpapi_ConstantList_name +blpapi_ConstantList_numConstants = _blpapi_ConstantList_numConstants +blpapi_ConstantList_status = _blpapi_ConstantList_status +blpapi_Constant_datatype = _blpapi_Constant_datatype +blpapi_Constant_description = _blpapi_Constant_description +blpapi_Constant_getValueAsChar = _blpapi_Constant_getValueAsChar +blpapi_Constant_getValueAsDatetime = _blpapi_Constant_getValueAsDatetime +blpapi_Constant_getValueAsFloat32 = _blpapi_Constant_getValueAsFloat32 +blpapi_Constant_getValueAsFloat64 = _blpapi_Constant_getValueAsFloat64 +blpapi_Constant_getValueAsInt32 = _blpapi_Constant_getValueAsInt32 +blpapi_Constant_getValueAsInt64 = _blpapi_Constant_getValueAsInt64 +blpapi_Constant_getValueAsString = _blpapi_Constant_getValueAsString +blpapi_Constant_name = _blpapi_Constant_name +blpapi_Constant_status = _blpapi_Constant_status +blpapi_Datetime_tag = BDatetime +blpapi_DiagnosticsUtil_memoryInfo_wrapper = ( + _blpapi_DiagnosticsUtil_memoryInfo_wrapper +) +blpapi_Element_appendElement = _blpapi_Element_appendElement +blpapi_Element_datatype = _blpapi_Element_datatype +blpapi_Element_definition = _blpapi_Element_definition +blpapi_Element_getChoice = _blpapi_Element_getChoice +blpapi_Element_getElement = _blpapi_Element_getElement +blpapi_Element_getElementAt = _blpapi_Element_getElementAt +blpapi_Element_getValueAsBool = _blpapi_Element_getValueAsBool +blpapi_Element_getValueAsBytes = _blpapi_Element_getValueAsBytes +blpapi_Element_getValueAsChar = _blpapi_Element_getValueAsChar +blpapi_Element_getValueAsDatetime = _blpapi_Element_getValueAsDatetime +blpapi_Element_getValueAsElement = _blpapi_Element_getValueAsElement +blpapi_Element_getValueAsFloat64 = _blpapi_Element_getValueAsFloat64 +blpapi_Element_getValueAsHighPrecisionDatetime = ( + _blpapi_Element_getValueAsHighPrecisionDatetime +) +blpapi_Element_getValueAsInt32 = _blpapi_Element_getValueAsInt32 +blpapi_Element_getValueAsInt64 = _blpapi_Element_getValueAsInt64 +blpapi_Element_getValueAsName = _blpapi_Element_getValueAsName +blpapi_Element_getValueAsString = _blpapi_Element_getValueAsString +blpapi_Element_hasElementEx = _blpapi_Element_hasElementEx +blpapi_Element_isArray = _blpapi_Element_isArray +blpapi_Element_isComplexType = _blpapi_Element_isComplexType +blpapi_Element_isNull = _blpapi_Element_isNull +blpapi_Element_isNullValue = _blpapi_Element_isNullValue +blpapi_Element_isReadOnly = _blpapi_Element_isReadOnly +blpapi_Element_name = _blpapi_Element_name +blpapi_Element_nameString = _blpapi_Element_nameString +blpapi_Element_numElements = _blpapi_Element_numElements +blpapi_Element_numValues = _blpapi_Element_numValues +blpapi_Element_printHelper = _blpapi_Element_printHelper +blpapi_Element_setChoice = _blpapi_Element_setChoice +blpapi_Element_setElementBool = _blpapi_Element_setElementBool +blpapi_Element_setElementBytes = _blpapi_Element_setElementBytes +blpapi_Element_setElementFloat = _blpapi_Element_setElementFloat +blpapi_Element_setElementFromName = _blpapi_Element_setElementFromName +blpapi_Element_setElementHighPrecisionDatetime = ( + _blpapi_Element_setElementHighPrecisionDatetime +) +blpapi_Element_setElementInt32 = _blpapi_Element_setElementInt32 +blpapi_Element_setElementInt64 = _blpapi_Element_setElementInt64 +blpapi_Element_setElementString = _blpapi_Element_setElementString +blpapi_Element_setValueBool = _blpapi_Element_setValueBool +blpapi_Element_setValueBytes = _blpapi_Element_setValueBytes +blpapi_Element_setValueFloat = _blpapi_Element_setValueFloat +blpapi_Element_setValueFromName = _blpapi_Element_setValueFromName +blpapi_Element_setValueHighPrecisionDatetime = ( + _blpapi_Element_setValueHighPrecisionDatetime +) +blpapi_Element_setValueInt32 = _blpapi_Element_setValueInt32 +blpapi_Element_setValueInt64 = _blpapi_Element_setValueInt64 +blpapi_Element_setValueString = _blpapi_Element_setValueString +blpapi_Element_toPy = _blpapi_Element_toPy +blpapi_EventDispatcher_create = _blpapi_EventDispatcher_create +blpapi_EventDispatcher_destroy = _blpapi_EventDispatcher_destroy +blpapi_EventDispatcher_start = _blpapi_EventDispatcher_start +blpapi_EventDispatcher_stop = _blpapi_EventDispatcher_stop +blpapi_EventFormatter_appendElement = _blpapi_EventFormatter_appendElement +blpapi_EventFormatter_appendFragmentedRecapMessage = ( + _blpapi_EventFormatter_appendFragmentedRecapMessage +) +blpapi_EventFormatter_appendFragmentedRecapMessageSeq = ( + _blpapi_EventFormatter_appendFragmentedRecapMessageSeq +) +blpapi_EventFormatter_appendMessage = _blpapi_EventFormatter_appendMessage +blpapi_EventFormatter_appendMessageSeq = ( + _blpapi_EventFormatter_appendMessageSeq +) +blpapi_EventFormatter_appendRecapMessage = ( + _blpapi_EventFormatter_appendRecapMessage +) +blpapi_EventFormatter_appendRecapMessageSeq = ( + _blpapi_EventFormatter_appendRecapMessageSeq +) +blpapi_EventFormatter_appendResponse = _blpapi_EventFormatter_appendResponse +blpapi_EventFormatter_appendValueBool = _blpapi_EventFormatter_appendValueBool +blpapi_EventFormatter_appendValueChar = _blpapi_EventFormatter_appendValueChar +blpapi_EventFormatter_appendValueFloat = ( + _blpapi_EventFormatter_appendValueFloat +) +blpapi_EventFormatter_appendValueFromName = ( + _blpapi_EventFormatter_appendValueFromName +) +blpapi_EventFormatter_appendValueHighPrecisionDatetime = ( + _blpapi_EventFormatter_appendValueHighPrecisionDatetime +) +blpapi_EventFormatter_appendValueInt32 = ( + _blpapi_EventFormatter_appendValueInt32 +) +blpapi_EventFormatter_appendValueInt64 = ( + _blpapi_EventFormatter_appendValueInt64 +) +blpapi_EventFormatter_appendValueString = ( + _blpapi_EventFormatter_appendValueString +) +blpapi_EventFormatter_create = _blpapi_EventFormatter_create +blpapi_EventFormatter_destroy = _blpapi_EventFormatter_destroy +blpapi_EventFormatter_popElement = _blpapi_EventFormatter_popElement +blpapi_EventFormatter_pushElement = _blpapi_EventFormatter_pushElement +blpapi_EventFormatter_setValueBool = _blpapi_EventFormatter_setValueBool +blpapi_EventFormatter_setValueBytes = _blpapi_EventFormatter_setValueBytes +blpapi_EventFormatter_setValueChar = _blpapi_EventFormatter_setValueChar +blpapi_EventFormatter_setValueFloat = _blpapi_EventFormatter_setValueFloat +blpapi_EventFormatter_setValueFromName = ( + _blpapi_EventFormatter_setValueFromName +) +blpapi_EventFormatter_setValueHighPrecisionDatetime = ( + _blpapi_EventFormatter_setValueHighPrecisionDatetime +) +blpapi_EventFormatter_setValueInt32 = _blpapi_EventFormatter_setValueInt32 +blpapi_EventFormatter_setValueInt64 = _blpapi_EventFormatter_setValueInt64 +blpapi_EventFormatter_setValueNull = _blpapi_EventFormatter_setValueNull +blpapi_EventFormatter_setValueString = _blpapi_EventFormatter_setValueString +blpapi_EventQueue_create = _blpapi_EventQueue_create +blpapi_EventQueue_destroy = _blpapi_EventQueue_destroy +blpapi_EventQueue_nextEvent = _blpapi_EventQueue_nextEvent +blpapi_EventQueue_purge = _blpapi_EventQueue_purge +blpapi_EventQueue_tryNextEvent = _blpapi_EventQueue_tryNextEvent +blpapi_Event_eventType = _blpapi_Event_eventType +blpapi_Event_release = _blpapi_Event_release +blpapi_HighPrecisionDatetime_compare = _blpapi_HighPrecisionDatetime_compare +blpapi_HighPrecisionDatetime_fromTimePoint = ( + _blpapi_HighPrecisionDatetime_fromTimePoint +) +blpapi_HighPrecisionDatetime_fromTimePoint_wrapper = ( + _blpapi_HighPrecisionDatetime_fromTimePoint_wrapper +) +blpapi_HighPrecisionDatetime_print = _blpapi_HighPrecisionDatetime_print +blpapi_HighPrecisionDatetime_tag = HighPrecisionDatetime +blpapi_HighResolutionClock_now = _blpapi_HighResolutionClock_now +blpapi_Identity_addRef = _blpapi_Identity_addRef +blpapi_Identity_getSeatType = _blpapi_Identity_getSeatType +blpapi_Identity_hasEntitlements = _blpapi_Identity_hasEntitlements +blpapi_Identity_isAuthorized = _blpapi_Identity_isAuthorized +blpapi_Identity_release = _blpapi_Identity_release +blpapi_Logging_logTestMessage = _blpapi_Logging_logTestMessage +blpapi_Logging_registerCallback = _blpapi_Logging_registerCallback +blpapi_MessageFormatter_FormatMessageJson = ( + _blpapi_MessageFormatter_FormatMessageJson +) +blpapi_MessageFormatter_FormatMessageXml = ( + _blpapi_MessageFormatter_FormatMessageXml +) +blpapi_MessageFormatter_appendElement = _blpapi_MessageFormatter_appendElement +blpapi_MessageFormatter_appendValueBool = ( + _blpapi_MessageFormatter_appendValueBool +) +blpapi_MessageFormatter_appendValueChar = ( + _blpapi_MessageFormatter_appendValueChar +) +blpapi_MessageFormatter_appendValueDatetime = ( + _blpapi_MessageFormatter_appendValueDatetime +) +blpapi_MessageFormatter_appendValueFloat = ( + _blpapi_MessageFormatter_appendValueFloat +) +blpapi_MessageFormatter_appendValueFloat32 = ( + _blpapi_MessageFormatter_appendValueFloat32 +) +blpapi_MessageFormatter_appendValueFloat64 = ( + _blpapi_MessageFormatter_appendValueFloat64 +) +blpapi_MessageFormatter_appendValueFromName = ( + _blpapi_MessageFormatter_appendValueFromName +) +blpapi_MessageFormatter_appendValueHighPrecisionDatetime = ( + _blpapi_MessageFormatter_appendValueHighPrecisionDatetime +) +blpapi_MessageFormatter_appendValueInt32 = ( + _blpapi_MessageFormatter_appendValueInt32 +) +blpapi_MessageFormatter_appendValueInt64 = ( + _blpapi_MessageFormatter_appendValueInt64 +) +blpapi_MessageFormatter_appendValueString = ( + _blpapi_MessageFormatter_appendValueString +) +blpapi_MessageFormatter_assign = _blpapi_MessageFormatter_assign +blpapi_MessageFormatter_copy = _blpapi_MessageFormatter_copy +blpapi_MessageFormatter_destroy = _blpapi_MessageFormatter_destroy +blpapi_MessageFormatter_popElement = _blpapi_MessageFormatter_popElement +blpapi_MessageFormatter_pushElement = _blpapi_MessageFormatter_pushElement +blpapi_MessageFormatter_setValueBool = _blpapi_MessageFormatter_setValueBool +blpapi_MessageFormatter_setValueBytes = _blpapi_MessageFormatter_setValueBytes +blpapi_MessageFormatter_setValueChar = _blpapi_MessageFormatter_setValueChar +blpapi_MessageFormatter_setValueDatetime = ( + _blpapi_MessageFormatter_setValueDatetime +) +blpapi_MessageFormatter_setValueFloat = _blpapi_MessageFormatter_setValueFloat +blpapi_MessageFormatter_setValueFloat32 = ( + _blpapi_MessageFormatter_setValueFloat32 +) +blpapi_MessageFormatter_setValueFloat64 = ( + _blpapi_MessageFormatter_setValueFloat64 +) +blpapi_MessageFormatter_setValueFromName = ( + _blpapi_MessageFormatter_setValueFromName +) +blpapi_MessageFormatter_setValueHighPrecisionDatetime = ( + _blpapi_MessageFormatter_setValueHighPrecisionDatetime +) +blpapi_MessageFormatter_setValueInt32 = _blpapi_MessageFormatter_setValueInt32 +blpapi_MessageFormatter_setValueInt64 = _blpapi_MessageFormatter_setValueInt64 +blpapi_MessageFormatter_setValueNull = _blpapi_MessageFormatter_setValueNull +blpapi_MessageFormatter_setValueString = ( + _blpapi_MessageFormatter_setValueString +) +blpapi_MessageIterator_create = _blpapi_MessageIterator_create +blpapi_MessageIterator_destroy = _blpapi_MessageIterator_destroy +blpapi_MessageIterator_next = _blpapi_MessageIterator_next +blpapi_MessageProperties_assign = _blpapi_MessageProperties_assign +blpapi_MessageProperties_copy = _blpapi_MessageProperties_copy +blpapi_MessageProperties_create = _blpapi_MessageProperties_create +blpapi_MessageProperties_destroy = _blpapi_MessageProperties_destroy +blpapi_MessageProperties_setCorrelationIds = ( + _blpapi_MessageProperties_setCorrelationIds +) +blpapi_MessageProperties_setRecapType = _blpapi_MessageProperties_setRecapType +blpapi_MessageProperties_setRequestId = _blpapi_MessageProperties_setRequestId +blpapi_MessageProperties_setService = _blpapi_MessageProperties_setService +blpapi_MessageProperties_setTimeReceived = ( + _blpapi_MessageProperties_setTimeReceived +) +blpapi_Message_addRef = _blpapi_Message_addRef +blpapi_Message_correlationId = _blpapi_Message_correlationId +blpapi_Message_elements = _blpapi_Message_elements +blpapi_Message_fragmentType = _blpapi_Message_fragmentType +blpapi_Message_getRequestId = _blpapi_Message_getRequestId +blpapi_Message_messageType = _blpapi_Message_messageType +blpapi_Message_numCorrelationIds = _blpapi_Message_numCorrelationIds +blpapi_Message_printHelper = _blpapi_Message_printHelper +blpapi_Message_recapType = _blpapi_Message_recapType +blpapi_Message_release = _blpapi_Message_release +blpapi_Message_service = _blpapi_Message_service +blpapi_Message_timeReceived = _blpapi_Message_timeReceived +blpapi_Message_topicName = _blpapi_Message_topicName +blpapi_Name_create = _blpapi_Name_create +blpapi_Name_destroy = _blpapi_Name_destroy +blpapi_Name_equalsStr = _blpapi_Name_equalsStr +blpapi_Name_findName = _blpapi_Name_findName +blpapi_Name_hasName = _blpapi_Name_hasName +blpapi_Name_length = _blpapi_Name_length +blpapi_Name_string = _blpapi_Name_string +blpapi_Operation_description = _blpapi_Operation_description +blpapi_Operation_name = _blpapi_Operation_name +blpapi_Operation_numResponseDefinitions = ( + _blpapi_Operation_numResponseDefinitions +) +blpapi_Operation_requestDefinition = _blpapi_Operation_requestDefinition +blpapi_Operation_responseDefinition = _blpapi_Operation_responseDefinition +blpapi_Operation_responseDefinitionFromName = ( + _blpapi_Operation_responseDefinitionFromName +) +blpapi_ProviderSession_activateSubServiceCodeRange = ( + _blpapi_ProviderSession_activateSubServiceCodeRange +) +blpapi_ProviderSession_createServiceStatusTopic = ( + _blpapi_ProviderSession_createServiceStatusTopic +) +blpapi_ProviderSession_createTopic = _blpapi_ProviderSession_createTopic +blpapi_ProviderSession_createTopics = _blpapi_ProviderSession_createTopics +blpapi_ProviderSession_createTopicsAsync = ( + _blpapi_ProviderSession_createTopicsAsync +) +blpapi_ProviderSession_deactivateSubServiceCodeRange = ( + _blpapi_ProviderSession_deactivateSubServiceCodeRange +) +blpapi_ProviderSession_deleteTopics = _blpapi_ProviderSession_deleteTopics +blpapi_ProviderSession_deregisterService = ( + _blpapi_ProviderSession_deregisterService +) +blpapi_ProviderSession_flushPublishedEvents = ( + _blpapi_ProviderSession_flushPublishedEvents +) +blpapi_ProviderSession_getAbstractSession = ( + _blpapi_ProviderSession_getAbstractSession +) +blpapi_ProviderSession_getTopic = _blpapi_ProviderSession_getTopic +blpapi_ProviderSession_nextEvent = _blpapi_ProviderSession_nextEvent +blpapi_ProviderSession_publish = _blpapi_ProviderSession_publish +blpapi_ProviderSession_registerService = ( + _blpapi_ProviderSession_registerService +) +blpapi_ProviderSession_registerServiceAsync = ( + _blpapi_ProviderSession_registerServiceAsync +) +blpapi_ProviderSession_resolve = _blpapi_ProviderSession_resolve +blpapi_ProviderSession_resolveAsync = _blpapi_ProviderSession_resolveAsync +blpapi_ProviderSession_sendResponse = _blpapi_ProviderSession_sendResponse +blpapi_ProviderSession_start = _blpapi_ProviderSession_start +blpapi_ProviderSession_startAsync = _blpapi_ProviderSession_startAsync +blpapi_ProviderSession_stop = _blpapi_ProviderSession_stop +blpapi_ProviderSession_stopAsync = _blpapi_ProviderSession_stopAsync +ProviderSession_terminateSubscriptionsOnTopic = ( + _blpapi_ProviderSession_terminateSubscriptionsOnTopic +) +blpapi_ProviderSession_terminateSubscriptionsOnTopics = ( + _blpapi_ProviderSession_terminateSubscriptionsOnTopics +) +blpapi_ProviderSession_tryNextEvent = _blpapi_ProviderSession_tryNextEvent +blpapi_RequestTemplate_release = _blpapi_RequestTemplate_release +blpapi_Request_destroy = _blpapi_Request_destroy +blpapi_Request_elements = _blpapi_Request_elements +blpapi_Request_getRequestId = _blpapi_Request_getRequestId +blpapi_Request_setPreferredRoute = _blpapi_Request_setPreferredRoute +blpapi_ResolutionList_add = _blpapi_ResolutionList_add +blpapi_ResolutionList_addAttribute = _blpapi_ResolutionList_addAttribute +blpapi_ResolutionList_addFromMessage = _blpapi_ResolutionList_addFromMessage +blpapi_ResolutionList_attribute = _blpapi_ResolutionList_attribute +blpapi_ResolutionList_attributeAt = _blpapi_ResolutionList_attributeAt +blpapi_ResolutionList_correlationIdAt = _blpapi_ResolutionList_correlationIdAt +blpapi_ResolutionList_create = _blpapi_ResolutionList_create +blpapi_ResolutionList_destroy = _blpapi_ResolutionList_destroy +blpapi_ResolutionList_extractAttributeFromResolutionSuccess = ( + _blpapi_ResolutionList_extractAttributeFromResolutionSuccess +) +blpapi_ResolutionList_message = _blpapi_ResolutionList_message +blpapi_ResolutionList_messageAt = _blpapi_ResolutionList_messageAt +blpapi_ResolutionList_size = _blpapi_ResolutionList_size +blpapi_ResolutionList_status = _blpapi_ResolutionList_status +blpapi_ResolutionList_statusAt = _blpapi_ResolutionList_statusAt +blpapi_ResolutionList_topicString = _blpapi_ResolutionList_topicString +blpapi_ResolutionList_topicStringAt = _blpapi_ResolutionList_topicStringAt +blpapi_SchemaElementDefinition_description = ( + _blpapi_SchemaElementDefinition_description +) +blpapi_SchemaElementDefinition_getAlternateName = ( + _blpapi_SchemaElementDefinition_getAlternateName +) +blpapi_SchemaElementDefinition_maxValues = ( + _blpapi_SchemaElementDefinition_maxValues +) +blpapi_SchemaElementDefinition_minValues = ( + _blpapi_SchemaElementDefinition_minValues +) +blpapi_SchemaElementDefinition_name = _blpapi_SchemaElementDefinition_name +blpapi_SchemaElementDefinition_numAlternateNames = ( + _blpapi_SchemaElementDefinition_numAlternateNames +) +blpapi_SchemaElementDefinition_printHelper = ( + _blpapi_SchemaElementDefinition_printHelper +) +blpapi_SchemaElementDefinition_status = _blpapi_SchemaElementDefinition_status +blpapi_SchemaElementDefinition_type = _blpapi_SchemaElementDefinition_type +blpapi_SchemaTypeDefinition_datatype = _blpapi_SchemaTypeDefinition_datatype +blpapi_SchemaTypeDefinition_description = ( + _blpapi_SchemaTypeDefinition_description +) +blpapi_SchemaTypeDefinition_enumeration = ( + _blpapi_SchemaTypeDefinition_enumeration +) +blpapi_SchemaTypeDefinition_getElementDefinition = ( + _blpapi_SchemaTypeDefinition_getElementDefinition +) +blpapi_SchemaTypeDefinition_getElementDefinitionAt = ( + _blpapi_SchemaTypeDefinition_getElementDefinitionAt +) +blpapi_SchemaTypeDefinition_hasElementDefinition = ( + _blpapi_SchemaTypeDefinition_hasElementDefinition +) +blpapi_SchemaTypeDefinition_isComplexType = ( + _blpapi_SchemaTypeDefinition_isComplexType +) +blpapi_SchemaTypeDefinition_isEnumerationType = ( + _blpapi_SchemaTypeDefinition_isEnumerationType +) +blpapi_SchemaTypeDefinition_isSimpleType = ( + _blpapi_SchemaTypeDefinition_isSimpleType +) +blpapi_SchemaTypeDefinition_name = _blpapi_SchemaTypeDefinition_name +blpapi_SchemaTypeDefinition_numElementDefinitions = ( + _blpapi_SchemaTypeDefinition_numElementDefinitions +) +blpapi_SchemaTypeDefinition_printHelper = ( + _blpapi_SchemaTypeDefinition_printHelper +) +blpapi_SchemaTypeDefinition_status = _blpapi_SchemaTypeDefinition_status +blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange = ( + _blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange +) +blpapi_ServiceRegistrationOptions_copy = ( + _blpapi_ServiceRegistrationOptions_copy +) +blpapi_ServiceRegistrationOptions_create = ( + _blpapi_ServiceRegistrationOptions_create +) +blpapi_ServiceRegistrationOptions_destroy = ( + _blpapi_ServiceRegistrationOptions_destroy +) +blpapi_ServiceRegistrationOptions_duplicate = ( + _blpapi_ServiceRegistrationOptions_duplicate +) +blpapi_ServiceRegistrationOptions_getGroupId = ( + _blpapi_ServiceRegistrationOptions_getGroupId +) +blpapi_ServiceRegistrationOptions_getPartsToRegister = ( + _blpapi_ServiceRegistrationOptions_getPartsToRegister +) +blpapi_ServiceRegistrationOptions_getServicePriority = ( + _blpapi_ServiceRegistrationOptions_getServicePriority +) +blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges = ( + _blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges +) +blpapi_ServiceRegistrationOptions_setGroupId = ( + _blpapi_ServiceRegistrationOptions_setGroupId +) +blpapi_ServiceRegistrationOptions_setPartsToRegister = ( + _blpapi_ServiceRegistrationOptions_setPartsToRegister +) +blpapi_ServiceRegistrationOptions_setServicePriority = ( + _blpapi_ServiceRegistrationOptions_setServicePriority +) +blpapi_Service_addRef = _blpapi_Service_addRef +blpapi_Service_authorizationServiceName = ( + _blpapi_Service_authorizationServiceName +) +blpapi_Service_createAdminEvent = _blpapi_Service_createAdminEvent +blpapi_Service_createAuthorizationRequest = ( + _blpapi_Service_createAuthorizationRequest +) +blpapi_Service_createPublishEvent = _blpapi_Service_createPublishEvent +blpapi_Service_createRequest = _blpapi_Service_createRequest +blpapi_Service_createResponseEvent = _blpapi_Service_createResponseEvent +blpapi_Service_description = _blpapi_Service_description +blpapi_Service_getEventDefinition = _blpapi_Service_getEventDefinition +blpapi_Service_getEventDefinitionAt = _blpapi_Service_getEventDefinitionAt +blpapi_Service_getOperation = _blpapi_Service_getOperation +blpapi_Service_getOperationAt = _blpapi_Service_getOperationAt +blpapi_Service_hasEventDefinition = _blpapi_Service_hasEventDefinition +blpapi_Service_hasOperation = _blpapi_Service_hasOperation +blpapi_Service_name = _blpapi_Service_name +blpapi_Service_numEventDefinitions = _blpapi_Service_numEventDefinitions +blpapi_Service_numOperations = _blpapi_Service_numOperations +blpapi_Service_printHelper = _blpapi_Service_printHelper +blpapi_Service_release = _blpapi_Service_release +blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg = ( + _blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg +) +blpapi_SessionOptions_applicationIdentityKey = ( + _blpapi_SessionOptions_applicationIdentityKey +) +blpapi_SessionOptions_authenticationOptions = ( + _blpapi_SessionOptions_authenticationOptions +) +blpapi_SessionOptions_autoRestartOnDisconnection = ( + _blpapi_SessionOptions_autoRestartOnDisconnection +) +blpapi_SessionOptions_bandwidthSaveModeDisabled = ( + _blpapi_SessionOptions_bandwidthSaveModeDisabled +) +blpapi_SessionOptions_clientMode = _blpapi_SessionOptions_clientMode +blpapi_SessionOptions_connectTimeout = _blpapi_SessionOptions_connectTimeout +blpapi_SessionOptions_create = _blpapi_SessionOptions_create +blpapi_SessionOptions_defaultKeepAliveInactivityTime = ( + _blpapi_SessionOptions_defaultKeepAliveInactivityTime +) +blpapi_SessionOptions_defaultKeepAliveResponseTimeout = ( + _blpapi_SessionOptions_defaultKeepAliveResponseTimeout +) +blpapi_SessionOptions_defaultServices = _blpapi_SessionOptions_defaultServices +blpapi_SessionOptions_defaultSubscriptionService = ( + _blpapi_SessionOptions_defaultSubscriptionService +) +blpapi_SessionOptions_defaultTopicPrefix = ( + _blpapi_SessionOptions_defaultTopicPrefix +) +blpapi_SessionOptions_destroy = _blpapi_SessionOptions_destroy +blpapi_SessionOptions_flushPublishedEventsTimeout = ( + _blpapi_SessionOptions_flushPublishedEventsTimeout +) +blpapi_SessionOptions_getServerAddressWithProxy = ( + _blpapi_SessionOptions_getServerAddressWithProxy +) +blpapi_SessionOptions_keepAliveEnabled = ( + _blpapi_SessionOptions_keepAliveEnabled +) +blpapi_SessionOptions_maxEventQueueSize = ( + _blpapi_SessionOptions_maxEventQueueSize +) +blpapi_SessionOptions_maxPendingRequests = ( + _blpapi_SessionOptions_maxPendingRequests +) +blpapi_SessionOptions_numServerAddresses = ( + _blpapi_SessionOptions_numServerAddresses +) +blpapi_SessionOptions_numStartAttempts = ( + _blpapi_SessionOptions_numStartAttempts +) +blpapi_SessionOptions_printHelper = _blpapi_SessionOptions_printHelper +blpapi_SessionOptions_recordSubscriptionDataReceiveTimes = ( + _blpapi_SessionOptions_recordSubscriptionDataReceiveTimes +) +blpapi_SessionOptions_removeServerAddress = ( + _blpapi_SessionOptions_removeServerAddress +) +blpapi_SessionOptions_serverHost = _blpapi_SessionOptions_serverHost +blpapi_SessionOptions_serverPort = _blpapi_SessionOptions_serverPort +blpapi_SessionOptions_serviceCheckTimeout = ( + _blpapi_SessionOptions_serviceCheckTimeout +) +blpapi_SessionOptions_serviceDownloadTimeout = ( + _blpapi_SessionOptions_serviceDownloadTimeout +) +blpapi_SessionOptions_sessionName = _blpapi_SessionOptions_sessionName +blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg = ( + _blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg +) +blpapi_SessionOptions_setApplicationIdentityKey = ( + _blpapi_SessionOptions_setApplicationIdentityKey +) +blpapi_SessionOptions_setAuthenticationOptions = ( + _blpapi_SessionOptions_setAuthenticationOptions +) +blpapi_SessionOptions_setAutoRestartOnDisconnection = ( + _blpapi_SessionOptions_setAutoRestartOnDisconnection +) +blpapi_SessionOptions_setBandwidthSaveModeDisabled = ( + _blpapi_SessionOptions_setBandwidthSaveModeDisabled +) +blpapi_SessionOptions_setClientMode = _blpapi_SessionOptions_setClientMode +blpapi_SessionOptions_setConnectTimeout = ( + _blpapi_SessionOptions_setConnectTimeout +) +blpapi_SessionOptions_setDefaultKeepAliveInactivityTime = ( + _blpapi_SessionOptions_setDefaultKeepAliveInactivityTime +) +blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout = ( + _blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout +) +blpapi_SessionOptions_setDefaultServices = ( + _blpapi_SessionOptions_setDefaultServices +) +blpapi_SessionOptions_setDefaultSubscriptionService = ( + _blpapi_SessionOptions_setDefaultSubscriptionService +) +blpapi_SessionOptions_setDefaultTopicPrefix = ( + _blpapi_SessionOptions_setDefaultTopicPrefix +) +blpapi_SessionOptions_setFlushPublishedEventsTimeout = ( + _blpapi_SessionOptions_setFlushPublishedEventsTimeout +) +blpapi_SessionOptions_setKeepAliveEnabled = ( + _blpapi_SessionOptions_setKeepAliveEnabled +) +blpapi_SessionOptions_setMaxEventQueueSize = ( + _blpapi_SessionOptions_setMaxEventQueueSize +) +blpapi_SessionOptions_setMaxPendingRequests = ( + _blpapi_SessionOptions_setMaxPendingRequests +) +blpapi_SessionOptions_setNumStartAttempts = ( + _blpapi_SessionOptions_setNumStartAttempts +) +blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes = ( + _blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes +) +blpapi_SessionOptions_setServerAddress = ( + _blpapi_SessionOptions_setServerAddress +) +blpapi_SessionOptions_setServerAddressWithProxy = ( + _blpapi_SessionOptions_setServerAddressWithProxy +) +blpapi_SessionOptions_setServerHost = _blpapi_SessionOptions_setServerHost +blpapi_SessionOptions_setServerPort = _blpapi_SessionOptions_setServerPort +blpapi_SessionOptions_setServiceCheckTimeout = ( + _blpapi_SessionOptions_setServiceCheckTimeout +) +blpapi_SessionOptions_setServiceDownloadTimeout = ( + _blpapi_SessionOptions_setServiceDownloadTimeout +) +blpapi_SessionOptions_setSessionIdentityOptions = ( + _blpapi_SessionOptions_setSessionIdentityOptions +) +blpapi_SessionOptions_setSessionName = _blpapi_SessionOptions_setSessionName +blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark = ( + _blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark +) +blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark = ( + _blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark +) +blpapi_SessionOptions_setTlsOptions = _blpapi_SessionOptions_setTlsOptions +blpapi_SessionOptions_slowConsumerWarningHiWaterMark = ( + _blpapi_SessionOptions_slowConsumerWarningHiWaterMark +) +blpapi_SessionOptions_slowConsumerWarningLoWaterMark = ( + _blpapi_SessionOptions_slowConsumerWarningLoWaterMark +) +blpapi_Session_createSnapshotRequestTemplate = ( + _blpapi_Session_createSnapshotRequestTemplate +) +blpapi_Session_getAbstractSession = _blpapi_Session_getAbstractSession +blpapi_Session_nextEvent = _blpapi_Session_nextEvent +blpapi_Session_resubscribe = _blpapi_Session_resubscribe +blpapi_Session_resubscribeEx = _blpapi_Session_resubscribeEx +blpapi_Session_resubscribeEx_helper = _blpapi_Session_resubscribeEx_helper +blpapi_Session_resubscribeWithId = _blpapi_Session_resubscribeWithId +blpapi_Session_resubscribeWithIdEx = _blpapi_Session_resubscribeWithIdEx +blpapi_Session_resubscribeWithIdEx_helper = ( + _blpapi_Session_resubscribeWithIdEx_helper +) +blpapi_Session_sendRequest = _blpapi_Session_sendRequest +blpapi_Session_sendRequestTemplate = _blpapi_Session_sendRequestTemplate +blpapi_Session_setStatusCorrelationId = _blpapi_Session_setStatusCorrelationId +blpapi_Session_start = _blpapi_Session_start +blpapi_Session_startAsync = _blpapi_Session_startAsync +blpapi_Session_stop = _blpapi_Session_stop +blpapi_Session_stopAsync = _blpapi_Session_stopAsync +blpapi_Session_subscribe = _blpapi_Session_subscribe +blpapi_Session_subscribeEx = _blpapi_Session_subscribeEx +blpapi_Session_subscribeEx_helper = _blpapi_Session_subscribeEx_helper +blpapi_Session_tryNextEvent = _blpapi_Session_tryNextEvent +blpapi_Session_unsubscribe = _blpapi_Session_unsubscribe +blpapi_Socks5Config_create = _blpapi_Socks5Config_create +blpapi_Socks5Config_destroy = _blpapi_Socks5Config_destroy +blpapi_Socks5Config_printHelper = _blpapi_Socks5Config_printHelper +blpapi_SubscriptionList_addHelper = _blpapi_SubscriptionList_addHelper +blpapi_SubscriptionList_addResolved = _blpapi_SubscriptionList_addResolved +blpapi_SubscriptionList_append = _blpapi_SubscriptionList_append +blpapi_SubscriptionList_clear = _blpapi_SubscriptionList_clear +blpapi_SubscriptionList_correlationIdAt = ( + _blpapi_SubscriptionList_correlationIdAt +) +blpapi_SubscriptionList_create = _blpapi_SubscriptionList_create +blpapi_SubscriptionList_destroy = _blpapi_SubscriptionList_destroy +blpapi_SubscriptionList_isResolvedAt = _blpapi_SubscriptionList_isResolvedAt +blpapi_SubscriptionList_size = _blpapi_SubscriptionList_size +blpapi_SubscriptionList_topicStringAt = _blpapi_SubscriptionList_topicStringAt +blpapi_TestUtil_appendMessage = _blpapi_TestUtil_appendMessage +blpapi_TestUtil_createEvent = _blpapi_TestUtil_createEvent +blpapi_TestUtil_createTopic = _blpapi_TestUtil_createTopic +blpapi_TestUtil_deserializeService = _blpapi_TestUtil_deserializeService +blpapi_TestUtil_getAdminMessageDefinition = ( + _blpapi_TestUtil_getAdminMessageDefinition +) +blpapi_TestUtil_serializeServiceHelper = ( + _blpapi_TestUtil_serializeServiceHelper +) +blpapi_TimePoint = TimePoint +blpapi_TimePointUtil_nanosecondsBetween = ( + _blpapi_TimePointUtil_nanosecondsBetween +) +blpapi_TlsOptions_createFromBlobs = _blpapi_TlsOptions_createFromBlobs +blpapi_TlsOptions_createFromFiles = _blpapi_TlsOptions_createFromFiles +blpapi_TlsOptions_destroy = _blpapi_TlsOptions_destroy +blpapi_TlsOptions_setCrlFetchTimeoutMs = ( + _blpapi_TlsOptions_setCrlFetchTimeoutMs +) +blpapi_TlsOptions_setTlsHandshakeTimeoutMs = ( + _blpapi_TlsOptions_setTlsHandshakeTimeoutMs +) +blpapi_TopicList_add = _blpapi_TopicList_add +blpapi_TopicList_addFromMessage = _blpapi_TopicList_addFromMessage +blpapi_TopicList_correlationIdAt = _blpapi_TopicList_correlationIdAt +blpapi_TopicList_create = _blpapi_TopicList_create +blpapi_TopicList_createFromResolutionList = ( + _blpapi_TopicList_createFromResolutionList +) +blpapi_TopicList_destroy = _blpapi_TopicList_destroy +blpapi_TopicList_message = _blpapi_TopicList_message +blpapi_TopicList_messageAt = _blpapi_TopicList_messageAt +blpapi_TopicList_size = _blpapi_TopicList_size +blpapi_TopicList_status = _blpapi_TopicList_status +blpapi_TopicList_statusAt = _blpapi_TopicList_statusAt +blpapi_TopicList_topicString = _blpapi_TopicList_topicString +blpapi_TopicList_topicStringAt = _blpapi_TopicList_topicStringAt +blpapi_Topic_compare = _blpapi_Topic_compare +blpapi_Topic_create = _blpapi_Topic_create +blpapi_Topic_destroy = _blpapi_Topic_destroy +blpapi_Topic_isActive = _blpapi_Topic_isActive +blpapi_Topic_service = _blpapi_Topic_service +blpapi_ZfpUtil_getOptionsForLeasedLines = ( + _blpapi_ZfpUtil_getOptionsForLeasedLines +) +blpapi_getLastErrorDescription = _blpapi_getLastErrorDescription +blpapi_getVersionInfo = _blpapi_getVersionInfo +ProviderSession_createHelper = _ProviderSession_createHelper +ProviderSession_destroyHelper = _ProviderSession_destroyHelper +Session_createHelper = _Session_createHelper +Session_destroyHelper = _Session_destroyHelper + + +def _test_function_signatures(): + _C_TO_PY = { + "char": c_char, + "double": c_double, + "float": c_float, + "int": c_int, + "int*": POINTER(c_int), + "size_t": c_size_t, + "unsigned int": c_uint, + "blpapi_CorrelationId_t": CidStruct, + } + def c_type_to_ctypes(ctype: str): + pt = _C_TO_PY.get(ctype, None) + if pt is not None: + return pt + if "char" in ctype: + return c_char_p + elif "*" in ctype: + return c_void_p + return None + + def verify_ctypes(fnc, ret: str, args: List[str]): + f = globals().get("l_" + fnc, None) # find in local module + if f is None: + # this if fine, not yet impl + return + + if f.restype != c_type_to_ctypes(ret): + raise ImportError( + f"Return type for '{fnc}' is '{ret}', but restype set to '{f.restype}'" + ) + + if f.argtypes is None: + # OK, for now, not all have it + return + + assert len(f.argtypes) == len(args) + for pyarg, carg in zip(f.argtypes, args): + if pyarg != c_type_to_ctypes(carg): + raise ImportError( + f"Argument type for '{fnc}' is '{carg}' but set to '{pyarg}'" + ) + + verify_ctypes( + fnc="blpapi_AbstractSession_cancel", + ret="int", + args=[ + "blpapi_AbstractSession_t*", + "blpapi_CorrelationId_t*", + "size_t", + "char*", + "int", + ], + ) + verify_ctypes( + fnc="blpapi_AbstractSession_createIdentity", + ret="blpapi_Identity_t *", + args=["blpapi_AbstractSession_t*"], + ) + verify_ctypes( + fnc="blpapi_AbstractSession_generateAuthorizedIdentityAsync", + ret="int", + args=[ + "blpapi_AbstractSession_t*", + "blpapi_AuthOptions_t*", + "blpapi_CorrelationId_t*", + ], + ) + verify_ctypes( + fnc="blpapi_AbstractSession_generateManualToken", + ret="int", + args=[ + "blpapi_AbstractSession_t*", + "blpapi_CorrelationId_t*", + "char*", + "char*", + "blpapi_EventQueue_t*", + ], + ) + verify_ctypes( + fnc="blpapi_AbstractSession_generateToken", + ret="int", + args=[ + "blpapi_AbstractSession_t*", + "blpapi_CorrelationId_t*", + "blpapi_EventQueue_t*", + ], + ) + verify_ctypes( + fnc="blpapi_AbstractSession_getAuthorizedIdentity", + ret="int", + args=[ + "blpapi_AbstractSession_t*", + "blpapi_CorrelationId_t*", + "blpapi_Identity_t**", + ], + ) + verify_ctypes( + fnc="blpapi_AbstractSession_getService", + ret="int", + args=["blpapi_AbstractSession_t*", "blpapi_Service_t**", "char*"], + ) + verify_ctypes( + fnc="blpapi_AbstractSession_openService", + ret="int", + args=["blpapi_AbstractSession_t*", "char*"], + ) + verify_ctypes( + fnc="blpapi_AbstractSession_openServiceAsync", + ret="int", + args=["blpapi_AbstractSession_t*", "char*", "blpapi_CorrelationId_t*"], + ) + verify_ctypes( + fnc="blpapi_AbstractSession_sessionName", + ret="int", + args=["blpapi_AbstractSession_t*", "char**", "size_t*"], + ) + verify_ctypes( + fnc="blpapi_AuthApplication_copy", + ret="int", + args=["blpapi_AuthApplication_t*", "blpapi_AuthApplication_t*"], + ) + verify_ctypes( + fnc="blpapi_AuthApplication_create", + ret="int", + args=["blpapi_AuthApplication_t**", "char*"], + ) + verify_ctypes( + fnc="blpapi_AuthApplication_destroy", + ret="void", + args=["blpapi_AuthApplication_t*"], + ) + verify_ctypes( + fnc="blpapi_AuthApplication_duplicate", + ret="int", + args=["blpapi_AuthApplication_t**", "blpapi_AuthApplication_t*"], + ) + verify_ctypes( + fnc="blpapi_AuthOptions_copy", + ret="int", + args=["blpapi_AuthOptions_t*", "blpapi_AuthOptions_t*"], + ) + verify_ctypes( + fnc="blpapi_AuthOptions_create_default", + ret="int", + args=["blpapi_AuthOptions_t**"], + ) + verify_ctypes( + fnc="blpapi_AuthOptions_create_forAppMode", + ret="int", + args=["blpapi_AuthOptions_t**", "blpapi_AuthApplication_t*"], + ) + verify_ctypes( + fnc="blpapi_AuthOptions_create_forToken", + ret="int", + args=["blpapi_AuthOptions_t**", "blpapi_AuthToken_t*"], + ) + verify_ctypes( + fnc="blpapi_AuthOptions_create_forUserAndAppMode", + ret="int", + args=[ + "blpapi_AuthOptions_t**", + "blpapi_AuthUser_t*", + "blpapi_AuthApplication_t*", + ], + ) + verify_ctypes( + fnc="blpapi_AuthOptions_create_forUserMode", + ret="int", + args=["blpapi_AuthOptions_t**", "blpapi_AuthUser_t*"], + ) + verify_ctypes( + fnc="blpapi_AuthOptions_destroy", + ret="void", + args=["blpapi_AuthOptions_t*"], + ) + verify_ctypes( + fnc="blpapi_AuthOptions_duplicate", + ret="int", + args=["blpapi_AuthOptions_t**", "blpapi_AuthOptions_t*"], + ) + verify_ctypes( + fnc="blpapi_AuthToken_copy", + ret="int", + args=["blpapi_AuthToken_t*", "blpapi_AuthToken_t*"], + ) + verify_ctypes( + fnc="blpapi_AuthToken_create", + ret="int", + args=["blpapi_AuthToken_t**", "char*"], + ) + verify_ctypes( + fnc="blpapi_AuthToken_destroy", + ret="void", + args=["blpapi_AuthToken_t*"], + ) + verify_ctypes( + fnc="blpapi_AuthToken_duplicate", + ret="int", + args=["blpapi_AuthToken_t**", "blpapi_AuthToken_t*"], + ) + verify_ctypes( + fnc="blpapi_AuthUser_copy", + ret="int", + args=["blpapi_AuthUser_t*", "blpapi_AuthUser_t*"], + ) + verify_ctypes( + fnc="blpapi_AuthUser_createWithActiveDirectoryProperty", + ret="int", + args=["blpapi_AuthUser_t**", "char*"], + ) + verify_ctypes( + fnc="blpapi_AuthUser_createWithLogonName", + ret="int", + args=["blpapi_AuthUser_t**"], + ) + verify_ctypes( + fnc="blpapi_AuthUser_createWithManualOptions", + ret="int", + args=["blpapi_AuthUser_t**", "char*", "char*"], + ) + verify_ctypes( + fnc="blpapi_AuthUser_destroy", ret="void", args=["blpapi_AuthUser_t*"] + ) + verify_ctypes( + fnc="blpapi_AuthUser_duplicate", + ret="int", + args=["blpapi_AuthUser_t**", "blpapi_AuthUser_t*"], + ) + verify_ctypes( + fnc="blpapi_ConstantList_datatype", + ret="int", + args=["blpapi_ConstantList_t*"], + ) + verify_ctypes( + fnc="blpapi_ConstantList_description", + ret="char *", + args=["blpapi_ConstantList_t*"], + ) + verify_ctypes( + fnc="blpapi_ConstantList_getConstant", + ret="blpapi_Constant_t *", + args=["blpapi_ConstantList_t*", "char*", "blpapi_Name_t*"], + ) + verify_ctypes( + fnc="blpapi_ConstantList_getConstantAt", + ret="blpapi_Constant_t *", + args=["blpapi_ConstantList_t*", "size_t"], + ) + verify_ctypes( + fnc="blpapi_ConstantList_name", + ret="blpapi_Name_t *", + args=["blpapi_ConstantList_t*"], + ) + verify_ctypes( + fnc="blpapi_ConstantList_numConstants", + ret="int", + args=["blpapi_ConstantList_t*"], + ) + verify_ctypes( + fnc="blpapi_ConstantList_status", + ret="int", + args=["blpapi_ConstantList_t*"], + ) + verify_ctypes( + fnc="blpapi_Constant_datatype", ret="int", args=["blpapi_Constant_t*"] + ) + verify_ctypes( + fnc="blpapi_Constant_description", + ret="char *", + args=["blpapi_Constant_t*"], + ) + verify_ctypes( + fnc="blpapi_Constant_getValueAsChar", + ret="int", + args=["blpapi_Constant_t*", "blpapi_Char_t*"], + ) + verify_ctypes( + fnc="blpapi_Constant_getValueAsDatetime", + ret="int", + args=["blpapi_Constant_t*", "blpapi_Datetime_t*"], + ) + verify_ctypes( + fnc="blpapi_Constant_getValueAsFloat32", + ret="int", + args=["blpapi_Constant_t*", "blpapi_Float32_t*"], + ) + verify_ctypes( + fnc="blpapi_Constant_getValueAsFloat64", + ret="int", + args=["blpapi_Constant_t*", "blpapi_Float64_t*"], + ) + verify_ctypes( + fnc="blpapi_Constant_getValueAsInt32", + ret="int", + args=["blpapi_Constant_t*", "blpapi_Int32_t*"], + ) + verify_ctypes( + fnc="blpapi_Constant_getValueAsInt64", + ret="int", + args=["blpapi_Constant_t*", "blpapi_Int64_t*"], + ) + verify_ctypes( + fnc="blpapi_Constant_getValueAsString", + ret="int", + args=["blpapi_Constant_t*", "char**"], + ) + verify_ctypes( + fnc="blpapi_Constant_name", + ret="blpapi_Name_t *", + args=["blpapi_Constant_t*"], + ) + verify_ctypes( + fnc="blpapi_Constant_status", ret="int", args=["blpapi_Constant_t*"] + ) + verify_ctypes( + fnc="blpapi_Element_appendElement", + ret="int", + args=["blpapi_Element_t*", "blpapi_Element_t**"], + ) + verify_ctypes( + fnc="blpapi_Element_datatype", ret="int", args=["blpapi_Element_t*"] + ) + verify_ctypes( + fnc="blpapi_Element_definition", + ret="blpapi_SchemaElementDefinition_t *", + args=["blpapi_Element_t*"], + ) + verify_ctypes( + fnc="blpapi_Element_getChoice", + ret="int", + args=["blpapi_Element_t*", "blpapi_Element_t**"], + ) + verify_ctypes( + fnc="blpapi_Element_getElement", + ret="int", + args=["blpapi_Element_t*", "blpapi_Element_t**", "size_t"], + ) + verify_ctypes( + fnc="blpapi_Element_getElementAt", + ret="int", + args=["blpapi_Element_t*", "blpapi_Element_t**", "size_t"], + ) + verify_ctypes( + fnc="blpapi_Element_getValueAsBool", + ret="int", + args=["blpapi_Element_t*", "blpapi_Bool_t*", "size_t"], + ) + verify_ctypes( + fnc="blpapi_Element_getValueAsBytes", + ret="int", + args=["blpapi_Element_t*", "char**", "size_t*", "size_t"], + ) + verify_ctypes( + fnc="blpapi_Element_getValueAsChar", + ret="int", + args=["blpapi_Element_t*", "blpapi_Char_t*", "size_t"], + ) + verify_ctypes( + fnc="blpapi_Element_getValueAsDatetime", + ret="int", + args=["blpapi_Element_t*", "blpapi_Datetime_t*", "size_t"], + ) + verify_ctypes( + fnc="blpapi_Element_getValueAsElement", + ret="int", + args=["blpapi_Element_t*", "blpapi_Element_t**", "size_t"], + ) + verify_ctypes( + fnc="blpapi_Element_getValueAsFloat64", + ret="int", + args=["blpapi_Element_t*", "blpapi_Float64_t*", "size_t"], + ) + verify_ctypes( + fnc="blpapi_Element_getValueAsHighPrecisionDatetime", + ret="int", + args=[ + "blpapi_Element_t*", + "blpapi_HighPrecisionDatetime_t*", + "size_t", + ], + ) + verify_ctypes( + fnc="blpapi_Element_getValueAsInt32", + ret="int", + args=["blpapi_Element_t*", "blpapi_Int32_t*", "size_t"], + ) + verify_ctypes( + fnc="blpapi_Element_getValueAsInt64", + ret="int", + args=["blpapi_Element_t*", "blpapi_Int64_t*", "size_t"], + ) + verify_ctypes( + fnc="blpapi_Element_getValueAsName", + ret="int", + args=["blpapi_Element_t*", "blpapi_Name_t**", "size_t"], + ) + verify_ctypes( + fnc="blpapi_Element_getValueAsString", + ret="int", + args=["blpapi_Element_t*", "char**", "size_t"], + ) + verify_ctypes( + fnc="blpapi_Element_hasElementEx", + ret="int", + args=["blpapi_Element_t*", "char*", "blpapi_Name_t*", "int", "int"], + ) + verify_ctypes( + fnc="blpapi_Element_isArray", ret="int", args=["blpapi_Element_t*"] + ) + verify_ctypes( + fnc="blpapi_Element_isComplexType", + ret="int", + args=["blpapi_Element_t*"], + ) + verify_ctypes( + fnc="blpapi_Element_isNull", + ret="int", + args=["blpapi_Element_t*", "size_t"], + ) + verify_ctypes( + fnc="blpapi_Element_isNullValue", + ret="int", + args=["blpapi_Element_t*", "size_t"], + ) + verify_ctypes( + fnc="blpapi_Element_isReadOnly", ret="int", args=["blpapi_Element_t*"] + ) + verify_ctypes( + fnc="blpapi_Element_name", + ret="blpapi_Name_t *", + args=["blpapi_Element_t*"], + ) + verify_ctypes( + fnc="blpapi_Element_nameString", + ret="char *", + args=["blpapi_Element_t*"], + ) + verify_ctypes( + fnc="blpapi_Element_numElements", + ret="size_t", + args=["blpapi_Element_t*"], + ) + verify_ctypes( + fnc="blpapi_Element_numValues", + ret="size_t", + args=["blpapi_Element_t*"], + ) + verify_ctypes( + fnc="blpapi_Element_setChoice", + ret="int", + args=[ + "blpapi_Element_t*", + "blpapi_Element_t**", + "char*", + "blpapi_Name_t*", + "size_t", + ], + ) + verify_ctypes( + fnc="blpapi_Element_setElementBool", + ret="int", + args=["blpapi_Element_t*", "char*", "blpapi_Name_t*", "blpapi_Bool_t"], + ) + verify_ctypes( + fnc="blpapi_Element_setElementBytes", + ret="int", + args=[ + "blpapi_Element_t*", + "char*", + "blpapi_Name_t*", + "char*", + "size_t", + ], + ) + verify_ctypes( + fnc="blpapi_Element_setElementFloat", + ret="int", + args=[ + "blpapi_Element_t*", + "char*", + "blpapi_Name_t*", + "blpapi_Float32_t", + ], + ) + verify_ctypes( + fnc="blpapi_Element_setElementFromName", + ret="int", + args=[ + "blpapi_Element_t*", + "char*", + "blpapi_Name_t*", + "blpapi_Name_t*", + ], + ) + verify_ctypes( + fnc="blpapi_Element_setElementHighPrecisionDatetime", + ret="int", + args=[ + "blpapi_Element_t*", + "char*", + "blpapi_Name_t*", + "blpapi_HighPrecisionDatetime_t*", + ], + ) + verify_ctypes( + fnc="blpapi_Element_setElementInt32", + ret="int", + args=[ + "blpapi_Element_t*", + "char*", + "blpapi_Name_t*", + "blpapi_Int32_t", + ], + ) + verify_ctypes( + fnc="blpapi_Element_setElementInt64", + ret="int", + args=[ + "blpapi_Element_t*", + "char*", + "blpapi_Name_t*", + "blpapi_Int64_t", + ], + ) + verify_ctypes( + fnc="blpapi_Element_setElementString", + ret="int", + args=["blpapi_Element_t*", "char*", "blpapi_Name_t*", "char*"], + ) + verify_ctypes( + fnc="blpapi_Element_setValueBool", + ret="int", + args=["blpapi_Element_t*", "blpapi_Bool_t", "size_t"], + ) + verify_ctypes( + fnc="blpapi_Element_setValueBytes", + ret="int", + args=["blpapi_Element_t*", "char*", "size_t", "size_t"], + ) + verify_ctypes( + fnc="blpapi_Element_setValueFloat", + ret="int", + args=["blpapi_Element_t*", "blpapi_Float32_t", "size_t"], + ) + verify_ctypes( + fnc="blpapi_Element_setValueFromName", + ret="int", + args=["blpapi_Element_t*", "blpapi_Name_t*", "size_t"], + ) + verify_ctypes( + fnc="blpapi_Element_setValueHighPrecisionDatetime", + ret="int", + args=[ + "blpapi_Element_t*", + "blpapi_HighPrecisionDatetime_t*", + "size_t", + ], + ) + verify_ctypes( + fnc="blpapi_Element_setValueInt32", + ret="int", + args=["blpapi_Element_t*", "blpapi_Int32_t", "size_t"], + ) + verify_ctypes( + fnc="blpapi_Element_setValueInt64", + ret="int", + args=["blpapi_Element_t*", "blpapi_Int64_t", "size_t"], + ) + verify_ctypes( + fnc="blpapi_Element_setValueString", + ret="int", + args=["blpapi_Element_t*", "char*", "size_t"], + ) + verify_ctypes( + fnc="blpapi_EventDispatcher_create", + ret="blpapi_EventDispatcher_t *", + args=["size_t"], + ) + verify_ctypes( + fnc="blpapi_EventDispatcher_destroy", + ret="void", + args=["blpapi_EventDispatcher_t*"], + ) + verify_ctypes( + fnc="blpapi_EventDispatcher_start", + ret="int", + args=["blpapi_EventDispatcher_t*"], + ) + verify_ctypes( + fnc="blpapi_EventDispatcher_stop", + ret="int", + args=["blpapi_EventDispatcher_t*", "int"], + ) + verify_ctypes( + fnc="blpapi_EventFormatter_appendElement", + ret="int", + args=["blpapi_EventFormatter_t*"], + ) + verify_ctypes( + fnc="blpapi_EventFormatter_appendFragmentedRecapMessage", + ret="int", + args=[ + "blpapi_EventFormatter_t*", + "char*", + "blpapi_Name_t*", + "blpapi_Topic_t*", + "blpapi_CorrelationId_t*", + "int", + ], + ) + verify_ctypes( + fnc="blpapi_EventFormatter_appendFragmentedRecapMessageSeq", + ret="int", + args=[ + "blpapi_EventFormatter_t*", + "char*", + "blpapi_Name_t*", + "blpapi_Topic_t*", + "int", + "unsigned int", + ], + ) + verify_ctypes( + fnc="blpapi_EventFormatter_appendMessage", + ret="int", + args=[ + "blpapi_EventFormatter_t*", + "char*", + "blpapi_Name_t*", + "blpapi_Topic_t*", + ], + ) + verify_ctypes( + fnc="blpapi_EventFormatter_appendMessageSeq", + ret="int", + args=[ + "blpapi_EventFormatter_t*", + "char*", + "blpapi_Name_t*", + "blpapi_Topic_t*", + "unsigned int", + "unsigned", + ], + ) + verify_ctypes( + fnc="blpapi_EventFormatter_appendRecapMessage", + ret="int", + args=[ + "blpapi_EventFormatter_t*", + "blpapi_Topic_t*", + "blpapi_CorrelationId_t*", + ], + ) + verify_ctypes( + fnc="blpapi_EventFormatter_appendRecapMessageSeq", + ret="int", + args=[ + "blpapi_EventFormatter_t*", + "blpapi_Topic_t*", + "blpapi_CorrelationId_t*", + "unsigned int", + "unsigned", + ], + ) + verify_ctypes( + fnc="blpapi_EventFormatter_appendResponse", + ret="int", + args=["blpapi_EventFormatter_t*", "char*", "blpapi_Name_t*"], + ) + verify_ctypes( + fnc="blpapi_EventFormatter_appendValueBool", + ret="int", + args=["blpapi_EventFormatter_t*", "blpapi_Bool_t"], + ) + verify_ctypes( + fnc="blpapi_EventFormatter_appendValueChar", + ret="int", + args=["blpapi_EventFormatter_t*", "char"], + ) + verify_ctypes( + fnc="blpapi_EventFormatter_appendValueFloat", + ret="int", + args=["blpapi_EventFormatter_t*", "blpapi_Float32_t"], + ) + verify_ctypes( + fnc="blpapi_EventFormatter_appendValueFromName", + ret="int", + args=["blpapi_EventFormatter_t*", "blpapi_Name_t*"], + ) + verify_ctypes( + fnc="blpapi_EventFormatter_appendValueHighPrecisionDatetime", + ret="int", + args=["blpapi_EventFormatter_t*", "blpapi_HighPrecisionDatetime_t*"], + ) + verify_ctypes( + fnc="blpapi_EventFormatter_appendValueInt32", + ret="int", + args=["blpapi_EventFormatter_t*", "blpapi_Int32_t"], + ) + verify_ctypes( + fnc="blpapi_EventFormatter_appendValueInt64", + ret="int", + args=["blpapi_EventFormatter_t*", "blpapi_Int64_t"], + ) + verify_ctypes( + fnc="blpapi_EventFormatter_appendValueString", + ret="int", + args=["blpapi_EventFormatter_t*", "char*"], + ) + verify_ctypes( + fnc="blpapi_EventFormatter_create", + ret="blpapi_EventFormatter_t *", + args=["blpapi_Event_t*"], + ) + verify_ctypes( + fnc="blpapi_EventFormatter_destroy", + ret="void", + args=["blpapi_EventFormatter_t*"], + ) + verify_ctypes( + fnc="blpapi_EventFormatter_popElement", + ret="int", + args=["blpapi_EventFormatter_t*"], + ) + verify_ctypes( + fnc="blpapi_EventFormatter_pushElement", + ret="int", + args=["blpapi_EventFormatter_t*", "char*", "blpapi_Name_t*"], + ) + verify_ctypes( + fnc="blpapi_EventFormatter_setValueBool", + ret="int", + args=[ + "blpapi_EventFormatter_t*", + "char*", + "blpapi_Name_t*", + "blpapi_Bool_t", + ], + ) + verify_ctypes( + fnc="blpapi_EventFormatter_setValueBytes", + ret="int", + args=[ + "blpapi_EventFormatter_t*", + "char*", + "blpapi_Name_t*", + "char*", + "size_t", + ], + ) + verify_ctypes( + fnc="blpapi_EventFormatter_setValueChar", + ret="int", + args=["blpapi_EventFormatter_t*", "char*", "blpapi_Name_t*", "char"], + ) + verify_ctypes( + fnc="blpapi_EventFormatter_setValueFloat", + ret="int", + args=[ + "blpapi_EventFormatter_t*", + "char*", + "blpapi_Name_t*", + "blpapi_Float32_t", + ], + ) + verify_ctypes( + fnc="blpapi_EventFormatter_setValueFromName", + ret="int", + args=[ + "blpapi_EventFormatter_t*", + "char*", + "blpapi_Name_t*", + "blpapi_Name_t*", + ], + ) + verify_ctypes( + fnc="blpapi_EventFormatter_setValueHighPrecisionDatetime", + ret="int", + args=[ + "blpapi_EventFormatter_t*", + "char*", + "blpapi_Name_t*", + "blpapi_HighPrecisionDatetime_t*", + ], + ) + verify_ctypes( + fnc="blpapi_EventFormatter_setValueInt32", + ret="int", + args=[ + "blpapi_EventFormatter_t*", + "char*", + "blpapi_Name_t*", + "blpapi_Int32_t", + ], + ) + verify_ctypes( + fnc="blpapi_EventFormatter_setValueInt64", + ret="int", + args=[ + "blpapi_EventFormatter_t*", + "char*", + "blpapi_Name_t*", + "blpapi_Int64_t", + ], + ) + verify_ctypes( + fnc="blpapi_EventFormatter_setValueNull", + ret="int", + args=["blpapi_EventFormatter_t*", "char*", "blpapi_Name_t*"], + ) + verify_ctypes( + fnc="blpapi_EventFormatter_setValueString", + ret="int", + args=["blpapi_EventFormatter_t*", "char*", "blpapi_Name_t*", "char*"], + ) + verify_ctypes( + fnc="blpapi_EventQueue_create", ret="blpapi_EventQueue_t *", args=[""] + ) + verify_ctypes( + fnc="blpapi_EventQueue_destroy", + ret="int", + args=["blpapi_EventQueue_t*"], + ) + verify_ctypes( + fnc="blpapi_EventQueue_nextEvent", + ret="blpapi_Event_t *", + args=["blpapi_EventQueue_t*", "int"], + ) + verify_ctypes( + fnc="blpapi_EventQueue_purge", ret="int", args=["blpapi_EventQueue_t*"] + ) + verify_ctypes( + fnc="blpapi_EventQueue_tryNextEvent", + ret="int", + args=["blpapi_EventQueue_t*", "blpapi_Event_t**"], + ) + verify_ctypes( + fnc="blpapi_Event_eventType", ret="int", args=["blpapi_Event_t*"] + ) + verify_ctypes( + fnc="blpapi_Event_release", ret="int", args=["blpapi_Event_t*"] + ) + verify_ctypes( + fnc="blpapi_HighPrecisionDatetime_compare", + ret="int", + args=[ + "blpapi_HighPrecisionDatetime_t*", + "blpapi_HighPrecisionDatetime_t*", + ], + ) + verify_ctypes( + fnc="blpapi_HighPrecisionDatetime_fromTimePoint", + ret="int", + args=[ + "blpapi_HighPrecisionDatetime_t*", + "blpapi_TimePoint_t*", + "short", + ], + ) + verify_ctypes( + fnc="blpapi_HighPrecisionDatetime_print", + ret="int", + args=[ + "blpapi_HighPrecisionDatetime_t*", + "blpapi_StreamWriter_t", + "void*", + "int", + "int", + ], + ) + verify_ctypes( + fnc="blpapi_HighResolutionClock_now", + ret="int", + args=["blpapi_TimePoint_t*"], + ) + verify_ctypes( + fnc="blpapi_Identity_addRef", ret="int", args=["blpapi_Identity_t*"] + ) + verify_ctypes( + fnc="blpapi_Identity_getSeatType", + ret="int", + args=["blpapi_Identity_t*", "int*"], + ) + verify_ctypes( + fnc="blpapi_Identity_hasEntitlements", + ret="int", + args=[ + "blpapi_Identity_t*", + "blpapi_Service_t*", + "blpapi_Element_t*", + "int*", + "size_t", + "int*", + "int*", + ], + ) + verify_ctypes( + fnc="blpapi_Identity_isAuthorized", + ret="int", + args=["blpapi_Identity_t*", "blpapi_Service_t*"], + ) + verify_ctypes( + fnc="blpapi_Identity_release", ret="void", args=["blpapi_Identity_t*"] + ) + verify_ctypes( + fnc="blpapi_Logging_logTestMessage", + ret="void", + args=["blpapi_Logging_Severity_t"], + ) + verify_ctypes( + fnc="blpapi_Logging_registerCallback", + ret="int", + args=["funct", "blpapi_Logging_Severity_t"], + ) + verify_ctypes( + fnc="blpapi_MessageFormatter_FormatMessageJson", + ret="int", + args=["blpapi_MessageFormatter_t*", "char*"], + ) + verify_ctypes( + fnc="blpapi_MessageFormatter_FormatMessageXml", + ret="int", + args=["blpapi_MessageFormatter_t*", "char*"], + ) + verify_ctypes( + fnc="blpapi_MessageFormatter_appendElement", + ret="int", + args=["blpapi_MessageFormatter_t*"], + ) + verify_ctypes( + fnc="blpapi_MessageFormatter_appendValueBool", + ret="int", + args=["blpapi_MessageFormatter_t*", "blpapi_Bool_t"], + ) + verify_ctypes( + fnc="blpapi_MessageFormatter_appendValueChar", + ret="int", + args=["blpapi_MessageFormatter_t*", "char"], + ) + verify_ctypes( + fnc="blpapi_MessageFormatter_appendValueDatetime", + ret="int", + args=["blpapi_MessageFormatter_t*", "blpapi_Datetime_t*"], + ) + verify_ctypes( + fnc="blpapi_MessageFormatter_appendValueFloat", + ret="int", + args=["blpapi_MessageFormatter_t*", "blpapi_Float32_t"], + ) + verify_ctypes( + fnc="blpapi_MessageFormatter_appendValueFloat32", + ret="int", + args=["blpapi_MessageFormatter_t*", "blpapi_Float32_t"], + ) + verify_ctypes( + fnc="blpapi_MessageFormatter_appendValueFloat64", + ret="int", + args=["blpapi_MessageFormatter_t*", "blpapi_Float64_t"], + ) + verify_ctypes( + fnc="blpapi_MessageFormatter_appendValueFromName", + ret="int", + args=["blpapi_MessageFormatter_t*", "blpapi_Name_t*"], + ) + verify_ctypes( + fnc="blpapi_MessageFormatter_appendValueHighPrecisionDatetime", + ret="int", + args=["blpapi_MessageFormatter_t*", "blpapi_HighPrecisionDatetime_t*"], + ) + verify_ctypes( + fnc="blpapi_MessageFormatter_appendValueInt32", + ret="int", + args=["blpapi_MessageFormatter_t*", "blpapi_Int32_t"], + ) + verify_ctypes( + fnc="blpapi_MessageFormatter_appendValueInt64", + ret="int", + args=["blpapi_MessageFormatter_t*", "blpapi_Int64_t"], + ) + verify_ctypes( + fnc="blpapi_MessageFormatter_appendValueString", + ret="int", + args=["blpapi_MessageFormatter_t*", "char*"], + ) + verify_ctypes( + fnc="blpapi_MessageFormatter_assign", + ret="int", + args=["blpapi_MessageFormatter_t**", "blpapi_MessageFormatter_t*"], + ) + verify_ctypes( + fnc="blpapi_MessageFormatter_copy", + ret="int", + args=["blpapi_MessageFormatter_t**", "blpapi_MessageFormatter_t*"], + ) + verify_ctypes( + fnc="blpapi_MessageFormatter_destroy", + ret="int", + args=["blpapi_MessageFormatter_t*"], + ) + verify_ctypes( + fnc="blpapi_MessageFormatter_popElement", + ret="int", + args=["blpapi_MessageFormatter_t*"], + ) + verify_ctypes( + fnc="blpapi_MessageFormatter_pushElement", + ret="int", + args=["blpapi_MessageFormatter_t*", "blpapi_Name_t*"], + ) + verify_ctypes( + fnc="blpapi_MessageFormatter_setValueBool", + ret="int", + args=["blpapi_MessageFormatter_t*", "blpapi_Name_t*", "blpapi_Bool_t"], + ) + verify_ctypes( + fnc="blpapi_MessageFormatter_setValueBytes", + ret="int", + args=[ + "blpapi_MessageFormatter_t*", + "blpapi_Name_t*", + "char*", + "size_t", + ], + ) + verify_ctypes( + fnc="blpapi_MessageFormatter_setValueChar", + ret="int", + args=["blpapi_MessageFormatter_t*", "blpapi_Name_t*", "char"], + ) + verify_ctypes( + fnc="blpapi_MessageFormatter_setValueDatetime", + ret="int", + args=[ + "blpapi_MessageFormatter_t*", + "blpapi_Name_t*", + "blpapi_Datetime_t*", + ], + ) + verify_ctypes( + fnc="blpapi_MessageFormatter_setValueFloat", + ret="int", + args=[ + "blpapi_MessageFormatter_t*", + "blpapi_Name_t*", + "blpapi_Float32_t", + ], + ) + verify_ctypes( + fnc="blpapi_MessageFormatter_setValueFloat32", + ret="int", + args=[ + "blpapi_MessageFormatter_t*", + "blpapi_Name_t*", + "blpapi_Float32_t", + ], + ) + verify_ctypes( + fnc="blpapi_MessageFormatter_setValueFloat64", + ret="int", + args=[ + "blpapi_MessageFormatter_t*", + "blpapi_Name_t*", + "blpapi_Float64_t", + ], + ) + verify_ctypes( + fnc="blpapi_MessageFormatter_setValueFromName", + ret="int", + args=[ + "blpapi_MessageFormatter_t*", + "blpapi_Name_t*", + "blpapi_Name_t*", + ], + ) + verify_ctypes( + fnc="blpapi_MessageFormatter_setValueHighPrecisionDatetime", + ret="int", + args=[ + "blpapi_MessageFormatter_t*", + "blpapi_Name_t*", + "blpapi_HighPrecisionDatetime_t*", + ], + ) + verify_ctypes( + fnc="blpapi_MessageFormatter_setValueInt32", + ret="int", + args=[ + "blpapi_MessageFormatter_t*", + "blpapi_Name_t*", + "blpapi_Int32_t", + ], + ) + verify_ctypes( + fnc="blpapi_MessageFormatter_setValueInt64", + ret="int", + args=[ + "blpapi_MessageFormatter_t*", + "blpapi_Name_t*", + "blpapi_Int64_t", + ], + ) + verify_ctypes( + fnc="blpapi_MessageFormatter_setValueNull", + ret="int", + args=["blpapi_MessageFormatter_t*", "blpapi_Name_t*"], + ) + verify_ctypes( + fnc="blpapi_MessageFormatter_setValueString", + ret="int", + args=["blpapi_MessageFormatter_t*", "blpapi_Name_t*", "char*"], + ) + verify_ctypes( + fnc="blpapi_MessageIterator_create", + ret="blpapi_MessageIterator_t *", + args=["blpapi_Event_t*"], + ) + verify_ctypes( + fnc="blpapi_MessageIterator_destroy", + ret="void", + args=["blpapi_MessageIterator_t*"], + ) + verify_ctypes( + fnc="blpapi_MessageIterator_next", + ret="int", + args=["blpapi_MessageIterator_t*", "blpapi_Message_t**"], + ) + verify_ctypes( + fnc="blpapi_MessageProperties_assign", + ret="int", + args=["blpapi_MessageProperties_t*", "blpapi_MessageProperties_t*"], + ) + verify_ctypes( + fnc="blpapi_MessageProperties_copy", + ret="int", + args=["blpapi_MessageProperties_t**", "blpapi_MessageProperties_t*"], + ) + verify_ctypes( + fnc="blpapi_MessageProperties_create", + ret="int", + args=["blpapi_MessageProperties_t**"], + ) + verify_ctypes( + fnc="blpapi_MessageProperties_destroy", + ret="void", + args=["blpapi_MessageProperties_t*"], + ) + verify_ctypes( + fnc="blpapi_MessageProperties_setCorrelationIds", + ret="int", + args=[ + "blpapi_MessageProperties_t*", + "blpapi_CorrelationId_t*", + "size_t", + ], + ) + verify_ctypes( + fnc="blpapi_MessageProperties_setRecapType", + ret="int", + args=["blpapi_MessageProperties_t*", "int", "int"], + ) + verify_ctypes( + fnc="blpapi_MessageProperties_setRequestId", + ret="int", + args=["blpapi_MessageProperties_t*", "char*"], + ) + verify_ctypes( + fnc="blpapi_MessageProperties_setService", + ret="int", + args=["blpapi_MessageProperties_t*", "blpapi_Service_t*"], + ) + verify_ctypes( + fnc="blpapi_MessageProperties_setTimeReceived", + ret="int", + args=[ + "blpapi_MessageProperties_t*", + "blpapi_HighPrecisionDatetime_t*", + ], + ) + verify_ctypes( + fnc="blpapi_Message_addRef", ret="int", args=["blpapi_Message_t*"] + ) + verify_ctypes( + fnc="blpapi_Message_correlationId", + ret="blpapi_CorrelationId_t", + args=["blpapi_Message_t*", "size_t"], + ) + verify_ctypes( + fnc="blpapi_Message_elements", + ret="blpapi_Element_t *", + args=["blpapi_Message_t*"], + ) + verify_ctypes( + fnc="blpapi_Message_fragmentType", + ret="int", + args=["blpapi_Message_t*"], + ) + verify_ctypes( + fnc="blpapi_Message_getRequestId", + ret="int", + args=["blpapi_Message_t*", "char**"], + ) + verify_ctypes( + fnc="blpapi_Message_messageType", + ret="blpapi_Name_t *", + args=["blpapi_Message_t*"], + ) + verify_ctypes( + fnc="blpapi_Message_numCorrelationIds", + ret="int", + args=["blpapi_Message_t*"], + ) + verify_ctypes( + fnc="blpapi_Message_recapType", ret="int", args=["blpapi_Message_t*"] + ) + verify_ctypes( + fnc="blpapi_Message_release", ret="int", args=["blpapi_Message_t*"] + ) + verify_ctypes( + fnc="blpapi_Message_service", + ret="blpapi_Service_t *", + args=["blpapi_Message_t*"], + ) + verify_ctypes( + fnc="blpapi_Message_timeReceived", + ret="int", + args=["blpapi_Message_t*", "blpapi_TimePoint_t*"], + ) + verify_ctypes( + fnc="blpapi_Message_topicName", + ret="char *", + args=["blpapi_Message_t*"], + ) + verify_ctypes( + fnc="blpapi_Name_create", ret="blpapi_Name_t *", args=["char*"] + ) + verify_ctypes( + fnc="blpapi_Name_destroy", ret="void", args=["blpapi_Name_t*"] + ) + verify_ctypes( + fnc="blpapi_Name_equalsStr", + ret="int", + args=["blpapi_Name_t*", "char*"], + ) + verify_ctypes( + fnc="blpapi_Name_findName", ret="blpapi_Name_t *", args=["char*"] + ) + verify_ctypes( + fnc="blpapi_Name_length", ret="size_t", args=["blpapi_Name_t*"] + ) + verify_ctypes( + fnc="blpapi_Name_string", ret="char *", args=["blpapi_Name_t*"] + ) + verify_ctypes( + fnc="blpapi_Operation_description", + ret="char *", + args=["blpapi_Operation_t*"], + ) + verify_ctypes( + fnc="blpapi_Operation_name", ret="char *", args=["blpapi_Operation_t*"] + ) + verify_ctypes( + fnc="blpapi_Operation_numResponseDefinitions", + ret="int", + args=["blpapi_Operation_t*"], + ) + verify_ctypes( + fnc="blpapi_Operation_requestDefinition", + ret="int", + args=["blpapi_Operation_t*", "blpapi_SchemaElementDefinition_t**"], + ) + verify_ctypes( + fnc="blpapi_Operation_responseDefinition", + ret="int", + args=[ + "blpapi_Operation_t*", + "blpapi_SchemaElementDefinition_t**", + "size_t", + ], + ) + verify_ctypes( + fnc="blpapi_Operation_responseDefinitionFromName", + ret="int", + args=[ + "blpapi_Operation_t*", + "blpapi_SchemaElementDefinition_t**", + "blpapi_Name_t*", + ], + ) + verify_ctypes( + fnc="blpapi_ProviderSession_activateSubServiceCodeRange", + ret="int", + args=["blpapi_ProviderSession_t*", "char*", "int", "int", "int"], + ) + verify_ctypes( + fnc="blpapi_ProviderSession_createServiceStatusTopic", + ret="int", + args=[ + "blpapi_ProviderSession_t*", + "blpapi_Service_t*", + "blpapi_Topic_t**", + ], + ) + verify_ctypes( + fnc="blpapi_ProviderSession_createTopic", + ret="int", + args=[ + "blpapi_ProviderSession_t*", + "blpapi_TopicList_t*", + "int", + "blpapi_Identity_t*", + ], + ) + verify_ctypes( + fnc="blpapi_ProviderSession_createTopics", + ret="int", + args=[ + "blpapi_ProviderSession_t*", + "blpapi_TopicList_t*", + "int", + "blpapi_Identity_t*", + ], + ) + verify_ctypes( + fnc="blpapi_ProviderSession_createTopicsAsync", + ret="int", + args=[ + "blpapi_ProviderSession_t*", + "blpapi_TopicList_t*", + "int", + "blpapi_Identity_t*", + ], + ) + verify_ctypes( + fnc="blpapi_ProviderSession_deactivateSubServiceCodeRange", + ret="int", + args=["blpapi_ProviderSession_t*", "char*", "int", "int"], + ) + verify_ctypes( + fnc="blpapi_ProviderSession_deleteTopics", + ret="int", + args=["blpapi_ProviderSession_t*", "blpapi_Topic_t**", "size_t"], + ) + verify_ctypes( + fnc="blpapi_ProviderSession_deregisterService", + ret="int", + args=["blpapi_ProviderSession_t*", "char*"], + ) + verify_ctypes( + fnc="blpapi_ProviderSession_flushPublishedEvents", + ret="int", + args=["blpapi_ProviderSession_t*", "int*", "int"], + ) + verify_ctypes( + fnc="blpapi_ProviderSession_getAbstractSession", + ret="blpapi_AbstractSession_t *", + args=["blpapi_ProviderSession_t*"], + ) + verify_ctypes( + fnc="blpapi_ProviderSession_getTopic", + ret="int", + args=[ + "blpapi_ProviderSession_t*", + "blpapi_Message_t*", + "blpapi_Topic_t**", + ], + ) + verify_ctypes( + fnc="blpapi_ProviderSession_nextEvent", + ret="int", + args=["blpapi_ProviderSession_t*", "blpapi_Event_t**", "unsigned int"], + ) + verify_ctypes( + fnc="blpapi_ProviderSession_publish", + ret="int", + args=["blpapi_ProviderSession_t*", "blpapi_Event_t*"], + ) + verify_ctypes( + fnc="blpapi_ProviderSession_registerService", + ret="int", + args=[ + "blpapi_ProviderSession_t*", + "char*", + "blpapi_Identity_t*", + "blpapi_ServiceRegistrationOptions_t*", + ], + ) + verify_ctypes( + fnc="blpapi_ProviderSession_registerServiceAsync", + ret="int", + args=[ + "blpapi_ProviderSession_t*", + "char*", + "blpapi_Identity_t*", + "blpapi_CorrelationId_t*", + "blpapi_ServiceRegistrationOptions_t*", + ], + ) + verify_ctypes( + fnc="blpapi_ProviderSession_resolve", + ret="int", + args=[ + "blpapi_ProviderSession_t*", + "blpapi_ResolutionList_t*", + "int", + "blpapi_Identity_t*", + ], + ) + verify_ctypes( + fnc="blpapi_ProviderSession_resolveAsync", + ret="int", + args=[ + "blpapi_ProviderSession_t*", + "blpapi_ResolutionList_t*", + "int", + "blpapi_Identity_t*", + ], + ) + verify_ctypes( + fnc="blpapi_ProviderSession_sendResponse", + ret="int", + args=["blpapi_ProviderSession_t*", "blpapi_Event_t*", "int"], + ) + verify_ctypes( + fnc="blpapi_ProviderSession_start", + ret="int", + args=["blpapi_ProviderSession_t*"], + ) + verify_ctypes( + fnc="blpapi_ProviderSession_startAsync", + ret="int", + args=["blpapi_ProviderSession_t*"], + ) + verify_ctypes( + fnc="blpapi_ProviderSession_stop", + ret="int", + args=["blpapi_ProviderSession_t*"], + ) + verify_ctypes( + fnc="blpapi_ProviderSession_stopAsync", + ret="int", + args=["blpapi_ProviderSession_t*"], + ) + verify_ctypes( + fnc="blpapi_ProviderSession_terminateSubscriptionsOnTopics", + ret="int", + args=[ + "blpapi_ProviderSession_t*", + "blpapi_Topic_t**", + "size_t", + "char*", + ], + ) + verify_ctypes( + fnc="blpapi_ProviderSession_tryNextEvent", + ret="int", + args=["blpapi_ProviderSession_t*", "blpapi_Event_t**"], + ) + verify_ctypes( + fnc="blpapi_RequestTemplate_release", + ret="int", + args=["blpapi_RequestTemplate_t*"], + ) + verify_ctypes( + fnc="blpapi_Request_destroy", ret="void", args=["blpapi_Request_t*"] + ) + verify_ctypes( + fnc="blpapi_Request_elements", + ret="blpapi_Element_t *", + args=["blpapi_Request_t*"], + ) + verify_ctypes( + fnc="blpapi_Request_getRequestId", + ret="int", + args=["blpapi_Request_t*", "char**"], + ) + verify_ctypes( + fnc="blpapi_Request_setPreferredRoute", + ret="void", + args=["blpapi_Request_t*", "blpapi_CorrelationId_t*"], + ) + verify_ctypes( + fnc="blpapi_ResolutionList_add", + ret="int", + args=["blpapi_ResolutionList_t*", "char*", "blpapi_CorrelationId_t*"], + ) + verify_ctypes( + fnc="blpapi_ResolutionList_addAttribute", + ret="int", + args=["blpapi_ResolutionList_t*", "blpapi_Name_t*"], + ) + verify_ctypes( + fnc="blpapi_ResolutionList_addFromMessage", + ret="int", + args=[ + "blpapi_ResolutionList_t*", + "blpapi_Message_t*", + "blpapi_CorrelationId_t*", + ], + ) + verify_ctypes( + fnc="blpapi_ResolutionList_attribute", + ret="int", + args=[ + "blpapi_ResolutionList_t*", + "blpapi_Element_t**", + "blpapi_Name_t*", + "blpapi_CorrelationId_t*", + ], + ) + verify_ctypes( + fnc="blpapi_ResolutionList_attributeAt", + ret="int", + args=[ + "blpapi_ResolutionList_t*", + "blpapi_Element_t**", + "blpapi_Name_t*", + "size_t", + ], + ) + verify_ctypes( + fnc="blpapi_ResolutionList_correlationIdAt", + ret="int", + args=["blpapi_ResolutionList_t*", "blpapi_CorrelationId_t*", "size_t"], + ) + verify_ctypes( + fnc="blpapi_ResolutionList_create", + ret="blpapi_ResolutionList_t *", + args=["blpapi_ResolutionList_t*"], + ) + verify_ctypes( + fnc="blpapi_ResolutionList_destroy", + ret="void", + args=["blpapi_ResolutionList_t*"], + ) + verify_ctypes( + fnc="blpapi_ResolutionList_extractAttributeFromResolutionSuccess", + ret="blpapi_Element_t *", + args=["blpapi_Message_t*", "blpapi_Name_t*"], + ) + verify_ctypes( + fnc="blpapi_ResolutionList_message", + ret="int", + args=[ + "blpapi_ResolutionList_t*", + "blpapi_Message_t**", + "blpapi_CorrelationId_t*", + ], + ) + verify_ctypes( + fnc="blpapi_ResolutionList_messageAt", + ret="int", + args=["blpapi_ResolutionList_t*", "blpapi_Message_t**", "size_t"], + ) + verify_ctypes( + fnc="blpapi_ResolutionList_size", + ret="int", + args=["blpapi_ResolutionList_t*"], + ) + verify_ctypes( + fnc="blpapi_ResolutionList_status", + ret="int", + args=["blpapi_ResolutionList_t*", "int*", "blpapi_CorrelationId_t*"], + ) + verify_ctypes( + fnc="blpapi_ResolutionList_statusAt", + ret="int", + args=["blpapi_ResolutionList_t*", "int*", "size_t"], + ) + verify_ctypes( + fnc="blpapi_ResolutionList_topicString", + ret="int", + args=["blpapi_ResolutionList_t*", "char**", "blpapi_CorrelationId_t*"], + ) + verify_ctypes( + fnc="blpapi_ResolutionList_topicStringAt", + ret="int", + args=["blpapi_ResolutionList_t*", "char**", "size_t"], + ) + verify_ctypes( + fnc="blpapi_SchemaElementDefinition_description", + ret="char *", + args=["blpapi_SchemaElementDefinition_t*"], + ) + verify_ctypes( + fnc="blpapi_SchemaElementDefinition_getAlternateName", + ret="blpapi_Name_t *", + args=["blpapi_SchemaElementDefinition_t*", "size_t"], + ) + verify_ctypes( + fnc="blpapi_SchemaElementDefinition_maxValues", + ret="size_t", + args=["blpapi_SchemaElementDefinition_t*"], + ) + verify_ctypes( + fnc="blpapi_SchemaElementDefinition_minValues", + ret="size_t", + args=["blpapi_SchemaElementDefinition_t*"], + ) + verify_ctypes( + fnc="blpapi_SchemaElementDefinition_name", + ret="blpapi_Name_t *", + args=["blpapi_SchemaElementDefinition_t*"], + ) + verify_ctypes( + fnc="blpapi_SchemaElementDefinition_numAlternateNames", + ret="size_t", + args=["blpapi_SchemaElementDefinition_t*"], + ) + verify_ctypes( + fnc="blpapi_SchemaElementDefinition_status", + ret="int", + args=["blpapi_SchemaElementDefinition_t*"], + ) + verify_ctypes( + fnc="blpapi_SchemaElementDefinition_type", + ret="blpapi_SchemaTypeDefinition_t *", + args=["blpapi_SchemaElementDefinition_t*"], + ) + verify_ctypes( + fnc="blpapi_SchemaTypeDefinition_datatype", + ret="int", + args=["blpapi_SchemaTypeDefinition_t*"], + ) + verify_ctypes( + fnc="blpapi_SchemaTypeDefinition_description", + ret="char *", + args=["blpapi_SchemaTypeDefinition_t*"], + ) + verify_ctypes( + fnc="blpapi_SchemaTypeDefinition_enumeration", + ret="blpapi_ConstantList_t *", + args=["blpapi_SchemaTypeDefinition_t*"], + ) + verify_ctypes( + fnc="blpapi_SchemaTypeDefinition_getElementDefinition", + ret="void*", + args=["blpapi_SchemaTypeDefinition_t*", "char*", "blpapi_Name_t*"], + ) + verify_ctypes( + fnc="blpapi_SchemaTypeDefinition_getElementDefinitionAt", + ret="void*", + args=["blpapi_SchemaTypeDefinition_t*", "size_t"], + ) + verify_ctypes( + fnc="blpapi_SchemaTypeDefinition_isComplexType", + ret="int", + args=["blpapi_SchemaTypeDefinition_t*"], + ) + verify_ctypes( + fnc="blpapi_SchemaTypeDefinition_isEnumerationType", + ret="int", + args=["blpapi_SchemaTypeDefinition_t*"], + ) + verify_ctypes( + fnc="blpapi_SchemaTypeDefinition_isSimpleType", + ret="int", + args=["blpapi_SchemaTypeDefinition_t*"], + ) + verify_ctypes( + fnc="blpapi_SchemaTypeDefinition_name", + ret="blpapi_Name_t *", + args=["blpapi_SchemaTypeDefinition_t*"], + ) + verify_ctypes( + fnc="blpapi_SchemaTypeDefinition_numElementDefinitions", + ret="size_t", + args=["blpapi_SchemaTypeDefinition_t*"], + ) + verify_ctypes( + fnc="blpapi_SchemaTypeDefinition_status", + ret="int", + args=["blpapi_SchemaTypeDefinition_t*"], + ) + verify_ctypes( + fnc="blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange", + ret="int", + args=["blpapi_ServiceRegistrationOptions_t*", "int", "int", "int"], + ) + verify_ctypes( + fnc="blpapi_ServiceRegistrationOptions_copy", + ret="void", + args=[ + "blpapi_ServiceRegistrationOptions_t*", + "blpapi_ServiceRegistrationOptions_t*", + ], + ) + verify_ctypes( + fnc="blpapi_ServiceRegistrationOptions_create", + ret="blpapi_ServiceRegistrationOptions_t *", + args=[""], + ) + verify_ctypes( + fnc="blpapi_ServiceRegistrationOptions_destroy", + ret="void", + args=["blpapi_ServiceRegistrationOptions_t*"], + ) + verify_ctypes( + fnc="blpapi_ServiceRegistrationOptions_duplicate", + ret="void*", + args=["blpapi_ServiceRegistrationOptions_t*"], + ) + verify_ctypes( + fnc="blpapi_ServiceRegistrationOptions_getGroupId", + ret="int", + args=["blpapi_ServiceRegistrationOptions_t*", "char*", "int*"], + ) + verify_ctypes( + fnc="blpapi_ServiceRegistrationOptions_getPartsToRegister", + ret="int", + args=["blpapi_ServiceRegistrationOptions_t*"], + ) + verify_ctypes( + fnc="blpapi_ServiceRegistrationOptions_getServicePriority", + ret="int", + args=["blpapi_ServiceRegistrationOptions_t*"], + ) + verify_ctypes( + fnc="blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges", + ret="void", + args=["blpapi_ServiceRegistrationOptions_t*"], + ) + verify_ctypes( + fnc="blpapi_ServiceRegistrationOptions_setGroupId", + ret="void", + args=["blpapi_ServiceRegistrationOptions_t*", "char*", "unsigned int"], + ) + verify_ctypes( + fnc="blpapi_ServiceRegistrationOptions_setPartsToRegister", + ret="void", + args=["blpapi_ServiceRegistrationOptions_t*", "int"], + ) + verify_ctypes( + fnc="blpapi_ServiceRegistrationOptions_setServicePriority", + ret="int", + args=["blpapi_ServiceRegistrationOptions_t*", "int"], + ) + verify_ctypes( + fnc="blpapi_Service_addRef", ret="int", args=["blpapi_Service_t*"] + ) + verify_ctypes( + fnc="blpapi_Service_authorizationServiceName", + ret="char *", + args=["blpapi_Service_t*"], + ) + verify_ctypes( + fnc="blpapi_Service_createAdminEvent", + ret="int", + args=["blpapi_Service_t*", "blpapi_Event_t**"], + ) + verify_ctypes( + fnc="blpapi_Service_createAuthorizationRequest", + ret="int", + args=["blpapi_Service_t*", "blpapi_Request_t**", "char*"], + ) + verify_ctypes( + fnc="blpapi_Service_createPublishEvent", + ret="int", + args=["blpapi_Service_t*", "blpapi_Event_t**"], + ) + verify_ctypes( + fnc="blpapi_Service_createRequest", + ret="int", + args=["blpapi_Service_t*", "blpapi_Request_t**", "char*"], + ) + verify_ctypes( + fnc="blpapi_Service_createResponseEvent", + ret="int", + args=[ + "blpapi_Service_t*", + "blpapi_CorrelationId_t*", + "blpapi_Event_t**", + ], + ) + verify_ctypes( + fnc="blpapi_Service_description", + ret="char *", + args=["blpapi_Service_t*"], + ) + verify_ctypes( + fnc="blpapi_Service_getEventDefinition", + ret="int", + args=[ + "blpapi_Service_t*", + "blpapi_SchemaElementDefinition_t**", + "char*", + "blpapi_Name_t*", + ], + ) + verify_ctypes( + fnc="blpapi_Service_getEventDefinitionAt", + ret="int", + args=[ + "blpapi_Service_t*", + "blpapi_SchemaElementDefinition_t**", + "size_t", + ], + ) + verify_ctypes( + fnc="blpapi_Service_getOperation", + ret="int", + args=[ + "blpapi_Service_t*", + "blpapi_Operation_t**", + "char*", + "blpapi_Name_t*", + ], + ) + verify_ctypes( + fnc="blpapi_Service_getOperationAt", + ret="int", + args=["blpapi_Service_t*", "blpapi_Operation_t**", "size_t"], + ) + verify_ctypes( + fnc="blpapi_Service_name", ret="char *", args=["blpapi_Service_t*"] + ) + verify_ctypes( + fnc="blpapi_Service_numEventDefinitions", + ret="int", + args=["blpapi_Service_t*"], + ) + verify_ctypes( + fnc="blpapi_Service_numOperations", + ret="int", + args=["blpapi_Service_t*"], + ) + verify_ctypes( + fnc="blpapi_Service_release", ret="void", args=["blpapi_Service_t*"] + ) + verify_ctypes( + fnc="blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg", + ret="int", + args=["blpapi_SessionOptions_t*"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_applicationIdentityKey", + ret="int", + args=["char**", "size_t*", "blpapi_SessionOptions_t*"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_authenticationOptions", + ret="char *", + args=["blpapi_SessionOptions_t*"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_autoRestartOnDisconnection", + ret="int", + args=["blpapi_SessionOptions_t*"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_bandwidthSaveModeDisabled", + ret="int", + args=["blpapi_SessionOptions_t*"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_clientMode", + ret="int", + args=["blpapi_SessionOptions_t*"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_connectTimeout", + ret="unsigned int", + args=["blpapi_SessionOptions_t*"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_create", + ret="blpapi_SessionOptions_t *", + args=[""], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_defaultKeepAliveInactivityTime", + ret="int", + args=["blpapi_SessionOptions_t*"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_defaultKeepAliveResponseTimeout", + ret="int", + args=["blpapi_SessionOptions_t*"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_defaultServices", + ret="char *", + args=["blpapi_SessionOptions_t*"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_defaultSubscriptionService", + ret="char *", + args=["blpapi_SessionOptions_t*"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_defaultTopicPrefix", + ret="char *", + args=["blpapi_SessionOptions_t*"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_destroy", + ret="void", + args=["blpapi_SessionOptions_t*"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_flushPublishedEventsTimeout", + ret="int", + args=["blpapi_SessionOptions_t*"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_getServerAddressWithProxy", + ret="int", + args=[ + "blpapi_SessionOptions_t*", + "char**", + "unsigned short*", + "char**", + "unsigned short*", + "size_t", + ], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_keepAliveEnabled", + ret="int", + args=["blpapi_SessionOptions_t*"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_maxEventQueueSize", + ret="size_t", + args=["blpapi_SessionOptions_t*"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_maxPendingRequests", + ret="int", + args=["blpapi_SessionOptions_t*"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_numServerAddresses", + ret="int", + args=["blpapi_SessionOptions_t*"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_numStartAttempts", + ret="int", + args=["blpapi_SessionOptions_t*"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_recordSubscriptionDataReceiveTimes", + ret="int", + args=["blpapi_SessionOptions_t*"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_removeServerAddress", + ret="int", + args=["blpapi_SessionOptions_t*", "size_t"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_serverHost", + ret="char *", + args=["blpapi_SessionOptions_t*"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_serverPort", + ret="unsigned int", + args=["blpapi_SessionOptions_t*"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_serviceCheckTimeout", + ret="int", + args=["blpapi_SessionOptions_t*"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_serviceDownloadTimeout", + ret="int", + args=["blpapi_SessionOptions_t*"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_sessionName", + ret="int", + args=["char**", "size_t*", "blpapi_SessionOptions_t*"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg", + ret="void", + args=["blpapi_SessionOptions_t*", "int"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_setApplicationIdentityKey", + ret="int", + args=["blpapi_SessionOptions_t*", "char*", "size_t"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_setAuthenticationOptions", + ret="void", + args=["blpapi_SessionOptions_t*", "char*"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_setAutoRestartOnDisconnection", + ret="void", + args=["blpapi_SessionOptions_t*", "int"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_setBandwidthSaveModeDisabled", + ret="int", + args=["blpapi_SessionOptions_t*", "int"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_setClientMode", + ret="void", + args=["blpapi_SessionOptions_t*", "int"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_setConnectTimeout", + ret="int", + args=["blpapi_SessionOptions_t*", "unsigned int"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_setDefaultKeepAliveInactivityTime", + ret="int", + args=["blpapi_SessionOptions_t*", "int"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout", + ret="int", + args=["blpapi_SessionOptions_t*", "int"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_setDefaultServices", + ret="int", + args=["blpapi_SessionOptions_t*", "char*"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_setDefaultSubscriptionService", + ret="int", + args=["blpapi_SessionOptions_t*", "char*"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_setDefaultTopicPrefix", + ret="void", + args=["blpapi_SessionOptions_t*", "char*"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_setFlushPublishedEventsTimeout", + ret="int", + args=["blpapi_SessionOptions_t*", "int"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_setKeepAliveEnabled", + ret="int", + args=["blpapi_SessionOptions_t*", "int"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_setMaxEventQueueSize", + ret="void", + args=["blpapi_SessionOptions_t*", "size_t"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_setMaxPendingRequests", + ret="void", + args=["blpapi_SessionOptions_t*", "int"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_setNumStartAttempts", + ret="void", + args=["blpapi_SessionOptions_t*", "int"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes", + ret="void", + args=["blpapi_SessionOptions_t*", "int"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_setServerAddress", + ret="int", + args=["blpapi_SessionOptions_t*", "char*", "unsigned short", "size_t"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_setServerAddressWithProxy", + ret="int", + args=[ + "blpapi_SessionOptions_t*", + "char*", + "unsigned short", + "blpapi_Socks5Config_t*", + "size_t", + ], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_setServerHost", + ret="int", + args=["blpapi_SessionOptions_t*", "char*"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_setServerPort", + ret="int", + args=["blpapi_SessionOptions_t*", "unsigned short"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_setServiceCheckTimeout", + ret="int", + args=["blpapi_SessionOptions_t*", "int"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_setServiceDownloadTimeout", + ret="int", + args=["blpapi_SessionOptions_t*", "int"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_setSessionIdentityOptions", + ret="int", + args=[ + "blpapi_SessionOptions_t*", + "blpapi_AuthOptions_t*", + "blpapi_CorrelationId_t*", + ], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_setSessionName", + ret="int", + args=["blpapi_SessionOptions_t*", "char*", "size_t"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark", + ret="int", + args=["blpapi_SessionOptions_t*", "float"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark", + ret="int", + args=["blpapi_SessionOptions_t*", "float"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_setTlsOptions", + ret="void", + args=["blpapi_SessionOptions_t*", "blpapi_TlsOptions_t*"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_slowConsumerWarningHiWaterMark", + ret="float", + args=["blpapi_SessionOptions_t*"], + ) + verify_ctypes( + fnc="blpapi_SessionOptions_slowConsumerWarningLoWaterMark", + ret="float", + args=["blpapi_SessionOptions_t*"], + ) + verify_ctypes( + fnc="blpapi_Session_createSnapshotRequestTemplate", + ret="int", + args=[ + "blpapi_RequestTemplate_t**", + "blpapi_Session_t*", + "char*", + "blpapi_Identity_t*", + "blpapi_CorrelationId_t*", + ], + ) + verify_ctypes( + fnc="blpapi_Session_getAbstractSession", + ret="blpapi_AbstractSession_t *", + args=["blpapi_Session_t*"], + ) + verify_ctypes( + fnc="blpapi_Session_nextEvent", + ret="int", + args=["blpapi_Session_t*", "blpapi_Event_t**", "unsigned int"], + ) + verify_ctypes( + fnc="blpapi_Session_resubscribe", + ret="int", + args=[ + "blpapi_Session_t*", + "blpapi_SubscriptionList_t*", + "char*", + "int", + ], + ) + verify_ctypes( + fnc="blpapi_Session_resubscribeEx", + ret="int", + args=[ + "blpapi_Session_t*", + "blpapi_SubscriptionList_t*", + "char*", + "int", + "blpapi_SubscriptionPreprocessErrorHandler_t", + "void*", + ], + ) + verify_ctypes( + fnc="blpapi_Session_resubscribeWithId", + ret="int", + args=[ + "blpapi_Session_t*", + "blpapi_SubscriptionList_t*", + "int", + "char*", + "int", + ], + ) + verify_ctypes( + fnc="blpapi_Session_resubscribeWithIdEx", + ret="int", + args=[ + "blpapi_Session_t*", + "blpapi_SubscriptionList_t*", + "int", + "char*", + "int", + "blpapi_SubscriptionPreprocessErrorHandler_t", + "void*", + ], + ) + verify_ctypes( + fnc="blpapi_Session_sendRequest", + ret="int", + args=[ + "blpapi_Session_t*", + "blpapi_Request_t*", + "blpapi_CorrelationId_t*", + "blpapi_Identity_t*", + "blpapi_EventQueue_t*", + "char*", + "int", + ], + ) + verify_ctypes( + fnc="blpapi_Session_sendRequestTemplate", + ret="int", + args=[ + "blpapi_Session_t*", + "blpapi_RequestTemplate_t*", + "blpapi_CorrelationId_t*", + ], + ) + verify_ctypes( + fnc="blpapi_Session_setStatusCorrelationId", + ret="int", + args=[ + "blpapi_Session_t*", + "blpapi_Service_t*", + "blpapi_Identity_t*", + "blpapi_CorrelationId_t*", + ], + ) + verify_ctypes( + fnc="blpapi_Session_start", ret="int", args=["blpapi_Session_t*"] + ) + verify_ctypes( + fnc="blpapi_Session_startAsync", ret="int", args=["blpapi_Session_t*"] + ) + verify_ctypes( + fnc="blpapi_Session_stop", ret="int", args=["blpapi_Session_t*"] + ) + verify_ctypes( + fnc="blpapi_Session_stopAsync", ret="int", args=["blpapi_Session_t*"] + ) + verify_ctypes( + fnc="blpapi_Session_subscribe", + ret="int", + args=[ + "blpapi_Session_t*", + "blpapi_SubscriptionList_t*", + "blpapi_Identity_t*", + "char*", + "int", + ], + ) + verify_ctypes( + fnc="blpapi_Session_tryNextEvent", + ret="int", + args=["blpapi_Session_t*", "blpapi_Event_t**"], + ) + verify_ctypes( + fnc="blpapi_Session_unsubscribe", + ret="int", + args=[ + "blpapi_Session_t*", + "blpapi_SubscriptionList_t*", + "char*", + "int", + ], + ) + verify_ctypes( + fnc="blpapi_Socks5Config_create", + ret="blpapi_Socks5Config_t *", + args=["char*", "size_t", "unsigned short"], + ) + verify_ctypes( + fnc="blpapi_Socks5Config_destroy", + ret="void", + args=["blpapi_Socks5Config_t*"], + ) + verify_ctypes( + fnc="blpapi_SubscriptionList_addResolved", + ret="int", + args=[ + "blpapi_SubscriptionList_t*", + "char*", + "blpapi_CorrelationId_t*", + ], + ) + verify_ctypes( + fnc="blpapi_SubscriptionList_append", + ret="int", + args=["blpapi_SubscriptionList_t*", "blpapi_SubscriptionList_t*"], + ) + verify_ctypes( + fnc="blpapi_SubscriptionList_clear", + ret="int", + args=["blpapi_SubscriptionList_t*"], + ) + verify_ctypes( + fnc="blpapi_SubscriptionList_correlationIdAt", + ret="int", + args=[ + "blpapi_SubscriptionList_t*", + "blpapi_CorrelationId_t*", + "size_t", + ], + ) + verify_ctypes( + fnc="blpapi_SubscriptionList_create", + ret="blpapi_SubscriptionList_t *", + args=[""], + ) + verify_ctypes( + fnc="blpapi_SubscriptionList_destroy", + ret="void", + args=["blpapi_SubscriptionList_t*"], + ) + verify_ctypes( + fnc="blpapi_SubscriptionList_isResolvedAt", + ret="int", + args=["blpapi_SubscriptionList_t*", "int*", "size_t"], + ) + verify_ctypes( + fnc="blpapi_SubscriptionList_size", + ret="int", + args=["blpapi_SubscriptionList_t*"], + ) + verify_ctypes( + fnc="blpapi_SubscriptionList_topicStringAt", + ret="int", + args=["blpapi_SubscriptionList_t*", "char**", "size_t"], + ) + verify_ctypes( + fnc="blpapi_TestUtil_appendMessage", + ret="int", + args=[ + "blpapi_MessageFormatter_t**", + "blpapi_Event_t*", + "blpapi_SchemaElementDefinition_t*", + "blpapi_MessageProperties_t*", + ], + ) + verify_ctypes( + fnc="blpapi_TestUtil_createEvent", + ret="int", + args=["blpapi_Event_t**", "int"], + ) + verify_ctypes( + fnc="blpapi_TestUtil_createTopic", + ret="int", + args=["blpapi_Topic_t**", "blpapi_Service_t*", "int"], + ) + verify_ctypes( + fnc="blpapi_TestUtil_deserializeService", + ret="int", + args=["char*", "size_t", "blpapi_Service_t**"], + ) + verify_ctypes( + fnc="blpapi_TestUtil_getAdminMessageDefinition", + ret="int", + args=["blpapi_SchemaElementDefinition_t**", "blpapi_Name_t*"], + ) + verify_ctypes( + fnc="blpapi_TimePointUtil_nanosecondsBetween", + ret="long long", + args=["blpapi_TimePoint_t*", "blpapi_TimePoint_t*"], + ) + verify_ctypes( + fnc="blpapi_TlsOptions_createFromBlobs", + ret="blpapi_TlsOptions_t *", + args=["char*", "int", "char*", "char*", "int"], + ) + verify_ctypes( + fnc="blpapi_TlsOptions_createFromFiles", + ret="blpapi_TlsOptions_t *", + args=["char*", "char*", "char*"], + ) + verify_ctypes( + fnc="blpapi_TlsOptions_destroy", + ret="void", + args=["blpapi_TlsOptions_t*"], + ) + verify_ctypes( + fnc="blpapi_TlsOptions_setCrlFetchTimeoutMs", + ret="void", + args=["blpapi_TlsOptions_t*", "int"], + ) + verify_ctypes( + fnc="blpapi_TlsOptions_setTlsHandshakeTimeoutMs", + ret="void", + args=["blpapi_TlsOptions_t*", "int"], + ) + verify_ctypes( + fnc="blpapi_TopicList_add", + ret="int", + args=["blpapi_TopicList_t*", "char*", "blpapi_CorrelationId_t*"], + ) + verify_ctypes( + fnc="blpapi_TopicList_addFromMessage", + ret="int", + args=[ + "blpapi_TopicList_t*", + "blpapi_Message_t*", + "blpapi_CorrelationId_t*", + ], + ) + verify_ctypes( + fnc="blpapi_TopicList_correlationIdAt", + ret="int", + args=["blpapi_TopicList_t*", "blpapi_CorrelationId_t*", "size_t"], + ) + verify_ctypes( + fnc="blpapi_TopicList_create", + ret="blpapi_TopicList_t *", + args=["blpapi_TopicList_t*"], + ) + verify_ctypes( + fnc="blpapi_TopicList_destroy", + ret="void", + args=["blpapi_TopicList_t*"], + ) + verify_ctypes( + fnc="blpapi_TopicList_message", + ret="int", + args=[ + "blpapi_TopicList_t*", + "blpapi_Message_t**", + "blpapi_CorrelationId_t*", + ], + ) + verify_ctypes( + fnc="blpapi_TopicList_messageAt", + ret="int", + args=["blpapi_TopicList_t*", "blpapi_Message_t**", "size_t"], + ) + verify_ctypes( + fnc="blpapi_TopicList_size", ret="int", args=["blpapi_TopicList_t*"] + ) + verify_ctypes( + fnc="blpapi_TopicList_status", + ret="int", + args=["blpapi_TopicList_t*", "int*", "blpapi_CorrelationId_t*"], + ) + verify_ctypes( + fnc="blpapi_TopicList_statusAt", + ret="int", + args=["blpapi_TopicList_t*", "int*", "size_t"], + ) + verify_ctypes( + fnc="blpapi_TopicList_topicString", + ret="int", + args=["blpapi_TopicList_t*", "char**", "blpapi_CorrelationId_t*"], + ) + verify_ctypes( + fnc="blpapi_TopicList_topicStringAt", + ret="int", + args=["blpapi_TopicList_t*", "char**", "size_t"], + ) + verify_ctypes( + fnc="blpapi_Topic_compare", + ret="int", + args=["blpapi_Topic_t*", "blpapi_Topic_t*"], + ) + verify_ctypes( + fnc="blpapi_Topic_create", + ret="blpapi_Topic_t *", + args=["blpapi_Topic_t*"], + ) + verify_ctypes( + fnc="blpapi_Topic_destroy", ret="void", args=["blpapi_Topic_t*"] + ) + verify_ctypes( + fnc="blpapi_Topic_isActive", ret="int", args=["blpapi_Topic_t*"] + ) + verify_ctypes( + fnc="blpapi_Topic_service", + ret="blpapi_Service_t *", + args=["blpapi_Topic_t*"], + ) + verify_ctypes( + fnc="blpapi_ZfpUtil_getOptionsForLeasedLines", + ret="int", + args=["blpapi_SessionOptions_t*", "blpapi_TlsOptions_t*", "int"], + ) + verify_ctypes( + fnc="blpapi_getLastErrorDescription", ret="char *", args=["int"] + ) diff --git a/src/blpapi/internals_wrap.c b/src/blpapi/internals_wrap.c deleted file mode 100644 index a7e3e70..0000000 --- a/src/blpapi/internals_wrap.c +++ /dev/null @@ -1,24620 +0,0 @@ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.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. - * ----------------------------------------------------------------------------- */ - - -#ifndef SWIGPYTHON -#define SWIGPYTHON -#endif - -#define SWIG_PYTHON_THREADS -#define SWIG_PYTHON_DIRECTOR_NO_VTABLE - -/* ----------------------------------------------------------------------------- - * This section contains generic SWIG labels for method/variable - * declarations/attributes, and other compiler dependent labels. - * ----------------------------------------------------------------------------- */ - -/* template workaround for compilers that cannot correctly implement the C++ standard */ -#ifndef SWIGTEMPLATEDISAMBIGUATOR -# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) -# define SWIGTEMPLATEDISAMBIGUATOR template -# elif defined(__HP_aCC) -/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ -/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ -# define SWIGTEMPLATEDISAMBIGUATOR template -# else -# define SWIGTEMPLATEDISAMBIGUATOR -# endif -#endif - -/* inline attribute */ -#ifndef SWIGINLINE -# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) -# define SWIGINLINE inline -# else -# define SWIGINLINE -# endif -#endif - -/* attribute recognised by some compilers to avoid 'unused' warnings */ -#ifndef SWIGUNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define SWIGUNUSED __attribute__ ((__unused__)) -# else -# define SWIGUNUSED -# endif -# elif defined(__ICC) -# define SWIGUNUSED __attribute__ ((__unused__)) -# else -# define SWIGUNUSED -# endif -#endif - -#ifndef SWIG_MSC_UNSUPPRESS_4505 -# if defined(_MSC_VER) -# pragma warning(disable : 4505) /* unreferenced local function has been removed */ -# endif -#endif - -#ifndef SWIGUNUSEDPARM -# ifdef __cplusplus -# define SWIGUNUSEDPARM(p) -# else -# define SWIGUNUSEDPARM(p) p SWIGUNUSED -# endif -#endif - -/* internal SWIG method */ -#ifndef SWIGINTERN -# define SWIGINTERN static SWIGUNUSED -#endif - -/* internal inline SWIG method */ -#ifndef SWIGINTERNINLINE -# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE -#endif - -/* exporting methods */ -#if defined(__GNUC__) -# if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) -# ifndef GCC_HASCLASSVISIBILITY -# define GCC_HASCLASSVISIBILITY -# endif -# endif -#endif - -#ifndef SWIGEXPORT -# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) -# if defined(STATIC_LINKED) -# define SWIGEXPORT -# else -# define SWIGEXPORT __declspec(dllexport) -# endif -# else -# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) -# define SWIGEXPORT __attribute__ ((visibility("default"))) -# else -# define SWIGEXPORT -# endif -# endif -#endif - -/* calling conventions for Windows */ -#ifndef SWIGSTDCALL -# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) -# define SWIGSTDCALL __stdcall -# else -# define SWIGSTDCALL -# endif -#endif - -/* Deal with Microsoft's attempt at deprecating C standard runtime functions */ -#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) -# define _CRT_SECURE_NO_DEPRECATE -#endif - -/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ -#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) -# define _SCL_SECURE_NO_DEPRECATE -#endif - -/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */ -#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES) -# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0 -#endif - -/* Intel's compiler complains if a variable which was never initialised is - * cast to void, which is a common idiom which we use to indicate that we - * are aware a variable isn't used. So we just silence that warning. - * See: https://github.com/swig/swig/issues/192 for more discussion. - */ -#ifdef __INTEL_COMPILER -# pragma warning disable 592 -#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(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG) -/* Use debug wrappers with the Python release dll */ -# undef _DEBUG -# include -# define _DEBUG 1 -#else -# include -#endif - -/* ----------------------------------------------------------------------------- - * swigrun.swg - * - * This file contains generic C API SWIG runtime support for pointer - * type checking. - * ----------------------------------------------------------------------------- */ - -/* This should only be incremented when either the layout of swig_type_info changes, - or for whatever reason, the runtime changes incompatibly */ -#define SWIG_RUNTIME_VERSION "4" - -/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ -#ifdef SWIG_TYPE_TABLE -# define SWIG_QUOTE_STRING(x) #x -# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x) -# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE) -#else -# define SWIG_TYPE_TABLE_NAME -#endif - -/* - You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for - creating a static or dynamic library from the SWIG runtime code. - In 99.9% of the cases, SWIG just needs to declare them as 'static'. - - But only do this if strictly necessary, ie, if you have problems - with your compiler or suchlike. -*/ - -#ifndef SWIGRUNTIME -# define SWIGRUNTIME SWIGINTERN -#endif - -#ifndef SWIGRUNTIMEINLINE -# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE -#endif - -/* Generic buffer size */ -#ifndef SWIG_BUFFER_SIZE -# define SWIG_BUFFER_SIZE 1024 -#endif - -/* Flags for pointer conversions */ -#define SWIG_POINTER_DISOWN 0x1 -#define SWIG_CAST_NEW_MEMORY 0x2 -#define SWIG_POINTER_NO_NULL 0x4 - -/* Flags for new pointer objects */ -#define SWIG_POINTER_OWN 0x1 - - -/* - Flags/methods for returning states. - - The SWIG conversion methods, as ConvertPtr, return an integer - that tells if the conversion was successful or not. And if not, - an error code can be returned (see swigerrors.swg for the codes). - - Use the following macros/flags to set or process the returning - states. - - In old versions of SWIG, code such as the following was usually written: - - if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { - // success code - } else { - //fail code - } - - Now you can be more explicit: - - int res = SWIG_ConvertPtr(obj,vptr,ty.flags); - if (SWIG_IsOK(res)) { - // success code - } else { - // fail code - } - - which is the same really, but now you can also do - - Type *ptr; - int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags); - if (SWIG_IsOK(res)) { - // success code - if (SWIG_IsNewObj(res) { - ... - delete *ptr; - } else { - ... - } - } else { - // fail code - } - - I.e., now SWIG_ConvertPtr can return new objects and you can - identify the case and take care of the deallocation. Of course that - also requires SWIG_ConvertPtr to return new result values, such as - - int SWIG_ConvertPtr(obj, ptr,...) { - if () { - if () { - *ptr = ; - return SWIG_NEWOBJ; - } else { - *ptr = ; - return SWIG_OLDOBJ; - } - } else { - return SWIG_BADOBJ; - } - } - - Of course, returning the plain '0(success)/-1(fail)' still works, but you can be - more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the - 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 - - int food(double) - int fooi(int); - - and you call - - food(1) // cast rank '1' (1 -> 1.0) - fooi(1) // cast rank '0' - - just use the SWIG_AddCast()/SWIG_CheckState() -*/ - -#define SWIG_OK (0) -#define SWIG_ERROR (-1) -#define SWIG_IsOK(r) (r >= 0) -#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError) - -/* The CastRankLimit says how many bits are used for the cast rank */ -#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 */ -#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 */ -#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)) -#define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r) -#define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r) -#define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK)) - -/* Cast-Rank Mode */ -#if defined(SWIG_CASTRANK_MODE) -# ifndef SWIG_TypeRank -# define SWIG_TypeRank unsigned long -# endif -# ifndef SWIG_MAXCASTRANK /* Default cast allowed */ -# define SWIG_MAXCASTRANK (2) -# endif -# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1) -# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK) -SWIGINTERNINLINE int SWIG_AddCast(int r) { - return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r; -} -SWIGINTERNINLINE int SWIG_CheckState(int r) { - return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; -} -#else /* no cast-rank mode */ -# define SWIG_AddCast(r) (r) -# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0) -#endif - - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void *(*swig_converter_func)(void *, int *); -typedef struct swig_type_info *(*swig_dycast_func)(void **); - -/* Structure to store information on one type */ -typedef struct swig_type_info { - const char *name; /* mangled name of this type */ - const char *str; /* human readable name of this type */ - swig_dycast_func dcast; /* dynamic cast function down a hierarchy */ - struct swig_cast_info *cast; /* linked list of types that can cast into this type */ - void *clientdata; /* language specific type data */ - int owndata; /* flag if the structure owns the clientdata */ -} swig_type_info; - -/* Structure to store a type and conversion function used for casting */ -typedef struct swig_cast_info { - swig_type_info *type; /* pointer to type that is equivalent to this type */ - swig_converter_func converter; /* function to cast the void pointers */ - struct swig_cast_info *next; /* pointer to next cast in linked list */ - struct swig_cast_info *prev; /* pointer to the previous cast */ -} swig_cast_info; - -/* Structure used to store module information - * Each module generates one structure like this, and the runtime collects - * all of these structures and stores them in a circularly linked list.*/ -typedef struct swig_module_info { - swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */ - size_t size; /* Number of types in this module */ - struct swig_module_info *next; /* Pointer to next element in circularly linked list */ - swig_type_info **type_initial; /* Array of initially generated type structures */ - swig_cast_info **cast_initial; /* Array of initially generated casting structures */ - void *clientdata; /* Language specific module data */ -} swig_module_info; - -/* - Compare two type names skipping the space characters, therefore - "char*" == "char *" and "Class" == "Class", etc. - - Return 0 when the two name types are equivalent, as in - strncmp, but skipping ' '. -*/ -SWIGRUNTIME int -SWIG_TypeNameComp(const char *f1, const char *l1, - const char *f2, const char *l2) { - for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) { - while ((*f1 == ' ') && (f1 != l1)) ++f1; - while ((*f2 == ' ') && (f2 != l2)) ++f2; - if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1; - } - return (int)((l1 - f1) - (l2 - f2)); -} - -/* - Check type equivalence in a name list like ||... - Return 0 if equal, -1 if nb < tb, 1 if nb > tb -*/ -SWIGRUNTIME int -SWIG_TypeCmp(const char *nb, const char *tb) { - int equiv = 1; - const char* te = tb + strlen(tb); - const char* ne = nb; - while (equiv != 0 && *ne) { - for (nb = ne; *ne; ++ne) { - if (*ne == '|') break; - } - equiv = SWIG_TypeNameComp(nb, ne, tb, te); - if (*ne) ++ne; - } - return equiv; -} - -/* - Check type equivalence in a name list like ||... - Return 0 if not equal, 1 if equal -*/ -SWIGRUNTIME int -SWIG_TypeEquiv(const char *nb, const char *tb) { - return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0; -} - -/* - Check the typename -*/ -SWIGRUNTIME swig_cast_info * -SWIG_TypeCheck(const char *c, swig_type_info *ty) { - if (ty) { - swig_cast_info *iter = ty->cast; - while (iter) { - if (strcmp(iter->type->name, c) == 0) { - #if 0 - if (iter == ty->cast) - return iter; - /* Move iter to the top of the linked list */ - iter->prev->next = iter->next; - if (iter->next) - iter->next->prev = iter->prev; - iter->next = ty->cast; - iter->prev = 0; - if (ty->cast) ty->cast->prev = iter; - ty->cast = iter; - #endif - return iter; - } - iter = iter->next; - } - } - return 0; -} - -/* - 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) { - if (ty) { - swig_cast_info *iter = ty->cast; - while (iter) { - if (iter->type == from) { - #if 0 - if (iter == ty->cast) - return iter; - /* Move iter to the top of the linked list */ - iter->prev->next = iter->next; - if (iter->next) - iter->next->prev = iter->prev; - iter->next = ty->cast; - iter->prev = 0; - if (ty->cast) ty->cast->prev = iter; - ty->cast = iter; - #endif - return iter; - } - iter = iter->next; - } - } - return 0; -} - -/* - Cast a pointer up an inheritance hierarchy -*/ -SWIGRUNTIMEINLINE void * -SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) { - return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory); -} - -/* - Dynamic pointer casting. Down an inheritance hierarchy -*/ -SWIGRUNTIME swig_type_info * -SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) { - swig_type_info *lastty = ty; - if (!ty || !ty->dcast) return ty; - while (ty && (ty->dcast)) { - ty = (*ty->dcast)(ptr); - if (ty) lastty = ty; - } - return lastty; -} - -/* - Return the name associated with this type -*/ -SWIGRUNTIMEINLINE const char * -SWIG_TypeName(const swig_type_info *ty) { - return ty->name; -} - -/* - Return the pretty name associated with this type, - that is an unmangled type name in a form presentable to the user. -*/ -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. */ - if (!type) return NULL; - if (type->str != NULL) { - const char *last_name = type->str; - const char *s; - for (s = type->str; *s; s++) - if (*s == '|') last_name = s+1; - return last_name; - } - else - return type->name; -} - -/* - Set the clientdata field for a type -*/ -SWIGRUNTIME void -SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { - swig_cast_info *cast = ti->cast; - /* if (ti->clientdata == clientdata) return; */ - ti->clientdata = clientdata; - - while (cast) { - if (!cast->converter) { - swig_type_info *tc = cast->type; - if (!tc->clientdata) { - SWIG_TypeClientData(tc, clientdata); - } - } - cast = cast->next; - } -} -SWIGRUNTIME void -SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) { - SWIG_TypeClientData(ti, clientdata); - ti->owndata = 1; -} - -/* - Search for a swig_type_info structure only by mangled name - Search is a O(log #types) - - We start searching at module start, and finish searching when start == end. - Note: if start == end at the beginning of the function, we go all the way around - the circular list. -*/ -SWIGRUNTIME swig_type_info * -SWIG_MangledTypeQueryModule(swig_module_info *start, - swig_module_info *end, - const char *name) { - swig_module_info *iter = start; - do { - if (iter->size) { - size_t l = 0; - size_t r = iter->size - 1; - do { - /* since l+r >= 0, we can (>> 1) instead (/ 2) */ - size_t i = (l + r) >> 1; - const char *iname = iter->types[i]->name; - if (iname) { - int compare = strcmp(name, iname); - if (compare == 0) { - return iter->types[i]; - } else if (compare < 0) { - if (i) { - r = i - 1; - } else { - break; - } - } else if (compare > 0) { - l = i + 1; - } - } else { - break; /* should never happen */ - } - } while (l <= r); - } - iter = iter->next; - } while (iter != end); - return 0; -} - -/* - Search for a swig_type_info structure for either a mangled name or a human readable name. - It first searches the mangled names of the types, which is a O(log #types) - If a type is not found it then searches the human readable names, which is O(#types). - - We start searching at module start, and finish searching when start == end. - Note: if start == end at the beginning of the function, we go all the way around - the circular list. -*/ -SWIGRUNTIME swig_type_info * -SWIG_TypeQueryModule(swig_module_info *start, - swig_module_info *end, - const char *name) { - /* STEP 1: Search the name field using binary search */ - swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name); - if (ret) { - return ret; - } else { - /* STEP 2: If the type hasn't been found, do a complete search - of the str field (the human readable name) */ - swig_module_info *iter = start; - do { - size_t i = 0; - for (; i < iter->size; ++i) { - if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name))) - return iter->types[i]; - } - iter = iter->next; - } while (iter != end); - } - - /* neither found a match */ - return 0; -} - -/* - Pack binary data into a string -*/ -SWIGRUNTIME char * -SWIG_PackData(char *c, void *ptr, size_t sz) { - static const char hex[17] = "0123456789abcdef"; - const unsigned char *u = (unsigned char *) ptr; - const unsigned char *eu = u + sz; - for (; u != eu; ++u) { - unsigned char uu = *u; - *(c++) = hex[(uu & 0xf0) >> 4]; - *(c++) = hex[uu & 0xf]; - } - return c; -} - -/* - Unpack binary data from a string -*/ -SWIGRUNTIME const char * -SWIG_UnpackData(const char *c, void *ptr, size_t sz) { - unsigned char *u = (unsigned char *) ptr; - const unsigned char *eu = u + sz; - for (; u != eu; ++u) { - char d = *(c++); - unsigned char uu; - if ((d >= '0') && (d <= '9')) - uu = (unsigned char)((d - '0') << 4); - else if ((d >= 'a') && (d <= 'f')) - uu = (unsigned char)((d - ('a'-10)) << 4); - else - return (char *) 0; - d = *(c++); - if ((d >= '0') && (d <= '9')) - uu |= (unsigned char)(d - '0'); - else if ((d >= 'a') && (d <= 'f')) - uu |= (unsigned char)(d - ('a'-10)); - else - return (char *) 0; - *u = uu; - } - return c; -} - -/* - Pack 'void *' into a string buffer. -*/ -SWIGRUNTIME char * -SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) { - char *r = buff; - if ((2*sizeof(void *) + 2) > bsz) return 0; - *(r++) = '_'; - r = SWIG_PackData(r,&ptr,sizeof(void *)); - if (strlen(name) + 1 > (bsz - (r - buff))) return 0; - strcpy(r,name); - return buff; -} - -SWIGRUNTIME const char * -SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) { - if (*c != '_') { - if (strcmp(c,"NULL") == 0) { - *ptr = (void *) 0; - return name; - } else { - return 0; - } - } - return SWIG_UnpackData(++c,ptr,sizeof(void *)); -} - -SWIGRUNTIME char * -SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) { - char *r = buff; - size_t lname = (name ? strlen(name) : 0); - if ((2*sz + 2 + lname) > bsz) return 0; - *(r++) = '_'; - r = SWIG_PackData(r,ptr,sz); - if (lname) { - strncpy(r,name,lname+1); - } else { - *r = 0; - } - return buff; -} - -SWIGRUNTIME const char * -SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { - if (*c != '_') { - if (strcmp(c,"NULL") == 0) { - memset(ptr,0,sz); - return name; - } else { - return 0; - } - } - return SWIG_UnpackData(++c,ptr,sz); -} - -#ifdef __cplusplus -} -#endif - -/* Errors in SWIG */ -#define SWIG_UnknownError -1 -#define SWIG_IOError -2 -#define SWIG_RuntimeError -3 -#define SWIG_IndexError -4 -#define SWIG_TypeError -5 -#define SWIG_DivisionByZero -6 -#define SWIG_OverflowError -7 -#define SWIG_SyntaxError -8 -#define SWIG_ValueError -9 -#define SWIG_SystemError -10 -#define SWIG_AttributeError -11 -#define SWIG_MemoryError -12 -#define SWIG_NullReferenceError -13 - - - -/* Compatibility macros for Python 3 */ -#if PY_VERSION_HEX >= 0x03000000 - -#define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type) -#define PyInt_Check(x) PyLong_Check(x) -#define PyInt_AsLong(x) PyLong_AsLong(x) -#define PyInt_FromLong(x) PyLong_FromLong(x) -#define PyInt_FromSize_t(x) PyLong_FromSize_t(x) -#define PyString_Check(name) PyBytes_Check(name) -#define PyString_FromString(x) PyUnicode_FromString(x) -#define PyString_Format(fmt, args) PyUnicode_Format(fmt, args) -#define PyString_AsString(str) PyBytes_AsString(str) -#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 - -#ifndef Py_TYPE -# define Py_TYPE(op) ((op)->ob_type) -#endif - -/* SWIG APIs for compatibility of both Python 2 & 3 */ - -#if PY_VERSION_HEX >= 0x03000000 -# define SWIG_Python_str_FromFormat PyUnicode_FromFormat -#else -# define SWIG_Python_str_FromFormat PyString_FromFormat -#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 >= 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; -#else - return PyString_AsString(str); -#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) -{ -#if PY_VERSION_HEX >= 0x03000000 - return PyUnicode_FromString(c); -#else - return PyString_FromString(c); -#endif -} - -#ifndef PyObject_DEL -# define PyObject_DEL PyObject_Del -#endif - -// 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) - -#if PY_VERSION_HEX < 0x03020000 -#define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type) -#define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name) -#define Py_hash_t long -#endif - -/* ----------------------------------------------------------------------------- - * error manipulation - * ----------------------------------------------------------------------------- */ - -SWIGRUNTIME PyObject* -SWIG_Python_ErrorType(int code) { - PyObject* type = 0; - switch(code) { - case SWIG_MemoryError: - type = PyExc_MemoryError; - break; - case SWIG_IOError: - type = PyExc_IOError; - break; - case SWIG_RuntimeError: - type = PyExc_RuntimeError; - break; - case SWIG_IndexError: - type = PyExc_IndexError; - break; - case SWIG_TypeError: - type = PyExc_TypeError; - break; - case SWIG_DivisionByZero: - type = PyExc_ZeroDivisionError; - break; - case SWIG_OverflowError: - type = PyExc_OverflowError; - break; - case SWIG_SyntaxError: - type = PyExc_SyntaxError; - break; - case SWIG_ValueError: - type = PyExc_ValueError; - break; - case SWIG_SystemError: - type = PyExc_SystemError; - break; - case SWIG_AttributeError: - type = PyExc_AttributeError; - break; - default: - type = PyExc_RuntimeError; - } - return type; -} - - -SWIGRUNTIME void -SWIG_Python_AddErrorMsg(const char* mesg) -{ - PyObject *type = 0; - PyObject *value = 0; - PyObject *traceback = 0; - - if (PyErr_Occurred()) - PyErr_Fetch(&type, &value, &traceback); - if (value) { - PyObject *old_str = PyObject_Str(value); - const char *tmp = SWIG_Python_str_AsChar(old_str); - 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_DECREF(old_str); - Py_DECREF(value); - } else { - PyErr_SetString(PyExc_RuntimeError, mesg); - } -} - -SWIGRUNTIME int -SWIG_Python_TypeErrorOccurred(PyObject *obj) -{ - PyObject *error; - if (obj) - return 0; - error = PyErr_Occurred(); - return error && PyErr_GivenExceptionMatches(error, PyExc_TypeError); -} - -SWIGRUNTIME void -SWIG_Python_RaiseOrModifyTypeError(const char *message) -{ - if (SWIG_Python_TypeErrorOccurred(NULL)) { - /* Use existing TypeError to preserve stacktrace and enhance with given message */ - PyObject *newvalue; - PyObject *type = NULL, *value = NULL, *traceback = NULL; - PyErr_Fetch(&type, &value, &traceback); -#if PY_VERSION_HEX >= 0x03000000 - newvalue = PyUnicode_FromFormat("%S\nAdditional information:\n%s", value, message); -#else - newvalue = PyString_FromFormat("%s\nAdditional information:\n%s", PyString_AsString(value), message); -#endif - Py_XDECREF(value); - PyErr_Restore(type, newvalue, traceback); - } else { - /* Raise TypeError using given message */ - PyErr_SetString(PyExc_TypeError, message); - } -} - -#if defined(SWIG_PYTHON_NO_THREADS) -# if defined(SWIG_PYTHON_THREADS) -# undef SWIG_PYTHON_THREADS -# endif -#endif -#if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */ -# if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL) -# 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() -# endif -# ifdef __cplusplus /* C++ code */ - class SWIG_Python_Thread_Block { - bool status; - PyGILState_STATE state; - public: - void end() { if (status) { PyGILState_Release(state); status = false;} } - SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {} - ~SWIG_Python_Thread_Block() { end(); } - }; - class SWIG_Python_Thread_Allow { - bool status; - PyThreadState *save; - public: - void end() { if (status) { PyEval_RestoreThread(save); status = false; }} - SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {} - ~SWIG_Python_Thread_Allow() { end(); } - }; -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK SWIG_Python_Thread_Block _swig_thread_block -# define SWIG_PYTHON_THREAD_END_BLOCK _swig_thread_block.end() -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW SWIG_Python_Thread_Allow _swig_thread_allow -# define SWIG_PYTHON_THREAD_END_ALLOW _swig_thread_allow.end() -# else /* C code */ -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK PyGILState_STATE _swig_thread_block = PyGILState_Ensure() -# define SWIG_PYTHON_THREAD_END_BLOCK PyGILState_Release(_swig_thread_block) -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW PyThreadState *_swig_thread_allow = PyEval_SaveThread() -# define SWIG_PYTHON_THREAD_END_ALLOW PyEval_RestoreThread(_swig_thread_allow) -# endif -# else /* Old thread way, not implemented, user must provide it */ -# if !defined(SWIG_PYTHON_INITIALIZE_THREADS) -# define SWIG_PYTHON_INITIALIZE_THREADS -# endif -# if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK) -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK -# endif -# if !defined(SWIG_PYTHON_THREAD_END_BLOCK) -# define SWIG_PYTHON_THREAD_END_BLOCK -# endif -# if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW) -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW -# endif -# if !defined(SWIG_PYTHON_THREAD_END_ALLOW) -# define SWIG_PYTHON_THREAD_END_ALLOW -# endif -# endif -#else /* No thread support */ -# define SWIG_PYTHON_INITIALIZE_THREADS -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK -# define SWIG_PYTHON_THREAD_END_BLOCK -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW -# define SWIG_PYTHON_THREAD_END_ALLOW -#endif - -/* ----------------------------------------------------------------------------- - * Python API portion that goes into the runtime - * ----------------------------------------------------------------------------- */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* ----------------------------------------------------------------------------- - * Constant declarations - * ----------------------------------------------------------------------------- */ - -/* Constant Types */ -#define SWIG_PY_POINTER 4 -#define SWIG_PY_BINARY 5 - -/* Constant information structure */ -typedef struct swig_const_info { - int type; - const char *name; - long lvalue; - double dvalue; - void *pvalue; - swig_type_info **ptype; -} swig_const_info; - -#ifdef __cplusplus -} -#endif - - -/* ----------------------------------------------------------------------------- - * pyrun.swg - * - * This file contains the runtime support for Python modules - * and includes code for managing global variables and pointer - * type checking. - * - * ----------------------------------------------------------------------------- */ - -#if PY_VERSION_HEX < 0x02070000 /* 2.7.0 */ -# 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" -#endif - -/* Common SWIG API */ - -/* for raw pointers */ -#define SWIG_Python_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0) -#define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtr(obj, pptr, type, flags) -#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own) - -#ifdef SWIGPYTHON_BUILTIN -#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(self, ptr, type, flags) -#else -#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags) -#endif - -#define SWIG_InternalNewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags) - -#define SWIG_CheckImplicit(ty) SWIG_Python_CheckImplicit(ty) -#define SWIG_AcquirePtr(ptr, src) SWIG_Python_AcquirePtr(ptr, src) -#define swig_owntype int - -/* for raw packed data */ -#define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) - -/* for class or struct pointers */ -#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags) -#define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags) - -/* for C or C++ function pointers */ -#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_Python_ConvertFunctionPtr(obj, pptr, type) -#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Python_NewPointerObj(NULL, ptr, type, 0) - -/* for C++ member pointers, ie, member methods */ -#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewMemberObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) - - -/* Runtime API */ - -#define SWIG_GetModule(clientdata) SWIG_Python_GetModule(clientdata) -#define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer) -#define SWIG_NewClientData(obj) SwigPyClientData_New(obj) - -#define SWIG_SetErrorObj SWIG_Python_SetErrorObj -#define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg -#define SWIG_ErrorType(code) SWIG_Python_ErrorType(code) -#define SWIG_Error(code, msg) SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg) -#define SWIG_fail goto fail - - -/* Runtime API implementation */ - -/* Error manipulation */ - -SWIGINTERN void -SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - PyErr_SetObject(errtype, obj); - Py_DECREF(obj); - SWIG_PYTHON_THREAD_END_BLOCK; -} - -SWIGINTERN void -SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - PyErr_SetString(errtype, msg); - SWIG_PYTHON_THREAD_END_BLOCK; -} - -#define SWIG_Python_Raise(obj, type, desc) SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj) - -/* Set a constant value */ - -#if defined(SWIGPYTHON_BUILTIN) - -SWIGINTERN void -SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) { - PyObject *s = PyString_InternFromString(key); - PyList_Append(seq, s); - Py_DECREF(s); -} - -SWIGINTERN void -SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) { - PyDict_SetItemString(d, name, obj); - Py_DECREF(obj); - if (public_interface) - SwigPyBuiltin_AddPublicSymbol(public_interface, name); -} - -#else - -SWIGINTERN void -SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) { - PyDict_SetItemString(d, name, obj); - Py_DECREF(obj); -} - -#endif - -/* Append a value to the result obj */ - -SWIGINTERN PyObject* -SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) { - if (!result) { - result = obj; - } else if (result == Py_None) { - Py_DECREF(result); - result = obj; - } else { - if (!PyList_Check(result)) { - PyObject *o2 = result; - result = PyList_New(1); - PyList_SetItem(result, 0, o2); - } - PyList_Append(result,obj); - Py_DECREF(obj); - } - return result; -} - -/* Unpack the argument tuple */ - -SWIGINTERN Py_ssize_t -SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs) -{ - if (!args) { - if (!min && !max) { - return 1; - } else { - PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none", - name, (min == max ? "" : "at least "), (int)min); - return 0; - } - } - if (!PyTuple_Check(args)) { - if (min <= 1 && max >= 1) { - Py_ssize_t i; - objs[0] = args; - for (i = 1; i < max; ++i) { - objs[i] = 0; - } - return 2; - } - PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple"); - return 0; - } else { - Py_ssize_t l = PyTuple_GET_SIZE(args); - if (l < min) { - PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", - name, (min == max ? "" : "at least "), (int)min, (int)l); - return 0; - } else if (l > max) { - PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", - name, (min == max ? "" : "at most "), (int)max, (int)l); - return 0; - } else { - Py_ssize_t i; - for (i = 0; i < l; ++i) { - objs[i] = PyTuple_GET_ITEM(args, i); - } - for (; l < max; ++l) { - objs[l] = 0; - } - return i + 1; - } - } -} - -/* A functor is a function object with one single object argument */ -#define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL); - -/* - Helper for static pointer initialization for both C and C++ code, for example - static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...); -*/ -#ifdef __cplusplus -#define SWIG_STATIC_POINTER(var) var -#else -#define SWIG_STATIC_POINTER(var) var = 0; if (!var) var -#endif - -/* ----------------------------------------------------------------------------- - * Pointer declarations - * ----------------------------------------------------------------------------- */ - -/* Flags for new pointer objects */ -#define SWIG_POINTER_NOSHADOW (SWIG_POINTER_OWN << 1) -#define SWIG_POINTER_NEW (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN) - -#define SWIG_POINTER_IMPLICIT_CONV (SWIG_POINTER_DISOWN << 1) - -#define SWIG_BUILTIN_TP_INIT (SWIG_POINTER_OWN << 2) -#define SWIG_BUILTIN_INIT (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN) - -#ifdef __cplusplus -extern "C" { -#endif - -/* The python void return value */ - -SWIGRUNTIMEINLINE PyObject * -SWIG_Py_Void(void) -{ - PyObject *none = Py_None; - Py_INCREF(none); - return none; -} - -/* SwigPyClientData */ - -typedef struct { - PyObject *klass; - PyObject *newraw; - PyObject *newargs; - PyObject *destroy; - int delargs; - int implicitconv; - PyTypeObject *pytype; -} SwigPyClientData; - -SWIGRUNTIMEINLINE int -SWIG_Python_CheckImplicit(swig_type_info *ty) -{ - SwigPyClientData *data = (SwigPyClientData *)ty->clientdata; - int fail = data ? data->implicitconv : 0; - if (fail) - PyErr_SetString(PyExc_TypeError, "Implicit conversion is prohibited for explicit constructors."); - return fail; -} - -SWIGRUNTIMEINLINE PyObject * -SWIG_Python_ExceptionType(swig_type_info *desc) { - SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0; - PyObject *klass = data ? data->klass : 0; - return (klass ? klass : PyExc_RuntimeError); -} - - -SWIGRUNTIME SwigPyClientData * -SwigPyClientData_New(PyObject* obj) -{ - if (!obj) { - return 0; - } else { - SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData)); - /* the klass element */ - data->klass = obj; - Py_INCREF(data->klass); - /* 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); - } 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); - } else { - data->newargs = obj; - } - Py_INCREF(data->newargs); - } - /* the destroy method, aka as the C++ delete method */ - data->destroy = PyObject_GetAttrString(data->klass, "__swig_destroy__"); - if (PyErr_Occurred()) { - PyErr_Clear(); - data->destroy = 0; - } - if (data->destroy) { - int flags; - Py_INCREF(data->destroy); - flags = PyCFunction_GET_FLAGS(data->destroy); - data->delargs = !(flags & (METH_O)); - } else { - data->delargs = 0; - } - data->implicitconv = 0; - data->pytype = 0; - return data; - } -} - -SWIGRUNTIME void -SwigPyClientData_Del(SwigPyClientData *data) { - Py_XDECREF(data->newraw); - Py_XDECREF(data->newargs); - Py_XDECREF(data->destroy); -} - -/* =============== SwigPyObject =====================*/ - -typedef struct { - PyObject_HEAD - void *ptr; - swig_type_info *ty; - int own; - PyObject *next; -#ifdef SWIGPYTHON_BUILTIN - PyObject *dict; -#endif -} SwigPyObject; - - -#ifdef SWIGPYTHON_BUILTIN - -SWIGRUNTIME PyObject * -SwigPyObject_get___dict__(PyObject *v, PyObject *SWIGUNUSEDPARM(args)) -{ - SwigPyObject *sobj = (SwigPyObject *)v; - - if (!sobj->dict) - sobj->dict = PyDict_New(); - - Py_INCREF(sobj->dict); - return sobj->dict; -} - -#endif - -SWIGRUNTIME PyObject * -SwigPyObject_long(SwigPyObject *v) -{ - return PyLong_FromVoidPtr(v->ptr); -} - -SWIGRUNTIME PyObject * -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); - if (ofmt) { -#if PY_VERSION_HEX >= 0x03000000 - res = PyUnicode_Format(ofmt,args); -#else - res = PyString_Format(ofmt,args); -#endif - Py_DECREF(ofmt); - } - Py_DECREF(args); - } - } - return res; -} - -SWIGRUNTIME PyObject * -SwigPyObject_oct(SwigPyObject *v) -{ - return SwigPyObject_format("%o",v); -} - -SWIGRUNTIME PyObject * -SwigPyObject_hex(SwigPyObject *v) -{ - return SwigPyObject_format("%x",v); -} - -SWIGRUNTIME PyObject * -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) { - PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next); -# if PY_VERSION_HEX >= 0x03000000 - PyObject *joined = PyUnicode_Concat(repr, nrep); - Py_DecRef(repr); - Py_DecRef(nrep); - repr = joined; -# else - PyString_ConcatAndDel(&repr,nrep); -# endif - } - return repr; -} - -/* We need a version taking two PyObject* parameters so it's a valid - * PyCFunction to use in swigobject_methods[]. */ -SWIGRUNTIME PyObject * -SwigPyObject_repr2(PyObject *v, PyObject *SWIGUNUSEDPARM(args)) -{ - return SwigPyObject_repr((SwigPyObject*)v); -} - -SWIGRUNTIME int -SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w) -{ - void *i = v->ptr; - void *j = w->ptr; - return (i < j) ? -1 : ((i > j) ? 1 : 0); -} - -/* Added for Python 3.x, would it also be useful for Python 2.x? */ -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; - } - res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0); - return res; -} - - -SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void); - -#ifdef SWIGPYTHON_BUILTIN -static swig_type_info *SwigPyObject_stype = 0; -SWIGRUNTIME PyTypeObject* -SwigPyObject_type(void) { - SwigPyClientData *cd; - assert(SwigPyObject_stype); - cd = (SwigPyClientData*) SwigPyObject_stype->clientdata; - assert(cd); - assert(cd->pytype); - return cd->pytype; -} -#else -SWIGRUNTIME PyTypeObject* -SwigPyObject_type(void) { - static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyObject_TypeOnce(); - return type; -} -#endif - -SWIGRUNTIMEINLINE int -SwigPyObject_Check(PyObject *op) { -#ifdef SWIGPYTHON_BUILTIN - PyTypeObject *target_tp = SwigPyObject_type(); - if (PyType_IsSubtype(op->ob_type, target_tp)) - return 1; - return (strcmp(op->ob_type->tp_name, "SwigPyObject") == 0); -#else - return (Py_TYPE(op) == SwigPyObject_type()) - || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0); -#endif -} - -SWIGRUNTIME PyObject * -SwigPyObject_New(void *ptr, swig_type_info *ty, int own); - -SWIGRUNTIME void -SwigPyObject_dealloc(PyObject *v) -{ - SwigPyObject *sobj = (SwigPyObject *) v; - PyObject *next = sobj->next; - if (sobj->own == SWIG_POINTER_OWN) { - swig_type_info *ty = sobj->ty; - SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; - PyObject *destroy = data ? data->destroy : 0; - if (destroy) { - /* destroy is always a VARARGS method */ - PyObject *res; - - /* PyObject_CallFunction() has the potential to silently drop - the active exception. In cases of unnamed temporary - variable or where we just finished iterating over a generator - StopIteration will be active right now, and this needs to - remain true upon return from SwigPyObject_dealloc. So save - and restore. */ - - PyObject *type = NULL, *value = NULL, *traceback = NULL; - PyErr_Fetch(&type, &value, &traceback); - - 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); - } else { - PyCFunction meth = PyCFunction_GET_FUNCTION(destroy); - PyObject *mself = PyCFunction_GET_SELF(destroy); - res = ((*meth)(mself, v)); - } - if (!res) - PyErr_WriteUnraisable(destroy); - - PyErr_Restore(type, value, traceback); - - Py_XDECREF(res); - } -#if !defined(SWIG_PYTHON_SILENT_MEMLEAK) - else { - const char *name = SWIG_TypePrettyName(ty); - printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown")); - } -#endif - } - Py_XDECREF(next); - PyObject_DEL(v); -} - -SWIGRUNTIME PyObject* -SwigPyObject_append(PyObject* v, PyObject* next) -{ - SwigPyObject *sobj = (SwigPyObject *) v; - if (!SwigPyObject_Check(next)) { - PyErr_SetString(PyExc_TypeError, "Attempt to append a non SwigPyObject"); - return NULL; - } - sobj->next = next; - Py_INCREF(next); - return SWIG_Py_Void(); -} - -SWIGRUNTIME PyObject* -SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) -{ - SwigPyObject *sobj = (SwigPyObject *) v; - if (sobj->next) { - Py_INCREF(sobj->next); - return sobj->next; - } else { - return SWIG_Py_Void(); - } -} - -SWIGINTERN PyObject* -SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) -{ - SwigPyObject *sobj = (SwigPyObject *)v; - sobj->own = 0; - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject* -SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) -{ - SwigPyObject *sobj = (SwigPyObject *)v; - sobj->own = SWIG_POINTER_OWN; - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject* -SwigPyObject_own(PyObject *v, PyObject *args) -{ - PyObject *val = 0; - if (!PyArg_UnpackTuple(args, "own", 0, 1, &val)) { - return NULL; - } else { - SwigPyObject *sobj = (SwigPyObject *)v; - PyObject *obj = PyBool_FromLong(sobj->own); - if (val) { - if (PyObject_IsTrue(val)) { - SwigPyObject_acquire(v,args); - } else { - SwigPyObject_disown(v,args); - } - } - return obj; - } -} - -static PyMethodDef -swigobject_methods[] = { - {"disown", SwigPyObject_disown, METH_NOARGS, "releases ownership of the pointer"}, - {"acquire", SwigPyObject_acquire, METH_NOARGS, "acquires ownership of the pointer"}, - {"own", SwigPyObject_own, METH_VARARGS, "returns/sets ownership of the pointer"}, - {"append", SwigPyObject_append, METH_O, "appends another 'this' object"}, - {"next", SwigPyObject_next, METH_NOARGS, "returns the next 'this' object"}, - {"__repr__",SwigPyObject_repr2, METH_NOARGS, "returns object representation"}, - {0, 0, 0, 0} -}; - -SWIGRUNTIME PyTypeObject* -SwigPyObject_TypeOnce(void) { - static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer"; - - static PyNumberMethods SwigPyObject_as_number = { - (binaryfunc)0, /*nb_add*/ - (binaryfunc)0, /*nb_subtract*/ - (binaryfunc)0, /*nb_multiply*/ - /* nb_divide removed in Python 3 */ -#if PY_VERSION_HEX < 0x03000000 - (binaryfunc)0, /*nb_divide*/ -#endif - (binaryfunc)0, /*nb_remainder*/ - (binaryfunc)0, /*nb_divmod*/ - (ternaryfunc)0,/*nb_power*/ - (unaryfunc)0, /*nb_negative*/ - (unaryfunc)0, /*nb_positive*/ - (unaryfunc)0, /*nb_absolute*/ - (inquiry)0, /*nb_nonzero*/ - 0, /*nb_invert*/ - 0, /*nb_lshift*/ - 0, /*nb_rshift*/ - 0, /*nb_and*/ - 0, /*nb_xor*/ - 0, /*nb_or*/ -#if PY_VERSION_HEX < 0x03000000 - 0, /*nb_coerce*/ -#endif - (unaryfunc)SwigPyObject_long, /*nb_int*/ -#if PY_VERSION_HEX < 0x03000000 - (unaryfunc)SwigPyObject_long, /*nb_long*/ -#else - 0, /*nb_reserved*/ -#endif - (unaryfunc)0, /*nb_float*/ -#if PY_VERSION_HEX < 0x03000000 - (unaryfunc)SwigPyObject_oct, /*nb_oct*/ - (unaryfunc)SwigPyObject_hex, /*nb_hex*/ -#endif -#if PY_VERSION_HEX >= 0x03050000 /* 3.5 */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_matrix_multiply */ -#elif PY_VERSION_HEX >= 0x03000000 /* 3.0 */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */ -#else - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */ -#endif - }; - - static PyTypeObject swigpyobject_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 - "SwigPyObject", /* tp_name */ - sizeof(SwigPyObject), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)SwigPyObject_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - (getattrfunc)0, /* tp_getattr */ - (setattrfunc)0, /* tp_setattr */ -#if PY_VERSION_HEX >= 0x03000000 - 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */ -#else - (cmpfunc)SwigPyObject_compare, /* tp_compare */ -#endif - (reprfunc)SwigPyObject_repr, /* tp_repr */ - &SwigPyObject_as_number, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)0, /* tp_hash */ - (ternaryfunc)0, /* tp_call */ - 0, /* tp_str */ - PyObject_GenericGetAttr, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - swigobject_doc, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)SwigPyObject_richcompare,/* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - swigobject_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - 0, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - 0, /* tp_free */ - 0, /* tp_is_gc */ - 0, /* tp_bases */ - 0, /* tp_mro */ - 0, /* tp_cache */ - 0, /* tp_subclasses */ - 0, /* 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 - }; - swigpyobject_type = tmp; - type_init = 1; - if (PyType_Ready(&swigpyobject_type) < 0) - return NULL; - } - return &swigpyobject_type; -} - -SWIGRUNTIME PyObject * -SwigPyObject_New(void *ptr, swig_type_info *ty, int own) -{ - SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type()); - if (sobj) { - sobj->ptr = ptr; - sobj->ty = ty; - sobj->own = own; - sobj->next = 0; - } - return (PyObject *)sobj; -} - -/* ----------------------------------------------------------------------------- - * Implements a simple Swig Packed type, and use it instead of string - * ----------------------------------------------------------------------------- */ - -typedef struct { - PyObject_HEAD - void *pack; - swig_type_info *ty; - size_t size; -} SwigPyPacked; - -SWIGRUNTIME PyObject * -SwigPyPacked_repr(SwigPyPacked *v) -{ - char result[SWIG_BUFFER_SIZE]; - if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) { - return SWIG_Python_str_FromFormat("", result, v->ty->name); - } else { - return SWIG_Python_str_FromFormat("", v->ty->name); - } -} - -SWIGRUNTIME PyObject * -SwigPyPacked_str(SwigPyPacked *v) -{ - char result[SWIG_BUFFER_SIZE]; - if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){ - return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name); - } else { - return SWIG_Python_str_FromChar(v->ty->name); - } -} - -SWIGRUNTIME int -SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w) -{ - size_t i = v->size; - size_t j = w->size; - int s = (i < j) ? -1 : ((i > j) ? 1 : 0); - return s ? s : strncmp((const char *)v->pack, (const char *)w->pack, 2*v->size); -} - -SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void); - -SWIGRUNTIME PyTypeObject* -SwigPyPacked_type(void) { - static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyPacked_TypeOnce(); - return type; -} - -SWIGRUNTIMEINLINE int -SwigPyPacked_Check(PyObject *op) { - return ((op)->ob_type == SwigPyPacked_TypeOnce()) - || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0); -} - -SWIGRUNTIME void -SwigPyPacked_dealloc(PyObject *v) -{ - if (SwigPyPacked_Check(v)) { - SwigPyPacked *sobj = (SwigPyPacked *) v; - free(sobj->pack); - } - PyObject_DEL(v); -} - -SWIGRUNTIME PyTypeObject* -SwigPyPacked_TypeOnce(void) { - static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer"; - static PyTypeObject swigpypacked_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 - "SwigPyPacked", /* tp_name */ - sizeof(SwigPyPacked), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)SwigPyPacked_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - (getattrfunc)0, /* tp_getattr */ - (setattrfunc)0, /* tp_setattr */ -#if PY_VERSION_HEX>=0x03000000 - 0, /* tp_reserved in 3.0.1 */ -#else - (cmpfunc)SwigPyPacked_compare, /* tp_compare */ -#endif - (reprfunc)SwigPyPacked_repr, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)0, /* tp_hash */ - (ternaryfunc)0, /* tp_call */ - (reprfunc)SwigPyPacked_str, /* tp_str */ - PyObject_GenericGetAttr, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - swigpacked_doc, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - 0, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - 0, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - 0, /* tp_free */ - 0, /* tp_is_gc */ - 0, /* tp_bases */ - 0, /* tp_mro */ - 0, /* tp_cache */ - 0, /* tp_subclasses */ - 0, /* 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 - }; - swigpypacked_type = tmp; - type_init = 1; - if (PyType_Ready(&swigpypacked_type) < 0) - return NULL; - } - return &swigpypacked_type; -} - -SWIGRUNTIME PyObject * -SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty) -{ - SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type()); - if (sobj) { - void *pack = malloc(size); - if (pack) { - memcpy(pack, ptr, size); - sobj->pack = pack; - sobj->ty = ty; - sobj->size = size; - } else { - PyObject_DEL((PyObject *) sobj); - sobj = 0; - } - } - return (PyObject *) sobj; -} - -SWIGRUNTIME swig_type_info * -SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size) -{ - if (SwigPyPacked_Check(obj)) { - SwigPyPacked *sobj = (SwigPyPacked *)obj; - if (sobj->size != size) return 0; - memcpy(ptr, sobj->pack, size); - return sobj->ty; - } else { - return 0; - } -} - -/* ----------------------------------------------------------------------------- - * pointers/data manipulation - * ----------------------------------------------------------------------------- */ - -static PyObject *Swig_This_global = NULL; - -SWIGRUNTIME PyObject * -SWIG_This(void) -{ - if (Swig_This_global == NULL) - Swig_This_global = SWIG_Python_str_FromChar("this"); - return Swig_This_global; -} - -/* #define SWIG_PYTHON_SLOW_GETSET_THIS */ - -/* TODO: I don't know how to implement the fast getset in Python 3 right now */ -#if PY_VERSION_HEX>=0x03000000 -#define SWIG_PYTHON_SLOW_GETSET_THIS -#endif - -SWIGRUNTIME SwigPyObject * -SWIG_Python_GetSwigThis(PyObject *pyobj) -{ - PyObject *obj; - - if (SwigPyObject_Check(pyobj)) - return (SwigPyObject *) pyobj; - -#ifdef SWIGPYTHON_BUILTIN - (void)obj; -# ifdef PyWeakref_CheckProxy - if (PyWeakref_CheckProxy(pyobj)) { - pyobj = PyWeakref_GET_OBJECT(pyobj); - if (pyobj && SwigPyObject_Check(pyobj)) - return (SwigPyObject*) pyobj; - } -# endif - return NULL; -#else - - obj = 0; - -#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS) - if (PyInstance_Check(pyobj)) { - obj = _PyInstance_Lookup(pyobj, SWIG_This()); - } else { - PyObject **dictptr = _PyObject_GetDictPtr(pyobj); - if (dictptr != NULL) { - PyObject *dict = *dictptr; - obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0; - } else { -#ifdef PyWeakref_CheckProxy - if (PyWeakref_CheckProxy(pyobj)) { - PyObject *wobj = PyWeakref_GET_OBJECT(pyobj); - return wobj ? SWIG_Python_GetSwigThis(wobj) : 0; - } -#endif - obj = PyObject_GetAttr(pyobj,SWIG_This()); - if (obj) { - Py_DECREF(obj); - } else { - if (PyErr_Occurred()) PyErr_Clear(); - return 0; - } - } - } -#else - obj = PyObject_GetAttr(pyobj,SWIG_This()); - if (obj) { - Py_DECREF(obj); - } else { - if (PyErr_Occurred()) PyErr_Clear(); - return 0; - } -#endif - if (obj && !SwigPyObject_Check(obj)) { - /* a PyObject is called 'this', try to get the 'real this' - SwigPyObject from it */ - return SWIG_Python_GetSwigThis(obj); - } - return (SwigPyObject *)obj; -#endif -} - -/* Acquire a pointer value */ - -SWIGRUNTIME int -SWIG_Python_AcquirePtr(PyObject *obj, int own) { - if (own == SWIG_POINTER_OWN) { - SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj); - if (sobj) { - int oldown = sobj->own; - sobj->own = own; - return oldown; - } - } - return 0; -} - -/* Convert a pointer value */ - -SWIGRUNTIME int -SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) { - int res; - SwigPyObject *sobj; - int implicit_conv = (flags & SWIG_POINTER_IMPLICIT_CONV) != 0; - - if (!obj) - return SWIG_ERROR; - if (obj == Py_None && !implicit_conv) { - if (ptr) - *ptr = 0; - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - } - - res = SWIG_ERROR; - - sobj = SWIG_Python_GetSwigThis(obj); - if (own) - *own = 0; - while (sobj) { - void *vptr = sobj->ptr; - if (ty) { - swig_type_info *to = sobj->ty; - if (to == ty) { - /* no type cast needed */ - if (ptr) *ptr = vptr; - break; - } else { - swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); - if (!tc) { - sobj = (SwigPyObject *)sobj->next; - } else { - if (ptr) { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc,vptr,&newmemory); - if (newmemory == SWIG_CAST_NEW_MEMORY) { - assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */ - if (own) - *own = *own | SWIG_CAST_NEW_MEMORY; - } - } - break; - } - } - } else { - if (ptr) *ptr = vptr; - break; - } - } - if (sobj) { - if (own) - *own = *own | sobj->own; - if (flags & SWIG_POINTER_DISOWN) { - sobj->own = 0; - } - res = SWIG_OK; - } else { - if (implicit_conv) { - SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; - if (data && !data->implicitconv) { - PyObject *klass = data->klass; - if (klass) { - PyObject *impconv; - data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/ - impconv = SWIG_Python_CallFunctor(klass, obj); - data->implicitconv = 0; - if (PyErr_Occurred()) { - PyErr_Clear(); - impconv = 0; - } - if (impconv) { - SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv); - if (iobj) { - void *vptr; - res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0); - if (SWIG_IsOK(res)) { - if (ptr) { - *ptr = vptr; - /* transfer the ownership to 'ptr' */ - iobj->own = 0; - res = SWIG_AddCast(res); - res = SWIG_AddNewMask(res); - } else { - res = SWIG_AddCast(res); - } - } - } - Py_DECREF(impconv); - } - } - } - if (!SWIG_IsOK(res) && obj == Py_None) { - if (ptr) - *ptr = 0; - if (PyErr_Occurred()) - PyErr_Clear(); - res = SWIG_OK; - } - } - } - return res; -} - -/* Convert a function ptr value */ - -SWIGRUNTIME int -SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) { - if (!PyCFunction_Check(obj)) { - return SWIG_ConvertPtr(obj, ptr, ty, 0); - } else { - void *vptr = 0; - swig_cast_info *tc; - - /* here we get the method pointer for callbacks */ - const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); - const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0; - if (desc) - desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0; - if (!desc) - return SWIG_ERROR; - tc = SWIG_TypeCheck(desc,ty); - if (tc) { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc,vptr,&newmemory); - assert(!newmemory); /* newmemory handling not yet implemented */ - } else { - return SWIG_ERROR; - } - return SWIG_OK; - } -} - -/* Convert a packed pointer value */ - -SWIGRUNTIME int -SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) { - swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz); - if (!to) return SWIG_ERROR; - if (ty) { - if (to != ty) { - /* check type cast? */ - swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); - if (!tc) return SWIG_ERROR; - } - } - return SWIG_OK; -} - -/* ----------------------------------------------------------------------------- - * Create a new pointer object - * ----------------------------------------------------------------------------- */ - -/* - Create a new instance object, without calling __init__, and set the - 'this' attribute. -*/ - -SWIGRUNTIME PyObject* -SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) -{ - PyObject *inst = 0; - PyObject *newraw = data->newraw; - if (newraw) { - inst = PyObject_Call(newraw, data->newargs, NULL); - if (inst) { -#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); - } - } -#else - PyObject *key = SWIG_This(); - PyObject_SetAttr(inst, key, swig_this); -#endif - } - } else { -#if PY_VERSION_HEX >= 0x03000000 - PyObject *empty_args = PyTuple_New(0); - if (empty_args) { - PyObject *empty_kwargs = PyDict_New(); - if (empty_kwargs) { - inst = ((PyTypeObject *)data->newargs)->tp_new((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; - } - } - Py_DECREF(empty_args); - } -#else - PyObject *dict = PyDict_New(); - if (dict) { - PyDict_SetItem(dict, SWIG_This(), swig_this); - inst = PyInstance_NewRaw(data->newargs, dict); - Py_DECREF(dict); - } -#endif - } - return inst; -} - -SWIGRUNTIME void -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; - } -#endif - dict = PyObject_GetAttrString(inst, "__dict__"); - PyDict_SetItem(dict, SWIG_This(), swig_this); - Py_DECREF(dict); -} - - -SWIGINTERN PyObject * -SWIG_Python_InitShadowInstance(PyObject *args) { - PyObject *obj[2]; - if (!SWIG_Python_UnpackTuple(args, "swiginit", 2, 2, obj)) { - return NULL; - } else { - SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]); - if (sthis) { - SwigPyObject_append((PyObject*) sthis, obj[1]); - } else { - SWIG_Python_SetSwigThis(obj[0], obj[1]); - } - return SWIG_Py_Void(); - } -} - -/* Create a new pointer object */ - -SWIGRUNTIME PyObject * -SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags) { - SwigPyClientData *clientdata; - PyObject * robj; - int own; - - if (!ptr) - return SWIG_Py_Void(); - - clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0; - own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0; - if (clientdata && clientdata->pytype) { - SwigPyObject *newobj; - if (flags & SWIG_BUILTIN_TP_INIT) { - newobj = (SwigPyObject*) self; - if (newobj->ptr) { - PyObject *next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0); - while (newobj->next) - newobj = (SwigPyObject *) newobj->next; - newobj->next = next_self; - newobj = (SwigPyObject *)next_self; -#ifdef SWIGPYTHON_BUILTIN - newobj->dict = 0; -#endif - } - } else { - newobj = PyObject_New(SwigPyObject, clientdata->pytype); -#ifdef SWIGPYTHON_BUILTIN - newobj->dict = 0; -#endif - } - if (newobj) { - newobj->ptr = ptr; - newobj->ty = type; - newobj->own = own; - newobj->next = 0; - return (PyObject*) newobj; - } - return SWIG_Py_Void(); - } - - assert(!(flags & SWIG_BUILTIN_TP_INIT)); - - robj = SwigPyObject_New(ptr, type, own); - if (robj && clientdata && !(flags & SWIG_POINTER_NOSHADOW)) { - PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj); - Py_DECREF(robj); - robj = inst; - } - return robj; -} - -/* Create a new packed object */ - -SWIGRUNTIMEINLINE PyObject * -SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) { - return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void(); -} - -/* -----------------------------------------------------------------------------* - * Get type list - * -----------------------------------------------------------------------------*/ - -#ifdef SWIG_LINK_RUNTIME -void *SWIG_ReturnGlobalTypeList(void *); -#endif - -SWIGRUNTIME swig_module_info * -SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata)) { - 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 - } - return (swig_module_info *) type_pointer; -} - -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; - for (i =0; i < swig_module->size; ++i) { - swig_type_info *ty = types[i]; - if (ty->owndata) { - SwigPyClientData *data = (SwigPyClientData *) ty->clientdata; - if (data) SwigPyClientData_Del(data); - } - } - Py_DECREF(SWIG_This()); - Swig_This_global = NULL; -} - -SWIGRUNTIME void -SWIG_Python_SetModule(swig_module_info *swig_module) { -#if PY_VERSION_HEX >= 0x03000000 - /* Add a dummy module object into sys.modules */ - PyObject *module = PyImport_AddModule("swig_runtime_data" SWIG_RUNTIME_VERSION); -#else - static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} }; /* Sentinel */ - PyObject *module = Py_InitModule("swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table); -#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); - } 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) -{ - PyObject *cache = SWIG_Python_TypeCache(); - PyObject *key = SWIG_Python_str_FromChar(type); - PyObject *obj = PyDict_GetItem(cache, key); - swig_type_info *descriptor; - if (obj) { - descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, NULL); - } else { - swig_module_info *swig_module = SWIG_GetModule(0); - 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); - } - } - Py_DECREF(key); - return descriptor; -} - -/* - For backward compatibility only -*/ -#define SWIG_POINTER_EXCEPTION 0 -#define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg) -#define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags) - -SWIGRUNTIME int -SWIG_Python_AddErrMesg(const char* mesg, int infront) -{ - if (PyErr_Occurred()) { - PyObject *type = 0; - PyObject *value = 0; - PyObject *traceback = 0; - PyErr_Fetch(&type, &value, &traceback); - if (value) { - PyObject *old_str = PyObject_Str(value); - const char *tmp = SWIG_Python_str_AsChar(old_str); - const char *errmesg = tmp ? tmp : "Invalid error message"; - Py_XINCREF(type); - PyErr_Clear(); - if (infront) { - PyErr_Format(type, "%s %s", mesg, errmesg); - } else { - PyErr_Format(type, "%s %s", errmesg, mesg); - } - SWIG_Python_str_DelForPy3(tmp); - Py_DECREF(old_str); - } - return 1; - } else { - return 0; - } -} - -SWIGRUNTIME int -SWIG_Python_ArgFail(int argnum) -{ - if (PyErr_Occurred()) { - /* add information about failing argument */ - char mesg[256]; - PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum); - return SWIG_Python_AddErrMesg(mesg, 1); - } else { - return 0; - } -} - -SWIGRUNTIMEINLINE const char * -SwigPyObject_GetDesc(PyObject *self) -{ - SwigPyObject *v = (SwigPyObject *)self; - swig_type_info *ty = v ? v->ty : 0; - return ty ? ty->str : ""; -} - -SWIGRUNTIME void -SWIG_Python_TypeError(const char *type, PyObject *obj) -{ - if (type) { -#if defined(SWIG_COBJECT_TYPES) - if (obj && SwigPyObject_Check(obj)) { - const char *otype = (const char *) SwigPyObject_GetDesc(obj); - if (otype) { - PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received", - type, otype); - return; - } - } else -#endif - { - 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; - 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(str); - return; - } - } - PyErr_Format(PyExc_TypeError, "a '%s' is expected", type); - } else { - PyErr_Format(PyExc_TypeError, "unexpected type is received"); - } -} - - -/* Convert a pointer value, signal an exception on a type mismatch */ -SWIGRUNTIME void * -SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags) { - 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; -} - -#ifdef SWIGPYTHON_BUILTIN -SWIGRUNTIME int -SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { - PyTypeObject *tp = obj->ob_type; - PyObject *descr; - PyObject *encoded_name; - descrsetfunc f; - int res = -1; - -# ifdef Py_USING_UNICODE - if (PyString_Check(name)) { - name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL); - if (!name) - return -1; - } else if (!PyUnicode_Check(name)) -# else - if (!PyString_Check(name)) -# endif - { - PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name); - return -1; - } else { - Py_INCREF(name); - } - - if (!tp->tp_dict) { - if (PyType_Ready(tp) < 0) - goto done; - } - - descr = _PyType_Lookup(tp, name); - f = NULL; - if (descr != NULL) - f = descr->ob_type->tp_descr_set; - if (!f) { - if (PyString_Check(name)) { - encoded_name = name; - Py_INCREF(name); - } else { - encoded_name = PyUnicode_AsUTF8String(name); - if (!encoded_name) - return -1; - } - PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name)); - Py_DECREF(encoded_name); - } else { - res = f(descr, obj, value); - } - - done: - Py_DECREF(name); - return res; -} -#endif - - -#ifdef __cplusplus -} -#endif - - - -#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); - -#ifdef __cplusplus -} -#endif - - - #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0) - - -/* -------- TYPES TABLE (BEGIN) -------- */ - -#define SWIGTYPE_p_blpapi_AbstractSession swig_types[0] -#define SWIGTYPE_p_blpapi_AuthApplication swig_types[1] -#define SWIGTYPE_p_blpapi_AuthOptions swig_types[2] -#define SWIGTYPE_p_blpapi_AuthToken swig_types[3] -#define SWIGTYPE_p_blpapi_AuthUser swig_types[4] -#define SWIGTYPE_p_blpapi_Constant swig_types[5] -#define SWIGTYPE_p_blpapi_ConstantList swig_types[6] -#define SWIGTYPE_p_blpapi_CorrelationId_t_ swig_types[7] -#define SWIGTYPE_p_blpapi_CorrelationId_t__value swig_types[8] -#define SWIGTYPE_p_blpapi_Datetime_tag swig_types[9] -#define SWIGTYPE_p_blpapi_Element swig_types[10] -#define SWIGTYPE_p_blpapi_Event swig_types[11] -#define SWIGTYPE_p_blpapi_EventDispatcher swig_types[12] -#define SWIGTYPE_p_blpapi_EventFormatter swig_types[13] -#define SWIGTYPE_p_blpapi_EventQueue swig_types[14] -#define SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag swig_types[15] -#define SWIGTYPE_p_blpapi_Identity swig_types[16] -#define SWIGTYPE_p_blpapi_Logging_Func_t swig_types[17] -#define SWIGTYPE_p_blpapi_Logging_Severity_t swig_types[18] -#define SWIGTYPE_p_blpapi_ManagedPtr_t_ swig_types[19] -#define SWIGTYPE_p_blpapi_Message swig_types[20] -#define SWIGTYPE_p_blpapi_MessageFormatter swig_types[21] -#define SWIGTYPE_p_blpapi_MessageIterator swig_types[22] -#define SWIGTYPE_p_blpapi_MessageProperties swig_types[23] -#define SWIGTYPE_p_blpapi_Name swig_types[24] -#define SWIGTYPE_p_blpapi_Operation swig_types[25] -#define SWIGTYPE_p_blpapi_ProviderSession swig_types[26] -#define SWIGTYPE_p_blpapi_Request swig_types[27] -#define SWIGTYPE_p_blpapi_RequestTemplate swig_types[28] -#define SWIGTYPE_p_blpapi_ResolutionList swig_types[29] -#define SWIGTYPE_p_blpapi_SchemaElementDefinition swig_types[30] -#define SWIGTYPE_p_blpapi_Service swig_types[31] -#define SWIGTYPE_p_blpapi_ServiceRegistrationOptions swig_types[32] -#define SWIGTYPE_p_blpapi_Session swig_types[33] -#define SWIGTYPE_p_blpapi_SessionOptions swig_types[34] -#define SWIGTYPE_p_blpapi_Socks5Config swig_types[35] -#define SWIGTYPE_p_blpapi_StreamWriter_t swig_types[36] -#define SWIGTYPE_p_blpapi_SubscriptionItrerator swig_types[37] -#define SWIGTYPE_p_blpapi_SubscriptionList swig_types[38] -#define SWIGTYPE_p_blpapi_TimePoint swig_types[39] -#define SWIGTYPE_p_blpapi_TlsOptions swig_types[40] -#define SWIGTYPE_p_blpapi_Topic swig_types[41] -#define SWIGTYPE_p_blpapi_TopicList swig_types[42] -#define SWIGTYPE_p_char swig_types[43] -#define SWIGTYPE_p_double swig_types[44] -#define SWIGTYPE_p_f_p_q_const__struct_blpapi_CorrelationId_t__p_q_const__char_int_p_q_const__char_p_void__void swig_types[45] -#define SWIGTYPE_p_f_p_struct_blpapi_Event_p_struct_blpapi_ProviderSession_p_void__void swig_types[46] -#define SWIGTYPE_p_float swig_types[47] -#define SWIGTYPE_p_int swig_types[48] -#define SWIGTYPE_p_intArray swig_types[49] -#define SWIGTYPE_p_long_long swig_types[50] -#define SWIGTYPE_p_p_blpapi_AuthApplication swig_types[51] -#define SWIGTYPE_p_p_blpapi_AuthOptions swig_types[52] -#define SWIGTYPE_p_p_blpapi_AuthToken swig_types[53] -#define SWIGTYPE_p_p_blpapi_AuthUser swig_types[54] -#define SWIGTYPE_p_p_blpapi_Element swig_types[55] -#define SWIGTYPE_p_p_blpapi_Event swig_types[56] -#define SWIGTYPE_p_p_blpapi_Identity swig_types[57] -#define SWIGTYPE_p_p_blpapi_Message swig_types[58] -#define SWIGTYPE_p_p_blpapi_MessageFormatter swig_types[59] -#define SWIGTYPE_p_p_blpapi_MessageProperties swig_types[60] -#define SWIGTYPE_p_p_blpapi_Name swig_types[61] -#define SWIGTYPE_p_p_blpapi_Operation swig_types[62] -#define SWIGTYPE_p_p_blpapi_Request swig_types[63] -#define SWIGTYPE_p_p_blpapi_RequestTemplate swig_types[64] -#define SWIGTYPE_p_p_blpapi_SchemaElementDefinition swig_types[65] -#define SWIGTYPE_p_p_blpapi_Service swig_types[66] -#define SWIGTYPE_p_p_blpapi_Topic swig_types[67] -#define SWIGTYPE_p_p_char swig_types[68] -#define SWIGTYPE_p_p_void swig_types[69] -#define SWIGTYPE_p_short swig_types[70] -#define SWIGTYPE_p_size_t swig_types[71] -#define SWIGTYPE_p_unsigned_char swig_types[72] -#define SWIGTYPE_p_unsigned_int swig_types[73] -#define SWIGTYPE_p_unsigned_long_long swig_types[74] -#define SWIGTYPE_p_unsigned_short swig_types[75] -static swig_type_info *swig_types[77]; -static swig_module_info swig_module = {swig_types, 76, 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) - -/* -------- TYPES TABLE (END) -------- */ - -#ifdef SWIG_TypeQuery -# undef SWIG_TypeQuery -#endif -#define SWIG_TypeQuery SWIG_Python_TypeQuery - -/*----------------------------------------------- - @(target):= _internals.so - ------------------------------------------------*/ -#if PY_VERSION_HEX >= 0x03000000 -# define SWIG_init PyInit__internals - -#else -# define SWIG_init init_internals - -#endif -#define SWIG_name "_internals" - -#define SWIGVERSION 0x040001 -#define SWIG_VERSION SWIGVERSION - - -#define SWIG_as_voidptr(a) (void *)((const void *)(a)) -#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a)) - - -#define SWIG_FILE_WITH_INIT -#include "blpapi_types.h" - - -SWIGINTERNINLINE PyObject* - SWIG_From_unsigned_SS_int (unsigned int value) -{ - return PyInt_FromSize_t((size_t) value); -} - - - #define SWIG_From_long PyInt_FromLong - - -SWIGINTERNINLINE PyObject* -SWIG_From_unsigned_SS_long (unsigned long value) -{ - return (value > LONG_MAX) ? - PyLong_FromUnsignedLong(value) : PyInt_FromLong((long)(value)); -} - - -#include -#if !defined(SWIG_NO_LLONG_MAX) -# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__) -# define LLONG_MAX __LONG_LONG_MAX__ -# define LLONG_MIN (-LLONG_MAX - 1LL) -# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL) -# endif -#endif - - -#if defined(LLONG_MAX) && !defined(SWIG_LONG_LONG_AVAILABLE) -# define SWIG_LONG_LONG_AVAILABLE -#endif - - -#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE PyObject* -SWIG_From_unsigned_SS_long_SS_long (unsigned long long value) -{ - return (value > LONG_MAX) ? - PyLong_FromUnsignedLongLong(value) : PyInt_FromLong((long)(value)); -} -#endif - - -SWIGINTERNINLINE PyObject * -SWIG_From_size_t (size_t value) -{ -#ifdef SWIG_LONG_LONG_AVAILABLE - if (sizeof(size_t) <= sizeof(unsigned long)) { -#endif - return SWIG_From_unsigned_SS_long ((unsigned long)(value)); -#ifdef SWIG_LONG_LONG_AVAILABLE - } else { - /* assume sizeof(size_t) <= sizeof(unsigned long long) */ - return SWIG_From_unsigned_SS_long_SS_long ((unsigned long long)(value)); - } -#endif -} - - -SWIGINTERNINLINE PyObject* - SWIG_From_int (int value) -{ - return PyInt_FromLong((long) value); -} - - -#include "blpapi_authoptions.h" -#include "blpapi_constant.h" -#include "blpapi_datetime.h" -#include "blpapi_diagnosticsutil.h" -#include "blpapi_element.h" -#include "blpapi_error.h" -#include "blpapi_event.h" -#include "blpapi_eventdispatcher.h" -#include "blpapi_highresolutionclock.h" -#include "blpapi_identity.h" -#include "blpapi_logging.h" -#include "blpapi_message.h" -#include "blpapi_messageformatter.h" -#include "blpapi_name.h" -#include "blpapi_request.h" -#include "blpapi_schema.h" -#include "blpapi_service.h" -#include "blpapi_session.h" -#include "blpapi_sessionoptions.h" -#include "blpapi_streamproxy.h" -#include "blpapi_subscriptionlist.h" -#include "blpapi_timepoint.h" -#include "blpapi_testutil.h" -#include "blpapi_zfputil.h" - -// publishing support -#include "blpapi_eventformatter.h" -#include "blpapi_providersession.h" -#include "blpapi_resolutionlist.h" -#include "blpapi_topic.h" -#include "blpapi_topiclist.h" - - -#ifndef MAX_GROUP_ID_SIZE -// MAX_GROUP_ID_SIZE is not defined in BLPAPI, but docs say its value is 64 -#define MAX_GROUP_ID_SIZE 64 -#endif - -#include // for malloc() and free() -#include // for strncpy() - -typedef struct StreamWriterData { - char *stream; - int size; -} StreamWriterData; - - -// this is the signature dictated by C layer -// we are going to hijack the length and populate .size in streamData -// to allow guiding python to array+size rather than 0-terminated option -int cstr_StreamWriter(const char *data, int length, void *streamData) -{ - StreamWriterData *stream = (StreamWriterData*) streamData; - char *dest = (char *) malloc(length); - if (dest == 0) { - return 1; - } - memcpy(dest, data, length); - stream->stream = dest; - stream->size = length; - return 0; -} - -// in all printHelper functions if C layer fails to produce a string -// we shall return a null-pointer and 0-size to SWIG layer, -// which is going to treat it correctly -void blpapi_Service_printHelper( - blpapi_Service_t *service, - int level, - int spacesPerLevel, - char **output_allocated, - int *output_size) -{ - StreamWriterData stream = {0}; - blpapi_Service_print( - service, - cstr_StreamWriter, - &stream, - level, - spacesPerLevel); - *output_allocated = stream.stream; - *output_size = stream.size; -} - -void blpapi_SchemaElementDefinition_printHelper( - blpapi_SchemaElementDefinition_t *item, - int level, - int spacesPerLevel, - char **output_allocated, - int *output_size) -{ - StreamWriterData stream = {0}; - blpapi_SchemaElementDefinition_print( - item, - cstr_StreamWriter, - &stream, - level, - spacesPerLevel); - *output_allocated = stream.stream; - *output_size = stream.size; -} - -void blpapi_SchemaTypeDefinition_printHelper( - blpapi_SchemaTypeDefinition_t *item, - int level, - int spacesPerLevel, - char **output_allocated, - int *output_size) -{ - StreamWriterData stream = {0}; - blpapi_SchemaTypeDefinition_print( - item, - cstr_StreamWriter, - &stream, - level, - spacesPerLevel); - *output_allocated = stream.stream; - *output_size = stream.size; -} - -void blpapi_Message_printHelper( - blpapi_Message_t *message, - int level, - int spacesPerLevel, - char **output_allocated, - int *output_size) -{ - StreamWriterData stream = {0}; - blpapi_Message_print( - message, - cstr_StreamWriter, - &stream, - level, - spacesPerLevel); - *output_allocated = stream.stream; - *output_size = stream.size; -} - -void blpapi_SessionOptions_printHelper( - blpapi_SessionOptions_t *sessionOptions, - int level, - int spacesPerLevel, - char **output_allocated, - int *output_size) -{ - StreamWriterData stream = {0}; - blpapi_SessionOptions_print( - sessionOptions, - cstr_StreamWriter, - &stream, - level, - spacesPerLevel); - *output_allocated = stream.stream; - *output_size = stream.size; -} - -void blpapi_Socks5Config_printHelper( - blpapi_Socks5Config_t *socks5Config, - int level, - int spacesPerLevel, - char **output_allocated, - int *output_size) -{ - StreamWriterData stream = {0}; - blpapi_Socks5Config_print( - socks5Config, - cstr_StreamWriter, - &stream, - level, - spacesPerLevel); - *output_allocated = stream.stream; - *output_size = stream.size; -} - -void blpapi_TestUtil_serializeServiceHelper( - blpapi_Service_t *service, - char **output_allocated, - int *output_size) -{ - StreamWriterData stream = {0}; - blpapi_TestUtil_serializeService( - cstr_StreamWriter, - &stream, - service); - *output_allocated = stream.stream; - *output_size = stream.size; -} - -int blpapi_SchemaTypeDefinition_hasElementDefinition( - const blpapi_SchemaTypeDefinition_t *type, - const char *nameString, - const blpapi_Name_t *name) -{ - return 0 != blpapi_SchemaTypeDefinition_getElementDefinition( - type, nameString, name); -} - -int blpapi_ConstantList_hasConstant( - const blpapi_ConstantList_t *list, - const char *nameString, - const blpapi_Name_t *name) -{ - return 0 != blpapi_ConstantList_getConstant(list, nameString, name); -} - -int blpapi_Service_hasEventDefinition( - blpapi_Service_t *service, - const char* nameString, - const blpapi_Name_t *name) -{ - blpapi_SchemaElementDefinition_t *eventDefinition; - - return 0 == blpapi_Service_getEventDefinition( - service, &eventDefinition, nameString, name); -} - -int blpapi_Service_hasOperation( - blpapi_Service_t *service, - const char* nameString, - const blpapi_Name_t *name) -{ - blpapi_Operation_t *operation; - - return 0 == blpapi_Service_getOperation( - service, &operation, nameString, name); -} - -int blpapi_SubscriptionList_addHelper( - blpapi_SubscriptionList_t *list, - const char *topic, - const blpapi_CorrelationId_t *correlationId, - const char *fields, - const char *options) -{ - return blpapi_SubscriptionList_add( - list, - topic, - correlationId, - &fields, - &options, - fields ? 1 : 0, - options ? 1: 0); -} - -int blpapi_Name_hasName(const char *nameString) -{ - return blpapi_Name_findName(nameString) ? 1 : 0; -} - -blpapi_TopicList_t* blpapi_TopicList_createFromResolutionList( - blpapi_ResolutionList_t* from) -{ - return blpapi_TopicList_create((blpapi_TopicList_t*) (from)); -} - -PyObject *blpapi_DiagnosticsUtil_memoryInfo_wrapper() -{ - // Get the length of the buffer first - int len = blpapi_DiagnosticsUtil_memoryInfo(0, 0); - int buffer_length; - char *buffer; - PyObject *diagnostics_str; - - if (len < 0) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - PyErr_SetString(PyExc_RuntimeError, "blpapi_DiagnosticsUtil_memoryInfo error"); - SWIG_PYTHON_THREAD_END_BLOCK; - return NULL; - } - - buffer_length = len + 1; - buffer = (char *) malloc(buffer_length); - blpapi_DiagnosticsUtil_memoryInfo(buffer, buffer_length); - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - diagnostics_str = PyString_FromString(buffer); - SWIG_PYTHON_THREAD_END_BLOCK; - free(buffer); - - return diagnostics_str; -} - -// Shared global object guarded by GIL -PyObject* loggerCallback = 0; - -void loggerCallbackWrapper(blpapi_UInt64_t threadId, - int severity, - blpapi_Datetime_t original, - const char *category, - const char *message) -{ - PyGILState_STATE gilstate = PyGILState_Ensure(); - blpapi_Datetime_t *outputPtr; - PyObject *datetime_obj; - PyObject* result; - - // This snippet was inspired by the code generated for SWIG to handle - // `_wrap_blpapi_Element_getValueAsDatetime`. - outputPtr = (blpapi_Datetime_t *) malloc(sizeof(blpapi_Datetime_t)); - *outputPtr = original; - datetime_obj = SWIG_NewPointerObj(outputPtr, SWIGTYPE_p_blpapi_Datetime_tag, SWIG_POINTER_OWN); - - // "KiOss" below follow the format for `Py_BuildValue` strings. - // https://docs.python.org/3/c-api/arg.html#c.Py_BuildValue - result = PyObject_CallFunction(loggerCallback, "KiOss", threadId, severity, - datetime_obj, category, message); - - Py_XDECREF(result); - Py_CLEAR(datetime_obj); - PyGILState_Release(gilstate); -} - -int setLoggerCallbackWrapper(PyObject *cb, int severity) -{ - int err; - - if (!PyCallable_Check(cb)) { - if(cb != Py_None) { - return -1; - } - } - - loggerCallback = cb; - // Set actual callback - if (cb != Py_None) { - err = blpapi_Logging_registerCallback( - &loggerCallbackWrapper, (blpapi_Logging_Severity_t)severity); - } - else { - err = blpapi_Logging_registerCallback( - 0, (blpapi_Logging_Severity_t)severity); - } - if (err != 0) { - return -2; - } - - return 0; -} - -/** Convert `blpapi_TimePoint_t` value to `blpapi_HighPrecisionDatetime_t`. Function - * always returns UTC time. - */ -blpapi_HighPrecisionDatetime_t blpapi_HighPrecisionDatetime_fromTimePoint_wrapper(blpapi_TimePoint_t original) -{ - blpapi_HighPrecisionDatetime_t highPrecisionDatetime; - - blpapi_HighPrecisionDatetime_fromTimePoint( - &highPrecisionDatetime, - &original, - 0); - - return highPrecisionDatetime; -} - - -SWIGINTERN int -SWIG_AsVal_double (PyObject *obj, double *val) -{ - int res = SWIG_TypeError; - if (PyFloat_Check(obj)) { - if (val) *val = PyFloat_AsDouble(obj); - return SWIG_OK; -#if PY_VERSION_HEX < 0x03000000 - } else if (PyInt_Check(obj)) { - if (val) *val = (double) PyInt_AsLong(obj); - return SWIG_OK; -#endif - } else if (PyLong_Check(obj)) { - double v = PyLong_AsDouble(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_OK; - } else { - PyErr_Clear(); - } - } -#ifdef SWIG_PYTHON_CAST_MODE - { - int dispatch = 0; - double d = PyFloat_AsDouble(obj); - if (!PyErr_Occurred()) { - if (val) *val = d; - return SWIG_AddCast(SWIG_OK); - } else { - PyErr_Clear(); - } - if (!dispatch) { - long v = PyLong_AsLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_AddCast(SWIG_AddCast(SWIG_OK)); - } else { - PyErr_Clear(); - } - } - } -#endif - return res; -} - - -#include - - -#include - - -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 */ - if ((errno == EDOM) || (errno == ERANGE)) { - errno = 0; - } else { - double summ, reps, diff; - if (rd < x) { - diff = x - rd; - } else if (rd > x) { - diff = rd - x; - } else { - return 1; - } - summ = rd + x; - reps = diff/summ; - if (reps < 8*DBL_EPSILON) { - *d = rd; - return 1; - } - } - } - return 0; -} - - -SWIGINTERN int -SWIG_AsVal_long (PyObject *obj, long* val) -{ -#if PY_VERSION_HEX < 0x03000000 - if (PyInt_Check(obj)) { - if (val) *val = PyInt_AsLong(obj); - return SWIG_OK; - } else -#endif - if (PyLong_Check(obj)) { - long v = PyLong_AsLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_OK; - } else { - PyErr_Clear(); - return SWIG_OverflowError; - } - } -#ifdef SWIG_PYTHON_CAST_MODE - { - int dispatch = 0; - long v = PyInt_AsLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_AddCast(SWIG_OK); - } else { - PyErr_Clear(); - } - if (!dispatch) { - double d; - int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d)); - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) { - if (val) *val = (long)(d); - return res; - } - } - } -#endif - return SWIG_TypeError; -} - - -SWIGINTERN int -SWIG_AsVal_int (PyObject * obj, int *val) -{ - long v; - int res = SWIG_AsVal_long (obj, &v); - if (SWIG_IsOK(res)) { - if ((v < INT_MIN || v > INT_MAX)) { - return SWIG_OverflowError; - } else { - if (val) *val = (int)(v); - } - } - return res; -} - - -SWIGINTERN swig_type_info* -SWIG_pchar_descriptor(void) -{ - static int init = 0; - static swig_type_info* info = 0; - if (!init) { - info = SWIG_TypeQuery("_p_char"); - init = 1; - } - return info; -} - - -SWIGINTERNINLINE PyObject * -SWIG_FromCharPtrAndSize(const char* carray, size_t size) -{ - if (carray) { - if (size > INT_MAX) { - swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - return pchar_descriptor ? - SWIG_InternalNewPointerObj((char *)(carray), pchar_descriptor, 0) : SWIG_Py_Void(); - } else { -#if PY_VERSION_HEX >= 0x03000000 -#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) - return PyBytes_FromStringAndSize(carray, (Py_ssize_t)(size)); -#else - return PyUnicode_DecodeUTF8(carray, (Py_ssize_t)(size), "surrogateescape"); -#endif -#else - return PyString_FromStringAndSize(carray, (Py_ssize_t)(size)); -#endif - } - } else { - return SWIG_Py_Void(); - } -} - - -SWIGINTERN int -SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) -{ -#if PY_VERSION_HEX>=0x03000000 -#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) - if (PyBytes_Check(obj)) -#else - if (PyUnicode_Check(obj)) -#endif -#else - if (PyString_Check(obj)) -#endif - { - char *cstr; Py_ssize_t len; - 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); -#else - PyString_AsStringAndSize(obj, &cstr, &len); -#endif - if (cptr) { - if (alloc) { - if (*alloc == SWIG_NEWOBJ) { - *cptr = (char *)memcpy(malloc((len + 1)*sizeof(char)), cstr, sizeof(char)*(len + 1)); - *alloc = SWIG_NEWOBJ; - } else { - *cptr = cstr; - *alloc = SWIG_OLDOBJ; - } - } 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 - } - } - if (psize) *psize = len + 1; -#if PY_VERSION_HEX>=0x03000000 && !defined(SWIG_PYTHON_STRICT_BYTE_CHAR) - Py_XDECREF(obj); -#endif - return ret; - } else { -#if defined(SWIG_PYTHON_2_UNICODE) -#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) -#error "Cannot use both SWIG_PYTHON_2_UNICODE and SWIG_PYTHON_STRICT_BYTE_CHAR at once" -#endif -#if PY_VERSION_HEX<0x03000000 - if (PyUnicode_Check(obj)) { - char *cstr; Py_ssize_t len; - if (!alloc && cptr) { - return SWIG_RuntimeError; - } - obj = PyUnicode_AsUTF8String(obj); - if (!obj) - return SWIG_TypeError; - if (PyString_AsStringAndSize(obj, &cstr, &len) != -1) { - if (cptr) { - if (alloc) *alloc = SWIG_NEWOBJ; - *cptr = (char *)memcpy(malloc((len + 1)*sizeof(char)), cstr, sizeof(char)*(len + 1)); - } - if (psize) *psize = len + 1; - - Py_XDECREF(obj); - return SWIG_OK; - } else { - Py_XDECREF(obj); - } - } -#endif -#endif - - swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - if (pchar_descriptor) { - void* vptr = 0; - if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) { - if (cptr) *cptr = (char *) vptr; - if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0; - if (alloc) *alloc = SWIG_OLDOBJ; - return SWIG_OK; - } - } - } - return SWIG_TypeError; -} - - - - - -typedef int intArray; - - -SWIGINTERN int -SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val) -{ -#if PY_VERSION_HEX < 0x03000000 - if (PyInt_Check(obj)) { - long v = PyInt_AsLong(obj); - if (v >= 0) { - if (val) *val = v; - return SWIG_OK; - } else { - return SWIG_OverflowError; - } - } else -#endif - if (PyLong_Check(obj)) { - unsigned long v = PyLong_AsUnsignedLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_OK; - } else { - PyErr_Clear(); - return SWIG_OverflowError; - } - } -#ifdef SWIG_PYTHON_CAST_MODE - { - int dispatch = 0; - unsigned long v = PyLong_AsUnsignedLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_AddCast(SWIG_OK); - } else { - PyErr_Clear(); - } - if (!dispatch) { - double d; - int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d)); - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) { - if (val) *val = (unsigned long)(d); - return res; - } - } - } -#endif - return SWIG_TypeError; -} - - -#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERN int -SWIG_AsVal_unsigned_SS_long_SS_long (PyObject *obj, unsigned long long *val) -{ - int res = SWIG_TypeError; - if (PyLong_Check(obj)) { - unsigned long long v = PyLong_AsUnsignedLongLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_OK; - } else { - PyErr_Clear(); - res = SWIG_OverflowError; - } - } else { - unsigned long v; - res = SWIG_AsVal_unsigned_SS_long (obj,&v); - if (SWIG_IsOK(res)) { - if (val) *val = v; - return res; - } - } -#ifdef SWIG_PYTHON_CAST_MODE - { - const double mant_max = 1LL << DBL_MANT_DIG; - double d; - res = SWIG_AsVal_double (obj,&d); - if (SWIG_IsOK(res) && !SWIG_CanCastAsInteger(&d, 0, mant_max)) - return SWIG_OverflowError; - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, mant_max)) { - if (val) *val = (unsigned long long)(d); - return SWIG_AddCast(res); - } - res = SWIG_TypeError; - } -#endif - return res; -} -#endif - - -SWIGINTERNINLINE int -SWIG_AsVal_size_t (PyObject * obj, size_t *val) -{ - int res = SWIG_TypeError; -#ifdef SWIG_LONG_LONG_AVAILABLE - if (sizeof(size_t) <= sizeof(unsigned long)) { -#endif - unsigned long v; - res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0); - if (SWIG_IsOK(res) && val) *val = (size_t)(v); -#ifdef SWIG_LONG_LONG_AVAILABLE - } else if (sizeof(size_t) <= sizeof(unsigned long long)) { - unsigned long long v; - res = SWIG_AsVal_unsigned_SS_long_SS_long (obj, val ? &v : 0); - if (SWIG_IsOK(res) && val) *val = (size_t)(v); - } -#endif - return res; -} - -SWIGINTERN intArray *new_intArray(size_t nelements){ - return (int *)calloc(nelements, sizeof(int)); - } -SWIGINTERN void delete_intArray(intArray *self){ - free((char*)self); - } -SWIGINTERN int intArray___getitem__(intArray *self,size_t index){ - return self[index]; - } -SWIGINTERN void intArray___setitem__(intArray *self,size_t index,int value){ - self[index] = value; - } -SWIGINTERN int *intArray_cast(intArray *self){ - return self; - } -SWIGINTERN intArray *intArray_frompointer(int *t){ - return (intArray *)(t); - } - - static blpapi_Topic_t* *new_topicPtrArray(size_t nelements) { - return (blpapi_Topic_t* *)calloc(nelements, sizeof(blpapi_Topic_t*)); - } - - static void delete_topicPtrArray(blpapi_Topic_t* *ary) { - free((char*)ary); - } - - static blpapi_Topic_t* topicPtrArray_getitem(blpapi_Topic_t* *ary, size_t index) { - return ary[index]; - } - static void topicPtrArray_setitem(blpapi_Topic_t* *ary, size_t index, blpapi_Topic_t* value) { - ary[index] = value; - } - - - -#include "blpapi_correlationid.h" - -int pyObjectManagerFunc( - blpapi_ManagedPtr_t *managedPtr, - const blpapi_ManagedPtr_t *srcPtr, - int operation) -{ - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - if (operation == BLPAPI_MANAGEDPTR_COPY) { - managedPtr->pointer = srcPtr->pointer; - managedPtr->manager = srcPtr->manager; - Py_INCREF((PyObject *) (managedPtr->pointer)); - } - else if (operation == BLPAPI_MANAGEDPTR_DESTROY) { - Py_DECREF((PyObject *) (managedPtr->pointer)); - } - SWIG_PYTHON_THREAD_END_BLOCK; - - return 0; -} - -blpapi_CorrelationId_t *CorrelationId_t_createEmpty() -{ - blpapi_CorrelationId_t *cid; - - Py_BEGIN_ALLOW_THREADS - cid = (blpapi_CorrelationId_t *) malloc(sizeof(blpapi_CorrelationId_t)); - memset(cid, 0, sizeof(blpapi_CorrelationId_t)); - Py_END_ALLOW_THREADS - - return cid; -} - -blpapi_CorrelationId_t *CorrelationId_t_createFromInteger(long long value, unsigned short classId) -{ - blpapi_CorrelationId_t *cid; - - Py_BEGIN_ALLOW_THREADS - cid = (blpapi_CorrelationId_t *) malloc(sizeof(blpapi_CorrelationId_t)); - memset(cid, 0, sizeof(blpapi_CorrelationId_t)); - - cid->size = sizeof(blpapi_CorrelationId_t); - cid->valueType = BLPAPI_CORRELATION_TYPE_INT; - cid->classId = classId; - cid->value.intValue = value; - Py_END_ALLOW_THREADS - - return cid; -} - -blpapi_CorrelationId_t *CorrelationId_t_createFromObject(PyObject *value, unsigned short classId) -{ - blpapi_CorrelationId_t *cid; - if (!value) { - value = Py_None; - } - - Py_BEGIN_ALLOW_THREADS - cid = (blpapi_CorrelationId_t *) malloc(sizeof(blpapi_CorrelationId_t)); - memset(cid, 0, sizeof(blpapi_CorrelationId_t)); - - cid->size = sizeof(blpapi_CorrelationId_t); - cid->valueType = BLPAPI_CORRELATION_TYPE_POINTER; - cid->classId = classId; - - cid->value.ptrValue.manager = &pyObjectManagerFunc; - cid->value.ptrValue.pointer = value; - Py_END_ALLOW_THREADS - - Py_INCREF(value); - - return cid; -} - -blpapi_CorrelationId_t *CorrelationId_t_clone(const blpapi_CorrelationId_t *original) -{ - blpapi_CorrelationId_t *cid; - Py_BEGIN_ALLOW_THREADS - cid = (blpapi_CorrelationId_t *) malloc(sizeof(blpapi_CorrelationId_t)); - *cid = *original; - Py_END_ALLOW_THREADS - - if (BLPAPI_CORRELATION_TYPE_POINTER == cid->valueType) { - blpapi_ManagedPtr_ManagerFunction_t manager = - cid->value.ptrValue.manager; - if (manager) { - manager(&cid->value.ptrValue, &original->value.ptrValue, - BLPAPI_MANAGEDPTR_COPY); - } - } - - return cid; -} - -void CorrelationId_t_cleanup(blpapi_CorrelationId_t *cid) -{ - if (BLPAPI_CORRELATION_TYPE_POINTER == cid->valueType) { - blpapi_ManagedPtr_ManagerFunction_t manager = - cid->value.ptrValue.manager; - if (manager) { - manager(&cid->value.ptrValue, 0, BLPAPI_MANAGEDPTR_DESTROY); - } - } -} - -void CorrelationId_t_delete(blpapi_CorrelationId_t *cid) -{ - if (!cid) { - return; - } - - CorrelationId_t_cleanup(cid); - - Py_BEGIN_ALLOW_THREADS - free(cid); - Py_END_ALLOW_THREADS -} - -int CorrelationId_t_equals( - const blpapi_CorrelationId_t *cid1, - const blpapi_CorrelationId_t *cid2) -{ - if (cid1 == cid2) { - return 1; - } - - if (!cid1 || !cid2) { - return 0; - } - - if (cid1->valueType != cid2->valueType) { - return 0; - } - - if (cid1->classId != cid2->classId) { - return 0; - } - - if (cid1->valueType == BLPAPI_CORRELATION_TYPE_POINTER) { - return cid1->value.ptrValue.pointer == cid2->value.ptrValue.pointer; - } else { - return cid1->value.intValue == cid2->value.intValue; - } -} - -long long CorrelationId_t_toInteger(const blpapi_CorrelationId_t *cid) -{ - if (cid->valueType == BLPAPI_CORRELATION_TYPE_POINTER) - return (long long) (cid->value.ptrValue.pointer); - return cid->value.intValue; -} - -PyObject *CorrelationId_t_getObject(const blpapi_CorrelationId_t *cid) { - PyObject *res; - - if (BLPAPI_CORRELATION_TYPE_POINTER == cid->valueType - && &pyObjectManagerFunc == cid->value.ptrValue.manager) - { - res = (PyObject *) (cid->value.ptrValue.pointer); - } - else { - res = Py_None; - } - - Py_INCREF(res); - return res; -} - - -typedef union { - blpapi_UInt64_t intValue; - blpapi_ManagedPtr_t ptrValue; -} blpapi_CorrelationId_t__value; - -SWIGINTERN struct blpapi_CorrelationId_t_ *new_blpapi_CorrelationId_t___SWIG_0(void){ - return CorrelationId_t_createEmpty(); - } - -#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERN int -SWIG_AsVal_long_SS_long (PyObject *obj, long long *val) -{ - int res = SWIG_TypeError; - if (PyLong_Check(obj)) { - long long v = PyLong_AsLongLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_OK; - } else { - PyErr_Clear(); - res = SWIG_OverflowError; - } - } else { - long v; - res = SWIG_AsVal_long (obj,&v); - if (SWIG_IsOK(res)) { - if (val) *val = v; - return res; - } - } -#ifdef SWIG_PYTHON_CAST_MODE - { - const double mant_max = 1LL << DBL_MANT_DIG; - const double mant_min = -mant_max; - double d; - res = SWIG_AsVal_double (obj,&d); - if (SWIG_IsOK(res) && !SWIG_CanCastAsInteger(&d, mant_min, mant_max)) - return SWIG_OverflowError; - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, mant_min, mant_max)) { - if (val) *val = (long long)(d); - return SWIG_AddCast(res); - } - res = SWIG_TypeError; - } -#endif - return res; -} -#endif - - -SWIGINTERN int -SWIG_AsVal_unsigned_SS_short (PyObject * obj, unsigned short *val) -{ - unsigned long v; - int res = SWIG_AsVal_unsigned_SS_long (obj, &v); - if (SWIG_IsOK(res)) { - if ((v > USHRT_MAX)) { - return SWIG_OverflowError; - } else { - if (val) *val = (unsigned short)(v); - } - } - return res; -} - -SWIGINTERN struct blpapi_CorrelationId_t_ *new_blpapi_CorrelationId_t___SWIG_1(long long value,unsigned short classId){ - return CorrelationId_t_createFromInteger(value, classId); - } -SWIGINTERN struct blpapi_CorrelationId_t_ *new_blpapi_CorrelationId_t___SWIG_2(PyObject *value,unsigned short classId){ - return CorrelationId_t_createFromObject(value, classId); - } -SWIGINTERN void delete_blpapi_CorrelationId_t_(struct blpapi_CorrelationId_t_ *self){ - CorrelationId_t_delete((self)); - } -SWIGINTERN unsigned short blpapi_CorrelationId_t__type(struct blpapi_CorrelationId_t_ const *self){ - return self->valueType; - } - -SWIGINTERNINLINE PyObject * -SWIG_From_unsigned_SS_short (unsigned short value) -{ - return SWIG_From_unsigned_SS_long (value); -} - -SWIGINTERN unsigned short blpapi_CorrelationId_t__classId(struct blpapi_CorrelationId_t_ const *self){ - return self->classId; - } -SWIGINTERN PyObject *blpapi_CorrelationId_t____asObject(struct blpapi_CorrelationId_t_ const *self){ - return CorrelationId_t_getObject(self); - } -SWIGINTERN long long blpapi_CorrelationId_t____asInteger(struct blpapi_CorrelationId_t_ const *self){ - return self->value.intValue; - } - -#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE PyObject* -SWIG_From_long_SS_long (long long value) -{ - return ((value < LONG_MIN) || (value > LONG_MAX)) ? - PyLong_FromLongLong(value) : PyInt_FromLong((long)(value)); -} -#endif - -SWIGINTERN long long blpapi_CorrelationId_t____toInteger(struct blpapi_CorrelationId_t_ const *self){ - return CorrelationId_t_toInteger(self); - } - - -#include "blpapi_element.h" - -PyObject* blpapi_Element_toPy(blpapi_Element_t *element); - -PyObject* getScalarValue(const blpapi_Element_t* element, const int index) { - const int datatype = blpapi_Element_datatype(element); - - switch (datatype) { - case BLPAPI_DATATYPE_BOOL: { - blpapi_Bool_t boolBuffer; - if (0 != blpapi_Element_getValueAsBool(element, - &boolBuffer, - index)) { - PyErr_SetString( - PyExc_Exception, - "Internal error getting bool"); - return NULL; - } - return PyBool_FromLong(boolBuffer); - } - case BLPAPI_DATATYPE_BYTE: - case BLPAPI_DATATYPE_INT32: - case BLPAPI_DATATYPE_INT64: { - blpapi_Int64_t int64Buffer; - if (0 != blpapi_Element_getValueAsInt64(element, - &int64Buffer, - index)) { - PyErr_SetString( - PyExc_Exception, - "Internal error getting int"); - return NULL; - } - return PyLong_FromLongLong(int64Buffer); - } - case BLPAPI_DATATYPE_FLOAT32: - case BLPAPI_DATATYPE_FLOAT64: { - blpapi_Float64_t floatBuffer; - if (0 != blpapi_Element_getValueAsFloat64(element, - &floatBuffer, - index)) { - PyErr_SetString( - PyExc_Exception, - "Internal error getting float"); - return NULL; - } - return PyFloat_FromDouble(floatBuffer); - } - case BLPAPI_DATATYPE_CHAR: - case BLPAPI_DATATYPE_STRING: - case BLPAPI_DATATYPE_ENUMERATION: { - const char* strValue; - if (0 != blpapi_Element_getValueAsString(element, - &strValue, - index)) { - PyErr_SetString( - PyExc_Exception, - "Internal error getting string"); - return NULL; - } - return PyString_FromString(strValue); - } - case BLPAPI_DATATYPE_BYTEARRAY: { - const char* bytesValue = 0; - size_t bytesLength = 0; - if (0 != blpapi_Element_getValueAsBytes(element, - &bytesValue, - &bytesLength, - index)) { - PyErr_SetString( - PyExc_Exception, - "Internal error getting bytes"); - return NULL; - } - return PyBytes_FromStringAndSize(bytesValue, bytesLength); - } - case BLPAPI_DATATYPE_DATE: - case BLPAPI_DATATYPE_TIME: - case BLPAPI_DATATYPE_DATETIME: { - static PyObject* blpapiDatetimeModule = NULL; - static PyObject* datetimeUtil = NULL; - static PyObject* convertToNative = NULL; - blpapi_HighPrecisionDatetime_t highPrecisionDatetimeBuffer; - PyObject* datetimePyObj = NULL; - PyObject* highPrecisionDatetimePyObj = NULL; - PyObject* pyDatetimeResult = NULL; - - // initialize static variables once - if (convertToNative == NULL) { - blpapiDatetimeModule = - PyImport_ImportModule("blpapi.datetime"); - if (blpapiDatetimeModule == NULL) { - PyErr_SetString( - PyExc_Exception, - "Internal error getting blpapi.datetime"); - return NULL; - } - datetimeUtil = - PyObject_GetAttr(blpapiDatetimeModule, - PyString_FromString("_DatetimeUtil")); - if (datetimeUtil == NULL) { - Py_DECREF(blpapiDatetimeModule); - PyErr_SetString( - PyExc_Exception, - "Internal error getting _DatetimeUtil"); - return NULL; - } - convertToNative = PyObject_GetAttr( - datetimeUtil, PyString_FromString("convertToNative")); - if (convertToNative == NULL) { - Py_DECREF(blpapiDatetimeModule); - Py_DECREF(datetimeUtil); - PyErr_SetString( - PyExc_Exception, - "Internal error getting convertToNative"); - return NULL; - } - } - - if (blpapi_Element_getValueAsHighPrecisionDatetime( - element, - &highPrecisionDatetimeBuffer, - index) != 0) { - PyErr_SetString( - PyExc_Exception, - "Internal error getting datetime"); - return NULL; - } - - // Return `None` when the `datetime` has no parts because our - // `convertToNative` function will raise an exception if there are - // no parts - if (!highPrecisionDatetimeBuffer.datetime.parts) { - Py_RETURN_NONE; // inc ref and return - } - - highPrecisionDatetimePyObj = SWIG_NewPointerObj( - (void *) &highPrecisionDatetimeBuffer, - SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, - 0); - if (highPrecisionDatetimePyObj == NULL) { - PyErr_SetString( - PyExc_Exception, - "Internal error getting HighPrecisionDatetime"); - return NULL; - } - - datetimePyObj = Py_BuildValue("(O)", - highPrecisionDatetimePyObj); - pyDatetimeResult = PyObject_Call( - convertToNative, - datetimePyObj, - NULL); - Py_DECREF(datetimePyObj); - Py_DECREF(highPrecisionDatetimePyObj); - return pyDatetimeResult; - } - case BLPAPI_DATATYPE_SEQUENCE: - case BLPAPI_DATATYPE_CHOICE: - default: { - PyErr_SetString(PyExc_Exception, "Internal datatype error"); - return NULL; - } - } -} - -PyObject* complexElementToPy(blpapi_Element_t *element) { - PyObject* pyDict = PyDict_New(); - PyObject* subElementPy = NULL; - unsigned int i; - if (pyDict == NULL) { - goto ERROR; - } - - for (i = 0; i < blpapi_Element_numElements(element); ++i) { - blpapi_Element_t* subElement; - const char* name; - if (0 != blpapi_Element_getElementAt(element, &subElement, i)) { - PyErr_SetString(PyExc_Exception, - "Internal error in `Element.toPy`"); - goto ERROR; - } - name = blpapi_Element_nameString(subElement); - subElementPy = blpapi_Element_toPy(subElement); - if (subElementPy == NULL) { - goto ERROR; - } - // does not steal ref to value - if (PyDict_SetItemString(pyDict, name, subElementPy)) { - goto ERROR; - } - Py_DECREF(subElementPy); - } - return pyDict; -ERROR: - Py_XDECREF(pyDict); - Py_XDECREF(subElementPy); - // Ensure that we set an error before returning NULL - if (PyErr_Occurred() == NULL) { - PyErr_SetString( - PyExc_Exception, - "Internal error converting a complex Element"); - } - return NULL; -} - -PyObject* arrayElementToPy(blpapi_Element_t *element) { - const unsigned int numValues = blpapi_Element_numValues(element); - PyObject* pyList = PyList_New(numValues); - PyObject* pyValue = NULL; - - const blpapi_SchemaElementDefinition_t* definition - = blpapi_Element_definition(element); - const blpapi_SchemaTypeDefinition_t* typeDefinition - = blpapi_SchemaElementDefinition_type(definition); - - unsigned int i; - if (pyList == NULL) { - goto ERROR; - } - - // complex values - if (blpapi_SchemaTypeDefinition_isComplexType(typeDefinition)) { - for (i = 0; i < numValues; ++i) { - blpapi_Element_t* result; - if (0 != blpapi_Element_getValueAsElement(element, &result, i)) { - PyErr_SetString( - PyExc_Exception, - "Internal error in blpapi_Element_getValueAsElement"); - goto ERROR; - } - pyValue = blpapi_Element_toPy(result); - if (pyValue == NULL) { - goto ERROR; - } - // steals ref to value - // returns void, no error checking - PyList_SET_ITEM(pyList, i, pyValue); - } - } - else { - // non complex values - for (i = 0; i < numValues; ++i) { - pyValue = getScalarValue(element, i); - if (pyValue == NULL) { - goto ERROR; - } - // steals ref to value - // returns void, no error checking - PyList_SET_ITEM(pyList, i, pyValue); - } - } - return pyList; - -ERROR: - Py_XDECREF(pyList); - Py_XDECREF(pyValue); - // Ensure that we set an error before returning NULL - if (PyErr_Occurred() == NULL) { - PyErr_SetString( - PyExc_Exception, - "Internal error converting an array Element"); - } - return NULL; -} - -PyObject* blpapi_Element_toPy(blpapi_Element_t *element) { - if (blpapi_Element_isComplexType(element)) { - return complexElementToPy(element); - } - else if (blpapi_Element_isArray(element)) { - return arrayElementToPy(element); - } - else if (blpapi_Element_isNull(element)) { - Py_RETURN_NONE; // inc ref and return - } - else { - return getScalarValue(element, 0); - } -} - -int blpapi_Element_setElementFloat( - blpapi_Element_t *element, - const char* nameString, - const blpapi_Name_t* name, - blpapi_Float64_t value) -{ - // The C interface will not silently discard precision to store a 64-bit - // float in a field whose schema type is 32-bit, however all Python floats - // are 64-bit, so we explicitly allow narrowing to 32 bits if necessary. - - blpapi_Element_t *fldt; - int ret = blpapi_Element_getElement(element, &fldt, nameString, name); - if (ret == 0) { - // Able to get field, consider its datatype - if (blpapi_Element_datatype(fldt) == BLPAPI_DATATYPE_FLOAT32) { - ret = blpapi_Element_setElementFloat32(element, - nameString, name, value); - } else { - ret = blpapi_Element_setElementFloat64(element, - nameString, name, value); - } - return ret; - } - - // Unable to get field. Try to set element anyway - ret = blpapi_Element_setElementFloat64(element, - nameString, name, value); - - if (ret) { - ret = blpapi_Element_setElementFloat32(element, - nameString, name, value); - } - - return ret; -} - -int blpapi_Element_setValueFloat( - blpapi_Element_t *element, - blpapi_Float64_t value, - size_t index) -{ - // The C interface will not silently discard precision to store a 64-bit - // float in a field whose schema type is 32-bit, however all Python floats - // are 64-bit, so we explicitly allow narrowing to 32 bits if necessary. - - int ret; - - // Consider field datatype - if (blpapi_Element_datatype(element) == BLPAPI_DATATYPE_FLOAT32) { - ret = blpapi_Element_setValueFloat32(element, value, index); - } else { - ret = blpapi_Element_setValueFloat64(element, value, index); - } - - return ret; -} - -void blpapi_Element_printHelper( - blpapi_Element_t *element, - int level, - int spacesPerLevel, - char **output_allocated, - int *output_size) -{ - // StreamWriterData and cstr_StreamWriter are defined in internals.i - StreamWriterData stream = {0}; - blpapi_Element_print( - element, - cstr_StreamWriter, - &stream, - level, - spacesPerLevel); - *output_allocated = stream.stream; - *output_size = stream.size; -} - - - -SWIGINTERNINLINE PyObject * -SWIG_FromCharPtr(const char *cptr) -{ - return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0)); -} - - -SWIGINTERNINLINE PyObject * -SWIG_From_char (char c) -{ - return SWIG_FromCharPtrAndSize(&c,1); -} - - - #define SWIG_From_double PyFloat_FromDouble - - - -#include "blpapi_eventformatter.h" - -int blpapi_EventFormatter_setValueFloat( - blpapi_EventFormatter_t* formatter, - char const* typeString, - const blpapi_Name_t* typeName, - blpapi_Float64_t value) -{ - // The C interface will not silently discard precision to store a 64-bit - // float in a field whose schema type is 32-bit, however all Python floats - // are 64-bit, so we explicitly allow narrowing to 32 bits if necessary. - - int ret = blpapi_EventFormatter_setValueFloat64(formatter, typeString, - typeName, value); - if (ret) { - ret = blpapi_EventFormatter_setValueFloat32(formatter, typeString, - typeName, value); - } - - return ret; -} - -int blpapi_EventFormatter_appendValueFloat( - blpapi_EventFormatter_t* formatter, - blpapi_Float64_t value) -{ - // The C interface will not silently discard precision to store a 64-bit - // float in a field whose schema type is 32-bit, however all Python floats - // are 64-bit, so we explicitly allow narrowing to 32 bits if necessary. - - int ret = blpapi_EventFormatter_appendValueFloat64(formatter, value); - - if (ret) { - ret = blpapi_EventFormatter_appendValueFloat32(formatter, value); - } - - return ret; -} - - - -SWIGINTERN int -SWIG_AsVal_unsigned_SS_int (PyObject * obj, unsigned int *val) -{ - unsigned long v; - int res = SWIG_AsVal_unsigned_SS_long (obj, &v); - if (SWIG_IsOK(res)) { - if ((v > UINT_MAX)) { - return SWIG_OverflowError; - } else { - if (val) *val = (unsigned int)(v); - } - } - return res; -} - - -SWIGINTERN int -SWIG_AsCharArray(PyObject * obj, char *val, size_t size) -{ - char* cptr = 0; size_t csize = 0; int alloc = SWIG_OLDOBJ; - int res = SWIG_AsCharPtrAndSize(obj, &cptr, &csize, &alloc); - if (SWIG_IsOK(res)) { - /* special case of single char conversion when we don't need space for NUL */ - if (size == 1 && csize == 2 && cptr && !cptr[1]) --csize; - if (csize <= size) { - if (val) { - if (csize) memcpy(val, cptr, csize*sizeof(char)); - if (csize < size) memset(val + csize, 0, (size - csize)*sizeof(char)); - } - if (alloc == SWIG_NEWOBJ) { - free((char*)cptr); - res = SWIG_DelNewMask(res); - } - return res; - } - if (alloc == SWIG_NEWOBJ) free((char*)cptr); - } - return SWIG_TypeError; -} - - -SWIGINTERN int -SWIG_AsVal_char (PyObject * obj, char *val) -{ - int res = SWIG_AsCharArray(obj, val, 1); - if (!SWIG_IsOK(res)) { - long v; - res = SWIG_AddCast(SWIG_AsVal_long (obj, &v)); - if (SWIG_IsOK(res)) { - if ((CHAR_MIN <= v) && (v <= CHAR_MAX)) { - if (val) *val = (char)(v); - } else { - res = SWIG_OverflowError; - } - } - } - return res; -} - - -#include "blpapi_session.h" - -void dispatchEventProxy(blpapi_Event_t *event, blpapi_Session_t *session, void *userData) -{ - PyObject *eventDispatcherFunc = (PyObject *) (userData); - PyObject *result; - - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - - PyObject *arglist = PyTuple_New(1); - PyTuple_SET_ITEM(arglist, 0, - SWIG_NewPointerObj(SWIG_as_voidptr(event), SWIGTYPE_p_blpapi_Event, 0)); - - result = PyObject_CallObject(eventDispatcherFunc, arglist); - - Py_DECREF(arglist); - Py_XDECREF(result); - - SWIG_PYTHON_THREAD_END_BLOCK; -} - -blpapi_Session_t *Session_createHelper(blpapi_SessionOptions_t *parameters, - PyObject *eventHandlerFunc, - blpapi_EventDispatcher_t *dispatcher) -{ - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - const int hasHandler = - eventHandlerFunc != 0 && eventHandlerFunc != Py_None; - - blpapi_Session_t *const res = blpapi_Session_create( - parameters, - hasHandler ? &dispatchEventProxy : 0, - dispatcher, - hasHandler ? eventHandlerFunc : 0); - - if (!res) { - return 0; - } - SWIG_PYTHON_THREAD_END_ALLOW; - - Py_XINCREF(eventHandlerFunc); - - return res; -} - -void Session_destroyHelper(blpapi_Session_t *sessionHandle, PyObject *eventHandlerFunc) -{ - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_Session_destroy(sessionHandle); - SWIG_PYTHON_THREAD_END_ALLOW; - - Py_XDECREF(eventHandlerFunc); -} - - - -#include "blpapi_providersession.h" - -void dispatchProviderEventProxy(blpapi_Event_t *event, blpapi_ProviderSession_t *providerSession, void *userData) -{ - PyObject *eventDispatcherFunc = (PyObject *) (userData); - PyObject *result; - PyObject *arglist; - - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - - arglist = PyTuple_New(1); - PyTuple_SET_ITEM(arglist, 0, - SWIG_NewPointerObj(SWIG_as_voidptr(event), SWIGTYPE_p_blpapi_Event, 0)); - - result = PyObject_CallObject(eventDispatcherFunc, arglist); - - Py_DECREF(arglist); - Py_XDECREF(result); - - SWIG_PYTHON_THREAD_END_BLOCK; -} - -blpapi_ProviderSession_t *ProviderSession_createHelper(blpapi_SessionOptions_t *parameters, - PyObject *eventHandlerFunc, - blpapi_EventDispatcher_t *dispatcher) -{ - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - const int hasHandler = - eventHandlerFunc != 0 && eventHandlerFunc != Py_None; - - blpapi_ProviderSession_t *const res = blpapi_ProviderSession_create( - parameters, - hasHandler ? &dispatchProviderEventProxy : 0, - dispatcher, - hasHandler ? eventHandlerFunc : 0); - - if (!res) { - return 0; - } - SWIG_PYTHON_THREAD_END_ALLOW; - - Py_XINCREF(eventHandlerFunc); - - return res; -} - -void ProviderSession_destroyHelper(blpapi_ProviderSession_t *sessionHandle, - PyObject *eventHandlerFunc) -{ - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_ProviderSession_destroy(sessionHandle); - SWIG_PYTHON_THREAD_END_ALLOW; - - Py_XDECREF(eventHandlerFunc); -} - -int ProviderSession_terminateSubscriptionsOnTopic(blpapi_ProviderSession_t *sessionHandle, - const blpapi_Topic_t *topic, - const char *message) -{ - int res; - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - res = blpapi_ProviderSession_terminateSubscriptionsOnTopics(sessionHandle, &topic, 1, message); - SWIG_PYTHON_THREAD_END_ALLOW; - return res; -} - - - - -#include "blpapi_messageformatter.h" - -int blpapi_MessageFormatter_setValueFloat( - blpapi_MessageFormatter_t* formatter, - const blpapi_Name_t* typeName, - blpapi_Float64_t value) -{ - // The C interface will not silently discard precision to store a 64-bit - // float in a field whose schema type is 32-bit, however all Python floats - // are 64-bit, so we explicitly allow narrowing to 32 bits if necessary. - - int ret = blpapi_MessageFormatter_setValueFloat64(formatter, - typeName, - value); - if (ret) { - ret = blpapi_MessageFormatter_setValueFloat32(formatter, - typeName, - value); - } - - return ret; -} - -int blpapi_MessageFormatter_appendValueFloat( - blpapi_MessageFormatter_t* formatter, - blpapi_Float64_t value) -{ - // The C interface will not silently discard precision to store a 64-bit - // float in a field whose schema type is 32-bit, however all Python floats - // are 64-bit, so we explicitly allow narrowing to 32 bits if necessary. - - int ret = blpapi_MessageFormatter_appendValueFloat64(formatter, - value); - if (ret) { - ret = blpapi_MessageFormatter_appendValueFloat32(formatter, - value); - } - - return ret; -} - - - -/* Getting isfinite working pre C99 across multiple platforms is non-trivial. Users can provide SWIG_isfinite on older platforms. */ -#ifndef SWIG_isfinite -/* isfinite() is a macro for C99 */ -# if defined(isfinite) -# define SWIG_isfinite(X) (isfinite(X)) -# elif defined(__cplusplus) && __cplusplus >= 201103L -/* Use a template so that this works whether isfinite() is std::isfinite() or - * in the global namespace. The reality seems to vary between compiler - * versions. - * - * Make sure namespace std exists to avoid compiler warnings. - * - * extern "C++" is required as this fragment can end up inside an extern "C" { } block - */ -namespace std { } -extern "C++" template -inline int SWIG_isfinite_func(T x) { - using namespace std; - return isfinite(x); -} -# define SWIG_isfinite(X) (SWIG_isfinite_func(X)) -# elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)) -# define SWIG_isfinite(X) (__builtin_isfinite(X)) -# elif defined(__clang__) && defined(__has_builtin) -# if __has_builtin(__builtin_isfinite) -# define SWIG_isfinite(X) (__builtin_isfinite(X)) -# endif -# elif defined(_MSC_VER) -# define SWIG_isfinite(X) (_finite(X)) -# elif defined(__sun) && defined(__SVR4) -# include -# define SWIG_isfinite(X) (finite(X)) -# endif -#endif - - -/* Accept infinite as a valid float value unless we are unable to check if a value is finite */ -#ifdef SWIG_isfinite -# define SWIG_Float_Overflow_Check(X) ((X < -FLT_MAX || X > FLT_MAX) && SWIG_isfinite(X)) -#else -# define SWIG_Float_Overflow_Check(X) ((X < -FLT_MAX || X > FLT_MAX)) -#endif - - -SWIGINTERN int -SWIG_AsVal_float (PyObject * obj, float *val) -{ - double v; - int res = SWIG_AsVal_double (obj, &v); - if (SWIG_IsOK(res)) { - if (SWIG_Float_Overflow_Check(v)) { - return SWIG_OverflowError; - } else { - if (val) *val = (float)(v); - } - } - return res; -} - - - -void blpapi_SubscriptionPreprocess_handleErrorPy( - const blpapi_CorrelationId_t *correlationId, - const char *subscriptionString, - int errorCode, - const char *description, - void *userData) -{ - /* GIL needs to be held while using the python C-API. */ - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - - PyObject* cidPyObject; - PyObject* result; - PyObject* errorAppenderCb; - - cidPyObject = SWIG_NewPointerObj( - CorrelationId_t_clone(correlationId), - SWIGTYPE_p_blpapi_CorrelationId_t_, - SWIG_POINTER_OWN); - - errorAppenderCb = (PyObject*) userData; - result = PyObject_CallFunction(errorAppenderCb, "Osis", - cidPyObject, - subscriptionString, - errorCode, - description); - - Py_XDECREF(result); - Py_CLEAR(cidPyObject); - - SWIG_PYTHON_THREAD_END_BLOCK; -} - - -int blpapi_Session_subscribeEx_helper( - blpapi_Session_t *session, - const blpapi_SubscriptionList_t *subscriptionList, - const blpapi_Identity_t *identity, - const char* requestLabel, - int requestLabelLen, - PyObject* errorAppenderCb) -{ - return blpapi_Session_subscribeEx( - session, - subscriptionList, - identity, - requestLabel, - requestLabelLen, - &blpapi_SubscriptionPreprocess_handleErrorPy, - errorAppenderCb); -} - -int blpapi_Session_resubscribeEx_helper( - blpapi_Session_t *session, - const blpapi_SubscriptionList_t *resubscriptionList, - const char *requestLabel, - int requestLabelLen, - PyObject* errorAppenderCb) -{ - return blpapi_Session_resubscribeEx( - session, - resubscriptionList, - requestLabel, - requestLabelLen, - &blpapi_SubscriptionPreprocess_handleErrorPy, - errorAppenderCb); -} - -int blpapi_Session_resubscribeWithIdEx_helper( - blpapi_Session_t *session, - const blpapi_SubscriptionList_t *resubscriptionList, - int resubscriptionId, - const char *requestLabel, - int requestLabelLen, - PyObject* errorAppenderCb) -{ - return blpapi_Session_resubscribeWithIdEx( - session, - resubscriptionList, - resubscriptionId, - requestLabel, - requestLabelLen, - &blpapi_SubscriptionPreprocess_handleErrorPy, - errorAppenderCb); -} - - - -SWIGINTERNINLINE PyObject * -SWIG_From_float (float value) -{ - return SWIG_From_double (value); -} - - -SWIGINTERN int -SWIG_AsVal_unsigned_SS_char (PyObject * obj, unsigned char *val) -{ - unsigned long v; - int res = SWIG_AsVal_unsigned_SS_long (obj, &v); - if (SWIG_IsOK(res)) { - if ((v > UCHAR_MAX)) { - return SWIG_OverflowError; - } else { - if (val) *val = (unsigned char)(v); - } - } - return res; -} - - -SWIGINTERNINLINE PyObject * -SWIG_From_unsigned_SS_char (unsigned char value) -{ - return SWIG_From_unsigned_SS_long (value); -} - - -SWIGINTERN int -SWIG_AsVal_short (PyObject * obj, short *val) -{ - long v; - int res = SWIG_AsVal_long (obj, &v); - if (SWIG_IsOK(res)) { - if ((v < SHRT_MIN || v > SHRT_MAX)) { - return SWIG_OverflowError; - } else { - if (val) *val = (short)(v); - } - } - return res; -} - - -SWIGINTERNINLINE PyObject * -SWIG_From_short (short value) -{ - return SWIG_From_long (value); -} - -#ifdef __cplusplus -extern "C" { -#endif -SWIGINTERN PyObject *_wrap_setLoggerCallbackWrapper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - PyObject *arg1 = (PyObject *) 0 ; - int arg2 ; - int val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "setLoggerCallbackWrapper", 2, 2, swig_obj)) SWIG_fail; - arg1 = swig_obj[0]; - ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "setLoggerCallbackWrapper" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)setLoggerCallbackWrapper(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_fromTimePoint_wrapper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_TimePoint_t arg1 ; - void *argp1 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - blpapi_HighPrecisionDatetime_t result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - { - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_blpapi_TimePoint, 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_fromTimePoint_wrapper" "', argument " "1"" of type '" "blpapi_TimePoint_t""'"); - } - if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "blpapi_HighPrecisionDatetime_fromTimePoint_wrapper" "', argument " "1"" of type '" "blpapi_TimePoint_t""'"); - } else { - arg1 = *((blpapi_TimePoint_t *)(argp1)); - } - } - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = blpapi_HighPrecisionDatetime_fromTimePoint_wrapper(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj((blpapi_HighPrecisionDatetime_t *)memcpy((blpapi_HighPrecisionDatetime_t *)calloc(1,sizeof(blpapi_HighPrecisionDatetime_t)),&result,sizeof(blpapi_HighPrecisionDatetime_t)), SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Logging_registerCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Logging_Func_t arg1 ; - blpapi_Logging_Severity_t arg2 ; - void *argp1 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Logging_registerCallback", 2, 2, swig_obj)) SWIG_fail; - { - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_blpapi_Logging_Func_t, 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Logging_registerCallback" "', argument " "1"" of type '" "blpapi_Logging_Func_t""'"); - } - if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "blpapi_Logging_registerCallback" "', argument " "1"" of type '" "blpapi_Logging_Func_t""'"); - } else { - arg1 = *((blpapi_Logging_Func_t *)(argp1)); - } - } - ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Logging_registerCallback" "', argument " "2"" of type '" "blpapi_Logging_Severity_t""'"); - } - arg2 = (blpapi_Logging_Severity_t)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Logging_registerCallback(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Logging_logTestMessage(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Logging_Severity_t arg1 ; - int val1 ; - int ecode1 = 0 ; - PyObject *swig_obj[1] ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "blpapi_Logging_logTestMessage" "', argument " "1"" of type '" "blpapi_Logging_Severity_t""'"); - } - arg1 = (blpapi_Logging_Severity_t)(val1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_Logging_logTestMessage(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_DiagnosticsUtil_memoryInfo_wrapper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - PyObject *result = 0 ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_DiagnosticsUtil_memoryInfo_wrapper", 0, 0, 0)) SWIG_fail; - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (PyObject *)blpapi_DiagnosticsUtil_memoryInfo_wrapper(); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = result; - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventDispatcher_stop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventDispatcher_t *arg1 = (blpapi_EventDispatcher_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_EventDispatcher_stop", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventDispatcher, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventDispatcher_stop" "', argument " "1"" of type '" "blpapi_EventDispatcher_t *""'"); - } - arg1 = (blpapi_EventDispatcher_t *)(argp1); - ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_EventDispatcher_stop" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventDispatcher_stop(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Service_printHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - int arg2 ; - int arg3 ; - char **arg4 = (char **) 0 ; - int *arg5 = (int *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - char *temp4 = 0 ; - int tempn4 ; - PyObject *swig_obj[3] ; - - arg4 = &temp4; arg5 = &tempn4; - if (!SWIG_Python_UnpackTuple(args, "blpapi_Service_printHelper", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_printHelper" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = (blpapi_Service_t *)(argp1); - ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Service_printHelper" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); - ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Service_printHelper" "', argument " "3"" of type '" "int""'"); - } - arg3 = (int)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_Service_printHelper(arg1,arg2,arg3,arg4,arg5); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - if (*arg4) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtrAndSize(*arg4,*arg5)); - free(*arg4); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_printHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; - int arg2 ; - int arg3 ; - char **arg4 = (char **) 0 ; - int *arg5 = (int *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - char *temp4 = 0 ; - int tempn4 ; - PyObject *swig_obj[3] ; - - arg4 = &temp4; arg5 = &tempn4; - if (!SWIG_Python_UnpackTuple(args, "blpapi_SchemaElementDefinition_printHelper", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_printHelper" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t *""'"); - } - arg1 = (blpapi_SchemaElementDefinition_t *)(argp1); - ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SchemaElementDefinition_printHelper" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); - ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_SchemaElementDefinition_printHelper" "', argument " "3"" of type '" "int""'"); - } - arg3 = (int)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_SchemaElementDefinition_printHelper(arg1,arg2,arg3,arg4,arg5); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - if (*arg4) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtrAndSize(*arg4,*arg5)); - free(*arg4); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_printHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; - int arg2 ; - int arg3 ; - char **arg4 = (char **) 0 ; - int *arg5 = (int *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - char *temp4 = 0 ; - int tempn4 ; - PyObject *swig_obj[3] ; - - arg4 = &temp4; arg5 = &tempn4; - if (!SWIG_Python_UnpackTuple(args, "blpapi_SchemaTypeDefinition_printHelper", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_p_void, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_printHelper" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t *""'"); - } - arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); - ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SchemaTypeDefinition_printHelper" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); - ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_SchemaTypeDefinition_printHelper" "', argument " "3"" of type '" "int""'"); - } - arg3 = (int)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_SchemaTypeDefinition_printHelper(arg1,arg2,arg3,arg4,arg5); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - if (*arg4) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtrAndSize(*arg4,*arg5)); - free(*arg4); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Message_printHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; - int arg2 ; - int arg3 ; - char **arg4 = (char **) 0 ; - int *arg5 = (int *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - char *temp4 = 0 ; - int tempn4 ; - PyObject *swig_obj[3] ; - - arg4 = &temp4; arg5 = &tempn4; - if (!SWIG_Python_UnpackTuple(args, "blpapi_Message_printHelper", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_printHelper" "', argument " "1"" of type '" "blpapi_Message_t *""'"); - } - arg1 = (blpapi_Message_t *)(argp1); - ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Message_printHelper" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); - ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Message_printHelper" "', argument " "3"" of type '" "int""'"); - } - arg3 = (int)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_Message_printHelper(arg1,arg2,arg3,arg4,arg5); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - if (*arg4) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtrAndSize(*arg4,*arg5)); - free(*arg4); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_printHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - int arg2 ; - int arg3 ; - char **arg4 = (char **) 0 ; - int *arg5 = (int *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - char *temp4 = 0 ; - int tempn4 ; - PyObject *swig_obj[3] ; - - arg4 = &temp4; arg5 = &tempn4; - if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_printHelper", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_printHelper" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_printHelper" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); - ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_SessionOptions_printHelper" "', argument " "3"" of type '" "int""'"); - } - arg3 = (int)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_SessionOptions_printHelper(arg1,arg2,arg3,arg4,arg5); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - if (*arg4) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtrAndSize(*arg4,*arg5)); - free(*arg4); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Socks5Config_printHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Socks5Config_t *arg1 = (blpapi_Socks5Config_t *) 0 ; - int arg2 ; - int arg3 ; - char **arg4 = (char **) 0 ; - int *arg5 = (int *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - char *temp4 = 0 ; - int tempn4 ; - PyObject *swig_obj[3] ; - - arg4 = &temp4; arg5 = &tempn4; - if (!SWIG_Python_UnpackTuple(args, "blpapi_Socks5Config_printHelper", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Socks5Config, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Socks5Config_printHelper" "', argument " "1"" of type '" "blpapi_Socks5Config_t *""'"); - } - arg1 = (blpapi_Socks5Config_t *)(argp1); - ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Socks5Config_printHelper" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); - ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Socks5Config_printHelper" "', argument " "3"" of type '" "int""'"); - } - arg3 = (int)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_Socks5Config_printHelper(arg1,arg2,arg3,arg4,arg5); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - if (*arg4) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtrAndSize(*arg4,*arg5)); - free(*arg4); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TestUtil_serializeServiceHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - char **arg2 = (char **) 0 ; - int *arg3 = (int *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - char *temp2 = 0 ; - int tempn2 ; - PyObject *swig_obj[1] ; - - arg2 = &temp2; arg3 = &tempn2; - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TestUtil_serializeServiceHelper" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = (blpapi_Service_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_TestUtil_serializeServiceHelper(arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - if (*arg2) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtrAndSize(*arg2,*arg3)); - free(*arg2); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_hasElementDefinition(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_SchemaTypeDefinition_hasElementDefinition", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_p_void, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_hasElementDefinition" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); - } - arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SchemaTypeDefinition_hasElementDefinition" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_SchemaTypeDefinition_hasElementDefinition" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = (blpapi_Name_t *)(argp3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SchemaTypeDefinition_hasElementDefinition((void *const *)arg1,(char const *)arg2,(struct blpapi_Name const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ConstantList_hasConstant(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ConstantList_t *arg1 = (blpapi_ConstantList_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_ConstantList_hasConstant", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_hasConstant" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); - } - arg1 = (blpapi_ConstantList_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ConstantList_hasConstant" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ConstantList_hasConstant" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = (blpapi_Name_t *)(argp3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ConstantList_hasConstant((struct blpapi_ConstantList const *)arg1,(char const *)arg2,(struct blpapi_Name const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Service_hasEventDefinition(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Service_hasEventDefinition", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_hasEventDefinition" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = (blpapi_Service_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Service_hasEventDefinition" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Service_hasEventDefinition" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = (blpapi_Name_t *)(argp3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Service_hasEventDefinition(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Service_hasOperation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Service_hasOperation", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_hasOperation" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = (blpapi_Service_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Service_hasOperation" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Service_hasOperation" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = (blpapi_Name_t *)(argp3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Service_hasOperation(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_addHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; - char *arg4 = (char *) 0 ; - char *arg5 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - int res4 ; - char *buf4 = 0 ; - int alloc4 = 0 ; - int res5 ; - char *buf5 = 0 ; - int alloc5 = 0 ; - PyObject *swig_obj[5] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_SubscriptionList_addHelper", 5, 5, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_addHelper" "', argument " "1"" of type '" "blpapi_SubscriptionList_t *""'"); - } - arg1 = (blpapi_SubscriptionList_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SubscriptionList_addHelper" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_SubscriptionList_addHelper" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); - } - arg3 = (blpapi_CorrelationId_t *)(argp3); - res4 = SWIG_AsCharPtrAndSize(swig_obj[3], &buf4, NULL, &alloc4); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_SubscriptionList_addHelper" "', argument " "4"" of type '" "char const *""'"); - } - arg4 = (char *)(buf4); - res5 = SWIG_AsCharPtrAndSize(swig_obj[4], &buf5, NULL, &alloc5); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "blpapi_SubscriptionList_addHelper" "', argument " "5"" of type '" "char const *""'"); - } - arg5 = (char *)(buf5); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SubscriptionList_addHelper(arg1,(char const *)arg2,(struct blpapi_CorrelationId_t_ const *)arg3,(char const *)arg4,(char const *)arg5); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); - if (alloc5 == SWIG_NEWOBJ) free((char*)buf5); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); - if (alloc5 == SWIG_NEWOBJ) free((char*)buf5); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Name_hasName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Name_hasName" "', argument " "1"" of type '" "char const *""'"); - } - arg1 = (char *)(buf1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Name_hasName((char const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); - return resultobj; -fail: - if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TopicList_createFromResolutionList(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - blpapi_TopicList_t *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_createFromResolutionList" "', argument " "1"" of type '" "blpapi_ResolutionList_t *""'"); - } - arg1 = (blpapi_ResolutionList_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_TopicList_t *)blpapi_TopicList_createFromResolutionList(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_intArray(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - size_t val1 ; - int ecode1 = 0 ; - PyObject *swig_obj[1] ; - intArray *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - ecode1 = SWIG_AsVal_size_t(swig_obj[0], &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_intArray" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = (size_t)(val1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (intArray *)new_intArray(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_intArray, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_intArray(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - intArray *arg1 = (intArray *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_intArray, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_intArray" "', argument " "1"" of type '" "intArray *""'"); - } - arg1 = (intArray *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - delete_intArray(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_intArray___getitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - intArray *arg1 = (intArray *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "intArray___getitem__", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_intArray, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "intArray___getitem__" "', argument " "1"" of type '" "intArray *""'"); - } - arg1 = (intArray *)(argp1); - ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "intArray___getitem__" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = (size_t)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)intArray___getitem__(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_intArray___setitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - intArray *arg1 = (intArray *) 0 ; - size_t arg2 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[3] ; - - if (!SWIG_Python_UnpackTuple(args, "intArray___setitem__", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_intArray, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "intArray___setitem__" "', argument " "1"" of type '" "intArray *""'"); - } - arg1 = (intArray *)(argp1); - ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "intArray___setitem__" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = (size_t)(val2); - ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "intArray___setitem__" "', argument " "3"" of type '" "int""'"); - } - arg3 = (int)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - intArray___setitem__(arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_intArray_cast(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - intArray *arg1 = (intArray *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_intArray, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "intArray_cast" "', argument " "1"" of type '" "intArray *""'"); - } - arg1 = (intArray *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int *)intArray_cast(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_intArray_frompointer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int *arg1 = (int *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - intArray *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "intArray_frompointer" "', argument " "1"" of type '" "int *""'"); - } - arg1 = (int *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (intArray *)intArray_frompointer(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_intArray, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *intArray_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_intArray, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *intArray_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - return SWIG_Python_InitShadowInstance(args); -} - -SWIGINTERN PyObject *_wrap_new_topicPtrArray(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - size_t val1 ; - int ecode1 = 0 ; - PyObject *swig_obj[1] ; - blpapi_Topic_t **result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - ecode1 = SWIG_AsVal_size_t(swig_obj[0], &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_topicPtrArray" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = (size_t)(val1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Topic_t **)new_topicPtrArray(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_blpapi_Topic, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_topicPtrArray(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Topic_t **arg1 = (blpapi_Topic_t **) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_p_blpapi_Topic, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_topicPtrArray" "', argument " "1"" of type '" "blpapi_Topic_t **""'"); - } - arg1 = (blpapi_Topic_t **)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - delete_topicPtrArray(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_topicPtrArray_getitem(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Topic_t **arg1 = (blpapi_Topic_t **) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - blpapi_Topic_t *result = 0 ; - - if (!SWIG_Python_UnpackTuple(args, "topicPtrArray_getitem", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_p_blpapi_Topic, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "topicPtrArray_getitem" "', argument " "1"" of type '" "blpapi_Topic_t **""'"); - } - arg1 = (blpapi_Topic_t **)(argp1); - ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "topicPtrArray_getitem" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = (size_t)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Topic_t *)topicPtrArray_getitem(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Topic, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_topicPtrArray_setitem(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Topic_t **arg1 = (blpapi_Topic_t **) 0 ; - size_t arg2 ; - blpapi_Topic_t *arg3 = (blpapi_Topic_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject *swig_obj[3] ; - - if (!SWIG_Python_UnpackTuple(args, "topicPtrArray_setitem", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_p_blpapi_Topic, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "topicPtrArray_setitem" "', argument " "1"" of type '" "blpapi_Topic_t **""'"); - } - arg1 = (blpapi_Topic_t **)(argp1); - ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "topicPtrArray_setitem" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = (size_t)(val2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "topicPtrArray_setitem" "', argument " "3"" of type '" "blpapi_Topic_t *""'"); - } - arg3 = (blpapi_Topic_t *)(argp3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - topicPtrArray_setitem(arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_CorrelationId_t_equals(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_CorrelationId_t *arg1 = (blpapi_CorrelationId_t *) 0 ; - blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "CorrelationId_t_equals", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CorrelationId_t_equals" "', argument " "1"" of type '" "blpapi_CorrelationId_t const *""'"); - } - arg1 = (blpapi_CorrelationId_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CorrelationId_t_equals" "', argument " "2"" of type '" "blpapi_CorrelationId_t const *""'"); - } - arg2 = (blpapi_CorrelationId_t *)(argp2); - result = (int)CorrelationId_t_equals((struct blpapi_CorrelationId_t_ const *)arg1,(struct blpapi_CorrelationId_t_ const *)arg2); - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_CorrelationId_value_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct blpapi_CorrelationId_t_ *arg1 = (struct blpapi_CorrelationId_t_ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - blpapi_CorrelationId_t__value *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CorrelationId_value_get" "', argument " "1"" of type '" "struct blpapi_CorrelationId_t_ *""'"); - } - arg1 = (struct blpapi_CorrelationId_t_ *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_CorrelationId_t__value *)& ((arg1)->value); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_CorrelationId_t__value, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_CorrelationId__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **SWIGUNUSEDPARM(swig_obj)) { - PyObject *resultobj = 0; - struct blpapi_CorrelationId_t_ *result = 0 ; - - if ((nobjs < 0) || (nobjs > 0)) SWIG_fail; - result = (struct blpapi_CorrelationId_t_ *)new_blpapi_CorrelationId_t___SWIG_0(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_CorrelationId_t_, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_CorrelationId__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { - PyObject *resultobj = 0; - long long arg1 ; - unsigned short arg2 = (unsigned short) 0 ; - long long val1 ; - int ecode1 = 0 ; - unsigned short val2 ; - int ecode2 = 0 ; - struct blpapi_CorrelationId_t_ *result = 0 ; - - if ((nobjs < 1) || (nobjs > 2)) SWIG_fail; - ecode1 = SWIG_AsVal_long_SS_long(swig_obj[0], &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_CorrelationId" "', argument " "1"" of type '" "long long""'"); - } - arg1 = (long long)(val1); - if (swig_obj[1]) { - ecode2 = SWIG_AsVal_unsigned_SS_short(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CorrelationId" "', argument " "2"" of type '" "unsigned short""'"); - } - arg2 = (unsigned short)(val2); - } - result = (struct blpapi_CorrelationId_t_ *)new_blpapi_CorrelationId_t___SWIG_1(arg1,arg2); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_CorrelationId_t_, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_CorrelationId__SWIG_2(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { - PyObject *resultobj = 0; - PyObject *arg1 = (PyObject *) 0 ; - unsigned short arg2 = (unsigned short) 0 ; - unsigned short val2 ; - int ecode2 = 0 ; - struct blpapi_CorrelationId_t_ *result = 0 ; - - if ((nobjs < 1) || (nobjs > 2)) SWIG_fail; - { - arg1 = swig_obj[0]; - } - if (swig_obj[1]) { - ecode2 = SWIG_AsVal_unsigned_SS_short(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CorrelationId" "', argument " "2"" of type '" "unsigned short""'"); - } - arg2 = (unsigned short)(val2); - } - result = (struct blpapi_CorrelationId_t_ *)new_blpapi_CorrelationId_t___SWIG_2(arg1,arg2); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_CorrelationId_t_, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_CorrelationId(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - - if (!(argc = SWIG_Python_UnpackTuple(args, "new_CorrelationId", 0, 2, argv))) SWIG_fail; - --argc; - if (argc == 0) { - return _wrap_new_CorrelationId__SWIG_0(self, argc, argv); - } - if ((argc >= 1) && (argc <= 2)) { - int _v; - { - int res = SWIG_AsVal_long_SS_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - if (argc <= 1) { - return _wrap_new_CorrelationId__SWIG_1(self, argc, argv); - } - { - int res = SWIG_AsVal_unsigned_SS_short(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_CorrelationId__SWIG_1(self, argc, argv); - } - } - } - if ((argc >= 1) && (argc <= 2)) { - int _v; - _v = (argv[0] != 0); - if (_v) { - if (argc <= 1) { - return _wrap_new_CorrelationId__SWIG_2(self, argc, argv); - } - { - int res = SWIG_AsVal_unsigned_SS_short(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_CorrelationId__SWIG_2(self, argc, argv); - } - } - } - -fail: - SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'new_CorrelationId'.\n" - " Possible C/C++ prototypes are:\n" - " blpapi_CorrelationId_t_::blpapi_CorrelationId_t_()\n" - " blpapi_CorrelationId_t_::blpapi_CorrelationId_t_(long long,unsigned short)\n" - " blpapi_CorrelationId_t_::blpapi_CorrelationId_t_(PyObject *,unsigned short)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_CorrelationId(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct blpapi_CorrelationId_t_ *arg1 = (struct blpapi_CorrelationId_t_ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_CorrelationId_t_, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CorrelationId" "', argument " "1"" of type '" "struct blpapi_CorrelationId_t_ *""'"); - } - arg1 = (struct blpapi_CorrelationId_t_ *)(argp1); - delete_blpapi_CorrelationId_t_(arg1); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_CorrelationId_type(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct blpapi_CorrelationId_t_ *arg1 = (struct blpapi_CorrelationId_t_ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - unsigned short result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CorrelationId_type" "', argument " "1"" of type '" "struct blpapi_CorrelationId_t_ const *""'"); - } - arg1 = (struct blpapi_CorrelationId_t_ *)(argp1); - result = (unsigned short)blpapi_CorrelationId_t__type((struct blpapi_CorrelationId_t_ const *)arg1); - resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_CorrelationId_classId(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct blpapi_CorrelationId_t_ *arg1 = (struct blpapi_CorrelationId_t_ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - unsigned short result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CorrelationId_classId" "', argument " "1"" of type '" "struct blpapi_CorrelationId_t_ const *""'"); - } - arg1 = (struct blpapi_CorrelationId_t_ *)(argp1); - result = (unsigned short)blpapi_CorrelationId_t__classId((struct blpapi_CorrelationId_t_ const *)arg1); - resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_CorrelationId___asObject(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct blpapi_CorrelationId_t_ *arg1 = (struct blpapi_CorrelationId_t_ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - PyObject *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CorrelationId___asObject" "', argument " "1"" of type '" "struct blpapi_CorrelationId_t_ const *""'"); - } - arg1 = (struct blpapi_CorrelationId_t_ *)(argp1); - result = (PyObject *)blpapi_CorrelationId_t____asObject((struct blpapi_CorrelationId_t_ const *)arg1); - { - resultobj = result; - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_CorrelationId___asInteger(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct blpapi_CorrelationId_t_ *arg1 = (struct blpapi_CorrelationId_t_ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - long long result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CorrelationId___asInteger" "', argument " "1"" of type '" "struct blpapi_CorrelationId_t_ const *""'"); - } - arg1 = (struct blpapi_CorrelationId_t_ *)(argp1); - result = (long long)blpapi_CorrelationId_t____asInteger((struct blpapi_CorrelationId_t_ const *)arg1); - resultobj = SWIG_From_long_SS_long((long long)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_CorrelationId___toInteger(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct blpapi_CorrelationId_t_ *arg1 = (struct blpapi_CorrelationId_t_ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - long long result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CorrelationId___toInteger" "', argument " "1"" of type '" "struct blpapi_CorrelationId_t_ const *""'"); - } - arg1 = (struct blpapi_CorrelationId_t_ *)(argp1); - result = (long long)blpapi_CorrelationId_t____toInteger((struct blpapi_CorrelationId_t_ const *)arg1); - resultobj = SWIG_From_long_SS_long((long long)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *CorrelationId_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_blpapi_CorrelationId_t_, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *CorrelationId_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - return SWIG_Python_InitShadowInstance(args); -} - -SWIGINTERN PyObject *_wrap_new_blpapi_CorrelationId_t__value(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_CorrelationId_t__value *result = 0 ; - - if (!SWIG_Python_UnpackTuple(args, "new_blpapi_CorrelationId_t__value", 0, 0, 0)) SWIG_fail; - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_CorrelationId_t__value *)calloc(1, sizeof(blpapi_CorrelationId_t__value)); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_CorrelationId_t__value, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_blpapi_CorrelationId_t__value(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_CorrelationId_t__value *arg1 = (blpapi_CorrelationId_t__value *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_CorrelationId_t__value, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_blpapi_CorrelationId_t__value" "', argument " "1"" of type '" "blpapi_CorrelationId_t__value *""'"); - } - arg1 = (blpapi_CorrelationId_t__value *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - free((char *) arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *blpapi_CorrelationId_t__value_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_blpapi_CorrelationId_t__value, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *blpapi_CorrelationId_t__value_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - return SWIG_Python_InitShadowInstance(args); -} - -SWIGINTERN PyObject *_wrap_blpapi_Element_toPy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - PyObject *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_toPy" "', argument " "1"" of type '" "blpapi_Element_t *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - result = (PyObject *)blpapi_Element_toPy(arg1); - { - resultobj = result; - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_setElementFloat(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - blpapi_Float64_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - double val4 ; - int ecode4 = 0 ; - PyObject *swig_obj[4] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_setElementFloat", 4, 4, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setElementFloat" "', argument " "1"" of type '" "blpapi_Element_t *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setElementFloat" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_setElementFloat" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = (blpapi_Name_t *)(argp3); - ecode4 = SWIG_AsVal_double(swig_obj[3], &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_Element_setElementFloat" "', argument " "4"" of type '" "blpapi_Float64_t""'"); - } - arg4 = (blpapi_Float64_t)(val4); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_setElementFloat(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3,arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_setValueFloat(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - blpapi_Float64_t arg2 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_setValueFloat", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setValueFloat" "', argument " "1"" of type '" "blpapi_Element_t *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - ecode2 = SWIG_AsVal_double(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Element_setValueFloat" "', argument " "2"" of type '" "blpapi_Float64_t""'"); - } - arg2 = (blpapi_Float64_t)(val2); - ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_setValueFloat" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_setValueFloat(arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_printHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - int arg2 ; - int arg3 ; - char **arg4 = (char **) 0 ; - int *arg5 = (int *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - char *temp4 = 0 ; - int tempn4 ; - PyObject *swig_obj[3] ; - - arg4 = &temp4; arg5 = &tempn4; - if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_printHelper", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_printHelper" "', argument " "1"" of type '" "blpapi_Element_t *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Element_printHelper" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); - ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_printHelper" "', argument " "3"" of type '" "int""'"); - } - arg3 = (int)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_Element_printHelper(arg1,arg2,arg3,arg4,arg5); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - if (*arg4) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtrAndSize(*arg4,*arg5)); - free(*arg4); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - blpapi_Name_t *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_name" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Name_t *)blpapi_Element_name((struct blpapi_Element const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_nameString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - char *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_nameString" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_Element_nameString((struct blpapi_Element const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_definition(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - blpapi_SchemaElementDefinition_t *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_definition" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_SchemaElementDefinition_t *)blpapi_Element_definition((struct blpapi_Element const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_datatype(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_datatype" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_datatype((struct blpapi_Element const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_isComplexType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_isComplexType" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_isComplexType((struct blpapi_Element const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_isArray(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_isArray" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_isArray((struct blpapi_Element const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_isReadOnly(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_isReadOnly" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_isReadOnly((struct blpapi_Element const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_numValues(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - size_t result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_numValues" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = blpapi_Element_numValues((struct blpapi_Element const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_size_t((size_t)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_numElements(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - size_t result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_numElements" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = blpapi_Element_numElements((struct blpapi_Element const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_size_t((size_t)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_isNullValue(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_isNullValue", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_isNullValue" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Element_isNullValue" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = (size_t)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_isNullValue((struct blpapi_Element const *)arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_isNull(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_isNull" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_isNull((struct blpapi_Element const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_getElementAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - blpapi_Element_t **arg2 = (blpapi_Element_t **) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Element_t *temp2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_getElementAt", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getElementAt" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getElementAt" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_getElementAt((struct blpapi_Element const *)arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Element, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_getElement(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - blpapi_Element_t **arg2 = (blpapi_Element_t **) 0 ; - char *arg3 = (char *) 0 ; - blpapi_Name_t *arg4 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Element_t *temp2 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject *swig_obj[3] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_getElement", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getElement" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - res3 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf3, NULL, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_getElement" "', argument " "3"" of type '" "char const *""'"); - } - arg3 = (char *)(buf3); - res4 = SWIG_ConvertPtr(swig_obj[2], &argp4,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Element_getElement" "', argument " "4"" of type '" "blpapi_Name_t const *""'"); - } - arg4 = (blpapi_Name_t *)(argp4); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_getElement((struct blpapi_Element const *)arg1,arg2,(char const *)arg3,(struct blpapi_Name const *)arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Element, 0)); - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); - return resultobj; -fail: - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_hasElementEx(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - int arg4 ; - int arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - int val4 ; - int ecode4 = 0 ; - int val5 ; - int ecode5 = 0 ; - PyObject *swig_obj[5] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_hasElementEx", 5, 5, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_hasElementEx" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_hasElementEx" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_hasElementEx" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = (blpapi_Name_t *)(argp3); - ecode4 = SWIG_AsVal_int(swig_obj[3], &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_Element_hasElementEx" "', argument " "4"" of type '" "int""'"); - } - arg4 = (int)(val4); - ecode5 = SWIG_AsVal_int(swig_obj[4], &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_Element_hasElementEx" "', argument " "5"" of type '" "int""'"); - } - arg5 = (int)(val5); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_hasElementEx((struct blpapi_Element const *)arg1,(char const *)arg2,(struct blpapi_Name const *)arg3,arg4,arg5); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsBool(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - blpapi_Bool_t *arg2 = (blpapi_Bool_t *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int temp2 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_getValueAsBool", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsBool" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getValueAsBool" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_getValueAsBool((struct blpapi_Element const *)arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, PyInt_FromLong(*arg2)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsChar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - blpapi_Char_t *arg2 = (blpapi_Char_t *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Char_t temp2 ; - int res2 = SWIG_TMPOBJ ; - size_t val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_getValueAsChar", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsChar" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getValueAsChar" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_getValueAsChar((struct blpapi_Element const *)arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (SWIG_IsTmpObj(res2)) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_char((*arg2))); - } else { - int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_char, new_flags)); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsInt32(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - blpapi_Int32_t *arg2 = (blpapi_Int32_t *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int temp2 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_getValueAsInt32", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsInt32" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getValueAsInt32" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_getValueAsInt32((struct blpapi_Element const *)arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, PyInt_FromLong(*arg2)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsInt64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - blpapi_Int64_t *arg2 = (blpapi_Int64_t *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Int64_t temp2 ; - int res2 = SWIG_TMPOBJ ; - size_t val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_getValueAsInt64", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsInt64" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getValueAsInt64" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_getValueAsInt64((struct blpapi_Element const *)arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (SWIG_IsTmpObj(res2)) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_long_SS_long((*arg2))); - } else { - int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_long_long, new_flags)); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsFloat64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - blpapi_Float64_t *arg2 = (blpapi_Float64_t *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Float64_t temp2 ; - int res2 = SWIG_TMPOBJ ; - size_t val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_getValueAsFloat64", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsFloat64" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getValueAsFloat64" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_getValueAsFloat64((struct blpapi_Element const *)arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (SWIG_IsTmpObj(res2)) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_double((*arg2))); - } else { - int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_double, new_flags)); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - char **arg2 = (char **) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - char *temp2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_getValueAsString", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsString" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getValueAsString" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_getValueAsString((struct blpapi_Element const *)arg1,(char const **)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsDatetime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - blpapi_Datetime_t *arg2 = (blpapi_Datetime_t *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Datetime_t temp2 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_getValueAsDatetime", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsDatetime" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getValueAsDatetime" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_getValueAsDatetime((struct blpapi_Element const *)arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - { - blpapi_Datetime_t *outputPtr = (blpapi_Datetime_t *) malloc(sizeof(blpapi_Datetime_t)); - *outputPtr = *arg2; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(outputPtr, SWIGTYPE_p_blpapi_Datetime_tag, SWIG_POINTER_OWN)); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsHighPrecisionDatetime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - blpapi_HighPrecisionDatetime_t *arg2 = (blpapi_HighPrecisionDatetime_t *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_HighPrecisionDatetime_t temp2 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_getValueAsHighPrecisionDatetime", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsHighPrecisionDatetime" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getValueAsHighPrecisionDatetime" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_getValueAsHighPrecisionDatetime((struct blpapi_Element const *)arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - { - blpapi_HighPrecisionDatetime_t *outputPtr = (blpapi_HighPrecisionDatetime_t *) malloc(sizeof(blpapi_HighPrecisionDatetime_t)); - *outputPtr = *arg2; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(outputPtr, SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, SWIG_POINTER_OWN)); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsElement(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - blpapi_Element_t **arg2 = (blpapi_Element_t **) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Element_t *temp2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_getValueAsElement", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsElement" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getValueAsElement" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_getValueAsElement((struct blpapi_Element const *)arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Element, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - blpapi_Name_t **arg2 = (blpapi_Name_t **) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Name_t *temp2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_getValueAsName", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsName" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_getValueAsName" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_getValueAsName((struct blpapi_Element const *)arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Name, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsBytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - char **arg2 = (char **) 0 ; - size_t *arg3 = (size_t *) 0 ; - size_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - char *temp2 = 0 ; - size_t tempLength2 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - PyObject *swig_obj[2] ; - int result; - - { - arg2 = &temp2; - arg3 = &tempLength2; - } - if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_getValueAsBytes", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getValueAsBytes" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - ecode4 = SWIG_AsVal_size_t(swig_obj[1], &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_Element_getValueAsBytes" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = (size_t)(val4); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_getValueAsBytes((struct blpapi_Element const *)arg1,(char const **)arg2,arg3,arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - { - resultobj = SWIG_Python_AppendOutput(resultobj, PyBytes_FromStringAndSize(*arg2, *arg3)); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_getChoice(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - blpapi_Element_t **arg2 = (blpapi_Element_t **) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Element_t *temp2 = 0 ; - PyObject *swig_obj[1] ; - int result; - - arg2 = &temp2; - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_getChoice" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_getChoice((struct blpapi_Element const *)arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Element, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_setValueBool(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - blpapi_Bool_t arg2 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_setValueBool", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setValueBool" "', argument " "1"" of type '" "blpapi_Element_t *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Element_setValueBool" "', argument " "2"" of type '" "blpapi_Bool_t""'"); - } - arg2 = (blpapi_Bool_t)(val2); - ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_setValueBool" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_setValueBool(arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_setValueInt32(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - blpapi_Int32_t arg2 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_setValueInt32", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setValueInt32" "', argument " "1"" of type '" "blpapi_Element_t *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Element_setValueInt32" "', argument " "2"" of type '" "blpapi_Int32_t""'"); - } - arg2 = (blpapi_Int32_t)(val2); - ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_setValueInt32" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_setValueInt32(arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_setValueInt64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - blpapi_Int64_t arg2 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - long long val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_setValueInt64", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setValueInt64" "', argument " "1"" of type '" "blpapi_Element_t *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - ecode2 = SWIG_AsVal_long_SS_long(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Element_setValueInt64" "', argument " "2"" of type '" "blpapi_Int64_t""'"); - } - arg2 = (blpapi_Int64_t)(val2); - ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_setValueInt64" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_setValueInt64(arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_setValueString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - char *arg2 = (char *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_setValueString", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setValueString" "', argument " "1"" of type '" "blpapi_Element_t *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setValueString" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_setValueString" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_setValueString(arg1,(char const *)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_setValueHighPrecisionDatetime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - blpapi_HighPrecisionDatetime_t *arg2 = (blpapi_HighPrecisionDatetime_t *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_setValueHighPrecisionDatetime", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setValueHighPrecisionDatetime" "', argument " "1"" of type '" "blpapi_Element_t *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setValueHighPrecisionDatetime" "', argument " "2"" of type '" "blpapi_HighPrecisionDatetime_t const *""'"); - } - arg2 = (blpapi_HighPrecisionDatetime_t *)(argp2); - ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_setValueHighPrecisionDatetime" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_setValueHighPrecisionDatetime(arg1,(struct blpapi_HighPrecisionDatetime_tag const *)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_setValueBytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - char *arg2 = (char *) 0 ; - size_t arg3 ; - size_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_setValueBytes", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setValueBytes" "', argument " "1"" of type '" "blpapi_Element_t *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - { - if (swig_obj[1] == Py_None) { - arg2 = 0; - arg3 = 0; - } - else { - arg2 = PyBytes_AsString(swig_obj[1]); - arg3 = PyBytes_Size(swig_obj[1]); - } - } - ecode4 = SWIG_AsVal_size_t(swig_obj[2], &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_Element_setValueBytes" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = (size_t)(val4); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_setValueBytes(arg1,(char const *)arg2,arg3,arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_setValueFromName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_setValueFromName", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setValueFromName" "', argument " "1"" of type '" "blpapi_Element_t *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setValueFromName" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); - } - arg2 = (blpapi_Name_t *)(argp2); - ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Element_setValueFromName" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_setValueFromName(arg1,(struct blpapi_Name const *)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_setElementBool(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - blpapi_Bool_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - int val4 ; - int ecode4 = 0 ; - PyObject *swig_obj[4] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_setElementBool", 4, 4, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setElementBool" "', argument " "1"" of type '" "blpapi_Element_t *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setElementBool" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_setElementBool" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = (blpapi_Name_t *)(argp3); - ecode4 = SWIG_AsVal_int(swig_obj[3], &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_Element_setElementBool" "', argument " "4"" of type '" "blpapi_Bool_t""'"); - } - arg4 = (blpapi_Bool_t)(val4); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_setElementBool(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3,arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_setElementInt32(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - blpapi_Int32_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - int val4 ; - int ecode4 = 0 ; - PyObject *swig_obj[4] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_setElementInt32", 4, 4, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setElementInt32" "', argument " "1"" of type '" "blpapi_Element_t *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setElementInt32" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_setElementInt32" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = (blpapi_Name_t *)(argp3); - ecode4 = SWIG_AsVal_int(swig_obj[3], &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_Element_setElementInt32" "', argument " "4"" of type '" "blpapi_Int32_t""'"); - } - arg4 = (blpapi_Int32_t)(val4); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_setElementInt32(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3,arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_setElementInt64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - blpapi_Int64_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long long val4 ; - int ecode4 = 0 ; - PyObject *swig_obj[4] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_setElementInt64", 4, 4, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setElementInt64" "', argument " "1"" of type '" "blpapi_Element_t *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setElementInt64" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_setElementInt64" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = (blpapi_Name_t *)(argp3); - ecode4 = SWIG_AsVal_long_SS_long(swig_obj[3], &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_Element_setElementInt64" "', argument " "4"" of type '" "blpapi_Int64_t""'"); - } - arg4 = (blpapi_Int64_t)(val4); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_setElementInt64(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3,arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_setElementString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - char *arg4 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - int res4 ; - char *buf4 = 0 ; - int alloc4 = 0 ; - PyObject *swig_obj[4] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_setElementString", 4, 4, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setElementString" "', argument " "1"" of type '" "blpapi_Element_t *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setElementString" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_setElementString" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = (blpapi_Name_t *)(argp3); - res4 = SWIG_AsCharPtrAndSize(swig_obj[3], &buf4, NULL, &alloc4); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Element_setElementString" "', argument " "4"" of type '" "char const *""'"); - } - arg4 = (char *)(buf4); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_setElementString(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3,(char const *)arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_setElementHighPrecisionDatetime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - blpapi_HighPrecisionDatetime_t *arg4 = (blpapi_HighPrecisionDatetime_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject *swig_obj[4] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_setElementHighPrecisionDatetime", 4, 4, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setElementHighPrecisionDatetime" "', argument " "1"" of type '" "blpapi_Element_t *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setElementHighPrecisionDatetime" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_setElementHighPrecisionDatetime" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = (blpapi_Name_t *)(argp3); - res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Element_setElementHighPrecisionDatetime" "', argument " "4"" of type '" "blpapi_HighPrecisionDatetime_t const *""'"); - } - arg4 = (blpapi_HighPrecisionDatetime_t *)(argp4); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_setElementHighPrecisionDatetime(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3,(struct blpapi_HighPrecisionDatetime_tag const *)arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_setElementBytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - char *arg4 = (char *) 0 ; - size_t arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject *swig_obj[4] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_setElementBytes", 4, 4, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setElementBytes" "', argument " "1"" of type '" "blpapi_Element_t *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setElementBytes" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_setElementBytes" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = (blpapi_Name_t *)(argp3); - { - if (swig_obj[3] == Py_None) { - arg4 = 0; - arg5 = 0; - } - else { - arg4 = PyBytes_AsString(swig_obj[3]); - arg5 = PyBytes_Size(swig_obj[3]); - } - } - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_setElementBytes(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3,(char const *)arg4,arg5); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_setElementFromName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - blpapi_Name_t *arg4 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject *swig_obj[4] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_setElementFromName", 4, 4, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setElementFromName" "', argument " "1"" of type '" "blpapi_Element_t *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Element_setElementFromName" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_setElementFromName" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = (blpapi_Name_t *)(argp3); - res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Element_setElementFromName" "', argument " "4"" of type '" "blpapi_Name_t const *""'"); - } - arg4 = (blpapi_Name_t *)(argp4); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_setElementFromName(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3,(struct blpapi_Name const *)arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_appendElement(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - blpapi_Element_t **arg2 = (blpapi_Element_t **) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Element_t *temp2 = 0 ; - PyObject *swig_obj[1] ; - int result; - - arg2 = &temp2; - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_appendElement" "', argument " "1"" of type '" "blpapi_Element_t *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_appendElement(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Element, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Element_setChoice(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Element_t *arg1 = (blpapi_Element_t *) 0 ; - blpapi_Element_t **arg2 = (blpapi_Element_t **) 0 ; - char *arg3 = (char *) 0 ; - blpapi_Name_t *arg4 = (blpapi_Name_t *) 0 ; - size_t arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Element_t *temp2 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - PyObject *swig_obj[4] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_Element_setChoice", 4, 4, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_setChoice" "', argument " "1"" of type '" "blpapi_Element_t *""'"); - } - arg1 = (blpapi_Element_t *)(argp1); - res3 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf3, NULL, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Element_setChoice" "', argument " "3"" of type '" "char const *""'"); - } - arg3 = (char *)(buf3); - res4 = SWIG_ConvertPtr(swig_obj[2], &argp4,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Element_setChoice" "', argument " "4"" of type '" "blpapi_Name_t const *""'"); - } - arg4 = (blpapi_Name_t *)(argp4); - ecode5 = SWIG_AsVal_size_t(swig_obj[3], &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_Element_setChoice" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = (size_t)(val5); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Element_setChoice(arg1,arg2,(char const *)arg3,(struct blpapi_Name const *)arg4,arg5); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Element, 0)); - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); - return resultobj; -fail: - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueFloat(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - blpapi_Float64_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - double val4 ; - int ecode4 = 0 ; - PyObject *swig_obj[4] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_setValueFloat", 4, 4, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_setValueFloat" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = (blpapi_EventFormatter_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_setValueFloat" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_setValueFloat" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = (blpapi_Name_t *)(argp3); - ecode4 = SWIG_AsVal_double(swig_obj[3], &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_EventFormatter_setValueFloat" "', argument " "4"" of type '" "blpapi_Float64_t""'"); - } - arg4 = (blpapi_Float64_t)(val4); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_setValueFloat(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3,arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueFloat(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - blpapi_Float64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_appendValueFloat", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendValueFloat" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = (blpapi_EventFormatter_t *)(argp1); - ecode2 = SWIG_AsVal_double(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_EventFormatter_appendValueFloat" "', argument " "2"" of type '" "blpapi_Float64_t""'"); - } - arg2 = (blpapi_Float64_t)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_appendValueFloat(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Event_t *arg1 = (blpapi_Event_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - blpapi_EventFormatter_t *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Event, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_create" "', argument " "1"" of type '" "blpapi_Event_t *""'"); - } - arg1 = (blpapi_Event_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_EventFormatter_t *)blpapi_EventFormatter_create(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_destroy" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = (blpapi_EventFormatter_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_EventFormatter_destroy(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendMessage(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - blpapi_Topic_t *arg4 = (blpapi_Topic_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject *swig_obj[4] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_appendMessage", 4, 4, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendMessage" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = (blpapi_EventFormatter_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendMessage" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_appendMessage" "', argument " "3"" of type '" "blpapi_Name_t *""'"); - } - arg3 = (blpapi_Name_t *)(argp3); - res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_EventFormatter_appendMessage" "', argument " "4"" of type '" "blpapi_Topic_t const *""'"); - } - arg4 = (blpapi_Topic_t *)(argp4); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_appendMessage(arg1,(char const *)arg2,arg3,(struct blpapi_Topic const *)arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendMessageSeq(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - blpapi_Topic_t *arg4 = (blpapi_Topic_t *) 0 ; - unsigned int arg5 ; - unsigned int arg6 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - unsigned int val5 ; - int ecode5 = 0 ; - unsigned int val6 ; - int ecode6 = 0 ; - PyObject *swig_obj[6] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_appendMessageSeq", 6, 6, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendMessageSeq" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = (blpapi_EventFormatter_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendMessageSeq" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_appendMessageSeq" "', argument " "3"" of type '" "blpapi_Name_t *""'"); - } - arg3 = (blpapi_Name_t *)(argp3); - res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_EventFormatter_appendMessageSeq" "', argument " "4"" of type '" "blpapi_Topic_t const *""'"); - } - arg4 = (blpapi_Topic_t *)(argp4); - ecode5 = SWIG_AsVal_unsigned_SS_int(swig_obj[4], &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_EventFormatter_appendMessageSeq" "', argument " "5"" of type '" "unsigned int""'"); - } - arg5 = (unsigned int)(val5); - ecode6 = SWIG_AsVal_unsigned_SS_int(swig_obj[5], &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "blpapi_EventFormatter_appendMessageSeq" "', argument " "6"" of type '" "unsigned int""'"); - } - arg6 = (unsigned int)(val6); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_appendMessageSeq(arg1,(char const *)arg2,arg3,(struct blpapi_Topic const *)arg4,arg5,arg6); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendResponse(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_appendResponse", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendResponse" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = (blpapi_EventFormatter_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendResponse" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_appendResponse" "', argument " "3"" of type '" "blpapi_Name_t *""'"); - } - arg3 = (blpapi_Name_t *)(argp3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_appendResponse(arg1,(char const *)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendRecapMessage(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - blpapi_Topic_t *arg2 = (blpapi_Topic_t *) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_appendRecapMessage", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendRecapMessage" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = (blpapi_EventFormatter_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendRecapMessage" "', argument " "2"" of type '" "blpapi_Topic_t const *""'"); - } - arg2 = (blpapi_Topic_t *)(argp2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_appendRecapMessage" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); - } - arg3 = (blpapi_CorrelationId_t *)(argp3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_appendRecapMessage(arg1,(struct blpapi_Topic const *)arg2,(struct blpapi_CorrelationId_t_ const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendRecapMessageSeq(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - blpapi_Topic_t *arg2 = (blpapi_Topic_t *) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; - unsigned int arg4 ; - unsigned int arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - unsigned int val4 ; - int ecode4 = 0 ; - unsigned int val5 ; - int ecode5 = 0 ; - PyObject *swig_obj[5] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_appendRecapMessageSeq", 5, 5, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendRecapMessageSeq" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = (blpapi_EventFormatter_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendRecapMessageSeq" "', argument " "2"" of type '" "blpapi_Topic_t const *""'"); - } - arg2 = (blpapi_Topic_t *)(argp2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_appendRecapMessageSeq" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); - } - arg3 = (blpapi_CorrelationId_t *)(argp3); - ecode4 = SWIG_AsVal_unsigned_SS_int(swig_obj[3], &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_EventFormatter_appendRecapMessageSeq" "', argument " "4"" of type '" "unsigned int""'"); - } - arg4 = (unsigned int)(val4); - ecode5 = SWIG_AsVal_unsigned_SS_int(swig_obj[4], &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_EventFormatter_appendRecapMessageSeq" "', argument " "5"" of type '" "unsigned int""'"); - } - arg5 = (unsigned int)(val5); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_appendRecapMessageSeq(arg1,(struct blpapi_Topic const *)arg2,(struct blpapi_CorrelationId_t_ const *)arg3,arg4,arg5); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendFragmentedRecapMessage(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - blpapi_Topic_t *arg4 = (blpapi_Topic_t *) 0 ; - blpapi_CorrelationId_t *arg5 = (blpapi_CorrelationId_t *) 0 ; - int arg6 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - int val6 ; - int ecode6 = 0 ; - PyObject *swig_obj[6] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_appendFragmentedRecapMessage", 6, 6, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessage" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = (blpapi_EventFormatter_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessage" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessage" "', argument " "3"" of type '" "blpapi_Name_t *""'"); - } - arg3 = (blpapi_Name_t *)(argp3); - res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessage" "', argument " "4"" of type '" "blpapi_Topic_t const *""'"); - } - arg4 = (blpapi_Topic_t *)(argp4); - res5 = SWIG_ConvertPtr(swig_obj[4], &argp5,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessage" "', argument " "5"" of type '" "blpapi_CorrelationId_t const *""'"); - } - arg5 = (blpapi_CorrelationId_t *)(argp5); - ecode6 = SWIG_AsVal_int(swig_obj[5], &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessage" "', argument " "6"" of type '" "int""'"); - } - arg6 = (int)(val6); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_appendFragmentedRecapMessage(arg1,(char const *)arg2,arg3,(struct blpapi_Topic const *)arg4,(struct blpapi_CorrelationId_t_ const *)arg5,arg6); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendFragmentedRecapMessageSeq(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - blpapi_Topic_t *arg4 = (blpapi_Topic_t *) 0 ; - int arg5 ; - unsigned int arg6 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - int val5 ; - int ecode5 = 0 ; - unsigned int val6 ; - int ecode6 = 0 ; - PyObject *swig_obj[6] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_appendFragmentedRecapMessageSeq", 6, 6, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessageSeq" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = (blpapi_EventFormatter_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessageSeq" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessageSeq" "', argument " "3"" of type '" "blpapi_Name_t *""'"); - } - arg3 = (blpapi_Name_t *)(argp3); - res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessageSeq" "', argument " "4"" of type '" "blpapi_Topic_t const *""'"); - } - arg4 = (blpapi_Topic_t *)(argp4); - ecode5 = SWIG_AsVal_int(swig_obj[4], &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessageSeq" "', argument " "5"" of type '" "int""'"); - } - arg5 = (int)(val5); - ecode6 = SWIG_AsVal_unsigned_SS_int(swig_obj[5], &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "blpapi_EventFormatter_appendFragmentedRecapMessageSeq" "', argument " "6"" of type '" "unsigned int""'"); - } - arg6 = (unsigned int)(val6); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_appendFragmentedRecapMessageSeq(arg1,(char const *)arg2,arg3,(struct blpapi_Topic const *)arg4,arg5,arg6); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueBool(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - blpapi_Bool_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - int val4 ; - int ecode4 = 0 ; - PyObject *swig_obj[4] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_setValueBool", 4, 4, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_setValueBool" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = (blpapi_EventFormatter_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_setValueBool" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_setValueBool" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = (blpapi_Name_t *)(argp3); - ecode4 = SWIG_AsVal_int(swig_obj[3], &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_EventFormatter_setValueBool" "', argument " "4"" of type '" "blpapi_Bool_t""'"); - } - arg4 = (blpapi_Bool_t)(val4); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_setValueBool(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3,arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueChar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - char arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - char val4 ; - int ecode4 = 0 ; - PyObject *swig_obj[4] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_setValueChar", 4, 4, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_setValueChar" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = (blpapi_EventFormatter_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_setValueChar" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_setValueChar" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = (blpapi_Name_t *)(argp3); - ecode4 = SWIG_AsVal_char(swig_obj[3], &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_EventFormatter_setValueChar" "', argument " "4"" of type '" "char""'"); - } - arg4 = (char)(val4); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_setValueChar(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3,arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueInt32(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - blpapi_Int32_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - int val4 ; - int ecode4 = 0 ; - PyObject *swig_obj[4] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_setValueInt32", 4, 4, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_setValueInt32" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = (blpapi_EventFormatter_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_setValueInt32" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_setValueInt32" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = (blpapi_Name_t *)(argp3); - ecode4 = SWIG_AsVal_int(swig_obj[3], &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_EventFormatter_setValueInt32" "', argument " "4"" of type '" "blpapi_Int32_t""'"); - } - arg4 = (blpapi_Int32_t)(val4); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_setValueInt32(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3,arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueInt64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - blpapi_Int64_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long long val4 ; - int ecode4 = 0 ; - PyObject *swig_obj[4] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_setValueInt64", 4, 4, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_setValueInt64" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = (blpapi_EventFormatter_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_setValueInt64" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_setValueInt64" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = (blpapi_Name_t *)(argp3); - ecode4 = SWIG_AsVal_long_SS_long(swig_obj[3], &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_EventFormatter_setValueInt64" "', argument " "4"" of type '" "blpapi_Int64_t""'"); - } - arg4 = (blpapi_Int64_t)(val4); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_setValueInt64(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3,arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueHighPrecisionDatetime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - blpapi_HighPrecisionDatetime_t *arg4 = (blpapi_HighPrecisionDatetime_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject *swig_obj[4] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_setValueHighPrecisionDatetime", 4, 4, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_setValueHighPrecisionDatetime" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = (blpapi_EventFormatter_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_setValueHighPrecisionDatetime" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_setValueHighPrecisionDatetime" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = (blpapi_Name_t *)(argp3); - res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_EventFormatter_setValueHighPrecisionDatetime" "', argument " "4"" of type '" "blpapi_HighPrecisionDatetime_t const *""'"); - } - arg4 = (blpapi_HighPrecisionDatetime_t *)(argp4); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_setValueHighPrecisionDatetime(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3,(struct blpapi_HighPrecisionDatetime_tag const *)arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - char *arg4 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - int res4 ; - char *buf4 = 0 ; - int alloc4 = 0 ; - PyObject *swig_obj[4] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_setValueString", 4, 4, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_setValueString" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = (blpapi_EventFormatter_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_setValueString" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_setValueString" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = (blpapi_Name_t *)(argp3); - res4 = SWIG_AsCharPtrAndSize(swig_obj[3], &buf4, NULL, &alloc4); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_EventFormatter_setValueString" "', argument " "4"" of type '" "char const *""'"); - } - arg4 = (char *)(buf4); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_setValueString(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3,(char const *)arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueFromName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - blpapi_Name_t *arg4 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject *swig_obj[4] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_setValueFromName", 4, 4, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_setValueFromName" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = (blpapi_EventFormatter_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_setValueFromName" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_setValueFromName" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = (blpapi_Name_t *)(argp3); - res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_EventFormatter_setValueFromName" "', argument " "4"" of type '" "blpapi_Name_t const *""'"); - } - arg4 = (blpapi_Name_t *)(argp4); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_setValueFromName(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3,(struct blpapi_Name const *)arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueBytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - char *arg4 = (char *) 0 ; - size_t arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject *swig_obj[4] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_setValueBytes", 4, 4, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_setValueBytes" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = (blpapi_EventFormatter_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_setValueBytes" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_setValueBytes" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = (blpapi_Name_t *)(argp3); - { - if (swig_obj[3] == Py_None) { - arg4 = 0; - arg5 = 0; - } - else { - arg4 = PyBytes_AsString(swig_obj[3]); - arg5 = PyBytes_Size(swig_obj[3]); - } - } - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_setValueBytes(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3,(char const *)arg4,arg5); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueNull(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_setValueNull", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_setValueNull" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = (blpapi_EventFormatter_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_setValueNull" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_setValueNull" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = (blpapi_Name_t *)(argp3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_setValueNull(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_pushElement(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_pushElement", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_pushElement" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = (blpapi_EventFormatter_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_pushElement" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_EventFormatter_pushElement" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = (blpapi_Name_t *)(argp3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_pushElement(arg1,(char const *)arg2,(struct blpapi_Name const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_popElement(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_popElement" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = (blpapi_EventFormatter_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_popElement(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueBool(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - blpapi_Bool_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_appendValueBool", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendValueBool" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = (blpapi_EventFormatter_t *)(argp1); - ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_EventFormatter_appendValueBool" "', argument " "2"" of type '" "blpapi_Bool_t""'"); - } - arg2 = (blpapi_Bool_t)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_appendValueBool(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueChar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - char arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - char val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_appendValueChar", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendValueChar" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = (blpapi_EventFormatter_t *)(argp1); - ecode2 = SWIG_AsVal_char(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_EventFormatter_appendValueChar" "', argument " "2"" of type '" "char""'"); - } - arg2 = (char)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_appendValueChar(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueInt32(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - blpapi_Int32_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_appendValueInt32", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendValueInt32" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = (blpapi_EventFormatter_t *)(argp1); - ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_EventFormatter_appendValueInt32" "', argument " "2"" of type '" "blpapi_Int32_t""'"); - } - arg2 = (blpapi_Int32_t)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_appendValueInt32(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueInt64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - blpapi_Int64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long long val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_appendValueInt64", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendValueInt64" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = (blpapi_EventFormatter_t *)(argp1); - ecode2 = SWIG_AsVal_long_SS_long(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_EventFormatter_appendValueInt64" "', argument " "2"" of type '" "blpapi_Int64_t""'"); - } - arg2 = (blpapi_Int64_t)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_appendValueInt64(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueHighPrecisionDatetime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - blpapi_HighPrecisionDatetime_t *arg2 = (blpapi_HighPrecisionDatetime_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_appendValueHighPrecisionDatetime", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendValueHighPrecisionDatetime" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = (blpapi_EventFormatter_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendValueHighPrecisionDatetime" "', argument " "2"" of type '" "blpapi_HighPrecisionDatetime_t const *""'"); - } - arg2 = (blpapi_HighPrecisionDatetime_t *)(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_appendValueHighPrecisionDatetime(arg1,(struct blpapi_HighPrecisionDatetime_tag const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_appendValueString", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendValueString" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = (blpapi_EventFormatter_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendValueString" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_appendValueString(arg1,(char const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueFromName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_EventFormatter_appendValueFromName", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendValueFromName" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = (blpapi_EventFormatter_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_EventFormatter_appendValueFromName" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); - } - arg2 = (blpapi_Name_t *)(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_appendValueFromName(arg1,(struct blpapi_Name const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendElement(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventFormatter_t *arg1 = (blpapi_EventFormatter_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventFormatter_appendElement" "', argument " "1"" of type '" "blpapi_EventFormatter_t *""'"); - } - arg1 = (blpapi_EventFormatter_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventFormatter_appendElement(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Session_createHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - PyObject *arg2 = (PyObject *) 0 ; - blpapi_EventDispatcher_t *arg3 = (blpapi_EventDispatcher_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject *swig_obj[3] ; - blpapi_Session_t *result = 0 ; - - if (!SWIG_Python_UnpackTuple(args, "Session_createHelper", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_createHelper" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - { - arg2 = swig_obj[1]; - } - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_EventDispatcher, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Session_createHelper" "', argument " "3"" of type '" "blpapi_EventDispatcher_t *""'"); - } - arg3 = (blpapi_EventDispatcher_t *)(argp3); - result = (blpapi_Session_t *)Session_createHelper(arg1,arg2,arg3); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Session, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Session_destroyHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - PyObject *arg2 = (PyObject *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[2] ; - - if (!SWIG_Python_UnpackTuple(args, "Session_destroyHelper", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_destroyHelper" "', argument " "1"" of type '" "blpapi_Session_t *""'"); - } - arg1 = (blpapi_Session_t *)(argp1); - { - arg2 = swig_obj[1]; - } - Session_destroyHelper(arg1,arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventDispatcher_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - size_t val1 ; - int ecode1 = 0 ; - PyObject *swig_obj[1] ; - blpapi_EventDispatcher_t *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - ecode1 = SWIG_AsVal_size_t(swig_obj[0], &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "blpapi_EventDispatcher_create" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = (size_t)(val1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_EventDispatcher_t *)blpapi_EventDispatcher_create(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_EventDispatcher, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventDispatcher_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventDispatcher_t *arg1 = (blpapi_EventDispatcher_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventDispatcher, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventDispatcher_destroy" "', argument " "1"" of type '" "blpapi_EventDispatcher_t *""'"); - } - arg1 = (blpapi_EventDispatcher_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_EventDispatcher_destroy(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventDispatcher_start(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventDispatcher_t *arg1 = (blpapi_EventDispatcher_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventDispatcher, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventDispatcher_start" "', argument " "1"" of type '" "blpapi_EventDispatcher_t *""'"); - } - arg1 = (blpapi_EventDispatcher_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventDispatcher_start(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProviderSession_createHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - PyObject *arg2 = (PyObject *) 0 ; - blpapi_EventDispatcher_t *arg3 = (blpapi_EventDispatcher_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject *swig_obj[3] ; - blpapi_ProviderSession_t *result = 0 ; - - if (!SWIG_Python_UnpackTuple(args, "ProviderSession_createHelper", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProviderSession_createHelper" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - { - arg2 = swig_obj[1]; - } - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_EventDispatcher, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProviderSession_createHelper" "', argument " "3"" of type '" "blpapi_EventDispatcher_t *""'"); - } - arg3 = (blpapi_EventDispatcher_t *)(argp3); - result = (blpapi_ProviderSession_t *)ProviderSession_createHelper(arg1,arg2,arg3); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProviderSession_destroyHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - PyObject *arg2 = (PyObject *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[2] ; - - if (!SWIG_Python_UnpackTuple(args, "ProviderSession_destroyHelper", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProviderSession_destroyHelper" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = (blpapi_ProviderSession_t *)(argp1); - { - arg2 = swig_obj[1]; - } - ProviderSession_destroyHelper(arg1,arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProviderSession_terminateSubscriptionsOnTopic(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - blpapi_Topic_t *arg2 = (blpapi_Topic_t *) 0 ; - char *arg3 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "ProviderSession_terminateSubscriptionsOnTopic", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProviderSession_terminateSubscriptionsOnTopic" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = (blpapi_ProviderSession_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProviderSession_terminateSubscriptionsOnTopic" "', argument " "2"" of type '" "blpapi_Topic_t const *""'"); - } - arg2 = (blpapi_Topic_t *)(argp2); - res3 = SWIG_AsCharPtrAndSize(swig_obj[2], &buf3, NULL, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProviderSession_terminateSubscriptionsOnTopic" "', argument " "3"" of type '" "char const *""'"); - } - arg3 = (char *)(buf3); - result = (int)ProviderSession_terminateSubscriptionsOnTopic(arg1,(struct blpapi_Topic const *)arg2,(char const *)arg3); - resultobj = SWIG_From_int((int)(result)); - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); - return resultobj; -fail: - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_setValueFloat(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; - blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; - blpapi_Float64_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - double val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_setValueFloat", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_setValueFloat" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); - } - arg1 = (blpapi_MessageFormatter_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_setValueFloat" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); - } - arg2 = (blpapi_Name_t *)(argp2); - ecode3 = SWIG_AsVal_double(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_MessageFormatter_setValueFloat" "', argument " "3"" of type '" "blpapi_Float64_t""'"); - } - arg3 = (blpapi_Float64_t)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_MessageFormatter_setValueFloat(arg1,(struct blpapi_Name const *)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_appendValueFloat(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; - blpapi_Float64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_appendValueFloat", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_appendValueFloat" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); - } - arg1 = (blpapi_MessageFormatter_t *)(argp1); - ecode2 = SWIG_AsVal_double(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_MessageFormatter_appendValueFloat" "', argument " "2"" of type '" "blpapi_Float64_t""'"); - } - arg2 = (blpapi_Float64_t)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_MessageFormatter_appendValueFloat(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_setValueBool(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; - blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; - blpapi_Bool_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_setValueBool", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_setValueBool" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); - } - arg1 = (blpapi_MessageFormatter_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_setValueBool" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); - } - arg2 = (blpapi_Name_t *)(argp2); - ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_MessageFormatter_setValueBool" "', argument " "3"" of type '" "blpapi_Bool_t""'"); - } - arg3 = (blpapi_Bool_t)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_MessageFormatter_setValueBool(arg1,(struct blpapi_Name const *)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_setValueChar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; - blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; - char arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - char val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_setValueChar", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_setValueChar" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); - } - arg1 = (blpapi_MessageFormatter_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_setValueChar" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); - } - arg2 = (blpapi_Name_t *)(argp2); - ecode3 = SWIG_AsVal_char(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_MessageFormatter_setValueChar" "', argument " "3"" of type '" "char""'"); - } - arg3 = (char)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_MessageFormatter_setValueChar(arg1,(struct blpapi_Name const *)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_setValueInt32(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; - blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; - blpapi_Int32_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_setValueInt32", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_setValueInt32" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); - } - arg1 = (blpapi_MessageFormatter_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_setValueInt32" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); - } - arg2 = (blpapi_Name_t *)(argp2); - ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_MessageFormatter_setValueInt32" "', argument " "3"" of type '" "blpapi_Int32_t""'"); - } - arg3 = (blpapi_Int32_t)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_MessageFormatter_setValueInt32(arg1,(struct blpapi_Name const *)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_setValueInt64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; - blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; - blpapi_Int64_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - long long val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_setValueInt64", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_setValueInt64" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); - } - arg1 = (blpapi_MessageFormatter_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_setValueInt64" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); - } - arg2 = (blpapi_Name_t *)(argp2); - ecode3 = SWIG_AsVal_long_SS_long(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_MessageFormatter_setValueInt64" "', argument " "3"" of type '" "blpapi_Int64_t""'"); - } - arg3 = (blpapi_Int64_t)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_MessageFormatter_setValueInt64(arg1,(struct blpapi_Name const *)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_setValueFloat32(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; - blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; - blpapi_Float32_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - float val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_setValueFloat32", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_setValueFloat32" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); - } - arg1 = (blpapi_MessageFormatter_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_setValueFloat32" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); - } - arg2 = (blpapi_Name_t *)(argp2); - ecode3 = SWIG_AsVal_float(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_MessageFormatter_setValueFloat32" "', argument " "3"" of type '" "blpapi_Float32_t""'"); - } - arg3 = (blpapi_Float32_t)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_MessageFormatter_setValueFloat32(arg1,(struct blpapi_Name const *)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_setValueFloat64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; - blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; - blpapi_Float64_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - double val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_setValueFloat64", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_setValueFloat64" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); - } - arg1 = (blpapi_MessageFormatter_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_setValueFloat64" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); - } - arg2 = (blpapi_Name_t *)(argp2); - ecode3 = SWIG_AsVal_double(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_MessageFormatter_setValueFloat64" "', argument " "3"" of type '" "blpapi_Float64_t""'"); - } - arg3 = (blpapi_Float64_t)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_MessageFormatter_setValueFloat64(arg1,(struct blpapi_Name const *)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_setValueDatetime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; - blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; - blpapi_Datetime_t *arg3 = (blpapi_Datetime_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_setValueDatetime", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_setValueDatetime" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); - } - arg1 = (blpapi_MessageFormatter_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_setValueDatetime" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); - } - arg2 = (blpapi_Name_t *)(argp2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_MessageFormatter_setValueDatetime" "', argument " "3"" of type '" "blpapi_Datetime_t const *""'"); - } - arg3 = (blpapi_Datetime_t *)(argp3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_MessageFormatter_setValueDatetime(arg1,(struct blpapi_Name const *)arg2,(struct blpapi_Datetime_tag const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_setValueHighPrecisionDatetime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; - blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; - blpapi_HighPrecisionDatetime_t *arg3 = (blpapi_HighPrecisionDatetime_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_setValueHighPrecisionDatetime", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_setValueHighPrecisionDatetime" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); - } - arg1 = (blpapi_MessageFormatter_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_setValueHighPrecisionDatetime" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); - } - arg2 = (blpapi_Name_t *)(argp2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_MessageFormatter_setValueHighPrecisionDatetime" "', argument " "3"" of type '" "blpapi_HighPrecisionDatetime_t const *""'"); - } - arg3 = (blpapi_HighPrecisionDatetime_t *)(argp3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_MessageFormatter_setValueHighPrecisionDatetime(arg1,(struct blpapi_Name const *)arg2,(struct blpapi_HighPrecisionDatetime_tag const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_setValueString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; - blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; - char *arg3 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_setValueString", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_setValueString" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); - } - arg1 = (blpapi_MessageFormatter_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_setValueString" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); - } - arg2 = (blpapi_Name_t *)(argp2); - res3 = SWIG_AsCharPtrAndSize(swig_obj[2], &buf3, NULL, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_MessageFormatter_setValueString" "', argument " "3"" of type '" "char const *""'"); - } - arg3 = (char *)(buf3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_MessageFormatter_setValueString(arg1,(struct blpapi_Name const *)arg2,(char const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); - return resultobj; -fail: - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_setValueFromName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; - blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_setValueFromName", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_setValueFromName" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); - } - arg1 = (blpapi_MessageFormatter_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_setValueFromName" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); - } - arg2 = (blpapi_Name_t *)(argp2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_MessageFormatter_setValueFromName" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = (blpapi_Name_t *)(argp3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_MessageFormatter_setValueFromName(arg1,(struct blpapi_Name const *)arg2,(struct blpapi_Name const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_setValueBytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; - blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; - char *arg3 = (char *) 0 ; - size_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_setValueBytes", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_setValueBytes" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); - } - arg1 = (blpapi_MessageFormatter_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_setValueBytes" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); - } - arg2 = (blpapi_Name_t *)(argp2); - { - if (swig_obj[2] == Py_None) { - arg3 = 0; - arg4 = 0; - } - else { - arg3 = PyBytes_AsString(swig_obj[2]); - arg4 = PyBytes_Size(swig_obj[2]); - } - } - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_MessageFormatter_setValueBytes(arg1,(struct blpapi_Name const *)arg2,(char const *)arg3,arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_setValueNull(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; - blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_setValueNull", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_setValueNull" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); - } - arg1 = (blpapi_MessageFormatter_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_setValueNull" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); - } - arg2 = (blpapi_Name_t *)(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_MessageFormatter_setValueNull(arg1,(struct blpapi_Name const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_pushElement(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; - blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_pushElement", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_pushElement" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); - } - arg1 = (blpapi_MessageFormatter_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_pushElement" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); - } - arg2 = (blpapi_Name_t *)(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_MessageFormatter_pushElement(arg1,(struct blpapi_Name const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_popElement(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_popElement" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); - } - arg1 = (blpapi_MessageFormatter_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_MessageFormatter_popElement(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_appendValueBool(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; - blpapi_Bool_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_appendValueBool", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_appendValueBool" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); - } - arg1 = (blpapi_MessageFormatter_t *)(argp1); - ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_MessageFormatter_appendValueBool" "', argument " "2"" of type '" "blpapi_Bool_t""'"); - } - arg2 = (blpapi_Bool_t)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_MessageFormatter_appendValueBool(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_appendValueChar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; - char arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - char val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_appendValueChar", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_appendValueChar" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); - } - arg1 = (blpapi_MessageFormatter_t *)(argp1); - ecode2 = SWIG_AsVal_char(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_MessageFormatter_appendValueChar" "', argument " "2"" of type '" "char""'"); - } - arg2 = (char)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_MessageFormatter_appendValueChar(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_appendValueInt32(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; - blpapi_Int32_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_appendValueInt32", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_appendValueInt32" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); - } - arg1 = (blpapi_MessageFormatter_t *)(argp1); - ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_MessageFormatter_appendValueInt32" "', argument " "2"" of type '" "blpapi_Int32_t""'"); - } - arg2 = (blpapi_Int32_t)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_MessageFormatter_appendValueInt32(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_appendValueInt64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; - blpapi_Int64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long long val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_appendValueInt64", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_appendValueInt64" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); - } - arg1 = (blpapi_MessageFormatter_t *)(argp1); - ecode2 = SWIG_AsVal_long_SS_long(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_MessageFormatter_appendValueInt64" "', argument " "2"" of type '" "blpapi_Int64_t""'"); - } - arg2 = (blpapi_Int64_t)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_MessageFormatter_appendValueInt64(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_appendValueFloat32(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; - blpapi_Float32_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - float val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_appendValueFloat32", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_appendValueFloat32" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); - } - arg1 = (blpapi_MessageFormatter_t *)(argp1); - ecode2 = SWIG_AsVal_float(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_MessageFormatter_appendValueFloat32" "', argument " "2"" of type '" "blpapi_Float32_t""'"); - } - arg2 = (blpapi_Float32_t)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_MessageFormatter_appendValueFloat32(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_appendValueFloat64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; - blpapi_Float64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_appendValueFloat64", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_appendValueFloat64" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); - } - arg1 = (blpapi_MessageFormatter_t *)(argp1); - ecode2 = SWIG_AsVal_double(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_MessageFormatter_appendValueFloat64" "', argument " "2"" of type '" "blpapi_Float64_t""'"); - } - arg2 = (blpapi_Float64_t)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_MessageFormatter_appendValueFloat64(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_appendValueDatetime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; - blpapi_Datetime_t *arg2 = (blpapi_Datetime_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_appendValueDatetime", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_appendValueDatetime" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); - } - arg1 = (blpapi_MessageFormatter_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_appendValueDatetime" "', argument " "2"" of type '" "blpapi_Datetime_t const *""'"); - } - arg2 = (blpapi_Datetime_t *)(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_MessageFormatter_appendValueDatetime(arg1,(struct blpapi_Datetime_tag const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_appendValueHighPrecisionDatetime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; - blpapi_HighPrecisionDatetime_t *arg2 = (blpapi_HighPrecisionDatetime_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_appendValueHighPrecisionDatetime", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_appendValueHighPrecisionDatetime" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); - } - arg1 = (blpapi_MessageFormatter_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_appendValueHighPrecisionDatetime" "', argument " "2"" of type '" "blpapi_HighPrecisionDatetime_t const *""'"); - } - arg2 = (blpapi_HighPrecisionDatetime_t *)(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_MessageFormatter_appendValueHighPrecisionDatetime(arg1,(struct blpapi_HighPrecisionDatetime_tag const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_appendValueString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_appendValueString", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_appendValueString" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); - } - arg1 = (blpapi_MessageFormatter_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_appendValueString" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_MessageFormatter_appendValueString(arg1,(char const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_appendValueFromName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; - blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_appendValueFromName", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_appendValueFromName" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); - } - arg1 = (blpapi_MessageFormatter_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_appendValueFromName" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); - } - arg2 = (blpapi_Name_t *)(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_MessageFormatter_appendValueFromName(arg1,(struct blpapi_Name const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_appendElement(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_appendElement" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); - } - arg1 = (blpapi_MessageFormatter_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_MessageFormatter_appendElement(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_FormatMessageJson(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_FormatMessageJson", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_FormatMessageJson" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); - } - arg1 = (blpapi_MessageFormatter_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_FormatMessageJson" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_MessageFormatter_FormatMessageJson(arg1,(char const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_FormatMessageXml(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageFormatter_FormatMessageXml", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_FormatMessageXml" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); - } - arg1 = (blpapi_MessageFormatter_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_FormatMessageXml" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_MessageFormatter_FormatMessageXml(arg1,(char const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_copy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageFormatter_t **arg1 = (blpapi_MessageFormatter_t **) 0 ; - blpapi_MessageFormatter_t *arg2 = (blpapi_MessageFormatter_t *) 0 ; - blpapi_MessageFormatter_t *temp1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[1] ; - int result; - - arg1 = &temp1; - if (!args) SWIG_fail; - swig_obj[0] = args; - res2 = SWIG_ConvertPtr(swig_obj[0], &argp2,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_copy" "', argument " "2"" of type '" "blpapi_MessageFormatter_t const *""'"); - } - arg2 = (blpapi_MessageFormatter_t *)(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_MessageFormatter_copy(arg1,(struct blpapi_MessageFormatter const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_MessageFormatter, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_assign(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageFormatter_t **arg1 = (blpapi_MessageFormatter_t **) 0 ; - blpapi_MessageFormatter_t *arg2 = (blpapi_MessageFormatter_t *) 0 ; - blpapi_MessageFormatter_t *temp1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[1] ; - int result; - - arg1 = &temp1; - if (!args) SWIG_fail; - swig_obj[0] = args; - res2 = SWIG_ConvertPtr(swig_obj[0], &argp2,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageFormatter_assign" "', argument " "2"" of type '" "blpapi_MessageFormatter_t const *""'"); - } - arg2 = (blpapi_MessageFormatter_t *)(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_MessageFormatter_assign(arg1,(struct blpapi_MessageFormatter const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_MessageFormatter, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageFormatter_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageFormatter_t *arg1 = (blpapi_MessageFormatter_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageFormatter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageFormatter_destroy" "', argument " "1"" of type '" "blpapi_MessageFormatter_t *""'"); - } - arg1 = (blpapi_MessageFormatter_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_MessageFormatter_destroy(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Session_subscribeEx_helper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - blpapi_SubscriptionList_t *arg2 = (blpapi_SubscriptionList_t *) 0 ; - blpapi_Identity_t *arg3 = (blpapi_Identity_t *) 0 ; - char *arg4 = (char *) 0 ; - int arg5 ; - PyObject *arg6 = (PyObject *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - int res4 ; - char *buf4 = 0 ; - size_t size4 = 0 ; - int alloc4 = 0 ; - PyObject *swig_obj[5] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Session_subscribeEx_helper", 5, 5, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_subscribeEx_helper" "', argument " "1"" of type '" "blpapi_Session_t *""'"); - } - arg1 = (blpapi_Session_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_subscribeEx_helper" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); - } - arg2 = (blpapi_SubscriptionList_t *)(argp2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_subscribeEx_helper" "', argument " "3"" of type '" "blpapi_Identity_t const *""'"); - } - arg3 = (blpapi_Identity_t *)(argp3); - res4 = SWIG_AsCharPtrAndSize(swig_obj[3], &buf4, &size4, &alloc4); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Session_subscribeEx_helper" "', argument " "4"" of type '" "char const *""'"); - } - arg4 = (char *)(buf4); - arg5 = (int)(size4 - 1); - { - arg6 = swig_obj[4]; - } - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_subscribeEx_helper(arg1,(struct blpapi_SubscriptionList const *)arg2,(struct blpapi_Identity const *)arg3,(char const *)arg4,arg5,arg6); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); - return resultobj; -fail: - if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Session_resubscribeEx_helper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - blpapi_SubscriptionList_t *arg2 = (blpapi_SubscriptionList_t *) 0 ; - char *arg3 = (char *) 0 ; - int arg4 ; - PyObject *arg5 = (PyObject *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int res3 ; - char *buf3 = 0 ; - size_t size3 = 0 ; - int alloc3 = 0 ; - PyObject *swig_obj[4] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Session_resubscribeEx_helper", 4, 4, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_resubscribeEx_helper" "', argument " "1"" of type '" "blpapi_Session_t *""'"); - } - arg1 = (blpapi_Session_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_resubscribeEx_helper" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); - } - arg2 = (blpapi_SubscriptionList_t *)(argp2); - res3 = SWIG_AsCharPtrAndSize(swig_obj[2], &buf3, &size3, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_resubscribeEx_helper" "', argument " "3"" of type '" "char const *""'"); - } - arg3 = (char *)(buf3); - arg4 = (int)(size3 - 1); - { - arg5 = swig_obj[3]; - } - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_resubscribeEx_helper(arg1,(struct blpapi_SubscriptionList const *)arg2,(char const *)arg3,arg4,arg5); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); - return resultobj; -fail: - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Session_resubscribeWithIdEx_helper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - blpapi_SubscriptionList_t *arg2 = (blpapi_SubscriptionList_t *) 0 ; - int arg3 ; - char *arg4 = (char *) 0 ; - int arg5 ; - PyObject *arg6 = (PyObject *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - int res4 ; - char *buf4 = 0 ; - size_t size4 = 0 ; - int alloc4 = 0 ; - PyObject *swig_obj[5] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Session_resubscribeWithIdEx_helper", 5, 5, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_resubscribeWithIdEx_helper" "', argument " "1"" of type '" "blpapi_Session_t *""'"); - } - arg1 = (blpapi_Session_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_resubscribeWithIdEx_helper" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); - } - arg2 = (blpapi_SubscriptionList_t *)(argp2); - ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Session_resubscribeWithIdEx_helper" "', argument " "3"" of type '" "int""'"); - } - arg3 = (int)(val3); - res4 = SWIG_AsCharPtrAndSize(swig_obj[3], &buf4, &size4, &alloc4); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Session_resubscribeWithIdEx_helper" "', argument " "4"" of type '" "char const *""'"); - } - arg4 = (char *)(buf4); - arg5 = (int)(size4 - 1); - { - arg6 = swig_obj[4]; - } - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_resubscribeWithIdEx_helper(arg1,(struct blpapi_SubscriptionList const *)arg2,arg3,(char const *)arg4,arg5,arg6); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); - return resultobj; -fail: - if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_AuthOptions_create_default(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_AuthOptions_t **arg1 = (blpapi_AuthOptions_t **) 0 ; - blpapi_AuthOptions_t *temp1 = 0 ; - int result; - - arg1 = &temp1; - if (!SWIG_Python_UnpackTuple(args, "blpapi_AuthOptions_create_default", 0, 0, 0)) SWIG_fail; - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AuthOptions_create_default(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthOptions, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_AuthOptions_create_forUserMode(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_AuthOptions_t **arg1 = (blpapi_AuthOptions_t **) 0 ; - blpapi_AuthUser_t *arg2 = (blpapi_AuthUser_t *) 0 ; - blpapi_AuthOptions_t *temp1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[1] ; - int result; - - arg1 = &temp1; - if (!args) SWIG_fail; - swig_obj[0] = args; - res2 = SWIG_ConvertPtr(swig_obj[0], &argp2,SWIGTYPE_p_blpapi_AuthUser, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthOptions_create_forUserMode" "', argument " "2"" of type '" "blpapi_AuthUser_t const *""'"); - } - arg2 = (blpapi_AuthUser_t *)(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AuthOptions_create_forUserMode(arg1,(struct blpapi_AuthUser const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthOptions, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_AuthOptions_create_forAppMode(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_AuthOptions_t **arg1 = (blpapi_AuthOptions_t **) 0 ; - blpapi_AuthApplication_t *arg2 = (blpapi_AuthApplication_t *) 0 ; - blpapi_AuthOptions_t *temp1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[1] ; - int result; - - arg1 = &temp1; - if (!args) SWIG_fail; - swig_obj[0] = args; - res2 = SWIG_ConvertPtr(swig_obj[0], &argp2,SWIGTYPE_p_blpapi_AuthApplication, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthOptions_create_forAppMode" "', argument " "2"" of type '" "blpapi_AuthApplication_t const *""'"); - } - arg2 = (blpapi_AuthApplication_t *)(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AuthOptions_create_forAppMode(arg1,(struct blpapi_AuthApplication const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthOptions, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_AuthOptions_create_forUserAndAppMode(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_AuthOptions_t **arg1 = (blpapi_AuthOptions_t **) 0 ; - blpapi_AuthUser_t *arg2 = (blpapi_AuthUser_t *) 0 ; - blpapi_AuthApplication_t *arg3 = (blpapi_AuthApplication_t *) 0 ; - blpapi_AuthOptions_t *temp1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg1 = &temp1; - if (!SWIG_Python_UnpackTuple(args, "blpapi_AuthOptions_create_forUserAndAppMode", 2, 2, swig_obj)) SWIG_fail; - res2 = SWIG_ConvertPtr(swig_obj[0], &argp2,SWIGTYPE_p_blpapi_AuthUser, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthOptions_create_forUserAndAppMode" "', argument " "2"" of type '" "blpapi_AuthUser_t const *""'"); - } - arg2 = (blpapi_AuthUser_t *)(argp2); - res3 = SWIG_ConvertPtr(swig_obj[1], &argp3,SWIGTYPE_p_blpapi_AuthApplication, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AuthOptions_create_forUserAndAppMode" "', argument " "3"" of type '" "blpapi_AuthApplication_t const *""'"); - } - arg3 = (blpapi_AuthApplication_t *)(argp3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AuthOptions_create_forUserAndAppMode(arg1,(struct blpapi_AuthUser const *)arg2,(struct blpapi_AuthApplication const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthOptions, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_AuthOptions_create_forToken(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_AuthOptions_t **arg1 = (blpapi_AuthOptions_t **) 0 ; - blpapi_AuthToken_t *arg2 = (blpapi_AuthToken_t *) 0 ; - blpapi_AuthOptions_t *temp1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[1] ; - int result; - - arg1 = &temp1; - if (!args) SWIG_fail; - swig_obj[0] = args; - res2 = SWIG_ConvertPtr(swig_obj[0], &argp2,SWIGTYPE_p_blpapi_AuthToken, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthOptions_create_forToken" "', argument " "2"" of type '" "blpapi_AuthToken_t const *""'"); - } - arg2 = (blpapi_AuthToken_t *)(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AuthOptions_create_forToken(arg1,(struct blpapi_AuthToken const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthOptions, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_AuthOptions_duplicate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_AuthOptions_t **arg1 = (blpapi_AuthOptions_t **) 0 ; - blpapi_AuthOptions_t *arg2 = (blpapi_AuthOptions_t *) 0 ; - blpapi_AuthOptions_t *temp1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[1] ; - int result; - - arg1 = &temp1; - if (!args) SWIG_fail; - swig_obj[0] = args; - res2 = SWIG_ConvertPtr(swig_obj[0], &argp2,SWIGTYPE_p_blpapi_AuthOptions, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthOptions_duplicate" "', argument " "2"" of type '" "blpapi_AuthOptions_t const *""'"); - } - arg2 = (blpapi_AuthOptions_t *)(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AuthOptions_duplicate(arg1,(struct blpapi_AuthOptions const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthOptions, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_AuthOptions_copy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_AuthOptions_t *arg1 = (blpapi_AuthOptions_t *) 0 ; - blpapi_AuthOptions_t *arg2 = (blpapi_AuthOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_AuthOptions_copy", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_AuthOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AuthOptions_copy" "', argument " "1"" of type '" "blpapi_AuthOptions_t *""'"); - } - arg1 = (blpapi_AuthOptions_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_AuthOptions, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthOptions_copy" "', argument " "2"" of type '" "blpapi_AuthOptions_t const *""'"); - } - arg2 = (blpapi_AuthOptions_t *)(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AuthOptions_copy(arg1,(struct blpapi_AuthOptions const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_AuthOptions_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_AuthOptions_t *arg1 = (blpapi_AuthOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_AuthOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AuthOptions_destroy" "', argument " "1"" of type '" "blpapi_AuthOptions_t *""'"); - } - arg1 = (blpapi_AuthOptions_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_AuthOptions_destroy(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_AuthUser_createWithLogonName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_AuthUser_t **arg1 = (blpapi_AuthUser_t **) 0 ; - blpapi_AuthUser_t *temp1 = 0 ; - int result; - - arg1 = &temp1; - if (!SWIG_Python_UnpackTuple(args, "blpapi_AuthUser_createWithLogonName", 0, 0, 0)) SWIG_fail; - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AuthUser_createWithLogonName(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthUser, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_AuthUser_createWithActiveDirectoryProperty(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_AuthUser_t **arg1 = (blpapi_AuthUser_t **) 0 ; - char *arg2 = (char *) 0 ; - blpapi_AuthUser_t *temp1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject *swig_obj[1] ; - int result; - - arg1 = &temp1; - if (!args) SWIG_fail; - swig_obj[0] = args; - res2 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthUser_createWithActiveDirectoryProperty" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AuthUser_createWithActiveDirectoryProperty(arg1,(char const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthUser, 0)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_AuthUser_createWithManualOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_AuthUser_t **arg1 = (blpapi_AuthUser_t **) 0 ; - char *arg2 = (char *) 0 ; - char *arg3 = (char *) 0 ; - blpapi_AuthUser_t *temp1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg1 = &temp1; - if (!SWIG_Python_UnpackTuple(args, "blpapi_AuthUser_createWithManualOptions", 2, 2, swig_obj)) SWIG_fail; - res2 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthUser_createWithManualOptions" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf3, NULL, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AuthUser_createWithManualOptions" "', argument " "3"" of type '" "char const *""'"); - } - arg3 = (char *)(buf3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AuthUser_createWithManualOptions(arg1,(char const *)arg2,(char const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthUser, 0)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_AuthUser_duplicate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_AuthUser_t **arg1 = (blpapi_AuthUser_t **) 0 ; - blpapi_AuthUser_t *arg2 = (blpapi_AuthUser_t *) 0 ; - blpapi_AuthUser_t *temp1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[1] ; - int result; - - arg1 = &temp1; - if (!args) SWIG_fail; - swig_obj[0] = args; - res2 = SWIG_ConvertPtr(swig_obj[0], &argp2,SWIGTYPE_p_blpapi_AuthUser, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthUser_duplicate" "', argument " "2"" of type '" "blpapi_AuthUser_t const *""'"); - } - arg2 = (blpapi_AuthUser_t *)(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AuthUser_duplicate(arg1,(struct blpapi_AuthUser const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthUser, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_AuthUser_copy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_AuthUser_t *arg1 = (blpapi_AuthUser_t *) 0 ; - blpapi_AuthUser_t *arg2 = (blpapi_AuthUser_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_AuthUser_copy", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_AuthUser, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AuthUser_copy" "', argument " "1"" of type '" "blpapi_AuthUser_t *""'"); - } - arg1 = (blpapi_AuthUser_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_AuthUser, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthUser_copy" "', argument " "2"" of type '" "blpapi_AuthUser_t const *""'"); - } - arg2 = (blpapi_AuthUser_t *)(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AuthUser_copy(arg1,(struct blpapi_AuthUser const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_AuthUser_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_AuthUser_t *arg1 = (blpapi_AuthUser_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_AuthUser, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AuthUser_destroy" "', argument " "1"" of type '" "blpapi_AuthUser_t *""'"); - } - arg1 = (blpapi_AuthUser_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_AuthUser_destroy(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_AuthApplication_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_AuthApplication_t **arg1 = (blpapi_AuthApplication_t **) 0 ; - char *arg2 = (char *) 0 ; - blpapi_AuthApplication_t *temp1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject *swig_obj[1] ; - int result; - - arg1 = &temp1; - if (!args) SWIG_fail; - swig_obj[0] = args; - res2 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthApplication_create" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AuthApplication_create(arg1,(char const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthApplication, 0)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_AuthApplication_duplicate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_AuthApplication_t **arg1 = (blpapi_AuthApplication_t **) 0 ; - blpapi_AuthApplication_t *arg2 = (blpapi_AuthApplication_t *) 0 ; - blpapi_AuthApplication_t *temp1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[1] ; - int result; - - arg1 = &temp1; - if (!args) SWIG_fail; - swig_obj[0] = args; - res2 = SWIG_ConvertPtr(swig_obj[0], &argp2,SWIGTYPE_p_blpapi_AuthApplication, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthApplication_duplicate" "', argument " "2"" of type '" "blpapi_AuthApplication_t const *""'"); - } - arg2 = (blpapi_AuthApplication_t *)(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AuthApplication_duplicate(arg1,(struct blpapi_AuthApplication const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthApplication, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_AuthApplication_copy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_AuthApplication_t *arg1 = (blpapi_AuthApplication_t *) 0 ; - blpapi_AuthApplication_t *arg2 = (blpapi_AuthApplication_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_AuthApplication_copy", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_AuthApplication, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AuthApplication_copy" "', argument " "1"" of type '" "blpapi_AuthApplication_t *""'"); - } - arg1 = (blpapi_AuthApplication_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_AuthApplication, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthApplication_copy" "', argument " "2"" of type '" "blpapi_AuthApplication_t const *""'"); - } - arg2 = (blpapi_AuthApplication_t *)(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AuthApplication_copy(arg1,(struct blpapi_AuthApplication const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_AuthApplication_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_AuthApplication_t *arg1 = (blpapi_AuthApplication_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_AuthApplication, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AuthApplication_destroy" "', argument " "1"" of type '" "blpapi_AuthApplication_t *""'"); - } - arg1 = (blpapi_AuthApplication_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_AuthApplication_destroy(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_AuthToken_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_AuthToken_t **arg1 = (blpapi_AuthToken_t **) 0 ; - char *arg2 = (char *) 0 ; - blpapi_AuthToken_t *temp1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject *swig_obj[1] ; - int result; - - arg1 = &temp1; - if (!args) SWIG_fail; - swig_obj[0] = args; - res2 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthToken_create" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AuthToken_create(arg1,(char const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthToken, 0)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_AuthToken_duplicate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_AuthToken_t **arg1 = (blpapi_AuthToken_t **) 0 ; - blpapi_AuthToken_t *arg2 = (blpapi_AuthToken_t *) 0 ; - blpapi_AuthToken_t *temp1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[1] ; - int result; - - arg1 = &temp1; - if (!args) SWIG_fail; - swig_obj[0] = args; - res2 = SWIG_ConvertPtr(swig_obj[0], &argp2,SWIGTYPE_p_blpapi_AuthToken, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthToken_duplicate" "', argument " "2"" of type '" "blpapi_AuthToken_t const *""'"); - } - arg2 = (blpapi_AuthToken_t *)(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AuthToken_duplicate(arg1,(struct blpapi_AuthToken const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_AuthToken, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_AuthToken_copy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_AuthToken_t *arg1 = (blpapi_AuthToken_t *) 0 ; - blpapi_AuthToken_t *arg2 = (blpapi_AuthToken_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_AuthToken_copy", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_AuthToken, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AuthToken_copy" "', argument " "1"" of type '" "blpapi_AuthToken_t *""'"); - } - arg1 = (blpapi_AuthToken_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_AuthToken, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AuthToken_copy" "', argument " "2"" of type '" "blpapi_AuthToken_t const *""'"); - } - arg2 = (blpapi_AuthToken_t *)(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AuthToken_copy(arg1,(struct blpapi_AuthToken const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_AuthToken_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_AuthToken_t *arg1 = (blpapi_AuthToken_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_AuthToken, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AuthToken_destroy" "', argument " "1"" of type '" "blpapi_AuthToken_t *""'"); - } - arg1 = (blpapi_AuthToken_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_AuthToken_destroy(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_getLastErrorDescription(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int val1 ; - int ecode1 = 0 ; - PyObject *swig_obj[1] ; - char *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "blpapi_getLastErrorDescription" "', argument " "1"" of type '" "int""'"); - } - arg1 = (int)(val1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_getLastErrorDescription(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Socks5Config_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - size_t arg2 ; - unsigned short arg3 ; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - unsigned short val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[3] ; - blpapi_Socks5Config_t *result = 0 ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Socks5Config_create", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Socks5Config_create" "', argument " "1"" of type '" "char const *""'"); - } - arg1 = (char *)(buf1); - ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Socks5Config_create" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = (size_t)(val2); - ecode3 = SWIG_AsVal_unsigned_SS_short(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Socks5Config_create" "', argument " "3"" of type '" "unsigned short""'"); - } - arg3 = (unsigned short)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Socks5Config_t *)blpapi_Socks5Config_create((char const *)arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Socks5Config, 0 | 0 ); - if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); - return resultobj; -fail: - if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Socks5Config_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Socks5Config_t *arg1 = (blpapi_Socks5Config_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Socks5Config, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Socks5Config_destroy" "', argument " "1"" of type '" "blpapi_Socks5Config_t *""'"); - } - arg1 = (blpapi_Socks5Config_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_Socks5Config_destroy(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *result = 0 ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_create", 0, 0, 0)) SWIG_fail; - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_SessionOptions_t *)blpapi_SessionOptions_create(); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_destroy" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_SessionOptions_destroy(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setServerHost(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setServerHost", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setServerHost" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setServerHost" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setServerHost(arg1,(char const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setServerPort(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - unsigned short arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned short val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setServerPort", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setServerPort" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_short(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setServerPort" "', argument " "2"" of type '" "unsigned short""'"); - } - arg2 = (unsigned short)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setServerPort(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setServerAddress(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - char *arg2 = (char *) 0 ; - unsigned short arg3 ; - size_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - unsigned short val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - PyObject *swig_obj[4] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setServerAddress", 4, 4, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setServerAddress" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setServerAddress" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - ecode3 = SWIG_AsVal_unsigned_SS_short(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_SessionOptions_setServerAddress" "', argument " "3"" of type '" "unsigned short""'"); - } - arg3 = (unsigned short)(val3); - ecode4 = SWIG_AsVal_size_t(swig_obj[3], &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_SessionOptions_setServerAddress" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = (size_t)(val4); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setServerAddress(arg1,(char const *)arg2,arg3,arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setServerAddressWithProxy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - char *arg2 = (char *) 0 ; - unsigned short arg3 ; - blpapi_Socks5Config_t *arg4 = (blpapi_Socks5Config_t *) 0 ; - size_t arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - unsigned short val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - PyObject *swig_obj[5] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setServerAddressWithProxy", 5, 5, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setServerAddressWithProxy" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setServerAddressWithProxy" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - ecode3 = SWIG_AsVal_unsigned_SS_short(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_SessionOptions_setServerAddressWithProxy" "', argument " "3"" of type '" "unsigned short""'"); - } - arg3 = (unsigned short)(val3); - res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_blpapi_Socks5Config, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_SessionOptions_setServerAddressWithProxy" "', argument " "4"" of type '" "blpapi_Socks5Config_t const *""'"); - } - arg4 = (blpapi_Socks5Config_t *)(argp4); - ecode5 = SWIG_AsVal_size_t(swig_obj[4], &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_SessionOptions_setServerAddressWithProxy" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = (size_t)(val5); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setServerAddressWithProxy(arg1,(char const *)arg2,arg3,(struct blpapi_Socks5Config const *)arg4,arg5); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_removeServerAddress(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_removeServerAddress", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_removeServerAddress" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_removeServerAddress" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = (size_t)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_removeServerAddress(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setConnectTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - unsigned int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned int val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setConnectTimeout", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setConnectTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setConnectTimeout" "', argument " "2"" of type '" "unsigned int""'"); - } - arg2 = (unsigned int)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setConnectTimeout(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setDefaultServices(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setDefaultServices", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setDefaultServices" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setDefaultServices" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setDefaultServices(arg1,(char const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setDefaultSubscriptionService(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setDefaultSubscriptionService", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setDefaultSubscriptionService" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setDefaultSubscriptionService" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setDefaultSubscriptionService(arg1,(char const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setDefaultTopicPrefix(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject *swig_obj[2] ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setDefaultTopicPrefix", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setDefaultTopicPrefix" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setDefaultTopicPrefix" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_SessionOptions_setDefaultTopicPrefix(arg1,(char const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setClientMode(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setClientMode", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setClientMode" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setClientMode" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_SessionOptions_setClientMode(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setMaxPendingRequests(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setMaxPendingRequests", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setMaxPendingRequests" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setMaxPendingRequests" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_SessionOptions_setMaxPendingRequests(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setAutoRestartOnDisconnection(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setAutoRestartOnDisconnection", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setAutoRestartOnDisconnection" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setAutoRestartOnDisconnection" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_SessionOptions_setAutoRestartOnDisconnection(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setSessionIdentityOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - blpapi_AuthOptions_t *arg2 = (blpapi_AuthOptions_t *) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setSessionIdentityOptions", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setSessionIdentityOptions" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_AuthOptions, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setSessionIdentityOptions" "', argument " "2"" of type '" "blpapi_AuthOptions_t const *""'"); - } - arg2 = (blpapi_AuthOptions_t *)(argp2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_SessionOptions_setSessionIdentityOptions" "', argument " "3"" of type '" "blpapi_CorrelationId_t *""'"); - } - arg3 = (blpapi_CorrelationId_t *)(argp3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setSessionIdentityOptions(arg1,(struct blpapi_AuthOptions const *)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setAuthenticationOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject *swig_obj[2] ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setAuthenticationOptions", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setAuthenticationOptions" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setAuthenticationOptions" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_SessionOptions_setAuthenticationOptions(arg1,(char const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setNumStartAttempts(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setNumStartAttempts", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setNumStartAttempts" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setNumStartAttempts" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_SessionOptions_setNumStartAttempts(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setMaxEventQueueSize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setMaxEventQueueSize", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setMaxEventQueueSize" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setMaxEventQueueSize" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = (size_t)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_SessionOptions_setMaxEventQueueSize(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - float arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - float val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_float(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark" "', argument " "2"" of type '" "float""'"); - } - arg2 = (float)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - float arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - float val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_float(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark" "', argument " "2"" of type '" "float""'"); - } - arg2 = (float)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setDefaultKeepAliveInactivityTime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setDefaultKeepAliveInactivityTime", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setDefaultKeepAliveInactivityTime" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setDefaultKeepAliveInactivityTime" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setDefaultKeepAliveInactivityTime(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setKeepAliveEnabled(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setKeepAliveEnabled", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setKeepAliveEnabled" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setKeepAliveEnabled" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setKeepAliveEnabled(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setServiceCheckTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setServiceCheckTimeout", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setServiceCheckTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setServiceCheckTimeout" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setServiceCheckTimeout(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setServiceDownloadTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setServiceDownloadTimeout", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setServiceDownloadTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setServiceDownloadTimeout" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setServiceDownloadTimeout(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setTlsOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - blpapi_TlsOptions_t *arg2 = (blpapi_TlsOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[2] ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setTlsOptions", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setTlsOptions" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setTlsOptions" "', argument " "2"" of type '" "blpapi_TlsOptions_t const *""'"); - } - arg2 = (blpapi_TlsOptions_t *)(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_SessionOptions_setTlsOptions(arg1,(struct blpapi_TlsOptions const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setFlushPublishedEventsTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setFlushPublishedEventsTimeout", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setFlushPublishedEventsTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setFlushPublishedEventsTimeout" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setFlushPublishedEventsTimeout(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setBandwidthSaveModeDisabled(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setBandwidthSaveModeDisabled", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setBandwidthSaveModeDisabled" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SessionOptions_setBandwidthSaveModeDisabled" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setBandwidthSaveModeDisabled(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_serverHost(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - char *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_serverHost" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_SessionOptions_serverHost(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_serverPort(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - unsigned int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_serverPort" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (unsigned int)blpapi_SessionOptions_serverPort(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_numServerAddresses(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_numServerAddresses" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_numServerAddresses(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_getServerAddressWithProxy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - char **arg2 = (char **) 0 ; - unsigned short *arg3 = (unsigned short *) 0 ; - char **arg4 = (char **) 0 ; - unsigned short *arg5 = (unsigned short *) 0 ; - size_t arg6 ; - void *argp1 = 0 ; - int res1 = 0 ; - char *temp2 = 0 ; - unsigned short temp3 ; - char *temp4 = 0 ; - unsigned short temp5 ; - size_t val6 ; - int ecode6 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg2 = &temp2; - arg3 = &temp3; - arg4 = &temp4; - arg5 = &temp5; - if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_getServerAddressWithProxy", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_getServerAddressWithProxy" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - ecode6 = SWIG_AsVal_size_t(swig_obj[1], &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "blpapi_SessionOptions_getServerAddressWithProxy" "', argument " "6"" of type '" "size_t""'"); - } - arg6 = (size_t)(val6); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_getServerAddressWithProxy(arg1,(char const **)arg2,arg3,(char const **)arg4,arg5,arg6); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); - resultobj = SWIG_Python_AppendOutput(resultobj, PyInt_FromLong(*arg3)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg4)); - resultobj = SWIG_Python_AppendOutput(resultobj, PyInt_FromLong(*arg5)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_connectTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - unsigned int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_connectTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (unsigned int)blpapi_SessionOptions_connectTimeout(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultServices(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - char *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_defaultServices" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_SessionOptions_defaultServices(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultSubscriptionService(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - char *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_defaultSubscriptionService" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_SessionOptions_defaultSubscriptionService(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultTopicPrefix(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - char *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_defaultTopicPrefix" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_SessionOptions_defaultTopicPrefix(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_clientMode(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_clientMode" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_clientMode(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_maxPendingRequests(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_maxPendingRequests" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_maxPendingRequests(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_autoRestartOnDisconnection(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_autoRestartOnDisconnection" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_autoRestartOnDisconnection(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_authenticationOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - char *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_authenticationOptions" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_SessionOptions_authenticationOptions(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_numStartAttempts(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_numStartAttempts" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_numStartAttempts(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_maxEventQueueSize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - size_t result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_maxEventQueueSize" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = blpapi_SessionOptions_maxEventQueueSize(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_size_t((size_t)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_slowConsumerWarningHiWaterMark(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - float result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_slowConsumerWarningHiWaterMark" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (float)blpapi_SessionOptions_slowConsumerWarningHiWaterMark(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_float((float)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_slowConsumerWarningLoWaterMark(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - float result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_slowConsumerWarningLoWaterMark" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (float)blpapi_SessionOptions_slowConsumerWarningLoWaterMark(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_float((float)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultKeepAliveInactivityTime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_defaultKeepAliveInactivityTime" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_defaultKeepAliveInactivityTime(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultKeepAliveResponseTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_defaultKeepAliveResponseTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_defaultKeepAliveResponseTimeout(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_keepAliveEnabled(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_keepAliveEnabled" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_keepAliveEnabled(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_recordSubscriptionDataReceiveTimes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_recordSubscriptionDataReceiveTimes" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_recordSubscriptionDataReceiveTimes(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_serviceCheckTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_serviceCheckTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_serviceCheckTimeout(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_serviceDownloadTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_serviceDownloadTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_serviceDownloadTimeout(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_flushPublishedEventsTimeout(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_flushPublishedEventsTimeout" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_flushPublishedEventsTimeout(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_bandwidthSaveModeDisabled(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_bandwidthSaveModeDisabled" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_bandwidthSaveModeDisabled(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setApplicationIdentityKey(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - char *arg2 = (char *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - size_t size2 = 0 ; - int alloc2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setApplicationIdentityKey", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setApplicationIdentityKey" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, &size2, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setApplicationIdentityKey" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - arg3 = (size_t)(size2 - 1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setApplicationIdentityKey(arg1,(char const *)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_applicationIdentityKey(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - char **arg1 = (char **) 0 ; - size_t *arg2 = (size_t *) 0 ; - blpapi_SessionOptions_t *arg3 = (blpapi_SessionOptions_t *) 0 ; - char *temp1 = 0 ; - size_t temp2 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject *swig_obj[1] ; - int result; - - arg1 = &temp1; - arg2 = &temp2; - if (!args) SWIG_fail; - swig_obj[0] = args; - res3 = SWIG_ConvertPtr(swig_obj[0], &argp3,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_SessionOptions_applicationIdentityKey" "', argument " "3"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg3 = (blpapi_SessionOptions_t *)(argp3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_applicationIdentityKey((char const **)arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtrAndSize(*arg1, *arg2)); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setSessionName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - char *arg2 = (char *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - size_t size2 = 0 ; - int alloc2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_SessionOptions_setSessionName", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SessionOptions_setSessionName" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, &size2, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SessionOptions_setSessionName" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - arg3 = (size_t)(size2 - 1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_setSessionName(arg1,(char const *)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_sessionName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - char **arg1 = (char **) 0 ; - size_t *arg2 = (size_t *) 0 ; - blpapi_SessionOptions_t *arg3 = (blpapi_SessionOptions_t *) 0 ; - char *temp1 = 0 ; - size_t temp2 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject *swig_obj[1] ; - int result; - - arg1 = &temp1; - arg2 = &temp2; - if (!args) SWIG_fail; - swig_obj[0] = args; - res3 = SWIG_ConvertPtr(swig_obj[0], &argp3,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_SessionOptions_sessionName" "', argument " "3"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg3 = (blpapi_SessionOptions_t *)(argp3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SessionOptions_sessionName((char const **)arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtrAndSize(*arg1, *arg2)); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_TlsOptions_t *arg1 = (blpapi_TlsOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TlsOptions_destroy" "', argument " "1"" of type '" "blpapi_TlsOptions_t *""'"); - } - arg1 = (blpapi_TlsOptions_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_TlsOptions_destroy(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_createFromFiles(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - char *arg2 = (char *) 0 ; - char *arg3 = (char *) 0 ; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; - PyObject *swig_obj[3] ; - blpapi_TlsOptions_t *result = 0 ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_TlsOptions_createFromFiles", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TlsOptions_createFromFiles" "', argument " "1"" of type '" "char const *""'"); - } - arg1 = (char *)(buf1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_TlsOptions_createFromFiles" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_AsCharPtrAndSize(swig_obj[2], &buf3, NULL, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_TlsOptions_createFromFiles" "', argument " "3"" of type '" "char const *""'"); - } - arg3 = (char *)(buf3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_TlsOptions_t *)blpapi_TlsOptions_createFromFiles((char const *)arg1,(char const *)arg2,(char const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); - if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); - return resultobj; -fail: - if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_createFromBlobs(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - int arg2 ; - char *arg3 = (char *) 0 ; - char *arg4 = (char *) 0 ; - int arg5 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; - PyObject *swig_obj[3] ; - blpapi_TlsOptions_t *result = 0 ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_TlsOptions_createFromBlobs", 3, 3, swig_obj)) SWIG_fail; - { - int res; Py_ssize_t size = 0; const void *buf = 0; - Py_buffer view; - res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO); - size = view.len; - buf = view.buf; - PyBuffer_Release(&view); - if (res < 0) { - PyErr_Clear(); - SWIG_exception_fail(SWIG_ArgError(res), "in method '" "blpapi_TlsOptions_createFromBlobs" "', argument " "1"" of type '" "(const char *clientCredentialsRawData, int clientCredentialsRawDataLength)""'"); - } - arg1 = (char *) buf; - arg2 = (int) (size / sizeof(char const)); - } - res3 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf3, NULL, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_TlsOptions_createFromBlobs" "', argument " "3"" of type '" "char const *""'"); - } - arg3 = (char *)(buf3); - { - int res; Py_ssize_t size = 0; const void *buf = 0; - Py_buffer view; - res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO); - size = view.len; - buf = view.buf; - PyBuffer_Release(&view); - if (res < 0) { - PyErr_Clear(); - SWIG_exception_fail(SWIG_ArgError(res), "in method '" "blpapi_TlsOptions_createFromBlobs" "', argument " "4"" of type '" "(const char *trustedCertificatesRawData, int trustedCertificatesRawDataLength)""'"); - } - arg4 = (char *) buf; - arg5 = (int) (size / sizeof(char const)); - } - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_TlsOptions_t *)blpapi_TlsOptions_createFromBlobs((char const *)arg1,arg2,(char const *)arg3,(char const *)arg4,arg5); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); - return resultobj; -fail: - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_setTlsHandshakeTimeoutMs(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_TlsOptions_t *arg1 = (blpapi_TlsOptions_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_TlsOptions_setTlsHandshakeTimeoutMs", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TlsOptions_setTlsHandshakeTimeoutMs" "', argument " "1"" of type '" "blpapi_TlsOptions_t *""'"); - } - arg1 = (blpapi_TlsOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_TlsOptions_setTlsHandshakeTimeoutMs" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_TlsOptions_setTlsHandshakeTimeoutMs(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_setCrlFetchTimeoutMs(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_TlsOptions_t *arg1 = (blpapi_TlsOptions_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_TlsOptions_setCrlFetchTimeoutMs", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TlsOptions_setCrlFetchTimeoutMs" "', argument " "1"" of type '" "blpapi_TlsOptions_t *""'"); - } - arg1 = (blpapi_TlsOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_TlsOptions_setCrlFetchTimeoutMs" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_TlsOptions_setCrlFetchTimeoutMs(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Name_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - PyObject *swig_obj[1] ; - blpapi_Name_t *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Name_create" "', argument " "1"" of type '" "char const *""'"); - } - arg1 = (char *)(buf1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Name_t *)blpapi_Name_create((char const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); - return resultobj; -fail: - if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Name_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Name_t *arg1 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Name_destroy" "', argument " "1"" of type '" "blpapi_Name_t *""'"); - } - arg1 = (blpapi_Name_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_Name_destroy(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Name_equalsStr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Name_t *arg1 = (blpapi_Name_t *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Name_equalsStr", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Name_equalsStr" "', argument " "1"" of type '" "blpapi_Name_t const *""'"); - } - arg1 = (blpapi_Name_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Name_equalsStr" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Name_equalsStr((struct blpapi_Name const *)arg1,(char const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Name_string(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Name_t *arg1 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - char *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Name_string" "', argument " "1"" of type '" "blpapi_Name_t const *""'"); - } - arg1 = (blpapi_Name_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_Name_string((struct blpapi_Name const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Name_length(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Name_t *arg1 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - size_t result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Name_length" "', argument " "1"" of type '" "blpapi_Name_t const *""'"); - } - arg1 = (blpapi_Name_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = blpapi_Name_length((struct blpapi_Name const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_size_t((size_t)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Name_findName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - PyObject *swig_obj[1] ; - blpapi_Name_t *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Name_findName" "', argument " "1"" of type '" "char const *""'"); - } - arg1 = (char *)(buf1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Name_t *)blpapi_Name_findName((char const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); - return resultobj; -fail: - if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SubscriptionList_t *result = 0 ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_SubscriptionList_create", 0, 0, 0)) SWIG_fail; - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_SubscriptionList_t *)blpapi_SubscriptionList_create(); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_destroy" "', argument " "1"" of type '" "blpapi_SubscriptionList_t *""'"); - } - arg1 = (blpapi_SubscriptionList_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_SubscriptionList_destroy(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_addResolved(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_SubscriptionList_addResolved", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_addResolved" "', argument " "1"" of type '" "blpapi_SubscriptionList_t *""'"); - } - arg1 = (blpapi_SubscriptionList_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SubscriptionList_addResolved" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_SubscriptionList_addResolved" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); - } - arg3 = (blpapi_CorrelationId_t *)(argp3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SubscriptionList_addResolved(arg1,(char const *)arg2,(struct blpapi_CorrelationId_t_ const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_clear" "', argument " "1"" of type '" "blpapi_SubscriptionList_t *""'"); - } - arg1 = (blpapi_SubscriptionList_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SubscriptionList_clear(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_append(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; - blpapi_SubscriptionList_t *arg2 = (blpapi_SubscriptionList_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_SubscriptionList_append", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_append" "', argument " "1"" of type '" "blpapi_SubscriptionList_t *""'"); - } - arg1 = (blpapi_SubscriptionList_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SubscriptionList_append" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); - } - arg2 = (blpapi_SubscriptionList_t *)(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SubscriptionList_append(arg1,(struct blpapi_SubscriptionList const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_size" "', argument " "1"" of type '" "blpapi_SubscriptionList_t const *""'"); - } - arg1 = (blpapi_SubscriptionList_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SubscriptionList_size((struct blpapi_SubscriptionList const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_correlationIdAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; - blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_CorrelationId_t temp2 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_SubscriptionList_correlationIdAt", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_correlationIdAt" "', argument " "1"" of type '" "blpapi_SubscriptionList_t const *""'"); - } - arg1 = (blpapi_SubscriptionList_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_SubscriptionList_correlationIdAt" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SubscriptionList_correlationIdAt((struct blpapi_SubscriptionList const *)arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (!result) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(CorrelationId_t_clone(arg2), SWIGTYPE_p_blpapi_CorrelationId_t_, SWIG_POINTER_OWN)); - } else { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_Py_Void()); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_topicStringAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; - char **arg2 = (char **) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - char *temp2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_SubscriptionList_topicStringAt", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_topicStringAt" "', argument " "1"" of type '" "blpapi_SubscriptionList_t *""'"); - } - arg1 = (blpapi_SubscriptionList_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_SubscriptionList_topicStringAt" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SubscriptionList_topicStringAt(arg1,(char const **)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_isResolvedAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SubscriptionList_t *arg1 = (blpapi_SubscriptionList_t *) 0 ; - int *arg2 = (int *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int temp2 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_SubscriptionList_isResolvedAt", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SubscriptionList_isResolvedAt" "', argument " "1"" of type '" "blpapi_SubscriptionList_t *""'"); - } - arg1 = (blpapi_SubscriptionList_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_SubscriptionList_isResolvedAt" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SubscriptionList_isResolvedAt(arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, PyInt_FromLong(*arg2)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TimePoint_d_value_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct blpapi_TimePoint *arg1 = (struct blpapi_TimePoint *) 0 ; - blpapi_Int64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long long val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_TimePoint_d_value_set", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_TimePoint, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TimePoint_d_value_set" "', argument " "1"" of type '" "struct blpapi_TimePoint *""'"); - } - arg1 = (struct blpapi_TimePoint *)(argp1); - ecode2 = SWIG_AsVal_long_SS_long(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_TimePoint_d_value_set" "', argument " "2"" of type '" "blpapi_Int64_t""'"); - } - arg2 = (blpapi_Int64_t)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - if (arg1) (arg1)->d_value = arg2; - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TimePoint_d_value_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct blpapi_TimePoint *arg1 = (struct blpapi_TimePoint *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - blpapi_Int64_t result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_TimePoint, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TimePoint_d_value_get" "', argument " "1"" of type '" "struct blpapi_TimePoint *""'"); - } - arg1 = (struct blpapi_TimePoint *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Int64_t) ((arg1)->d_value); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_long_SS_long((long long)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_blpapi_TimePoint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct blpapi_TimePoint *result = 0 ; - - if (!SWIG_Python_UnpackTuple(args, "new_blpapi_TimePoint", 0, 0, 0)) SWIG_fail; - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (struct blpapi_TimePoint *)calloc(1, sizeof(struct blpapi_TimePoint)); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_TimePoint, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_blpapi_TimePoint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct blpapi_TimePoint *arg1 = (struct blpapi_TimePoint *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_TimePoint, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_blpapi_TimePoint" "', argument " "1"" of type '" "struct blpapi_TimePoint *""'"); - } - arg1 = (struct blpapi_TimePoint *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - free((char *) arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *blpapi_TimePoint_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_blpapi_TimePoint, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *blpapi_TimePoint_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - return SWIG_Python_InitShadowInstance(args); -} - -SWIGINTERN PyObject *_wrap_blpapi_TimePointUtil_nanosecondsBetween(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_TimePoint_t *arg1 = (blpapi_TimePoint_t *) 0 ; - blpapi_TimePoint_t *arg2 = (blpapi_TimePoint_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[2] ; - long long result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_TimePointUtil_nanosecondsBetween", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_TimePoint, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TimePointUtil_nanosecondsBetween" "', argument " "1"" of type '" "blpapi_TimePoint_t const *""'"); - } - arg1 = (blpapi_TimePoint_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_TimePoint, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_TimePointUtil_nanosecondsBetween" "', argument " "2"" of type '" "blpapi_TimePoint_t const *""'"); - } - arg2 = (blpapi_TimePoint_t *)(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (long long)blpapi_TimePointUtil_nanosecondsBetween((struct blpapi_TimePoint const *)arg1,(struct blpapi_TimePoint const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_long_SS_long((long long)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_parts_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; - blpapi_UChar_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned char val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Datetime_tag_parts_set", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_parts_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); - } - arg1 = (struct blpapi_Datetime_tag *)(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_char(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_parts_set" "', argument " "2"" of type '" "blpapi_UChar_t""'"); - } - arg2 = (blpapi_UChar_t)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - if (arg1) (arg1)->parts = arg2; - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_parts_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - blpapi_UChar_t result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_parts_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); - } - arg1 = (struct blpapi_Datetime_tag *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_UChar_t) ((arg1)->parts); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_unsigned_SS_char((unsigned char)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_hours_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; - blpapi_UChar_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned char val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Datetime_tag_hours_set", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_hours_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); - } - arg1 = (struct blpapi_Datetime_tag *)(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_char(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_hours_set" "', argument " "2"" of type '" "blpapi_UChar_t""'"); - } - arg2 = (blpapi_UChar_t)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - if (arg1) (arg1)->hours = arg2; - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_hours_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - blpapi_UChar_t result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_hours_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); - } - arg1 = (struct blpapi_Datetime_tag *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_UChar_t) ((arg1)->hours); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_unsigned_SS_char((unsigned char)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_minutes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; - blpapi_UChar_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned char val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Datetime_tag_minutes_set", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_minutes_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); - } - arg1 = (struct blpapi_Datetime_tag *)(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_char(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_minutes_set" "', argument " "2"" of type '" "blpapi_UChar_t""'"); - } - arg2 = (blpapi_UChar_t)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - if (arg1) (arg1)->minutes = arg2; - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_minutes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - blpapi_UChar_t result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_minutes_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); - } - arg1 = (struct blpapi_Datetime_tag *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_UChar_t) ((arg1)->minutes); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_unsigned_SS_char((unsigned char)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_seconds_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; - blpapi_UChar_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned char val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Datetime_tag_seconds_set", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_seconds_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); - } - arg1 = (struct blpapi_Datetime_tag *)(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_char(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_seconds_set" "', argument " "2"" of type '" "blpapi_UChar_t""'"); - } - arg2 = (blpapi_UChar_t)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - if (arg1) (arg1)->seconds = arg2; - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_seconds_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - blpapi_UChar_t result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_seconds_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); - } - arg1 = (struct blpapi_Datetime_tag *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_UChar_t) ((arg1)->seconds); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_unsigned_SS_char((unsigned char)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_milliSeconds_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; - blpapi_UInt16_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned short val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Datetime_tag_milliSeconds_set", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_milliSeconds_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); - } - arg1 = (struct blpapi_Datetime_tag *)(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_short(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_milliSeconds_set" "', argument " "2"" of type '" "blpapi_UInt16_t""'"); - } - arg2 = (blpapi_UInt16_t)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - if (arg1) (arg1)->milliSeconds = arg2; - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_milliSeconds_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - blpapi_UInt16_t result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_milliSeconds_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); - } - arg1 = (struct blpapi_Datetime_tag *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_UInt16_t) ((arg1)->milliSeconds); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_month_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; - blpapi_UChar_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned char val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Datetime_tag_month_set", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_month_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); - } - arg1 = (struct blpapi_Datetime_tag *)(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_char(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_month_set" "', argument " "2"" of type '" "blpapi_UChar_t""'"); - } - arg2 = (blpapi_UChar_t)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - if (arg1) (arg1)->month = arg2; - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_month_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - blpapi_UChar_t result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_month_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); - } - arg1 = (struct blpapi_Datetime_tag *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_UChar_t) ((arg1)->month); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_unsigned_SS_char((unsigned char)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_day_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; - blpapi_UChar_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned char val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Datetime_tag_day_set", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_day_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); - } - arg1 = (struct blpapi_Datetime_tag *)(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_char(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_day_set" "', argument " "2"" of type '" "blpapi_UChar_t""'"); - } - arg2 = (blpapi_UChar_t)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - if (arg1) (arg1)->day = arg2; - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_day_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - blpapi_UChar_t result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_day_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); - } - arg1 = (struct blpapi_Datetime_tag *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_UChar_t) ((arg1)->day); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_unsigned_SS_char((unsigned char)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_year_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; - blpapi_UInt16_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned short val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Datetime_tag_year_set", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_year_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); - } - arg1 = (struct blpapi_Datetime_tag *)(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_short(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_year_set" "', argument " "2"" of type '" "blpapi_UInt16_t""'"); - } - arg2 = (blpapi_UInt16_t)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - if (arg1) (arg1)->year = arg2; - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_year_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - blpapi_UInt16_t result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_year_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); - } - arg1 = (struct blpapi_Datetime_tag *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_UInt16_t) ((arg1)->year); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_offset_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; - blpapi_Int16_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - short val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Datetime_tag_offset_set", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_offset_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); - } - arg1 = (struct blpapi_Datetime_tag *)(argp1); - ecode2 = SWIG_AsVal_short(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Datetime_tag_offset_set" "', argument " "2"" of type '" "blpapi_Int16_t""'"); - } - arg2 = (blpapi_Int16_t)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - if (arg1) (arg1)->offset = arg2; - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_offset_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - blpapi_Int16_t result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_offset_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); - } - arg1 = (struct blpapi_Datetime_tag *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Int16_t) ((arg1)->offset); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_short((short)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_blpapi_Datetime_tag(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct blpapi_Datetime_tag *result = 0 ; - - if (!SWIG_Python_UnpackTuple(args, "new_blpapi_Datetime_tag", 0, 0, 0)) SWIG_fail; - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (struct blpapi_Datetime_tag *)calloc(1, sizeof(struct blpapi_Datetime_tag)); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Datetime_tag, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_blpapi_Datetime_tag(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Datetime_tag, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_blpapi_Datetime_tag" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); - } - arg1 = (struct blpapi_Datetime_tag *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - free((char *) arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *blpapi_Datetime_tag_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_blpapi_Datetime_tag, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *blpapi_Datetime_tag_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - return SWIG_Python_InitShadowInstance(args); -} - -SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_tag_datetime_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct blpapi_HighPrecisionDatetime_tag *arg1 = (struct blpapi_HighPrecisionDatetime_tag *) 0 ; - blpapi_Datetime_t *arg2 = (blpapi_Datetime_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[2] ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_HighPrecisionDatetime_tag_datetime_set", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_tag_datetime_set" "', argument " "1"" of type '" "struct blpapi_HighPrecisionDatetime_tag *""'"); - } - arg1 = (struct blpapi_HighPrecisionDatetime_tag *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_HighPrecisionDatetime_tag_datetime_set" "', argument " "2"" of type '" "blpapi_Datetime_t *""'"); - } - arg2 = (blpapi_Datetime_t *)(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - if (arg1) (arg1)->datetime = *arg2; - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_tag_datetime_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct blpapi_HighPrecisionDatetime_tag *arg1 = (struct blpapi_HighPrecisionDatetime_tag *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - blpapi_Datetime_t *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_tag_datetime_get" "', argument " "1"" of type '" "struct blpapi_HighPrecisionDatetime_tag *""'"); - } - arg1 = (struct blpapi_HighPrecisionDatetime_tag *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Datetime_t *)& ((arg1)->datetime); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Datetime_tag, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_tag_picoseconds_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct blpapi_HighPrecisionDatetime_tag *arg1 = (struct blpapi_HighPrecisionDatetime_tag *) 0 ; - blpapi_UInt32_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned int val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_HighPrecisionDatetime_tag_picoseconds_set", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_tag_picoseconds_set" "', argument " "1"" of type '" "struct blpapi_HighPrecisionDatetime_tag *""'"); - } - arg1 = (struct blpapi_HighPrecisionDatetime_tag *)(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_HighPrecisionDatetime_tag_picoseconds_set" "', argument " "2"" of type '" "blpapi_UInt32_t""'"); - } - arg2 = (blpapi_UInt32_t)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - if (arg1) (arg1)->picoseconds = arg2; - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_tag_picoseconds_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct blpapi_HighPrecisionDatetime_tag *arg1 = (struct blpapi_HighPrecisionDatetime_tag *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - blpapi_UInt32_t result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_tag_picoseconds_get" "', argument " "1"" of type '" "struct blpapi_HighPrecisionDatetime_tag *""'"); - } - arg1 = (struct blpapi_HighPrecisionDatetime_tag *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_UInt32_t) ((arg1)->picoseconds); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_blpapi_HighPrecisionDatetime_tag(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct blpapi_HighPrecisionDatetime_tag *result = 0 ; - - if (!SWIG_Python_UnpackTuple(args, "new_blpapi_HighPrecisionDatetime_tag", 0, 0, 0)) SWIG_fail; - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (struct blpapi_HighPrecisionDatetime_tag *)calloc(1, sizeof(struct blpapi_HighPrecisionDatetime_tag)); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_blpapi_HighPrecisionDatetime_tag(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct blpapi_HighPrecisionDatetime_tag *arg1 = (struct blpapi_HighPrecisionDatetime_tag *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_blpapi_HighPrecisionDatetime_tag" "', argument " "1"" of type '" "struct blpapi_HighPrecisionDatetime_tag *""'"); - } - arg1 = (struct blpapi_HighPrecisionDatetime_tag *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - free((char *) arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *blpapi_HighPrecisionDatetime_tag_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *blpapi_HighPrecisionDatetime_tag_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - return SWIG_Python_InitShadowInstance(args); -} - -SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_compare(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_HighPrecisionDatetime_t *arg1 = (blpapi_HighPrecisionDatetime_t *) 0 ; - blpapi_HighPrecisionDatetime_t *arg2 = (blpapi_HighPrecisionDatetime_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_HighPrecisionDatetime_compare", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_compare" "', argument " "1"" of type '" "blpapi_HighPrecisionDatetime_t const *""'"); - } - arg1 = (blpapi_HighPrecisionDatetime_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_HighPrecisionDatetime_compare" "', argument " "2"" of type '" "blpapi_HighPrecisionDatetime_t const *""'"); - } - arg2 = (blpapi_HighPrecisionDatetime_t *)(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_HighPrecisionDatetime_compare((struct blpapi_HighPrecisionDatetime_tag const *)arg1,(struct blpapi_HighPrecisionDatetime_tag const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_print(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_HighPrecisionDatetime_t *arg1 = (blpapi_HighPrecisionDatetime_t *) 0 ; - blpapi_StreamWriter_t arg2 ; - void *arg3 = (void *) 0 ; - int arg4 ; - int arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 ; - int res2 = 0 ; - int res3 ; - int val4 ; - int ecode4 = 0 ; - int val5 ; - int ecode5 = 0 ; - PyObject *swig_obj[5] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_HighPrecisionDatetime_print", 5, 5, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_print" "', argument " "1"" of type '" "blpapi_HighPrecisionDatetime_t const *""'"); - } - arg1 = (blpapi_HighPrecisionDatetime_t *)(argp1); - { - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_blpapi_StreamWriter_t, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_HighPrecisionDatetime_print" "', argument " "2"" of type '" "blpapi_StreamWriter_t""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "blpapi_HighPrecisionDatetime_print" "', argument " "2"" of type '" "blpapi_StreamWriter_t""'"); - } else { - arg2 = *((blpapi_StreamWriter_t *)(argp2)); - } - } - res3 = SWIG_ConvertPtr(swig_obj[2],SWIG_as_voidptrptr(&arg3), 0, 0); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_HighPrecisionDatetime_print" "', argument " "3"" of type '" "void *""'"); - } - ecode4 = SWIG_AsVal_int(swig_obj[3], &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_HighPrecisionDatetime_print" "', argument " "4"" of type '" "int""'"); - } - arg4 = (int)(val4); - ecode5 = SWIG_AsVal_int(swig_obj[4], &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_HighPrecisionDatetime_print" "', argument " "5"" of type '" "int""'"); - } - arg5 = (int)(val5); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_HighPrecisionDatetime_print((struct blpapi_HighPrecisionDatetime_tag const *)arg1,arg2,arg3,arg4,arg5); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_fromTimePoint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_HighPrecisionDatetime_t *arg1 = (blpapi_HighPrecisionDatetime_t *) 0 ; - blpapi_TimePoint_t *arg2 = (blpapi_TimePoint_t *) 0 ; - short arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_TimePoint_t temp2 ; - short val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_HighPrecisionDatetime_fromTimePoint", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_fromTimePoint" "', argument " "1"" of type '" "blpapi_HighPrecisionDatetime_t *""'"); - } - arg1 = (blpapi_HighPrecisionDatetime_t *)(argp1); - ecode3 = SWIG_AsVal_short(swig_obj[1], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_HighPrecisionDatetime_fromTimePoint" "', argument " "3"" of type '" "short""'"); - } - arg3 = (short)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_HighPrecisionDatetime_fromTimePoint(arg1,(struct blpapi_TimePoint const *)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - { - blpapi_TimePoint_t *outputPtr = (blpapi_TimePoint_t *) malloc(sizeof(blpapi_TimePoint_t)); - *outputPtr = *arg2; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(outputPtr, SWIGTYPE_p_blpapi_TimePoint, SWIG_POINTER_OWN)); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Constant_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - blpapi_Name_t *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_name" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); - } - arg1 = (blpapi_Constant_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Name_t *)blpapi_Constant_name((struct blpapi_Constant const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Constant_description(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - char *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_description" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); - } - arg1 = (blpapi_Constant_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_Constant_description((struct blpapi_Constant const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Constant_status(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_status" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); - } - arg1 = (blpapi_Constant_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Constant_status((struct blpapi_Constant const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Constant_datatype(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_datatype" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); - } - arg1 = (blpapi_Constant_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Constant_datatype((struct blpapi_Constant const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Constant_getValueAsChar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; - blpapi_Char_t *arg2 = (blpapi_Char_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Char_t temp2 ; - int res2 = SWIG_TMPOBJ ; - PyObject *swig_obj[1] ; - int result; - - arg2 = &temp2; - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_getValueAsChar" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); - } - arg1 = (blpapi_Constant_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Constant_getValueAsChar((struct blpapi_Constant const *)arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (SWIG_IsTmpObj(res2)) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_char((*arg2))); - } else { - int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_char, new_flags)); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Constant_getValueAsInt32(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; - blpapi_Int32_t *arg2 = (blpapi_Int32_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int temp2 ; - PyObject *swig_obj[1] ; - int result; - - arg2 = &temp2; - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_getValueAsInt32" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); - } - arg1 = (blpapi_Constant_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Constant_getValueAsInt32((struct blpapi_Constant const *)arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, PyInt_FromLong(*arg2)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Constant_getValueAsInt64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; - blpapi_Int64_t *arg2 = (blpapi_Int64_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Int64_t temp2 ; - int res2 = SWIG_TMPOBJ ; - PyObject *swig_obj[1] ; - int result; - - arg2 = &temp2; - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_getValueAsInt64" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); - } - arg1 = (blpapi_Constant_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Constant_getValueAsInt64((struct blpapi_Constant const *)arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (SWIG_IsTmpObj(res2)) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_long_SS_long((*arg2))); - } else { - int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_long_long, new_flags)); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Constant_getValueAsFloat32(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; - blpapi_Float32_t *arg2 = (blpapi_Float32_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Float32_t temp2 ; - int res2 = SWIG_TMPOBJ ; - PyObject *swig_obj[1] ; - int result; - - arg2 = &temp2; - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_getValueAsFloat32" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); - } - arg1 = (blpapi_Constant_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Constant_getValueAsFloat32((struct blpapi_Constant const *)arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (SWIG_IsTmpObj(res2)) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_float((*arg2))); - } else { - int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_float, new_flags)); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Constant_getValueAsFloat64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; - blpapi_Float64_t *arg2 = (blpapi_Float64_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Float64_t temp2 ; - int res2 = SWIG_TMPOBJ ; - PyObject *swig_obj[1] ; - int result; - - arg2 = &temp2; - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_getValueAsFloat64" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); - } - arg1 = (blpapi_Constant_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Constant_getValueAsFloat64((struct blpapi_Constant const *)arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (SWIG_IsTmpObj(res2)) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_double((*arg2))); - } else { - int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_double, new_flags)); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Constant_getValueAsDatetime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; - blpapi_Datetime_t *arg2 = (blpapi_Datetime_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Datetime_t temp2 ; - PyObject *swig_obj[1] ; - int result; - - arg2 = &temp2; - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_getValueAsDatetime" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); - } - arg1 = (blpapi_Constant_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Constant_getValueAsDatetime((struct blpapi_Constant const *)arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - { - blpapi_Datetime_t *outputPtr = (blpapi_Datetime_t *) malloc(sizeof(blpapi_Datetime_t)); - *outputPtr = *arg2; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(outputPtr, SWIGTYPE_p_blpapi_Datetime_tag, SWIG_POINTER_OWN)); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Constant_getValueAsString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Constant_t *arg1 = (blpapi_Constant_t *) 0 ; - char **arg2 = (char **) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - char *temp2 = 0 ; - PyObject *swig_obj[1] ; - int result; - - arg2 = &temp2; - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Constant, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Constant_getValueAsString" "', argument " "1"" of type '" "blpapi_Constant_t const *""'"); - } - arg1 = (blpapi_Constant_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Constant_getValueAsString((struct blpapi_Constant const *)arg1,(char const **)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ConstantList_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ConstantList_t *arg1 = (blpapi_ConstantList_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - blpapi_Name_t *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_name" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); - } - arg1 = (blpapi_ConstantList_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Name_t *)blpapi_ConstantList_name((struct blpapi_ConstantList const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ConstantList_description(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ConstantList_t *arg1 = (blpapi_ConstantList_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - char *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_description" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); - } - arg1 = (blpapi_ConstantList_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_ConstantList_description((struct blpapi_ConstantList const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ConstantList_numConstants(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ConstantList_t *arg1 = (blpapi_ConstantList_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_numConstants" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); - } - arg1 = (blpapi_ConstantList_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ConstantList_numConstants((struct blpapi_ConstantList const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ConstantList_datatype(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ConstantList_t *arg1 = (blpapi_ConstantList_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_datatype" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); - } - arg1 = (blpapi_ConstantList_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ConstantList_datatype((struct blpapi_ConstantList const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ConstantList_status(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ConstantList_t *arg1 = (blpapi_ConstantList_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_status" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); - } - arg1 = (blpapi_ConstantList_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ConstantList_status((struct blpapi_ConstantList const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ConstantList_getConstant(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ConstantList_t *arg1 = (blpapi_ConstantList_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject *swig_obj[3] ; - blpapi_Constant_t *result = 0 ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_ConstantList_getConstant", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_getConstant" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); - } - arg1 = (blpapi_ConstantList_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ConstantList_getConstant" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ConstantList_getConstant" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = (blpapi_Name_t *)(argp3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Constant_t *)blpapi_ConstantList_getConstant((struct blpapi_ConstantList const *)arg1,(char const *)arg2,(struct blpapi_Name const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Constant, 0 | 0 ); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ConstantList_getConstantAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ConstantList_t *arg1 = (blpapi_ConstantList_t *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - blpapi_Constant_t *result = 0 ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_ConstantList_getConstantAt", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ConstantList_getConstantAt" "', argument " "1"" of type '" "blpapi_ConstantList_t const *""'"); - } - arg1 = (blpapi_ConstantList_t *)(argp1); - ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_ConstantList_getConstantAt" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = (size_t)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Constant_t *)blpapi_ConstantList_getConstantAt((struct blpapi_ConstantList const *)arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Constant, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - blpapi_Name_t *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_name" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); - } - arg1 = (blpapi_SchemaElementDefinition_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Name_t *)blpapi_SchemaElementDefinition_name((struct blpapi_SchemaElementDefinition const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_description(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - char *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_description" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); - } - arg1 = (blpapi_SchemaElementDefinition_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_SchemaElementDefinition_description((struct blpapi_SchemaElementDefinition const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_status(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_status" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); - } - arg1 = (blpapi_SchemaElementDefinition_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SchemaElementDefinition_status((struct blpapi_SchemaElementDefinition const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_type(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - blpapi_SchemaTypeDefinition_t *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_type" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); - } - arg1 = (blpapi_SchemaElementDefinition_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_SchemaTypeDefinition_t *)blpapi_SchemaElementDefinition_type((struct blpapi_SchemaElementDefinition const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_void, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_numAlternateNames(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - size_t result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_numAlternateNames" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); - } - arg1 = (blpapi_SchemaElementDefinition_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = blpapi_SchemaElementDefinition_numAlternateNames((struct blpapi_SchemaElementDefinition const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_size_t((size_t)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_getAlternateName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - blpapi_Name_t *result = 0 ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_SchemaElementDefinition_getAlternateName", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_getAlternateName" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); - } - arg1 = (blpapi_SchemaElementDefinition_t *)(argp1); - ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SchemaElementDefinition_getAlternateName" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = (size_t)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Name_t *)blpapi_SchemaElementDefinition_getAlternateName((struct blpapi_SchemaElementDefinition const *)arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_minValues(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - size_t result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_minValues" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); - } - arg1 = (blpapi_SchemaElementDefinition_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = blpapi_SchemaElementDefinition_minValues((struct blpapi_SchemaElementDefinition const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_size_t((size_t)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_maxValues(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaElementDefinition_t *arg1 = (blpapi_SchemaElementDefinition_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - size_t result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaElementDefinition_maxValues" "', argument " "1"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); - } - arg1 = (blpapi_SchemaElementDefinition_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = blpapi_SchemaElementDefinition_maxValues((struct blpapi_SchemaElementDefinition const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_size_t((size_t)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - blpapi_Name_t *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_p_void, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_name" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); - } - arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Name_t *)blpapi_SchemaTypeDefinition_name((void *const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_description(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - char *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_p_void, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_description" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); - } - arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_SchemaTypeDefinition_description((void *const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_status(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_p_void, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_status" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); - } - arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SchemaTypeDefinition_status((void *const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_datatype(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_p_void, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_datatype" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); - } - arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SchemaTypeDefinition_datatype((void *const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_isComplexType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_p_void, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_isComplexType" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); - } - arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SchemaTypeDefinition_isComplexType((void *const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_isSimpleType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_p_void, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_isSimpleType" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); - } - arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SchemaTypeDefinition_isSimpleType((void *const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_isEnumerationType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_p_void, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_isEnumerationType" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); - } - arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_SchemaTypeDefinition_isEnumerationType((void *const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_numElementDefinitions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - size_t result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_p_void, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_numElementDefinitions" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); - } - arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = blpapi_SchemaTypeDefinition_numElementDefinitions((void *const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_size_t((size_t)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_getElementDefinition(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject *swig_obj[3] ; - blpapi_SchemaElementDefinition_t *result = 0 ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_SchemaTypeDefinition_getElementDefinition", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_p_void, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_getElementDefinition" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); - } - arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_SchemaTypeDefinition_getElementDefinition" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_SchemaTypeDefinition_getElementDefinition" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = (blpapi_Name_t *)(argp3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_SchemaElementDefinition_t *)blpapi_SchemaTypeDefinition_getElementDefinition((void *const *)arg1,(char const *)arg2,(struct blpapi_Name const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_getElementDefinitionAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - blpapi_SchemaElementDefinition_t *result = 0 ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_SchemaTypeDefinition_getElementDefinitionAt", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_p_void, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_getElementDefinitionAt" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); - } - arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); - ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_SchemaTypeDefinition_getElementDefinitionAt" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = (size_t)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_SchemaElementDefinition_t *)blpapi_SchemaTypeDefinition_getElementDefinitionAt((void *const *)arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_enumeration(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaTypeDefinition_t *arg1 = (blpapi_SchemaTypeDefinition_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - blpapi_ConstantList_t *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_p_void, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_SchemaTypeDefinition_enumeration" "', argument " "1"" of type '" "blpapi_SchemaTypeDefinition_t const *""'"); - } - arg1 = (blpapi_SchemaTypeDefinition_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_ConstantList_t *)blpapi_SchemaTypeDefinition_enumeration((void *const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_ConstantList, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Request_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Request_t *arg1 = (blpapi_Request_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Request, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Request_destroy" "', argument " "1"" of type '" "blpapi_Request_t *""'"); - } - arg1 = (blpapi_Request_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_Request_destroy(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Request_elements(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Request_t *arg1 = (blpapi_Request_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - blpapi_Element_t *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Request, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Request_elements" "', argument " "1"" of type '" "blpapi_Request_t *""'"); - } - arg1 = (blpapi_Request_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Element_t *)blpapi_Request_elements(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Element, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Request_setPreferredRoute(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Request_t *arg1 = (blpapi_Request_t *) 0 ; - blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[2] ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Request_setPreferredRoute", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Request, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Request_setPreferredRoute" "', argument " "1"" of type '" "blpapi_Request_t *""'"); - } - arg1 = (blpapi_Request_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Request_setPreferredRoute" "', argument " "2"" of type '" "blpapi_CorrelationId_t *""'"); - } - arg2 = (blpapi_CorrelationId_t *)(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_Request_setPreferredRoute(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Request_getRequestId(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Request_t *arg1 = (blpapi_Request_t *) 0 ; - char **arg2 = (char **) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - char *temp2 = 0 ; - PyObject *swig_obj[1] ; - int result; - - arg2 = &temp2; - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Request, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Request_getRequestId" "', argument " "1"" of type '" "blpapi_Request_t const *""'"); - } - arg1 = (blpapi_Request_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Request_getRequestId((struct blpapi_Request const *)arg1,(char const **)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_RequestTemplate_release(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_RequestTemplate_t *arg1 = (blpapi_RequestTemplate_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_RequestTemplate, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_RequestTemplate_release" "', argument " "1"" of type '" "blpapi_RequestTemplate_t const *""'"); - } - arg1 = (blpapi_RequestTemplate_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_RequestTemplate_release((struct blpapi_RequestTemplate const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Operation_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Operation_t *arg1 = (blpapi_Operation_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - char *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Operation, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Operation_name" "', argument " "1"" of type '" "blpapi_Operation_t *""'"); - } - arg1 = (blpapi_Operation_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_Operation_name(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Operation_description(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Operation_t *arg1 = (blpapi_Operation_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - char *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Operation, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Operation_description" "', argument " "1"" of type '" "blpapi_Operation_t *""'"); - } - arg1 = (blpapi_Operation_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_Operation_description(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Operation_requestDefinition(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Operation_t *arg1 = (blpapi_Operation_t *) 0 ; - blpapi_SchemaElementDefinition_t **arg2 = (blpapi_SchemaElementDefinition_t **) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_SchemaElementDefinition_t *temp2 = 0 ; - PyObject *swig_obj[1] ; - int result; - - arg2 = &temp2; - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Operation, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Operation_requestDefinition" "', argument " "1"" of type '" "blpapi_Operation_t *""'"); - } - arg1 = (blpapi_Operation_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Operation_requestDefinition(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_SchemaElementDefinition, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Operation_numResponseDefinitions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Operation_t *arg1 = (blpapi_Operation_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Operation, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Operation_numResponseDefinitions" "', argument " "1"" of type '" "blpapi_Operation_t *""'"); - } - arg1 = (blpapi_Operation_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Operation_numResponseDefinitions(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Operation_responseDefinition(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Operation_t *arg1 = (blpapi_Operation_t *) 0 ; - blpapi_SchemaElementDefinition_t **arg2 = (blpapi_SchemaElementDefinition_t **) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_SchemaElementDefinition_t *temp2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_Operation_responseDefinition", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Operation, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Operation_responseDefinition" "', argument " "1"" of type '" "blpapi_Operation_t *""'"); - } - arg1 = (blpapi_Operation_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Operation_responseDefinition" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Operation_responseDefinition(arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_SchemaElementDefinition, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Operation_responseDefinitionFromName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Operation_t *arg1 = (blpapi_Operation_t *) 0 ; - blpapi_SchemaElementDefinition_t **arg2 = (blpapi_SchemaElementDefinition_t **) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_SchemaElementDefinition_t *temp2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_Operation_responseDefinitionFromName", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Operation, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Operation_responseDefinitionFromName" "', argument " "1"" of type '" "blpapi_Operation_t *""'"); - } - arg1 = (blpapi_Operation_t *)(argp1); - res3 = SWIG_ConvertPtr(swig_obj[1], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Operation_responseDefinitionFromName" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = (blpapi_Name_t *)(argp3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Operation_responseDefinitionFromName(arg1,arg2,(struct blpapi_Name const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_SchemaElementDefinition, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Service_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - char *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_name" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = (blpapi_Service_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_Service_name(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Service_description(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - char *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_description" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = (blpapi_Service_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_Service_description(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Service_numOperations(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_numOperations" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = (blpapi_Service_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Service_numOperations(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Service_numEventDefinitions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_numEventDefinitions" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = (blpapi_Service_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Service_numEventDefinitions(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Service_addRef(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_addRef" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = (blpapi_Service_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Service_addRef(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Service_release(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_release" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = (blpapi_Service_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_Service_release(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Service_authorizationServiceName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - char *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_authorizationServiceName" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = (blpapi_Service_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_Service_authorizationServiceName(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Service_getOperation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - blpapi_Operation_t **arg2 = (blpapi_Operation_t **) 0 ; - char *arg3 = (char *) 0 ; - blpapi_Name_t *arg4 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Operation_t *temp2 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject *swig_obj[3] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_Service_getOperation", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_getOperation" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = (blpapi_Service_t *)(argp1); - res3 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf3, NULL, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Service_getOperation" "', argument " "3"" of type '" "char const *""'"); - } - arg3 = (char *)(buf3); - res4 = SWIG_ConvertPtr(swig_obj[2], &argp4,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Service_getOperation" "', argument " "4"" of type '" "blpapi_Name_t const *""'"); - } - arg4 = (blpapi_Name_t *)(argp4); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Service_getOperation(arg1,arg2,(char const *)arg3,(struct blpapi_Name const *)arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Operation, 0)); - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); - return resultobj; -fail: - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Service_getOperationAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - blpapi_Operation_t **arg2 = (blpapi_Operation_t **) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Operation_t *temp2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_Service_getOperationAt", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_getOperationAt" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = (blpapi_Service_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Service_getOperationAt" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Service_getOperationAt(arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Operation, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Service_getEventDefinition(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - blpapi_SchemaElementDefinition_t **arg2 = (blpapi_SchemaElementDefinition_t **) 0 ; - char *arg3 = (char *) 0 ; - blpapi_Name_t *arg4 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_SchemaElementDefinition_t *temp2 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject *swig_obj[3] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_Service_getEventDefinition", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_getEventDefinition" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = (blpapi_Service_t *)(argp1); - res3 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf3, NULL, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Service_getEventDefinition" "', argument " "3"" of type '" "char const *""'"); - } - arg3 = (char *)(buf3); - res4 = SWIG_ConvertPtr(swig_obj[2], &argp4,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Service_getEventDefinition" "', argument " "4"" of type '" "blpapi_Name_t const *""'"); - } - arg4 = (blpapi_Name_t *)(argp4); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Service_getEventDefinition(arg1,arg2,(char const *)arg3,(struct blpapi_Name const *)arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_SchemaElementDefinition, 0)); - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); - return resultobj; -fail: - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Service_getEventDefinitionAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - blpapi_SchemaElementDefinition_t **arg2 = (blpapi_SchemaElementDefinition_t **) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_SchemaElementDefinition_t *temp2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_Service_getEventDefinitionAt", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_getEventDefinitionAt" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = (blpapi_Service_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Service_getEventDefinitionAt" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Service_getEventDefinitionAt(arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_SchemaElementDefinition, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Service_createRequest(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - blpapi_Request_t **arg2 = (blpapi_Request_t **) 0 ; - char *arg3 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Request_t *temp2 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_Service_createRequest", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_createRequest" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = (blpapi_Service_t *)(argp1); - res3 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf3, NULL, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Service_createRequest" "', argument " "3"" of type '" "char const *""'"); - } - arg3 = (char *)(buf3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Service_createRequest(arg1,arg2,(char const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Request, 0)); - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); - return resultobj; -fail: - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Service_createAuthorizationRequest(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - blpapi_Request_t **arg2 = (blpapi_Request_t **) 0 ; - char *arg3 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Request_t *temp2 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_Service_createAuthorizationRequest", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_createAuthorizationRequest" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = (blpapi_Service_t *)(argp1); - res3 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf3, NULL, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Service_createAuthorizationRequest" "', argument " "3"" of type '" "char const *""'"); - } - arg3 = (char *)(buf3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Service_createAuthorizationRequest(arg1,arg2,(char const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Request, 0)); - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); - return resultobj; -fail: - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Service_createPublishEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - blpapi_Event_t **arg2 = (blpapi_Event_t **) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Event_t *temp2 = 0 ; - PyObject *swig_obj[1] ; - int result; - - arg2 = &temp2; - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_createPublishEvent" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = (blpapi_Service_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Service_createPublishEvent(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Event, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Service_createAdminEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - blpapi_Event_t **arg2 = (blpapi_Event_t **) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Event_t *temp2 = 0 ; - PyObject *swig_obj[1] ; - int result; - - arg2 = &temp2; - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_createAdminEvent" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = (blpapi_Service_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Service_createAdminEvent(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Event, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Service_createResponseEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Service_t *arg1 = (blpapi_Service_t *) 0 ; - blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; - blpapi_Event_t **arg3 = (blpapi_Event_t **) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - blpapi_Event_t *temp3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg3 = &temp3; - if (!SWIG_Python_UnpackTuple(args, "blpapi_Service_createResponseEvent", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Service_createResponseEvent" "', argument " "1"" of type '" "blpapi_Service_t *""'"); - } - arg1 = (blpapi_Service_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Service_createResponseEvent" "', argument " "2"" of type '" "blpapi_CorrelationId_t const *""'"); - } - arg2 = (blpapi_CorrelationId_t *)(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Service_createResponseEvent(arg1,(struct blpapi_CorrelationId_t_ const *)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg3), SWIGTYPE_p_blpapi_Event, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Message_messageType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - blpapi_Name_t *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_messageType" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); - } - arg1 = (blpapi_Message_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Name_t *)blpapi_Message_messageType((struct blpapi_Message const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Name, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Message_topicName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - char *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_topicName" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); - } - arg1 = (blpapi_Message_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_Message_topicName((struct blpapi_Message const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Message_service(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - blpapi_Service_t *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_service" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); - } - arg1 = (blpapi_Message_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Service_t *)blpapi_Message_service((struct blpapi_Message const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Service, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Message_numCorrelationIds(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_numCorrelationIds" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); - } - arg1 = (blpapi_Message_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Message_numCorrelationIds((struct blpapi_Message const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Message_correlationId(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - blpapi_CorrelationId_t result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Message_correlationId", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_correlationId" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); - } - arg1 = (blpapi_Message_t *)(argp1); - ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_Message_correlationId" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = (size_t)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = blpapi_Message_correlationId((struct blpapi_Message const *)arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(CorrelationId_t_clone(&result), SWIGTYPE_p_blpapi_CorrelationId_t_, SWIG_POINTER_OWN)); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Message_getRequestId(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; - char **arg2 = (char **) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - char *temp2 = 0 ; - PyObject *swig_obj[1] ; - int result; - - arg2 = &temp2; - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_getRequestId" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); - } - arg1 = (blpapi_Message_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Message_getRequestId((struct blpapi_Message const *)arg1,(char const **)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Message_elements(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - blpapi_Element_t *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_elements" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); - } - arg1 = (blpapi_Message_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Element_t *)blpapi_Message_elements((struct blpapi_Message const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Element, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Message_fragmentType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_fragmentType" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); - } - arg1 = (blpapi_Message_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Message_fragmentType((struct blpapi_Message const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Message_recapType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_recapType" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); - } - arg1 = (blpapi_Message_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Message_recapType((struct blpapi_Message const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Message_addRef(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_addRef" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); - } - arg1 = (blpapi_Message_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Message_addRef((struct blpapi_Message const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Message_release(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_release" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); - } - arg1 = (blpapi_Message_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Message_release((struct blpapi_Message const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Message_timeReceived(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; - blpapi_TimePoint_t *arg2 = (blpapi_TimePoint_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_TimePoint_t temp2 ; - PyObject *swig_obj[1] ; - int result; - - arg2 = &temp2; - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Message_timeReceived" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); - } - arg1 = (blpapi_Message_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Message_timeReceived((struct blpapi_Message const *)arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - { - blpapi_TimePoint_t *outputPtr = (blpapi_TimePoint_t *) malloc(sizeof(blpapi_TimePoint_t)); - *outputPtr = *arg2; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(outputPtr, SWIGTYPE_p_blpapi_TimePoint, SWIG_POINTER_OWN)); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Event_eventType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Event_t *arg1 = (blpapi_Event_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Event, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Event_eventType" "', argument " "1"" of type '" "blpapi_Event_t const *""'"); - } - arg1 = (blpapi_Event_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Event_eventType((struct blpapi_Event const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Event_release(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Event_t *arg1 = (blpapi_Event_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Event, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Event_release" "', argument " "1"" of type '" "blpapi_Event_t const *""'"); - } - arg1 = (blpapi_Event_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Event_release((struct blpapi_Event const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventQueue_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventQueue_t *result = 0 ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_EventQueue_create", 0, 0, 0)) SWIG_fail; - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_EventQueue_t *)blpapi_EventQueue_create(); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventQueue_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventQueue_t *arg1 = (blpapi_EventQueue_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventQueue_destroy" "', argument " "1"" of type '" "blpapi_EventQueue_t *""'"); - } - arg1 = (blpapi_EventQueue_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventQueue_destroy(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventQueue_nextEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventQueue_t *arg1 = (blpapi_EventQueue_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - blpapi_Event_t *result = 0 ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_EventQueue_nextEvent", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventQueue_nextEvent" "', argument " "1"" of type '" "blpapi_EventQueue_t *""'"); - } - arg1 = (blpapi_EventQueue_t *)(argp1); - ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_EventQueue_nextEvent" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Event_t *)blpapi_EventQueue_nextEvent(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Event, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventQueue_purge(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventQueue_t *arg1 = (blpapi_EventQueue_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventQueue_purge" "', argument " "1"" of type '" "blpapi_EventQueue_t *""'"); - } - arg1 = (blpapi_EventQueue_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventQueue_purge(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_EventQueue_tryNextEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_EventQueue_t *arg1 = (blpapi_EventQueue_t *) 0 ; - blpapi_Event_t **arg2 = (blpapi_Event_t **) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Event_t *temp2 = 0 ; - PyObject *swig_obj[1] ; - int result; - - arg2 = &temp2; - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_EventQueue_tryNextEvent" "', argument " "1"" of type '" "blpapi_EventQueue_t *""'"); - } - arg1 = (blpapi_EventQueue_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_EventQueue_tryNextEvent(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Event, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageIterator_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Event_t *arg1 = (blpapi_Event_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - blpapi_MessageIterator_t *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Event, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageIterator_create" "', argument " "1"" of type '" "blpapi_Event_t const *""'"); - } - arg1 = (blpapi_Event_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_MessageIterator_t *)blpapi_MessageIterator_create((struct blpapi_Event const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_MessageIterator, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageIterator_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageIterator_t *arg1 = (blpapi_MessageIterator_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageIterator, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageIterator_destroy" "', argument " "1"" of type '" "blpapi_MessageIterator_t *""'"); - } - arg1 = (blpapi_MessageIterator_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_MessageIterator_destroy(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageIterator_next(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageIterator_t *arg1 = (blpapi_MessageIterator_t *) 0 ; - blpapi_Message_t **arg2 = (blpapi_Message_t **) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Message_t *temp2 = 0 ; - PyObject *swig_obj[1] ; - int result; - - arg2 = &temp2; - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageIterator, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageIterator_next" "', argument " "1"" of type '" "blpapi_MessageIterator_t *""'"); - } - arg1 = (blpapi_MessageIterator_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_MessageIterator_next(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Message, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Identity_release(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Identity_t *arg1 = (blpapi_Identity_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Identity_release" "', argument " "1"" of type '" "blpapi_Identity_t *""'"); - } - arg1 = (blpapi_Identity_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_Identity_release(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Identity_addRef(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Identity_t *arg1 = (blpapi_Identity_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Identity_addRef" "', argument " "1"" of type '" "blpapi_Identity_t *""'"); - } - arg1 = (blpapi_Identity_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Identity_addRef(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Identity_hasEntitlements(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Identity_t *arg1 = (blpapi_Identity_t *) 0 ; - blpapi_Service_t *arg2 = (blpapi_Service_t *) 0 ; - blpapi_Element_t *arg3 = (blpapi_Element_t *) 0 ; - int *arg4 = (int *) 0 ; - size_t arg5 ; - int *arg6 = (int *) 0 ; - int *arg7 = (int *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - PyObject *swig_obj[7] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Identity_hasEntitlements", 7, 7, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Identity_hasEntitlements" "', argument " "1"" of type '" "blpapi_Identity_t const *""'"); - } - arg1 = (blpapi_Identity_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Identity_hasEntitlements" "', argument " "2"" of type '" "blpapi_Service_t const *""'"); - } - arg2 = (blpapi_Service_t *)(argp2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Element, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Identity_hasEntitlements" "', argument " "3"" of type '" "blpapi_Element_t const *""'"); - } - arg3 = (blpapi_Element_t *)(argp3); - res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Identity_hasEntitlements" "', argument " "4"" of type '" "int const *""'"); - } - arg4 = (int *)(argp4); - ecode5 = SWIG_AsVal_size_t(swig_obj[4], &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_Identity_hasEntitlements" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = (size_t)(val5); - res6 = SWIG_ConvertPtr(swig_obj[5], &argp6,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "blpapi_Identity_hasEntitlements" "', argument " "6"" of type '" "int *""'"); - } - arg6 = (int *)(argp6); - res7 = SWIG_ConvertPtr(swig_obj[6], &argp7,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "blpapi_Identity_hasEntitlements" "', argument " "7"" of type '" "int *""'"); - } - arg7 = (int *)(argp7); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Identity_hasEntitlements((struct blpapi_Identity const *)arg1,(struct blpapi_Service const *)arg2,(struct blpapi_Element const *)arg3,(int const *)arg4,arg5,arg6,arg7); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Identity_isAuthorized(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Identity_t *arg1 = (blpapi_Identity_t *) 0 ; - blpapi_Service_t *arg2 = (blpapi_Service_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Identity_isAuthorized", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Identity_isAuthorized" "', argument " "1"" of type '" "blpapi_Identity_t const *""'"); - } - arg1 = (blpapi_Identity_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Identity_isAuthorized" "', argument " "2"" of type '" "blpapi_Service_t const *""'"); - } - arg2 = (blpapi_Service_t *)(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Identity_isAuthorized((struct blpapi_Identity const *)arg1,(struct blpapi_Service const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Identity_getSeatType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Identity_t *arg1 = (blpapi_Identity_t *) 0 ; - int *arg2 = (int *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int temp2 ; - PyObject *swig_obj[1] ; - int result; - - arg2 = &temp2; - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Identity_getSeatType" "', argument " "1"" of type '" "blpapi_Identity_t const *""'"); - } - arg1 = (blpapi_Identity_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Identity_getSeatType((struct blpapi_Identity const *)arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, PyInt_FromLong(*arg2)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_HighResolutionClock_now(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_TimePoint_t *arg1 = (blpapi_TimePoint_t *) 0 ; - blpapi_TimePoint_t temp1 ; - int result; - - arg1 = &temp1; - if (!SWIG_Python_UnpackTuple(args, "blpapi_HighResolutionClock_now", 0, 0, 0)) SWIG_fail; - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_HighResolutionClock_now(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - { - blpapi_TimePoint_t *outputPtr = (blpapi_TimePoint_t *) malloc(sizeof(blpapi_TimePoint_t)); - *outputPtr = *arg1; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(outputPtr, SWIGTYPE_p_blpapi_TimePoint, SWIG_POINTER_OWN)); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_cancel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; - blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; - size_t arg3 ; - char *arg4 = (char *) 0 ; - int arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res4 ; - char *buf4 = 0 ; - size_t size4 = 0 ; - int alloc4 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_AbstractSession_cancel", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_cancel" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); - } - arg1 = (blpapi_AbstractSession_t *)(argp1); - { - int sz = PyList_Size(swig_obj[1]); - int res = 0; - arg2 = 0; - arg3 = sz; - if(sz) { - /* Define loop index at the top because old VisualStudio compilers */ - /* don't like variable declarations inside for-statements. */ - int i = 0; - arg2 = (blpapi_CorrelationId_t*) malloc(sizeof(blpapi_CorrelationId_t) * sz); - /* We are ignoring possible errors for malloc return value. */ - /* There aren't any perfect solutions for failure to allocate here, */ - /* and SWIG also seems to ignore this in its own generated code. */ - for(; i < sz; ++i) { - PyObject * thing = PyList_GetItem(swig_obj[1], i); - void* argp; - res = SWIG_ConvertPtr(thing, &argp, SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res)) { - SWIG_exception_fail(SWIG_ArgError(res), "Expected a list of blpapi_CorrelationId_t const * as a 2nd argument"); - } - arg2[i] = *(blpapi_CorrelationId_t*)argp; - } - } - } - res4 = SWIG_AsCharPtrAndSize(swig_obj[2], &buf4, &size4, &alloc4); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_AbstractSession_cancel" "', argument " "4"" of type '" "char const *""'"); - } - arg4 = (char *)(buf4); - arg5 = (int)(size4 - 1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AbstractSession_cancel(arg1,(struct blpapi_CorrelationId_t_ const *)arg2,arg3,(char const *)arg4,arg5); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - { - if(arg2) free(arg2); - } - if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); - return resultobj; -fail: - { - if(arg2) free(arg2); - } - if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_sendAuthorizationRequest(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; - blpapi_Request_t *arg2 = (blpapi_Request_t *) 0 ; - blpapi_Identity_t *arg3 = (blpapi_Identity_t *) 0 ; - blpapi_CorrelationId_t *arg4 = (blpapi_CorrelationId_t *) 0 ; - blpapi_EventQueue_t *arg5 = (blpapi_EventQueue_t *) 0 ; - char *arg6 = (char *) 0 ; - int arg7 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - int res6 ; - char *buf6 = 0 ; - size_t size6 = 0 ; - int alloc6 = 0 ; - PyObject *swig_obj[6] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_AbstractSession_sendAuthorizationRequest", 6, 6, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_sendAuthorizationRequest" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); - } - arg1 = (blpapi_AbstractSession_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Request, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_sendAuthorizationRequest" "', argument " "2"" of type '" "blpapi_Request_t const *""'"); - } - arg2 = (blpapi_Request_t *)(argp2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AbstractSession_sendAuthorizationRequest" "', argument " "3"" of type '" "blpapi_Identity_t *""'"); - } - arg3 = (blpapi_Identity_t *)(argp3); - res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_AbstractSession_sendAuthorizationRequest" "', argument " "4"" of type '" "blpapi_CorrelationId_t *""'"); - } - arg4 = (blpapi_CorrelationId_t *)(argp4); - res5 = SWIG_ConvertPtr(swig_obj[4], &argp5,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "blpapi_AbstractSession_sendAuthorizationRequest" "', argument " "5"" of type '" "blpapi_EventQueue_t *""'"); - } - arg5 = (blpapi_EventQueue_t *)(argp5); - res6 = SWIG_AsCharPtrAndSize(swig_obj[5], &buf6, &size6, &alloc6); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "blpapi_AbstractSession_sendAuthorizationRequest" "', argument " "6"" of type '" "char const *""'"); - } - arg6 = (char *)(buf6); - arg7 = (int)(size6 - 1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AbstractSession_sendAuthorizationRequest(arg1,(struct blpapi_Request const *)arg2,arg3,arg4,arg5,(char const *)arg6,arg7); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc6 == SWIG_NEWOBJ) free((char*)buf6); - return resultobj; -fail: - if (alloc6 == SWIG_NEWOBJ) free((char*)buf6); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_openService(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_AbstractSession_openService", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_openService" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); - } - arg1 = (blpapi_AbstractSession_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_openService" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AbstractSession_openService(arg1,(char const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_openServiceAsync(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_AbstractSession_openServiceAsync", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_openServiceAsync" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); - } - arg1 = (blpapi_AbstractSession_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_openServiceAsync" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AbstractSession_openServiceAsync" "', argument " "3"" of type '" "blpapi_CorrelationId_t *""'"); - } - arg3 = (blpapi_CorrelationId_t *)(argp3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AbstractSession_openServiceAsync(arg1,(char const *)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_generateToken(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; - blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; - blpapi_EventQueue_t *arg3 = (blpapi_EventQueue_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_AbstractSession_generateToken", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_generateToken" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); - } - arg1 = (blpapi_AbstractSession_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_generateToken" "', argument " "2"" of type '" "blpapi_CorrelationId_t *""'"); - } - arg2 = (blpapi_CorrelationId_t *)(argp2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AbstractSession_generateToken" "', argument " "3"" of type '" "blpapi_EventQueue_t *""'"); - } - arg3 = (blpapi_EventQueue_t *)(argp3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AbstractSession_generateToken(arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_generateManualToken(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; - blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; - char *arg3 = (char *) 0 ; - char *arg4 = (char *) 0 ; - blpapi_EventQueue_t *arg5 = (blpapi_EventQueue_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; - int res4 ; - char *buf4 = 0 ; - int alloc4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject *swig_obj[5] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_AbstractSession_generateManualToken", 5, 5, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_generateManualToken" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); - } - arg1 = (blpapi_AbstractSession_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_generateManualToken" "', argument " "2"" of type '" "blpapi_CorrelationId_t *""'"); - } - arg2 = (blpapi_CorrelationId_t *)(argp2); - res3 = SWIG_AsCharPtrAndSize(swig_obj[2], &buf3, NULL, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AbstractSession_generateManualToken" "', argument " "3"" of type '" "char const *""'"); - } - arg3 = (char *)(buf3); - res4 = SWIG_AsCharPtrAndSize(swig_obj[3], &buf4, NULL, &alloc4); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_AbstractSession_generateManualToken" "', argument " "4"" of type '" "char const *""'"); - } - arg4 = (char *)(buf4); - res5 = SWIG_ConvertPtr(swig_obj[4], &argp5,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "blpapi_AbstractSession_generateManualToken" "', argument " "5"" of type '" "blpapi_EventQueue_t *""'"); - } - arg5 = (blpapi_EventQueue_t *)(argp5); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AbstractSession_generateManualToken(arg1,arg2,(char const *)arg3,(char const *)arg4,arg5); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); - if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); - return resultobj; -fail: - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); - if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_getService(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; - blpapi_Service_t **arg2 = (blpapi_Service_t **) 0 ; - char *arg3 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Service_t *temp2 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_AbstractSession_getService", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_getService" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); - } - arg1 = (blpapi_AbstractSession_t *)(argp1); - res3 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf3, NULL, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AbstractSession_getService" "', argument " "3"" of type '" "char const *""'"); - } - arg3 = (char *)(buf3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AbstractSession_getService(arg1,arg2,(char const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Service, 0)); - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); - return resultobj; -fail: - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_createIdentity(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - blpapi_Identity_t *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_createIdentity" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); - } - arg1 = (blpapi_AbstractSession_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Identity_t *)blpapi_AbstractSession_createIdentity(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Identity, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_generateAuthorizedIdentityAsync(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; - blpapi_AuthOptions_t *arg2 = (blpapi_AuthOptions_t *) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_AbstractSession_generateAuthorizedIdentityAsync", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_generateAuthorizedIdentityAsync" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); - } - arg1 = (blpapi_AbstractSession_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_AuthOptions, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_generateAuthorizedIdentityAsync" "', argument " "2"" of type '" "blpapi_AuthOptions_t const *""'"); - } - arg2 = (blpapi_AuthOptions_t *)(argp2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_AbstractSession_generateAuthorizedIdentityAsync" "', argument " "3"" of type '" "blpapi_CorrelationId_t *""'"); - } - arg3 = (blpapi_CorrelationId_t *)(argp3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AbstractSession_generateAuthorizedIdentityAsync(arg1,(struct blpapi_AuthOptions const *)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_getAuthorizedIdentity(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; - blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; - blpapi_Identity_t **arg3 = (blpapi_Identity_t **) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - blpapi_Identity_t *temp3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg3 = &temp3; - if (!SWIG_Python_UnpackTuple(args, "blpapi_AbstractSession_getAuthorizedIdentity", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_getAuthorizedIdentity" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); - } - arg1 = (blpapi_AbstractSession_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_AbstractSession_getAuthorizedIdentity" "', argument " "2"" of type '" "blpapi_CorrelationId_t const *""'"); - } - arg2 = (blpapi_CorrelationId_t *)(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AbstractSession_getAuthorizedIdentity(arg1,(struct blpapi_CorrelationId_t_ const *)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg3), SWIGTYPE_p_blpapi_Identity, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_sessionName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_AbstractSession_t *arg1 = (blpapi_AbstractSession_t *) 0 ; - char **arg2 = (char **) 0 ; - size_t *arg3 = (size_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - char *temp2 = 0 ; - size_t temp3 ; - PyObject *swig_obj[1] ; - int result; - - arg2 = &temp2; - arg3 = &temp3; - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_AbstractSession_sessionName" "', argument " "1"" of type '" "blpapi_AbstractSession_t *""'"); - } - arg1 = (blpapi_AbstractSession_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_AbstractSession_sessionName(arg1,(char const **)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtrAndSize(*arg2, *arg3)); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Session_start(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_start" "', argument " "1"" of type '" "blpapi_Session_t *""'"); - } - arg1 = (blpapi_Session_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_start(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Session_startAsync(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_startAsync" "', argument " "1"" of type '" "blpapi_Session_t *""'"); - } - arg1 = (blpapi_Session_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_startAsync(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Session_stop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_stop" "', argument " "1"" of type '" "blpapi_Session_t *""'"); - } - arg1 = (blpapi_Session_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_stop(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Session_stopAsync(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_stopAsync" "', argument " "1"" of type '" "blpapi_Session_t *""'"); - } - arg1 = (blpapi_Session_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_stopAsync(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Session_nextEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - blpapi_Event_t **arg2 = (blpapi_Event_t **) 0 ; - unsigned int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Event_t *temp2 = 0 ; - unsigned int val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_Session_nextEvent", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_nextEvent" "', argument " "1"" of type '" "blpapi_Session_t *""'"); - } - arg1 = (blpapi_Session_t *)(argp1); - ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Session_nextEvent" "', argument " "3"" of type '" "unsigned int""'"); - } - arg3 = (unsigned int)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_nextEvent(arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Event, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Session_tryNextEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - blpapi_Event_t **arg2 = (blpapi_Event_t **) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Event_t *temp2 = 0 ; - PyObject *swig_obj[1] ; - int result; - - arg2 = &temp2; - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_tryNextEvent" "', argument " "1"" of type '" "blpapi_Session_t *""'"); - } - arg1 = (blpapi_Session_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_tryNextEvent(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Event, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Session_subscribe(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - blpapi_SubscriptionList_t *arg2 = (blpapi_SubscriptionList_t *) 0 ; - blpapi_Identity_t *arg3 = (blpapi_Identity_t *) 0 ; - char *arg4 = (char *) 0 ; - int arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - int res4 ; - char *buf4 = 0 ; - size_t size4 = 0 ; - int alloc4 = 0 ; - PyObject *swig_obj[4] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Session_subscribe", 4, 4, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_subscribe" "', argument " "1"" of type '" "blpapi_Session_t *""'"); - } - arg1 = (blpapi_Session_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_subscribe" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); - } - arg2 = (blpapi_SubscriptionList_t *)(argp2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_subscribe" "', argument " "3"" of type '" "blpapi_Identity_t const *""'"); - } - arg3 = (blpapi_Identity_t *)(argp3); - res4 = SWIG_AsCharPtrAndSize(swig_obj[3], &buf4, &size4, &alloc4); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Session_subscribe" "', argument " "4"" of type '" "char const *""'"); - } - arg4 = (char *)(buf4); - arg5 = (int)(size4 - 1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_subscribe(arg1,(struct blpapi_SubscriptionList const *)arg2,(struct blpapi_Identity const *)arg3,(char const *)arg4,arg5); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); - return resultobj; -fail: - if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Session_subscribeEx(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - blpapi_SubscriptionList_t *arg2 = (blpapi_SubscriptionList_t *) 0 ; - blpapi_Identity_t *arg3 = (blpapi_Identity_t *) 0 ; - char *arg4 = (char *) 0 ; - int arg5 ; - blpapi_SubscriptionPreprocessErrorHandler_t arg6 = (blpapi_SubscriptionPreprocessErrorHandler_t) 0 ; - void *arg7 = (void *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - int res4 ; - char *buf4 = 0 ; - size_t size4 = 0 ; - int alloc4 = 0 ; - int res7 ; - PyObject *swig_obj[6] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Session_subscribeEx", 6, 6, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_subscribeEx" "', argument " "1"" of type '" "blpapi_Session_t *""'"); - } - arg1 = (blpapi_Session_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_subscribeEx" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); - } - arg2 = (blpapi_SubscriptionList_t *)(argp2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_subscribeEx" "', argument " "3"" of type '" "blpapi_Identity_t const *""'"); - } - arg3 = (blpapi_Identity_t *)(argp3); - res4 = SWIG_AsCharPtrAndSize(swig_obj[3], &buf4, &size4, &alloc4); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Session_subscribeEx" "', argument " "4"" of type '" "char const *""'"); - } - arg4 = (char *)(buf4); - arg5 = (int)(size4 - 1); - { - int res = SWIG_ConvertFunctionPtr(swig_obj[4], (void**)(&arg6), SWIGTYPE_p_f_p_q_const__struct_blpapi_CorrelationId_t__p_q_const__char_int_p_q_const__char_p_void__void); - if (!SWIG_IsOK(res)) { - SWIG_exception_fail(SWIG_ArgError(res), "in method '" "blpapi_Session_subscribeEx" "', argument " "6"" of type '" "blpapi_SubscriptionPreprocessErrorHandler_t""'"); - } - } - res7 = SWIG_ConvertPtr(swig_obj[5],SWIG_as_voidptrptr(&arg7), 0, 0); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "blpapi_Session_subscribeEx" "', argument " "7"" of type '" "void *""'"); - } - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_subscribeEx(arg1,(struct blpapi_SubscriptionList const *)arg2,(struct blpapi_Identity const *)arg3,(char const *)arg4,arg5,arg6,arg7); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); - return resultobj; -fail: - if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Session_resubscribe(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - blpapi_SubscriptionList_t *arg2 = (blpapi_SubscriptionList_t *) 0 ; - char *arg3 = (char *) 0 ; - int arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int res3 ; - char *buf3 = 0 ; - size_t size3 = 0 ; - int alloc3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Session_resubscribe", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_resubscribe" "', argument " "1"" of type '" "blpapi_Session_t *""'"); - } - arg1 = (blpapi_Session_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_resubscribe" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); - } - arg2 = (blpapi_SubscriptionList_t *)(argp2); - res3 = SWIG_AsCharPtrAndSize(swig_obj[2], &buf3, &size3, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_resubscribe" "', argument " "3"" of type '" "char const *""'"); - } - arg3 = (char *)(buf3); - arg4 = (int)(size3 - 1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_resubscribe(arg1,(struct blpapi_SubscriptionList const *)arg2,(char const *)arg3,arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); - return resultobj; -fail: - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Session_resubscribeEx(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - blpapi_SubscriptionList_t *arg2 = (blpapi_SubscriptionList_t *) 0 ; - char *arg3 = (char *) 0 ; - int arg4 ; - blpapi_SubscriptionPreprocessErrorHandler_t arg5 = (blpapi_SubscriptionPreprocessErrorHandler_t) 0 ; - void *arg6 = (void *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int res3 ; - char *buf3 = 0 ; - size_t size3 = 0 ; - int alloc3 = 0 ; - int res6 ; - PyObject *swig_obj[5] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Session_resubscribeEx", 5, 5, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_resubscribeEx" "', argument " "1"" of type '" "blpapi_Session_t *""'"); - } - arg1 = (blpapi_Session_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_resubscribeEx" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); - } - arg2 = (blpapi_SubscriptionList_t *)(argp2); - res3 = SWIG_AsCharPtrAndSize(swig_obj[2], &buf3, &size3, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_resubscribeEx" "', argument " "3"" of type '" "char const *""'"); - } - arg3 = (char *)(buf3); - arg4 = (int)(size3 - 1); - { - int res = SWIG_ConvertFunctionPtr(swig_obj[3], (void**)(&arg5), SWIGTYPE_p_f_p_q_const__struct_blpapi_CorrelationId_t__p_q_const__char_int_p_q_const__char_p_void__void); - if (!SWIG_IsOK(res)) { - SWIG_exception_fail(SWIG_ArgError(res), "in method '" "blpapi_Session_resubscribeEx" "', argument " "5"" of type '" "blpapi_SubscriptionPreprocessErrorHandler_t""'"); - } - } - res6 = SWIG_ConvertPtr(swig_obj[4],SWIG_as_voidptrptr(&arg6), 0, 0); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "blpapi_Session_resubscribeEx" "', argument " "6"" of type '" "void *""'"); - } - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_resubscribeEx(arg1,(struct blpapi_SubscriptionList const *)arg2,(char const *)arg3,arg4,arg5,arg6); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); - return resultobj; -fail: - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Session_resubscribeWithId(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - blpapi_SubscriptionList_t *arg2 = (blpapi_SubscriptionList_t *) 0 ; - int arg3 ; - char *arg4 = (char *) 0 ; - int arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - int res4 ; - char *buf4 = 0 ; - size_t size4 = 0 ; - int alloc4 = 0 ; - PyObject *swig_obj[4] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Session_resubscribeWithId", 4, 4, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_resubscribeWithId" "', argument " "1"" of type '" "blpapi_Session_t *""'"); - } - arg1 = (blpapi_Session_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_resubscribeWithId" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); - } - arg2 = (blpapi_SubscriptionList_t *)(argp2); - ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Session_resubscribeWithId" "', argument " "3"" of type '" "int""'"); - } - arg3 = (int)(val3); - res4 = SWIG_AsCharPtrAndSize(swig_obj[3], &buf4, &size4, &alloc4); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Session_resubscribeWithId" "', argument " "4"" of type '" "char const *""'"); - } - arg4 = (char *)(buf4); - arg5 = (int)(size4 - 1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_resubscribeWithId(arg1,(struct blpapi_SubscriptionList const *)arg2,arg3,(char const *)arg4,arg5); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); - return resultobj; -fail: - if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Session_resubscribeWithIdEx(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - blpapi_SubscriptionList_t *arg2 = (blpapi_SubscriptionList_t *) 0 ; - int arg3 ; - char *arg4 = (char *) 0 ; - int arg5 ; - blpapi_SubscriptionPreprocessErrorHandler_t arg6 = (blpapi_SubscriptionPreprocessErrorHandler_t) 0 ; - void *arg7 = (void *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - int res4 ; - char *buf4 = 0 ; - size_t size4 = 0 ; - int alloc4 = 0 ; - int res7 ; - PyObject *swig_obj[6] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Session_resubscribeWithIdEx", 6, 6, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_resubscribeWithIdEx" "', argument " "1"" of type '" "blpapi_Session_t *""'"); - } - arg1 = (blpapi_Session_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_resubscribeWithIdEx" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); - } - arg2 = (blpapi_SubscriptionList_t *)(argp2); - ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_Session_resubscribeWithIdEx" "', argument " "3"" of type '" "int""'"); - } - arg3 = (int)(val3); - res4 = SWIG_AsCharPtrAndSize(swig_obj[3], &buf4, &size4, &alloc4); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Session_resubscribeWithIdEx" "', argument " "4"" of type '" "char const *""'"); - } - arg4 = (char *)(buf4); - arg5 = (int)(size4 - 1); - { - int res = SWIG_ConvertFunctionPtr(swig_obj[4], (void**)(&arg6), SWIGTYPE_p_f_p_q_const__struct_blpapi_CorrelationId_t__p_q_const__char_int_p_q_const__char_p_void__void); - if (!SWIG_IsOK(res)) { - SWIG_exception_fail(SWIG_ArgError(res), "in method '" "blpapi_Session_resubscribeWithIdEx" "', argument " "6"" of type '" "blpapi_SubscriptionPreprocessErrorHandler_t""'"); - } - } - res7 = SWIG_ConvertPtr(swig_obj[5],SWIG_as_voidptrptr(&arg7), 0, 0); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "blpapi_Session_resubscribeWithIdEx" "', argument " "7"" of type '" "void *""'"); - } - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_resubscribeWithIdEx(arg1,(struct blpapi_SubscriptionList const *)arg2,arg3,(char const *)arg4,arg5,arg6,arg7); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); - return resultobj; -fail: - if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Session_unsubscribe(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - blpapi_SubscriptionList_t *arg2 = (blpapi_SubscriptionList_t *) 0 ; - char *arg3 = (char *) 0 ; - int arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int res3 ; - char *buf3 = 0 ; - size_t size3 = 0 ; - int alloc3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Session_unsubscribe", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_unsubscribe" "', argument " "1"" of type '" "blpapi_Session_t *""'"); - } - arg1 = (blpapi_Session_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_SubscriptionList, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_unsubscribe" "', argument " "2"" of type '" "blpapi_SubscriptionList_t const *""'"); - } - arg2 = (blpapi_SubscriptionList_t *)(argp2); - res3 = SWIG_AsCharPtrAndSize(swig_obj[2], &buf3, &size3, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_unsubscribe" "', argument " "3"" of type '" "char const *""'"); - } - arg3 = (char *)(buf3); - arg4 = (int)(size3 - 1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_unsubscribe(arg1,(struct blpapi_SubscriptionList const *)arg2,(char const *)arg3,arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); - return resultobj; -fail: - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Session_setStatusCorrelationId(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - blpapi_Service_t *arg2 = (blpapi_Service_t *) 0 ; - blpapi_Identity_t *arg3 = (blpapi_Identity_t *) 0 ; - blpapi_CorrelationId_t *arg4 = (blpapi_CorrelationId_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject *swig_obj[4] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Session_setStatusCorrelationId", 4, 4, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_setStatusCorrelationId" "', argument " "1"" of type '" "blpapi_Session_t *""'"); - } - arg1 = (blpapi_Session_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_setStatusCorrelationId" "', argument " "2"" of type '" "blpapi_Service_t const *""'"); - } - arg2 = (blpapi_Service_t *)(argp2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_setStatusCorrelationId" "', argument " "3"" of type '" "blpapi_Identity_t const *""'"); - } - arg3 = (blpapi_Identity_t *)(argp3); - res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Session_setStatusCorrelationId" "', argument " "4"" of type '" "blpapi_CorrelationId_t const *""'"); - } - arg4 = (blpapi_CorrelationId_t *)(argp4); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_setStatusCorrelationId(arg1,(struct blpapi_Service const *)arg2,(struct blpapi_Identity const *)arg3,(struct blpapi_CorrelationId_t_ const *)arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Session_sendRequest(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - blpapi_Request_t *arg2 = (blpapi_Request_t *) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; - blpapi_Identity_t *arg4 = (blpapi_Identity_t *) 0 ; - blpapi_EventQueue_t *arg5 = (blpapi_EventQueue_t *) 0 ; - char *arg6 = (char *) 0 ; - int arg7 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - int res6 ; - char *buf6 = 0 ; - size_t size6 = 0 ; - int alloc6 = 0 ; - PyObject *swig_obj[6] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Session_sendRequest", 6, 6, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_sendRequest" "', argument " "1"" of type '" "blpapi_Session_t *""'"); - } - arg1 = (blpapi_Session_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Request, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_sendRequest" "', argument " "2"" of type '" "blpapi_Request_t const *""'"); - } - arg2 = (blpapi_Request_t *)(argp2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_sendRequest" "', argument " "3"" of type '" "blpapi_CorrelationId_t *""'"); - } - arg3 = (blpapi_CorrelationId_t *)(argp3); - res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Session_sendRequest" "', argument " "4"" of type '" "blpapi_Identity_t *""'"); - } - arg4 = (blpapi_Identity_t *)(argp4); - res5 = SWIG_ConvertPtr(swig_obj[4], &argp5,SWIGTYPE_p_blpapi_EventQueue, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "blpapi_Session_sendRequest" "', argument " "5"" of type '" "blpapi_EventQueue_t *""'"); - } - arg5 = (blpapi_EventQueue_t *)(argp5); - res6 = SWIG_AsCharPtrAndSize(swig_obj[5], &buf6, &size6, &alloc6); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "blpapi_Session_sendRequest" "', argument " "6"" of type '" "char const *""'"); - } - arg6 = (char *)(buf6); - arg7 = (int)(size6 - 1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_sendRequest(arg1,(struct blpapi_Request const *)arg2,arg3,arg4,arg5,(char const *)arg6,arg7); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc6 == SWIG_NEWOBJ) free((char*)buf6); - return resultobj; -fail: - if (alloc6 == SWIG_NEWOBJ) free((char*)buf6); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Session_sendRequestTemplate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - blpapi_RequestTemplate_t *arg2 = (blpapi_RequestTemplate_t *) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Session_sendRequestTemplate", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_sendRequestTemplate" "', argument " "1"" of type '" "blpapi_Session_t *""'"); - } - arg1 = (blpapi_Session_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_RequestTemplate, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_sendRequestTemplate" "', argument " "2"" of type '" "blpapi_RequestTemplate_t const *""'"); - } - arg2 = (blpapi_RequestTemplate_t *)(argp2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_sendRequestTemplate" "', argument " "3"" of type '" "blpapi_CorrelationId_t *""'"); - } - arg3 = (blpapi_CorrelationId_t *)(argp3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_sendRequestTemplate(arg1,(struct blpapi_RequestTemplate const *)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Session_createSnapshotRequestTemplate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_RequestTemplate_t **arg1 = (blpapi_RequestTemplate_t **) 0 ; - blpapi_Session_t *arg2 = (blpapi_Session_t *) 0 ; - char *arg3 = (char *) 0 ; - blpapi_Identity_t *arg4 = (blpapi_Identity_t *) 0 ; - blpapi_CorrelationId_t *arg5 = (blpapi_CorrelationId_t *) 0 ; - blpapi_RequestTemplate_t *temp1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject *swig_obj[4] ; - int result; - - arg1 = &temp1; - if (!SWIG_Python_UnpackTuple(args, "blpapi_Session_createSnapshotRequestTemplate", 4, 4, swig_obj)) SWIG_fail; - res2 = SWIG_ConvertPtr(swig_obj[0], &argp2,SWIGTYPE_p_blpapi_Session, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Session_createSnapshotRequestTemplate" "', argument " "2"" of type '" "blpapi_Session_t *""'"); - } - arg2 = (blpapi_Session_t *)(argp2); - res3 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf3, NULL, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_Session_createSnapshotRequestTemplate" "', argument " "3"" of type '" "char const *""'"); - } - arg3 = (char *)(buf3); - res4 = SWIG_ConvertPtr(swig_obj[2], &argp4,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_Session_createSnapshotRequestTemplate" "', argument " "4"" of type '" "blpapi_Identity_t const *""'"); - } - arg4 = (blpapi_Identity_t *)(argp4); - res5 = SWIG_ConvertPtr(swig_obj[3], &argp5,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "blpapi_Session_createSnapshotRequestTemplate" "', argument " "5"" of type '" "blpapi_CorrelationId_t *""'"); - } - arg5 = (blpapi_CorrelationId_t *)(argp5); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Session_createSnapshotRequestTemplate(arg1,arg2,(char const *)arg3,(struct blpapi_Identity const *)arg4,arg5); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_RequestTemplate, 0)); - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); - return resultobj; -fail: - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Session_getAbstractSession(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Session_t *arg1 = (blpapi_Session_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - blpapi_AbstractSession_t *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Session, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Session_getAbstractSession" "', argument " "1"" of type '" "blpapi_Session_t *""'"); - } - arg1 = (blpapi_Session_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_AbstractSession_t *)blpapi_Session_getAbstractSession(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_extractAttributeFromResolutionSuccess(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Message_t *arg1 = (blpapi_Message_t *) 0 ; - blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[2] ; - blpapi_Element_t *result = 0 ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_ResolutionList_extractAttributeFromResolutionSuccess", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Message, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_extractAttributeFromResolutionSuccess" "', argument " "1"" of type '" "blpapi_Message_t const *""'"); - } - arg1 = (blpapi_Message_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ResolutionList_extractAttributeFromResolutionSuccess" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); - } - arg2 = (blpapi_Name_t *)(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Element_t *)blpapi_ResolutionList_extractAttributeFromResolutionSuccess((struct blpapi_Message const *)arg1,(struct blpapi_Name const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Element, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - blpapi_ResolutionList_t *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_create" "', argument " "1"" of type '" "blpapi_ResolutionList_t *""'"); - } - arg1 = (blpapi_ResolutionList_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_ResolutionList_t *)blpapi_ResolutionList_create(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_destroy" "', argument " "1"" of type '" "blpapi_ResolutionList_t *""'"); - } - arg1 = (blpapi_ResolutionList_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_ResolutionList_destroy(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_ResolutionList_add", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_add" "', argument " "1"" of type '" "blpapi_ResolutionList_t *""'"); - } - arg1 = (blpapi_ResolutionList_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ResolutionList_add" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ResolutionList_add" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); - } - arg3 = (blpapi_CorrelationId_t *)(argp3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ResolutionList_add(arg1,(char const *)arg2,(struct blpapi_CorrelationId_t_ const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_addFromMessage(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - blpapi_Message_t *arg2 = (blpapi_Message_t *) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_ResolutionList_addFromMessage", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_addFromMessage" "', argument " "1"" of type '" "blpapi_ResolutionList_t *""'"); - } - arg1 = (blpapi_ResolutionList_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Message, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ResolutionList_addFromMessage" "', argument " "2"" of type '" "blpapi_Message_t const *""'"); - } - arg2 = (blpapi_Message_t *)(argp2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ResolutionList_addFromMessage" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); - } - arg3 = (blpapi_CorrelationId_t *)(argp3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ResolutionList_addFromMessage(arg1,(struct blpapi_Message const *)arg2,(struct blpapi_CorrelationId_t_ const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_addAttribute(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_ResolutionList_addAttribute", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_addAttribute" "', argument " "1"" of type '" "blpapi_ResolutionList_t *""'"); - } - arg1 = (blpapi_ResolutionList_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ResolutionList_addAttribute" "', argument " "2"" of type '" "blpapi_Name_t const *""'"); - } - arg2 = (blpapi_Name_t *)(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ResolutionList_addAttribute(arg1,(struct blpapi_Name const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_correlationIdAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_CorrelationId_t temp2 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_ResolutionList_correlationIdAt", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_correlationIdAt" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); - } - arg1 = (blpapi_ResolutionList_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ResolutionList_correlationIdAt" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ResolutionList_correlationIdAt((struct blpapi_ResolutionList const *)arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (!result) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(CorrelationId_t_clone(arg2), SWIGTYPE_p_blpapi_CorrelationId_t_, SWIG_POINTER_OWN)); - } else { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_Py_Void()); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_topicString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - char **arg2 = (char **) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - char *temp2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_ResolutionList_topicString", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_topicString" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); - } - arg1 = (blpapi_ResolutionList_t *)(argp1); - res3 = SWIG_ConvertPtr(swig_obj[1], &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ResolutionList_topicString" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); - } - arg3 = (blpapi_CorrelationId_t *)(argp3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ResolutionList_topicString((struct blpapi_ResolutionList const *)arg1,(char const **)arg2,(struct blpapi_CorrelationId_t_ const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_topicStringAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - char **arg2 = (char **) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - char *temp2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_ResolutionList_topicStringAt", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_topicStringAt" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); - } - arg1 = (blpapi_ResolutionList_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ResolutionList_topicStringAt" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ResolutionList_topicStringAt((struct blpapi_ResolutionList const *)arg1,(char const **)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_status(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - int *arg2 = (int *) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int temp2 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_ResolutionList_status", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_status" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); - } - arg1 = (blpapi_ResolutionList_t *)(argp1); - res3 = SWIG_ConvertPtr(swig_obj[1], &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ResolutionList_status" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); - } - arg3 = (blpapi_CorrelationId_t *)(argp3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ResolutionList_status((struct blpapi_ResolutionList const *)arg1,arg2,(struct blpapi_CorrelationId_t_ const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, PyInt_FromLong(*arg2)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_statusAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - int *arg2 = (int *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int temp2 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_ResolutionList_statusAt", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_statusAt" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); - } - arg1 = (blpapi_ResolutionList_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ResolutionList_statusAt" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ResolutionList_statusAt((struct blpapi_ResolutionList const *)arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, PyInt_FromLong(*arg2)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_attribute(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - blpapi_Element_t **arg2 = (blpapi_Element_t **) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - blpapi_CorrelationId_t *arg4 = (blpapi_CorrelationId_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Element_t *temp2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject *swig_obj[3] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_ResolutionList_attribute", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_attribute" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); - } - arg1 = (blpapi_ResolutionList_t *)(argp1); - res3 = SWIG_ConvertPtr(swig_obj[1], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ResolutionList_attribute" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = (blpapi_Name_t *)(argp3); - res4 = SWIG_ConvertPtr(swig_obj[2], &argp4,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_ResolutionList_attribute" "', argument " "4"" of type '" "blpapi_CorrelationId_t const *""'"); - } - arg4 = (blpapi_CorrelationId_t *)(argp4); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ResolutionList_attribute((struct blpapi_ResolutionList const *)arg1,arg2,(struct blpapi_Name const *)arg3,(struct blpapi_CorrelationId_t_ const *)arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Element, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_attributeAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - blpapi_Element_t **arg2 = (blpapi_Element_t **) 0 ; - blpapi_Name_t *arg3 = (blpapi_Name_t *) 0 ; - size_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Element_t *temp2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - PyObject *swig_obj[3] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_ResolutionList_attributeAt", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_attributeAt" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); - } - arg1 = (blpapi_ResolutionList_t *)(argp1); - res3 = SWIG_ConvertPtr(swig_obj[1], &argp3,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ResolutionList_attributeAt" "', argument " "3"" of type '" "blpapi_Name_t const *""'"); - } - arg3 = (blpapi_Name_t *)(argp3); - ecode4 = SWIG_AsVal_size_t(swig_obj[2], &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_ResolutionList_attributeAt" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = (size_t)(val4); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ResolutionList_attributeAt((struct blpapi_ResolutionList const *)arg1,arg2,(struct blpapi_Name const *)arg3,arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Element, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_message(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - blpapi_Message_t **arg2 = (blpapi_Message_t **) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Message_t *temp2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_ResolutionList_message", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_message" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); - } - arg1 = (blpapi_ResolutionList_t *)(argp1); - res3 = SWIG_ConvertPtr(swig_obj[1], &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ResolutionList_message" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); - } - arg3 = (blpapi_CorrelationId_t *)(argp3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ResolutionList_message((struct blpapi_ResolutionList const *)arg1,arg2,(struct blpapi_CorrelationId_t_ const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Message, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_messageAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - blpapi_Message_t **arg2 = (blpapi_Message_t **) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Message_t *temp2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_ResolutionList_messageAt", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_messageAt" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); - } - arg1 = (blpapi_ResolutionList_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ResolutionList_messageAt" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ResolutionList_messageAt((struct blpapi_ResolutionList const *)arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Message, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ResolutionList_t *arg1 = (blpapi_ResolutionList_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ResolutionList_size" "', argument " "1"" of type '" "blpapi_ResolutionList_t const *""'"); - } - arg1 = (blpapi_ResolutionList_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ResolutionList_size((struct blpapi_ResolutionList const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TestUtil_createEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Event_t **arg1 = (blpapi_Event_t **) 0 ; - int arg2 ; - blpapi_Event_t *temp1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[1] ; - int result; - - arg1 = &temp1; - if (!args) SWIG_fail; - swig_obj[0] = args; - ecode2 = SWIG_AsVal_int(swig_obj[0], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_TestUtil_createEvent" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_TestUtil_createEvent(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_Event, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TestUtil_deserializeService(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - size_t arg2 ; - blpapi_Service_t **arg3 = (blpapi_Service_t **) 0 ; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - blpapi_Service_t *temp3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg3 = &temp3; - if (!SWIG_Python_UnpackTuple(args, "blpapi_TestUtil_deserializeService", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TestUtil_deserializeService" "', argument " "1"" of type '" "char const *""'"); - } - arg1 = (char *)(buf1); - ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_TestUtil_deserializeService" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = (size_t)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_TestUtil_deserializeService((char const *)arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg3), SWIGTYPE_p_blpapi_Service, 0)); - if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); - return resultobj; -fail: - if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TestUtil_serializeService(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_StreamWriter_t arg1 ; - void *arg2 = (void *) 0 ; - blpapi_Service_t *arg3 = (blpapi_Service_t *) 0 ; - void *argp1 ; - int res1 = 0 ; - int res2 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_TestUtil_serializeService", 3, 3, swig_obj)) SWIG_fail; - { - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_blpapi_StreamWriter_t, 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TestUtil_serializeService" "', argument " "1"" of type '" "blpapi_StreamWriter_t""'"); - } - if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "blpapi_TestUtil_serializeService" "', argument " "1"" of type '" "blpapi_StreamWriter_t""'"); - } else { - arg1 = *((blpapi_StreamWriter_t *)(argp1)); - } - } - res2 = SWIG_ConvertPtr(swig_obj[1],SWIG_as_voidptrptr(&arg2), 0, 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_TestUtil_serializeService" "', argument " "2"" of type '" "void *""'"); - } - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_TestUtil_serializeService" "', argument " "3"" of type '" "blpapi_Service_t const *""'"); - } - arg3 = (blpapi_Service_t *)(argp3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_TestUtil_serializeService(arg1,arg2,(struct blpapi_Service const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TestUtil_appendMessage(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageFormatter_t **arg1 = (blpapi_MessageFormatter_t **) 0 ; - blpapi_Event_t *arg2 = (blpapi_Event_t *) 0 ; - blpapi_SchemaElementDefinition_t *arg3 = (blpapi_SchemaElementDefinition_t *) 0 ; - blpapi_MessageProperties_t *arg4 = (blpapi_MessageProperties_t *) 0 ; - blpapi_MessageFormatter_t *temp1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject *swig_obj[3] ; - int result; - - arg1 = &temp1; - if (!SWIG_Python_UnpackTuple(args, "blpapi_TestUtil_appendMessage", 3, 3, swig_obj)) SWIG_fail; - res2 = SWIG_ConvertPtr(swig_obj[0], &argp2,SWIGTYPE_p_blpapi_Event, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_TestUtil_appendMessage" "', argument " "2"" of type '" "blpapi_Event_t *""'"); - } - arg2 = (blpapi_Event_t *)(argp2); - res3 = SWIG_ConvertPtr(swig_obj[1], &argp3,SWIGTYPE_p_blpapi_SchemaElementDefinition, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_TestUtil_appendMessage" "', argument " "3"" of type '" "blpapi_SchemaElementDefinition_t const *""'"); - } - arg3 = (blpapi_SchemaElementDefinition_t *)(argp3); - res4 = SWIG_ConvertPtr(swig_obj[2], &argp4,SWIGTYPE_p_blpapi_MessageProperties, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_TestUtil_appendMessage" "', argument " "4"" of type '" "blpapi_MessageProperties_t const *""'"); - } - arg4 = (blpapi_MessageProperties_t *)(argp4); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_TestUtil_appendMessage(arg1,arg2,(struct blpapi_SchemaElementDefinition const *)arg3,(struct blpapi_MessageProperties const *)arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_MessageFormatter, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TestUtil_createTopic(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Topic_t **arg1 = (blpapi_Topic_t **) 0 ; - blpapi_Service_t *arg2 = (blpapi_Service_t *) 0 ; - int arg3 ; - blpapi_Topic_t *temp1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg1 = &temp1; - if (!SWIG_Python_UnpackTuple(args, "blpapi_TestUtil_createTopic", 2, 2, swig_obj)) SWIG_fail; - res2 = SWIG_ConvertPtr(swig_obj[0], &argp2,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_TestUtil_createTopic" "', argument " "2"" of type '" "blpapi_Service_t const *""'"); - } - arg2 = (blpapi_Service_t *)(argp2); - ecode3 = SWIG_AsVal_int(swig_obj[1], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_TestUtil_createTopic" "', argument " "3"" of type '" "int""'"); - } - arg3 = (int)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_TestUtil_createTopic(arg1,(struct blpapi_Service const *)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_Topic, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TestUtil_getAdminMessageDefinition(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SchemaElementDefinition_t **arg1 = (blpapi_SchemaElementDefinition_t **) 0 ; - blpapi_Name_t *arg2 = (blpapi_Name_t *) 0 ; - blpapi_SchemaElementDefinition_t *temp1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[1] ; - int result; - - arg1 = &temp1; - if (!args) SWIG_fail; - swig_obj[0] = args; - res2 = SWIG_ConvertPtr(swig_obj[0], &argp2,SWIGTYPE_p_blpapi_Name, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_TestUtil_getAdminMessageDefinition" "', argument " "2"" of type '" "blpapi_Name_t *""'"); - } - arg2 = (blpapi_Name_t *)(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_TestUtil_getAdminMessageDefinition(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_SchemaElementDefinition, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageProperties_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageProperties_t **arg1 = (blpapi_MessageProperties_t **) 0 ; - blpapi_MessageProperties_t *temp1 = 0 ; - int result; - - arg1 = &temp1; - if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageProperties_create", 0, 0, 0)) SWIG_fail; - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_MessageProperties_create(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_MessageProperties, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageProperties_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageProperties_t *arg1 = (blpapi_MessageProperties_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageProperties, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageProperties_destroy" "', argument " "1"" of type '" "blpapi_MessageProperties_t *""'"); - } - arg1 = (blpapi_MessageProperties_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_MessageProperties_destroy(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageProperties_copy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageProperties_t **arg1 = (blpapi_MessageProperties_t **) 0 ; - blpapi_MessageProperties_t *arg2 = (blpapi_MessageProperties_t *) 0 ; - blpapi_MessageProperties_t *temp1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[1] ; - int result; - - arg1 = &temp1; - if (!args) SWIG_fail; - swig_obj[0] = args; - res2 = SWIG_ConvertPtr(swig_obj[0], &argp2,SWIGTYPE_p_blpapi_MessageProperties, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageProperties_copy" "', argument " "2"" of type '" "blpapi_MessageProperties_t const *""'"); - } - arg2 = (blpapi_MessageProperties_t *)(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_MessageProperties_copy(arg1,(struct blpapi_MessageProperties const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg1), SWIGTYPE_p_blpapi_MessageProperties, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageProperties_assign(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageProperties_t *arg1 = (blpapi_MessageProperties_t *) 0 ; - blpapi_MessageProperties_t *arg2 = (blpapi_MessageProperties_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageProperties_assign", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageProperties, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageProperties_assign" "', argument " "1"" of type '" "blpapi_MessageProperties_t *""'"); - } - arg1 = (blpapi_MessageProperties_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_MessageProperties, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageProperties_assign" "', argument " "2"" of type '" "blpapi_MessageProperties_t const *""'"); - } - arg2 = (blpapi_MessageProperties_t *)(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_MessageProperties_assign(arg1,(struct blpapi_MessageProperties const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageProperties_setCorrelationIds(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageProperties_t *arg1 = (blpapi_MessageProperties_t *) 0 ; - blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageProperties_setCorrelationIds", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageProperties, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageProperties_setCorrelationIds" "', argument " "1"" of type '" "blpapi_MessageProperties_t *""'"); - } - arg1 = (blpapi_MessageProperties_t *)(argp1); - { - int sz = PyList_Size(swig_obj[1]); - int res = 0; - arg2 = 0; - arg3 = sz; - if(sz) { - /* Define loop index at the top because old VisualStudio compilers */ - /* don't like variable declarations inside for-statements. */ - int i = 0; - arg2 = (blpapi_CorrelationId_t*) malloc(sizeof(blpapi_CorrelationId_t) * sz); - /* We are ignoring possible errors for malloc return value. */ - /* There aren't any perfect solutions for failure to allocate here, */ - /* and SWIG also seems to ignore this in its own generated code. */ - for(; i < sz; ++i) { - PyObject * thing = PyList_GetItem(swig_obj[1], i); - void* argp; - res = SWIG_ConvertPtr(thing, &argp, SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res)) { - SWIG_exception_fail(SWIG_ArgError(res), "Expected a list of blpapi_CorrelationId_t const * as a 2nd argument"); - } - arg2[i] = *(blpapi_CorrelationId_t*)argp; - } - } - } - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_MessageProperties_setCorrelationIds(arg1,(struct blpapi_CorrelationId_t_ const *)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - { - if(arg2) free(arg2); - } - return resultobj; -fail: - { - if(arg2) free(arg2); - } - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageProperties_setRecapType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageProperties_t *arg1 = (blpapi_MessageProperties_t *) 0 ; - int arg2 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageProperties_setRecapType", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageProperties, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageProperties_setRecapType" "', argument " "1"" of type '" "blpapi_MessageProperties_t *""'"); - } - arg1 = (blpapi_MessageProperties_t *)(argp1); - ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_MessageProperties_setRecapType" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); - ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_MessageProperties_setRecapType" "', argument " "3"" of type '" "int""'"); - } - arg3 = (int)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_MessageProperties_setRecapType(arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageProperties_setTimeReceived(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageProperties_t *arg1 = (blpapi_MessageProperties_t *) 0 ; - blpapi_HighPrecisionDatetime_t *arg2 = (blpapi_HighPrecisionDatetime_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageProperties_setTimeReceived", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageProperties, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageProperties_setTimeReceived" "', argument " "1"" of type '" "blpapi_MessageProperties_t *""'"); - } - arg1 = (blpapi_MessageProperties_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_HighPrecisionDatetime_tag, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageProperties_setTimeReceived" "', argument " "2"" of type '" "blpapi_HighPrecisionDatetime_t const *""'"); - } - arg2 = (blpapi_HighPrecisionDatetime_t *)(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_MessageProperties_setTimeReceived(arg1,(struct blpapi_HighPrecisionDatetime_tag const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageProperties_setService(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageProperties_t *arg1 = (blpapi_MessageProperties_t *) 0 ; - blpapi_Service_t *arg2 = (blpapi_Service_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageProperties_setService", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageProperties, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageProperties_setService" "', argument " "1"" of type '" "blpapi_MessageProperties_t *""'"); - } - arg1 = (blpapi_MessageProperties_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageProperties_setService" "', argument " "2"" of type '" "blpapi_Service_t const *""'"); - } - arg2 = (blpapi_Service_t *)(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_MessageProperties_setService(arg1,(struct blpapi_Service const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_MessageProperties_setRequestId(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_MessageProperties_t *arg1 = (blpapi_MessageProperties_t *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_MessageProperties_setRequestId", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_MessageProperties, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_MessageProperties_setRequestId" "', argument " "1"" of type '" "blpapi_MessageProperties_t *""'"); - } - arg1 = (blpapi_MessageProperties_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_MessageProperties_setRequestId" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_MessageProperties_setRequestId(arg1,(char const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Topic_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Topic_t *arg1 = (blpapi_Topic_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - blpapi_Topic_t *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Topic_create" "', argument " "1"" of type '" "blpapi_Topic_t *""'"); - } - arg1 = (blpapi_Topic_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Topic_t *)blpapi_Topic_create(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Topic, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Topic_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Topic_t *arg1 = (blpapi_Topic_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Topic_destroy" "', argument " "1"" of type '" "blpapi_Topic_t *""'"); - } - arg1 = (blpapi_Topic_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_Topic_destroy(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Topic_compare(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Topic_t *arg1 = (blpapi_Topic_t *) 0 ; - blpapi_Topic_t *arg2 = (blpapi_Topic_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_Topic_compare", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Topic_compare" "', argument " "1"" of type '" "blpapi_Topic_t const *""'"); - } - arg1 = (blpapi_Topic_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_Topic_compare" "', argument " "2"" of type '" "blpapi_Topic_t const *""'"); - } - arg2 = (blpapi_Topic_t *)(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Topic_compare((struct blpapi_Topic const *)arg1,(struct blpapi_Topic const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Topic_service(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Topic_t *arg1 = (blpapi_Topic_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - blpapi_Service_t *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Topic_service" "', argument " "1"" of type '" "blpapi_Topic_t const *""'"); - } - arg1 = (blpapi_Topic_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_Service_t *)blpapi_Topic_service((struct blpapi_Topic const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_Service, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_Topic_isActive(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_Topic_t *arg1 = (blpapi_Topic_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_Topic, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Topic_isActive" "', argument " "1"" of type '" "blpapi_Topic_t const *""'"); - } - arg1 = (blpapi_Topic_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_Topic_isActive((struct blpapi_Topic const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TopicList_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_TopicList_t *arg1 = (blpapi_TopicList_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - blpapi_TopicList_t *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_create" "', argument " "1"" of type '" "blpapi_TopicList_t *""'"); - } - arg1 = (blpapi_TopicList_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_TopicList_t *)blpapi_TopicList_create(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TopicList_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_TopicList_t *arg1 = (blpapi_TopicList_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_destroy" "', argument " "1"" of type '" "blpapi_TopicList_t *""'"); - } - arg1 = (blpapi_TopicList_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_TopicList_destroy(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TopicList_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_TopicList_t *arg1 = (blpapi_TopicList_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_TopicList_add", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_add" "', argument " "1"" of type '" "blpapi_TopicList_t *""'"); - } - arg1 = (blpapi_TopicList_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_TopicList_add" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_TopicList_add" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); - } - arg3 = (blpapi_CorrelationId_t *)(argp3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_TopicList_add(arg1,(char const *)arg2,(struct blpapi_CorrelationId_t_ const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TopicList_addFromMessage(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_TopicList_t *arg1 = (blpapi_TopicList_t *) 0 ; - blpapi_Message_t *arg2 = (blpapi_Message_t *) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_TopicList_addFromMessage", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_addFromMessage" "', argument " "1"" of type '" "blpapi_TopicList_t *""'"); - } - arg1 = (blpapi_TopicList_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Message, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_TopicList_addFromMessage" "', argument " "2"" of type '" "blpapi_Message_t const *""'"); - } - arg2 = (blpapi_Message_t *)(argp2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_TopicList_addFromMessage" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); - } - arg3 = (blpapi_CorrelationId_t *)(argp3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_TopicList_addFromMessage(arg1,(struct blpapi_Message const *)arg2,(struct blpapi_CorrelationId_t_ const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TopicList_correlationIdAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_TopicList_t *arg1 = (blpapi_TopicList_t *) 0 ; - blpapi_CorrelationId_t *arg2 = (blpapi_CorrelationId_t *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_CorrelationId_t temp2 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_TopicList_correlationIdAt", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_correlationIdAt" "', argument " "1"" of type '" "blpapi_TopicList_t const *""'"); - } - arg1 = (blpapi_TopicList_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_TopicList_correlationIdAt" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_TopicList_correlationIdAt((struct blpapi_TopicList const *)arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (!result) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(CorrelationId_t_clone(arg2), SWIGTYPE_p_blpapi_CorrelationId_t_, SWIG_POINTER_OWN)); - } else { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_Py_Void()); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TopicList_topicString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_TopicList_t *arg1 = (blpapi_TopicList_t *) 0 ; - char **arg2 = (char **) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - char *temp2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_TopicList_topicString", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_topicString" "', argument " "1"" of type '" "blpapi_TopicList_t const *""'"); - } - arg1 = (blpapi_TopicList_t *)(argp1); - res3 = SWIG_ConvertPtr(swig_obj[1], &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_TopicList_topicString" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); - } - arg3 = (blpapi_CorrelationId_t *)(argp3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_TopicList_topicString((struct blpapi_TopicList const *)arg1,(char const **)arg2,(struct blpapi_CorrelationId_t_ const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TopicList_topicStringAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_TopicList_t *arg1 = (blpapi_TopicList_t *) 0 ; - char **arg2 = (char **) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - char *temp2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_TopicList_topicStringAt", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_topicStringAt" "', argument " "1"" of type '" "blpapi_TopicList_t const *""'"); - } - arg1 = (blpapi_TopicList_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_TopicList_topicStringAt" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_TopicList_topicStringAt((struct blpapi_TopicList const *)arg1,(char const **)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TopicList_status(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_TopicList_t *arg1 = (blpapi_TopicList_t *) 0 ; - int *arg2 = (int *) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int temp2 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_TopicList_status", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_status" "', argument " "1"" of type '" "blpapi_TopicList_t const *""'"); - } - arg1 = (blpapi_TopicList_t *)(argp1); - res3 = SWIG_ConvertPtr(swig_obj[1], &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_TopicList_status" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); - } - arg3 = (blpapi_CorrelationId_t *)(argp3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_TopicList_status((struct blpapi_TopicList const *)arg1,arg2,(struct blpapi_CorrelationId_t_ const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, PyInt_FromLong(*arg2)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TopicList_statusAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_TopicList_t *arg1 = (blpapi_TopicList_t *) 0 ; - int *arg2 = (int *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int temp2 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_TopicList_statusAt", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_statusAt" "', argument " "1"" of type '" "blpapi_TopicList_t const *""'"); - } - arg1 = (blpapi_TopicList_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_TopicList_statusAt" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_TopicList_statusAt((struct blpapi_TopicList const *)arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, PyInt_FromLong(*arg2)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TopicList_message(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_TopicList_t *arg1 = (blpapi_TopicList_t *) 0 ; - blpapi_Message_t **arg2 = (blpapi_Message_t **) 0 ; - blpapi_CorrelationId_t *arg3 = (blpapi_CorrelationId_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Message_t *temp2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_TopicList_message", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_message" "', argument " "1"" of type '" "blpapi_TopicList_t const *""'"); - } - arg1 = (blpapi_TopicList_t *)(argp1); - res3 = SWIG_ConvertPtr(swig_obj[1], &argp3,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_TopicList_message" "', argument " "3"" of type '" "blpapi_CorrelationId_t const *""'"); - } - arg3 = (blpapi_CorrelationId_t *)(argp3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_TopicList_message((struct blpapi_TopicList const *)arg1,arg2,(struct blpapi_CorrelationId_t_ const *)arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Message, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TopicList_messageAt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_TopicList_t *arg1 = (blpapi_TopicList_t *) 0 ; - blpapi_Message_t **arg2 = (blpapi_Message_t **) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Message_t *temp2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_TopicList_messageAt", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_messageAt" "', argument " "1"" of type '" "blpapi_TopicList_t const *""'"); - } - arg1 = (blpapi_TopicList_t *)(argp1); - ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_TopicList_messageAt" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_TopicList_messageAt((struct blpapi_TopicList const *)arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Message, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_TopicList_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_TopicList_t *arg1 = (blpapi_TopicList_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_TopicList_size" "', argument " "1"" of type '" "blpapi_TopicList_t const *""'"); - } - arg1 = (blpapi_TopicList_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_TopicList_size((struct blpapi_TopicList const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - blpapi_ProviderEventHandler_t arg2 = (blpapi_ProviderEventHandler_t) 0 ; - blpapi_EventDispatcher_t *arg3 = (blpapi_EventDispatcher_t *) 0 ; - void *arg4 = (void *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - int res4 ; - PyObject *swig_obj[4] ; - blpapi_ProviderSession_t *result = 0 ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_ProviderSession_create", 4, 4, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_create" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - { - int res = SWIG_ConvertFunctionPtr(swig_obj[1], (void**)(&arg2), SWIGTYPE_p_f_p_struct_blpapi_Event_p_struct_blpapi_ProviderSession_p_void__void); - if (!SWIG_IsOK(res)) { - SWIG_exception_fail(SWIG_ArgError(res), "in method '" "blpapi_ProviderSession_create" "', argument " "2"" of type '" "blpapi_ProviderEventHandler_t""'"); - } - } - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_EventDispatcher, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ProviderSession_create" "', argument " "3"" of type '" "blpapi_EventDispatcher_t *""'"); - } - arg3 = (blpapi_EventDispatcher_t *)(argp3); - res4 = SWIG_ConvertPtr(swig_obj[3],SWIG_as_voidptrptr(&arg4), 0, 0); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_ProviderSession_create" "', argument " "4"" of type '" "void *""'"); - } - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_ProviderSession_t *)blpapi_ProviderSession_create(arg1,arg2,arg3,arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_destroy" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = (blpapi_ProviderSession_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_ProviderSession_destroy(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_start(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_start" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = (blpapi_ProviderSession_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_start(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_startAsync(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_startAsync" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = (blpapi_ProviderSession_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_startAsync(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_stop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_stop" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = (blpapi_ProviderSession_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_stop(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_stopAsync(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_stopAsync" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = (blpapi_ProviderSession_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_stopAsync(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_nextEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - blpapi_Event_t **arg2 = (blpapi_Event_t **) 0 ; - unsigned int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Event_t *temp2 = 0 ; - unsigned int val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_ProviderSession_nextEvent", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_nextEvent" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = (blpapi_ProviderSession_t *)(argp1); - ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_nextEvent" "', argument " "3"" of type '" "unsigned int""'"); - } - arg3 = (unsigned int)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_nextEvent(arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Event, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_tryNextEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - blpapi_Event_t **arg2 = (blpapi_Event_t **) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - blpapi_Event_t *temp2 = 0 ; - PyObject *swig_obj[1] ; - int result; - - arg2 = &temp2; - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_tryNextEvent" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = (blpapi_ProviderSession_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_tryNextEvent(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg2), SWIGTYPE_p_blpapi_Event, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_registerService(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Identity_t *arg3 = (blpapi_Identity_t *) 0 ; - blpapi_ServiceRegistrationOptions_t *arg4 = (blpapi_ServiceRegistrationOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject *swig_obj[4] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_ProviderSession_registerService", 4, 4, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_registerService" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = (blpapi_ProviderSession_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_registerService" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ProviderSession_registerService" "', argument " "3"" of type '" "blpapi_Identity_t const *""'"); - } - arg3 = (blpapi_Identity_t *)(argp3); - res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_ProviderSession_registerService" "', argument " "4"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); - } - arg4 = (blpapi_ServiceRegistrationOptions_t *)(argp4); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_registerService(arg1,(char const *)arg2,(struct blpapi_Identity const *)arg3,arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_activateSubServiceCodeRange(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - char *arg2 = (char *) 0 ; - int arg3 ; - int arg4 ; - int arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - int val3 ; - int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - int val5 ; - int ecode5 = 0 ; - PyObject *swig_obj[5] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_ProviderSession_activateSubServiceCodeRange", 5, 5, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_activateSubServiceCodeRange" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = (blpapi_ProviderSession_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_activateSubServiceCodeRange" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_activateSubServiceCodeRange" "', argument " "3"" of type '" "int""'"); - } - arg3 = (int)(val3); - ecode4 = SWIG_AsVal_int(swig_obj[3], &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_ProviderSession_activateSubServiceCodeRange" "', argument " "4"" of type '" "int""'"); - } - arg4 = (int)(val4); - ecode5 = SWIG_AsVal_int(swig_obj[4], &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "blpapi_ProviderSession_activateSubServiceCodeRange" "', argument " "5"" of type '" "int""'"); - } - arg5 = (int)(val5); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_activateSubServiceCodeRange(arg1,(char const *)arg2,arg3,arg4,arg5); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_deactivateSubServiceCodeRange(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - char *arg2 = (char *) 0 ; - int arg3 ; - int arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - int val3 ; - int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - PyObject *swig_obj[4] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_ProviderSession_deactivateSubServiceCodeRange", 4, 4, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_deactivateSubServiceCodeRange" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = (blpapi_ProviderSession_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_deactivateSubServiceCodeRange" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_deactivateSubServiceCodeRange" "', argument " "3"" of type '" "int""'"); - } - arg3 = (int)(val3); - ecode4 = SWIG_AsVal_int(swig_obj[3], &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_ProviderSession_deactivateSubServiceCodeRange" "', argument " "4"" of type '" "int""'"); - } - arg4 = (int)(val4); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_deactivateSubServiceCodeRange(arg1,(char const *)arg2,arg3,arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_registerServiceAsync(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - char *arg2 = (char *) 0 ; - blpapi_Identity_t *arg3 = (blpapi_Identity_t *) 0 ; - blpapi_CorrelationId_t *arg4 = (blpapi_CorrelationId_t *) 0 ; - blpapi_ServiceRegistrationOptions_t *arg5 = (blpapi_ServiceRegistrationOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject *swig_obj[5] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_ProviderSession_registerServiceAsync", 5, 5, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_registerServiceAsync" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = (blpapi_ProviderSession_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_registerServiceAsync" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "blpapi_ProviderSession_registerServiceAsync" "', argument " "3"" of type '" "blpapi_Identity_t const *""'"); - } - arg3 = (blpapi_Identity_t *)(argp3); - res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_blpapi_CorrelationId_t_, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_ProviderSession_registerServiceAsync" "', argument " "4"" of type '" "blpapi_CorrelationId_t *""'"); - } - arg4 = (blpapi_CorrelationId_t *)(argp4); - res5 = SWIG_ConvertPtr(swig_obj[4], &argp5,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "blpapi_ProviderSession_registerServiceAsync" "', argument " "5"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); - } - arg5 = (blpapi_ServiceRegistrationOptions_t *)(argp5); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_registerServiceAsync(arg1,(char const *)arg2,(struct blpapi_Identity const *)arg3,arg4,arg5); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_deregisterService(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_ProviderSession_deregisterService", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_deregisterService" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = (blpapi_ProviderSession_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_deregisterService" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_deregisterService(arg1,(char const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_resolve(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - blpapi_ResolutionList_t *arg2 = (blpapi_ResolutionList_t *) 0 ; - int arg3 ; - blpapi_Identity_t *arg4 = (blpapi_Identity_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject *swig_obj[4] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_ProviderSession_resolve", 4, 4, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_resolve" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = (blpapi_ProviderSession_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_resolve" "', argument " "2"" of type '" "blpapi_ResolutionList_t *""'"); - } - arg2 = (blpapi_ResolutionList_t *)(argp2); - ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_resolve" "', argument " "3"" of type '" "int""'"); - } - arg3 = (int)(val3); - res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_ProviderSession_resolve" "', argument " "4"" of type '" "blpapi_Identity_t const *""'"); - } - arg4 = (blpapi_Identity_t *)(argp4); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_resolve(arg1,arg2,arg3,(struct blpapi_Identity const *)arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_resolveAsync(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - blpapi_ResolutionList_t *arg2 = (blpapi_ResolutionList_t *) 0 ; - int arg3 ; - blpapi_Identity_t *arg4 = (blpapi_Identity_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject *swig_obj[4] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_ProviderSession_resolveAsync", 4, 4, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_resolveAsync" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = (blpapi_ProviderSession_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_ResolutionList, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_resolveAsync" "', argument " "2"" of type '" "blpapi_ResolutionList_t const *""'"); - } - arg2 = (blpapi_ResolutionList_t *)(argp2); - ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_resolveAsync" "', argument " "3"" of type '" "int""'"); - } - arg3 = (int)(val3); - res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_ProviderSession_resolveAsync" "', argument " "4"" of type '" "blpapi_Identity_t const *""'"); - } - arg4 = (blpapi_Identity_t *)(argp4); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_resolveAsync(arg1,(struct blpapi_ResolutionList const *)arg2,arg3,(struct blpapi_Identity const *)arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_createTopics(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - blpapi_TopicList_t *arg2 = (blpapi_TopicList_t *) 0 ; - int arg3 ; - blpapi_Identity_t *arg4 = (blpapi_Identity_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject *swig_obj[4] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_ProviderSession_createTopics", 4, 4, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_createTopics" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = (blpapi_ProviderSession_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_createTopics" "', argument " "2"" of type '" "blpapi_TopicList_t *""'"); - } - arg2 = (blpapi_TopicList_t *)(argp2); - ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_createTopics" "', argument " "3"" of type '" "int""'"); - } - arg3 = (int)(val3); - res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_ProviderSession_createTopics" "', argument " "4"" of type '" "blpapi_Identity_t const *""'"); - } - arg4 = (blpapi_Identity_t *)(argp4); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_createTopics(arg1,arg2,arg3,(struct blpapi_Identity const *)arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_createTopicsAsync(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - blpapi_TopicList_t *arg2 = (blpapi_TopicList_t *) 0 ; - int arg3 ; - blpapi_Identity_t *arg4 = (blpapi_Identity_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject *swig_obj[4] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_ProviderSession_createTopicsAsync", 4, 4, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_createTopicsAsync" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = (blpapi_ProviderSession_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_TopicList, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_createTopicsAsync" "', argument " "2"" of type '" "blpapi_TopicList_t const *""'"); - } - arg2 = (blpapi_TopicList_t *)(argp2); - ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_createTopicsAsync" "', argument " "3"" of type '" "int""'"); - } - arg3 = (int)(val3); - res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_blpapi_Identity, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_ProviderSession_createTopicsAsync" "', argument " "4"" of type '" "blpapi_Identity_t const *""'"); - } - arg4 = (blpapi_Identity_t *)(argp4); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_createTopicsAsync(arg1,(struct blpapi_TopicList const *)arg2,arg3,(struct blpapi_Identity const *)arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_getTopic(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - blpapi_Message_t *arg2 = (blpapi_Message_t *) 0 ; - blpapi_Topic_t **arg3 = (blpapi_Topic_t **) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - blpapi_Topic_t *temp3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg3 = &temp3; - if (!SWIG_Python_UnpackTuple(args, "blpapi_ProviderSession_getTopic", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_getTopic" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = (blpapi_ProviderSession_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Message, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_getTopic" "', argument " "2"" of type '" "blpapi_Message_t const *""'"); - } - arg2 = (blpapi_Message_t *)(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_getTopic(arg1,(struct blpapi_Message const *)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg3), SWIGTYPE_p_blpapi_Topic, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_createTopic(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - blpapi_Message_t *arg2 = (blpapi_Message_t *) 0 ; - blpapi_Topic_t **arg3 = (blpapi_Topic_t **) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - blpapi_Topic_t *temp3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg3 = &temp3; - if (!SWIG_Python_UnpackTuple(args, "blpapi_ProviderSession_createTopic", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_createTopic" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = (blpapi_ProviderSession_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Message, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_createTopic" "', argument " "2"" of type '" "blpapi_Message_t const *""'"); - } - arg2 = (blpapi_Message_t *)(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_createTopic(arg1,(struct blpapi_Message const *)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg3), SWIGTYPE_p_blpapi_Topic, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_createServiceStatusTopic(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - blpapi_Service_t *arg2 = (blpapi_Service_t *) 0 ; - blpapi_Topic_t **arg3 = (blpapi_Topic_t **) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - blpapi_Topic_t *temp3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg3 = &temp3; - if (!SWIG_Python_UnpackTuple(args, "blpapi_ProviderSession_createServiceStatusTopic", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_createServiceStatusTopic" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = (blpapi_ProviderSession_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Service, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_createServiceStatusTopic" "', argument " "2"" of type '" "blpapi_Service_t const *""'"); - } - arg2 = (blpapi_Service_t *)(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_createServiceStatusTopic(arg1,(struct blpapi_Service const *)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((*arg3), SWIGTYPE_p_blpapi_Topic, 0)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_deleteTopics(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - blpapi_Topic_t **arg2 = (blpapi_Topic_t **) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_ProviderSession_deleteTopics", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_deleteTopics" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = (blpapi_ProviderSession_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_p_blpapi_Topic, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_deleteTopics" "', argument " "2"" of type '" "blpapi_Topic_t const **""'"); - } - arg2 = (blpapi_Topic_t **)(argp2); - ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_deleteTopics" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_deleteTopics(arg1,(struct blpapi_Topic const **)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_terminateSubscriptionsOnTopics(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - blpapi_Topic_t **arg2 = (blpapi_Topic_t **) 0 ; - size_t arg3 ; - char *arg4 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - int res4 ; - char *buf4 = 0 ; - int alloc4 = 0 ; - PyObject *swig_obj[4] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_ProviderSession_terminateSubscriptionsOnTopics", 4, 4, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_terminateSubscriptionsOnTopics" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = (blpapi_ProviderSession_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_p_blpapi_Topic, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_terminateSubscriptionsOnTopics" "', argument " "2"" of type '" "blpapi_Topic_t const **""'"); - } - arg2 = (blpapi_Topic_t **)(argp2); - ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_terminateSubscriptionsOnTopics" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = (size_t)(val3); - res4 = SWIG_AsCharPtrAndSize(swig_obj[3], &buf4, NULL, &alloc4); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "blpapi_ProviderSession_terminateSubscriptionsOnTopics" "', argument " "4"" of type '" "char const *""'"); - } - arg4 = (char *)(buf4); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_terminateSubscriptionsOnTopics(arg1,(struct blpapi_Topic const **)arg2,arg3,(char const *)arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); - return resultobj; -fail: - if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_publish(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - blpapi_Event_t *arg2 = (blpapi_Event_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_ProviderSession_publish", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_publish" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = (blpapi_ProviderSession_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Event, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_publish" "', argument " "2"" of type '" "blpapi_Event_t *""'"); - } - arg2 = (blpapi_Event_t *)(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_publish(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_sendResponse(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - blpapi_Event_t *arg2 = (blpapi_Event_t *) 0 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_ProviderSession_sendResponse", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_sendResponse" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = (blpapi_ProviderSession_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_Event, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ProviderSession_sendResponse" "', argument " "2"" of type '" "blpapi_Event_t *""'"); - } - arg2 = (blpapi_Event_t *)(argp2); - ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_sendResponse" "', argument " "3"" of type '" "int""'"); - } - arg3 = (int)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_sendResponse(arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_getAbstractSession(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - blpapi_AbstractSession_t *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_getAbstractSession" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = (blpapi_ProviderSession_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_AbstractSession_t *)blpapi_ProviderSession_getAbstractSession(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_AbstractSession, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_flushPublishedEvents(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ProviderSession_t *arg1 = (blpapi_ProviderSession_t *) 0 ; - int *arg2 = (int *) 0 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int temp2 ; - int val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[2] ; - int result; - - arg2 = &temp2; - if (!SWIG_Python_UnpackTuple(args, "blpapi_ProviderSession_flushPublishedEvents", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ProviderSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ProviderSession_flushPublishedEvents" "', argument " "1"" of type '" "blpapi_ProviderSession_t *""'"); - } - arg1 = (blpapi_ProviderSession_t *)(argp1); - ecode3 = SWIG_AsVal_int(swig_obj[1], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ProviderSession_flushPublishedEvents" "', argument " "3"" of type '" "int""'"); - } - arg3 = (int)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ProviderSession_flushPublishedEvents(arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - resultobj = SWIG_Python_AppendOutput(resultobj, PyInt_FromLong(*arg2)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ServiceRegistrationOptions_t *result = 0 ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_ServiceRegistrationOptions_create", 0, 0, 0)) SWIG_fail; - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_ServiceRegistrationOptions_t *)blpapi_ServiceRegistrationOptions_create(); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_duplicate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ServiceRegistrationOptions_t *arg1 = (blpapi_ServiceRegistrationOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - blpapi_ServiceRegistrationOptions_t *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_duplicate" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t const *""'"); - } - arg1 = (blpapi_ServiceRegistrationOptions_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (blpapi_ServiceRegistrationOptions_t *)blpapi_ServiceRegistrationOptions_duplicate((struct blpapi_ServiceRegistrationOptions const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ServiceRegistrationOptions_t *arg1 = (blpapi_ServiceRegistrationOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_destroy" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); - } - arg1 = (blpapi_ServiceRegistrationOptions_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_ServiceRegistrationOptions_destroy(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_copy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ServiceRegistrationOptions_t *arg1 = (blpapi_ServiceRegistrationOptions_t *) 0 ; - blpapi_ServiceRegistrationOptions_t *arg2 = (blpapi_ServiceRegistrationOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[2] ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_ServiceRegistrationOptions_copy", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_copy" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); - } - arg1 = (blpapi_ServiceRegistrationOptions_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ServiceRegistrationOptions_copy" "', argument " "2"" of type '" "blpapi_ServiceRegistrationOptions_t const *""'"); - } - arg2 = (blpapi_ServiceRegistrationOptions_t *)(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_ServiceRegistrationOptions_copy(arg1,(struct blpapi_ServiceRegistrationOptions const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ServiceRegistrationOptions_t *arg1 = (blpapi_ServiceRegistrationOptions_t *) 0 ; - int arg2 ; - int arg3 ; - int arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - PyObject *swig_obj[4] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange", 4, 4, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); - } - arg1 = (blpapi_ServiceRegistrationOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); - ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange" "', argument " "3"" of type '" "int""'"); - } - arg3 = (int)(val3); - ecode4 = SWIG_AsVal_int(swig_obj[3], &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange" "', argument " "4"" of type '" "int""'"); - } - arg4 = (int)(val4); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange(arg1,arg2,arg3,arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ServiceRegistrationOptions_t *arg1 = (blpapi_ServiceRegistrationOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); - } - arg1 = (blpapi_ServiceRegistrationOptions_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_setGroupId(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ServiceRegistrationOptions_t *arg1 = (blpapi_ServiceRegistrationOptions_t *) 0 ; - char *arg2 = (char *) 0 ; - unsigned int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - size_t size2 = 0 ; - int alloc2 = 0 ; - PyObject *swig_obj[2] ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_ServiceRegistrationOptions_setGroupId", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_setGroupId" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); - } - arg1 = (blpapi_ServiceRegistrationOptions_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, &size2, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ServiceRegistrationOptions_setGroupId" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - arg3 = (unsigned int)(size2 - 1); - { - if (!arg2) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); - } - } - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_ServiceRegistrationOptions_setGroupId(arg1,(char const *)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_setServicePriority(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ServiceRegistrationOptions_t *arg1 = (blpapi_ServiceRegistrationOptions_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_ServiceRegistrationOptions_setServicePriority", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_setServicePriority" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); - } - arg1 = (blpapi_ServiceRegistrationOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_ServiceRegistrationOptions_setServicePriority" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ServiceRegistrationOptions_setServicePriority(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_setPartsToRegister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ServiceRegistrationOptions_t *arg1 = (blpapi_ServiceRegistrationOptions_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_ServiceRegistrationOptions_setPartsToRegister", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_setPartsToRegister" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); - } - arg1 = (blpapi_ServiceRegistrationOptions_t *)(argp1); - ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "blpapi_ServiceRegistrationOptions_setPartsToRegister" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_ServiceRegistrationOptions_setPartsToRegister(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_getGroupId(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ServiceRegistrationOptions_t *arg1 = (blpapi_ServiceRegistrationOptions_t *) 0 ; - char *arg2 = (char *) 0 ; - int *arg3 = (int *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - char temp2[MAX_GROUP_ID_SIZE] ; - int len2 = MAX_GROUP_ID_SIZE ; - PyObject *swig_obj[1] ; - int result; - - arg2 = temp2; - arg3 = &len2; - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_getGroupId" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); - } - arg1 = (blpapi_ServiceRegistrationOptions_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ServiceRegistrationOptions_getGroupId(arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtrAndSize(arg2, *arg3)); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_getServicePriority(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ServiceRegistrationOptions_t *arg1 = (blpapi_ServiceRegistrationOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_getServicePriority" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); - } - arg1 = (blpapi_ServiceRegistrationOptions_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ServiceRegistrationOptions_getServicePriority(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_getPartsToRegister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_ServiceRegistrationOptions_t *arg1 = (blpapi_ServiceRegistrationOptions_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - int result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_ServiceRegistrationOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ServiceRegistrationOptions_getPartsToRegister" "', argument " "1"" of type '" "blpapi_ServiceRegistrationOptions_t *""'"); - } - arg1 = (blpapi_ServiceRegistrationOptions_t *)(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ServiceRegistrationOptions_getPartsToRegister(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_ZfpUtil_getOptionsForLeasedLines(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - blpapi_SessionOptions_t *arg1 = (blpapi_SessionOptions_t *) 0 ; - blpapi_TlsOptions_t *arg2 = (blpapi_TlsOptions_t *) 0 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[3] ; - int result; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_ZfpUtil_getOptionsForLeasedLines", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_blpapi_SessionOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_ZfpUtil_getOptionsForLeasedLines" "', argument " "1"" of type '" "blpapi_SessionOptions_t *""'"); - } - arg1 = (blpapi_SessionOptions_t *)(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_blpapi_TlsOptions, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "blpapi_ZfpUtil_getOptionsForLeasedLines" "', argument " "2"" of type '" "blpapi_TlsOptions_t const *""'"); - } - arg2 = (blpapi_TlsOptions_t *)(argp2); - ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "blpapi_ZfpUtil_getOptionsForLeasedLines" "', argument " "3"" of type '" "int""'"); - } - arg3 = (int)(val3); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)blpapi_ZfpUtil_getOptionsForLeasedLines(arg1,(struct blpapi_TlsOptions const *)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_From_int((int)(result)); - return resultobj; -fail: - return NULL; -} - - -static PyMethodDef SwigMethods[] = { - { "SWIG_PyInstanceMethod_New", SWIG_PyInstanceMethod_New, METH_O, NULL}, - { "setLoggerCallbackWrapper", _wrap_setLoggerCallbackWrapper, METH_VARARGS, NULL}, - { "blpapi_HighPrecisionDatetime_fromTimePoint_wrapper", _wrap_blpapi_HighPrecisionDatetime_fromTimePoint_wrapper, METH_O, NULL}, - { "blpapi_Logging_registerCallback", _wrap_blpapi_Logging_registerCallback, METH_VARARGS, NULL}, - { "blpapi_Logging_logTestMessage", _wrap_blpapi_Logging_logTestMessage, METH_O, NULL}, - { "blpapi_DiagnosticsUtil_memoryInfo_wrapper", _wrap_blpapi_DiagnosticsUtil_memoryInfo_wrapper, METH_NOARGS, NULL}, - { "blpapi_EventDispatcher_stop", _wrap_blpapi_EventDispatcher_stop, METH_VARARGS, NULL}, - { "blpapi_Service_printHelper", _wrap_blpapi_Service_printHelper, METH_VARARGS, NULL}, - { "blpapi_SchemaElementDefinition_printHelper", _wrap_blpapi_SchemaElementDefinition_printHelper, METH_VARARGS, NULL}, - { "blpapi_SchemaTypeDefinition_printHelper", _wrap_blpapi_SchemaTypeDefinition_printHelper, METH_VARARGS, NULL}, - { "blpapi_Message_printHelper", _wrap_blpapi_Message_printHelper, METH_VARARGS, NULL}, - { "blpapi_SessionOptions_printHelper", _wrap_blpapi_SessionOptions_printHelper, METH_VARARGS, NULL}, - { "blpapi_Socks5Config_printHelper", _wrap_blpapi_Socks5Config_printHelper, METH_VARARGS, NULL}, - { "blpapi_TestUtil_serializeServiceHelper", _wrap_blpapi_TestUtil_serializeServiceHelper, METH_O, NULL}, - { "blpapi_SchemaTypeDefinition_hasElementDefinition", _wrap_blpapi_SchemaTypeDefinition_hasElementDefinition, METH_VARARGS, NULL}, - { "blpapi_ConstantList_hasConstant", _wrap_blpapi_ConstantList_hasConstant, METH_VARARGS, NULL}, - { "blpapi_Service_hasEventDefinition", _wrap_blpapi_Service_hasEventDefinition, METH_VARARGS, NULL}, - { "blpapi_Service_hasOperation", _wrap_blpapi_Service_hasOperation, METH_VARARGS, NULL}, - { "blpapi_SubscriptionList_addHelper", _wrap_blpapi_SubscriptionList_addHelper, METH_VARARGS, NULL}, - { "blpapi_Name_hasName", _wrap_blpapi_Name_hasName, METH_O, NULL}, - { "blpapi_TopicList_createFromResolutionList", _wrap_blpapi_TopicList_createFromResolutionList, METH_O, NULL}, - { "new_intArray", _wrap_new_intArray, METH_O, NULL}, - { "delete_intArray", _wrap_delete_intArray, METH_O, NULL}, - { "intArray___getitem__", _wrap_intArray___getitem__, METH_VARARGS, NULL}, - { "intArray___setitem__", _wrap_intArray___setitem__, METH_VARARGS, NULL}, - { "intArray_cast", _wrap_intArray_cast, METH_O, NULL}, - { "intArray_frompointer", _wrap_intArray_frompointer, METH_O, NULL}, - { "intArray_swigregister", intArray_swigregister, METH_O, NULL}, - { "intArray_swiginit", intArray_swiginit, METH_VARARGS, NULL}, - { "new_topicPtrArray", _wrap_new_topicPtrArray, METH_O, NULL}, - { "delete_topicPtrArray", _wrap_delete_topicPtrArray, METH_O, NULL}, - { "topicPtrArray_getitem", _wrap_topicPtrArray_getitem, METH_VARARGS, NULL}, - { "topicPtrArray_setitem", _wrap_topicPtrArray_setitem, METH_VARARGS, NULL}, - { "CorrelationId_t_equals", _wrap_CorrelationId_t_equals, METH_VARARGS, NULL}, - { "CorrelationId_value_get", _wrap_CorrelationId_value_get, METH_O, NULL}, - { "new_CorrelationId", _wrap_new_CorrelationId, METH_VARARGS, "\n" - "``CorrelationId([value[, classId=0]])`` constructs a :class:`CorrelationId`\n" - "object.\n" - "\n" - "If ``value`` is an integer (either :class:`int` or :class:`long`) then the\n" - "created :class:`CorrelationId` will have type :attr:`INT_TYPE`. Otherwise, it\n" - "will have type :attr:`OBJECT_TYPE`.\n" - "\n" - "If no arguments are specified, then the type will be :attr:`UNSET_TYPE`.\n" - "\n" - "The maximum allowed ``classId`` value is :attr:`MAX_CLASS_ID`.\n" - ""}, - { "delete_CorrelationId", _wrap_delete_CorrelationId, METH_O, NULL}, - { "CorrelationId_type", _wrap_CorrelationId_type, METH_O, "\n" - "Returns:\n" - " int: The type of this CorrelationId object (see the ``xxx_TYPE`` class\n" - " attributes)\n" - ""}, - { "CorrelationId_classId", _wrap_CorrelationId_classId, METH_O, "\n" - "Returns:\n" - " int: The user defined classification of this :class:`CorrelationId`\n" - " object\n" - ""}, - { "CorrelationId___asObject", _wrap_CorrelationId___asObject, METH_O, NULL}, - { "CorrelationId___asInteger", _wrap_CorrelationId___asInteger, METH_O, NULL}, - { "CorrelationId___toInteger", _wrap_CorrelationId___toInteger, METH_O, NULL}, - { "CorrelationId_swigregister", CorrelationId_swigregister, METH_O, NULL}, - { "CorrelationId_swiginit", CorrelationId_swiginit, METH_VARARGS, NULL}, - { "new_blpapi_CorrelationId_t__value", _wrap_new_blpapi_CorrelationId_t__value, METH_NOARGS, NULL}, - { "delete_blpapi_CorrelationId_t__value", _wrap_delete_blpapi_CorrelationId_t__value, METH_O, NULL}, - { "blpapi_CorrelationId_t__value_swigregister", blpapi_CorrelationId_t__value_swigregister, METH_O, NULL}, - { "blpapi_CorrelationId_t__value_swiginit", blpapi_CorrelationId_t__value_swiginit, METH_VARARGS, NULL}, - { "blpapi_Element_toPy", _wrap_blpapi_Element_toPy, METH_O, NULL}, - { "blpapi_Element_setElementFloat", _wrap_blpapi_Element_setElementFloat, METH_VARARGS, NULL}, - { "blpapi_Element_setValueFloat", _wrap_blpapi_Element_setValueFloat, METH_VARARGS, NULL}, - { "blpapi_Element_printHelper", _wrap_blpapi_Element_printHelper, METH_VARARGS, NULL}, - { "blpapi_Element_name", _wrap_blpapi_Element_name, METH_O, NULL}, - { "blpapi_Element_nameString", _wrap_blpapi_Element_nameString, METH_O, NULL}, - { "blpapi_Element_definition", _wrap_blpapi_Element_definition, METH_O, NULL}, - { "blpapi_Element_datatype", _wrap_blpapi_Element_datatype, METH_O, NULL}, - { "blpapi_Element_isComplexType", _wrap_blpapi_Element_isComplexType, METH_O, NULL}, - { "blpapi_Element_isArray", _wrap_blpapi_Element_isArray, METH_O, NULL}, - { "blpapi_Element_isReadOnly", _wrap_blpapi_Element_isReadOnly, METH_O, NULL}, - { "blpapi_Element_numValues", _wrap_blpapi_Element_numValues, METH_O, NULL}, - { "blpapi_Element_numElements", _wrap_blpapi_Element_numElements, METH_O, NULL}, - { "blpapi_Element_isNullValue", _wrap_blpapi_Element_isNullValue, METH_VARARGS, NULL}, - { "blpapi_Element_isNull", _wrap_blpapi_Element_isNull, METH_O, NULL}, - { "blpapi_Element_getElementAt", _wrap_blpapi_Element_getElementAt, METH_VARARGS, NULL}, - { "blpapi_Element_getElement", _wrap_blpapi_Element_getElement, METH_VARARGS, NULL}, - { "blpapi_Element_hasElementEx", _wrap_blpapi_Element_hasElementEx, METH_VARARGS, NULL}, - { "blpapi_Element_getValueAsBool", _wrap_blpapi_Element_getValueAsBool, METH_VARARGS, NULL}, - { "blpapi_Element_getValueAsChar", _wrap_blpapi_Element_getValueAsChar, METH_VARARGS, NULL}, - { "blpapi_Element_getValueAsInt32", _wrap_blpapi_Element_getValueAsInt32, METH_VARARGS, NULL}, - { "blpapi_Element_getValueAsInt64", _wrap_blpapi_Element_getValueAsInt64, METH_VARARGS, NULL}, - { "blpapi_Element_getValueAsFloat64", _wrap_blpapi_Element_getValueAsFloat64, METH_VARARGS, NULL}, - { "blpapi_Element_getValueAsString", _wrap_blpapi_Element_getValueAsString, METH_VARARGS, NULL}, - { "blpapi_Element_getValueAsDatetime", _wrap_blpapi_Element_getValueAsDatetime, METH_VARARGS, NULL}, - { "blpapi_Element_getValueAsHighPrecisionDatetime", _wrap_blpapi_Element_getValueAsHighPrecisionDatetime, METH_VARARGS, NULL}, - { "blpapi_Element_getValueAsElement", _wrap_blpapi_Element_getValueAsElement, METH_VARARGS, NULL}, - { "blpapi_Element_getValueAsName", _wrap_blpapi_Element_getValueAsName, METH_VARARGS, NULL}, - { "blpapi_Element_getValueAsBytes", _wrap_blpapi_Element_getValueAsBytes, METH_VARARGS, NULL}, - { "blpapi_Element_getChoice", _wrap_blpapi_Element_getChoice, METH_O, NULL}, - { "blpapi_Element_setValueBool", _wrap_blpapi_Element_setValueBool, METH_VARARGS, NULL}, - { "blpapi_Element_setValueInt32", _wrap_blpapi_Element_setValueInt32, METH_VARARGS, NULL}, - { "blpapi_Element_setValueInt64", _wrap_blpapi_Element_setValueInt64, METH_VARARGS, NULL}, - { "blpapi_Element_setValueString", _wrap_blpapi_Element_setValueString, METH_VARARGS, NULL}, - { "blpapi_Element_setValueHighPrecisionDatetime", _wrap_blpapi_Element_setValueHighPrecisionDatetime, METH_VARARGS, NULL}, - { "blpapi_Element_setValueBytes", _wrap_blpapi_Element_setValueBytes, METH_VARARGS, NULL}, - { "blpapi_Element_setValueFromName", _wrap_blpapi_Element_setValueFromName, METH_VARARGS, NULL}, - { "blpapi_Element_setElementBool", _wrap_blpapi_Element_setElementBool, METH_VARARGS, NULL}, - { "blpapi_Element_setElementInt32", _wrap_blpapi_Element_setElementInt32, METH_VARARGS, NULL}, - { "blpapi_Element_setElementInt64", _wrap_blpapi_Element_setElementInt64, METH_VARARGS, NULL}, - { "blpapi_Element_setElementString", _wrap_blpapi_Element_setElementString, METH_VARARGS, NULL}, - { "blpapi_Element_setElementHighPrecisionDatetime", _wrap_blpapi_Element_setElementHighPrecisionDatetime, METH_VARARGS, NULL}, - { "blpapi_Element_setElementBytes", _wrap_blpapi_Element_setElementBytes, METH_VARARGS, NULL}, - { "blpapi_Element_setElementFromName", _wrap_blpapi_Element_setElementFromName, METH_VARARGS, NULL}, - { "blpapi_Element_appendElement", _wrap_blpapi_Element_appendElement, METH_O, NULL}, - { "blpapi_Element_setChoice", _wrap_blpapi_Element_setChoice, METH_VARARGS, NULL}, - { "blpapi_EventFormatter_setValueFloat", _wrap_blpapi_EventFormatter_setValueFloat, METH_VARARGS, NULL}, - { "blpapi_EventFormatter_appendValueFloat", _wrap_blpapi_EventFormatter_appendValueFloat, METH_VARARGS, NULL}, - { "blpapi_EventFormatter_create", _wrap_blpapi_EventFormatter_create, METH_O, NULL}, - { "blpapi_EventFormatter_destroy", _wrap_blpapi_EventFormatter_destroy, METH_O, NULL}, - { "blpapi_EventFormatter_appendMessage", _wrap_blpapi_EventFormatter_appendMessage, METH_VARARGS, NULL}, - { "blpapi_EventFormatter_appendMessageSeq", _wrap_blpapi_EventFormatter_appendMessageSeq, METH_VARARGS, NULL}, - { "blpapi_EventFormatter_appendResponse", _wrap_blpapi_EventFormatter_appendResponse, METH_VARARGS, NULL}, - { "blpapi_EventFormatter_appendRecapMessage", _wrap_blpapi_EventFormatter_appendRecapMessage, METH_VARARGS, NULL}, - { "blpapi_EventFormatter_appendRecapMessageSeq", _wrap_blpapi_EventFormatter_appendRecapMessageSeq, METH_VARARGS, NULL}, - { "blpapi_EventFormatter_appendFragmentedRecapMessage", _wrap_blpapi_EventFormatter_appendFragmentedRecapMessage, METH_VARARGS, NULL}, - { "blpapi_EventFormatter_appendFragmentedRecapMessageSeq", _wrap_blpapi_EventFormatter_appendFragmentedRecapMessageSeq, METH_VARARGS, NULL}, - { "blpapi_EventFormatter_setValueBool", _wrap_blpapi_EventFormatter_setValueBool, METH_VARARGS, NULL}, - { "blpapi_EventFormatter_setValueChar", _wrap_blpapi_EventFormatter_setValueChar, METH_VARARGS, NULL}, - { "blpapi_EventFormatter_setValueInt32", _wrap_blpapi_EventFormatter_setValueInt32, METH_VARARGS, NULL}, - { "blpapi_EventFormatter_setValueInt64", _wrap_blpapi_EventFormatter_setValueInt64, METH_VARARGS, NULL}, - { "blpapi_EventFormatter_setValueHighPrecisionDatetime", _wrap_blpapi_EventFormatter_setValueHighPrecisionDatetime, METH_VARARGS, NULL}, - { "blpapi_EventFormatter_setValueString", _wrap_blpapi_EventFormatter_setValueString, METH_VARARGS, NULL}, - { "blpapi_EventFormatter_setValueFromName", _wrap_blpapi_EventFormatter_setValueFromName, METH_VARARGS, NULL}, - { "blpapi_EventFormatter_setValueBytes", _wrap_blpapi_EventFormatter_setValueBytes, METH_VARARGS, NULL}, - { "blpapi_EventFormatter_setValueNull", _wrap_blpapi_EventFormatter_setValueNull, METH_VARARGS, NULL}, - { "blpapi_EventFormatter_pushElement", _wrap_blpapi_EventFormatter_pushElement, METH_VARARGS, NULL}, - { "blpapi_EventFormatter_popElement", _wrap_blpapi_EventFormatter_popElement, METH_O, NULL}, - { "blpapi_EventFormatter_appendValueBool", _wrap_blpapi_EventFormatter_appendValueBool, METH_VARARGS, NULL}, - { "blpapi_EventFormatter_appendValueChar", _wrap_blpapi_EventFormatter_appendValueChar, METH_VARARGS, NULL}, - { "blpapi_EventFormatter_appendValueInt32", _wrap_blpapi_EventFormatter_appendValueInt32, METH_VARARGS, NULL}, - { "blpapi_EventFormatter_appendValueInt64", _wrap_blpapi_EventFormatter_appendValueInt64, METH_VARARGS, NULL}, - { "blpapi_EventFormatter_appendValueHighPrecisionDatetime", _wrap_blpapi_EventFormatter_appendValueHighPrecisionDatetime, METH_VARARGS, NULL}, - { "blpapi_EventFormatter_appendValueString", _wrap_blpapi_EventFormatter_appendValueString, METH_VARARGS, NULL}, - { "blpapi_EventFormatter_appendValueFromName", _wrap_blpapi_EventFormatter_appendValueFromName, METH_VARARGS, NULL}, - { "blpapi_EventFormatter_appendElement", _wrap_blpapi_EventFormatter_appendElement, METH_O, NULL}, - { "Session_createHelper", _wrap_Session_createHelper, METH_VARARGS, NULL}, - { "Session_destroyHelper", _wrap_Session_destroyHelper, METH_VARARGS, NULL}, - { "blpapi_EventDispatcher_create", _wrap_blpapi_EventDispatcher_create, METH_O, NULL}, - { "blpapi_EventDispatcher_destroy", _wrap_blpapi_EventDispatcher_destroy, METH_O, NULL}, - { "blpapi_EventDispatcher_start", _wrap_blpapi_EventDispatcher_start, METH_O, NULL}, - { "ProviderSession_createHelper", _wrap_ProviderSession_createHelper, METH_VARARGS, NULL}, - { "ProviderSession_destroyHelper", _wrap_ProviderSession_destroyHelper, METH_VARARGS, NULL}, - { "ProviderSession_terminateSubscriptionsOnTopic", _wrap_ProviderSession_terminateSubscriptionsOnTopic, METH_VARARGS, NULL}, - { "blpapi_MessageFormatter_setValueFloat", _wrap_blpapi_MessageFormatter_setValueFloat, METH_VARARGS, NULL}, - { "blpapi_MessageFormatter_appendValueFloat", _wrap_blpapi_MessageFormatter_appendValueFloat, METH_VARARGS, NULL}, - { "blpapi_MessageFormatter_setValueBool", _wrap_blpapi_MessageFormatter_setValueBool, METH_VARARGS, NULL}, - { "blpapi_MessageFormatter_setValueChar", _wrap_blpapi_MessageFormatter_setValueChar, METH_VARARGS, NULL}, - { "blpapi_MessageFormatter_setValueInt32", _wrap_blpapi_MessageFormatter_setValueInt32, METH_VARARGS, NULL}, - { "blpapi_MessageFormatter_setValueInt64", _wrap_blpapi_MessageFormatter_setValueInt64, METH_VARARGS, NULL}, - { "blpapi_MessageFormatter_setValueFloat32", _wrap_blpapi_MessageFormatter_setValueFloat32, METH_VARARGS, NULL}, - { "blpapi_MessageFormatter_setValueFloat64", _wrap_blpapi_MessageFormatter_setValueFloat64, METH_VARARGS, NULL}, - { "blpapi_MessageFormatter_setValueDatetime", _wrap_blpapi_MessageFormatter_setValueDatetime, METH_VARARGS, NULL}, - { "blpapi_MessageFormatter_setValueHighPrecisionDatetime", _wrap_blpapi_MessageFormatter_setValueHighPrecisionDatetime, METH_VARARGS, NULL}, - { "blpapi_MessageFormatter_setValueString", _wrap_blpapi_MessageFormatter_setValueString, METH_VARARGS, NULL}, - { "blpapi_MessageFormatter_setValueFromName", _wrap_blpapi_MessageFormatter_setValueFromName, METH_VARARGS, NULL}, - { "blpapi_MessageFormatter_setValueBytes", _wrap_blpapi_MessageFormatter_setValueBytes, METH_VARARGS, NULL}, - { "blpapi_MessageFormatter_setValueNull", _wrap_blpapi_MessageFormatter_setValueNull, METH_VARARGS, NULL}, - { "blpapi_MessageFormatter_pushElement", _wrap_blpapi_MessageFormatter_pushElement, METH_VARARGS, NULL}, - { "blpapi_MessageFormatter_popElement", _wrap_blpapi_MessageFormatter_popElement, METH_O, NULL}, - { "blpapi_MessageFormatter_appendValueBool", _wrap_blpapi_MessageFormatter_appendValueBool, METH_VARARGS, NULL}, - { "blpapi_MessageFormatter_appendValueChar", _wrap_blpapi_MessageFormatter_appendValueChar, METH_VARARGS, NULL}, - { "blpapi_MessageFormatter_appendValueInt32", _wrap_blpapi_MessageFormatter_appendValueInt32, METH_VARARGS, NULL}, - { "blpapi_MessageFormatter_appendValueInt64", _wrap_blpapi_MessageFormatter_appendValueInt64, METH_VARARGS, NULL}, - { "blpapi_MessageFormatter_appendValueFloat32", _wrap_blpapi_MessageFormatter_appendValueFloat32, METH_VARARGS, NULL}, - { "blpapi_MessageFormatter_appendValueFloat64", _wrap_blpapi_MessageFormatter_appendValueFloat64, METH_VARARGS, NULL}, - { "blpapi_MessageFormatter_appendValueDatetime", _wrap_blpapi_MessageFormatter_appendValueDatetime, METH_VARARGS, NULL}, - { "blpapi_MessageFormatter_appendValueHighPrecisionDatetime", _wrap_blpapi_MessageFormatter_appendValueHighPrecisionDatetime, METH_VARARGS, NULL}, - { "blpapi_MessageFormatter_appendValueString", _wrap_blpapi_MessageFormatter_appendValueString, METH_VARARGS, NULL}, - { "blpapi_MessageFormatter_appendValueFromName", _wrap_blpapi_MessageFormatter_appendValueFromName, METH_VARARGS, NULL}, - { "blpapi_MessageFormatter_appendElement", _wrap_blpapi_MessageFormatter_appendElement, METH_O, NULL}, - { "blpapi_MessageFormatter_FormatMessageJson", _wrap_blpapi_MessageFormatter_FormatMessageJson, METH_VARARGS, NULL}, - { "blpapi_MessageFormatter_FormatMessageXml", _wrap_blpapi_MessageFormatter_FormatMessageXml, METH_VARARGS, NULL}, - { "blpapi_MessageFormatter_copy", _wrap_blpapi_MessageFormatter_copy, METH_O, NULL}, - { "blpapi_MessageFormatter_assign", _wrap_blpapi_MessageFormatter_assign, METH_O, NULL}, - { "blpapi_MessageFormatter_destroy", _wrap_blpapi_MessageFormatter_destroy, METH_O, NULL}, - { "blpapi_Session_subscribeEx_helper", _wrap_blpapi_Session_subscribeEx_helper, METH_VARARGS, NULL}, - { "blpapi_Session_resubscribeEx_helper", _wrap_blpapi_Session_resubscribeEx_helper, METH_VARARGS, NULL}, - { "blpapi_Session_resubscribeWithIdEx_helper", _wrap_blpapi_Session_resubscribeWithIdEx_helper, METH_VARARGS, NULL}, - { "blpapi_AuthOptions_create_default", _wrap_blpapi_AuthOptions_create_default, METH_NOARGS, NULL}, - { "blpapi_AuthOptions_create_forUserMode", _wrap_blpapi_AuthOptions_create_forUserMode, METH_O, NULL}, - { "blpapi_AuthOptions_create_forAppMode", _wrap_blpapi_AuthOptions_create_forAppMode, METH_O, NULL}, - { "blpapi_AuthOptions_create_forUserAndAppMode", _wrap_blpapi_AuthOptions_create_forUserAndAppMode, METH_VARARGS, NULL}, - { "blpapi_AuthOptions_create_forToken", _wrap_blpapi_AuthOptions_create_forToken, METH_O, NULL}, - { "blpapi_AuthOptions_duplicate", _wrap_blpapi_AuthOptions_duplicate, METH_O, NULL}, - { "blpapi_AuthOptions_copy", _wrap_blpapi_AuthOptions_copy, METH_VARARGS, NULL}, - { "blpapi_AuthOptions_destroy", _wrap_blpapi_AuthOptions_destroy, METH_O, NULL}, - { "blpapi_AuthUser_createWithLogonName", _wrap_blpapi_AuthUser_createWithLogonName, METH_NOARGS, NULL}, - { "blpapi_AuthUser_createWithActiveDirectoryProperty", _wrap_blpapi_AuthUser_createWithActiveDirectoryProperty, METH_O, NULL}, - { "blpapi_AuthUser_createWithManualOptions", _wrap_blpapi_AuthUser_createWithManualOptions, METH_VARARGS, NULL}, - { "blpapi_AuthUser_duplicate", _wrap_blpapi_AuthUser_duplicate, METH_O, NULL}, - { "blpapi_AuthUser_copy", _wrap_blpapi_AuthUser_copy, METH_VARARGS, NULL}, - { "blpapi_AuthUser_destroy", _wrap_blpapi_AuthUser_destroy, METH_O, NULL}, - { "blpapi_AuthApplication_create", _wrap_blpapi_AuthApplication_create, METH_O, NULL}, - { "blpapi_AuthApplication_duplicate", _wrap_blpapi_AuthApplication_duplicate, METH_O, NULL}, - { "blpapi_AuthApplication_copy", _wrap_blpapi_AuthApplication_copy, METH_VARARGS, NULL}, - { "blpapi_AuthApplication_destroy", _wrap_blpapi_AuthApplication_destroy, METH_O, NULL}, - { "blpapi_AuthToken_create", _wrap_blpapi_AuthToken_create, METH_O, NULL}, - { "blpapi_AuthToken_duplicate", _wrap_blpapi_AuthToken_duplicate, METH_O, NULL}, - { "blpapi_AuthToken_copy", _wrap_blpapi_AuthToken_copy, METH_VARARGS, NULL}, - { "blpapi_AuthToken_destroy", _wrap_blpapi_AuthToken_destroy, METH_O, NULL}, - { "blpapi_getLastErrorDescription", _wrap_blpapi_getLastErrorDescription, METH_O, NULL}, - { "blpapi_Socks5Config_create", _wrap_blpapi_Socks5Config_create, METH_VARARGS, NULL}, - { "blpapi_Socks5Config_destroy", _wrap_blpapi_Socks5Config_destroy, METH_O, NULL}, - { "blpapi_SessionOptions_create", _wrap_blpapi_SessionOptions_create, METH_NOARGS, NULL}, - { "blpapi_SessionOptions_destroy", _wrap_blpapi_SessionOptions_destroy, METH_O, NULL}, - { "blpapi_SessionOptions_setServerHost", _wrap_blpapi_SessionOptions_setServerHost, METH_VARARGS, NULL}, - { "blpapi_SessionOptions_setServerPort", _wrap_blpapi_SessionOptions_setServerPort, METH_VARARGS, NULL}, - { "blpapi_SessionOptions_setServerAddress", _wrap_blpapi_SessionOptions_setServerAddress, METH_VARARGS, NULL}, - { "blpapi_SessionOptions_setServerAddressWithProxy", _wrap_blpapi_SessionOptions_setServerAddressWithProxy, METH_VARARGS, NULL}, - { "blpapi_SessionOptions_removeServerAddress", _wrap_blpapi_SessionOptions_removeServerAddress, METH_VARARGS, NULL}, - { "blpapi_SessionOptions_setConnectTimeout", _wrap_blpapi_SessionOptions_setConnectTimeout, METH_VARARGS, NULL}, - { "blpapi_SessionOptions_setDefaultServices", _wrap_blpapi_SessionOptions_setDefaultServices, METH_VARARGS, NULL}, - { "blpapi_SessionOptions_setDefaultSubscriptionService", _wrap_blpapi_SessionOptions_setDefaultSubscriptionService, METH_VARARGS, NULL}, - { "blpapi_SessionOptions_setDefaultTopicPrefix", _wrap_blpapi_SessionOptions_setDefaultTopicPrefix, METH_VARARGS, NULL}, - { "blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg", _wrap_blpapi_SessionOptions_setAllowMultipleCorrelatorsPerMsg, METH_VARARGS, NULL}, - { "blpapi_SessionOptions_setClientMode", _wrap_blpapi_SessionOptions_setClientMode, METH_VARARGS, NULL}, - { "blpapi_SessionOptions_setMaxPendingRequests", _wrap_blpapi_SessionOptions_setMaxPendingRequests, METH_VARARGS, NULL}, - { "blpapi_SessionOptions_setAutoRestartOnDisconnection", _wrap_blpapi_SessionOptions_setAutoRestartOnDisconnection, METH_VARARGS, NULL}, - { "blpapi_SessionOptions_setSessionIdentityOptions", _wrap_blpapi_SessionOptions_setSessionIdentityOptions, METH_VARARGS, NULL}, - { "blpapi_SessionOptions_setAuthenticationOptions", _wrap_blpapi_SessionOptions_setAuthenticationOptions, METH_VARARGS, NULL}, - { "blpapi_SessionOptions_setNumStartAttempts", _wrap_blpapi_SessionOptions_setNumStartAttempts, METH_VARARGS, NULL}, - { "blpapi_SessionOptions_setMaxEventQueueSize", _wrap_blpapi_SessionOptions_setMaxEventQueueSize, METH_VARARGS, NULL}, - { "blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark", _wrap_blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark, METH_VARARGS, NULL}, - { "blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark", _wrap_blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark, METH_VARARGS, NULL}, - { "blpapi_SessionOptions_setDefaultKeepAliveInactivityTime", _wrap_blpapi_SessionOptions_setDefaultKeepAliveInactivityTime, METH_VARARGS, NULL}, - { "blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout", _wrap_blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout, METH_VARARGS, NULL}, - { "blpapi_SessionOptions_setKeepAliveEnabled", _wrap_blpapi_SessionOptions_setKeepAliveEnabled, METH_VARARGS, NULL}, - { "blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes", _wrap_blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes, METH_VARARGS, NULL}, - { "blpapi_SessionOptions_setServiceCheckTimeout", _wrap_blpapi_SessionOptions_setServiceCheckTimeout, METH_VARARGS, NULL}, - { "blpapi_SessionOptions_setServiceDownloadTimeout", _wrap_blpapi_SessionOptions_setServiceDownloadTimeout, METH_VARARGS, NULL}, - { "blpapi_SessionOptions_setTlsOptions", _wrap_blpapi_SessionOptions_setTlsOptions, METH_VARARGS, NULL}, - { "blpapi_SessionOptions_setFlushPublishedEventsTimeout", _wrap_blpapi_SessionOptions_setFlushPublishedEventsTimeout, METH_VARARGS, NULL}, - { "blpapi_SessionOptions_setBandwidthSaveModeDisabled", _wrap_blpapi_SessionOptions_setBandwidthSaveModeDisabled, METH_VARARGS, NULL}, - { "blpapi_SessionOptions_serverHost", _wrap_blpapi_SessionOptions_serverHost, METH_O, NULL}, - { "blpapi_SessionOptions_serverPort", _wrap_blpapi_SessionOptions_serverPort, METH_O, NULL}, - { "blpapi_SessionOptions_numServerAddresses", _wrap_blpapi_SessionOptions_numServerAddresses, METH_O, NULL}, - { "blpapi_SessionOptions_getServerAddressWithProxy", _wrap_blpapi_SessionOptions_getServerAddressWithProxy, METH_VARARGS, NULL}, - { "blpapi_SessionOptions_connectTimeout", _wrap_blpapi_SessionOptions_connectTimeout, METH_O, NULL}, - { "blpapi_SessionOptions_defaultServices", _wrap_blpapi_SessionOptions_defaultServices, METH_O, NULL}, - { "blpapi_SessionOptions_defaultSubscriptionService", _wrap_blpapi_SessionOptions_defaultSubscriptionService, METH_O, NULL}, - { "blpapi_SessionOptions_defaultTopicPrefix", _wrap_blpapi_SessionOptions_defaultTopicPrefix, METH_O, NULL}, - { "blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg", _wrap_blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg, METH_O, NULL}, - { "blpapi_SessionOptions_clientMode", _wrap_blpapi_SessionOptions_clientMode, METH_O, NULL}, - { "blpapi_SessionOptions_maxPendingRequests", _wrap_blpapi_SessionOptions_maxPendingRequests, METH_O, NULL}, - { "blpapi_SessionOptions_autoRestartOnDisconnection", _wrap_blpapi_SessionOptions_autoRestartOnDisconnection, METH_O, NULL}, - { "blpapi_SessionOptions_authenticationOptions", _wrap_blpapi_SessionOptions_authenticationOptions, METH_O, NULL}, - { "blpapi_SessionOptions_numStartAttempts", _wrap_blpapi_SessionOptions_numStartAttempts, METH_O, NULL}, - { "blpapi_SessionOptions_maxEventQueueSize", _wrap_blpapi_SessionOptions_maxEventQueueSize, METH_O, NULL}, - { "blpapi_SessionOptions_slowConsumerWarningHiWaterMark", _wrap_blpapi_SessionOptions_slowConsumerWarningHiWaterMark, METH_O, NULL}, - { "blpapi_SessionOptions_slowConsumerWarningLoWaterMark", _wrap_blpapi_SessionOptions_slowConsumerWarningLoWaterMark, METH_O, NULL}, - { "blpapi_SessionOptions_defaultKeepAliveInactivityTime", _wrap_blpapi_SessionOptions_defaultKeepAliveInactivityTime, METH_O, NULL}, - { "blpapi_SessionOptions_defaultKeepAliveResponseTimeout", _wrap_blpapi_SessionOptions_defaultKeepAliveResponseTimeout, METH_O, NULL}, - { "blpapi_SessionOptions_keepAliveEnabled", _wrap_blpapi_SessionOptions_keepAliveEnabled, METH_O, NULL}, - { "blpapi_SessionOptions_recordSubscriptionDataReceiveTimes", _wrap_blpapi_SessionOptions_recordSubscriptionDataReceiveTimes, METH_O, NULL}, - { "blpapi_SessionOptions_serviceCheckTimeout", _wrap_blpapi_SessionOptions_serviceCheckTimeout, METH_O, NULL}, - { "blpapi_SessionOptions_serviceDownloadTimeout", _wrap_blpapi_SessionOptions_serviceDownloadTimeout, METH_O, NULL}, - { "blpapi_SessionOptions_flushPublishedEventsTimeout", _wrap_blpapi_SessionOptions_flushPublishedEventsTimeout, METH_O, NULL}, - { "blpapi_SessionOptions_bandwidthSaveModeDisabled", _wrap_blpapi_SessionOptions_bandwidthSaveModeDisabled, METH_O, NULL}, - { "blpapi_SessionOptions_setApplicationIdentityKey", _wrap_blpapi_SessionOptions_setApplicationIdentityKey, METH_VARARGS, NULL}, - { "blpapi_SessionOptions_applicationIdentityKey", _wrap_blpapi_SessionOptions_applicationIdentityKey, METH_O, NULL}, - { "blpapi_SessionOptions_setSessionName", _wrap_blpapi_SessionOptions_setSessionName, METH_VARARGS, NULL}, - { "blpapi_SessionOptions_sessionName", _wrap_blpapi_SessionOptions_sessionName, METH_O, NULL}, - { "blpapi_TlsOptions_destroy", _wrap_blpapi_TlsOptions_destroy, METH_O, NULL}, - { "blpapi_TlsOptions_createFromFiles", _wrap_blpapi_TlsOptions_createFromFiles, METH_VARARGS, NULL}, - { "blpapi_TlsOptions_createFromBlobs", _wrap_blpapi_TlsOptions_createFromBlobs, METH_VARARGS, NULL}, - { "blpapi_TlsOptions_setTlsHandshakeTimeoutMs", _wrap_blpapi_TlsOptions_setTlsHandshakeTimeoutMs, METH_VARARGS, NULL}, - { "blpapi_TlsOptions_setCrlFetchTimeoutMs", _wrap_blpapi_TlsOptions_setCrlFetchTimeoutMs, METH_VARARGS, NULL}, - { "blpapi_Name_create", _wrap_blpapi_Name_create, METH_O, NULL}, - { "blpapi_Name_destroy", _wrap_blpapi_Name_destroy, METH_O, NULL}, - { "blpapi_Name_equalsStr", _wrap_blpapi_Name_equalsStr, METH_VARARGS, NULL}, - { "blpapi_Name_string", _wrap_blpapi_Name_string, METH_O, NULL}, - { "blpapi_Name_length", _wrap_blpapi_Name_length, METH_O, NULL}, - { "blpapi_Name_findName", _wrap_blpapi_Name_findName, METH_O, NULL}, - { "blpapi_SubscriptionList_create", _wrap_blpapi_SubscriptionList_create, METH_NOARGS, NULL}, - { "blpapi_SubscriptionList_destroy", _wrap_blpapi_SubscriptionList_destroy, METH_O, NULL}, - { "blpapi_SubscriptionList_addResolved", _wrap_blpapi_SubscriptionList_addResolved, METH_VARARGS, NULL}, - { "blpapi_SubscriptionList_clear", _wrap_blpapi_SubscriptionList_clear, METH_O, NULL}, - { "blpapi_SubscriptionList_append", _wrap_blpapi_SubscriptionList_append, METH_VARARGS, NULL}, - { "blpapi_SubscriptionList_size", _wrap_blpapi_SubscriptionList_size, METH_O, NULL}, - { "blpapi_SubscriptionList_correlationIdAt", _wrap_blpapi_SubscriptionList_correlationIdAt, METH_VARARGS, NULL}, - { "blpapi_SubscriptionList_topicStringAt", _wrap_blpapi_SubscriptionList_topicStringAt, METH_VARARGS, NULL}, - { "blpapi_SubscriptionList_isResolvedAt", _wrap_blpapi_SubscriptionList_isResolvedAt, METH_VARARGS, NULL}, - { "blpapi_TimePoint_d_value_set", _wrap_blpapi_TimePoint_d_value_set, METH_VARARGS, NULL}, - { "blpapi_TimePoint_d_value_get", _wrap_blpapi_TimePoint_d_value_get, METH_O, NULL}, - { "new_blpapi_TimePoint", _wrap_new_blpapi_TimePoint, METH_NOARGS, NULL}, - { "delete_blpapi_TimePoint", _wrap_delete_blpapi_TimePoint, METH_O, NULL}, - { "blpapi_TimePoint_swigregister", blpapi_TimePoint_swigregister, METH_O, NULL}, - { "blpapi_TimePoint_swiginit", blpapi_TimePoint_swiginit, METH_VARARGS, NULL}, - { "blpapi_TimePointUtil_nanosecondsBetween", _wrap_blpapi_TimePointUtil_nanosecondsBetween, METH_VARARGS, NULL}, - { "blpapi_Datetime_tag_parts_set", _wrap_blpapi_Datetime_tag_parts_set, METH_VARARGS, NULL}, - { "blpapi_Datetime_tag_parts_get", _wrap_blpapi_Datetime_tag_parts_get, METH_O, NULL}, - { "blpapi_Datetime_tag_hours_set", _wrap_blpapi_Datetime_tag_hours_set, METH_VARARGS, NULL}, - { "blpapi_Datetime_tag_hours_get", _wrap_blpapi_Datetime_tag_hours_get, METH_O, NULL}, - { "blpapi_Datetime_tag_minutes_set", _wrap_blpapi_Datetime_tag_minutes_set, METH_VARARGS, NULL}, - { "blpapi_Datetime_tag_minutes_get", _wrap_blpapi_Datetime_tag_minutes_get, METH_O, NULL}, - { "blpapi_Datetime_tag_seconds_set", _wrap_blpapi_Datetime_tag_seconds_set, METH_VARARGS, NULL}, - { "blpapi_Datetime_tag_seconds_get", _wrap_blpapi_Datetime_tag_seconds_get, METH_O, NULL}, - { "blpapi_Datetime_tag_milliSeconds_set", _wrap_blpapi_Datetime_tag_milliSeconds_set, METH_VARARGS, NULL}, - { "blpapi_Datetime_tag_milliSeconds_get", _wrap_blpapi_Datetime_tag_milliSeconds_get, METH_O, NULL}, - { "blpapi_Datetime_tag_month_set", _wrap_blpapi_Datetime_tag_month_set, METH_VARARGS, NULL}, - { "blpapi_Datetime_tag_month_get", _wrap_blpapi_Datetime_tag_month_get, METH_O, NULL}, - { "blpapi_Datetime_tag_day_set", _wrap_blpapi_Datetime_tag_day_set, METH_VARARGS, NULL}, - { "blpapi_Datetime_tag_day_get", _wrap_blpapi_Datetime_tag_day_get, METH_O, NULL}, - { "blpapi_Datetime_tag_year_set", _wrap_blpapi_Datetime_tag_year_set, METH_VARARGS, NULL}, - { "blpapi_Datetime_tag_year_get", _wrap_blpapi_Datetime_tag_year_get, METH_O, NULL}, - { "blpapi_Datetime_tag_offset_set", _wrap_blpapi_Datetime_tag_offset_set, METH_VARARGS, NULL}, - { "blpapi_Datetime_tag_offset_get", _wrap_blpapi_Datetime_tag_offset_get, METH_O, NULL}, - { "new_blpapi_Datetime_tag", _wrap_new_blpapi_Datetime_tag, METH_NOARGS, NULL}, - { "delete_blpapi_Datetime_tag", _wrap_delete_blpapi_Datetime_tag, METH_O, NULL}, - { "blpapi_Datetime_tag_swigregister", blpapi_Datetime_tag_swigregister, METH_O, NULL}, - { "blpapi_Datetime_tag_swiginit", blpapi_Datetime_tag_swiginit, METH_VARARGS, NULL}, - { "blpapi_HighPrecisionDatetime_tag_datetime_set", _wrap_blpapi_HighPrecisionDatetime_tag_datetime_set, METH_VARARGS, NULL}, - { "blpapi_HighPrecisionDatetime_tag_datetime_get", _wrap_blpapi_HighPrecisionDatetime_tag_datetime_get, METH_O, NULL}, - { "blpapi_HighPrecisionDatetime_tag_picoseconds_set", _wrap_blpapi_HighPrecisionDatetime_tag_picoseconds_set, METH_VARARGS, NULL}, - { "blpapi_HighPrecisionDatetime_tag_picoseconds_get", _wrap_blpapi_HighPrecisionDatetime_tag_picoseconds_get, METH_O, NULL}, - { "new_blpapi_HighPrecisionDatetime_tag", _wrap_new_blpapi_HighPrecisionDatetime_tag, METH_NOARGS, NULL}, - { "delete_blpapi_HighPrecisionDatetime_tag", _wrap_delete_blpapi_HighPrecisionDatetime_tag, METH_O, NULL}, - { "blpapi_HighPrecisionDatetime_tag_swigregister", blpapi_HighPrecisionDatetime_tag_swigregister, METH_O, NULL}, - { "blpapi_HighPrecisionDatetime_tag_swiginit", blpapi_HighPrecisionDatetime_tag_swiginit, METH_VARARGS, NULL}, - { "blpapi_HighPrecisionDatetime_compare", _wrap_blpapi_HighPrecisionDatetime_compare, METH_VARARGS, NULL}, - { "blpapi_HighPrecisionDatetime_print", _wrap_blpapi_HighPrecisionDatetime_print, METH_VARARGS, NULL}, - { "blpapi_HighPrecisionDatetime_fromTimePoint", _wrap_blpapi_HighPrecisionDatetime_fromTimePoint, METH_VARARGS, NULL}, - { "blpapi_Constant_name", _wrap_blpapi_Constant_name, METH_O, NULL}, - { "blpapi_Constant_description", _wrap_blpapi_Constant_description, METH_O, NULL}, - { "blpapi_Constant_status", _wrap_blpapi_Constant_status, METH_O, NULL}, - { "blpapi_Constant_datatype", _wrap_blpapi_Constant_datatype, METH_O, NULL}, - { "blpapi_Constant_getValueAsChar", _wrap_blpapi_Constant_getValueAsChar, METH_O, NULL}, - { "blpapi_Constant_getValueAsInt32", _wrap_blpapi_Constant_getValueAsInt32, METH_O, NULL}, - { "blpapi_Constant_getValueAsInt64", _wrap_blpapi_Constant_getValueAsInt64, METH_O, NULL}, - { "blpapi_Constant_getValueAsFloat32", _wrap_blpapi_Constant_getValueAsFloat32, METH_O, NULL}, - { "blpapi_Constant_getValueAsFloat64", _wrap_blpapi_Constant_getValueAsFloat64, METH_O, NULL}, - { "blpapi_Constant_getValueAsDatetime", _wrap_blpapi_Constant_getValueAsDatetime, METH_O, NULL}, - { "blpapi_Constant_getValueAsString", _wrap_blpapi_Constant_getValueAsString, METH_O, NULL}, - { "blpapi_ConstantList_name", _wrap_blpapi_ConstantList_name, METH_O, NULL}, - { "blpapi_ConstantList_description", _wrap_blpapi_ConstantList_description, METH_O, NULL}, - { "blpapi_ConstantList_numConstants", _wrap_blpapi_ConstantList_numConstants, METH_O, NULL}, - { "blpapi_ConstantList_datatype", _wrap_blpapi_ConstantList_datatype, METH_O, NULL}, - { "blpapi_ConstantList_status", _wrap_blpapi_ConstantList_status, METH_O, NULL}, - { "blpapi_ConstantList_getConstant", _wrap_blpapi_ConstantList_getConstant, METH_VARARGS, NULL}, - { "blpapi_ConstantList_getConstantAt", _wrap_blpapi_ConstantList_getConstantAt, METH_VARARGS, NULL}, - { "blpapi_SchemaElementDefinition_name", _wrap_blpapi_SchemaElementDefinition_name, METH_O, NULL}, - { "blpapi_SchemaElementDefinition_description", _wrap_blpapi_SchemaElementDefinition_description, METH_O, NULL}, - { "blpapi_SchemaElementDefinition_status", _wrap_blpapi_SchemaElementDefinition_status, METH_O, NULL}, - { "blpapi_SchemaElementDefinition_type", _wrap_blpapi_SchemaElementDefinition_type, METH_O, NULL}, - { "blpapi_SchemaElementDefinition_numAlternateNames", _wrap_blpapi_SchemaElementDefinition_numAlternateNames, METH_O, NULL}, - { "blpapi_SchemaElementDefinition_getAlternateName", _wrap_blpapi_SchemaElementDefinition_getAlternateName, METH_VARARGS, NULL}, - { "blpapi_SchemaElementDefinition_minValues", _wrap_blpapi_SchemaElementDefinition_minValues, METH_O, NULL}, - { "blpapi_SchemaElementDefinition_maxValues", _wrap_blpapi_SchemaElementDefinition_maxValues, METH_O, NULL}, - { "blpapi_SchemaTypeDefinition_name", _wrap_blpapi_SchemaTypeDefinition_name, METH_O, NULL}, - { "blpapi_SchemaTypeDefinition_description", _wrap_blpapi_SchemaTypeDefinition_description, METH_O, NULL}, - { "blpapi_SchemaTypeDefinition_status", _wrap_blpapi_SchemaTypeDefinition_status, METH_O, NULL}, - { "blpapi_SchemaTypeDefinition_datatype", _wrap_blpapi_SchemaTypeDefinition_datatype, METH_O, NULL}, - { "blpapi_SchemaTypeDefinition_isComplexType", _wrap_blpapi_SchemaTypeDefinition_isComplexType, METH_O, NULL}, - { "blpapi_SchemaTypeDefinition_isSimpleType", _wrap_blpapi_SchemaTypeDefinition_isSimpleType, METH_O, NULL}, - { "blpapi_SchemaTypeDefinition_isEnumerationType", _wrap_blpapi_SchemaTypeDefinition_isEnumerationType, METH_O, NULL}, - { "blpapi_SchemaTypeDefinition_numElementDefinitions", _wrap_blpapi_SchemaTypeDefinition_numElementDefinitions, METH_O, NULL}, - { "blpapi_SchemaTypeDefinition_getElementDefinition", _wrap_blpapi_SchemaTypeDefinition_getElementDefinition, METH_VARARGS, NULL}, - { "blpapi_SchemaTypeDefinition_getElementDefinitionAt", _wrap_blpapi_SchemaTypeDefinition_getElementDefinitionAt, METH_VARARGS, NULL}, - { "blpapi_SchemaTypeDefinition_enumeration", _wrap_blpapi_SchemaTypeDefinition_enumeration, METH_O, NULL}, - { "blpapi_Request_destroy", _wrap_blpapi_Request_destroy, METH_O, NULL}, - { "blpapi_Request_elements", _wrap_blpapi_Request_elements, METH_O, NULL}, - { "blpapi_Request_setPreferredRoute", _wrap_blpapi_Request_setPreferredRoute, METH_VARARGS, NULL}, - { "blpapi_Request_getRequestId", _wrap_blpapi_Request_getRequestId, METH_O, NULL}, - { "blpapi_RequestTemplate_release", _wrap_blpapi_RequestTemplate_release, METH_O, NULL}, - { "blpapi_Operation_name", _wrap_blpapi_Operation_name, METH_O, NULL}, - { "blpapi_Operation_description", _wrap_blpapi_Operation_description, METH_O, NULL}, - { "blpapi_Operation_requestDefinition", _wrap_blpapi_Operation_requestDefinition, METH_O, NULL}, - { "blpapi_Operation_numResponseDefinitions", _wrap_blpapi_Operation_numResponseDefinitions, METH_O, NULL}, - { "blpapi_Operation_responseDefinition", _wrap_blpapi_Operation_responseDefinition, METH_VARARGS, NULL}, - { "blpapi_Operation_responseDefinitionFromName", _wrap_blpapi_Operation_responseDefinitionFromName, METH_VARARGS, NULL}, - { "blpapi_Service_name", _wrap_blpapi_Service_name, METH_O, NULL}, - { "blpapi_Service_description", _wrap_blpapi_Service_description, METH_O, NULL}, - { "blpapi_Service_numOperations", _wrap_blpapi_Service_numOperations, METH_O, NULL}, - { "blpapi_Service_numEventDefinitions", _wrap_blpapi_Service_numEventDefinitions, METH_O, NULL}, - { "blpapi_Service_addRef", _wrap_blpapi_Service_addRef, METH_O, NULL}, - { "blpapi_Service_release", _wrap_blpapi_Service_release, METH_O, NULL}, - { "blpapi_Service_authorizationServiceName", _wrap_blpapi_Service_authorizationServiceName, METH_O, NULL}, - { "blpapi_Service_getOperation", _wrap_blpapi_Service_getOperation, METH_VARARGS, NULL}, - { "blpapi_Service_getOperationAt", _wrap_blpapi_Service_getOperationAt, METH_VARARGS, NULL}, - { "blpapi_Service_getEventDefinition", _wrap_blpapi_Service_getEventDefinition, METH_VARARGS, NULL}, - { "blpapi_Service_getEventDefinitionAt", _wrap_blpapi_Service_getEventDefinitionAt, METH_VARARGS, NULL}, - { "blpapi_Service_createRequest", _wrap_blpapi_Service_createRequest, METH_VARARGS, NULL}, - { "blpapi_Service_createAuthorizationRequest", _wrap_blpapi_Service_createAuthorizationRequest, METH_VARARGS, NULL}, - { "blpapi_Service_createPublishEvent", _wrap_blpapi_Service_createPublishEvent, METH_O, NULL}, - { "blpapi_Service_createAdminEvent", _wrap_blpapi_Service_createAdminEvent, METH_O, NULL}, - { "blpapi_Service_createResponseEvent", _wrap_blpapi_Service_createResponseEvent, METH_VARARGS, NULL}, - { "blpapi_Message_messageType", _wrap_blpapi_Message_messageType, METH_O, NULL}, - { "blpapi_Message_topicName", _wrap_blpapi_Message_topicName, METH_O, NULL}, - { "blpapi_Message_service", _wrap_blpapi_Message_service, METH_O, NULL}, - { "blpapi_Message_numCorrelationIds", _wrap_blpapi_Message_numCorrelationIds, METH_O, NULL}, - { "blpapi_Message_correlationId", _wrap_blpapi_Message_correlationId, METH_VARARGS, NULL}, - { "blpapi_Message_getRequestId", _wrap_blpapi_Message_getRequestId, METH_O, NULL}, - { "blpapi_Message_elements", _wrap_blpapi_Message_elements, METH_O, NULL}, - { "blpapi_Message_fragmentType", _wrap_blpapi_Message_fragmentType, METH_O, NULL}, - { "blpapi_Message_recapType", _wrap_blpapi_Message_recapType, METH_O, NULL}, - { "blpapi_Message_addRef", _wrap_blpapi_Message_addRef, METH_O, NULL}, - { "blpapi_Message_release", _wrap_blpapi_Message_release, METH_O, NULL}, - { "blpapi_Message_timeReceived", _wrap_blpapi_Message_timeReceived, METH_O, NULL}, - { "blpapi_Event_eventType", _wrap_blpapi_Event_eventType, METH_O, NULL}, - { "blpapi_Event_release", _wrap_blpapi_Event_release, METH_O, NULL}, - { "blpapi_EventQueue_create", _wrap_blpapi_EventQueue_create, METH_NOARGS, NULL}, - { "blpapi_EventQueue_destroy", _wrap_blpapi_EventQueue_destroy, METH_O, NULL}, - { "blpapi_EventQueue_nextEvent", _wrap_blpapi_EventQueue_nextEvent, METH_VARARGS, NULL}, - { "blpapi_EventQueue_purge", _wrap_blpapi_EventQueue_purge, METH_O, NULL}, - { "blpapi_EventQueue_tryNextEvent", _wrap_blpapi_EventQueue_tryNextEvent, METH_O, NULL}, - { "blpapi_MessageIterator_create", _wrap_blpapi_MessageIterator_create, METH_O, NULL}, - { "blpapi_MessageIterator_destroy", _wrap_blpapi_MessageIterator_destroy, METH_O, NULL}, - { "blpapi_MessageIterator_next", _wrap_blpapi_MessageIterator_next, METH_O, NULL}, - { "blpapi_Identity_release", _wrap_blpapi_Identity_release, METH_O, NULL}, - { "blpapi_Identity_addRef", _wrap_blpapi_Identity_addRef, METH_O, NULL}, - { "blpapi_Identity_hasEntitlements", _wrap_blpapi_Identity_hasEntitlements, METH_VARARGS, NULL}, - { "blpapi_Identity_isAuthorized", _wrap_blpapi_Identity_isAuthorized, METH_VARARGS, NULL}, - { "blpapi_Identity_getSeatType", _wrap_blpapi_Identity_getSeatType, METH_O, NULL}, - { "blpapi_HighResolutionClock_now", _wrap_blpapi_HighResolutionClock_now, METH_NOARGS, NULL}, - { "blpapi_AbstractSession_cancel", _wrap_blpapi_AbstractSession_cancel, METH_VARARGS, NULL}, - { "blpapi_AbstractSession_sendAuthorizationRequest", _wrap_blpapi_AbstractSession_sendAuthorizationRequest, METH_VARARGS, NULL}, - { "blpapi_AbstractSession_openService", _wrap_blpapi_AbstractSession_openService, METH_VARARGS, NULL}, - { "blpapi_AbstractSession_openServiceAsync", _wrap_blpapi_AbstractSession_openServiceAsync, METH_VARARGS, NULL}, - { "blpapi_AbstractSession_generateToken", _wrap_blpapi_AbstractSession_generateToken, METH_VARARGS, NULL}, - { "blpapi_AbstractSession_generateManualToken", _wrap_blpapi_AbstractSession_generateManualToken, METH_VARARGS, NULL}, - { "blpapi_AbstractSession_getService", _wrap_blpapi_AbstractSession_getService, METH_VARARGS, NULL}, - { "blpapi_AbstractSession_createIdentity", _wrap_blpapi_AbstractSession_createIdentity, METH_O, NULL}, - { "blpapi_AbstractSession_generateAuthorizedIdentityAsync", _wrap_blpapi_AbstractSession_generateAuthorizedIdentityAsync, METH_VARARGS, NULL}, - { "blpapi_AbstractSession_getAuthorizedIdentity", _wrap_blpapi_AbstractSession_getAuthorizedIdentity, METH_VARARGS, NULL}, - { "blpapi_AbstractSession_sessionName", _wrap_blpapi_AbstractSession_sessionName, METH_O, NULL}, - { "blpapi_Session_start", _wrap_blpapi_Session_start, METH_O, NULL}, - { "blpapi_Session_startAsync", _wrap_blpapi_Session_startAsync, METH_O, NULL}, - { "blpapi_Session_stop", _wrap_blpapi_Session_stop, METH_O, NULL}, - { "blpapi_Session_stopAsync", _wrap_blpapi_Session_stopAsync, METH_O, NULL}, - { "blpapi_Session_nextEvent", _wrap_blpapi_Session_nextEvent, METH_VARARGS, NULL}, - { "blpapi_Session_tryNextEvent", _wrap_blpapi_Session_tryNextEvent, METH_O, NULL}, - { "blpapi_Session_subscribe", _wrap_blpapi_Session_subscribe, METH_VARARGS, NULL}, - { "blpapi_Session_subscribeEx", _wrap_blpapi_Session_subscribeEx, METH_VARARGS, NULL}, - { "blpapi_Session_resubscribe", _wrap_blpapi_Session_resubscribe, METH_VARARGS, NULL}, - { "blpapi_Session_resubscribeEx", _wrap_blpapi_Session_resubscribeEx, METH_VARARGS, NULL}, - { "blpapi_Session_resubscribeWithId", _wrap_blpapi_Session_resubscribeWithId, METH_VARARGS, NULL}, - { "blpapi_Session_resubscribeWithIdEx", _wrap_blpapi_Session_resubscribeWithIdEx, METH_VARARGS, NULL}, - { "blpapi_Session_unsubscribe", _wrap_blpapi_Session_unsubscribe, METH_VARARGS, NULL}, - { "blpapi_Session_setStatusCorrelationId", _wrap_blpapi_Session_setStatusCorrelationId, METH_VARARGS, NULL}, - { "blpapi_Session_sendRequest", _wrap_blpapi_Session_sendRequest, METH_VARARGS, NULL}, - { "blpapi_Session_sendRequestTemplate", _wrap_blpapi_Session_sendRequestTemplate, METH_VARARGS, NULL}, - { "blpapi_Session_createSnapshotRequestTemplate", _wrap_blpapi_Session_createSnapshotRequestTemplate, METH_VARARGS, NULL}, - { "blpapi_Session_getAbstractSession", _wrap_blpapi_Session_getAbstractSession, METH_O, NULL}, - { "blpapi_ResolutionList_extractAttributeFromResolutionSuccess", _wrap_blpapi_ResolutionList_extractAttributeFromResolutionSuccess, METH_VARARGS, NULL}, - { "blpapi_ResolutionList_create", _wrap_blpapi_ResolutionList_create, METH_O, NULL}, - { "blpapi_ResolutionList_destroy", _wrap_blpapi_ResolutionList_destroy, METH_O, NULL}, - { "blpapi_ResolutionList_add", _wrap_blpapi_ResolutionList_add, METH_VARARGS, NULL}, - { "blpapi_ResolutionList_addFromMessage", _wrap_blpapi_ResolutionList_addFromMessage, METH_VARARGS, NULL}, - { "blpapi_ResolutionList_addAttribute", _wrap_blpapi_ResolutionList_addAttribute, METH_VARARGS, NULL}, - { "blpapi_ResolutionList_correlationIdAt", _wrap_blpapi_ResolutionList_correlationIdAt, METH_VARARGS, NULL}, - { "blpapi_ResolutionList_topicString", _wrap_blpapi_ResolutionList_topicString, METH_VARARGS, NULL}, - { "blpapi_ResolutionList_topicStringAt", _wrap_blpapi_ResolutionList_topicStringAt, METH_VARARGS, NULL}, - { "blpapi_ResolutionList_status", _wrap_blpapi_ResolutionList_status, METH_VARARGS, NULL}, - { "blpapi_ResolutionList_statusAt", _wrap_blpapi_ResolutionList_statusAt, METH_VARARGS, NULL}, - { "blpapi_ResolutionList_attribute", _wrap_blpapi_ResolutionList_attribute, METH_VARARGS, NULL}, - { "blpapi_ResolutionList_attributeAt", _wrap_blpapi_ResolutionList_attributeAt, METH_VARARGS, NULL}, - { "blpapi_ResolutionList_message", _wrap_blpapi_ResolutionList_message, METH_VARARGS, NULL}, - { "blpapi_ResolutionList_messageAt", _wrap_blpapi_ResolutionList_messageAt, METH_VARARGS, NULL}, - { "blpapi_ResolutionList_size", _wrap_blpapi_ResolutionList_size, METH_O, NULL}, - { "blpapi_TestUtil_createEvent", _wrap_blpapi_TestUtil_createEvent, METH_O, NULL}, - { "blpapi_TestUtil_deserializeService", _wrap_blpapi_TestUtil_deserializeService, METH_VARARGS, NULL}, - { "blpapi_TestUtil_serializeService", _wrap_blpapi_TestUtil_serializeService, METH_VARARGS, NULL}, - { "blpapi_TestUtil_appendMessage", _wrap_blpapi_TestUtil_appendMessage, METH_VARARGS, NULL}, - { "blpapi_TestUtil_createTopic", _wrap_blpapi_TestUtil_createTopic, METH_VARARGS, NULL}, - { "blpapi_TestUtil_getAdminMessageDefinition", _wrap_blpapi_TestUtil_getAdminMessageDefinition, METH_O, NULL}, - { "blpapi_MessageProperties_create", _wrap_blpapi_MessageProperties_create, METH_NOARGS, NULL}, - { "blpapi_MessageProperties_destroy", _wrap_blpapi_MessageProperties_destroy, METH_O, NULL}, - { "blpapi_MessageProperties_copy", _wrap_blpapi_MessageProperties_copy, METH_O, NULL}, - { "blpapi_MessageProperties_assign", _wrap_blpapi_MessageProperties_assign, METH_VARARGS, NULL}, - { "blpapi_MessageProperties_setCorrelationIds", _wrap_blpapi_MessageProperties_setCorrelationIds, METH_VARARGS, NULL}, - { "blpapi_MessageProperties_setRecapType", _wrap_blpapi_MessageProperties_setRecapType, METH_VARARGS, NULL}, - { "blpapi_MessageProperties_setTimeReceived", _wrap_blpapi_MessageProperties_setTimeReceived, METH_VARARGS, NULL}, - { "blpapi_MessageProperties_setService", _wrap_blpapi_MessageProperties_setService, METH_VARARGS, NULL}, - { "blpapi_MessageProperties_setRequestId", _wrap_blpapi_MessageProperties_setRequestId, METH_VARARGS, NULL}, - { "blpapi_Topic_create", _wrap_blpapi_Topic_create, METH_O, NULL}, - { "blpapi_Topic_destroy", _wrap_blpapi_Topic_destroy, METH_O, NULL}, - { "blpapi_Topic_compare", _wrap_blpapi_Topic_compare, METH_VARARGS, NULL}, - { "blpapi_Topic_service", _wrap_blpapi_Topic_service, METH_O, NULL}, - { "blpapi_Topic_isActive", _wrap_blpapi_Topic_isActive, METH_O, NULL}, - { "blpapi_TopicList_create", _wrap_blpapi_TopicList_create, METH_O, NULL}, - { "blpapi_TopicList_destroy", _wrap_blpapi_TopicList_destroy, METH_O, NULL}, - { "blpapi_TopicList_add", _wrap_blpapi_TopicList_add, METH_VARARGS, NULL}, - { "blpapi_TopicList_addFromMessage", _wrap_blpapi_TopicList_addFromMessage, METH_VARARGS, NULL}, - { "blpapi_TopicList_correlationIdAt", _wrap_blpapi_TopicList_correlationIdAt, METH_VARARGS, NULL}, - { "blpapi_TopicList_topicString", _wrap_blpapi_TopicList_topicString, METH_VARARGS, NULL}, - { "blpapi_TopicList_topicStringAt", _wrap_blpapi_TopicList_topicStringAt, METH_VARARGS, NULL}, - { "blpapi_TopicList_status", _wrap_blpapi_TopicList_status, METH_VARARGS, NULL}, - { "blpapi_TopicList_statusAt", _wrap_blpapi_TopicList_statusAt, METH_VARARGS, NULL}, - { "blpapi_TopicList_message", _wrap_blpapi_TopicList_message, METH_VARARGS, NULL}, - { "blpapi_TopicList_messageAt", _wrap_blpapi_TopicList_messageAt, METH_VARARGS, NULL}, - { "blpapi_TopicList_size", _wrap_blpapi_TopicList_size, METH_O, NULL}, - { "blpapi_ProviderSession_create", _wrap_blpapi_ProviderSession_create, METH_VARARGS, NULL}, - { "blpapi_ProviderSession_destroy", _wrap_blpapi_ProviderSession_destroy, METH_O, NULL}, - { "blpapi_ProviderSession_start", _wrap_blpapi_ProviderSession_start, METH_O, NULL}, - { "blpapi_ProviderSession_startAsync", _wrap_blpapi_ProviderSession_startAsync, METH_O, NULL}, - { "blpapi_ProviderSession_stop", _wrap_blpapi_ProviderSession_stop, METH_O, NULL}, - { "blpapi_ProviderSession_stopAsync", _wrap_blpapi_ProviderSession_stopAsync, METH_O, NULL}, - { "blpapi_ProviderSession_nextEvent", _wrap_blpapi_ProviderSession_nextEvent, METH_VARARGS, NULL}, - { "blpapi_ProviderSession_tryNextEvent", _wrap_blpapi_ProviderSession_tryNextEvent, METH_O, NULL}, - { "blpapi_ProviderSession_registerService", _wrap_blpapi_ProviderSession_registerService, METH_VARARGS, NULL}, - { "blpapi_ProviderSession_activateSubServiceCodeRange", _wrap_blpapi_ProviderSession_activateSubServiceCodeRange, METH_VARARGS, NULL}, - { "blpapi_ProviderSession_deactivateSubServiceCodeRange", _wrap_blpapi_ProviderSession_deactivateSubServiceCodeRange, METH_VARARGS, NULL}, - { "blpapi_ProviderSession_registerServiceAsync", _wrap_blpapi_ProviderSession_registerServiceAsync, METH_VARARGS, NULL}, - { "blpapi_ProviderSession_deregisterService", _wrap_blpapi_ProviderSession_deregisterService, METH_VARARGS, NULL}, - { "blpapi_ProviderSession_resolve", _wrap_blpapi_ProviderSession_resolve, METH_VARARGS, NULL}, - { "blpapi_ProviderSession_resolveAsync", _wrap_blpapi_ProviderSession_resolveAsync, METH_VARARGS, NULL}, - { "blpapi_ProviderSession_createTopics", _wrap_blpapi_ProviderSession_createTopics, METH_VARARGS, NULL}, - { "blpapi_ProviderSession_createTopicsAsync", _wrap_blpapi_ProviderSession_createTopicsAsync, METH_VARARGS, NULL}, - { "blpapi_ProviderSession_getTopic", _wrap_blpapi_ProviderSession_getTopic, METH_VARARGS, NULL}, - { "blpapi_ProviderSession_createTopic", _wrap_blpapi_ProviderSession_createTopic, METH_VARARGS, NULL}, - { "blpapi_ProviderSession_createServiceStatusTopic", _wrap_blpapi_ProviderSession_createServiceStatusTopic, METH_VARARGS, NULL}, - { "blpapi_ProviderSession_deleteTopics", _wrap_blpapi_ProviderSession_deleteTopics, METH_VARARGS, NULL}, - { "blpapi_ProviderSession_terminateSubscriptionsOnTopics", _wrap_blpapi_ProviderSession_terminateSubscriptionsOnTopics, METH_VARARGS, NULL}, - { "blpapi_ProviderSession_publish", _wrap_blpapi_ProviderSession_publish, METH_VARARGS, NULL}, - { "blpapi_ProviderSession_sendResponse", _wrap_blpapi_ProviderSession_sendResponse, METH_VARARGS, NULL}, - { "blpapi_ProviderSession_getAbstractSession", _wrap_blpapi_ProviderSession_getAbstractSession, METH_O, NULL}, - { "blpapi_ProviderSession_flushPublishedEvents", _wrap_blpapi_ProviderSession_flushPublishedEvents, METH_VARARGS, NULL}, - { "blpapi_ServiceRegistrationOptions_create", _wrap_blpapi_ServiceRegistrationOptions_create, METH_NOARGS, NULL}, - { "blpapi_ServiceRegistrationOptions_duplicate", _wrap_blpapi_ServiceRegistrationOptions_duplicate, METH_O, NULL}, - { "blpapi_ServiceRegistrationOptions_destroy", _wrap_blpapi_ServiceRegistrationOptions_destroy, METH_O, NULL}, - { "blpapi_ServiceRegistrationOptions_copy", _wrap_blpapi_ServiceRegistrationOptions_copy, METH_VARARGS, NULL}, - { "blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange", _wrap_blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange, METH_VARARGS, NULL}, - { "blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges", _wrap_blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges, METH_O, NULL}, - { "blpapi_ServiceRegistrationOptions_setGroupId", _wrap_blpapi_ServiceRegistrationOptions_setGroupId, METH_VARARGS, NULL}, - { "blpapi_ServiceRegistrationOptions_setServicePriority", _wrap_blpapi_ServiceRegistrationOptions_setServicePriority, METH_VARARGS, NULL}, - { "blpapi_ServiceRegistrationOptions_setPartsToRegister", _wrap_blpapi_ServiceRegistrationOptions_setPartsToRegister, METH_VARARGS, NULL}, - { "blpapi_ServiceRegistrationOptions_getGroupId", _wrap_blpapi_ServiceRegistrationOptions_getGroupId, METH_O, NULL}, - { "blpapi_ServiceRegistrationOptions_getServicePriority", _wrap_blpapi_ServiceRegistrationOptions_getServicePriority, METH_O, NULL}, - { "blpapi_ServiceRegistrationOptions_getPartsToRegister", _wrap_blpapi_ServiceRegistrationOptions_getPartsToRegister, METH_O, NULL}, - { "blpapi_ZfpUtil_getOptionsForLeasedLines", _wrap_blpapi_ZfpUtil_getOptionsForLeasedLines, METH_VARARGS, NULL}, - { NULL, NULL, 0, NULL } -}; - -static PyMethodDef SwigMethods_proxydocs[] = { - { NULL, NULL, 0, NULL } -}; - - -/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ - -static void *_p_intArrayTo_p_int(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((int *) ((intArray *) x)); -} -static swig_type_info _swigt__p_blpapi_AbstractSession = {"_p_blpapi_AbstractSession", "struct blpapi_AbstractSession *|blpapi_AbstractSession_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_AuthApplication = {"_p_blpapi_AuthApplication", "blpapi_AuthApplication_t *|struct blpapi_AuthApplication *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_AuthOptions = {"_p_blpapi_AuthOptions", "struct blpapi_AuthOptions *|blpapi_AuthOptions_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_AuthToken = {"_p_blpapi_AuthToken", "blpapi_AuthToken_t *|struct blpapi_AuthToken *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_AuthUser = {"_p_blpapi_AuthUser", "struct blpapi_AuthUser *|blpapi_AuthUser_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_Constant = {"_p_blpapi_Constant", "struct blpapi_Constant *|blpapi_Constant_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_ConstantList = {"_p_blpapi_ConstantList", "struct blpapi_ConstantList *|blpapi_ConstantList_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_CorrelationId_t_ = {"_p_blpapi_CorrelationId_t_", "struct blpapi_CorrelationId_t_ *|blpapi_CorrelationId_t_ *|blpapi_CorrelationId_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_CorrelationId_t__value = {"_p_blpapi_CorrelationId_t__value", "blpapi_CorrelationId_t__value *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_Datetime_tag = {"_p_blpapi_Datetime_tag", "blpapi_Datetime_t *|struct blpapi_Datetime_tag *|blpapi_Datetime_tag *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_Element = {"_p_blpapi_Element", "blpapi_Element_t *|struct blpapi_Element *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_Event = {"_p_blpapi_Event", "struct blpapi_Event *|blpapi_Event_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_EventDispatcher = {"_p_blpapi_EventDispatcher", "struct blpapi_EventDispatcher *|blpapi_EventDispatcher_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_EventFormatter = {"_p_blpapi_EventFormatter", "struct blpapi_EventFormatter *|blpapi_EventFormatter_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_EventQueue = {"_p_blpapi_EventQueue", "struct blpapi_EventQueue *|blpapi_EventQueue_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_HighPrecisionDatetime_tag = {"_p_blpapi_HighPrecisionDatetime_tag", "blpapi_HighPrecisionDatetime_t *|struct blpapi_HighPrecisionDatetime_tag *|blpapi_HighPrecisionDatetime_tag *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_Identity = {"_p_blpapi_Identity", "struct blpapi_Identity *|blpapi_UserHandle_t *|blpapi_UserHandle *|blpapi_Identity_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_Logging_Func_t = {"_p_blpapi_Logging_Func_t", "blpapi_Logging_Func_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_Logging_Severity_t = {"_p_blpapi_Logging_Severity_t", "enum blpapi_Logging_Severity_t *|blpapi_Logging_Severity_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_ManagedPtr_t_ = {"_p_blpapi_ManagedPtr_t_", "blpapi_ManagedPtr_t *|struct blpapi_ManagedPtr_t_ *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_Message = {"_p_blpapi_Message", "struct blpapi_Message *|blpapi_Message_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_MessageFormatter = {"_p_blpapi_MessageFormatter", "struct blpapi_MessageFormatter *|blpapi_MessageFormatter_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_MessageIterator = {"_p_blpapi_MessageIterator", "struct blpapi_MessageIterator *|blpapi_MessageIterator_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_MessageProperties = {"_p_blpapi_MessageProperties", "blpapi_MessageProperties_t *|struct blpapi_MessageProperties *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_Name = {"_p_blpapi_Name", "struct blpapi_Name *|blpapi_Name_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_Operation = {"_p_blpapi_Operation", "blpapi_Operation_t *|struct blpapi_Operation *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_ProviderSession = {"_p_blpapi_ProviderSession", "struct blpapi_ProviderSession *|blpapi_ProviderSession_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_Request = {"_p_blpapi_Request", "struct blpapi_Request *|blpapi_Request_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_RequestTemplate = {"_p_blpapi_RequestTemplate", "blpapi_RequestTemplate_t *|struct blpapi_RequestTemplate *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_ResolutionList = {"_p_blpapi_ResolutionList", "struct blpapi_ResolutionList *|blpapi_ResolutionList_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_SchemaElementDefinition = {"_p_blpapi_SchemaElementDefinition", "blpapi_SchemaElementDefinition_t *|struct blpapi_SchemaElementDefinition *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_Service = {"_p_blpapi_Service", "blpapi_Service_t *|struct blpapi_Service *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_ServiceRegistrationOptions = {"_p_blpapi_ServiceRegistrationOptions", "struct blpapi_ServiceRegistrationOptions *|blpapi_ServiceRegistrationOptions_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_Session = {"_p_blpapi_Session", "struct blpapi_Session *|blpapi_Session_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_SessionOptions = {"_p_blpapi_SessionOptions", "struct blpapi_SessionOptions *|blpapi_SessionOptions_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_Socks5Config = {"_p_blpapi_Socks5Config", "struct blpapi_Socks5Config *|blpapi_Socks5Config_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_StreamWriter_t = {"_p_blpapi_StreamWriter_t", "blpapi_StreamWriter_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_SubscriptionItrerator = {"_p_blpapi_SubscriptionItrerator", "struct blpapi_SubscriptionItrerator *|blpapi_SubscriptionIterator_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_SubscriptionList = {"_p_blpapi_SubscriptionList", "struct blpapi_SubscriptionList *|blpapi_SubscriptionList_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_TimePoint = {"_p_blpapi_TimePoint", "blpapi_TimePoint_t *|struct blpapi_TimePoint *|blpapi_TimePoint *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_TlsOptions = {"_p_blpapi_TlsOptions", "struct blpapi_TlsOptions *|blpapi_TlsOptions_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_Topic = {"_p_blpapi_Topic", "struct blpapi_Topic *|blpapi_Topic_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_blpapi_TopicList = {"_p_blpapi_TopicList", "struct blpapi_TopicList *|blpapi_TopicList_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_char = {"_p_char", "char *|blpapi_Char_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_double = {"_p_double", "blpapi_Float64_t *|double *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_f_p_q_const__struct_blpapi_CorrelationId_t__p_q_const__char_int_p_q_const__char_p_void__void = {"_p_f_p_q_const__struct_blpapi_CorrelationId_t__p_q_const__char_int_p_q_const__char_p_void__void", "void (*)(struct blpapi_CorrelationId_t_ const *,char const *,int,char const *,void *)|blpapi_SubscriptionPreprocessErrorHandler_t", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_f_p_struct_blpapi_Event_p_struct_blpapi_ProviderSession_p_void__void = {"_p_f_p_struct_blpapi_Event_p_struct_blpapi_ProviderSession_p_void__void", "void (*)(struct blpapi_Event *,struct blpapi_ProviderSession *,void *)|blpapi_ProviderEventHandler_t", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_float = {"_p_float", "blpapi_Float32_t *|float *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_int = {"_p_int", "blpapi_Bool_t *|int *|blpapi_Int32_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_intArray = {"_p_intArray", "intArray *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_long_long = {"_p_long_long", "blpapi_Int64_t *|long long *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_blpapi_AuthApplication = {"_p_p_blpapi_AuthApplication", "struct blpapi_AuthApplication **|blpapi_AuthApplication_t **", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_blpapi_AuthOptions = {"_p_p_blpapi_AuthOptions", "blpapi_AuthOptions_t **|struct blpapi_AuthOptions **", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_blpapi_AuthToken = {"_p_p_blpapi_AuthToken", "blpapi_AuthToken_t **|struct blpapi_AuthToken **", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_blpapi_AuthUser = {"_p_p_blpapi_AuthUser", "blpapi_AuthUser_t **|struct blpapi_AuthUser **", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_blpapi_Element = {"_p_p_blpapi_Element", "struct blpapi_Element **|blpapi_Element_t **", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_blpapi_Event = {"_p_p_blpapi_Event", "struct blpapi_Event **|blpapi_Event_t **", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_blpapi_Identity = {"_p_p_blpapi_Identity", "blpapi_Identity_t **|struct blpapi_Identity **", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_blpapi_Message = {"_p_p_blpapi_Message", "blpapi_Message_t **|struct blpapi_Message **", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_blpapi_MessageFormatter = {"_p_p_blpapi_MessageFormatter", "struct blpapi_MessageFormatter **|blpapi_MessageFormatter_t **", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_blpapi_MessageProperties = {"_p_p_blpapi_MessageProperties", "struct blpapi_MessageProperties **|blpapi_MessageProperties_t **", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_blpapi_Name = {"_p_p_blpapi_Name", "struct blpapi_Name **|blpapi_Name_t **", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_blpapi_Operation = {"_p_p_blpapi_Operation", "struct blpapi_Operation **|blpapi_Operation_t **", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_blpapi_Request = {"_p_p_blpapi_Request", "blpapi_Request_t **|struct blpapi_Request **", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_blpapi_RequestTemplate = {"_p_p_blpapi_RequestTemplate", "struct blpapi_RequestTemplate **|blpapi_RequestTemplate_t **", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_blpapi_SchemaElementDefinition = {"_p_p_blpapi_SchemaElementDefinition", "struct blpapi_SchemaElementDefinition **|blpapi_SchemaElementDefinition_t **", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_blpapi_Service = {"_p_p_blpapi_Service", "blpapi_Service_t **|struct blpapi_Service **", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_blpapi_Topic = {"_p_p_blpapi_Topic", "struct blpapi_Topic **|blpapi_Topic_t **", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_void = {"_p_p_void", "blpapi_SchemaTypeDefinition_t *|void **", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_short = {"_p_short", "short *|blpapi_Int16_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_size_t = {"_p_size_t", "size_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "unsigned char *|blpapi_UChar_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_unsigned_int = {"_p_unsigned_int", "blpapi_UInt32_t *|unsigned int *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_unsigned_long_long = {"_p_unsigned_long_long", "blpapi_UInt64_t *|unsigned long long *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_unsigned_short = {"_p_unsigned_short", "unsigned short *|blpapi_UInt16_t *", 0, 0, (void*)0, 0}; - -static swig_type_info *swig_type_initial[] = { - &_swigt__p_blpapi_AbstractSession, - &_swigt__p_blpapi_AuthApplication, - &_swigt__p_blpapi_AuthOptions, - &_swigt__p_blpapi_AuthToken, - &_swigt__p_blpapi_AuthUser, - &_swigt__p_blpapi_Constant, - &_swigt__p_blpapi_ConstantList, - &_swigt__p_blpapi_CorrelationId_t_, - &_swigt__p_blpapi_CorrelationId_t__value, - &_swigt__p_blpapi_Datetime_tag, - &_swigt__p_blpapi_Element, - &_swigt__p_blpapi_Event, - &_swigt__p_blpapi_EventDispatcher, - &_swigt__p_blpapi_EventFormatter, - &_swigt__p_blpapi_EventQueue, - &_swigt__p_blpapi_HighPrecisionDatetime_tag, - &_swigt__p_blpapi_Identity, - &_swigt__p_blpapi_Logging_Func_t, - &_swigt__p_blpapi_Logging_Severity_t, - &_swigt__p_blpapi_ManagedPtr_t_, - &_swigt__p_blpapi_Message, - &_swigt__p_blpapi_MessageFormatter, - &_swigt__p_blpapi_MessageIterator, - &_swigt__p_blpapi_MessageProperties, - &_swigt__p_blpapi_Name, - &_swigt__p_blpapi_Operation, - &_swigt__p_blpapi_ProviderSession, - &_swigt__p_blpapi_Request, - &_swigt__p_blpapi_RequestTemplate, - &_swigt__p_blpapi_ResolutionList, - &_swigt__p_blpapi_SchemaElementDefinition, - &_swigt__p_blpapi_Service, - &_swigt__p_blpapi_ServiceRegistrationOptions, - &_swigt__p_blpapi_Session, - &_swigt__p_blpapi_SessionOptions, - &_swigt__p_blpapi_Socks5Config, - &_swigt__p_blpapi_StreamWriter_t, - &_swigt__p_blpapi_SubscriptionItrerator, - &_swigt__p_blpapi_SubscriptionList, - &_swigt__p_blpapi_TimePoint, - &_swigt__p_blpapi_TlsOptions, - &_swigt__p_blpapi_Topic, - &_swigt__p_blpapi_TopicList, - &_swigt__p_char, - &_swigt__p_double, - &_swigt__p_f_p_q_const__struct_blpapi_CorrelationId_t__p_q_const__char_int_p_q_const__char_p_void__void, - &_swigt__p_f_p_struct_blpapi_Event_p_struct_blpapi_ProviderSession_p_void__void, - &_swigt__p_float, - &_swigt__p_int, - &_swigt__p_intArray, - &_swigt__p_long_long, - &_swigt__p_p_blpapi_AuthApplication, - &_swigt__p_p_blpapi_AuthOptions, - &_swigt__p_p_blpapi_AuthToken, - &_swigt__p_p_blpapi_AuthUser, - &_swigt__p_p_blpapi_Element, - &_swigt__p_p_blpapi_Event, - &_swigt__p_p_blpapi_Identity, - &_swigt__p_p_blpapi_Message, - &_swigt__p_p_blpapi_MessageFormatter, - &_swigt__p_p_blpapi_MessageProperties, - &_swigt__p_p_blpapi_Name, - &_swigt__p_p_blpapi_Operation, - &_swigt__p_p_blpapi_Request, - &_swigt__p_p_blpapi_RequestTemplate, - &_swigt__p_p_blpapi_SchemaElementDefinition, - &_swigt__p_p_blpapi_Service, - &_swigt__p_p_blpapi_Topic, - &_swigt__p_p_char, - &_swigt__p_p_void, - &_swigt__p_short, - &_swigt__p_size_t, - &_swigt__p_unsigned_char, - &_swigt__p_unsigned_int, - &_swigt__p_unsigned_long_long, - &_swigt__p_unsigned_short, -}; - -static swig_cast_info _swigc__p_blpapi_AbstractSession[] = { {&_swigt__p_blpapi_AbstractSession, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_AuthApplication[] = { {&_swigt__p_blpapi_AuthApplication, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_AuthOptions[] = { {&_swigt__p_blpapi_AuthOptions, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_AuthToken[] = { {&_swigt__p_blpapi_AuthToken, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_AuthUser[] = { {&_swigt__p_blpapi_AuthUser, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_Constant[] = { {&_swigt__p_blpapi_Constant, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_ConstantList[] = { {&_swigt__p_blpapi_ConstantList, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_CorrelationId_t_[] = { {&_swigt__p_blpapi_CorrelationId_t_, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_CorrelationId_t__value[] = { {&_swigt__p_blpapi_CorrelationId_t__value, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_Datetime_tag[] = { {&_swigt__p_blpapi_Datetime_tag, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_Element[] = { {&_swigt__p_blpapi_Element, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_Event[] = { {&_swigt__p_blpapi_Event, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_EventDispatcher[] = { {&_swigt__p_blpapi_EventDispatcher, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_EventFormatter[] = { {&_swigt__p_blpapi_EventFormatter, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_EventQueue[] = { {&_swigt__p_blpapi_EventQueue, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_HighPrecisionDatetime_tag[] = { {&_swigt__p_blpapi_HighPrecisionDatetime_tag, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_Identity[] = { {&_swigt__p_blpapi_Identity, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_Logging_Func_t[] = { {&_swigt__p_blpapi_Logging_Func_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_Logging_Severity_t[] = { {&_swigt__p_blpapi_Logging_Severity_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_ManagedPtr_t_[] = { {&_swigt__p_blpapi_ManagedPtr_t_, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_Message[] = { {&_swigt__p_blpapi_Message, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_MessageFormatter[] = { {&_swigt__p_blpapi_MessageFormatter, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_MessageIterator[] = { {&_swigt__p_blpapi_MessageIterator, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_MessageProperties[] = { {&_swigt__p_blpapi_MessageProperties, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_Name[] = { {&_swigt__p_blpapi_Name, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_Operation[] = { {&_swigt__p_blpapi_Operation, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_ProviderSession[] = { {&_swigt__p_blpapi_ProviderSession, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_Request[] = { {&_swigt__p_blpapi_Request, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_RequestTemplate[] = { {&_swigt__p_blpapi_RequestTemplate, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_ResolutionList[] = { {&_swigt__p_blpapi_ResolutionList, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_SchemaElementDefinition[] = { {&_swigt__p_blpapi_SchemaElementDefinition, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_Service[] = { {&_swigt__p_blpapi_Service, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_ServiceRegistrationOptions[] = { {&_swigt__p_blpapi_ServiceRegistrationOptions, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_Session[] = { {&_swigt__p_blpapi_Session, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_SessionOptions[] = { {&_swigt__p_blpapi_SessionOptions, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_Socks5Config[] = { {&_swigt__p_blpapi_Socks5Config, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_StreamWriter_t[] = { {&_swigt__p_blpapi_StreamWriter_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_SubscriptionItrerator[] = { {&_swigt__p_blpapi_SubscriptionItrerator, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_SubscriptionList[] = { {&_swigt__p_blpapi_SubscriptionList, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_TimePoint[] = { {&_swigt__p_blpapi_TimePoint, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_TlsOptions[] = { {&_swigt__p_blpapi_TlsOptions, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_Topic[] = { {&_swigt__p_blpapi_Topic, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_blpapi_TopicList[] = { {&_swigt__p_blpapi_TopicList, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_double[] = { {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_f_p_q_const__struct_blpapi_CorrelationId_t__p_q_const__char_int_p_q_const__char_p_void__void[] = { {&_swigt__p_f_p_q_const__struct_blpapi_CorrelationId_t__p_q_const__char_int_p_q_const__char_p_void__void, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_f_p_struct_blpapi_Event_p_struct_blpapi_ProviderSession_p_void__void[] = { {&_swigt__p_f_p_struct_blpapi_Event_p_struct_blpapi_ProviderSession_p_void__void, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_float[] = { {&_swigt__p_float, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_int[] = { {&_swigt__p_intArray, _p_intArrayTo_p_int, 0, 0}, {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_intArray[] = { {&_swigt__p_intArray, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_long_long[] = { {&_swigt__p_long_long, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_blpapi_AuthApplication[] = { {&_swigt__p_p_blpapi_AuthApplication, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_blpapi_AuthOptions[] = { {&_swigt__p_p_blpapi_AuthOptions, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_blpapi_AuthToken[] = { {&_swigt__p_p_blpapi_AuthToken, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_blpapi_AuthUser[] = { {&_swigt__p_p_blpapi_AuthUser, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_blpapi_Element[] = { {&_swigt__p_p_blpapi_Element, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_blpapi_Event[] = { {&_swigt__p_p_blpapi_Event, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_blpapi_Identity[] = { {&_swigt__p_p_blpapi_Identity, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_blpapi_Message[] = { {&_swigt__p_p_blpapi_Message, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_blpapi_MessageFormatter[] = { {&_swigt__p_p_blpapi_MessageFormatter, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_blpapi_MessageProperties[] = { {&_swigt__p_p_blpapi_MessageProperties, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_blpapi_Name[] = { {&_swigt__p_p_blpapi_Name, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_blpapi_Operation[] = { {&_swigt__p_p_blpapi_Operation, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_blpapi_Request[] = { {&_swigt__p_p_blpapi_Request, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_blpapi_RequestTemplate[] = { {&_swigt__p_p_blpapi_RequestTemplate, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_blpapi_SchemaElementDefinition[] = { {&_swigt__p_p_blpapi_SchemaElementDefinition, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_blpapi_Service[] = { {&_swigt__p_p_blpapi_Service, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_blpapi_Topic[] = { {&_swigt__p_p_blpapi_Topic, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_char[] = { {&_swigt__p_p_char, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_void[] = { {&_swigt__p_p_void, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_short[] = { {&_swigt__p_short, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_size_t[] = { {&_swigt__p_size_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_unsigned_char[] = { {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_unsigned_int[] = { {&_swigt__p_unsigned_int, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_unsigned_long_long[] = { {&_swigt__p_unsigned_long_long, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_unsigned_short[] = { {&_swigt__p_unsigned_short, 0, 0, 0},{0, 0, 0, 0}}; - -static swig_cast_info *swig_cast_initial[] = { - _swigc__p_blpapi_AbstractSession, - _swigc__p_blpapi_AuthApplication, - _swigc__p_blpapi_AuthOptions, - _swigc__p_blpapi_AuthToken, - _swigc__p_blpapi_AuthUser, - _swigc__p_blpapi_Constant, - _swigc__p_blpapi_ConstantList, - _swigc__p_blpapi_CorrelationId_t_, - _swigc__p_blpapi_CorrelationId_t__value, - _swigc__p_blpapi_Datetime_tag, - _swigc__p_blpapi_Element, - _swigc__p_blpapi_Event, - _swigc__p_blpapi_EventDispatcher, - _swigc__p_blpapi_EventFormatter, - _swigc__p_blpapi_EventQueue, - _swigc__p_blpapi_HighPrecisionDatetime_tag, - _swigc__p_blpapi_Identity, - _swigc__p_blpapi_Logging_Func_t, - _swigc__p_blpapi_Logging_Severity_t, - _swigc__p_blpapi_ManagedPtr_t_, - _swigc__p_blpapi_Message, - _swigc__p_blpapi_MessageFormatter, - _swigc__p_blpapi_MessageIterator, - _swigc__p_blpapi_MessageProperties, - _swigc__p_blpapi_Name, - _swigc__p_blpapi_Operation, - _swigc__p_blpapi_ProviderSession, - _swigc__p_blpapi_Request, - _swigc__p_blpapi_RequestTemplate, - _swigc__p_blpapi_ResolutionList, - _swigc__p_blpapi_SchemaElementDefinition, - _swigc__p_blpapi_Service, - _swigc__p_blpapi_ServiceRegistrationOptions, - _swigc__p_blpapi_Session, - _swigc__p_blpapi_SessionOptions, - _swigc__p_blpapi_Socks5Config, - _swigc__p_blpapi_StreamWriter_t, - _swigc__p_blpapi_SubscriptionItrerator, - _swigc__p_blpapi_SubscriptionList, - _swigc__p_blpapi_TimePoint, - _swigc__p_blpapi_TlsOptions, - _swigc__p_blpapi_Topic, - _swigc__p_blpapi_TopicList, - _swigc__p_char, - _swigc__p_double, - _swigc__p_f_p_q_const__struct_blpapi_CorrelationId_t__p_q_const__char_int_p_q_const__char_p_void__void, - _swigc__p_f_p_struct_blpapi_Event_p_struct_blpapi_ProviderSession_p_void__void, - _swigc__p_float, - _swigc__p_int, - _swigc__p_intArray, - _swigc__p_long_long, - _swigc__p_p_blpapi_AuthApplication, - _swigc__p_p_blpapi_AuthOptions, - _swigc__p_p_blpapi_AuthToken, - _swigc__p_p_blpapi_AuthUser, - _swigc__p_p_blpapi_Element, - _swigc__p_p_blpapi_Event, - _swigc__p_p_blpapi_Identity, - _swigc__p_p_blpapi_Message, - _swigc__p_p_blpapi_MessageFormatter, - _swigc__p_p_blpapi_MessageProperties, - _swigc__p_p_blpapi_Name, - _swigc__p_p_blpapi_Operation, - _swigc__p_p_blpapi_Request, - _swigc__p_p_blpapi_RequestTemplate, - _swigc__p_p_blpapi_SchemaElementDefinition, - _swigc__p_p_blpapi_Service, - _swigc__p_p_blpapi_Topic, - _swigc__p_p_char, - _swigc__p_p_void, - _swigc__p_short, - _swigc__p_size_t, - _swigc__p_unsigned_char, - _swigc__p_unsigned_int, - _swigc__p_unsigned_long_long, - _swigc__p_unsigned_short, -}; - - -/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */ - -static swig_const_info swig_const_table[] = { -{0, 0, 0, 0.0, 0, 0}}; - -#ifdef __cplusplus -} -#endif -/* ----------------------------------------------------------------------------- - * Type initialization: - * This problem is tough by the requirement that no dynamic - * memory is used. Also, since swig_type_info structures store pointers to - * swig_cast_info structures and swig_cast_info structures store pointers back - * to swig_type_info structures, we need some lookup code at initialization. - * The idea is that swig generates all the structures that are needed. - * The runtime then collects these partially filled structures. - * The SWIG_InitializeModule function takes these initial arrays out of - * swig_module, and does all the lookup, filling in the swig_module.types - * array with the correct data and linking the correct swig_cast_info - * structures together. - * - * The generated swig_type_info structures are assigned statically to an initial - * array. We just loop through that array, and handle each type individually. - * First we lookup if this type has been already loaded, and if so, use the - * loaded structure instead of the generated one. Then we have to fill in the - * cast linked list. The cast data is initially stored in something like a - * two-dimensional array. Each row corresponds to a type (there are the same - * number of rows as there are in the swig_type_initial array). Each entry in - * a column is one of the swig_cast_info structures for that type. - * The cast_initial array is actually an array of arrays, because each row has - * a variable number of columns. So to actually build the cast linked list, - * we find the array of casts associated with the type, and loop through it - * adding the casts to the list. The one last trick we need to do is making - * sure the type pointer in the swig_cast_info struct is correct. - * - * First off, we lookup the cast->type name to see if it is already loaded. - * There are three cases to handle: - * 1) If the cast->type has already been loaded AND the type we are adding - * casting info to has not been loaded (it is in this module), THEN we - * replace the cast->type pointer with the type pointer that has already - * been loaded. - * 2) If BOTH types (the one we are adding casting info to, and the - * cast->type) are loaded, THEN the cast info has already been loaded by - * the previous module so we just ignore it. - * 3) Finally, if cast->type has not already been loaded, then we add that - * swig_cast_info to the linked list (because the cast->type) pointer will - * be correct. - * ----------------------------------------------------------------------------- */ - -#ifdef __cplusplus -extern "C" { -#if 0 -} /* c-mode */ -#endif -#endif - -#if 0 -#define SWIGRUNTIME_DEBUG -#endif - - -SWIGRUNTIME void -SWIG_InitializeModule(void *clientdata) { - size_t i; - swig_module_info *module_head, *iter; - int init; - - /* check to see if the circular list has been setup, if not, set it up */ - if (swig_module.next==0) { - /* Initialize the swig_module */ - swig_module.type_initial = swig_type_initial; - swig_module.cast_initial = swig_cast_initial; - swig_module.next = &swig_module; - init = 1; - } else { - init = 0; - } - - /* Try and load any already created modules */ - module_head = SWIG_GetModule(clientdata); - if (!module_head) { - /* This is the first module loaded for this interpreter */ - /* so set the swig module into the interpreter */ - SWIG_SetModule(clientdata, &swig_module); - } else { - /* the interpreter has loaded a SWIG module, but has it loaded this one? */ - iter=module_head; - do { - if (iter==&swig_module) { - /* Our module is already in the list, so there's nothing more to do. */ - return; - } - iter=iter->next; - } while (iter!= module_head); - - /* otherwise we must add our module into the list */ - swig_module.next = module_head->next; - module_head->next = &swig_module; - } - - /* When multiple interpreters are used, a module could have already been initialized in - a different interpreter, but not yet have a pointer in this interpreter. - In this case, we do not want to continue adding types... everything should be - set up already */ - if (init == 0) return; - - /* Now work on filling in swig_module.types */ -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: size %lu\n", (unsigned long)swig_module.size); -#endif - for (i = 0; i < swig_module.size; ++i) { - swig_type_info *type = 0; - swig_type_info *ret; - swig_cast_info *cast; - -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name); -#endif - - /* if there is another module already loaded */ - if (swig_module.next != &swig_module) { - type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name); - } - if (type) { - /* Overwrite clientdata field */ -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: found type %s\n", type->name); -#endif - if (swig_module.type_initial[i]->clientdata) { - type->clientdata = swig_module.type_initial[i]->clientdata; -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name); -#endif - } - } else { - type = swig_module.type_initial[i]; - } - - /* Insert casting types */ - cast = swig_module.cast_initial[i]; - while (cast->type) { - /* Don't need to add information already in the list */ - ret = 0; -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: look cast %s\n", cast->type->name); -#endif - if (swig_module.next != &swig_module) { - ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name); -#ifdef SWIGRUNTIME_DEBUG - if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name); -#endif - } - if (ret) { - if (type == swig_module.type_initial[i]) { -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: skip old type %s\n", ret->name); -#endif - cast->type = ret; - ret = 0; - } else { - /* Check for casting already in the list */ - swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type); -#ifdef SWIGRUNTIME_DEBUG - if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name); -#endif - if (!ocast) ret = 0; - } - } - - if (!ret) { -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name); -#endif - if (type->cast) { - type->cast->prev = cast; - cast->next = type->cast; - } - type->cast = cast; - } - cast++; - } - /* Set entry in modules->types array equal to the type */ - swig_module.types[i] = type; - } - swig_module.types[i] = 0; - -#ifdef SWIGRUNTIME_DEBUG - printf("**** SWIG_InitializeModule: Cast List ******\n"); - for (i = 0; i < swig_module.size; ++i) { - int j = 0; - swig_cast_info *cast = swig_module.cast_initial[i]; - printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name); - while (cast->type) { - printf("SWIG_InitializeModule: cast type %s\n", cast->type->name); - cast++; - ++j; - } - printf("---- Total casts: %d\n",j); - } - printf("**** SWIG_InitializeModule: Cast List ******\n"); -#endif -} - -/* This function will propagate the clientdata field of type to -* any new swig_type_info structures that have been added into the list -* of equivalent types. It is like calling -* SWIG_TypeClientData(type, clientdata) a second time. -*/ -SWIGRUNTIME void -SWIG_PropagateClientData(void) { - size_t i; - swig_cast_info *equiv; - static int init_run = 0; - - if (init_run) return; - init_run = 1; - - for (i = 0; i < swig_module.size; i++) { - if (swig_module.types[i]->clientdata) { - equiv = swig_module.types[i]->cast; - while (equiv) { - if (!equiv->converter) { - if (equiv->type && !equiv->type->clientdata) - SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata); - } - equiv = equiv->next; - } - } - } -} - -#ifdef __cplusplus -#if 0 -{ - /* c-mode */ -#endif -} -#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(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 - * ----------------------------------------------------------------------------- */ - - /* Install Constants */ - SWIGINTERN void - SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) { - PyObject *obj = 0; - size_t i; - for (i = 0; constants[i].type; ++i) { - switch(constants[i].type) { - case SWIG_PY_POINTER: - obj = SWIG_InternalNewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0); - break; - case SWIG_PY_BINARY: - obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype)); - break; - default: - obj = 0; - break; - } - if (obj) { - PyDict_SetItemString(d, constants[i].name, obj); - Py_DECREF(obj); - } - } - } - - /* -----------------------------------------------------------------------------*/ - /* Fix SwigMethods to carry the callback ptrs when needed */ - /* -----------------------------------------------------------------------------*/ - - SWIGINTERN void - SWIG_Python_FixMethods(PyMethodDef *methods, - 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; - if (!c) continue; - c = strstr(c, "swig_ptr: "); - if (c) { - int j; - 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, - strlen(const_table[j].name)) == 0) { - ci = &(const_table[j]); - break; - } - } - if (ci) { - void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0; - if (ptr) { - size_t shift = (ci->ptype) - types; - swig_type_info *ty = types_initial[shift]; - size_t ldoc = (c - methods[i].ml_doc); - size_t lptr = strlen(ty->name)+2*sizeof(void*)+2; - char *ndoc = (char*)malloc(ldoc + lptr + 10); - if (ndoc) { - char *buff = ndoc; - memcpy(buff, methods[i].ml_doc, ldoc); - buff += ldoc; - memcpy(buff, "swig_ptr: ", 10); - buff += 10; - SWIG_PackVoidPtr(buff, ptr, ty->name, lptr); - methods[i].ml_doc = ndoc; - } - } - } - } - } - } - - /* ----------------------------------------------------------------------------- - * 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 - * -----------------------------------------------------------------------------*/ - -#ifdef __cplusplus -extern "C" -#endif - -SWIGEXPORT -#if PY_VERSION_HEX >= 0x03000000 -PyObject* -#else -void -#endif -SWIG_init(void) { - PyObject *m, *d, *md, *globals; - -#if PY_VERSION_HEX >= 0x03000000 - static struct PyModuleDef SWIG_module = { - PyModuleDef_HEAD_INIT, - SWIG_name, - NULL, - -1, - SwigMethods, - NULL, - NULL, - NULL, - NULL - }; -#endif - -#if defined(SWIGPYTHON_BUILTIN) - static SwigPyClientData SwigPyObject_clientdata = { - 0, 0, 0, 0, 0, 0, 0 - }; - static PyGetSetDef this_getset_def = { - (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL - }; - static SwigPyGetSet thisown_getset_closure = { - SwigPyObject_own, - SwigPyObject_own - }; - static PyGetSetDef thisown_getset_def = { - (char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure - }; - PyTypeObject *builtin_pytype; - int builtin_base_count; - swig_type_info *builtin_basetype; - PyObject *tuple; - PyGetSetDescrObject *static_getset; - PyTypeObject *metatype; - PyTypeObject *swigpyobject; - SwigPyClientData *cd; - PyObject *public_interface, *public_symbol; - PyObject *this_descr; - PyObject *thisown_descr; - PyObject *self = 0; - int i; - - (void)builtin_pytype; - (void)builtin_base_count; - (void)builtin_basetype; - (void)tuple; - (void)static_getset; - (void)self; - - /* Metaclass is used to implement static member variables */ - metatype = SwigPyObjectType(); - assert(metatype); -#endif - - (void)globals; - - /* Create singletons now to avoid potential deadlocks with multi-threaded usage after module initialization */ - SWIG_This(); - SWIG_Python_TypeCache(); - SwigPyPacked_type(); -#ifndef SWIGPYTHON_BUILTIN - SwigPyObject_type(); -#endif - - /* Fix SwigMethods to carry the callback ptrs when needed */ - SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial); - -#if PY_VERSION_HEX >= 0x03000000 - m = PyModule_Create(&SWIG_module); -#else - m = Py_InitModule(SWIG_name, SwigMethods); -#endif - - md = d = PyModule_GetDict(m); - (void)md; - - SWIG_InitializeModule(0); - -#ifdef SWIGPYTHON_BUILTIN - swigpyobject = SwigPyObject_TypeOnce(); - - SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject"); - assert(SwigPyObject_stype); - cd = (SwigPyClientData*) SwigPyObject_stype->clientdata; - if (!cd) { - SwigPyObject_stype->clientdata = &SwigPyObject_clientdata; - SwigPyObject_clientdata.pytype = swigpyobject; - } else if (swigpyobject->tp_basicsize != cd->pytype->tp_basicsize) { - PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules."); -# if PY_VERSION_HEX >= 0x03000000 - return NULL; -# else - return; -# endif - } - - /* All objects have a 'this' attribute */ - this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def); - (void)this_descr; - - /* All objects have a 'thisown' attribute */ - thisown_descr = PyDescr_NewGetSet(SwigPyObject_type(), &thisown_getset_def); - (void)thisown_descr; - - public_interface = PyList_New(0); - public_symbol = 0; - (void)public_symbol; - - PyDict_SetItemString(md, "__all__", public_interface); - Py_DECREF(public_interface); - for (i = 0; SwigMethods[i].ml_name != NULL; ++i) - SwigPyBuiltin_AddPublicSymbol(public_interface, SwigMethods[i].ml_name); - for (i = 0; swig_const_table[i].name != 0; ++i) - SwigPyBuiltin_AddPublicSymbol(public_interface, swig_const_table[i].name); -#endif - - SWIG_InstallConstants(d,swig_const_table); - - SWIG_Python_SetConstant(d, "ELEMENTDEFINITION_UNBOUNDED",SWIG_From_unsigned_SS_int((unsigned int)(BLPAPI_ELEMENTDEFINITION_UNBOUNDED))); - SWIG_Python_SetConstant(d, "ELEMENT_INDEX_END",SWIG_From_size_t((size_t)(BLPAPI_ELEMENT_INDEX_END))); - SWIG_Python_SetConstant(d, "SERVICEREGISTRATIONOPTIONS_PRIORITY_MEDIUM",SWIG_From_int((int)(INT_MAX/2))); - SWIG_Python_SetConstant(d, "SERVICEREGISTRATIONOPTIONS_PRIORITY_HIGH",SWIG_From_int((int)(INT_MAX))); - SWIG_Python_SetConstant(d, "CORRELATION_TYPE_UNSET",SWIG_From_int((int)(0))); - SWIG_Python_SetConstant(d, "CORRELATION_TYPE_INT",SWIG_From_int((int)(1))); - SWIG_Python_SetConstant(d, "CORRELATION_TYPE_POINTER",SWIG_From_int((int)(2))); - SWIG_Python_SetConstant(d, "CORRELATION_TYPE_AUTOGEN",SWIG_From_int((int)(3))); - SWIG_Python_SetConstant(d, "CORRELATION_MAX_CLASS_ID",SWIG_From_int((int)(((1 << 16) -1)))); - SWIG_Python_SetConstant(d, "MANAGEDPTR_COPY",SWIG_From_int((int)(1))); - SWIG_Python_SetConstant(d, "MANAGEDPTR_DESTROY",SWIG_From_int((int)((-1)))); - SWIG_Python_SetConstant(d, "DATETIME_YEAR_PART",SWIG_From_int((int)(0x1))); - SWIG_Python_SetConstant(d, "DATETIME_MONTH_PART",SWIG_From_int((int)(0x2))); - SWIG_Python_SetConstant(d, "DATETIME_DAY_PART",SWIG_From_int((int)(0x4))); - SWIG_Python_SetConstant(d, "DATETIME_OFFSET_PART",SWIG_From_int((int)(0x8))); - SWIG_Python_SetConstant(d, "DATETIME_HOURS_PART",SWIG_From_int((int)(0x10))); - SWIG_Python_SetConstant(d, "DATETIME_MINUTES_PART",SWIG_From_int((int)(0x20))); - SWIG_Python_SetConstant(d, "DATETIME_SECONDS_PART",SWIG_From_int((int)(0x40))); - SWIG_Python_SetConstant(d, "DATETIME_MILLISECONDS_PART",SWIG_From_int((int)(0x80))); - SWIG_Python_SetConstant(d, "DATETIME_FRACSECONDS_PART",SWIG_From_int((int)(0x80))); - SWIG_Python_SetConstant(d, "DATETIME_DATE_PART",SWIG_From_int((int)((0x1|0x2|0x4)))); - SWIG_Python_SetConstant(d, "DATETIME_TIME_PART",SWIG_From_int((int)((0x10|0x20|0x40)))); - SWIG_Python_SetConstant(d, "DATETIME_TIMEMILLI_PART",SWIG_From_int((int)(((0x10|0x20|0x40)|0x80)))); - SWIG_Python_SetConstant(d, "DATETIME_TIMEFRACSECONDS_PART",SWIG_From_int((int)(((0x10|0x20|0x40)|0x80)))); - SWIG_Python_SetConstant(d, "EVENTTYPE_ADMIN",SWIG_From_int((int)(1))); - SWIG_Python_SetConstant(d, "EVENTTYPE_SESSION_STATUS",SWIG_From_int((int)(2))); - SWIG_Python_SetConstant(d, "EVENTTYPE_SUBSCRIPTION_STATUS",SWIG_From_int((int)(3))); - SWIG_Python_SetConstant(d, "EVENTTYPE_REQUEST_STATUS",SWIG_From_int((int)(4))); - SWIG_Python_SetConstant(d, "EVENTTYPE_RESPONSE",SWIG_From_int((int)(5))); - SWIG_Python_SetConstant(d, "EVENTTYPE_PARTIAL_RESPONSE",SWIG_From_int((int)(6))); - SWIG_Python_SetConstant(d, "EVENTTYPE_SUBSCRIPTION_DATA",SWIG_From_int((int)(8))); - SWIG_Python_SetConstant(d, "EVENTTYPE_SERVICE_STATUS",SWIG_From_int((int)(9))); - SWIG_Python_SetConstant(d, "EVENTTYPE_TIMEOUT",SWIG_From_int((int)(10))); - SWIG_Python_SetConstant(d, "EVENTTYPE_AUTHORIZATION_STATUS",SWIG_From_int((int)(11))); - SWIG_Python_SetConstant(d, "EVENTTYPE_RESOLUTION_STATUS",SWIG_From_int((int)(12))); - SWIG_Python_SetConstant(d, "EVENTTYPE_TOPIC_STATUS",SWIG_From_int((int)(13))); - SWIG_Python_SetConstant(d, "EVENTTYPE_TOKEN_STATUS",SWIG_From_int((int)(14))); - SWIG_Python_SetConstant(d, "EVENTTYPE_REQUEST",SWIG_From_int((int)(15))); - SWIG_Python_SetConstant(d, "STATUS_ACTIVE",SWIG_From_int((int)(0))); - SWIG_Python_SetConstant(d, "STATUS_DEPRECATED",SWIG_From_int((int)(1))); - SWIG_Python_SetConstant(d, "STATUS_INACTIVE",SWIG_From_int((int)(2))); - SWIG_Python_SetConstant(d, "STATUS_PENDING_DEPRECATION",SWIG_From_int((int)(3))); - SWIG_Python_SetConstant(d, "SUBSCRIPTIONSTATUS_UNSUBSCRIBED",SWIG_From_int((int)(0))); - SWIG_Python_SetConstant(d, "SUBSCRIPTIONSTATUS_SUBSCRIBING",SWIG_From_int((int)(1))); - SWIG_Python_SetConstant(d, "SUBSCRIPTIONSTATUS_SUBSCRIBED",SWIG_From_int((int)(2))); - SWIG_Python_SetConstant(d, "SUBSCRIPTIONSTATUS_CANCELLED",SWIG_From_int((int)(3))); - SWIG_Python_SetConstant(d, "SUBSCRIPTIONSTATUS_PENDING_CANCELLATION",SWIG_From_int((int)(4))); - SWIG_Python_SetConstant(d, "CLIENTMODE_AUTO",SWIG_From_int((int)(0))); - SWIG_Python_SetConstant(d, "CLIENTMODE_DAPI",SWIG_From_int((int)(1))); - SWIG_Python_SetConstant(d, "CLIENTMODE_SAPI",SWIG_From_int((int)(2))); - SWIG_Python_SetConstant(d, "CLIENTMODE_COMPAT_33X",SWIG_From_int((int)(16))); - SWIG_Python_SetConstant(d, "RESOLVEMODE_DONT_REGISTER_SERVICES",SWIG_From_int((int)(0))); - SWIG_Python_SetConstant(d, "RESOLVEMODE_AUTO_REGISTER_SERVICES",SWIG_From_int((int)(1))); - SWIG_Python_SetConstant(d, "SEATTYPE_INVALID_SEAT",SWIG_From_int((int)(-1))); - SWIG_Python_SetConstant(d, "SEATTYPE_BPS",SWIG_From_int((int)(0))); - SWIG_Python_SetConstant(d, "SEATTYPE_NONBPS",SWIG_From_int((int)(1))); - SWIG_Python_SetConstant(d, "SERVICEREGISTRATIONOPTIONS_PRIORITY_LOW",SWIG_From_int((int)(0))); - SWIG_Python_SetConstant(d, "REGISTRATIONPARTS_DEFAULT",SWIG_From_int((int)(0x1))); - SWIG_Python_SetConstant(d, "REGISTRATIONPARTS_PUBLISHING",SWIG_From_int((int)(0x2))); - SWIG_Python_SetConstant(d, "REGISTRATIONPARTS_OPERATIONS",SWIG_From_int((int)(0x4))); - SWIG_Python_SetConstant(d, "REGISTRATIONPARTS_SUBSCRIBER_RESOLUTION",SWIG_From_int((int)(0x8))); - SWIG_Python_SetConstant(d, "REGISTRATIONPARTS_PUBLISHER_RESOLUTION",SWIG_From_int((int)(0x10))); - SWIG_Python_SetConstant(d, "TOPICLIST_NOT_CREATED",SWIG_From_int((int)(0))); - SWIG_Python_SetConstant(d, "TOPICLIST_CREATED",SWIG_From_int((int)(1))); - SWIG_Python_SetConstant(d, "TOPICLIST_FAILURE",SWIG_From_int((int)(2))); - SWIG_Python_SetConstant(d, "RESOLUTIONLIST_UNRESOLVED",SWIG_From_int((int)(0))); - SWIG_Python_SetConstant(d, "RESOLUTIONLIST_RESOLVED",SWIG_From_int((int)(1))); - SWIG_Python_SetConstant(d, "RESOLUTIONLIST_RESOLUTION_FAILURE_BAD_SERVICE",SWIG_From_int((int)(2))); - SWIG_Python_SetConstant(d, "RESOLUTIONLIST_RESOLUTION_FAILURE_SERVICE_AUTHORIZATION_FAILED",SWIG_From_int((int)(3))); - SWIG_Python_SetConstant(d, "RESOLUTIONLIST_RESOLUTION_FAILURE_BAD_TOPIC",SWIG_From_int((int)(4))); - SWIG_Python_SetConstant(d, "RESOLUTIONLIST_RESOLUTION_FAILURE_TOPIC_AUTHORIZATION_FAILED",SWIG_From_int((int)(5))); - SWIG_Python_SetConstant(d, "MESSAGE_FRAGMENT_NONE",SWIG_From_int((int)(0))); - SWIG_Python_SetConstant(d, "MESSAGE_FRAGMENT_START",SWIG_From_int((int)(1))); - SWIG_Python_SetConstant(d, "MESSAGE_FRAGMENT_INTERMEDIATE",SWIG_From_int((int)(2))); - SWIG_Python_SetConstant(d, "MESSAGE_FRAGMENT_END",SWIG_From_int((int)(3))); - SWIG_Python_SetConstant(d, "MESSAGE_RECAPTYPE_NONE",SWIG_From_int((int)(0))); - SWIG_Python_SetConstant(d, "MESSAGE_RECAPTYPE_SOLICITED",SWIG_From_int((int)(1))); - SWIG_Python_SetConstant(d, "MESSAGE_RECAPTYPE_UNSOLICITED",SWIG_From_int((int)(2))); - SWIG_Python_SetConstant(d, "ZFPUTIL_REMOTE_8194",SWIG_From_int((int)(8194))); - SWIG_Python_SetConstant(d, "ZFPUTIL_REMOTE_8196",SWIG_From_int((int)(8196))); - SWIG_Python_SetConstant(d, "IDENTITYUTIL_USERTYPE_UNKNOWN",SWIG_From_int((int)((-2)))); - SWIG_Python_SetConstant(d, "IDENTITYUTIL_USERTYPE_APP_PORTAL",SWIG_From_int((int)(8))); - SWIG_Python_SetConstant(d, "IDENTITYUTIL_USERTYPE_SANDBOX_EXCEL",SWIG_From_int((int)(9))); - SWIG_Python_SetConstant(d, "SUBSCRIPTIONPREPROCESS_INVALID_SUBSCRIPTION_STRING",SWIG_From_int((int)(1))); - SWIG_Python_SetConstant(d, "SUBSCRIPTIONPREPROCESS_CORRELATIONID_ERROR",SWIG_From_int((int)(2))); - SWIG_Python_SetConstant(d, "DATATYPE_BOOL",SWIG_From_int((int)(BLPAPI_DATATYPE_BOOL))); - SWIG_Python_SetConstant(d, "DATATYPE_CHAR",SWIG_From_int((int)(BLPAPI_DATATYPE_CHAR))); - SWIG_Python_SetConstant(d, "DATATYPE_BYTE",SWIG_From_int((int)(BLPAPI_DATATYPE_BYTE))); - SWIG_Python_SetConstant(d, "DATATYPE_INT32",SWIG_From_int((int)(BLPAPI_DATATYPE_INT32))); - SWIG_Python_SetConstant(d, "DATATYPE_INT64",SWIG_From_int((int)(BLPAPI_DATATYPE_INT64))); - SWIG_Python_SetConstant(d, "DATATYPE_FLOAT32",SWIG_From_int((int)(BLPAPI_DATATYPE_FLOAT32))); - SWIG_Python_SetConstant(d, "DATATYPE_FLOAT64",SWIG_From_int((int)(BLPAPI_DATATYPE_FLOAT64))); - SWIG_Python_SetConstant(d, "DATATYPE_STRING",SWIG_From_int((int)(BLPAPI_DATATYPE_STRING))); - SWIG_Python_SetConstant(d, "DATATYPE_BYTEARRAY",SWIG_From_int((int)(BLPAPI_DATATYPE_BYTEARRAY))); - SWIG_Python_SetConstant(d, "DATATYPE_DATE",SWIG_From_int((int)(BLPAPI_DATATYPE_DATE))); - SWIG_Python_SetConstant(d, "DATATYPE_TIME",SWIG_From_int((int)(BLPAPI_DATATYPE_TIME))); - SWIG_Python_SetConstant(d, "DATATYPE_DECIMAL",SWIG_From_int((int)(BLPAPI_DATATYPE_DECIMAL))); - SWIG_Python_SetConstant(d, "DATATYPE_DATETIME",SWIG_From_int((int)(BLPAPI_DATATYPE_DATETIME))); - SWIG_Python_SetConstant(d, "DATATYPE_ENUMERATION",SWIG_From_int((int)(BLPAPI_DATATYPE_ENUMERATION))); - SWIG_Python_SetConstant(d, "DATATYPE_SEQUENCE",SWIG_From_int((int)(BLPAPI_DATATYPE_SEQUENCE))); - SWIG_Python_SetConstant(d, "DATATYPE_CHOICE",SWIG_From_int((int)(BLPAPI_DATATYPE_CHOICE))); - SWIG_Python_SetConstant(d, "DATATYPE_CORRELATION_ID",SWIG_From_int((int)(BLPAPI_DATATYPE_CORRELATION_ID))); - SWIG_Python_SetConstant(d, "blpapi_Logging_SEVERITY_OFF",SWIG_From_int((int)(blpapi_Logging_SEVERITY_OFF))); - SWIG_Python_SetConstant(d, "blpapi_Logging_SEVERITY_FATAL",SWIG_From_int((int)(blpapi_Logging_SEVERITY_FATAL))); - SWIG_Python_SetConstant(d, "blpapi_Logging_SEVERITY_ERROR",SWIG_From_int((int)(blpapi_Logging_SEVERITY_ERROR))); - SWIG_Python_SetConstant(d, "blpapi_Logging_SEVERITY_WARN",SWIG_From_int((int)(blpapi_Logging_SEVERITY_WARN))); - SWIG_Python_SetConstant(d, "blpapi_Logging_SEVERITY_INFO",SWIG_From_int((int)(blpapi_Logging_SEVERITY_INFO))); - SWIG_Python_SetConstant(d, "blpapi_Logging_SEVERITY_DEBUG",SWIG_From_int((int)(blpapi_Logging_SEVERITY_DEBUG))); - SWIG_Python_SetConstant(d, "blpapi_Logging_SEVERITY_TRACE",SWIG_From_int((int)(blpapi_Logging_SEVERITY_TRACE))); - SWIG_Python_SetConstant(d, "UNKNOWN_CLASS",SWIG_From_int((int)(0x00000))); - SWIG_Python_SetConstant(d, "INVALIDSTATE_CLASS",SWIG_From_int((int)(0x10000))); - SWIG_Python_SetConstant(d, "INVALIDARG_CLASS",SWIG_From_int((int)(0x20000))); - SWIG_Python_SetConstant(d, "IOERROR_CLASS",SWIG_From_int((int)(0x30000))); - SWIG_Python_SetConstant(d, "CNVERROR_CLASS",SWIG_From_int((int)(0x40000))); - SWIG_Python_SetConstant(d, "BOUNDSERROR_CLASS",SWIG_From_int((int)(0x50000))); - SWIG_Python_SetConstant(d, "NOTFOUND_CLASS",SWIG_From_int((int)(0x60000))); - SWIG_Python_SetConstant(d, "FLDNOTFOUND_CLASS",SWIG_From_int((int)(0x70000))); - SWIG_Python_SetConstant(d, "UNSUPPORTED_CLASS",SWIG_From_int((int)(0x80000))); - SWIG_Python_SetConstant(d, "ERROR_UNKNOWN",SWIG_From_int((int)((0x00000|1)))); - SWIG_Python_SetConstant(d, "ERROR_ILLEGAL_ARG",SWIG_From_int((int)((0x20000|2)))); - SWIG_Python_SetConstant(d, "ERROR_ILLEGAL_ACCESS",SWIG_From_int((int)((0x80000|3)))); - SWIG_Python_SetConstant(d, "ERROR_INVALID_SESSION",SWIG_From_int((int)((0x20000|4)))); - SWIG_Python_SetConstant(d, "ERROR_DUPLICATE_CORRELATIONID",SWIG_From_int((int)((0x20000|5)))); - SWIG_Python_SetConstant(d, "ERROR_INTERNAL_ERROR",SWIG_From_int((int)((0x00000|6)))); - SWIG_Python_SetConstant(d, "ERROR_RESOLVE_FAILED",SWIG_From_int((int)((0x30000|7)))); - SWIG_Python_SetConstant(d, "ERROR_CONNECT_FAILED",SWIG_From_int((int)((0x30000|8)))); - SWIG_Python_SetConstant(d, "ERROR_ILLEGAL_STATE",SWIG_From_int((int)((0x10000|9)))); - SWIG_Python_SetConstant(d, "ERROR_CODEC_FAILURE",SWIG_From_int((int)((0x00000|10)))); - SWIG_Python_SetConstant(d, "ERROR_INDEX_OUT_OF_RANGE",SWIG_From_int((int)((0x50000|11)))); - SWIG_Python_SetConstant(d, "ERROR_INVALID_CONVERSION",SWIG_From_int((int)((0x40000|12)))); - SWIG_Python_SetConstant(d, "ERROR_ITEM_NOT_FOUND",SWIG_From_int((int)((0x60000|13)))); - SWIG_Python_SetConstant(d, "ERROR_IO_ERROR",SWIG_From_int((int)((0x30000|14)))); - SWIG_Python_SetConstant(d, "ERROR_CORRELATION_NOT_FOUND",SWIG_From_int((int)((0x60000|15)))); - SWIG_Python_SetConstant(d, "ERROR_SERVICE_NOT_FOUND",SWIG_From_int((int)((0x60000|16)))); - SWIG_Python_SetConstant(d, "ERROR_LOGON_LOOKUP_FAILED",SWIG_From_int((int)((0x00000|17)))); - SWIG_Python_SetConstant(d, "ERROR_DS_LOOKUP_FAILED",SWIG_From_int((int)((0x00000|18)))); - SWIG_Python_SetConstant(d, "ERROR_UNSUPPORTED_OPERATION",SWIG_From_int((int)((0x80000|19)))); - SWIG_Python_SetConstant(d, "ERROR_DS_PROPERTY_NOT_FOUND",SWIG_From_int((int)((0x60000|20)))); - SWIG_Python_SetConstant(d, "ERROR_MSG_TOO_LARGE",SWIG_From_int((int)((0x20000|21)))); - - /* Initialize threading */ - SWIG_PYTHON_INITIALIZE_THREADS; -#if PY_VERSION_HEX >= 0x03000000 - return m; -#else - return; -#endif -} - diff --git a/src/blpapi/logging.py b/src/blpapi/logging.py index 81fbf97..d3f1763 100644 --- a/src/blpapi/logging.py +++ b/src/blpapi/logging.py @@ -5,12 +5,13 @@ @DESCRIPTION: This component provides a function that is used to register a callback for logging""" -from typing import Callable, List +from typing import Callable, List, Optional, Tuple from blpapi import internals from datetime import datetime from . import utils from .datetime import _DatetimeUtil from .typehints import AnyPythonDatetime +from inspect import signature class Logger(metaclass=utils.MetaClassForClassesWithEnums): @@ -18,19 +19,22 @@ class Logger(metaclass=utils.MetaClassForClassesWithEnums): logging configuration.""" # Different logging levels - SEVERITY_OFF = internals.blpapi_Logging_SEVERITY_OFF # type: ignore - SEVERITY_FATAL = internals.blpapi_Logging_SEVERITY_FATAL # type: ignore - SEVERITY_ERROR = internals.blpapi_Logging_SEVERITY_ERROR # type: ignore - SEVERITY_WARN = internals.blpapi_Logging_SEVERITY_WARN # type: ignore - SEVERITY_INFO = internals.blpapi_Logging_SEVERITY_INFO # type: ignore - SEVERITY_DEBUG = internals.blpapi_Logging_SEVERITY_DEBUG # type: ignore - SEVERITY_TRACE = internals.blpapi_Logging_SEVERITY_TRACE # type: ignore + SEVERITY_OFF = internals.blpapi_Logging_SEVERITY_OFF + SEVERITY_FATAL = internals.blpapi_Logging_SEVERITY_FATAL + SEVERITY_ERROR = internals.blpapi_Logging_SEVERITY_ERROR + SEVERITY_WARN = internals.blpapi_Logging_SEVERITY_WARN + SEVERITY_INFO = internals.blpapi_Logging_SEVERITY_INFO + SEVERITY_DEBUG = internals.blpapi_Logging_SEVERITY_DEBUG + SEVERITY_TRACE = internals.blpapi_Logging_SEVERITY_TRACE - loggerCallbacksLocal: List[Callable] = [] # needed for temp. ref. holding + # needed for temp. ref. holding + loggerCallbacksLocal: List[Tuple[Callable, Callable]] = [] @staticmethod def registerCallback( - callback: Callable[[int, int, AnyPythonDatetime, str, str], None], + callback: Optional[ + Callable[[int, int, AnyPythonDatetime, str, str], None] + ], thresholdSeverity: int = SEVERITY_INFO, ) -> None: """Register the specified 'callback' that will be called for all log @@ -41,33 +45,45 @@ def registerCallback( 'RuntimeError' will be thrown if 'callback' cannot be registered. If callback is None, any existing callback shall be removed.""" - def callbackWrapper( - threadId: int, - severity: int, - ts: datetime, - category: str, - message: str, - ) -> None: - dt = _DatetimeUtil.convertToNativeNotHighPrecision(ts) - callback(threadId, severity, dt, category, message) - - callbackRef = None if callback is None else callbackWrapper - # we store a reference to callbackWrapper (that binds callback) - # for as long as it may be needed, i.e. until gc or re-register - Logger.loggerCallbacksLocal.append(callbackRef) - err_code = internals.setLoggerCallbackWrapper( + callbackRef = None + if callback is not None: + sign = signature(callback) + # we expect 5 named parameters + if len(sign.parameters) < 5: + raise TypeError("Wrong type of callback for logging") + + def callbackWrapper( + threadId: int, + severity: int, + ts: datetime, + category: bytes, + message: bytes, + ) -> None: + dt = _DatetimeUtil.convertToNativeNotHighPrecision(ts) + callback( + threadId, severity, dt, category.decode(), message.decode() + ) + + callbackRef = callbackWrapper + + err_code, proxy = internals.blpapi_Logging_registerCallback( callbackRef, thresholdSeverity ) - if len(Logger.loggerCallbacksLocal) > 1: - # we have a new cb now, let the previous one go - Logger.loggerCallbacksLocal.pop(0) - if err_code == -1: raise ValueError("parameter must be a function") if err_code == -2: raise RuntimeError("unable to register callback") + # we store a reference to callbackWrapper (that binds callback) + # for as long as it may be needed, i.e. until gc or re-register + if callbackRef is not None: + Logger.loggerCallbacksLocal.append((callbackRef, proxy)) + + if len(Logger.loggerCallbacksLocal) > 1: + # we have a new cb now, let the previous one go + Logger.loggerCallbacksLocal.pop(0) + @staticmethod def logTestMessage(severity: int) -> None: """Log a test message at the specified 'severity'. diff --git a/src/blpapi/message.py b/src/blpapi/message.py index 89e85f5..57ded33 100644 --- a/src/blpapi/message.py +++ b/src/blpapi/message.py @@ -25,6 +25,7 @@ from . import internals from .utils import deprecated, MetaClassForClassesWithEnums from .chandle import CHandle +from .correlationid import CorrelationId # Handling a circular dependency between modules: # service->event->message->service @@ -60,20 +61,20 @@ class Message(CHandle, metaclass=MetaClassForClassesWithEnums): the application. """ - FRAGMENT_NONE = internals.MESSAGE_FRAGMENT_NONE # type: ignore + FRAGMENT_NONE = internals.MESSAGE_FRAGMENT_NONE """Unfragmented message""" - FRAGMENT_START = internals.MESSAGE_FRAGMENT_START # type: ignore + FRAGMENT_START = internals.MESSAGE_FRAGMENT_START """Start of a fragmented message""" - FRAGMENT_INTERMEDIATE = internals.MESSAGE_FRAGMENT_INTERMEDIATE # type: ignore + FRAGMENT_INTERMEDIATE = internals.MESSAGE_FRAGMENT_INTERMEDIATE """Intermediate fragment""" - FRAGMENT_END = internals.MESSAGE_FRAGMENT_END # type: ignore + FRAGMENT_END = internals.MESSAGE_FRAGMENT_END """Final part of a fragmented message""" - RECAPTYPE_NONE = internals.MESSAGE_RECAPTYPE_NONE # type: ignore + RECAPTYPE_NONE = internals.MESSAGE_RECAPTYPE_NONE """Normal data tick""" - RECAPTYPE_SOLICITED = internals.MESSAGE_RECAPTYPE_SOLICITED # type: ignore + RECAPTYPE_SOLICITED = internals.MESSAGE_RECAPTYPE_SOLICITED """Generated on request by subscriber""" - RECAPTYPE_UNSOLICITED = internals.MESSAGE_RECAPTYPE_UNSOLICITED # type: ignore + RECAPTYPE_UNSOLICITED = internals.MESSAGE_RECAPTYPE_UNSOLICITED """Generated by the service""" def __init__( @@ -220,7 +221,9 @@ def correlationId(self) -> Optional["typehints.CorrelationId"]: if numCorrelations == 0: return None - return internals.blpapi_Message_correlationId(self.__handle, 0) + return CorrelationId( + internals.blpapi_Message_correlationId(self.__handle, 0) + ) def correlationIds(self) -> List["typehints.CorrelationId"]: r""" @@ -248,7 +251,9 @@ def correlationIds(self) -> List["typehints.CorrelationId"]: internals.blpapi_Message_numCorrelationIds(self.__handle) ): res.append( - internals.blpapi_Message_correlationId(self.__handle, i) + CorrelationId( + internals.blpapi_Message_correlationId(self.__handle, i) + ) ) return res diff --git a/src/blpapi/name.py b/src/blpapi/name.py index 18112dc..84d965f 100644 --- a/src/blpapi/name.py +++ b/src/blpapi/name.py @@ -119,7 +119,9 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: """x.__eq__(y) <==> x==y""" if not isstr(other): - return self.__handle == get_handle(other) + if other is None: + return False + return self.__handle.value == get_handle(other).value # type: ignore s = conv2str(other) p = internals.blpapi_Name_equalsStr(self.__handle, s) @@ -131,7 +133,7 @@ def __ne__(self, other: Any) -> bool: def __hash__(self) -> int: """x.__hash__() <==> hash(x)""" - return int(self.__handle) + return int(self.__handle.value) # type: ignore def getNamePair( diff --git a/src/blpapi/providersession.py b/src/blpapi/providersession.py index e24f231..3e59fbb 100644 --- a/src/blpapi/providersession.py +++ b/src/blpapi/providersession.py @@ -70,7 +70,7 @@ from . import exception from .exception import _ExceptionUtil from . import internals -from .internals import CorrelationId +from .correlationid import CorrelationId from .sessionoptions import SessionOptions from .topic import Topic from . import utils @@ -368,7 +368,6 @@ def __init__( receives small messages and processes each one very quickly then give each one a separate :class:`EventDispatcher`. """ - AbstractSession.__init__(self) if (eventHandler is None) and (eventDispatcher is not None): raise exception.InvalidArgumentException( "eventDispatcher is specified but eventHandler is None", 0 @@ -381,19 +380,23 @@ def __init__( self.__handlerProxy = functools.partial( ProviderSession.__dispatchEvent, ref(self) ) + self.__handle = internals.ProviderSession_createHelper( get_handle(options), self.__handlerProxy, get_handle(eventDispatcher), ) - _destroy = internals.ProviderSession_destroyHelper - # note: AbstractSession destroy passes AbstractSession handle - _dtor = lambda hndl: _destroy(self.__handle, self.__handlerProxy) + def _dtor(handle: Any) -> None: + atexit.unregister(self.stop) + internals.ProviderSession_destroyHelper( + handle, self.__handlerProxy + ) atexit.register(self.stop) # we must stop session before shutdown AbstractSession.__init__( self, + self.__handle, internals.blpapi_ProviderSession_getAbstractSession(self.__handle), _dtor, ) @@ -1009,20 +1012,12 @@ def terminateSubscriptionsOnTopics( """ if not topics: return - topicsCArraySize = len(topics) - topicsCArray = internals.new_topicPtrArray(topicsCArraySize) - try: - for i, topic in enumerate(topics): - internals.topicPtrArray_setitem( - topicsCArray, i, get_handle(topic) - ) - _ExceptionUtil.raiseOnError( - internals.blpapi_ProviderSession_terminateSubscriptionsOnTopics( - self.__handle, topicsCArray, topicsCArraySize, message - ) + + _ExceptionUtil.raiseOnError( + internals.blpapi_ProviderSession_terminateSubscriptionsOnTopics( + self.__handle, [get_handle(t) for t in topics], message ) - finally: - internals.delete_topicPtrArray(topicsCArray) + ) def deleteTopic(self, topic: Topic) -> None: """Remove one reference from the specified 'topic'. @@ -1053,20 +1048,12 @@ def deleteTopics(self, topics: Sequence[Topic]) -> None: See :meth:`deleteTopic()` above for additional details.""" if not topics: return - topicsCArraySize = len(topics) - topicsCArray = internals.new_topicPtrArray(topicsCArraySize) - try: - for i, topic in enumerate(topics): - internals.topicPtrArray_setitem( - topicsCArray, i, get_handle(topic) - ) - _ExceptionUtil.raiseOnError( - internals.blpapi_ProviderSession_deleteTopics( - self.__handle, topicsCArray, topicsCArraySize - ) + + _ExceptionUtil.raiseOnError( + internals.blpapi_ProviderSession_deleteTopics( + self.__handle, [get_handle(t) for t in topics] ) - finally: - internals.delete_topicPtrArray(topicsCArray) + ) __copyright__ = """ diff --git a/src/blpapi/py.typed b/src/blpapi/py.typed deleted file mode 100644 index e69de29..0000000 diff --git a/src/blpapi/pycbhelpers.py b/src/blpapi/pycbhelpers.py new file mode 100644 index 0000000..54bf310 --- /dev/null +++ b/src/blpapi/pycbhelpers.py @@ -0,0 +1,108 @@ +from ctypes import ( + CFUNCTYPE, + c_int, + c_char_p, + c_void_p, +) + +from typing import Any, Callable +from io import StringIO + +from .ctypesutils import pyObjectFromVoid, voidFromPyObject + +# ============== General disclaimer ============== +# All python callback wrappers currently use the same approach, +# namely, the pointer to py object is given as void* userdata, +# converted back to py object and a proper call is made on it. +# The benefit of this approach is that we can have one instance +# of a proxy to serve all needs. +# The other approach would be to bind the pythonic callback +# and pass null as userdata. That way we need to keep fewer things alive, +# but would have to create per call proxy object (and keep that alive) + + +def default_print_helper(data: bytes, sz: int, out: Any) -> int: + if sz > 0: + pyout = pyObjectFromVoid(out) + getattr(pyout, "write")(data[:sz].decode()) + return 0 + + +class StreamWrapper: + _cftype = CFUNCTYPE(c_int, c_char_p, c_int, c_void_p) + + def __init__(self, cb: Callable = default_print_helper) -> None: + self._cb = self._cftype(cb) + + def get(self) -> Callable: + return self._cb + + +def any_printer( + handle: c_void_p, cfun: Callable, level: int, spacesPerLevel: int +) -> str: + out = StringIO() + writer = StreamWrapper() + outparam = voidFromPyObject(out) + cfun(handle, writer.get(), outparam, level, spacesPerLevel) + out.seek(0) + return out.read() + + +def _dispatchEventProxy(event: Any, _session: Any, pycb: Any) -> None: + pyout = pyObjectFromVoid(pycb) + getattr(pyout, "__call__")(c_void_p(event)) + + +class EventHandleWrapper: + # blpapi_Event_t *event, blpapi_Session_t *session, void *userData + _cftype = CFUNCTYPE(None, c_void_p, c_void_p, c_void_p) + + def __init__(self) -> None: + self._cb = self._cftype(_dispatchEventProxy) + + def get(self) -> Callable: + return self._cb + + +anySessionEventHandlerWrapper = EventHandleWrapper() + + +def _subscriptionPreprocessProxy( + cid: int, subString: bytes, errorCode: int, errorDesc: bytes, pycb: int +) -> None: + # ^ the typehints are representation of + # c_void_p, c_char_p, c_int, c_char_p, c_void_p + pyout = pyObjectFromVoid(c_void_p(pycb)) + + # The handler is given &correlationId.impl() + # by ProxySubscriptionPreprocessErrorHandler::handleError + # i.e., it does not bump the ref. for us + correlationId = correlationIdWrapper(cid) + getattr(pyout, "__call__")( + correlationId, subString.decode(), errorCode, errorDesc.decode() + ) + + +class SubscriptionPreprocessHandlerWrapper: + # void (*blpapi_SubscriptionPreprocessErrorHandler_t)( + # const blpapi_CorrelationId_t *correlationId, + # const char *subscriptionString, + # int errorCode, + # const char *errorDescription, + # void *userData) + _cftype = CFUNCTYPE(None, c_void_p, c_char_p, c_int, c_char_p, c_void_p) + + def __init__(self) -> None: + self._cb = self._cftype(_subscriptionPreprocessProxy) + + def get(self) -> Callable: + return self._cb + + +anySessionSubErrorHandlerWrapper = SubscriptionPreprocessHandlerWrapper() + + +# will be overridden in correlationid.py +def correlationIdWrapper(ptr: int) -> Any: + raise Exception("Invalid cid wrapper called with", ptr) diff --git a/src/blpapi/resolutionlist.py b/src/blpapi/resolutionlist.py index 478179e..d22dd1e 100644 --- a/src/blpapi/resolutionlist.py +++ b/src/blpapi/resolutionlist.py @@ -11,7 +11,7 @@ from . import internals from . import utils from .utils import deprecated, get_handle -from .internals import CorrelationId +from .correlationid import CorrelationId from .chandle import CHandle from . import typehints # pylint: disable=unused-import @@ -135,7 +135,7 @@ def correlationIdAt(self, index: int) -> CorrelationId: self.__handle, index ) _ExceptionUtil.raiseOnError(errorCode) - return cid + return CorrelationId(cid) def topicString(self, correlationId: CorrelationId) -> str: """Return the topic of the entry identified by ``correlationId``. diff --git a/src/blpapi/schema.py b/src/blpapi/schema.py index bd8e70f..df2af07 100644 --- a/src/blpapi/schema.py +++ b/src/blpapi/schema.py @@ -35,14 +35,14 @@ class SchemaStatus(metaclass=utils.MetaClassForClassesWithEnums): """The possible deprecation statuses of a schema element or type.""" - ACTIVE = internals.STATUS_ACTIVE # type: ignore + ACTIVE = internals.STATUS_ACTIVE """This item is current and may appear in Messages""" - DEPRECATED = internals.STATUS_DEPRECATED # type: ignore + DEPRECATED = internals.STATUS_DEPRECATED """This item is current and may appear in Messages but will be removed in due course""" - INACTIVE = internals.STATUS_INACTIVE # type: ignore + INACTIVE = internals.STATUS_INACTIVE """This item is not current and will not appear in Messages""" - PENDING_DEPRECATION = internals.STATUS_PENDING_DEPRECATION # type: ignore + PENDING_DEPRECATION = internals.STATUS_PENDING_DEPRECATION """This item is expected to be deprecated in the future; clients are advised to migrate away from use of this item.""" @@ -83,7 +83,7 @@ class SchemaElementDefinition(metaclass=utils.MetaClassForClassesWithEnums): other blpapi components. """ - UNBOUNDED = internals.ELEMENTDEFINITION_UNBOUNDED # type: ignore + UNBOUNDED = internals.ELEMENTDEFINITION_UNBOUNDED """Indicates an array has an unbounded number of values.""" def __init__( diff --git a/src/blpapi/service.py b/src/blpapi/service.py index 92757a1..74a118f 100644 --- a/src/blpapi/service.py +++ b/src/blpapi/service.py @@ -141,11 +141,14 @@ def __init__( self, handle: BlpapiServiceHandle, sessions: Set["typehints.AbstractSession"], + isRealService: bool = True, ) -> None: super(Service, self).__init__(handle, internals.blpapi_Service_release) self.__handle = handle self.__sessions = sessions - internals.blpapi_Service_addRef(self.__handle) + if isRealService: # as opposed to deserialized + # see blpapi-cpp/src/blpapi_testutil.cpp#L270 + internals.blpapi_Service_addRef(self.__handle) def __str__(self) -> str: """Convert the service schema to a string.""" diff --git a/src/blpapi/session.py b/src/blpapi/session.py index 4ba0d8e..11dbba4 100644 --- a/src/blpapi/session.py +++ b/src/blpapi/session.py @@ -19,16 +19,15 @@ from . import exception from .exception import _ExceptionUtil from . import internals -from .internals import CorrelationId +from .correlationid import CorrelationId from .sessionoptions import SessionOptions from .requesttemplate import RequestTemplate from .utils import get_handle, MetaClassForClassesWithEnums from . import typehints # pylint: disable=unused-import from .typehints import BlpapiEventHandle -# pylint: disable=too-many-arguments,protected-access,bare-except - +# pylint: disable=too-many-arguments,protected-access,bare-except class SubscriptionPreprocessMode(Enum): """The modes that can be used for the :meth:`Session.subscribe()` and :meth:`Session.resubscribe()` operations.""" @@ -115,9 +114,6 @@ class Session(AbstractSession, metaclass=MetaClassForClassesWithEnums): PENDING_CANCELLATION = internals.SUBSCRIPTIONSTATUS_PENDING_CANCELLATION """No longer active, terminated by Application.""" - __handle = None # pylint: disable=unused-private-member - __handlerProxy = None # pylint: disable=unused-private-member - @staticmethod def __dispatchEvent( sessionRef: "ReferenceType[Session]", eventHandle: BlpapiEventHandle @@ -185,29 +181,31 @@ def __init__( ) if options is None: options = SessionOptions() + self.__handlerProxy = None if eventHandler is not None: # pylint: disable=unused-private-member self.__handler = eventHandler self.__handlerProxy = functools.partial( Session.__dispatchEvent, ref(self) ) + + # Note __handle in Session is not the __handle + # in/of AbstractSession base class self.__handle = internals.Session_createHelper( get_handle(options), self.__handlerProxy, get_handle(eventDispatcher), ) - _destroy = internals.Session_destroyHelper - - # note: AbstractSession destroy passes AbstractSession handle - def _dtor(_: Any) -> None: + def _dtor(handle: Any) -> None: atexit.unregister(self.stop) - _destroy(self.__handle, self.__handlerProxy) + internals.Session_destroyHelper(handle, self.__handlerProxy) atexit.register(self.stop) # we must stop session before shutdown AbstractSession.__init__( self, + self.__handle, internals.blpapi_Session_getAbstractSession(self.__handle), _dtor, ) @@ -756,9 +754,6 @@ def createSnapshotRequestTemplate( has been authorized. """ - cidArg = correlationId - identityArg = identity - # We changed the order of last two arguments, but # old clients may have them swapped at call site. # This detects the swap and calls the method correctly. @@ -767,13 +762,30 @@ def createSnapshotRequestTemplate( # Note: cid may never be None, only identity is allowed None # Hence, in the swapped case identity must be of type CorrelationId - if isinstance(identity, CorrelationId): - cidArg = identity # type: ignore - identityArg = correlationId - - rc, template = internals.blpapi_Session_createSnapshotRequestTemplate( - self.__handle, subscriptionString, get_handle(identityArg), cidArg - ) + if isinstance(correlationId, CorrelationId): + ( + rc, + template, + ) = internals.blpapi_Session_createSnapshotRequestTemplate( + self.__handle, + subscriptionString, + get_handle(identity), + correlationId, + ) + elif isinstance(identity, CorrelationId): # type: ignore + ( + rc, + template, + ) = internals.blpapi_Session_createSnapshotRequestTemplate( + self.__handle, + subscriptionString, + get_handle(correlationId), + identity, + ) + else: + raise exception.InvalidArgumentException( + "Invalid CorrelationId", 0 + ) _ExceptionUtil.raiseOnError(rc) reqTemplate = RequestTemplate(template) return reqTemplate diff --git a/src/blpapi/sessionoptions.py b/src/blpapi/sessionoptions.py index fd22e13..ace2ba3 100644 --- a/src/blpapi/sessionoptions.py +++ b/src/blpapi/sessionoptions.py @@ -46,9 +46,7 @@ def __init__(self, hostname: str, port: int) -> None: """ SessionOptions._validatePort(port) - self.__handle = internals.blpapi_Socks5Config_create( - hostname, len(hostname), port - ) + self.__handle = internals.blpapi_Socks5Config_create(hostname, port) super(Socks5Config, self).__init__( self.__handle, internals.blpapi_Socks5Config_destroy ) @@ -371,11 +369,14 @@ def setSessionIdentityOptions( _ExceptionUtil.raiseOnError(retcode) authOptions = AuthOptions(authOptions_handle) - retcode = internals.blpapi_SessionOptions_setSessionIdentityOptions( + ( + retcode, + actualcid, + ) = internals.blpapi_SessionOptions_setSessionIdentityOptions( self._handle(), get_handle(authOptions), correlationId ) _ExceptionUtil.raiseOnError(retcode) - return correlationId + return actualcid def setAuthenticationOptions(self, authOptions: str) -> None: """Set the specified ``authOptions`` as the authentication options. @@ -1076,8 +1077,8 @@ def createFromBlobs( PKCS#12 format and DER encoded trust material in PKCS#7 format from the given raw data. """ - credentials = bytearray(clientCredentials) - certs = bytearray(trustedCertificates) + credentials = bytes(clientCredentials) + certs = bytes(trustedCertificates) handle = internals.blpapi_TlsOptions_createFromBlobs( credentials, clientCredentialsPassword, certs ) diff --git a/src/blpapi/subscriptionlist.py b/src/blpapi/subscriptionlist.py index 781c60c..6801618 100644 --- a/src/blpapi/subscriptionlist.py +++ b/src/blpapi/subscriptionlist.py @@ -86,7 +86,7 @@ from .exception import _ExceptionUtil from . import internals -from .internals import CorrelationId +from .correlationid import CorrelationId from .utils import conv2str, get_handle, isstr from .chandle import CHandle from . import typehints # pylint: disable=unused-import @@ -174,27 +174,35 @@ def add( if topic is None: topic = "" - if fields is not None: + if fields: if isstr(fields): fields = conv2str(fields) # type: ignore # the isstr() check means fields must be string by this point else: fields = ",".join(fields) + if fields: + topic += "?fields=" + fields - if options is not None: + if options: if isstr(options): - options = conv2str(options) # type: ignore # the isstr() check means options must be string by this point + options_str = conv2str(options) # type: ignore # the isstr() check means options must be string by this point elif isinstance(options, (list, tuple)): - options = "&".join(options) + options_str = "&".join(options) elif isinstance(options, dict): - options = "&".join( + options_str = "&".join( [ key if val is None else f"{key}={val}" for key, val in options.items() ] ) + else: + options_str = "" + + if options_str: + opts_prefix = "&" if fields else "?" + topic += opts_prefix + options_str return internals.blpapi_SubscriptionList_addHelper( - self.__handle, topic, correlationId, fields, options + self.__handle, topic, correlationId ) def append(self, other: "typehints.SubscriptionList") -> int: @@ -234,7 +242,7 @@ def correlationIdAt(self, index: int) -> CorrelationId: self.__handle, index ) _ExceptionUtil.raiseOnError(errorCode) - return cid + return CorrelationId(cid) def topicStringAt(self, index: int) -> str: """ @@ -279,7 +287,7 @@ def addResolved( subscription. """ if correlationId is None: - correlationId = internals.CorrelationId() + correlationId = CorrelationId() return internals.blpapi_SubscriptionList_addResolved( self.__handle, subscriptionString, correlationId ) diff --git a/src/blpapi/test/messageproperties.py b/src/blpapi/test/messageproperties.py index 27a84de..70d5743 100644 --- a/src/blpapi/test/messageproperties.py +++ b/src/blpapi/test/messageproperties.py @@ -59,7 +59,7 @@ def setCorrelationIds( def setRecapType( self, recapType: int, - fragmentType: int = blpapi.Message.FRAGMENT_NONE, # type: ignore + fragmentType: int = blpapi.Message.FRAGMENT_NONE, ) -> None: """ Set the `recapType` and `fragmentType` properties of the message. diff --git a/src/blpapi/test/testutil.py b/src/blpapi/test/testutil.py index 2106168..1634857 100644 --- a/src/blpapi/test/testutil.py +++ b/src/blpapi/test/testutil.py @@ -83,7 +83,8 @@ def deserializeService(serviceXMLStr: str) -> Service: serviceXMLStr, len(serviceXMLStr) ) _ExceptionUtil.raiseOnError(rc) - service = Service(service_handle, set()) + let_it_leak = True # for now, we prefer leaks to crashes + service = Service(service_handle, set(), let_it_leak) return service diff --git a/src/blpapi/topic.py b/src/blpapi/topic.py index e438fc1..3a14951 100644 --- a/src/blpapi/topic.py +++ b/src/blpapi/topic.py @@ -37,16 +37,15 @@ def __init__( topic and must be assigned to from a valid topic before it can be used. """ super(Topic, self).__init__(handle, internals.blpapi_Topic_destroy) - self.__handle = handle self.__sessions = sessions if sessions is not None else set() - def isValid(self) -> bool: + def isValid(self) -> bool: # pylint: disable=useless-parent-delegation """ Returns: ``True`` if this :class:`Topic` is valid and can be used to publish a message on. """ - return self.__handle is not None + return super().isValid() def isActive(self) -> bool: """ @@ -54,7 +53,7 @@ def isActive(self) -> bool: ``True`` if this topic was elected by the platform to become the primary publisher. """ - return bool(internals.blpapi_Topic_isActive(self.__handle)) + return bool(internals.blpapi_Topic_isActive(self._handle())) def service(self) -> "typehints.Service": """ @@ -62,20 +61,20 @@ def service(self) -> "typehints.Service": Service: The service for which this topic was created. """ return Service( - internals.blpapi_Topic_service(self.__handle), self.__sessions + internals.blpapi_Topic_service(self._handle()), self.__sessions ) def __lt__(self, other: "typehints.Topic") -> bool: """2-way comparison of Topic objects.""" return ( - internals.blpapi_Topic_compare(self.__handle, get_handle(other)) + internals.blpapi_Topic_compare(self._handle(), get_handle(other)) < 0 ) def __eq__(self, other: Any) -> bool: """2-way comparison of Topic objects.""" return ( - internals.blpapi_Topic_compare(self.__handle, get_handle(other)) + internals.blpapi_Topic_compare(self._handle(), get_handle(other)) == 0 ) diff --git a/src/blpapi/topiclist.py b/src/blpapi/topiclist.py index 6a3e104..436ec74 100644 --- a/src/blpapi/topiclist.py +++ b/src/blpapi/topiclist.py @@ -12,7 +12,7 @@ from . import internals from . import utils from .utils import get_handle -from .internals import CorrelationId +from .correlationid import CorrelationId from .chandle import CHandle from . import typehints # pylint: disable=unused-import @@ -129,7 +129,7 @@ def correlationIdAt(self, index: int) -> CorrelationId: self.__handle, index ) _ExceptionUtil.raiseOnError(errorCode) - return cid + return CorrelationId(cid) def topicString(self, correlationId: CorrelationId) -> str: """ diff --git a/src/blpapi/utils.py b/src/blpapi/utils.py index a07d69f..8fb74c1 100644 --- a/src/blpapi/utils.py +++ b/src/blpapi/utils.py @@ -3,6 +3,7 @@ """Internal utils.""" from collections.abc import Iterator as IteratorABC, Sequence +from ctypes import c_void_p from typing import Any, Callable, Union, Optional from typing import Iterator as IteratorType import functools @@ -99,9 +100,18 @@ def __delattr__(cls, name: str) -> None: def get_handle(thing: Optional[CHandle]) -> Any: - """Returns the result of thing._handle() or None if thing is None""" + """Returns the result of thing._handle() or None if thing is None or + thing._handle() is c_void_p and its value is None. + """ # pylint: disable=protected-access - return None if thing is None else thing._handle() + if thing is None: + return None + handle = thing._handle() + if handle is None: + return None + if isinstance(handle, c_void_p) and handle.value is None: + return None + return handle def invoke_if_valid(cb: Any, value: Any) -> Any: diff --git a/src/blpapi/version.py b/src/blpapi/version.py index afc881a..afcf0cd 100644 --- a/src/blpapi/version.py +++ b/src/blpapi/version.py @@ -2,10 +2,10 @@ """Provide BLPAPI SDK versions""" -from . import versionhelper +from . import internals -__version__ = "3.24.6" -__expected_cpp_sdk_version__ = "3.24.6" +__version__ = "3.24.10" +__expected_cpp_sdk_version__ = "3.24.10" def print_version() -> None: @@ -28,8 +28,7 @@ def cpp_sdk_version() -> str: Returns: str: BLPAPI C++ SDK dependency version """ - version_string = ".".join(map(str, versionhelper.blpapi_getVersionInfo())) - return version_string + return internals.blpapi_getVersionInfo() def expected_cpp_sdk_version() -> str: diff --git a/src/blpapi/versionhelper.py b/src/blpapi/versionhelper.py deleted file mode 100644 index 04988d4..0000000 --- a/src/blpapi/versionhelper.py +++ /dev/null @@ -1,73 +0,0 @@ -# This file was automatically generated by SWIG (http://www.swig.org). -# Version 4.0.1 -# -# Do not make changes to this file unless you know what you are doing--modify -# the SWIG interface file instead. - -"""blpapi version helper""" - -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 _versionhelper -else: - import _versionhelper - -try: - import builtins as __builtin__ -except ImportError: - import __builtin__ - -def _swig_repr(self): - try: - strthis = "proxy of " + self.this.__repr__() - except __builtin__.Exception: - strthis = "" - return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) - - -def _swig_setattr_nondynamic_instance_variable(set): - def set_instance_attr(self, name, value): - if name == "thisown": - self.this.own(value) - elif name == "this": - set(self, name, value) - elif hasattr(self, name) and isinstance(getattr(type(self), name), property): - set(self, name, value) - else: - raise AttributeError("You cannot add instance attributes to %s" % self) - return set_instance_attr - - -def _swig_setattr_nondynamic_class_variable(set): - def set_class_attr(cls, name, value): - if hasattr(cls, name) and not isinstance(getattr(cls, name), property): - set(cls, name, value) - else: - raise AttributeError("You cannot add class attributes to %s" % cls) - return set_class_attr - - -def _swig_add_metaclass(metaclass): - """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass""" - def wrapper(cls): - return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy()) - return wrapper - - -class _SwigNonDynamicMeta(type): - """Meta class to enforce nondynamic attributes (no new attributes) for a class""" - __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__) - - - -def blpapi_getVersionInfo(): - return _versionhelper.blpapi_getVersionInfo() - -def blpapi_getVersionIdentifier(): - return _versionhelper.blpapi_getVersionIdentifier() - - diff --git a/src/blpapi/versionhelper_wrap.c b/src/blpapi/versionhelper_wrap.c deleted file mode 100644 index 8cc702d..0000000 --- a/src/blpapi/versionhelper_wrap.c +++ /dev/null @@ -1,3571 +0,0 @@ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.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. - * ----------------------------------------------------------------------------- */ - - -#ifndef SWIGPYTHON -#define SWIGPYTHON -#endif - -#define SWIG_PYTHON_THREADS -#define SWIG_PYTHON_DIRECTOR_NO_VTABLE - -/* ----------------------------------------------------------------------------- - * This section contains generic SWIG labels for method/variable - * declarations/attributes, and other compiler dependent labels. - * ----------------------------------------------------------------------------- */ - -/* template workaround for compilers that cannot correctly implement the C++ standard */ -#ifndef SWIGTEMPLATEDISAMBIGUATOR -# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) -# define SWIGTEMPLATEDISAMBIGUATOR template -# elif defined(__HP_aCC) -/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ -/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ -# define SWIGTEMPLATEDISAMBIGUATOR template -# else -# define SWIGTEMPLATEDISAMBIGUATOR -# endif -#endif - -/* inline attribute */ -#ifndef SWIGINLINE -# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) -# define SWIGINLINE inline -# else -# define SWIGINLINE -# endif -#endif - -/* attribute recognised by some compilers to avoid 'unused' warnings */ -#ifndef SWIGUNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define SWIGUNUSED __attribute__ ((__unused__)) -# else -# define SWIGUNUSED -# endif -# elif defined(__ICC) -# define SWIGUNUSED __attribute__ ((__unused__)) -# else -# define SWIGUNUSED -# endif -#endif - -#ifndef SWIG_MSC_UNSUPPRESS_4505 -# if defined(_MSC_VER) -# pragma warning(disable : 4505) /* unreferenced local function has been removed */ -# endif -#endif - -#ifndef SWIGUNUSEDPARM -# ifdef __cplusplus -# define SWIGUNUSEDPARM(p) -# else -# define SWIGUNUSEDPARM(p) p SWIGUNUSED -# endif -#endif - -/* internal SWIG method */ -#ifndef SWIGINTERN -# define SWIGINTERN static SWIGUNUSED -#endif - -/* internal inline SWIG method */ -#ifndef SWIGINTERNINLINE -# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE -#endif - -/* exporting methods */ -#if defined(__GNUC__) -# if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) -# ifndef GCC_HASCLASSVISIBILITY -# define GCC_HASCLASSVISIBILITY -# endif -# endif -#endif - -#ifndef SWIGEXPORT -# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) -# if defined(STATIC_LINKED) -# define SWIGEXPORT -# else -# define SWIGEXPORT __declspec(dllexport) -# endif -# else -# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) -# define SWIGEXPORT __attribute__ ((visibility("default"))) -# else -# define SWIGEXPORT -# endif -# endif -#endif - -/* calling conventions for Windows */ -#ifndef SWIGSTDCALL -# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) -# define SWIGSTDCALL __stdcall -# else -# define SWIGSTDCALL -# endif -#endif - -/* Deal with Microsoft's attempt at deprecating C standard runtime functions */ -#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) -# define _CRT_SECURE_NO_DEPRECATE -#endif - -/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ -#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) -# define _SCL_SECURE_NO_DEPRECATE -#endif - -/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */ -#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES) -# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0 -#endif - -/* Intel's compiler complains if a variable which was never initialised is - * cast to void, which is a common idiom which we use to indicate that we - * are aware a variable isn't used. So we just silence that warning. - * See: https://github.com/swig/swig/issues/192 for more discussion. - */ -#ifdef __INTEL_COMPILER -# pragma warning disable 592 -#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(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG) -/* Use debug wrappers with the Python release dll */ -# undef _DEBUG -# include -# define _DEBUG 1 -#else -# include -#endif - -/* ----------------------------------------------------------------------------- - * swigrun.swg - * - * This file contains generic C API SWIG runtime support for pointer - * type checking. - * ----------------------------------------------------------------------------- */ - -/* This should only be incremented when either the layout of swig_type_info changes, - or for whatever reason, the runtime changes incompatibly */ -#define SWIG_RUNTIME_VERSION "4" - -/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ -#ifdef SWIG_TYPE_TABLE -# define SWIG_QUOTE_STRING(x) #x -# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x) -# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE) -#else -# define SWIG_TYPE_TABLE_NAME -#endif - -/* - You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for - creating a static or dynamic library from the SWIG runtime code. - In 99.9% of the cases, SWIG just needs to declare them as 'static'. - - But only do this if strictly necessary, ie, if you have problems - with your compiler or suchlike. -*/ - -#ifndef SWIGRUNTIME -# define SWIGRUNTIME SWIGINTERN -#endif - -#ifndef SWIGRUNTIMEINLINE -# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE -#endif - -/* Generic buffer size */ -#ifndef SWIG_BUFFER_SIZE -# define SWIG_BUFFER_SIZE 1024 -#endif - -/* Flags for pointer conversions */ -#define SWIG_POINTER_DISOWN 0x1 -#define SWIG_CAST_NEW_MEMORY 0x2 -#define SWIG_POINTER_NO_NULL 0x4 - -/* Flags for new pointer objects */ -#define SWIG_POINTER_OWN 0x1 - - -/* - Flags/methods for returning states. - - The SWIG conversion methods, as ConvertPtr, return an integer - that tells if the conversion was successful or not. And if not, - an error code can be returned (see swigerrors.swg for the codes). - - Use the following macros/flags to set or process the returning - states. - - In old versions of SWIG, code such as the following was usually written: - - if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { - // success code - } else { - //fail code - } - - Now you can be more explicit: - - int res = SWIG_ConvertPtr(obj,vptr,ty.flags); - if (SWIG_IsOK(res)) { - // success code - } else { - // fail code - } - - which is the same really, but now you can also do - - Type *ptr; - int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags); - if (SWIG_IsOK(res)) { - // success code - if (SWIG_IsNewObj(res) { - ... - delete *ptr; - } else { - ... - } - } else { - // fail code - } - - I.e., now SWIG_ConvertPtr can return new objects and you can - identify the case and take care of the deallocation. Of course that - also requires SWIG_ConvertPtr to return new result values, such as - - int SWIG_ConvertPtr(obj, ptr,...) { - if () { - if () { - *ptr = ; - return SWIG_NEWOBJ; - } else { - *ptr = ; - return SWIG_OLDOBJ; - } - } else { - return SWIG_BADOBJ; - } - } - - Of course, returning the plain '0(success)/-1(fail)' still works, but you can be - more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the - 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 - - int food(double) - int fooi(int); - - and you call - - food(1) // cast rank '1' (1 -> 1.0) - fooi(1) // cast rank '0' - - just use the SWIG_AddCast()/SWIG_CheckState() -*/ - -#define SWIG_OK (0) -#define SWIG_ERROR (-1) -#define SWIG_IsOK(r) (r >= 0) -#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError) - -/* The CastRankLimit says how many bits are used for the cast rank */ -#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 */ -#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 */ -#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)) -#define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r) -#define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r) -#define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK)) - -/* Cast-Rank Mode */ -#if defined(SWIG_CASTRANK_MODE) -# ifndef SWIG_TypeRank -# define SWIG_TypeRank unsigned long -# endif -# ifndef SWIG_MAXCASTRANK /* Default cast allowed */ -# define SWIG_MAXCASTRANK (2) -# endif -# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1) -# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK) -SWIGINTERNINLINE int SWIG_AddCast(int r) { - return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r; -} -SWIGINTERNINLINE int SWIG_CheckState(int r) { - return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; -} -#else /* no cast-rank mode */ -# define SWIG_AddCast(r) (r) -# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0) -#endif - - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void *(*swig_converter_func)(void *, int *); -typedef struct swig_type_info *(*swig_dycast_func)(void **); - -/* Structure to store information on one type */ -typedef struct swig_type_info { - const char *name; /* mangled name of this type */ - const char *str; /* human readable name of this type */ - swig_dycast_func dcast; /* dynamic cast function down a hierarchy */ - struct swig_cast_info *cast; /* linked list of types that can cast into this type */ - void *clientdata; /* language specific type data */ - int owndata; /* flag if the structure owns the clientdata */ -} swig_type_info; - -/* Structure to store a type and conversion function used for casting */ -typedef struct swig_cast_info { - swig_type_info *type; /* pointer to type that is equivalent to this type */ - swig_converter_func converter; /* function to cast the void pointers */ - struct swig_cast_info *next; /* pointer to next cast in linked list */ - struct swig_cast_info *prev; /* pointer to the previous cast */ -} swig_cast_info; - -/* Structure used to store module information - * Each module generates one structure like this, and the runtime collects - * all of these structures and stores them in a circularly linked list.*/ -typedef struct swig_module_info { - swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */ - size_t size; /* Number of types in this module */ - struct swig_module_info *next; /* Pointer to next element in circularly linked list */ - swig_type_info **type_initial; /* Array of initially generated type structures */ - swig_cast_info **cast_initial; /* Array of initially generated casting structures */ - void *clientdata; /* Language specific module data */ -} swig_module_info; - -/* - Compare two type names skipping the space characters, therefore - "char*" == "char *" and "Class" == "Class", etc. - - Return 0 when the two name types are equivalent, as in - strncmp, but skipping ' '. -*/ -SWIGRUNTIME int -SWIG_TypeNameComp(const char *f1, const char *l1, - const char *f2, const char *l2) { - for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) { - while ((*f1 == ' ') && (f1 != l1)) ++f1; - while ((*f2 == ' ') && (f2 != l2)) ++f2; - if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1; - } - return (int)((l1 - f1) - (l2 - f2)); -} - -/* - Check type equivalence in a name list like ||... - Return 0 if equal, -1 if nb < tb, 1 if nb > tb -*/ -SWIGRUNTIME int -SWIG_TypeCmp(const char *nb, const char *tb) { - int equiv = 1; - const char* te = tb + strlen(tb); - const char* ne = nb; - while (equiv != 0 && *ne) { - for (nb = ne; *ne; ++ne) { - if (*ne == '|') break; - } - equiv = SWIG_TypeNameComp(nb, ne, tb, te); - if (*ne) ++ne; - } - return equiv; -} - -/* - Check type equivalence in a name list like ||... - Return 0 if not equal, 1 if equal -*/ -SWIGRUNTIME int -SWIG_TypeEquiv(const char *nb, const char *tb) { - return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0; -} - -/* - Check the typename -*/ -SWIGRUNTIME swig_cast_info * -SWIG_TypeCheck(const char *c, swig_type_info *ty) { - if (ty) { - swig_cast_info *iter = ty->cast; - while (iter) { - if (strcmp(iter->type->name, c) == 0) { - #if 0 - if (iter == ty->cast) - return iter; - /* Move iter to the top of the linked list */ - iter->prev->next = iter->next; - if (iter->next) - iter->next->prev = iter->prev; - iter->next = ty->cast; - iter->prev = 0; - if (ty->cast) ty->cast->prev = iter; - ty->cast = iter; - #endif - return iter; - } - iter = iter->next; - } - } - return 0; -} - -/* - 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) { - if (ty) { - swig_cast_info *iter = ty->cast; - while (iter) { - if (iter->type == from) { - #if 0 - if (iter == ty->cast) - return iter; - /* Move iter to the top of the linked list */ - iter->prev->next = iter->next; - if (iter->next) - iter->next->prev = iter->prev; - iter->next = ty->cast; - iter->prev = 0; - if (ty->cast) ty->cast->prev = iter; - ty->cast = iter; - #endif - return iter; - } - iter = iter->next; - } - } - return 0; -} - -/* - Cast a pointer up an inheritance hierarchy -*/ -SWIGRUNTIMEINLINE void * -SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) { - return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory); -} - -/* - Dynamic pointer casting. Down an inheritance hierarchy -*/ -SWIGRUNTIME swig_type_info * -SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) { - swig_type_info *lastty = ty; - if (!ty || !ty->dcast) return ty; - while (ty && (ty->dcast)) { - ty = (*ty->dcast)(ptr); - if (ty) lastty = ty; - } - return lastty; -} - -/* - Return the name associated with this type -*/ -SWIGRUNTIMEINLINE const char * -SWIG_TypeName(const swig_type_info *ty) { - return ty->name; -} - -/* - Return the pretty name associated with this type, - that is an unmangled type name in a form presentable to the user. -*/ -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. */ - if (!type) return NULL; - if (type->str != NULL) { - const char *last_name = type->str; - const char *s; - for (s = type->str; *s; s++) - if (*s == '|') last_name = s+1; - return last_name; - } - else - return type->name; -} - -/* - Set the clientdata field for a type -*/ -SWIGRUNTIME void -SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { - swig_cast_info *cast = ti->cast; - /* if (ti->clientdata == clientdata) return; */ - ti->clientdata = clientdata; - - while (cast) { - if (!cast->converter) { - swig_type_info *tc = cast->type; - if (!tc->clientdata) { - SWIG_TypeClientData(tc, clientdata); - } - } - cast = cast->next; - } -} -SWIGRUNTIME void -SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) { - SWIG_TypeClientData(ti, clientdata); - ti->owndata = 1; -} - -/* - Search for a swig_type_info structure only by mangled name - Search is a O(log #types) - - We start searching at module start, and finish searching when start == end. - Note: if start == end at the beginning of the function, we go all the way around - the circular list. -*/ -SWIGRUNTIME swig_type_info * -SWIG_MangledTypeQueryModule(swig_module_info *start, - swig_module_info *end, - const char *name) { - swig_module_info *iter = start; - do { - if (iter->size) { - size_t l = 0; - size_t r = iter->size - 1; - do { - /* since l+r >= 0, we can (>> 1) instead (/ 2) */ - size_t i = (l + r) >> 1; - const char *iname = iter->types[i]->name; - if (iname) { - int compare = strcmp(name, iname); - if (compare == 0) { - return iter->types[i]; - } else if (compare < 0) { - if (i) { - r = i - 1; - } else { - break; - } - } else if (compare > 0) { - l = i + 1; - } - } else { - break; /* should never happen */ - } - } while (l <= r); - } - iter = iter->next; - } while (iter != end); - return 0; -} - -/* - Search for a swig_type_info structure for either a mangled name or a human readable name. - It first searches the mangled names of the types, which is a O(log #types) - If a type is not found it then searches the human readable names, which is O(#types). - - We start searching at module start, and finish searching when start == end. - Note: if start == end at the beginning of the function, we go all the way around - the circular list. -*/ -SWIGRUNTIME swig_type_info * -SWIG_TypeQueryModule(swig_module_info *start, - swig_module_info *end, - const char *name) { - /* STEP 1: Search the name field using binary search */ - swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name); - if (ret) { - return ret; - } else { - /* STEP 2: If the type hasn't been found, do a complete search - of the str field (the human readable name) */ - swig_module_info *iter = start; - do { - size_t i = 0; - for (; i < iter->size; ++i) { - if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name))) - return iter->types[i]; - } - iter = iter->next; - } while (iter != end); - } - - /* neither found a match */ - return 0; -} - -/* - Pack binary data into a string -*/ -SWIGRUNTIME char * -SWIG_PackData(char *c, void *ptr, size_t sz) { - static const char hex[17] = "0123456789abcdef"; - const unsigned char *u = (unsigned char *) ptr; - const unsigned char *eu = u + sz; - for (; u != eu; ++u) { - unsigned char uu = *u; - *(c++) = hex[(uu & 0xf0) >> 4]; - *(c++) = hex[uu & 0xf]; - } - return c; -} - -/* - Unpack binary data from a string -*/ -SWIGRUNTIME const char * -SWIG_UnpackData(const char *c, void *ptr, size_t sz) { - unsigned char *u = (unsigned char *) ptr; - const unsigned char *eu = u + sz; - for (; u != eu; ++u) { - char d = *(c++); - unsigned char uu; - if ((d >= '0') && (d <= '9')) - uu = (unsigned char)((d - '0') << 4); - else if ((d >= 'a') && (d <= 'f')) - uu = (unsigned char)((d - ('a'-10)) << 4); - else - return (char *) 0; - d = *(c++); - if ((d >= '0') && (d <= '9')) - uu |= (unsigned char)(d - '0'); - else if ((d >= 'a') && (d <= 'f')) - uu |= (unsigned char)(d - ('a'-10)); - else - return (char *) 0; - *u = uu; - } - return c; -} - -/* - Pack 'void *' into a string buffer. -*/ -SWIGRUNTIME char * -SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) { - char *r = buff; - if ((2*sizeof(void *) + 2) > bsz) return 0; - *(r++) = '_'; - r = SWIG_PackData(r,&ptr,sizeof(void *)); - if (strlen(name) + 1 > (bsz - (r - buff))) return 0; - strcpy(r,name); - return buff; -} - -SWIGRUNTIME const char * -SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) { - if (*c != '_') { - if (strcmp(c,"NULL") == 0) { - *ptr = (void *) 0; - return name; - } else { - return 0; - } - } - return SWIG_UnpackData(++c,ptr,sizeof(void *)); -} - -SWIGRUNTIME char * -SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) { - char *r = buff; - size_t lname = (name ? strlen(name) : 0); - if ((2*sz + 2 + lname) > bsz) return 0; - *(r++) = '_'; - r = SWIG_PackData(r,ptr,sz); - if (lname) { - strncpy(r,name,lname+1); - } else { - *r = 0; - } - return buff; -} - -SWIGRUNTIME const char * -SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { - if (*c != '_') { - if (strcmp(c,"NULL") == 0) { - memset(ptr,0,sz); - return name; - } else { - return 0; - } - } - return SWIG_UnpackData(++c,ptr,sz); -} - -#ifdef __cplusplus -} -#endif - -/* Errors in SWIG */ -#define SWIG_UnknownError -1 -#define SWIG_IOError -2 -#define SWIG_RuntimeError -3 -#define SWIG_IndexError -4 -#define SWIG_TypeError -5 -#define SWIG_DivisionByZero -6 -#define SWIG_OverflowError -7 -#define SWIG_SyntaxError -8 -#define SWIG_ValueError -9 -#define SWIG_SystemError -10 -#define SWIG_AttributeError -11 -#define SWIG_MemoryError -12 -#define SWIG_NullReferenceError -13 - - - -/* Compatibility macros for Python 3 */ -#if PY_VERSION_HEX >= 0x03000000 - -#define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type) -#define PyInt_Check(x) PyLong_Check(x) -#define PyInt_AsLong(x) PyLong_AsLong(x) -#define PyInt_FromLong(x) PyLong_FromLong(x) -#define PyInt_FromSize_t(x) PyLong_FromSize_t(x) -#define PyString_Check(name) PyBytes_Check(name) -#define PyString_FromString(x) PyUnicode_FromString(x) -#define PyString_Format(fmt, args) PyUnicode_Format(fmt, args) -#define PyString_AsString(str) PyBytes_AsString(str) -#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 - -#ifndef Py_TYPE -# define Py_TYPE(op) ((op)->ob_type) -#endif - -/* SWIG APIs for compatibility of both Python 2 & 3 */ - -#if PY_VERSION_HEX >= 0x03000000 -# define SWIG_Python_str_FromFormat PyUnicode_FromFormat -#else -# define SWIG_Python_str_FromFormat PyString_FromFormat -#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 >= 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; -#else - return PyString_AsString(str); -#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) -{ -#if PY_VERSION_HEX >= 0x03000000 - return PyUnicode_FromString(c); -#else - return PyString_FromString(c); -#endif -} - -#ifndef PyObject_DEL -# define PyObject_DEL PyObject_Del -#endif - -// 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) - -#if PY_VERSION_HEX < 0x03020000 -#define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type) -#define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name) -#define Py_hash_t long -#endif - -/* ----------------------------------------------------------------------------- - * error manipulation - * ----------------------------------------------------------------------------- */ - -SWIGRUNTIME PyObject* -SWIG_Python_ErrorType(int code) { - PyObject* type = 0; - switch(code) { - case SWIG_MemoryError: - type = PyExc_MemoryError; - break; - case SWIG_IOError: - type = PyExc_IOError; - break; - case SWIG_RuntimeError: - type = PyExc_RuntimeError; - break; - case SWIG_IndexError: - type = PyExc_IndexError; - break; - case SWIG_TypeError: - type = PyExc_TypeError; - break; - case SWIG_DivisionByZero: - type = PyExc_ZeroDivisionError; - break; - case SWIG_OverflowError: - type = PyExc_OverflowError; - break; - case SWIG_SyntaxError: - type = PyExc_SyntaxError; - break; - case SWIG_ValueError: - type = PyExc_ValueError; - break; - case SWIG_SystemError: - type = PyExc_SystemError; - break; - case SWIG_AttributeError: - type = PyExc_AttributeError; - break; - default: - type = PyExc_RuntimeError; - } - return type; -} - - -SWIGRUNTIME void -SWIG_Python_AddErrorMsg(const char* mesg) -{ - PyObject *type = 0; - PyObject *value = 0; - PyObject *traceback = 0; - - if (PyErr_Occurred()) - PyErr_Fetch(&type, &value, &traceback); - if (value) { - PyObject *old_str = PyObject_Str(value); - const char *tmp = SWIG_Python_str_AsChar(old_str); - 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_DECREF(old_str); - Py_DECREF(value); - } else { - PyErr_SetString(PyExc_RuntimeError, mesg); - } -} - -SWIGRUNTIME int -SWIG_Python_TypeErrorOccurred(PyObject *obj) -{ - PyObject *error; - if (obj) - return 0; - error = PyErr_Occurred(); - return error && PyErr_GivenExceptionMatches(error, PyExc_TypeError); -} - -SWIGRUNTIME void -SWIG_Python_RaiseOrModifyTypeError(const char *message) -{ - if (SWIG_Python_TypeErrorOccurred(NULL)) { - /* Use existing TypeError to preserve stacktrace and enhance with given message */ - PyObject *newvalue; - PyObject *type = NULL, *value = NULL, *traceback = NULL; - PyErr_Fetch(&type, &value, &traceback); -#if PY_VERSION_HEX >= 0x03000000 - newvalue = PyUnicode_FromFormat("%S\nAdditional information:\n%s", value, message); -#else - newvalue = PyString_FromFormat("%s\nAdditional information:\n%s", PyString_AsString(value), message); -#endif - Py_XDECREF(value); - PyErr_Restore(type, newvalue, traceback); - } else { - /* Raise TypeError using given message */ - PyErr_SetString(PyExc_TypeError, message); - } -} - -#if defined(SWIG_PYTHON_NO_THREADS) -# if defined(SWIG_PYTHON_THREADS) -# undef SWIG_PYTHON_THREADS -# endif -#endif -#if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */ -# if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL) -# 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() -# endif -# ifdef __cplusplus /* C++ code */ - class SWIG_Python_Thread_Block { - bool status; - PyGILState_STATE state; - public: - void end() { if (status) { PyGILState_Release(state); status = false;} } - SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {} - ~SWIG_Python_Thread_Block() { end(); } - }; - class SWIG_Python_Thread_Allow { - bool status; - PyThreadState *save; - public: - void end() { if (status) { PyEval_RestoreThread(save); status = false; }} - SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {} - ~SWIG_Python_Thread_Allow() { end(); } - }; -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK SWIG_Python_Thread_Block _swig_thread_block -# define SWIG_PYTHON_THREAD_END_BLOCK _swig_thread_block.end() -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW SWIG_Python_Thread_Allow _swig_thread_allow -# define SWIG_PYTHON_THREAD_END_ALLOW _swig_thread_allow.end() -# else /* C code */ -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK PyGILState_STATE _swig_thread_block = PyGILState_Ensure() -# define SWIG_PYTHON_THREAD_END_BLOCK PyGILState_Release(_swig_thread_block) -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW PyThreadState *_swig_thread_allow = PyEval_SaveThread() -# define SWIG_PYTHON_THREAD_END_ALLOW PyEval_RestoreThread(_swig_thread_allow) -# endif -# else /* Old thread way, not implemented, user must provide it */ -# if !defined(SWIG_PYTHON_INITIALIZE_THREADS) -# define SWIG_PYTHON_INITIALIZE_THREADS -# endif -# if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK) -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK -# endif -# if !defined(SWIG_PYTHON_THREAD_END_BLOCK) -# define SWIG_PYTHON_THREAD_END_BLOCK -# endif -# if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW) -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW -# endif -# if !defined(SWIG_PYTHON_THREAD_END_ALLOW) -# define SWIG_PYTHON_THREAD_END_ALLOW -# endif -# endif -#else /* No thread support */ -# define SWIG_PYTHON_INITIALIZE_THREADS -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK -# define SWIG_PYTHON_THREAD_END_BLOCK -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW -# define SWIG_PYTHON_THREAD_END_ALLOW -#endif - -/* ----------------------------------------------------------------------------- - * Python API portion that goes into the runtime - * ----------------------------------------------------------------------------- */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* ----------------------------------------------------------------------------- - * Constant declarations - * ----------------------------------------------------------------------------- */ - -/* Constant Types */ -#define SWIG_PY_POINTER 4 -#define SWIG_PY_BINARY 5 - -/* Constant information structure */ -typedef struct swig_const_info { - int type; - const char *name; - long lvalue; - double dvalue; - void *pvalue; - swig_type_info **ptype; -} swig_const_info; - -#ifdef __cplusplus -} -#endif - - -/* ----------------------------------------------------------------------------- - * pyrun.swg - * - * This file contains the runtime support for Python modules - * and includes code for managing global variables and pointer - * type checking. - * - * ----------------------------------------------------------------------------- */ - -#if PY_VERSION_HEX < 0x02070000 /* 2.7.0 */ -# 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" -#endif - -/* Common SWIG API */ - -/* for raw pointers */ -#define SWIG_Python_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0) -#define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtr(obj, pptr, type, flags) -#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own) - -#ifdef SWIGPYTHON_BUILTIN -#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(self, ptr, type, flags) -#else -#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags) -#endif - -#define SWIG_InternalNewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags) - -#define SWIG_CheckImplicit(ty) SWIG_Python_CheckImplicit(ty) -#define SWIG_AcquirePtr(ptr, src) SWIG_Python_AcquirePtr(ptr, src) -#define swig_owntype int - -/* for raw packed data */ -#define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) - -/* for class or struct pointers */ -#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags) -#define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags) - -/* for C or C++ function pointers */ -#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_Python_ConvertFunctionPtr(obj, pptr, type) -#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Python_NewPointerObj(NULL, ptr, type, 0) - -/* for C++ member pointers, ie, member methods */ -#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewMemberObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) - - -/* Runtime API */ - -#define SWIG_GetModule(clientdata) SWIG_Python_GetModule(clientdata) -#define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer) -#define SWIG_NewClientData(obj) SwigPyClientData_New(obj) - -#define SWIG_SetErrorObj SWIG_Python_SetErrorObj -#define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg -#define SWIG_ErrorType(code) SWIG_Python_ErrorType(code) -#define SWIG_Error(code, msg) SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg) -#define SWIG_fail goto fail - - -/* Runtime API implementation */ - -/* Error manipulation */ - -SWIGINTERN void -SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - PyErr_SetObject(errtype, obj); - Py_DECREF(obj); - SWIG_PYTHON_THREAD_END_BLOCK; -} - -SWIGINTERN void -SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - PyErr_SetString(errtype, msg); - SWIG_PYTHON_THREAD_END_BLOCK; -} - -#define SWIG_Python_Raise(obj, type, desc) SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj) - -/* Set a constant value */ - -#if defined(SWIGPYTHON_BUILTIN) - -SWIGINTERN void -SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) { - PyObject *s = PyString_InternFromString(key); - PyList_Append(seq, s); - Py_DECREF(s); -} - -SWIGINTERN void -SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) { - PyDict_SetItemString(d, name, obj); - Py_DECREF(obj); - if (public_interface) - SwigPyBuiltin_AddPublicSymbol(public_interface, name); -} - -#else - -SWIGINTERN void -SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) { - PyDict_SetItemString(d, name, obj); - Py_DECREF(obj); -} - -#endif - -/* Append a value to the result obj */ - -SWIGINTERN PyObject* -SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) { - if (!result) { - result = obj; - } else if (result == Py_None) { - Py_DECREF(result); - result = obj; - } else { - if (!PyList_Check(result)) { - PyObject *o2 = result; - result = PyList_New(1); - PyList_SetItem(result, 0, o2); - } - PyList_Append(result,obj); - Py_DECREF(obj); - } - return result; -} - -/* Unpack the argument tuple */ - -SWIGINTERN Py_ssize_t -SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs) -{ - if (!args) { - if (!min && !max) { - return 1; - } else { - PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none", - name, (min == max ? "" : "at least "), (int)min); - return 0; - } - } - if (!PyTuple_Check(args)) { - if (min <= 1 && max >= 1) { - Py_ssize_t i; - objs[0] = args; - for (i = 1; i < max; ++i) { - objs[i] = 0; - } - return 2; - } - PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple"); - return 0; - } else { - Py_ssize_t l = PyTuple_GET_SIZE(args); - if (l < min) { - PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", - name, (min == max ? "" : "at least "), (int)min, (int)l); - return 0; - } else if (l > max) { - PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", - name, (min == max ? "" : "at most "), (int)max, (int)l); - return 0; - } else { - Py_ssize_t i; - for (i = 0; i < l; ++i) { - objs[i] = PyTuple_GET_ITEM(args, i); - } - for (; l < max; ++l) { - objs[l] = 0; - } - return i + 1; - } - } -} - -/* A functor is a function object with one single object argument */ -#define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL); - -/* - Helper for static pointer initialization for both C and C++ code, for example - static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...); -*/ -#ifdef __cplusplus -#define SWIG_STATIC_POINTER(var) var -#else -#define SWIG_STATIC_POINTER(var) var = 0; if (!var) var -#endif - -/* ----------------------------------------------------------------------------- - * Pointer declarations - * ----------------------------------------------------------------------------- */ - -/* Flags for new pointer objects */ -#define SWIG_POINTER_NOSHADOW (SWIG_POINTER_OWN << 1) -#define SWIG_POINTER_NEW (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN) - -#define SWIG_POINTER_IMPLICIT_CONV (SWIG_POINTER_DISOWN << 1) - -#define SWIG_BUILTIN_TP_INIT (SWIG_POINTER_OWN << 2) -#define SWIG_BUILTIN_INIT (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN) - -#ifdef __cplusplus -extern "C" { -#endif - -/* The python void return value */ - -SWIGRUNTIMEINLINE PyObject * -SWIG_Py_Void(void) -{ - PyObject *none = Py_None; - Py_INCREF(none); - return none; -} - -/* SwigPyClientData */ - -typedef struct { - PyObject *klass; - PyObject *newraw; - PyObject *newargs; - PyObject *destroy; - int delargs; - int implicitconv; - PyTypeObject *pytype; -} SwigPyClientData; - -SWIGRUNTIMEINLINE int -SWIG_Python_CheckImplicit(swig_type_info *ty) -{ - SwigPyClientData *data = (SwigPyClientData *)ty->clientdata; - int fail = data ? data->implicitconv : 0; - if (fail) - PyErr_SetString(PyExc_TypeError, "Implicit conversion is prohibited for explicit constructors."); - return fail; -} - -SWIGRUNTIMEINLINE PyObject * -SWIG_Python_ExceptionType(swig_type_info *desc) { - SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0; - PyObject *klass = data ? data->klass : 0; - return (klass ? klass : PyExc_RuntimeError); -} - - -SWIGRUNTIME SwigPyClientData * -SwigPyClientData_New(PyObject* obj) -{ - if (!obj) { - return 0; - } else { - SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData)); - /* the klass element */ - data->klass = obj; - Py_INCREF(data->klass); - /* 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); - } 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); - } else { - data->newargs = obj; - } - Py_INCREF(data->newargs); - } - /* the destroy method, aka as the C++ delete method */ - data->destroy = PyObject_GetAttrString(data->klass, "__swig_destroy__"); - if (PyErr_Occurred()) { - PyErr_Clear(); - data->destroy = 0; - } - if (data->destroy) { - int flags; - Py_INCREF(data->destroy); - flags = PyCFunction_GET_FLAGS(data->destroy); - data->delargs = !(flags & (METH_O)); - } else { - data->delargs = 0; - } - data->implicitconv = 0; - data->pytype = 0; - return data; - } -} - -SWIGRUNTIME void -SwigPyClientData_Del(SwigPyClientData *data) { - Py_XDECREF(data->newraw); - Py_XDECREF(data->newargs); - Py_XDECREF(data->destroy); -} - -/* =============== SwigPyObject =====================*/ - -typedef struct { - PyObject_HEAD - void *ptr; - swig_type_info *ty; - int own; - PyObject *next; -#ifdef SWIGPYTHON_BUILTIN - PyObject *dict; -#endif -} SwigPyObject; - - -#ifdef SWIGPYTHON_BUILTIN - -SWIGRUNTIME PyObject * -SwigPyObject_get___dict__(PyObject *v, PyObject *SWIGUNUSEDPARM(args)) -{ - SwigPyObject *sobj = (SwigPyObject *)v; - - if (!sobj->dict) - sobj->dict = PyDict_New(); - - Py_INCREF(sobj->dict); - return sobj->dict; -} - -#endif - -SWIGRUNTIME PyObject * -SwigPyObject_long(SwigPyObject *v) -{ - return PyLong_FromVoidPtr(v->ptr); -} - -SWIGRUNTIME PyObject * -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); - if (ofmt) { -#if PY_VERSION_HEX >= 0x03000000 - res = PyUnicode_Format(ofmt,args); -#else - res = PyString_Format(ofmt,args); -#endif - Py_DECREF(ofmt); - } - Py_DECREF(args); - } - } - return res; -} - -SWIGRUNTIME PyObject * -SwigPyObject_oct(SwigPyObject *v) -{ - return SwigPyObject_format("%o",v); -} - -SWIGRUNTIME PyObject * -SwigPyObject_hex(SwigPyObject *v) -{ - return SwigPyObject_format("%x",v); -} - -SWIGRUNTIME PyObject * -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) { - PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next); -# if PY_VERSION_HEX >= 0x03000000 - PyObject *joined = PyUnicode_Concat(repr, nrep); - Py_DecRef(repr); - Py_DecRef(nrep); - repr = joined; -# else - PyString_ConcatAndDel(&repr,nrep); -# endif - } - return repr; -} - -/* We need a version taking two PyObject* parameters so it's a valid - * PyCFunction to use in swigobject_methods[]. */ -SWIGRUNTIME PyObject * -SwigPyObject_repr2(PyObject *v, PyObject *SWIGUNUSEDPARM(args)) -{ - return SwigPyObject_repr((SwigPyObject*)v); -} - -SWIGRUNTIME int -SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w) -{ - void *i = v->ptr; - void *j = w->ptr; - return (i < j) ? -1 : ((i > j) ? 1 : 0); -} - -/* Added for Python 3.x, would it also be useful for Python 2.x? */ -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; - } - res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0); - return res; -} - - -SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void); - -#ifdef SWIGPYTHON_BUILTIN -static swig_type_info *SwigPyObject_stype = 0; -SWIGRUNTIME PyTypeObject* -SwigPyObject_type(void) { - SwigPyClientData *cd; - assert(SwigPyObject_stype); - cd = (SwigPyClientData*) SwigPyObject_stype->clientdata; - assert(cd); - assert(cd->pytype); - return cd->pytype; -} -#else -SWIGRUNTIME PyTypeObject* -SwigPyObject_type(void) { - static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyObject_TypeOnce(); - return type; -} -#endif - -SWIGRUNTIMEINLINE int -SwigPyObject_Check(PyObject *op) { -#ifdef SWIGPYTHON_BUILTIN - PyTypeObject *target_tp = SwigPyObject_type(); - if (PyType_IsSubtype(op->ob_type, target_tp)) - return 1; - return (strcmp(op->ob_type->tp_name, "SwigPyObject") == 0); -#else - return (Py_TYPE(op) == SwigPyObject_type()) - || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0); -#endif -} - -SWIGRUNTIME PyObject * -SwigPyObject_New(void *ptr, swig_type_info *ty, int own); - -SWIGRUNTIME void -SwigPyObject_dealloc(PyObject *v) -{ - SwigPyObject *sobj = (SwigPyObject *) v; - PyObject *next = sobj->next; - if (sobj->own == SWIG_POINTER_OWN) { - swig_type_info *ty = sobj->ty; - SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; - PyObject *destroy = data ? data->destroy : 0; - if (destroy) { - /* destroy is always a VARARGS method */ - PyObject *res; - - /* PyObject_CallFunction() has the potential to silently drop - the active exception. In cases of unnamed temporary - variable or where we just finished iterating over a generator - StopIteration will be active right now, and this needs to - remain true upon return from SwigPyObject_dealloc. So save - and restore. */ - - PyObject *type = NULL, *value = NULL, *traceback = NULL; - PyErr_Fetch(&type, &value, &traceback); - - 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); - } else { - PyCFunction meth = PyCFunction_GET_FUNCTION(destroy); - PyObject *mself = PyCFunction_GET_SELF(destroy); - res = ((*meth)(mself, v)); - } - if (!res) - PyErr_WriteUnraisable(destroy); - - PyErr_Restore(type, value, traceback); - - Py_XDECREF(res); - } -#if !defined(SWIG_PYTHON_SILENT_MEMLEAK) - else { - const char *name = SWIG_TypePrettyName(ty); - printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown")); - } -#endif - } - Py_XDECREF(next); - PyObject_DEL(v); -} - -SWIGRUNTIME PyObject* -SwigPyObject_append(PyObject* v, PyObject* next) -{ - SwigPyObject *sobj = (SwigPyObject *) v; - if (!SwigPyObject_Check(next)) { - PyErr_SetString(PyExc_TypeError, "Attempt to append a non SwigPyObject"); - return NULL; - } - sobj->next = next; - Py_INCREF(next); - return SWIG_Py_Void(); -} - -SWIGRUNTIME PyObject* -SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) -{ - SwigPyObject *sobj = (SwigPyObject *) v; - if (sobj->next) { - Py_INCREF(sobj->next); - return sobj->next; - } else { - return SWIG_Py_Void(); - } -} - -SWIGINTERN PyObject* -SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) -{ - SwigPyObject *sobj = (SwigPyObject *)v; - sobj->own = 0; - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject* -SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) -{ - SwigPyObject *sobj = (SwigPyObject *)v; - sobj->own = SWIG_POINTER_OWN; - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject* -SwigPyObject_own(PyObject *v, PyObject *args) -{ - PyObject *val = 0; - if (!PyArg_UnpackTuple(args, "own", 0, 1, &val)) { - return NULL; - } else { - SwigPyObject *sobj = (SwigPyObject *)v; - PyObject *obj = PyBool_FromLong(sobj->own); - if (val) { - if (PyObject_IsTrue(val)) { - SwigPyObject_acquire(v,args); - } else { - SwigPyObject_disown(v,args); - } - } - return obj; - } -} - -static PyMethodDef -swigobject_methods[] = { - {"disown", SwigPyObject_disown, METH_NOARGS, "releases ownership of the pointer"}, - {"acquire", SwigPyObject_acquire, METH_NOARGS, "acquires ownership of the pointer"}, - {"own", SwigPyObject_own, METH_VARARGS, "returns/sets ownership of the pointer"}, - {"append", SwigPyObject_append, METH_O, "appends another 'this' object"}, - {"next", SwigPyObject_next, METH_NOARGS, "returns the next 'this' object"}, - {"__repr__",SwigPyObject_repr2, METH_NOARGS, "returns object representation"}, - {0, 0, 0, 0} -}; - -SWIGRUNTIME PyTypeObject* -SwigPyObject_TypeOnce(void) { - static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer"; - - static PyNumberMethods SwigPyObject_as_number = { - (binaryfunc)0, /*nb_add*/ - (binaryfunc)0, /*nb_subtract*/ - (binaryfunc)0, /*nb_multiply*/ - /* nb_divide removed in Python 3 */ -#if PY_VERSION_HEX < 0x03000000 - (binaryfunc)0, /*nb_divide*/ -#endif - (binaryfunc)0, /*nb_remainder*/ - (binaryfunc)0, /*nb_divmod*/ - (ternaryfunc)0,/*nb_power*/ - (unaryfunc)0, /*nb_negative*/ - (unaryfunc)0, /*nb_positive*/ - (unaryfunc)0, /*nb_absolute*/ - (inquiry)0, /*nb_nonzero*/ - 0, /*nb_invert*/ - 0, /*nb_lshift*/ - 0, /*nb_rshift*/ - 0, /*nb_and*/ - 0, /*nb_xor*/ - 0, /*nb_or*/ -#if PY_VERSION_HEX < 0x03000000 - 0, /*nb_coerce*/ -#endif - (unaryfunc)SwigPyObject_long, /*nb_int*/ -#if PY_VERSION_HEX < 0x03000000 - (unaryfunc)SwigPyObject_long, /*nb_long*/ -#else - 0, /*nb_reserved*/ -#endif - (unaryfunc)0, /*nb_float*/ -#if PY_VERSION_HEX < 0x03000000 - (unaryfunc)SwigPyObject_oct, /*nb_oct*/ - (unaryfunc)SwigPyObject_hex, /*nb_hex*/ -#endif -#if PY_VERSION_HEX >= 0x03050000 /* 3.5 */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_matrix_multiply */ -#elif PY_VERSION_HEX >= 0x03000000 /* 3.0 */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */ -#else - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */ -#endif - }; - - static PyTypeObject swigpyobject_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 - "SwigPyObject", /* tp_name */ - sizeof(SwigPyObject), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)SwigPyObject_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - (getattrfunc)0, /* tp_getattr */ - (setattrfunc)0, /* tp_setattr */ -#if PY_VERSION_HEX >= 0x03000000 - 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */ -#else - (cmpfunc)SwigPyObject_compare, /* tp_compare */ -#endif - (reprfunc)SwigPyObject_repr, /* tp_repr */ - &SwigPyObject_as_number, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)0, /* tp_hash */ - (ternaryfunc)0, /* tp_call */ - 0, /* tp_str */ - PyObject_GenericGetAttr, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - swigobject_doc, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)SwigPyObject_richcompare,/* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - swigobject_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - 0, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - 0, /* tp_free */ - 0, /* tp_is_gc */ - 0, /* tp_bases */ - 0, /* tp_mro */ - 0, /* tp_cache */ - 0, /* tp_subclasses */ - 0, /* 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 - }; - swigpyobject_type = tmp; - type_init = 1; - if (PyType_Ready(&swigpyobject_type) < 0) - return NULL; - } - return &swigpyobject_type; -} - -SWIGRUNTIME PyObject * -SwigPyObject_New(void *ptr, swig_type_info *ty, int own) -{ - SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type()); - if (sobj) { - sobj->ptr = ptr; - sobj->ty = ty; - sobj->own = own; - sobj->next = 0; - } - return (PyObject *)sobj; -} - -/* ----------------------------------------------------------------------------- - * Implements a simple Swig Packed type, and use it instead of string - * ----------------------------------------------------------------------------- */ - -typedef struct { - PyObject_HEAD - void *pack; - swig_type_info *ty; - size_t size; -} SwigPyPacked; - -SWIGRUNTIME PyObject * -SwigPyPacked_repr(SwigPyPacked *v) -{ - char result[SWIG_BUFFER_SIZE]; - if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) { - return SWIG_Python_str_FromFormat("", result, v->ty->name); - } else { - return SWIG_Python_str_FromFormat("", v->ty->name); - } -} - -SWIGRUNTIME PyObject * -SwigPyPacked_str(SwigPyPacked *v) -{ - char result[SWIG_BUFFER_SIZE]; - if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){ - return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name); - } else { - return SWIG_Python_str_FromChar(v->ty->name); - } -} - -SWIGRUNTIME int -SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w) -{ - size_t i = v->size; - size_t j = w->size; - int s = (i < j) ? -1 : ((i > j) ? 1 : 0); - return s ? s : strncmp((const char *)v->pack, (const char *)w->pack, 2*v->size); -} - -SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void); - -SWIGRUNTIME PyTypeObject* -SwigPyPacked_type(void) { - static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyPacked_TypeOnce(); - return type; -} - -SWIGRUNTIMEINLINE int -SwigPyPacked_Check(PyObject *op) { - return ((op)->ob_type == SwigPyPacked_TypeOnce()) - || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0); -} - -SWIGRUNTIME void -SwigPyPacked_dealloc(PyObject *v) -{ - if (SwigPyPacked_Check(v)) { - SwigPyPacked *sobj = (SwigPyPacked *) v; - free(sobj->pack); - } - PyObject_DEL(v); -} - -SWIGRUNTIME PyTypeObject* -SwigPyPacked_TypeOnce(void) { - static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer"; - static PyTypeObject swigpypacked_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 - "SwigPyPacked", /* tp_name */ - sizeof(SwigPyPacked), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)SwigPyPacked_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - (getattrfunc)0, /* tp_getattr */ - (setattrfunc)0, /* tp_setattr */ -#if PY_VERSION_HEX>=0x03000000 - 0, /* tp_reserved in 3.0.1 */ -#else - (cmpfunc)SwigPyPacked_compare, /* tp_compare */ -#endif - (reprfunc)SwigPyPacked_repr, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)0, /* tp_hash */ - (ternaryfunc)0, /* tp_call */ - (reprfunc)SwigPyPacked_str, /* tp_str */ - PyObject_GenericGetAttr, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - swigpacked_doc, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - 0, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - 0, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - 0, /* tp_free */ - 0, /* tp_is_gc */ - 0, /* tp_bases */ - 0, /* tp_mro */ - 0, /* tp_cache */ - 0, /* tp_subclasses */ - 0, /* 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 - }; - swigpypacked_type = tmp; - type_init = 1; - if (PyType_Ready(&swigpypacked_type) < 0) - return NULL; - } - return &swigpypacked_type; -} - -SWIGRUNTIME PyObject * -SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty) -{ - SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type()); - if (sobj) { - void *pack = malloc(size); - if (pack) { - memcpy(pack, ptr, size); - sobj->pack = pack; - sobj->ty = ty; - sobj->size = size; - } else { - PyObject_DEL((PyObject *) sobj); - sobj = 0; - } - } - return (PyObject *) sobj; -} - -SWIGRUNTIME swig_type_info * -SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size) -{ - if (SwigPyPacked_Check(obj)) { - SwigPyPacked *sobj = (SwigPyPacked *)obj; - if (sobj->size != size) return 0; - memcpy(ptr, sobj->pack, size); - return sobj->ty; - } else { - return 0; - } -} - -/* ----------------------------------------------------------------------------- - * pointers/data manipulation - * ----------------------------------------------------------------------------- */ - -static PyObject *Swig_This_global = NULL; - -SWIGRUNTIME PyObject * -SWIG_This(void) -{ - if (Swig_This_global == NULL) - Swig_This_global = SWIG_Python_str_FromChar("this"); - return Swig_This_global; -} - -/* #define SWIG_PYTHON_SLOW_GETSET_THIS */ - -/* TODO: I don't know how to implement the fast getset in Python 3 right now */ -#if PY_VERSION_HEX>=0x03000000 -#define SWIG_PYTHON_SLOW_GETSET_THIS -#endif - -SWIGRUNTIME SwigPyObject * -SWIG_Python_GetSwigThis(PyObject *pyobj) -{ - PyObject *obj; - - if (SwigPyObject_Check(pyobj)) - return (SwigPyObject *) pyobj; - -#ifdef SWIGPYTHON_BUILTIN - (void)obj; -# ifdef PyWeakref_CheckProxy - if (PyWeakref_CheckProxy(pyobj)) { - pyobj = PyWeakref_GET_OBJECT(pyobj); - if (pyobj && SwigPyObject_Check(pyobj)) - return (SwigPyObject*) pyobj; - } -# endif - return NULL; -#else - - obj = 0; - -#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS) - if (PyInstance_Check(pyobj)) { - obj = _PyInstance_Lookup(pyobj, SWIG_This()); - } else { - PyObject **dictptr = _PyObject_GetDictPtr(pyobj); - if (dictptr != NULL) { - PyObject *dict = *dictptr; - obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0; - } else { -#ifdef PyWeakref_CheckProxy - if (PyWeakref_CheckProxy(pyobj)) { - PyObject *wobj = PyWeakref_GET_OBJECT(pyobj); - return wobj ? SWIG_Python_GetSwigThis(wobj) : 0; - } -#endif - obj = PyObject_GetAttr(pyobj,SWIG_This()); - if (obj) { - Py_DECREF(obj); - } else { - if (PyErr_Occurred()) PyErr_Clear(); - return 0; - } - } - } -#else - obj = PyObject_GetAttr(pyobj,SWIG_This()); - if (obj) { - Py_DECREF(obj); - } else { - if (PyErr_Occurred()) PyErr_Clear(); - return 0; - } -#endif - if (obj && !SwigPyObject_Check(obj)) { - /* a PyObject is called 'this', try to get the 'real this' - SwigPyObject from it */ - return SWIG_Python_GetSwigThis(obj); - } - return (SwigPyObject *)obj; -#endif -} - -/* Acquire a pointer value */ - -SWIGRUNTIME int -SWIG_Python_AcquirePtr(PyObject *obj, int own) { - if (own == SWIG_POINTER_OWN) { - SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj); - if (sobj) { - int oldown = sobj->own; - sobj->own = own; - return oldown; - } - } - return 0; -} - -/* Convert a pointer value */ - -SWIGRUNTIME int -SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) { - int res; - SwigPyObject *sobj; - int implicit_conv = (flags & SWIG_POINTER_IMPLICIT_CONV) != 0; - - if (!obj) - return SWIG_ERROR; - if (obj == Py_None && !implicit_conv) { - if (ptr) - *ptr = 0; - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - } - - res = SWIG_ERROR; - - sobj = SWIG_Python_GetSwigThis(obj); - if (own) - *own = 0; - while (sobj) { - void *vptr = sobj->ptr; - if (ty) { - swig_type_info *to = sobj->ty; - if (to == ty) { - /* no type cast needed */ - if (ptr) *ptr = vptr; - break; - } else { - swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); - if (!tc) { - sobj = (SwigPyObject *)sobj->next; - } else { - if (ptr) { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc,vptr,&newmemory); - if (newmemory == SWIG_CAST_NEW_MEMORY) { - assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */ - if (own) - *own = *own | SWIG_CAST_NEW_MEMORY; - } - } - break; - } - } - } else { - if (ptr) *ptr = vptr; - break; - } - } - if (sobj) { - if (own) - *own = *own | sobj->own; - if (flags & SWIG_POINTER_DISOWN) { - sobj->own = 0; - } - res = SWIG_OK; - } else { - if (implicit_conv) { - SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; - if (data && !data->implicitconv) { - PyObject *klass = data->klass; - if (klass) { - PyObject *impconv; - data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/ - impconv = SWIG_Python_CallFunctor(klass, obj); - data->implicitconv = 0; - if (PyErr_Occurred()) { - PyErr_Clear(); - impconv = 0; - } - if (impconv) { - SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv); - if (iobj) { - void *vptr; - res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0); - if (SWIG_IsOK(res)) { - if (ptr) { - *ptr = vptr; - /* transfer the ownership to 'ptr' */ - iobj->own = 0; - res = SWIG_AddCast(res); - res = SWIG_AddNewMask(res); - } else { - res = SWIG_AddCast(res); - } - } - } - Py_DECREF(impconv); - } - } - } - if (!SWIG_IsOK(res) && obj == Py_None) { - if (ptr) - *ptr = 0; - if (PyErr_Occurred()) - PyErr_Clear(); - res = SWIG_OK; - } - } - } - return res; -} - -/* Convert a function ptr value */ - -SWIGRUNTIME int -SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) { - if (!PyCFunction_Check(obj)) { - return SWIG_ConvertPtr(obj, ptr, ty, 0); - } else { - void *vptr = 0; - swig_cast_info *tc; - - /* here we get the method pointer for callbacks */ - const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); - const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0; - if (desc) - desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0; - if (!desc) - return SWIG_ERROR; - tc = SWIG_TypeCheck(desc,ty); - if (tc) { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc,vptr,&newmemory); - assert(!newmemory); /* newmemory handling not yet implemented */ - } else { - return SWIG_ERROR; - } - return SWIG_OK; - } -} - -/* Convert a packed pointer value */ - -SWIGRUNTIME int -SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) { - swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz); - if (!to) return SWIG_ERROR; - if (ty) { - if (to != ty) { - /* check type cast? */ - swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); - if (!tc) return SWIG_ERROR; - } - } - return SWIG_OK; -} - -/* ----------------------------------------------------------------------------- - * Create a new pointer object - * ----------------------------------------------------------------------------- */ - -/* - Create a new instance object, without calling __init__, and set the - 'this' attribute. -*/ - -SWIGRUNTIME PyObject* -SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) -{ - PyObject *inst = 0; - PyObject *newraw = data->newraw; - if (newraw) { - inst = PyObject_Call(newraw, data->newargs, NULL); - if (inst) { -#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); - } - } -#else - PyObject *key = SWIG_This(); - PyObject_SetAttr(inst, key, swig_this); -#endif - } - } else { -#if PY_VERSION_HEX >= 0x03000000 - PyObject *empty_args = PyTuple_New(0); - if (empty_args) { - PyObject *empty_kwargs = PyDict_New(); - if (empty_kwargs) { - inst = ((PyTypeObject *)data->newargs)->tp_new((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; - } - } - Py_DECREF(empty_args); - } -#else - PyObject *dict = PyDict_New(); - if (dict) { - PyDict_SetItem(dict, SWIG_This(), swig_this); - inst = PyInstance_NewRaw(data->newargs, dict); - Py_DECREF(dict); - } -#endif - } - return inst; -} - -SWIGRUNTIME void -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; - } -#endif - dict = PyObject_GetAttrString(inst, "__dict__"); - PyDict_SetItem(dict, SWIG_This(), swig_this); - Py_DECREF(dict); -} - - -SWIGINTERN PyObject * -SWIG_Python_InitShadowInstance(PyObject *args) { - PyObject *obj[2]; - if (!SWIG_Python_UnpackTuple(args, "swiginit", 2, 2, obj)) { - return NULL; - } else { - SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]); - if (sthis) { - SwigPyObject_append((PyObject*) sthis, obj[1]); - } else { - SWIG_Python_SetSwigThis(obj[0], obj[1]); - } - return SWIG_Py_Void(); - } -} - -/* Create a new pointer object */ - -SWIGRUNTIME PyObject * -SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags) { - SwigPyClientData *clientdata; - PyObject * robj; - int own; - - if (!ptr) - return SWIG_Py_Void(); - - clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0; - own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0; - if (clientdata && clientdata->pytype) { - SwigPyObject *newobj; - if (flags & SWIG_BUILTIN_TP_INIT) { - newobj = (SwigPyObject*) self; - if (newobj->ptr) { - PyObject *next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0); - while (newobj->next) - newobj = (SwigPyObject *) newobj->next; - newobj->next = next_self; - newobj = (SwigPyObject *)next_self; -#ifdef SWIGPYTHON_BUILTIN - newobj->dict = 0; -#endif - } - } else { - newobj = PyObject_New(SwigPyObject, clientdata->pytype); -#ifdef SWIGPYTHON_BUILTIN - newobj->dict = 0; -#endif - } - if (newobj) { - newobj->ptr = ptr; - newobj->ty = type; - newobj->own = own; - newobj->next = 0; - return (PyObject*) newobj; - } - return SWIG_Py_Void(); - } - - assert(!(flags & SWIG_BUILTIN_TP_INIT)); - - robj = SwigPyObject_New(ptr, type, own); - if (robj && clientdata && !(flags & SWIG_POINTER_NOSHADOW)) { - PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj); - Py_DECREF(robj); - robj = inst; - } - return robj; -} - -/* Create a new packed object */ - -SWIGRUNTIMEINLINE PyObject * -SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) { - return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void(); -} - -/* -----------------------------------------------------------------------------* - * Get type list - * -----------------------------------------------------------------------------*/ - -#ifdef SWIG_LINK_RUNTIME -void *SWIG_ReturnGlobalTypeList(void *); -#endif - -SWIGRUNTIME swig_module_info * -SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata)) { - 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 - } - return (swig_module_info *) type_pointer; -} - -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; - for (i =0; i < swig_module->size; ++i) { - swig_type_info *ty = types[i]; - if (ty->owndata) { - SwigPyClientData *data = (SwigPyClientData *) ty->clientdata; - if (data) SwigPyClientData_Del(data); - } - } - Py_DECREF(SWIG_This()); - Swig_This_global = NULL; -} - -SWIGRUNTIME void -SWIG_Python_SetModule(swig_module_info *swig_module) { -#if PY_VERSION_HEX >= 0x03000000 - /* Add a dummy module object into sys.modules */ - PyObject *module = PyImport_AddModule("swig_runtime_data" SWIG_RUNTIME_VERSION); -#else - static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} }; /* Sentinel */ - PyObject *module = Py_InitModule("swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table); -#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); - } 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) -{ - PyObject *cache = SWIG_Python_TypeCache(); - PyObject *key = SWIG_Python_str_FromChar(type); - PyObject *obj = PyDict_GetItem(cache, key); - swig_type_info *descriptor; - if (obj) { - descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, NULL); - } else { - swig_module_info *swig_module = SWIG_GetModule(0); - 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); - } - } - Py_DECREF(key); - return descriptor; -} - -/* - For backward compatibility only -*/ -#define SWIG_POINTER_EXCEPTION 0 -#define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg) -#define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags) - -SWIGRUNTIME int -SWIG_Python_AddErrMesg(const char* mesg, int infront) -{ - if (PyErr_Occurred()) { - PyObject *type = 0; - PyObject *value = 0; - PyObject *traceback = 0; - PyErr_Fetch(&type, &value, &traceback); - if (value) { - PyObject *old_str = PyObject_Str(value); - const char *tmp = SWIG_Python_str_AsChar(old_str); - const char *errmesg = tmp ? tmp : "Invalid error message"; - Py_XINCREF(type); - PyErr_Clear(); - if (infront) { - PyErr_Format(type, "%s %s", mesg, errmesg); - } else { - PyErr_Format(type, "%s %s", errmesg, mesg); - } - SWIG_Python_str_DelForPy3(tmp); - Py_DECREF(old_str); - } - return 1; - } else { - return 0; - } -} - -SWIGRUNTIME int -SWIG_Python_ArgFail(int argnum) -{ - if (PyErr_Occurred()) { - /* add information about failing argument */ - char mesg[256]; - PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum); - return SWIG_Python_AddErrMesg(mesg, 1); - } else { - return 0; - } -} - -SWIGRUNTIMEINLINE const char * -SwigPyObject_GetDesc(PyObject *self) -{ - SwigPyObject *v = (SwigPyObject *)self; - swig_type_info *ty = v ? v->ty : 0; - return ty ? ty->str : ""; -} - -SWIGRUNTIME void -SWIG_Python_TypeError(const char *type, PyObject *obj) -{ - if (type) { -#if defined(SWIG_COBJECT_TYPES) - if (obj && SwigPyObject_Check(obj)) { - const char *otype = (const char *) SwigPyObject_GetDesc(obj); - if (otype) { - PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received", - type, otype); - return; - } - } else -#endif - { - 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; - 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(str); - return; - } - } - PyErr_Format(PyExc_TypeError, "a '%s' is expected", type); - } else { - PyErr_Format(PyExc_TypeError, "unexpected type is received"); - } -} - - -/* Convert a pointer value, signal an exception on a type mismatch */ -SWIGRUNTIME void * -SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags) { - 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; -} - -#ifdef SWIGPYTHON_BUILTIN -SWIGRUNTIME int -SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { - PyTypeObject *tp = obj->ob_type; - PyObject *descr; - PyObject *encoded_name; - descrsetfunc f; - int res = -1; - -# ifdef Py_USING_UNICODE - if (PyString_Check(name)) { - name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL); - if (!name) - return -1; - } else if (!PyUnicode_Check(name)) -# else - if (!PyString_Check(name)) -# endif - { - PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name); - return -1; - } else { - Py_INCREF(name); - } - - if (!tp->tp_dict) { - if (PyType_Ready(tp) < 0) - goto done; - } - - descr = _PyType_Lookup(tp, name); - f = NULL; - if (descr != NULL) - f = descr->ob_type->tp_descr_set; - if (!f) { - if (PyString_Check(name)) { - encoded_name = name; - Py_INCREF(name); - } else { - encoded_name = PyUnicode_AsUTF8String(name); - if (!encoded_name) - return -1; - } - PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name)); - Py_DECREF(encoded_name); - } else { - res = f(descr, obj, value); - } - - done: - Py_DECREF(name); - return res; -} -#endif - - -#ifdef __cplusplus -} -#endif - - - -#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); - -#ifdef __cplusplus -} -#endif - - -/* -------- TYPES TABLE (BEGIN) -------- */ - -#define SWIGTYPE_p_char swig_types[0] -#define SWIGTYPE_p_int swig_types[1] -static swig_type_info *swig_types[3]; -static swig_module_info swig_module = {swig_types, 2, 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) - -/* -------- TYPES TABLE (END) -------- */ - -#ifdef SWIG_TypeQuery -# undef SWIG_TypeQuery -#endif -#define SWIG_TypeQuery SWIG_Python_TypeQuery - -/*----------------------------------------------- - @(target):= _versionhelper.so - ------------------------------------------------*/ -#if PY_VERSION_HEX >= 0x03000000 -# define SWIG_init PyInit__versionhelper - -#else -# define SWIG_init init_versionhelper - -#endif -#define SWIG_name "_versionhelper" - -#define SWIGVERSION 0x040001 -#define SWIG_VERSION SWIGVERSION - - -#define SWIG_as_voidptr(a) (void *)((const void *)(a)) -#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a)) - - -#include "blpapi_versioninfo.h" - - -SWIGINTERNINLINE PyObject* - SWIG_From_int (int value) -{ - return PyInt_FromLong((long) value); -} - - -SWIGINTERN swig_type_info* -SWIG_pchar_descriptor(void) -{ - static int init = 0; - static swig_type_info* info = 0; - if (!init) { - info = SWIG_TypeQuery("_p_char"); - init = 1; - } - return info; -} - - -SWIGINTERNINLINE PyObject * -SWIG_FromCharPtrAndSize(const char* carray, size_t size) -{ - if (carray) { - if (size > INT_MAX) { - swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - return pchar_descriptor ? - SWIG_InternalNewPointerObj((char *)(carray), pchar_descriptor, 0) : SWIG_Py_Void(); - } else { -#if PY_VERSION_HEX >= 0x03000000 -#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) - return PyBytes_FromStringAndSize(carray, (Py_ssize_t)(size)); -#else - return PyUnicode_DecodeUTF8(carray, (Py_ssize_t)(size), "surrogateescape"); -#endif -#else - return PyString_FromStringAndSize(carray, (Py_ssize_t)(size)); -#endif - } - } else { - return SWIG_Py_Void(); - } -} - - -SWIGINTERNINLINE PyObject * -SWIG_FromCharPtr(const char *cptr) -{ - return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0)); -} - -#ifdef __cplusplus -extern "C" { -#endif -SWIGINTERN PyObject *_wrap_blpapi_getVersionInfo(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int *arg1 = (int *) 0 ; - int *arg2 = (int *) 0 ; - int *arg3 = (int *) 0 ; - int *arg4 = (int *) 0 ; - int temp1 ; - int res1 = SWIG_TMPOBJ ; - int temp2 ; - int res2 = SWIG_TMPOBJ ; - int temp3 ; - int res3 = SWIG_TMPOBJ ; - int temp4 ; - int res4 = SWIG_TMPOBJ ; - - arg1 = &temp1; - arg2 = &temp2; - arg3 = &temp3; - arg4 = &temp4; - if (!SWIG_Python_UnpackTuple(args, "blpapi_getVersionInfo", 0, 0, 0)) SWIG_fail; - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_getVersionInfo(arg1,arg2,arg3,arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_Py_Void(); - if (SWIG_IsTmpObj(res1)) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg1))); - } else { - int new_flags = SWIG_IsNewObj(res1) ? (SWIG_POINTER_OWN | 0 ) : 0 ; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg1), SWIGTYPE_p_int, new_flags)); - } - if (SWIG_IsTmpObj(res2)) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg2))); - } else { - int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_int, new_flags)); - } - if (SWIG_IsTmpObj(res3)) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg3))); - } else { - int new_flags = SWIG_IsNewObj(res3) ? (SWIG_POINTER_OWN | 0 ) : 0 ; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg3), SWIGTYPE_p_int, new_flags)); - } - if (SWIG_IsTmpObj(res4)) { - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg4))); - } else { - int new_flags = SWIG_IsNewObj(res4) ? (SWIG_POINTER_OWN | 0 ) : 0 ; - resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg4), SWIGTYPE_p_int, new_flags)); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_blpapi_getVersionIdentifier(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - char *result = 0 ; - - if (!SWIG_Python_UnpackTuple(args, "blpapi_getVersionIdentifier", 0, 0, 0)) SWIG_fail; - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)blpapi_getVersionIdentifier(); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -static PyMethodDef SwigMethods[] = { - { "SWIG_PyInstanceMethod_New", SWIG_PyInstanceMethod_New, METH_O, NULL}, - { "blpapi_getVersionInfo", _wrap_blpapi_getVersionInfo, METH_NOARGS, NULL}, - { "blpapi_getVersionIdentifier", _wrap_blpapi_getVersionIdentifier, METH_NOARGS, NULL}, - { NULL, NULL, 0, NULL } -}; - -static PyMethodDef SwigMethods_proxydocs[] = { - { NULL, NULL, 0, NULL } -}; - - -/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ - -static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_int = {"_p_int", "int *", 0, 0, (void*)0, 0}; - -static swig_type_info *swig_type_initial[] = { - &_swigt__p_char, - &_swigt__p_int, -}; - -static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}}; - -static swig_cast_info *swig_cast_initial[] = { - _swigc__p_char, - _swigc__p_int, -}; - - -/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */ - -static swig_const_info swig_const_table[] = { -{0, 0, 0, 0.0, 0, 0}}; - -#ifdef __cplusplus -} -#endif -/* ----------------------------------------------------------------------------- - * Type initialization: - * This problem is tough by the requirement that no dynamic - * memory is used. Also, since swig_type_info structures store pointers to - * swig_cast_info structures and swig_cast_info structures store pointers back - * to swig_type_info structures, we need some lookup code at initialization. - * The idea is that swig generates all the structures that are needed. - * The runtime then collects these partially filled structures. - * The SWIG_InitializeModule function takes these initial arrays out of - * swig_module, and does all the lookup, filling in the swig_module.types - * array with the correct data and linking the correct swig_cast_info - * structures together. - * - * The generated swig_type_info structures are assigned statically to an initial - * array. We just loop through that array, and handle each type individually. - * First we lookup if this type has been already loaded, and if so, use the - * loaded structure instead of the generated one. Then we have to fill in the - * cast linked list. The cast data is initially stored in something like a - * two-dimensional array. Each row corresponds to a type (there are the same - * number of rows as there are in the swig_type_initial array). Each entry in - * a column is one of the swig_cast_info structures for that type. - * The cast_initial array is actually an array of arrays, because each row has - * a variable number of columns. So to actually build the cast linked list, - * we find the array of casts associated with the type, and loop through it - * adding the casts to the list. The one last trick we need to do is making - * sure the type pointer in the swig_cast_info struct is correct. - * - * First off, we lookup the cast->type name to see if it is already loaded. - * There are three cases to handle: - * 1) If the cast->type has already been loaded AND the type we are adding - * casting info to has not been loaded (it is in this module), THEN we - * replace the cast->type pointer with the type pointer that has already - * been loaded. - * 2) If BOTH types (the one we are adding casting info to, and the - * cast->type) are loaded, THEN the cast info has already been loaded by - * the previous module so we just ignore it. - * 3) Finally, if cast->type has not already been loaded, then we add that - * swig_cast_info to the linked list (because the cast->type) pointer will - * be correct. - * ----------------------------------------------------------------------------- */ - -#ifdef __cplusplus -extern "C" { -#if 0 -} /* c-mode */ -#endif -#endif - -#if 0 -#define SWIGRUNTIME_DEBUG -#endif - - -SWIGRUNTIME void -SWIG_InitializeModule(void *clientdata) { - size_t i; - swig_module_info *module_head, *iter; - int init; - - /* check to see if the circular list has been setup, if not, set it up */ - if (swig_module.next==0) { - /* Initialize the swig_module */ - swig_module.type_initial = swig_type_initial; - swig_module.cast_initial = swig_cast_initial; - swig_module.next = &swig_module; - init = 1; - } else { - init = 0; - } - - /* Try and load any already created modules */ - module_head = SWIG_GetModule(clientdata); - if (!module_head) { - /* This is the first module loaded for this interpreter */ - /* so set the swig module into the interpreter */ - SWIG_SetModule(clientdata, &swig_module); - } else { - /* the interpreter has loaded a SWIG module, but has it loaded this one? */ - iter=module_head; - do { - if (iter==&swig_module) { - /* Our module is already in the list, so there's nothing more to do. */ - return; - } - iter=iter->next; - } while (iter!= module_head); - - /* otherwise we must add our module into the list */ - swig_module.next = module_head->next; - module_head->next = &swig_module; - } - - /* When multiple interpreters are used, a module could have already been initialized in - a different interpreter, but not yet have a pointer in this interpreter. - In this case, we do not want to continue adding types... everything should be - set up already */ - if (init == 0) return; - - /* Now work on filling in swig_module.types */ -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: size %lu\n", (unsigned long)swig_module.size); -#endif - for (i = 0; i < swig_module.size; ++i) { - swig_type_info *type = 0; - swig_type_info *ret; - swig_cast_info *cast; - -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name); -#endif - - /* if there is another module already loaded */ - if (swig_module.next != &swig_module) { - type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name); - } - if (type) { - /* Overwrite clientdata field */ -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: found type %s\n", type->name); -#endif - if (swig_module.type_initial[i]->clientdata) { - type->clientdata = swig_module.type_initial[i]->clientdata; -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name); -#endif - } - } else { - type = swig_module.type_initial[i]; - } - - /* Insert casting types */ - cast = swig_module.cast_initial[i]; - while (cast->type) { - /* Don't need to add information already in the list */ - ret = 0; -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: look cast %s\n", cast->type->name); -#endif - if (swig_module.next != &swig_module) { - ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name); -#ifdef SWIGRUNTIME_DEBUG - if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name); -#endif - } - if (ret) { - if (type == swig_module.type_initial[i]) { -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: skip old type %s\n", ret->name); -#endif - cast->type = ret; - ret = 0; - } else { - /* Check for casting already in the list */ - swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type); -#ifdef SWIGRUNTIME_DEBUG - if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name); -#endif - if (!ocast) ret = 0; - } - } - - if (!ret) { -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name); -#endif - if (type->cast) { - type->cast->prev = cast; - cast->next = type->cast; - } - type->cast = cast; - } - cast++; - } - /* Set entry in modules->types array equal to the type */ - swig_module.types[i] = type; - } - swig_module.types[i] = 0; - -#ifdef SWIGRUNTIME_DEBUG - printf("**** SWIG_InitializeModule: Cast List ******\n"); - for (i = 0; i < swig_module.size; ++i) { - int j = 0; - swig_cast_info *cast = swig_module.cast_initial[i]; - printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name); - while (cast->type) { - printf("SWIG_InitializeModule: cast type %s\n", cast->type->name); - cast++; - ++j; - } - printf("---- Total casts: %d\n",j); - } - printf("**** SWIG_InitializeModule: Cast List ******\n"); -#endif -} - -/* This function will propagate the clientdata field of type to -* any new swig_type_info structures that have been added into the list -* of equivalent types. It is like calling -* SWIG_TypeClientData(type, clientdata) a second time. -*/ -SWIGRUNTIME void -SWIG_PropagateClientData(void) { - size_t i; - swig_cast_info *equiv; - static int init_run = 0; - - if (init_run) return; - init_run = 1; - - for (i = 0; i < swig_module.size; i++) { - if (swig_module.types[i]->clientdata) { - equiv = swig_module.types[i]->cast; - while (equiv) { - if (!equiv->converter) { - if (equiv->type && !equiv->type->clientdata) - SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata); - } - equiv = equiv->next; - } - } - } -} - -#ifdef __cplusplus -#if 0 -{ - /* c-mode */ -#endif -} -#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(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 - * ----------------------------------------------------------------------------- */ - - /* Install Constants */ - SWIGINTERN void - SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) { - PyObject *obj = 0; - size_t i; - for (i = 0; constants[i].type; ++i) { - switch(constants[i].type) { - case SWIG_PY_POINTER: - obj = SWIG_InternalNewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0); - break; - case SWIG_PY_BINARY: - obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype)); - break; - default: - obj = 0; - break; - } - if (obj) { - PyDict_SetItemString(d, constants[i].name, obj); - Py_DECREF(obj); - } - } - } - - /* -----------------------------------------------------------------------------*/ - /* Fix SwigMethods to carry the callback ptrs when needed */ - /* -----------------------------------------------------------------------------*/ - - SWIGINTERN void - SWIG_Python_FixMethods(PyMethodDef *methods, - 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; - if (!c) continue; - c = strstr(c, "swig_ptr: "); - if (c) { - int j; - 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, - strlen(const_table[j].name)) == 0) { - ci = &(const_table[j]); - break; - } - } - if (ci) { - void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0; - if (ptr) { - size_t shift = (ci->ptype) - types; - swig_type_info *ty = types_initial[shift]; - size_t ldoc = (c - methods[i].ml_doc); - size_t lptr = strlen(ty->name)+2*sizeof(void*)+2; - char *ndoc = (char*)malloc(ldoc + lptr + 10); - if (ndoc) { - char *buff = ndoc; - memcpy(buff, methods[i].ml_doc, ldoc); - buff += ldoc; - memcpy(buff, "swig_ptr: ", 10); - buff += 10; - SWIG_PackVoidPtr(buff, ptr, ty->name, lptr); - methods[i].ml_doc = ndoc; - } - } - } - } - } - } - - /* ----------------------------------------------------------------------------- - * 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 - * -----------------------------------------------------------------------------*/ - -#ifdef __cplusplus -extern "C" -#endif - -SWIGEXPORT -#if PY_VERSION_HEX >= 0x03000000 -PyObject* -#else -void -#endif -SWIG_init(void) { - PyObject *m, *d, *md, *globals; - -#if PY_VERSION_HEX >= 0x03000000 - static struct PyModuleDef SWIG_module = { - PyModuleDef_HEAD_INIT, - SWIG_name, - NULL, - -1, - SwigMethods, - NULL, - NULL, - NULL, - NULL - }; -#endif - -#if defined(SWIGPYTHON_BUILTIN) - static SwigPyClientData SwigPyObject_clientdata = { - 0, 0, 0, 0, 0, 0, 0 - }; - static PyGetSetDef this_getset_def = { - (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL - }; - static SwigPyGetSet thisown_getset_closure = { - SwigPyObject_own, - SwigPyObject_own - }; - static PyGetSetDef thisown_getset_def = { - (char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure - }; - PyTypeObject *builtin_pytype; - int builtin_base_count; - swig_type_info *builtin_basetype; - PyObject *tuple; - PyGetSetDescrObject *static_getset; - PyTypeObject *metatype; - PyTypeObject *swigpyobject; - SwigPyClientData *cd; - PyObject *public_interface, *public_symbol; - PyObject *this_descr; - PyObject *thisown_descr; - PyObject *self = 0; - int i; - - (void)builtin_pytype; - (void)builtin_base_count; - (void)builtin_basetype; - (void)tuple; - (void)static_getset; - (void)self; - - /* Metaclass is used to implement static member variables */ - metatype = SwigPyObjectType(); - assert(metatype); -#endif - - (void)globals; - - /* Create singletons now to avoid potential deadlocks with multi-threaded usage after module initialization */ - SWIG_This(); - SWIG_Python_TypeCache(); - SwigPyPacked_type(); -#ifndef SWIGPYTHON_BUILTIN - SwigPyObject_type(); -#endif - - /* Fix SwigMethods to carry the callback ptrs when needed */ - SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial); - -#if PY_VERSION_HEX >= 0x03000000 - m = PyModule_Create(&SWIG_module); -#else - m = Py_InitModule(SWIG_name, SwigMethods); -#endif - - md = d = PyModule_GetDict(m); - (void)md; - - SWIG_InitializeModule(0); - -#ifdef SWIGPYTHON_BUILTIN - swigpyobject = SwigPyObject_TypeOnce(); - - SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject"); - assert(SwigPyObject_stype); - cd = (SwigPyClientData*) SwigPyObject_stype->clientdata; - if (!cd) { - SwigPyObject_stype->clientdata = &SwigPyObject_clientdata; - SwigPyObject_clientdata.pytype = swigpyobject; - } else if (swigpyobject->tp_basicsize != cd->pytype->tp_basicsize) { - PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules."); -# if PY_VERSION_HEX >= 0x03000000 - return NULL; -# else - return; -# endif - } - - /* All objects have a 'this' attribute */ - this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def); - (void)this_descr; - - /* All objects have a 'thisown' attribute */ - thisown_descr = PyDescr_NewGetSet(SwigPyObject_type(), &thisown_getset_def); - (void)thisown_descr; - - public_interface = PyList_New(0); - public_symbol = 0; - (void)public_symbol; - - PyDict_SetItemString(md, "__all__", public_interface); - Py_DECREF(public_interface); - for (i = 0; SwigMethods[i].ml_name != NULL; ++i) - SwigPyBuiltin_AddPublicSymbol(public_interface, SwigMethods[i].ml_name); - for (i = 0; swig_const_table[i].name != 0; ++i) - SwigPyBuiltin_AddPublicSymbol(public_interface, swig_const_table[i].name); -#endif - - SWIG_InstallConstants(d,swig_const_table); - - - /* Initialize threading */ - SWIG_PYTHON_INITIALIZE_THREADS; -#if PY_VERSION_HEX >= 0x03000000 - return m; -#else - return; -#endif -} - From 1abccf9151551367cd50e3e9485cf6e26b090b03 Mon Sep 17 00:00:00 2001 From: Marland Sitt Date: Wed, 22 Jan 2025 21:53:23 -0800 Subject: [PATCH 23/23] v3.24.11 --- PKG-INFO | 2 +- changelog.txt | 4 ++++ src/blpapi.egg-info/PKG-INFO | 2 +- src/blpapi.egg-info/SOURCES.txt | 1 + src/blpapi/correlationid.py | 2 +- src/blpapi/ctypesutils.py | 2 +- src/blpapi/py.typed | 0 src/blpapi/version.py | 4 ++-- 8 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 src/blpapi/py.typed diff --git a/PKG-INFO b/PKG-INFO index 08e7efb..ed6ac7c 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: blpapi -Version: 3.24.10 +Version: 3.24.11 Summary: Python SDK for Bloomberg BLPAPI Home-page: http://www.bloomberglabs.com/api/ Author: Bloomberg L.P. diff --git a/changelog.txt b/changelog.txt index 2cf20c3..e691a5e 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,7 @@ +Version 3.24.11: +================ +- Stability and performance improvements + Version 3.24.10: ================ - Stability and performance improvements diff --git a/src/blpapi.egg-info/PKG-INFO b/src/blpapi.egg-info/PKG-INFO index 08e7efb..ed6ac7c 100644 --- a/src/blpapi.egg-info/PKG-INFO +++ b/src/blpapi.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: blpapi -Version: 3.24.10 +Version: 3.24.11 Summary: Python SDK for Bloomberg BLPAPI Home-page: http://www.bloomberglabs.com/api/ Author: Bloomberg L.P. diff --git a/src/blpapi.egg-info/SOURCES.txt b/src/blpapi.egg-info/SOURCES.txt index 826e054..53b6fb2 100644 --- a/src/blpapi.egg-info/SOURCES.txt +++ b/src/blpapi.egg-info/SOURCES.txt @@ -85,6 +85,7 @@ src/blpapi/message.py src/blpapi/name.py src/blpapi/names.py src/blpapi/providersession.py +src/blpapi/py.typed src/blpapi/pycbhelpers.py src/blpapi/request.py src/blpapi/requesttemplate.py diff --git a/src/blpapi/correlationid.py b/src/blpapi/correlationid.py index 968e652..7d1a1d1 100644 --- a/src/blpapi/correlationid.py +++ b/src/blpapi/correlationid.py @@ -259,7 +259,7 @@ def __eq__(self, other: Any) -> bool: def __ne__(self, other: Any) -> bool: """x.__ne__(y) <==> x!=y""" equal = self.__eq__(other) - return NotImplemented if equal is NotImplemented else not equal # type: ignore + return NotImplemented if equal is NotImplemented else not equal pycbhelpers.correlationIdWrapper = CorrelationId.cidFromCPtr diff --git a/src/blpapi/ctypesutils.py b/src/blpapi/ctypesutils.py index 49f4beb..aa82572 100644 --- a/src/blpapi/ctypesutils.py +++ b/src/blpapi/ctypesutils.py @@ -47,7 +47,7 @@ def getHandleFromPtr(outp: int) -> Optional[c_void_p]: return c_void_p(outp) if outp else None -def getHandleFromOutput(outp: Any, retCode: int) -> c_void_p: +def getHandleFromOutput(outp: Any, retCode: int) -> Optional[c_void_p]: """Get c_void_p handle Special case: C layer populates the buffer with NULL. diff --git a/src/blpapi/py.typed b/src/blpapi/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/src/blpapi/version.py b/src/blpapi/version.py index afcf0cd..2891181 100644 --- a/src/blpapi/version.py +++ b/src/blpapi/version.py @@ -4,8 +4,8 @@ from . import internals -__version__ = "3.24.10" -__expected_cpp_sdk_version__ = "3.24.10" +__version__ = "3.24.11" +__expected_cpp_sdk_version__ = "3.24.11" def print_version() -> None: