From c367875439732faf64d7f38fefb504382198f0f0 Mon Sep 17 00:00:00 2001 From: Tony Roberts Date: Mon, 4 Feb 2019 13:26:09 +0000 Subject: [PATCH 1/4] Update to blpapi 3.12.2 --- 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 +- 32 files changed, 7327 insertions(+), 578 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/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 785e58e52dd7fc4dfaa8bf0121fc4a29b206e9ef Mon Sep 17 00:00:00 2001 From: Tony Roberts Date: Mon, 4 Feb 2019 13:28:04 +0000 Subject: [PATCH 2/4] Add version number to Bloomberg API DLL name On Windows get the version info from the Bloomberg API DLL and create a version specific lib/dll for the Python extensions to link against. This resolves any conflict where Python in embedded somewhere where another version of the Bloomberg API is already being loaded (eg Excel). --- setup.py | 111 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) diff --git a/setup.py b/setup.py index 0fafedc..5971824 100644 --- a/setup.py +++ b/setup.py @@ -31,7 +31,115 @@ else: blpapiLibraryName = 'blpapi3_32' +cmdclass = {} if platform == 'windows': + from distutils.command import build_ext + from ctypes import windll, create_string_buffer, c_uint, byref, string_at, wstring_at, c_void_p + import shutil + import array + import re + + class BuildBlpExtension(build_ext.build_ext): + @staticmethod + def get_file_info(filename, info): + """ + Extract information from a file. + """ + if version >= '3.0': + GetFileVersionInfoSize = windll.version.GetFileVersionInfoSizeW + GetFileVersionInfo = windll.version.GetFileVersionInfoW + VerQueryValue = windll.version.VerQueryValueW + tstring_at = wstring_at + else: + GetFileVersionInfoSize = windll.version.GetFileVersionInfoSizeA + GetFileVersionInfo = windll.version.GetFileVersionInfoA + VerQueryValue = windll.version.VerQueryValueA + tstring_at = string_at + + # Get size needed for buffer (0 if no info) + size = GetFileVersionInfoSize(filename, None) + if not size: + return '' + + # Create buffer + res = create_string_buffer(size) + + # Load file informations into buffer res + GetFileVersionInfo(filename, None, size, res) + r = c_void_p() + l = c_uint() + + # Look for codepages + VerQueryValue(res, '\\VarFileInfo\\Translation', byref(r), byref(l)) + + # If no codepage -> empty string + if not l.value: + return '' + + # Take the first codepage + codepages = array.array('H', string_at(r.value, l.value)) + codepage = tuple(codepages[:2].tolist()) + + # Extract information + VerQueryValue(res, ('\\StringFileInfo\\%04x%04x\\' + info) % codepage, byref(r), byref(l)) + return tstring_at(r.value, l.value-1).replace(" ", "").replace(",", ".") + + def build_extension(self, ext): + """ + Builds the C extension libraries, but replaces blpapi dll dependency with + a versioned copy so it doesn't conflict with other Bloomberg tools. + """ + # Replace blpapiLibraryName with the version specific one + if blpapiLibraryName in ext.libraries: + srcdll = os.path.join(blpapiLibraryPath, blpapiLibraryName + ".dll") + version = self.get_file_info(srcdll, "FileVersion") + versionedLibName = blpapiLibraryName + "_" + version + build_dir = os.path.dirname(self.get_ext_fullpath(ext.name)) + + if self.force or not os.path.exists(os.path.join(self.build_temp, versionedLibName + ".lib")): + if not self.compiler.initialized: + self.compiler.initialize() + + if not os.path.exists(self.build_temp): + os.makedirs(self.build_temp) + + # dump the def file for the dll to rebuild the lib file + dumpbinfile = os.path.join(self.build_temp, blpapiLibraryName + "_" + version + ".dumpbin") + dumpbin = os.path.join(os.path.dirname(self.compiler.lib), "DUMPBIN.EXE") + self.compiler.spawn([dumpbin, "/EXPORTS", "/OUT:" + dumpbinfile, srcdll]) + + # get all the function definitions + deffile = os.path.join(self.build_temp, blpapiLibraryName + "_" + version + ".def") + with open(deffile, "wt") as out_fh: + exports = [] + for line in open(dumpbinfile).readlines(): + matches = re.search(r'^\s*(\d+)\s+[A-Z0-9]+\s+[A-Z0-9]{8}\s+([^ ]+)', line) + if matches: + exports.append(matches.group(2) + "\n") + out_fh.writelines(["EXPORTS\n"] + exports) + + # rebuild the lib file with the new dll name + libfile = os.path.join(self.build_temp, blpapiLibraryName + "_" + version + ".lib") + machine = "/MACHINE:" + ("X64" if is64bit else "X86") + self.compiler.spawn([self.compiler.lib, machine, "/DEF:" + deffile, "/OUT:" + libfile]) + + # copy the versioned dll the the build output + if self.force or not os.path.exists(os.path.join(build_dir, versionedLibName + ".dll")): + if not os.path.exists(build_dir): + os.makedirs(build_dir) + shutil.copy(os.path.join(blpapiLibraryPath, blpapiLibraryName + ".dll"), + os.path.join(build_dir, versionedLibName + ".dll")) + + # replace blpapi.lib with the versioned one + ext.libraries = [versionedLibName if x == blpapiLibraryName else x for x in ext.libraries] + ext.library_dirs.insert(0, self.build_temp) + + build_ext.build_ext.build_extension(self, ext) + + cmdclass.update({ + "build_ext": BuildBlpExtension, + }) + blpapiLibraryPath = os.path.join(blpapiRoot, 'lib') extraLinkArgs = ['/MANIFEST'] @@ -50,6 +158,8 @@ else: raise Exception("Platform '" + platform + "' isn't supported") + + blpapiLibraryPath = blpapiLibVar or blpapiLibraryPath blpapiIncludes = blpapiIncludesVar or os.path.join(blpapiRoot, 'include') @@ -80,6 +190,7 @@ ext_modules=[blpapi_wrap, versionhelper_wrap], url='http://www.bloomberglabs.com/api/', packages=["blpapi"], + cmdclass=cmdclass, classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', From 9acdce244097600475ab0372f0a1f134e49a4164 Mon Sep 17 00:00:00 2001 From: Tony Roberts Date: Mon, 21 Sep 2020 09:54:53 +0100 Subject: [PATCH 3/4] Update to Bloomberg C API 3.12.3 --- README | 4 ++-- setup.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README b/README index 33f4713..eb22ffc 100644 --- a/README +++ b/README @@ -1,5 +1,5 @@ -Bloomberg Python API version 3.9 -================================ +Bloomberg Python API version 3.12 +================================= This directory contains an interface for interacting with Bloomberg API services using the Python programming language. This package is the source diff --git a/setup.py b/setup.py index 5971824..1c9ed93 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ os.chdir(os.path.dirname(os.path.realpath(__file__))) platform = plat.system().lower() -versionString = '3.12.2' +versionString = '3.12.3' if version < '2.6': raise Exception( From d5eb8cbbca0032f1c7ffd935260ff4cf97e3b8c6 Mon Sep 17 00:00:00 2001 From: Tony Roberts Date: Mon, 21 Sep 2020 10:23:17 +0100 Subject: [PATCH 4/4] Update to blpapi 3.14.0 --- MANIFEST.in | 4 + PKG-INFO | 4 +- README | 54 +- blpapi/__init__.py | 6 +- blpapi/abstractsession.py | 318 +- blpapi/compat.py | 48 +- blpapi/constant.py | 188 +- blpapi/datatype.py | 25 +- blpapi/datetime.py | 89 +- blpapi/debug.py | 46 +- blpapi/debug_environment.py | 89 + blpapi/diagnosticsutil.py | 13 +- blpapi/element.py | 650 +- blpapi/event.py | 121 +- blpapi/eventdispatcher.py | 67 +- blpapi/eventformatter.py | 254 +- blpapi/exception.py | 18 +- blpapi/highresclock.py | 7 +- blpapi/identity.py | 114 +- blpapi/internals.py | 292 +- .../{internals_wrap.cxx => internals_wrap.c} | 13486 +++++----------- blpapi/logging.py | 30 +- blpapi/message.py | 190 +- blpapi/name.py | 111 +- blpapi/providersession.py | 758 +- blpapi/request.py | 44 +- blpapi/requesttemplate.py | 2 + blpapi/resolutionlist.py | 290 +- blpapi/schema.py | 271 +- blpapi/service.py | 278 +- blpapi/session.py | 644 +- blpapi/sessionoptions.py | 682 +- blpapi/subscriptionlist.py | 188 +- blpapi/testtools.py | 74 +- blpapi/topic.py | 59 +- blpapi/topiclist.py | 194 +- blpapi/version.py | 14 +- blpapi/versionhelper.py | 4 - ...onhelper_wrap.cxx => versionhelper_wrap.c} | 175 +- blpapi/zfputil.py | 107 + changelog.txt | 43 +- examples/ContributionsMktdataExample.py | 113 +- examples/ContributionsPageExample.py | 155 +- examples/LocalMktdataSubscriptionExample.py | 137 +- examples/MktdataPublisher.py | 4 +- examples/SnapshotRequestTemplateExample.py | 38 +- examples/ZfpOverLeasedLinesSessionExample.py | 220 + setup.py | 44 +- 48 files changed, 8399 insertions(+), 12363 deletions(-) create mode 100644 MANIFEST.in create mode 100644 blpapi/debug_environment.py rename blpapi/{internals_wrap.cxx => internals_wrap.c} (61%) rename blpapi/{versionhelper_wrap.cxx => versionhelper_wrap.c} (95%) create mode 100644 blpapi/zfputil.py create mode 100644 examples/ZfpOverLeasedLinesSessionExample.py diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..c81792b --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,4 @@ +include README changelog.txt NOTES + +recursive-include examples *.py + diff --git a/PKG-INFO b/PKG-INFO index ca3af1a..3e49769 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.14.0 +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 eb22ffc..0b0f265 100644 --- a/README +++ b/README @@ -1,28 +1,48 @@ -Bloomberg Python API version 3.12 -================================= +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 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..b251a10 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) @@ -31,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`. """ @@ -98,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, @@ -121,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: @@ -141,7 +159,7 @@ def openServiceAsync(self, serviceName, correlationId=None): internals.blpapi_AbstractSession_openServiceAsync( self.__handle, serviceName, - correlationId._handle())) + get_handle(correlationId))) return correlationId def sendAuthorizationRequest(self, @@ -149,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: @@ -182,10 +212,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: @@ -193,32 +223,31 @@ 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( self.__handle, - correlationId._handle(), + get_handle(correlationId), 1, # number of correlation IDs supplied None, # no request label 0)) # request label length 0 @@ -227,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() @@ -240,34 +283,38 @@ 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 def getService(self, serviceName): - """Return a Service object representing the service. + """Return a :class:`Service` object representing the service. + + Args: + serviceName (str): Name of the service to retrieve - Return a Service object representing the service identified by the - specified 'serviceName'. + Returns: + Service: Service identified by the service name - The 'serviceName' must contain a fully qualified service name. That - is, it must be of the form "///". + Raises: + InvalidStateException: If the service identified by the specified + ``serviceName`` is not open already - If the service identified by the specified 'serviceName' is not open - already then an InvalidStateException is raised. + 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, @@ -276,14 +323,19 @@ 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) # 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..9d67a16 100644 --- a/blpapi/constant.py +++ b/blpapi/constant.py @@ -20,53 +20,78 @@ from . import utils from . import internals +# pylint: disable=protected-access,old-style-class 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. + 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. - 'Constant' objects are read-only. + :class:`Constant` objects are read-only. - Application clients never create 'Constant' object directly; applications - will typically work with 'Constant' objects returned by other 'blpapi' - components. + 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) @@ -74,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) @@ -84,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) @@ -98,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) @@ -108,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, @@ -123,78 +160,104 @@ 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 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'. + """ + Args: + name (Name or str): Name of the constant - 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. + Returns: + Constant: 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, @@ -208,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 cbcfac9..b58df81 100644 --- a/blpapi/datatype.py +++ b/blpapi/datatype.py @@ -6,35 +6,16 @@ '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): - """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 22745cf..3d135ef 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): @@ -19,42 +21,56 @@ 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, 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): + """ + Returns: + int: Offset from UTC in minutes + """ return self.__offset.days * 24 * 60 + self.__offset.seconds // 60 def __hash__(self): @@ -63,10 +79,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 +107,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 +141,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..8b9387d 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,81 +17,87 @@ 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. + """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 (sequnces 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': + 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 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 seqeunce 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 = ( @@ -138,25 +142,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,28 +179,28 @@ 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. """ 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() @@ -205,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( @@ -265,58 +277,70 @@ 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() 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. + """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() @@ -325,17 +349,18 @@ def toString(self, level=0, spacesPerLevel=4): spacesPerLevel) def getElement(self, nameOrIndex): - """Return a specified subelement. - - Return a subelement 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): @@ -352,23 +377,33 @@ 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): - 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): - """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() @@ -382,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() @@ -395,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() @@ -408,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() @@ -421,28 +469,38 @@ 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() res = internals.blpapi_Element_getValueAsHighPrecisionDatetime( - self.__handle, index) + self.__handle, index) _ExceptionUtil.raiseOnError(res[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() @@ -451,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() @@ -464,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() @@ -477,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() @@ -490,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() @@ -506,11 +586,12 @@ def getValue(self, index=0): return valueGetter(self, index) def values(self): - """Return an iterator over values contained in this Element. - - If 'isComplexType()' returns True for this Element, the empty iterator is - returned. + """ + Returns: + Iterator over values contained in this :class:`Element`. + If :meth:`isComplexType()` returns ``True`` for this :class:`Element`, + the empty iterator is returned. """ if self.isComplexType(): @@ -521,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() @@ -611,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-elemen 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() @@ -641,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 - This method can process the following types of 'value' without + 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 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() @@ -668,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. """ @@ -706,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 a7b21a1..56850c9 100644 --- a/blpapi/event.py +++ b/blpapi/event.py @@ -33,29 +33,25 @@ """ - - 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. + """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): self.__handle = \ - internals.blpapi_MessageIterator_create(event._handle()) + internals.blpapi_MessageIterator_create(get_handle(event)) self.__event = event def __del__(self): @@ -86,40 +82,23 @@ 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 @@ -164,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,20 +174,23 @@ 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. - '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() @@ -212,42 +201,46 @@ 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]: 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'. + """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 4a3c198..6fc8f76 100644 --- a/blpapi/eventdispatcher.py +++ b/blpapi/eventdispatcher.py @@ -6,34 +6,35 @@ 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 - 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`. + + 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. + 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( @@ -52,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) @@ -63,27 +62,33 @@ 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: 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/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 fa04f82..7cb9aac 100644 --- a/blpapi/exception.py +++ b/blpapi/exception.py @@ -6,7 +6,6 @@ """ - try: from builtins import Exception as _StandardException except ImportError: @@ -14,22 +13,31 @@ from . import internals +# pylint: disable=useless-object-inheritance, 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): + """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): - 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 :class:`CorrelationId`. """ pass @@ -84,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 @@ -120,6 +129,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..743438c 100644 --- a/blpapi/identity.py +++ b/blpapi/identity.py @@ -6,34 +6,33 @@ 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): """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. - - Once authorized a Identity has access to the entitlements of the user which - it was validated for. + 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, an :class:`Identity` has access to the entitlements of the + user which it was validated for. - Seat types: + :class:`Identity` objects are always created by the API, never directly by + the application. - 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 @@ -44,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) @@ -56,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: @@ -66,18 +70,24 @@ 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 - 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. + 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``. + + If :class:`Element` is supplied for ``entitlements``, it must be an + array of integers. """ 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 +100,7 @@ def hasEntitlements(self, service, entitlements): carrayOfEIDs[i] = eid res = internals.blpapi_Identity_hasEntitlements( self.__handle, - service._handle(), + get_handle(service), None, carrayOfEIDs, numberOfEIDs, @@ -99,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() @@ -117,8 +132,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 +150,7 @@ def getFailedEntitlements(self, service, entitlements): failedEIDsSize[0] = maxFailedEIDs res = internals.blpapi_Identity_hasEntitlements( self.__handle, - service._handle(), + get_handle(service), None, carrayOfEIDs, numberOfEIDs, @@ -147,17 +162,26 @@ 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, - service._handle()) + res = internals.blpapi_Identity_isAuthorized( + self.__handle, + get_handle(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] @@ -168,7 +192,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..1060cc8 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 @@ -353,50 +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: - 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. + 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__ = {} @@ -404,16 +386,27 @@ 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 + """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", @@ -439,7 +432,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 @@ -449,12 +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: - - integer (type() == CorrelationId.INT_TYPE - or type() == CorrelationId.AUTOGEN_TYPE) - - object (type() == CorrelationId.OBJECT_TYPE) - - None (type() == CorrelationId.UNSET_TYPE) + """ + 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 \ @@ -471,52 +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: - 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. + ``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: @@ -527,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) @@ -547,6 +517,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 +851,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 @@ -1009,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 @@ -1105,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 @@ -1184,6 +1176,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 +1291,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 +1575,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 +1639,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 +1967,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 +2018,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.cxx b/blpapi/internals_wrap.c similarity index 61% rename from blpapi/internals_wrap.cxx rename to blpapi/internals_wrap.c index 01583fe..675b57e 100644 --- a/blpapi/internals_wrap.cxx +++ b/blpapi/internals_wrap.c @@ -16,30 +16,6 @@ #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. @@ -443,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 */ @@ -453,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; @@ -470,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 */ @@ -480,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; @@ -3007,69 +2987,67 @@ SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { /* -------- 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 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) @@ -3097,97 +3075,14 @@ static swig_module_info swig_module = {swig_types, 61, 0, 0, 0, 0}; #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_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" -#include - - SWIGINTERNINLINE PyObject* SWIG_From_unsigned_SS_int (unsigned int value) { @@ -3202,7 +3097,7 @@ SWIGINTERNINLINE PyObject* SWIG_From_unsigned_SS_long (unsigned long value) { return (value > LONG_MAX) ? - PyLong_FromUnsignedLong(value) : PyInt_FromLong(static_cast< long >(value)); + PyLong_FromUnsignedLong(value) : PyInt_FromLong((long)(value)); } @@ -3226,7 +3121,7 @@ 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)); + PyLong_FromUnsignedLongLong(value) : PyInt_FromLong((long)(value)); } #endif @@ -3237,16 +3132,23 @@ 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)); + 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 (static_cast< unsigned long long >(value)); + 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" @@ -3280,80 +3182,109 @@ SWIG_From_size_t (size_t value) #define MAX_GROUP_ID_SIZE 64 #endif -#include // for std::ostringstream -#include // for std::runtime_error -#include // for tm and mktime +#include // for tm and mktime + +#include // for malloc() and free() +#include // for strncpy() + +typedef struct StreamWriterData { + char *stream; + int size; +} StreamWriterData; -std::string blpapi_Service_printHelper( +// 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) + int spacesPerLevel, + char **output_allocated, + int *output_size) { - std::ostringstream stream; - + StreamWriterData stream = {0}; blpapi_Service_print( service, - BloombergLP::blpapi::OstreamWriter, + cstr_StreamWriter, &stream, level, spacesPerLevel); - - return stream.str(); + *output_allocated = stream.stream; + *output_size = stream.size; } -std::string blpapi_SchemaElementDefinition_printHelper( +void blpapi_SchemaElementDefinition_printHelper( blpapi_SchemaElementDefinition_t *item, int level, - int spacesPerLevel) + int spacesPerLevel, + char **output_allocated, + int *output_size) { - std::ostringstream stream; - + StreamWriterData stream = {0}; blpapi_SchemaElementDefinition_print( item, - BloombergLP::blpapi::OstreamWriter, + cstr_StreamWriter, &stream, level, spacesPerLevel); - - return stream.str(); + *output_allocated = stream.stream; + *output_size = stream.size; } -std::string blpapi_SchemaTypeDefinition_printHelper( +void blpapi_SchemaTypeDefinition_printHelper( blpapi_SchemaTypeDefinition_t *item, int level, - int spacesPerLevel) + int spacesPerLevel, + char **output_allocated, + int *output_size) { - std::ostringstream stream; - + StreamWriterData stream = {0}; blpapi_SchemaTypeDefinition_print( item, - BloombergLP::blpapi::OstreamWriter, + cstr_StreamWriter, &stream, level, spacesPerLevel); - - return stream.str(); + *output_allocated = stream.stream; + *output_size = stream.size; } -std::string blpapi_SessionOptions_printHelper( +void blpapi_SessionOptions_printHelper( blpapi_SessionOptions_t *sessionOptions, int level, - int spacesPerLevel) + int spacesPerLevel, + char **output_allocated, + int *output_size) { - std::ostringstream stream; - + StreamWriterData stream = {0}; blpapi_SessionOptions_print( sessionOptions, - BloombergLP::blpapi::OstreamWriter, + cstr_StreamWriter, &stream, level, spacesPerLevel); - - return stream.str(); + *output_allocated = stream.stream; + *output_size = stream.size; } -bool blpapi_SchemaTypeDefinition_hasElementDefinition( +int blpapi_SchemaTypeDefinition_hasElementDefinition( const blpapi_SchemaTypeDefinition_t *type, const char *nameString, const blpapi_Name_t *name) @@ -3362,7 +3293,7 @@ bool blpapi_SchemaTypeDefinition_hasElementDefinition( type, nameString, name); } -bool blpapi_ConstantList_hasConstant( +int blpapi_ConstantList_hasConstant( const blpapi_ConstantList_t *list, const char *nameString, const blpapi_Name_t *name) @@ -3370,7 +3301,7 @@ bool blpapi_ConstantList_hasConstant( return 0 != blpapi_ConstantList_getConstant(list, nameString, name); } -bool blpapi_Service_hasEventDefinition( +int blpapi_Service_hasEventDefinition( blpapi_Service_t *service, const char* nameString, const blpapi_Name_t *name) @@ -3381,7 +3312,7 @@ bool blpapi_Service_hasEventDefinition( service, &eventDefinition, nameString, name); } -bool blpapi_Service_hasOperation( +int blpapi_Service_hasOperation( blpapi_Service_t *service, const char* nameString, const blpapi_Name_t *name) @@ -3409,30 +3340,37 @@ int blpapi_SubscriptionList_addHelper( options ? 1: 0); } -bool blpapi_Name_hasName(const char *nameString) +int blpapi_Name_hasName(const char *nameString) { - return blpapi_Name_findName(nameString) ? true : false; + return blpapi_Name_findName(nameString) ? 1 : 0; } blpapi_TopicList_t* blpapi_TopicList_createFromResolutionList( blpapi_ResolutionList_t* from) { - return blpapi_TopicList_create(reinterpret_cast(from)); + return blpapi_TopicList_create((blpapi_TopicList_t*) (from)); } -std::string blpapi_DiagnosticsUtil_memoryInfo_wrapper() +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) { - throw std::runtime_error("blpapi_DiagnosticsUtil_memoryInfo error"); + PyErr_SetString(PyExc_RuntimeError, "blpapi_DiagnosticsUtil_memoryInfo error"); + return NULL; } - // Allocate buffer and call the function - std::string buffer; - buffer.resize(len+1); - blpapi_DiagnosticsUtil_memoryInfo(&buffer[0], len+1); - return buffer; + 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, @@ -3444,20 +3382,22 @@ typedef void (*blpapi_Logging_Func_t)(blpapi_UInt64_t threadId, // Shared global object guarded by GIL PyObject* loggerCallback = 0; -static time_t blpapi_Datetime_to_unix(blpapi_Datetime_t const& original) { +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; + + 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); + result = mktime(ts); return result; } @@ -3467,7 +3407,7 @@ void loggerCallbackWrapper(blpapi_UInt64_t threadId, const char *category, const char *message) { - time_t ts = blpapi_Datetime_to_unix(original); + time_t ts = blpapi_Datetime_to_unix(&original); PyGILState_STATE gilstate = PyGILState_Ensure(); PyObject* result = PyObject_CallFunction(loggerCallback, "KiIss", @@ -3477,61 +3417,43 @@ void loggerCallbackWrapper(blpapi_UInt64_t threadId, Py_XDECREF(result); } -void setLoggerCallbackWrapper(PyObject *cb, int severity) +int setLoggerCallbackWrapper(PyObject *cb, int severity) { + int err; + if (!PyCallable_Check(cb)) { - throw std::invalid_argument("parameter must be a function"); + return -1; } Py_XINCREF(cb); Py_XDECREF(loggerCallback); loggerCallback = cb; // Set actual callback - int err = blpapi_Logging_registerCallback(&loggerCallbackWrapper, (blpapi_Logging_Severity_t)severity); + err = blpapi_Logging_registerCallback(&loggerCallbackWrapper, (blpapi_Logging_Severity_t)severity); if (err != 0) { - throw std::runtime_error("unable to register callback"); + return -2; } + + return 0; } /** Convert `blpapi_TimePoint_t` value to `blpapi_Datetime_t`. Function * always returns UTC time. */ -blpapi_Datetime_t fromTimePoint(blpapi_TimePoint_t original) +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); - blpapi_Datetime_t datetime = highPrecisionDatetime.datetime; + 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 @@ -3668,7 +3590,7 @@ SWIG_AsVal_int (PyObject * obj, int *val) if ((v < INT_MIN || v > INT_MAX)) { return SWIG_OverflowError; } else { - if (val) *val = static_cast< int >(v); + if (val) *val = (int)(v); } } return res; @@ -3695,20 +3617,20 @@ SWIG_FromCharPtrAndSize(const char* carray, size_t size) 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(); + 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, static_cast< Py_ssize_t >(size)); + return PyBytes_FromStringAndSize(carray, (Py_ssize_t)(size)); #else #if PY_VERSION_HEX >= 0x03010000 - return PyUnicode_DecodeUTF8(carray, static_cast< Py_ssize_t >(size), "surrogateescape"); + return PyUnicode_DecodeUTF8(carray, (Py_ssize_t)(size), "surrogateescape"); #else - return PyUnicode_FromStringAndSize(carray, static_cast< Py_ssize_t >(size)); + return PyUnicode_FromStringAndSize(carray, (Py_ssize_t)(size)); #endif #endif #else - return PyString_FromStringAndSize(carray, static_cast< Py_ssize_t >(size)); + return PyString_FromStringAndSize(carray, (Py_ssize_t)(size)); #endif } } else { @@ -3717,13 +3639,6 @@ SWIG_FromCharPtrAndSize(const char* carray, size_t size) } -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) { @@ -3771,7 +3686,7 @@ SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) if (*alloc == SWIG_NEWOBJ) #endif { - *cptr = reinterpret_cast< char* >(memcpy(new char[len + 1], cstr, sizeof(char)*(len + 1))); + *cptr = (char *)memcpy(malloc((len + 1)*sizeof(char)), cstr, sizeof(char)*(len + 1)); *alloc = SWIG_NEWOBJ; } else { *cptr = cstr; @@ -3809,7 +3724,7 @@ SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) 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))); + *cptr = (char *)memcpy(malloc((len + 1)*sizeof(char)), cstr, sizeof(char)*(len + 1)); } if (psize) *psize = len + 1; @@ -3840,13 +3755,6 @@ SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) -SWIGINTERNINLINE PyObject* - SWIG_From_bool (bool value) -{ - return PyBool_FromLong(value ? 1 : 0); -} - - typedef int intArray; @@ -3948,22 +3856,22 @@ SWIG_AsVal_size_t (PyObject * obj, size_t *val) #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); + 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 = static_cast< size_t >(v); + if (SWIG_IsOK(res) && val) *val = (size_t)(v); } #endif return res; } SWIGINTERN intArray *new_intArray(size_t nelements){ - return (new int[nelements]()); + return (int *)calloc(nelements, sizeof(int)); } SWIGINTERN void delete_intArray(intArray *self){ - delete[] self; + free((char*)self); } SWIGINTERN int intArray___getitem__(intArray *self,size_t index){ return self[index]; @@ -3975,15 +3883,15 @@ SWIGINTERN int *intArray_cast(intArray *self){ return self; } SWIGINTERN intArray *intArray_frompointer(int *t){ - return static_cast< intArray * >(t); + return (intArray *)(t); } static blpapi_Topic_t* *new_topicPtrArray(size_t nelements) { - return (new blpapi_Topic_t*[nelements]()); + return (blpapi_Topic_t* *)calloc(nelements, sizeof(blpapi_Topic_t*)); } static void delete_topicPtrArray(blpapi_Topic_t* *ary) { - delete[] ary; + free((char*)ary); } static blpapi_Topic_t* topicPtrArray_getitem(blpapi_Topic_t* *ary, size_t index) { @@ -4006,10 +3914,10 @@ int pyObjectManagerFunc( if (operation == BLPAPI_MANAGEDPTR_COPY) { managedPtr->pointer = srcPtr->pointer; managedPtr->manager = srcPtr->manager; - Py_INCREF(reinterpret_cast(managedPtr->pointer)); + Py_INCREF((PyObject *) (managedPtr->pointer)); } else if (operation == BLPAPI_MANAGEDPTR_DESTROY) { - Py_DECREF(reinterpret_cast(managedPtr->pointer)); + Py_DECREF((PyObject *) (managedPtr->pointer)); } SWIG_PYTHON_THREAD_END_BLOCK; @@ -4018,63 +3926,70 @@ int pyObjectManagerFunc( 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; + 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) { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_CorrelationId_t *cid = new blpapi_CorrelationId_t; - std::memset(cid, 0, sizeof(blpapi_CorrelationId_t)); + 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; - SWIG_PYTHON_THREAD_END_ALLOW; + 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; } - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - blpapi_CorrelationId_t *cid = new blpapi_CorrelationId_t; - std::memset(cid, 0, sizeof(blpapi_CorrelationId_t)); - + 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; - SWIG_PYTHON_THREAD_END_ALLOW; + Py_END_ALLOW_THREADS Py_INCREF(value); return cid; } -blpapi_CorrelationId_t *CorrelationId_t_clone(const blpapi_CorrelationId_t& original) +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; + 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 = + 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); } } @@ -4082,13 +3997,13 @@ blpapi_CorrelationId_t *CorrelationId_t_clone(const blpapi_CorrelationId_t& orig return cid; } -void CorrelationId_t_cleanup(blpapi_CorrelationId_t& 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 (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); + manager(&cid->value.ptrValue, 0, BLPAPI_MANAGEDPTR_DESTROY); } } } @@ -4099,46 +4014,54 @@ void CorrelationId_t_delete(blpapi_CorrelationId_t *cid) return; } - CorrelationId_t_cleanup(*cid); + CorrelationId_t_cleanup(cid); - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - delete cid; - SWIG_PYTHON_THREAD_END_ALLOW; + Py_BEGIN_ALLOW_THREADS + free(cid); + Py_END_ALLOW_THREADS } -bool CorrelationId_t_equals( - const blpapi_CorrelationId_t& cid1, - const blpapi_CorrelationId_t& cid2) +int CorrelationId_t_equals( + const blpapi_CorrelationId_t *cid1, + const blpapi_CorrelationId_t *cid2) { - if (cid1.valueType != cid2.valueType) { - return false; + if (cid1 == cid2) { + return 1; } - if (cid1.classId != cid2.classId) { - return false; + 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; + if (cid1->valueType == BLPAPI_CORRELATION_TYPE_POINTER) { + return cid1->value.ptrValue.pointer == cid2->value.ptrValue.pointer; } else { - return cid1.value.intValue == cid2.value.intValue; + return cid1->value.intValue == cid2->value.intValue; } } -long long CorrelationId_t_toInteger(const blpapi_CorrelationId_t& cid) +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; + 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 *CorrelationId_t_getObject(const blpapi_CorrelationId_t *cid) { PyObject *res; - if (BLPAPI_CORRELATION_TYPE_POINTER == cid.valueType - && &pyObjectManagerFunc == cid.value.ptrValue.manager) + if (BLPAPI_CORRELATION_TYPE_POINTER == cid->valueType + && &pyObjectManagerFunc == cid->value.ptrValue.manager) { - res = reinterpret_cast(cid.value.ptrValue.pointer); + res = (PyObject *) (cid->value.ptrValue.pointer); } else { res = Py_None; @@ -4149,7 +4072,12 @@ PyObject *CorrelationId_t_getObject(const blpapi_CorrelationId_t& cid) { } -SWIGINTERN blpapi_CorrelationId_t_ *new_blpapi_CorrelationId_t___SWIG_0(){ +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(); } @@ -4204,22 +4132,22 @@ SWIG_AsVal_unsigned_SS_short (PyObject * obj, unsigned short *val) if ((v > USHRT_MAX)) { return SWIG_OverflowError; } else { - if (val) *val = static_cast< unsigned short >(v); + if (val) *val = (unsigned short)(v); } } return res; } -SWIGINTERN blpapi_CorrelationId_t_ *new_blpapi_CorrelationId_t___SWIG_1(long long value,unsigned short classId=0){ +SWIGINTERN struct blpapi_CorrelationId_t_ *new_blpapi_CorrelationId_t___SWIG_1(long long value,unsigned short classId){ return CorrelationId_t_createFromInteger(value, classId); } -SWIGINTERN blpapi_CorrelationId_t_ *new_blpapi_CorrelationId_t___SWIG_3(PyObject *value,unsigned short classId=0){ +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_(blpapi_CorrelationId_t_ *self){ +SWIGINTERN void delete_blpapi_CorrelationId_t_(struct blpapi_CorrelationId_t_ *self){ CorrelationId_t_delete((self)); } -SWIGINTERN unsigned short blpapi_CorrelationId_t__type(blpapi_CorrelationId_t_ const *self){ +SWIGINTERN unsigned short blpapi_CorrelationId_t__type(struct blpapi_CorrelationId_t_ const *self){ return self->valueType; } @@ -4229,13 +4157,13 @@ 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){ +SWIGINTERN unsigned short blpapi_CorrelationId_t__classId(struct 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 PyObject *blpapi_CorrelationId_t____asObject(struct blpapi_CorrelationId_t_ const *self){ + return CorrelationId_t_getObject(self); } -SWIGINTERN long long blpapi_CorrelationId_t____asInteger(blpapi_CorrelationId_t_ const *self){ +SWIGINTERN long long blpapi_CorrelationId_t____asInteger(struct blpapi_CorrelationId_t_ const *self){ return self->value.intValue; } @@ -4244,17 +4172,16 @@ 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)); + PyLong_FromLongLong(value) : PyInt_FromLong((long)(value)); } #endif -SWIGINTERN long long blpapi_CorrelationId_t____toInteger(blpapi_CorrelationId_t_ const *self){ - return CorrelationId_t_toInteger(*self); +SWIGINTERN long long blpapi_CorrelationId_t____toInteger(struct 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, @@ -4313,21 +4240,23 @@ int blpapi_Element_setValueFloat( return ret; } -std::string blpapi_Element_printHelper( +void blpapi_Element_printHelper( blpapi_Element_t *element, int level, - int spacesPerLevel) + int spacesPerLevel, + char **output_allocated, + int *output_size) { - std::ostringstream stream; - + // StreamWriterData and cstr_StreamWriter are defined in internals.i + StreamWriterData stream = {0}; blpapi_Element_print( element, - BloombergLP::blpapi::OstreamWriter, + cstr_StreamWriter, &stream, level, spacesPerLevel); - - return stream.str(); + *output_allocated = stream.stream; + *output_size = stream.size; } @@ -4393,7 +4322,7 @@ SWIG_AsVal_unsigned_SS_int (PyObject * obj, unsigned int *val) if ((v > UINT_MAX)) { return SWIG_OverflowError; } else { - if (val) *val = static_cast< unsigned int >(v); + if (val) *val = (unsigned int)(v); } } return res; @@ -4414,12 +4343,12 @@ SWIG_AsCharArray(PyObject * obj, char *val, size_t size) if (csize < size) memset(val + csize, 0, (size - csize)*sizeof(char)); } if (alloc == SWIG_NEWOBJ) { - delete[] cptr; + free((char*)cptr); res = SWIG_DelNewMask(res); } return res; } - if (alloc == SWIG_NEWOBJ) delete[] cptr; + if (alloc == SWIG_NEWOBJ) free((char*)cptr); } return SWIG_TypeError; } @@ -4434,7 +4363,7 @@ SWIG_AsVal_char (PyObject * obj, char *val) 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); + if (val) *val = (char)(v); } else { res = SWIG_OverflowError; } @@ -4446,9 +4375,10 @@ SWIG_AsVal_char (PyObject * obj, char *val) #include "blpapi_session.h" -void dispatchEventProxy(blpapi_Event_t *event, blpapi_Session_t *, void *userData) +void dispatchEventProxy(blpapi_Event_t *event, blpapi_Session_t *session, void *userData) { - PyObject *eventDispatcherFunc = reinterpret_cast(userData); + PyObject *eventDispatcherFunc = (PyObject *) (userData); + PyObject *result; SWIG_PYTHON_THREAD_BEGIN_BLOCK; @@ -4456,7 +4386,7 @@ void dispatchEventProxy(blpapi_Event_t *event, blpapi_Session_t *, void *userDat PyTuple_SET_ITEM(arglist, 0, SWIG_NewPointerObj(SWIG_as_voidptr(event), SWIGTYPE_p_blpapi_Event, 0)); - PyObject *result = PyEval_CallObject(eventDispatcherFunc, arglist); + result = PyEval_CallObject(eventDispatcherFunc, arglist); Py_DECREF(arglist); Py_XDECREF(result); @@ -4469,7 +4399,7 @@ blpapi_Session_t *Session_createHelper(blpapi_SessionOptions_t *parameters, blpapi_EventDispatcher_t *dispatcher) { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - const bool hasHandler = + const int hasHandler = eventHandlerFunc != 0 && eventHandlerFunc != Py_None; blpapi_Session_t *const res = blpapi_Session_create( @@ -4501,17 +4431,19 @@ void Session_destroyHelper(blpapi_Session_t *sessionHandle, PyObject *eventHandl #include "blpapi_providersession.h" -void dispatchProviderEventProxy(blpapi_Event_t *event, blpapi_ProviderSession_t *, void *userData) +void dispatchProviderEventProxy(blpapi_Event_t *event, blpapi_ProviderSession_t *providerSession, void *userData) { - PyObject *eventDispatcherFunc = reinterpret_cast(userData); + PyObject *eventDispatcherFunc = (PyObject *) (userData); + PyObject *result; + PyObject *arglist; SWIG_PYTHON_THREAD_BEGIN_BLOCK; - PyObject *arglist = PyTuple_New(1); + 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); + result = PyEval_CallObject(eventDispatcherFunc, arglist); Py_DECREF(arglist); Py_XDECREF(result); @@ -4524,7 +4456,7 @@ blpapi_ProviderSession_t *ProviderSession_createHelper(blpapi_SessionOptions_t * blpapi_EventDispatcher_t *dispatcher) { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - const bool hasHandler = + const int hasHandler = eventHandlerFunc != 0 && eventHandlerFunc != Py_None; blpapi_ProviderSession_t *const res = blpapi_ProviderSession_create( @@ -4555,7 +4487,7 @@ void ProviderSession_destroyHelper(blpapi_ProviderSession_t *sessionHandle, int ProviderSession_terminateSubscriptionsOnTopic(blpapi_ProviderSession_t *sessionHandle, const blpapi_Topic_t *topic, - const char *message=0) + const char *message) { int res; SWIG_PYTHON_THREAD_BEGIN_ALLOW; @@ -4564,19 +4496,6 @@ int ProviderSession_terminateSubscriptionsOnTopic(blpapi_ProviderSession_t *sess 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. */ @@ -4626,7 +4545,7 @@ SWIG_AsVal_float (PyObject * obj, float *val) if (SWIG_Float_Overflow_Check(v)) { return SWIG_OverflowError; } else { - if (val) *val = static_cast< float >(v); + if (val) *val = (float)(v); } } return res; @@ -4649,7 +4568,7 @@ SWIG_AsVal_unsigned_SS_char (PyObject * obj, unsigned char *val) if ((v > UCHAR_MAX)) { return SWIG_OverflowError; } else { - if (val) *val = static_cast< unsigned char >(v); + if (val) *val = (unsigned char)(v); } } return res; @@ -4672,7 +4591,7 @@ SWIG_AsVal_short (PyObject * obj, short *val) if ((v < SHRT_MIN || v > SHRT_MAX)) { return SWIG_OverflowError; } else { - if (val) *val = static_cast< short >(v); + if (val) *val = (short)(v); } } return res; @@ -4696,6 +4615,7 @@ SWIGINTERN PyObject *_wrap_setLoggerCallbackWrapper(PyObject *SWIGUNUSEDPARM(sel int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; + int result; if (!PyArg_ParseTuple(args,(char *)"OO:setLoggerCallbackWrapper",&obj0,&obj1)) SWIG_fail; arg1 = obj0; @@ -4703,29 +4623,45 @@ SWIGINTERN PyObject *_wrap_setLoggerCallbackWrapper(PyObject *SWIGUNUSEDPARM(sel if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "setLoggerCallbackWrapper" "', argument " "2"" of type '" "int""'"); } - arg2 = static_cast< int >(val2); + 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; - try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - setLoggerCallbackWrapper(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; + 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)); } - } catch(std::out_of_range const& error) { - SWIG_exception(SWIG_IndexError, error.what()); - } catch(std::bad_alloc const& error) { - SWIG_exception(SWIG_MemoryError, error.what()); - } catch(std::overflow_error const& error) { - SWIG_exception(SWIG_OverflowError, error.what()); - } catch(std::invalid_argument const& error) { - SWIG_exception(SWIG_ValueError, error.what()); - } catch(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(); + { + 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; @@ -4746,45 +4682,27 @@ SWIGINTERN PyObject *_wrap_blpapi_Logging_registerCallback(PyObject *SWIGUNUSEDP 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); + 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 { - blpapi_Logging_Func_t * temp = reinterpret_cast< blpapi_Logging_Func_t * >(argp1); - arg1 = *temp; - if (SWIG_IsNewObj(res1)) delete temp; + 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 = 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -4803,28 +4721,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Logging_logTestMessage(PyObject *SWIGUNUSEDPAR 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()); + 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: @@ -4834,106 +4736,15 @@ SWIGINTERN PyObject *_wrap_blpapi_Logging_logTestMessage(PyObject *SWIGUNUSEDPAR SWIGINTERN PyObject *_wrap_blpapi_DiagnosticsUtil_memoryInfo_wrapper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - std::string result; + PyObject *result = 0 ; 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()); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (PyObject *)blpapi_DiagnosticsUtil_memoryInfo_wrapper(); + SWIG_PYTHON_THREAD_END_ALLOW; } - - resultobj = SWIG_NewPointerObj((new blpapi_Datetime_t(static_cast< const blpapi_Datetime_t& >(result))), SWIGTYPE_p_blpapi_Datetime_tag, SWIG_POINTER_OWN | 0 ); + resultobj = result; return resultobj; fail: return NULL; @@ -4957,34 +4768,18 @@ SWIGINTERN PyObject *_wrap_blpapi_EventDispatcher_stop(PyObject *SWIGUNUSEDPARM( 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); + 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 = 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()); + arg2 = (int)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_EventDispatcher_stop(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; } - - resultobj = SWIG_From_int(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -4996,55 +4791,47 @@ 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 ; - std::string result; + 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)) { 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); + 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 = static_cast< int >(val2); + 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 = 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()); + 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); } - - resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: return NULL; @@ -5056,55 +4843,47 @@ 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 ; - std::string result; + 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)) { 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); + 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 = static_cast< int >(val2); + 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 = 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()); + 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); } - - resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: return NULL; @@ -5116,55 +4895,47 @@ 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 ; - std::string result; + 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)) { 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); + 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 = static_cast< int >(val2); + 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 = 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()); + 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); } - - resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: return NULL; @@ -5176,55 +4947,47 @@ 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 ; - std::string result; + 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)) { 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); + 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 = static_cast< int >(val2); + 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 = 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()); + 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); } - - resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: return NULL; @@ -5246,50 +5009,34 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_hasElementDefinition(PyOb PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; - bool result; + 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 = reinterpret_cast< blpapi_SchemaTypeDefinition_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_hasElementDefinition" "', argument " "2"" of type '" "char const *""'"); } - arg2 = reinterpret_cast< char * >(buf2); + 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 = 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()); + 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_bool(static_cast< bool >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -5309,50 +5056,34 @@ SWIGINTERN PyObject *_wrap_blpapi_ConstantList_hasConstant(PyObject *SWIGUNUSEDP PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; - bool result; + 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 = reinterpret_cast< blpapi_ConstantList_t * >(argp1); + 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 = reinterpret_cast< char * >(buf2); + 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 = 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()); + 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_bool(static_cast< bool >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -5372,50 +5103,34 @@ SWIGINTERN PyObject *_wrap_blpapi_Service_hasEventDefinition(PyObject *SWIGUNUSE PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; - bool result; + 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 = reinterpret_cast< blpapi_Service_t * >(argp1); + 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 = reinterpret_cast< char * >(buf2); + 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 = 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()); + 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_bool(static_cast< bool >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -5435,50 +5150,34 @@ SWIGINTERN PyObject *_wrap_blpapi_Service_hasOperation(PyObject *SWIGUNUSEDPARM( PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; - bool result; + 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 = reinterpret_cast< blpapi_Service_t * >(argp1); + 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 = reinterpret_cast< char * >(buf2); + 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 = 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()); + 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_bool(static_cast< bool >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -5515,57 +5214,41 @@ SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_addHelper(PyObject *SWIGUNUSE 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); + 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 = reinterpret_cast< char * >(buf2); + 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 = reinterpret_cast< blpapi_CorrelationId_t * >(argp3); + 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 = reinterpret_cast< char * >(buf4); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - if (alloc4 == SWIG_NEWOBJ) delete[] buf4; - if (alloc5 == SWIG_NEWOBJ) delete[] buf5; + 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) delete[] buf2; - if (alloc4 == SWIG_NEWOBJ) delete[] buf4; - if (alloc5 == SWIG_NEWOBJ) delete[] buf5; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); + if (alloc5 == SWIG_NEWOBJ) free((char*)buf5); return NULL; } @@ -5577,40 +5260,24 @@ SWIGINTERN PyObject *_wrap_blpapi_Name_hasName(PyObject *SWIGUNUSEDPARM(self), P char *buf1 = 0 ; int alloc1 = 0 ; PyObject * obj0 = 0 ; - bool result; + 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 = 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()); + arg1 = (char *)(buf1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_Name_hasName((char const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; } - - resultobj = SWIG_From_bool(static_cast< bool >(result)); - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; + resultobj = SWIG_From_int((int)(result)); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return resultobj; fail: - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return NULL; } @@ -5628,28 +5295,12 @@ SWIGINTERN PyObject *_wrap_blpapi_TopicList_createFromResolutionList(PyObject *S 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()); + 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: @@ -5670,28 +5321,12 @@ SWIGINTERN PyObject *_wrap_new_intArray(PyObject *SWIGUNUSEDPARM(self), PyObject 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()); + 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: @@ -5711,28 +5346,12 @@ SWIGINTERN PyObject *_wrap_delete_intArray(PyObject *SWIGUNUSEDPARM(self), PyObj 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()); + arg1 = (intArray *)(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + delete_intArray(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -5757,34 +5376,18 @@ SWIGINTERN PyObject *_wrap_intArray___getitem__(PyObject *SWIGUNUSEDPARM(self), if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "intArray___getitem__" "', argument " "1"" of type '" "intArray *""'"); } - arg1 = reinterpret_cast< intArray * >(argp1); + 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 = 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()); + arg2 = (size_t)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)intArray___getitem__(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; } - - resultobj = SWIG_From_int(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -5811,38 +5414,22 @@ SWIGINTERN PyObject *_wrap_intArray___setitem__(PyObject *SWIGUNUSEDPARM(self), if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "intArray___setitem__" "', argument " "1"" of type '" "intArray *""'"); } - arg1 = reinterpret_cast< intArray * >(argp1); + 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 = static_cast< size_t >(val2); + 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 = 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()); + 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: @@ -5863,28 +5450,12 @@ SWIGINTERN PyObject *_wrap_intArray_cast(PyObject *SWIGUNUSEDPARM(self), PyObjec 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()); + 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: @@ -5905,28 +5476,12 @@ SWIGINTERN PyObject *_wrap_intArray_frompointer(PyObject *SWIGUNUSEDPARM(self), 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()); + 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: @@ -5954,28 +5509,12 @@ SWIGINTERN PyObject *_wrap_new_topicPtrArray(PyObject *SWIGUNUSEDPARM(self), PyO 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()); + 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: @@ -5995,28 +5534,12 @@ SWIGINTERN PyObject *_wrap_delete_topicPtrArray(PyObject *SWIGUNUSEDPARM(self), 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()); + 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: @@ -6041,33 +5564,17 @@ SWIGINTERN PyObject *_wrap_topicPtrArray_getitem(PyObject *SWIGUNUSEDPARM(self), 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); + 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 = 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()); + 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: @@ -6095,38 +5602,22 @@ SWIGINTERN PyObject *_wrap_topicPtrArray_setitem(PyObject *SWIGUNUSEDPARM(self), 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); + 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 = static_cast< size_t >(val2); + 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 = 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()); + 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: @@ -6136,126 +5627,67 @@ SWIGINTERN PyObject *_wrap_topicPtrArray_setitem(PyObject *SWIGUNUSEDPARM(self), SWIGINTERN PyObject *_wrap_CorrelationId_t_equals(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_CorrelationId_t *arg1 = 0 ; - blpapi_CorrelationId_t *arg2 = 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 ; - bool result; + 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); + 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 &""'"); + 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); + 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 &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CorrelationId_t_equals" "', argument " "2"" of type '" "blpapi_CorrelationId_t const &""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "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)); + 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_new_CorrelationId__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_CorrelationId_value_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_CorrelationId_t_ *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_CorrelationId")) SWIG_fail; + 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 ; - 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()); + 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_ *""'"); } - - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_blpapi_CorrelationId_t_, SWIG_POINTER_NEW | 0 ); + 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_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_new_CorrelationId__SWIG_0(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()); - } + 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: @@ -6263,37 +5695,32 @@ 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_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 ; - blpapi_CorrelationId_t_ *result = 0 ; + PyObject * obj1 = 0 ; + struct blpapi_CorrelationId_t_ *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:new_CorrelationId",&obj0)) SWIG_fail; + 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 = 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()); + 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: @@ -6301,76 +5728,28 @@ SWIGINTERN PyObject *_wrap_new_CorrelationId__SWIG_2(PyObject *SWIGUNUSEDPARM(se } -SWIGINTERN PyObject *_wrap_new_CorrelationId__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_new_CorrelationId__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; PyObject *arg1 = (PyObject *) 0 ; - unsigned short arg2 ; + unsigned short arg2 = (unsigned short) 0 ; unsigned short val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; - blpapi_CorrelationId_t_ *result = 0 ; + struct blpapi_CorrelationId_t_ *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OO:new_CorrelationId",&obj0,&obj1)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"O|O: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()); + 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: @@ -6393,30 +5772,16 @@ SWIGINTERN PyObject *_wrap_new_CorrelationId(PyObject *self, PyObject *args) { 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) { + 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); @@ -6426,16 +5791,19 @@ SWIGINTERN PyObject *_wrap_new_CorrelationId(PyObject *self, PyObject *args) { } } } - if (argc == 2) { + 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_3(self, args); + return _wrap_new_CorrelationId__SWIG_2(self, args); } } } @@ -6445,16 +5813,14 @@ SWIGINTERN PyObject *_wrap_new_CorrelationId(PyObject *self, PyObject *args) { " 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"); + " 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; - blpapi_CorrelationId_t_ *arg1 = (blpapi_CorrelationId_t_ *) 0 ; + struct blpapi_CorrelationId_t_ *arg1 = (struct blpapi_CorrelationId_t_ *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; @@ -6462,26 +5828,10 @@ SWIGINTERN PyObject *_wrap_delete_CorrelationId(PyObject *SWIGUNUSEDPARM(self), 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()); + 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: @@ -6491,7 +5841,7 @@ SWIGINTERN PyObject *_wrap_delete_CorrelationId(PyObject *SWIGUNUSEDPARM(self), SWIGINTERN PyObject *_wrap_CorrelationId_type(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_CorrelationId_t_ *arg1 = (blpapi_CorrelationId_t_ *) 0 ; + struct blpapi_CorrelationId_t_ *arg1 = (struct blpapi_CorrelationId_t_ *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; @@ -6500,27 +5850,11 @@ SWIGINTERN PyObject *_wrap_CorrelationId_type(PyObject *SWIGUNUSEDPARM(self), Py 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()); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CorrelationId_type" "', argument " "1"" of type '" "struct blpapi_CorrelationId_t_ const *""'"); } - - resultobj = SWIG_From_unsigned_SS_short(static_cast< unsigned short >(result)); + 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; @@ -6529,7 +5863,7 @@ SWIGINTERN PyObject *_wrap_CorrelationId_type(PyObject *SWIGUNUSEDPARM(self), Py SWIGINTERN PyObject *_wrap_CorrelationId_classId(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_CorrelationId_t_ *arg1 = (blpapi_CorrelationId_t_ *) 0 ; + struct blpapi_CorrelationId_t_ *arg1 = (struct blpapi_CorrelationId_t_ *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; @@ -6538,27 +5872,11 @@ SWIGINTERN PyObject *_wrap_CorrelationId_classId(PyObject *SWIGUNUSEDPARM(self), 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()); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CorrelationId_classId" "', argument " "1"" of type '" "struct blpapi_CorrelationId_t_ const *""'"); } - - resultobj = SWIG_From_unsigned_SS_short(static_cast< unsigned short >(result)); + 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; @@ -6567,7 +5885,7 @@ SWIGINTERN PyObject *_wrap_CorrelationId_classId(PyObject *SWIGUNUSEDPARM(self), SWIGINTERN PyObject *_wrap_CorrelationId___asObject(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_CorrelationId_t_ *arg1 = (blpapi_CorrelationId_t_ *) 0 ; + struct blpapi_CorrelationId_t_ *arg1 = (struct blpapi_CorrelationId_t_ *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; @@ -6576,26 +5894,10 @@ SWIGINTERN PyObject *_wrap_CorrelationId___asObject(PyObject *SWIGUNUSEDPARM(sel 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()); + 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; } @@ -6607,7 +5909,7 @@ SWIGINTERN PyObject *_wrap_CorrelationId___asObject(PyObject *SWIGUNUSEDPARM(sel SWIGINTERN PyObject *_wrap_CorrelationId___asInteger(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_CorrelationId_t_ *arg1 = (blpapi_CorrelationId_t_ *) 0 ; + struct blpapi_CorrelationId_t_ *arg1 = (struct blpapi_CorrelationId_t_ *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; @@ -6616,27 +5918,11 @@ SWIGINTERN PyObject *_wrap_CorrelationId___asInteger(PyObject *SWIGUNUSEDPARM(se 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()); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CorrelationId___asInteger" "', argument " "1"" of type '" "struct blpapi_CorrelationId_t_ const *""'"); } - - resultobj = SWIG_From_long_SS_long(static_cast< long long >(result)); + 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; @@ -6645,7 +5931,7 @@ SWIGINTERN PyObject *_wrap_CorrelationId___asInteger(PyObject *SWIGUNUSEDPARM(se SWIGINTERN PyObject *_wrap_CorrelationId___toInteger(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_CorrelationId_t_ *arg1 = (blpapi_CorrelationId_t_ *) 0 ; + struct blpapi_CorrelationId_t_ *arg1 = (struct blpapi_CorrelationId_t_ *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; @@ -6654,37 +5940,70 @@ SWIGINTERN PyObject *_wrap_CorrelationId___toInteger(PyObject *SWIGUNUSEDPARM(se 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CorrelationId___toInteger" "', argument " "1"" of type '" "struct blpapi_CorrelationId_t_ const *""'"); } - arg1 = reinterpret_cast< blpapi_CorrelationId_t_ * >(argp1); + 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 ; - 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()); + 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 ; - resultobj = SWIG_From_long_SS_long(static_cast< long long >(result)); + 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 *CorrelationId_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +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_, SWIG_NewClientData(obj)); + SWIG_TypeNewClientData(SWIGTYPE_p_blpapi_CorrelationId_t__value, SWIG_NewClientData(obj)); return SWIG_Py_Void(); } @@ -6714,48 +6033,32 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_setElementFloat(PyObject *SWIGUNUSEDPA 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); + 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 = reinterpret_cast< char * >(buf2); + 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 = reinterpret_cast< blpapi_Name_t * >(argp3); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -6781,39 +6084,23 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_setValueFloat(PyObject *SWIGUNUSEDPARM 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); + 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 = static_cast< blpapi_Float64_t >(val2); + 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 = 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -6825,55 +6112,47 @@ 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 ; - std::string result; + 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)) { 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); + 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 = static_cast< int >(val2); + 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 = 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()); + 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); } - - resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: return NULL; @@ -6893,28 +6172,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_name(PyObject *SWIGUNUSEDPARM(self), P 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()); + 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: @@ -6935,28 +6198,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_nameString(PyObject *SWIGUNUSEDPARM(se 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()); + 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: @@ -6977,28 +6224,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_definition(PyObject *SWIGUNUSEDPARM(se 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()); + 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: @@ -7019,29 +6250,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_datatype(PyObject *SWIGUNUSEDPARM(self 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -7061,29 +6276,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_isComplexType(PyObject *SWIGUNUSEDPARM 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -7103,29 +6302,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_isArray(PyObject *SWIGUNUSEDPARM(self) 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -7145,29 +6328,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_isReadOnly(PyObject *SWIGUNUSEDPARM(se 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -7187,29 +6354,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_numValues(PyObject *SWIGUNUSEDPARM(sel 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()); + 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(static_cast< size_t >(result)); + resultobj = SWIG_From_size_t((size_t)(result)); return resultobj; fail: return NULL; @@ -7227,31 +6378,15 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_numElements(PyObject *SWIGUNUSEDPARM(s 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()); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Element_numElements" "', argument " "1"" of type '" "blpapi_Element_t const *""'"); } - - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); + 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; @@ -7275,34 +6410,18 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_isNullValue(PyObject *SWIGUNUSEDPARM(s 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); + 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 = 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -7322,29 +6441,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_isNull(PyObject *SWIGUNUSEDPARM(self), 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -7371,34 +6474,18 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_getElementAt(PyObject *SWIGUNUSEDPARM( 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); + 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 = 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)); + 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: @@ -7431,44 +6518,28 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_getElement(PyObject *SWIGUNUSEDPARM(se 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); + 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 = reinterpret_cast< char * >(buf3); + 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 = 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)); + 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) delete[] buf3; + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return resultobj; fail: - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return NULL; } @@ -7503,53 +6574,37 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_hasElementEx(PyObject *SWIGUNUSEDPARM( 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); + 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 = reinterpret_cast< char * >(buf2); + 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 = reinterpret_cast< blpapi_Name_t * >(argp3); + 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 = static_cast< int >(val4); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -7575,34 +6630,18 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsBool(PyObject *SWIGUNUSEDPAR 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); + 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 = 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)); + 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 { @@ -7637,43 +6676,27 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsChar(PyObject *SWIGUNUSEDPAR 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); + 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 = reinterpret_cast< blpapi_Char_t * >(buf2); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -7699,39 +6722,23 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsInt32(PyObject *SWIGUNUSEDPA 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); + 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 = reinterpret_cast< blpapi_Int32_t * >(argp2); + 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 = 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -7759,34 +6766,18 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsInt64(PyObject *SWIGUNUSEDPA 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); + 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 = 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)); + 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 { @@ -7820,34 +6811,18 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsFloat64(PyObject *SWIGUNUSED 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); + 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 = 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)); + 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 { @@ -7880,34 +6855,18 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsString(PyObject *SWIGUNUSEDP 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); + 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 = 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)); + 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: @@ -7922,52 +6881,38 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsDatetime(PyObject *SWIGUNUSE 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 = new blpapi_Datetime_t; + 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 = reinterpret_cast< blpapi_Element_t * >(argp1); + 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 = 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()); + 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)); } - - 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; } @@ -7979,52 +6924,38 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsHighPrecisionDatetime(PyObje 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 = new blpapi_HighPrecisionDatetime_t; + 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 = reinterpret_cast< blpapi_Element_t * >(argp1); + 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 = 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()); + 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)); } - - 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; } @@ -8049,34 +6980,18 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsElement(PyObject *SWIGUNUSED 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); + 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 = 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)); + 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: @@ -8104,34 +7019,18 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_getValueAsName(PyObject *SWIGUNUSEDPAR 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); + 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 = 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)); + 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: @@ -8155,29 +7054,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_getChoice(PyObject *SWIGUNUSEDPARM(sel 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)); + 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: @@ -8206,39 +7089,23 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_setValueBool(PyObject *SWIGUNUSEDPARM( 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); + 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 = static_cast< blpapi_Bool_t >(val2); + 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 = 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -8266,39 +7133,23 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_setValueInt32(PyObject *SWIGUNUSEDPARM 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); + 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 = static_cast< blpapi_Int32_t >(val2); + 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 = 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -8326,39 +7177,23 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_setValueInt64(PyObject *SWIGUNUSEDPARM 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); + 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 = static_cast< blpapi_Int64_t >(val2); + 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 = 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -8387,43 +7222,27 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_setValueString(PyObject *SWIGUNUSEDPAR 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); + 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 = reinterpret_cast< char * >(buf2); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -8449,39 +7268,23 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_setValueDatetime(PyObject *SWIGUNUSEDP 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); + 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 = reinterpret_cast< blpapi_Datetime_t * >(argp2); + 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 = 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -8509,39 +7312,23 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_setValueFromName(PyObject *SWIGUNUSEDP 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); + 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 = reinterpret_cast< blpapi_Name_t * >(argp2); + 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 = 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -8574,48 +7361,32 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_setElementBool(PyObject *SWIGUNUSEDPAR 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); + 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 = reinterpret_cast< char * >(buf2); + 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 = reinterpret_cast< blpapi_Name_t * >(argp3); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -8646,48 +7417,32 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_setElementInt32(PyObject *SWIGUNUSEDPA 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); + 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 = reinterpret_cast< char * >(buf2); + 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 = reinterpret_cast< blpapi_Name_t * >(argp3); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -8718,48 +7473,32 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_setElementInt64(PyObject *SWIGUNUSEDPA 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); + 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 = reinterpret_cast< char * >(buf2); + 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 = reinterpret_cast< blpapi_Name_t * >(argp3); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -8791,50 +7530,34 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_setElementString(PyObject *SWIGUNUSEDP 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); + 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 = reinterpret_cast< char * >(buf2); + 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 = reinterpret_cast< blpapi_Name_t * >(argp3); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - if (alloc4 == SWIG_NEWOBJ) delete[] buf4; + 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) delete[] buf2; - if (alloc4 == SWIG_NEWOBJ) delete[] buf4; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); return NULL; } @@ -8865,48 +7588,32 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_setElementDatetime(PyObject *SWIGUNUSE 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); + 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 = reinterpret_cast< char * >(buf2); + 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 = reinterpret_cast< blpapi_Name_t * >(argp3); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -8937,48 +7644,32 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_setElementFromName(PyObject *SWIGUNUSE 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); + 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 = reinterpret_cast< char * >(buf2); + 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 = reinterpret_cast< blpapi_Name_t * >(argp3); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -8999,29 +7690,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_appendElement(PyObject *SWIGUNUSEDPARM 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)); + 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: @@ -9058,49 +7733,33 @@ SWIGINTERN PyObject *_wrap_blpapi_Element_setChoice(PyObject *SWIGUNUSEDPARM(sel 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); + 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 = reinterpret_cast< char * >(buf3); + 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 = reinterpret_cast< blpapi_Name_t * >(argp4); + 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 = 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)); + 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) delete[] buf3; + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return resultobj; fail: - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return NULL; } @@ -9131,48 +7790,32 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueFloat(PyObject *SWIGUNU 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); + 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 = reinterpret_cast< char * >(buf2); + 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 = reinterpret_cast< blpapi_Name_t * >(argp3); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -9194,34 +7837,18 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueFloat(PyObject *SWIG 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); + 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 = 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -9241,28 +7868,12 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_create(PyObject *SWIGUNUSEDPARM 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()); + 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: @@ -9282,28 +7893,12 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_destroy(PyObject *SWIGUNUSEDPAR 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()); + 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: @@ -9337,48 +7932,32 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendMessage(PyObject *SWIGUNU 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); + 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 = reinterpret_cast< char * >(buf2); + 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 = reinterpret_cast< blpapi_Name_t * >(argp3); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -9417,58 +7996,42 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendMessageSeq(PyObject *SWIG 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); + 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 = reinterpret_cast< char * >(buf2); + 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 = reinterpret_cast< blpapi_Name_t * >(argp3); + 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 = reinterpret_cast< blpapi_Topic_t * >(argp4); + 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 = static_cast< unsigned int >(val5); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -9495,43 +8058,27 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendResponse(PyObject *SWIGUN 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); + 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 = reinterpret_cast< char * >(buf2); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -9557,39 +8104,23 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendRecapMessage(PyObject *SW 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); + 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 = reinterpret_cast< blpapi_Topic_t * >(argp2); + 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 = 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -9625,49 +8156,33 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendRecapMessageSeq(PyObject 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); + 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 = reinterpret_cast< blpapi_Topic_t * >(argp2); + 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 = reinterpret_cast< blpapi_CorrelationId_t * >(argp3); + 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 = static_cast< unsigned int >(val4); + 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 = 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -9708,58 +8223,42 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendFragmentedRecapMessage(Py 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); + 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 = reinterpret_cast< char * >(buf2); + 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 = reinterpret_cast< blpapi_Name_t * >(argp3); + 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 = reinterpret_cast< blpapi_Topic_t * >(argp4); + 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 = reinterpret_cast< blpapi_CorrelationId_t * >(argp5); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -9798,58 +8297,42 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendFragmentedRecapMessageSeq 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); + 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 = reinterpret_cast< char * >(buf2); + 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 = reinterpret_cast< blpapi_Name_t * >(argp3); + 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 = reinterpret_cast< blpapi_Topic_t * >(argp4); + 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 = static_cast< int >(val5); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -9880,48 +8363,32 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueBool(PyObject *SWIGUNUS 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); + 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 = reinterpret_cast< char * >(buf2); + 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 = reinterpret_cast< blpapi_Name_t * >(argp3); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -9952,48 +8419,32 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueChar(PyObject *SWIGUNUS 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); + 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 = reinterpret_cast< char * >(buf2); + 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 = reinterpret_cast< blpapi_Name_t * >(argp3); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -10024,48 +8475,32 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueInt32(PyObject *SWIGUNU 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); + 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 = reinterpret_cast< char * >(buf2); + 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 = reinterpret_cast< blpapi_Name_t * >(argp3); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -10096,48 +8531,32 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueInt64(PyObject *SWIGUNU 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); + 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 = reinterpret_cast< char * >(buf2); + 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 = reinterpret_cast< blpapi_Name_t * >(argp3); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -10168,48 +8587,32 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueDatetime(PyObject *SWIG 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); + 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 = reinterpret_cast< char * >(buf2); + 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 = reinterpret_cast< blpapi_Name_t * >(argp3); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -10241,50 +8644,34 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueString(PyObject *SWIGUN 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); + 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 = reinterpret_cast< char * >(buf2); + 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 = reinterpret_cast< blpapi_Name_t * >(argp3); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - if (alloc4 == SWIG_NEWOBJ) delete[] buf4; + 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) delete[] buf2; - if (alloc4 == SWIG_NEWOBJ) delete[] buf4; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); return NULL; } @@ -10315,48 +8702,32 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueFromName(PyObject *SWIG 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); + 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 = reinterpret_cast< char * >(buf2); + 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 = reinterpret_cast< blpapi_Name_t * >(argp3); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -10383,43 +8754,27 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_setValueNull(PyObject *SWIGUNUS 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); + 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 = reinterpret_cast< char * >(buf2); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -10446,43 +8801,27 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_pushElement(PyObject *SWIGUNUSE 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); + 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 = reinterpret_cast< char * >(buf2); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -10500,29 +8839,13 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_popElement(PyObject *SWIGUNUSED 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -10546,34 +8869,18 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueBool(PyObject *SWIGU 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); + 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 = 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -10597,34 +8904,18 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueChar(PyObject *SWIGU 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); + 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 = 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()); + arg2 = (char)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_EventFormatter_appendValueChar(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; } - - resultobj = SWIG_From_int(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -10648,34 +8939,18 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueInt32(PyObject *SWIG 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); + 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 = 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -10699,34 +8974,18 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueInt64(PyObject *SWIG 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); + 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 = 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -10750,34 +9009,18 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueDatetime(PyObject *S 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); + 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 = 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -10802,38 +9045,22 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueString(PyObject *SWI 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); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -10855,34 +9082,18 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendValueFromName(PyObject *S 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); + 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 = 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -10902,29 +9113,13 @@ SWIGINTERN PyObject *_wrap_blpapi_EventFormatter_appendElement(PyObject *SWIGUNU 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -10950,7 +9145,7 @@ SWIGINTERN PyObject *_wrap_Session_createHelper(PyObject *SWIGUNUSEDPARM(self), 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); + arg1 = (blpapi_SessionOptions_t *)(argp1); { arg2 = obj1; } @@ -10958,24 +9153,8 @@ SWIGINTERN PyObject *_wrap_Session_createHelper(PyObject *SWIGUNUSEDPARM(self), 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()); - } - + 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: @@ -10997,27 +9176,11 @@ SWIGINTERN PyObject *_wrap_Session_destroyHelper(PyObject *SWIGUNUSEDPARM(self), 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); + arg1 = (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()); - } - + Session_destroyHelper(arg1,arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -11038,28 +9201,12 @@ SWIGINTERN PyObject *_wrap_blpapi_EventDispatcher_create(PyObject *SWIGUNUSEDPAR 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()); + 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: @@ -11079,28 +9226,12 @@ SWIGINTERN PyObject *_wrap_blpapi_EventDispatcher_destroy(PyObject *SWIGUNUSEDPA 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()); + 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: @@ -11121,29 +9252,13 @@ SWIGINTERN PyObject *_wrap_blpapi_EventDispatcher_start(PyObject *SWIGUNUSEDPARM 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -11169,7 +9284,7 @@ SWIGINTERN PyObject *_wrap_ProviderSession_createHelper(PyObject *SWIGUNUSEDPARM 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); + arg1 = (blpapi_SessionOptions_t *)(argp1); { arg2 = obj1; } @@ -11177,24 +9292,8 @@ SWIGINTERN PyObject *_wrap_ProviderSession_createHelper(PyObject *SWIGUNUSEDPARM 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()); - } - + 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: @@ -11216,27 +9315,11 @@ SWIGINTERN PyObject *_wrap_ProviderSession_destroyHelper(PyObject *SWIGUNUSEDPAR 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); + arg1 = (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()); - } - + ProviderSession_destroyHelper(arg1,arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -11266,90 +9349,23 @@ SWIGINTERN PyObject *_wrap_ProviderSession_terminateSubscriptionsOnTopic(PyObjec 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); + 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 = reinterpret_cast< blpapi_Topic_t * >(argp2); + 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 = 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)); + 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; } @@ -11367,28 +9383,12 @@ SWIGINTERN PyObject *_wrap_blpapi_getLastErrorDescription(PyObject *SWIGUNUSEDPA 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()); + 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: @@ -11401,27 +9401,11 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_create(PyObject *SWIGUNUSEDPARM 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()); + { + 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: @@ -11441,28 +9425,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_destroy(PyObject *SWIGUNUSEDPAR 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()); + 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: @@ -11488,38 +9456,22 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setServerHost(PyObject *SWIGUNU 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); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -11541,34 +9493,18 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setServerPort(PyObject *SWIGUNU 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); + 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 = 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -11601,48 +9537,32 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setServerAddress(PyObject *SWIG 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); + 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 = reinterpret_cast< char * >(buf2); + 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 = static_cast< unsigned short >(val3); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -11664,34 +9584,18 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_removeServerAddress(PyObject *S 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); + 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 = 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -11715,34 +9619,18 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setConnectTimeout(PyObject *SWI 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); + 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 = 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -11767,38 +9655,22 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setDefaultServices(PyObject *SW 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); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -11821,38 +9693,22 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setDefaultSubscriptionService(P 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); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -11874,38 +9730,22 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setDefaultTopicPrefix(PyObject 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); + 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 = 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()); + 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) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -11926,33 +9766,17 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setAllowMultipleCorrelatorsPerM 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); + 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 = 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()); + 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: @@ -11976,33 +9800,17 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setClientMode(PyObject *SWIGUNU 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); + 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 = 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()); + 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: @@ -12026,33 +9834,17 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setMaxPendingRequests(PyObject 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); + 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 = 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()); + 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: @@ -12076,33 +9868,17 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setAutoRestartOnDisconnection(P 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); + 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 = 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()); + 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: @@ -12127,38 +9903,22 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setAuthenticationOptions(PyObje 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); + 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 = 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()); + 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) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -12179,33 +9939,17 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setNumStartAttempts(PyObject *S 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); + 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 = 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()); + 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: @@ -12229,33 +9973,17 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setMaxEventQueueSize(PyObject * 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); + 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 = 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()); + 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: @@ -12280,34 +10008,18 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setSlowConsumerWarningHiWaterMa 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); + 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 = 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()); + arg2 = (float)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; } - - resultobj = SWIG_From_int(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -12331,34 +10043,18 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setSlowConsumerWarningLoWaterMa 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); + 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 = 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()); + arg2 = (float)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; } - - resultobj = SWIG_From_int(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -12382,34 +10078,18 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setDefaultKeepAliveInactivityTi 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); + 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 = 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()); + arg2 = (int)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_setDefaultKeepAliveInactivityTime(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; } - - resultobj = SWIG_From_int(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -12433,34 +10113,18 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setDefaultKeepAliveResponseTime 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); + 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 = 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()); + arg2 = (int)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; } - - resultobj = SWIG_From_int(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -12484,34 +10148,18 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setKeepAliveEnabled(PyObject *S 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); + 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 = 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()); + arg2 = (int)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_setKeepAliveEnabled(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; } - - resultobj = SWIG_From_int(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -12534,33 +10182,17 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setRecordSubscriptionDataReceiv 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); + 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 = 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()); + 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: @@ -12585,34 +10217,18 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setServiceCheckTimeout(PyObject 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); + 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 = 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()); + arg2 = (int)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_setServiceCheckTimeout(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; } - - resultobj = SWIG_From_int(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -12636,34 +10252,18 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setServiceDownloadTimeout(PyObj 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); + 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 = 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()); + arg2 = (int)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_SessionOptions_setServiceDownloadTimeout(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; } - - resultobj = SWIG_From_int(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -12686,33 +10286,17 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setTlsOptions(PyObject *SWIGUNU 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); + 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 = 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()); + 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: @@ -12737,34 +10321,53 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_setFlushPublishedEventsTimeout( 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); + 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 = 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()); + 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 * obj0 = 0 ; + PyObject * obj1 = 0 ; + int result; - resultobj = SWIG_From_int(static_cast< 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; @@ -12784,28 +10387,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_serverHost(PyObject *SWIGUNUSED 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()); + 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: @@ -12826,29 +10413,13 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_serverPort(PyObject *SWIGUNUSED 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()); + 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(static_cast< unsigned int >(result)); + resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result)); return resultobj; fail: return NULL; @@ -12868,29 +10439,13 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_numServerAddresses(PyObject *SW 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -12920,34 +10475,18 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_getServerAddress(PyObject *SWIG 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); + 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 = 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)); + 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)); @@ -12971,29 +10510,13 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_connectTimeout(PyObject *SWIGUN 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()); + 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(static_cast< unsigned int >(result)); + resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result)); return resultobj; fail: return NULL; @@ -13013,28 +10536,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultServices(PyObject *SWIGU 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()); + 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: @@ -13055,28 +10562,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultSubscriptionService(PyOb 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()); + 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: @@ -13097,28 +10588,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultTopicPrefix(PyObject *SW 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()); + 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: @@ -13139,29 +10614,13 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_allowMultipleCorrelatorsPerMsg( 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -13181,29 +10640,13 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_clientMode(PyObject *SWIGUNUSED 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -13223,29 +10666,13 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_maxPendingRequests(PyObject *SW 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -13265,29 +10692,13 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_autoRestartOnDisconnection(PyOb 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -13307,28 +10718,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_authenticationOptions(PyObject 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()); + 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: @@ -13349,29 +10744,13 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_numStartAttempts(PyObject *SWIG 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -13391,29 +10770,13 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_maxEventQueueSize(PyObject *SWI 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()); + 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(static_cast< size_t >(result)); + resultobj = SWIG_From_size_t((size_t)(result)); return resultobj; fail: return NULL; @@ -13433,29 +10796,13 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_slowConsumerWarningHiWaterMark( 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()); + 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(static_cast< float >(result)); + resultobj = SWIG_From_float((float)(result)); return resultobj; fail: return NULL; @@ -13475,29 +10822,13 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_slowConsumerWarningLoWaterMark( 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()); + 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(static_cast< float >(result)); + resultobj = SWIG_From_float((float)(result)); return resultobj; fail: return NULL; @@ -13517,29 +10848,13 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultKeepAliveInactivityTime( 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -13559,29 +10874,13 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_defaultKeepAliveResponseTimeout 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -13601,29 +10900,13 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_keepAliveEnabled(PyObject *SWIG 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -13643,29 +10926,13 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_recordSubscriptionDataReceiveTi 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -13685,29 +10952,13 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_serviceCheckTimeout(PyObject *S 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -13727,29 +10978,13 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_serviceDownloadTimeout(PyObject 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -13769,29 +11004,39 @@ SWIGINTERN PyObject *_wrap_blpapi_SessionOptions_flushPublishedEventsTimeout(PyO 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()); + 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 * obj0 = 0 ; + int result; - resultobj = SWIG_From_int(static_cast< 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; @@ -13810,28 +11055,12 @@ SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_destroy(PyObject *SWIGUNUSEDPARM(se 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()); + 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: @@ -13863,47 +11092,31 @@ SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_createFromFiles(PyObject *SWIGUNUSE 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); + 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 = reinterpret_cast< char * >(buf2); + 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 = 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()); + 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) delete[] buf1; - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + 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) delete[] buf1; - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return NULL; } @@ -13943,7 +11156,7 @@ SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_createFromBlobs(PyObject *SWIGUNUSE 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); + arg3 = (char *)(buf3); { res4 = PyObject_AsReadBuffer(obj2, &buf4, &size4); if (res4<0) { @@ -13953,32 +11166,16 @@ SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_createFromBlobs(PyObject *SWIGUNUSE 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()); + { + 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) delete[] buf3; + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return resultobj; fail: - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return NULL; } @@ -13999,33 +11196,17 @@ SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_setTlsHandshakeTimeoutMs(PyObject * 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); + 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 = 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()); + 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: @@ -14049,33 +11230,17 @@ SWIGINTERN PyObject *_wrap_blpapi_TlsOptions_setCrlFetchTimeoutMs(PyObject *SWIG 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); + 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 = 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()); + 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: @@ -14097,33 +11262,17 @@ SWIGINTERN PyObject *_wrap_blpapi_Name_create(PyObject *SWIGUNUSEDPARM(self), Py 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()); + 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) delete[] buf1; + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return resultobj; fail: - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return NULL; } @@ -14140,28 +11289,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Name_destroy(PyObject *SWIGUNUSEDPARM(self), P 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()); + 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: @@ -14187,38 +11320,22 @@ SWIGINTERN PyObject *_wrap_blpapi_Name_equalsStr(PyObject *SWIGUNUSEDPARM(self), 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); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -14236,28 +11353,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Name_string(PyObject *SWIGUNUSEDPARM(self), Py 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()); + 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: @@ -14278,29 +11379,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Name_length(PyObject *SWIGUNUSEDPARM(self), Py 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()); + 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(static_cast< size_t >(result)); + resultobj = SWIG_From_size_t((size_t)(result)); return resultobj; fail: return NULL; @@ -14321,33 +11406,17 @@ SWIGINTERN PyObject *_wrap_blpapi_Name_findName(PyObject *SWIGUNUSEDPARM(self), 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()); + 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) delete[] buf1; + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return resultobj; fail: - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return NULL; } @@ -14357,27 +11426,11 @@ SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_create(PyObject *SWIGUNUSEDPA 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()); + { + 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: @@ -14397,28 +11450,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_destroy(PyObject *SWIGUNUSEDP 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()); + 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: @@ -14448,43 +11485,27 @@ SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_addResolved(PyObject *SWIGUNU 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); + 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 = reinterpret_cast< char * >(buf2); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -14502,29 +11523,13 @@ SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_clear(PyObject *SWIGUNUSEDPAR 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -14548,34 +11553,18 @@ SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_append(PyObject *SWIGUNUSEDPA 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); + 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 = 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -14595,29 +11584,13 @@ SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_size(PyObject *SWIGUNUSEDPARM 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -14644,35 +11617,23 @@ SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_correlationIdAt(PyObject *SWI 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); + 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 = 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()); + 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()); } - - 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; @@ -14699,34 +11660,18 @@ SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_topicStringAt(PyObject *SWIGU 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); + 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 = 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)); + 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: @@ -14755,34 +11700,18 @@ SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_isResolvedAt(PyObject *SWIGUN 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); + 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 = 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)); + 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 { @@ -14795,9 +11724,153 @@ SWIGINTERN PyObject *_wrap_blpapi_SubscriptionList_isResolvedAt(PyObject *SWIGUN } +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; - blpapi_Datetime_tag *arg1 = (blpapi_Datetime_tag *) 0 ; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; blpapi_UChar_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; @@ -14809,14 +11882,14 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_parts_set(PyObject *SWIGUNUSEDPAR 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_parts_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } - arg1 = reinterpret_cast< blpapi_Datetime_tag * >(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_parts_set" "', argument " "2"" of type '" "blpapi_UChar_t""'"); } - arg2 = static_cast< blpapi_UChar_t >(val2); + arg2 = (blpapi_UChar_t)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; if (arg1) (arg1)->parts = arg2; @@ -14831,7 +11904,7 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_parts_set(PyObject *SWIGUNUSEDPAR SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_parts_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Datetime_tag *arg1 = (blpapi_Datetime_tag *) 0 ; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; @@ -14840,15 +11913,15 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_parts_get(PyObject *SWIGUNUSEDPAR 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_parts_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } - arg1 = reinterpret_cast< blpapi_Datetime_tag * >(argp1); + 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(static_cast< unsigned char >(result)); + resultobj = SWIG_From_unsigned_SS_char((unsigned char)(result)); return resultobj; fail: return NULL; @@ -14857,7 +11930,7 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_parts_get(PyObject *SWIGUNUSEDPAR SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_hours_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Datetime_tag *arg1 = (blpapi_Datetime_tag *) 0 ; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; blpapi_UChar_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; @@ -14869,14 +11942,14 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_hours_set(PyObject *SWIGUNUSEDPAR 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_hours_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } - arg1 = reinterpret_cast< blpapi_Datetime_tag * >(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 = static_cast< blpapi_UChar_t >(val2); + arg2 = (blpapi_UChar_t)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; if (arg1) (arg1)->hours = arg2; @@ -14891,7 +11964,7 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_hours_set(PyObject *SWIGUNUSEDPAR SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_hours_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Datetime_tag *arg1 = (blpapi_Datetime_tag *) 0 ; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; @@ -14900,15 +11973,15 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_hours_get(PyObject *SWIGUNUSEDPAR 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_hours_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } - arg1 = reinterpret_cast< blpapi_Datetime_tag * >(argp1); + 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(static_cast< unsigned char >(result)); + resultobj = SWIG_From_unsigned_SS_char((unsigned char)(result)); return resultobj; fail: return NULL; @@ -14917,7 +11990,7 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_hours_get(PyObject *SWIGUNUSEDPAR SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_minutes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Datetime_tag *arg1 = (blpapi_Datetime_tag *) 0 ; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; blpapi_UChar_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; @@ -14929,14 +12002,14 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_minutes_set(PyObject *SWIGUNUSEDP 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_minutes_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } - arg1 = reinterpret_cast< blpapi_Datetime_tag * >(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 = static_cast< blpapi_UChar_t >(val2); + arg2 = (blpapi_UChar_t)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; if (arg1) (arg1)->minutes = arg2; @@ -14951,7 +12024,7 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_minutes_set(PyObject *SWIGUNUSEDP SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_minutes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Datetime_tag *arg1 = (blpapi_Datetime_tag *) 0 ; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; @@ -14960,15 +12033,15 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_minutes_get(PyObject *SWIGUNUSEDP 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_minutes_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } - arg1 = reinterpret_cast< blpapi_Datetime_tag * >(argp1); + 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(static_cast< unsigned char >(result)); + resultobj = SWIG_From_unsigned_SS_char((unsigned char)(result)); return resultobj; fail: return NULL; @@ -14977,7 +12050,7 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_minutes_get(PyObject *SWIGUNUSEDP SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_seconds_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Datetime_tag *arg1 = (blpapi_Datetime_tag *) 0 ; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; blpapi_UChar_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; @@ -14989,14 +12062,14 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_seconds_set(PyObject *SWIGUNUSEDP 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_seconds_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } - arg1 = reinterpret_cast< blpapi_Datetime_tag * >(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 = static_cast< blpapi_UChar_t >(val2); + arg2 = (blpapi_UChar_t)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; if (arg1) (arg1)->seconds = arg2; @@ -15011,7 +12084,7 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_seconds_set(PyObject *SWIGUNUSEDP SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_seconds_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Datetime_tag *arg1 = (blpapi_Datetime_tag *) 0 ; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; @@ -15020,15 +12093,15 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_seconds_get(PyObject *SWIGUNUSEDP 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_seconds_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } - arg1 = reinterpret_cast< blpapi_Datetime_tag * >(argp1); + 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(static_cast< unsigned char >(result)); + resultobj = SWIG_From_unsigned_SS_char((unsigned char)(result)); return resultobj; fail: return NULL; @@ -15037,7 +12110,7 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_seconds_get(PyObject *SWIGUNUSEDP SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_milliSeconds_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Datetime_tag *arg1 = (blpapi_Datetime_tag *) 0 ; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; blpapi_UInt16_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; @@ -15049,14 +12122,14 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_milliSeconds_set(PyObject *SWIGUN 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_milliSeconds_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } - arg1 = reinterpret_cast< blpapi_Datetime_tag * >(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 = static_cast< blpapi_UInt16_t >(val2); + arg2 = (blpapi_UInt16_t)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; if (arg1) (arg1)->milliSeconds = arg2; @@ -15071,7 +12144,7 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_milliSeconds_set(PyObject *SWIGUN SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_milliSeconds_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Datetime_tag *arg1 = (blpapi_Datetime_tag *) 0 ; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; @@ -15080,15 +12153,15 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_milliSeconds_get(PyObject *SWIGUN 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_milliSeconds_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } - arg1 = reinterpret_cast< blpapi_Datetime_tag * >(argp1); + 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(static_cast< unsigned short >(result)); + resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); return resultobj; fail: return NULL; @@ -15097,7 +12170,7 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_milliSeconds_get(PyObject *SWIGUN SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_month_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Datetime_tag *arg1 = (blpapi_Datetime_tag *) 0 ; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; blpapi_UChar_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; @@ -15109,14 +12182,14 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_month_set(PyObject *SWIGUNUSEDPAR 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_month_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } - arg1 = reinterpret_cast< blpapi_Datetime_tag * >(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 = static_cast< blpapi_UChar_t >(val2); + arg2 = (blpapi_UChar_t)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; if (arg1) (arg1)->month = arg2; @@ -15131,7 +12204,7 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_month_set(PyObject *SWIGUNUSEDPAR SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_month_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Datetime_tag *arg1 = (blpapi_Datetime_tag *) 0 ; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; @@ -15140,15 +12213,15 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_month_get(PyObject *SWIGUNUSEDPAR 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_month_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } - arg1 = reinterpret_cast< blpapi_Datetime_tag * >(argp1); + 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(static_cast< unsigned char >(result)); + resultobj = SWIG_From_unsigned_SS_char((unsigned char)(result)); return resultobj; fail: return NULL; @@ -15157,7 +12230,7 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_month_get(PyObject *SWIGUNUSEDPAR SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_day_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Datetime_tag *arg1 = (blpapi_Datetime_tag *) 0 ; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; blpapi_UChar_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; @@ -15169,14 +12242,14 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_day_set(PyObject *SWIGUNUSEDPARM( 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_day_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } - arg1 = reinterpret_cast< blpapi_Datetime_tag * >(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 = static_cast< blpapi_UChar_t >(val2); + arg2 = (blpapi_UChar_t)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; if (arg1) (arg1)->day = arg2; @@ -15191,7 +12264,7 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_day_set(PyObject *SWIGUNUSEDPARM( SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_day_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Datetime_tag *arg1 = (blpapi_Datetime_tag *) 0 ; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; @@ -15200,15 +12273,15 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_day_get(PyObject *SWIGUNUSEDPARM( 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_day_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } - arg1 = reinterpret_cast< blpapi_Datetime_tag * >(argp1); + 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(static_cast< unsigned char >(result)); + resultobj = SWIG_From_unsigned_SS_char((unsigned char)(result)); return resultobj; fail: return NULL; @@ -15217,7 +12290,7 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_day_get(PyObject *SWIGUNUSEDPARM( SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_year_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Datetime_tag *arg1 = (blpapi_Datetime_tag *) 0 ; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; blpapi_UInt16_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; @@ -15229,14 +12302,14 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_year_set(PyObject *SWIGUNUSEDPARM 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_year_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } - arg1 = reinterpret_cast< blpapi_Datetime_tag * >(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 = static_cast< blpapi_UInt16_t >(val2); + arg2 = (blpapi_UInt16_t)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; if (arg1) (arg1)->year = arg2; @@ -15251,7 +12324,7 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_year_set(PyObject *SWIGUNUSEDPARM SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_year_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Datetime_tag *arg1 = (blpapi_Datetime_tag *) 0 ; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; @@ -15260,15 +12333,15 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_year_get(PyObject *SWIGUNUSEDPARM 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_year_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } - arg1 = reinterpret_cast< blpapi_Datetime_tag * >(argp1); + 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(static_cast< unsigned short >(result)); + resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); return resultobj; fail: return NULL; @@ -15277,7 +12350,7 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_year_get(PyObject *SWIGUNUSEDPARM SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_offset_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Datetime_tag *arg1 = (blpapi_Datetime_tag *) 0 ; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; blpapi_Int16_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; @@ -15289,14 +12362,14 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_offset_set(PyObject *SWIGUNUSEDPA 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_offset_set" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } - arg1 = reinterpret_cast< blpapi_Datetime_tag * >(argp1); + 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 = static_cast< blpapi_Int16_t >(val2); + arg2 = (blpapi_Int16_t)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; if (arg1) (arg1)->offset = arg2; @@ -15311,7 +12384,7 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_offset_set(PyObject *SWIGUNUSEDPA SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_offset_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Datetime_tag *arg1 = (blpapi_Datetime_tag *) 0 ; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; @@ -15320,15 +12393,15 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_offset_get(PyObject *SWIGUNUSEDPA 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_Datetime_tag_offset_get" "', argument " "1"" of type '" "struct blpapi_Datetime_tag *""'"); } - arg1 = reinterpret_cast< blpapi_Datetime_tag * >(argp1); + 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(static_cast< short >(result)); + resultobj = SWIG_From_short((short)(result)); return resultobj; fail: return NULL; @@ -15337,30 +12410,14 @@ SWIGINTERN PyObject *_wrap_blpapi_Datetime_tag_offset_get(PyObject *SWIGUNUSEDPA SWIGINTERN PyObject *_wrap_new_blpapi_Datetime_tag(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Datetime_tag *result = 0 ; + struct 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()); + { + 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: @@ -15370,7 +12427,7 @@ SWIGINTERN PyObject *_wrap_new_blpapi_Datetime_tag(PyObject *SWIGUNUSEDPARM(self SWIGINTERN PyObject *_wrap_delete_blpapi_Datetime_tag(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_Datetime_tag *arg1 = (blpapi_Datetime_tag *) 0 ; + struct blpapi_Datetime_tag *arg1 = (struct blpapi_Datetime_tag *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; @@ -15378,30 +12435,14 @@ SWIGINTERN PyObject *_wrap_delete_blpapi_Datetime_tag(PyObject *SWIGUNUSEDPARM(s 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_blpapi_Datetime_tag" "', argument " "1"" of type '" "struct 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()); + 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: @@ -15418,7 +12459,7 @@ SWIGINTERN PyObject *blpapi_Datetime_tag_swigregister(PyObject *SWIGUNUSEDPARM(s SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_tag_datetime_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_HighPrecisionDatetime_tag *arg1 = (blpapi_HighPrecisionDatetime_tag *) 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 ; @@ -15430,14 +12471,14 @@ SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_tag_datetime_set(PyObjec 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_tag_datetime_set" "', argument " "1"" of type '" "struct blpapi_HighPrecisionDatetime_tag *""'"); } - arg1 = reinterpret_cast< blpapi_HighPrecisionDatetime_tag * >(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 = reinterpret_cast< blpapi_Datetime_t * >(argp2); + arg2 = (blpapi_Datetime_t *)(argp2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; if (arg1) (arg1)->datetime = *arg2; @@ -15452,7 +12493,7 @@ SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_tag_datetime_set(PyObjec SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_tag_datetime_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_HighPrecisionDatetime_tag *arg1 = (blpapi_HighPrecisionDatetime_tag *) 0 ; + struct blpapi_HighPrecisionDatetime_tag *arg1 = (struct blpapi_HighPrecisionDatetime_tag *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; @@ -15461,9 +12502,9 @@ SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_tag_datetime_get(PyObjec 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_tag_datetime_get" "', argument " "1"" of type '" "struct blpapi_HighPrecisionDatetime_tag *""'"); } - arg1 = reinterpret_cast< blpapi_HighPrecisionDatetime_tag * >(argp1); + arg1 = (struct blpapi_HighPrecisionDatetime_tag *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (blpapi_Datetime_t *)& ((arg1)->datetime); @@ -15478,7 +12519,7 @@ SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_tag_datetime_get(PyObjec SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_tag_picoseconds_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_HighPrecisionDatetime_tag *arg1 = (blpapi_HighPrecisionDatetime_tag *) 0 ; + struct blpapi_HighPrecisionDatetime_tag *arg1 = (struct blpapi_HighPrecisionDatetime_tag *) 0 ; blpapi_UInt32_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; @@ -15490,14 +12531,14 @@ SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_tag_picoseconds_set(PyOb 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_tag_picoseconds_set" "', argument " "1"" of type '" "struct blpapi_HighPrecisionDatetime_tag *""'"); } - arg1 = reinterpret_cast< blpapi_HighPrecisionDatetime_tag * >(argp1); + 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 = static_cast< blpapi_UInt32_t >(val2); + arg2 = (blpapi_UInt32_t)(val2); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; if (arg1) (arg1)->picoseconds = arg2; @@ -15512,7 +12553,7 @@ SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_tag_picoseconds_set(PyOb SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_tag_picoseconds_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_HighPrecisionDatetime_tag *arg1 = (blpapi_HighPrecisionDatetime_tag *) 0 ; + struct blpapi_HighPrecisionDatetime_tag *arg1 = (struct blpapi_HighPrecisionDatetime_tag *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; @@ -15521,15 +12562,15 @@ SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_tag_picoseconds_get(PyOb 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blpapi_HighPrecisionDatetime_tag_picoseconds_get" "', argument " "1"" of type '" "struct blpapi_HighPrecisionDatetime_tag *""'"); } - arg1 = reinterpret_cast< blpapi_HighPrecisionDatetime_tag * >(argp1); + 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(static_cast< unsigned int >(result)); + resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result)); return resultobj; fail: return NULL; @@ -15538,30 +12579,14 @@ SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_tag_picoseconds_get(PyOb SWIGINTERN PyObject *_wrap_new_blpapi_HighPrecisionDatetime_tag(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_HighPrecisionDatetime_tag *result = 0 ; + struct 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()); + { + 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: @@ -15571,7 +12596,7 @@ SWIGINTERN PyObject *_wrap_new_blpapi_HighPrecisionDatetime_tag(PyObject *SWIGUN SWIGINTERN PyObject *_wrap_delete_blpapi_HighPrecisionDatetime_tag(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - blpapi_HighPrecisionDatetime_tag *arg1 = (blpapi_HighPrecisionDatetime_tag *) 0 ; + struct blpapi_HighPrecisionDatetime_tag *arg1 = (struct blpapi_HighPrecisionDatetime_tag *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; @@ -15579,30 +12604,14 @@ SWIGINTERN PyObject *_wrap_delete_blpapi_HighPrecisionDatetime_tag(PyObject *SWI 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_blpapi_HighPrecisionDatetime_tag" "', argument " "1"" of type '" "struct 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()); + 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: @@ -15634,34 +12643,18 @@ SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_compare(PyObject *SWIGUN 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); + 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 = 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -15696,18 +12689,16 @@ SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_print(PyObject *SWIGUNUS 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); + arg1 = (blpapi_HighPrecisionDatetime_t *)(argp1); { - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_blpapi_StreamWriter_t, 0 | 0); + 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 { - blpapi_StreamWriter_t * temp = reinterpret_cast< blpapi_StreamWriter_t * >(argp2); - arg2 = *temp; - if (SWIG_IsNewObj(res2)) delete temp; + arg2 = *((blpapi_StreamWriter_t *)(argp2)); } } res3 = SWIG_ConvertPtr(obj2,SWIG_as_voidptrptr(&arg3), 0, 0); @@ -15718,34 +12709,18 @@ SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_print(PyObject *SWIGUNUS 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); + 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 = 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -15759,53 +12734,36 @@ SWIGINTERN PyObject *_wrap_blpapi_HighPrecisionDatetime_fromTimePoint(PyObject * short arg3 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; + blpapi_TimePoint_t temp2 ; 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; + 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 = 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); + 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 = 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()); + 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)); } - - resultobj = SWIG_From_int(static_cast< int >(result)); return resultobj; fail: return NULL; @@ -15825,28 +12783,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Constant_name(PyObject *SWIGUNUSEDPARM(self), 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()); + 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: @@ -15867,28 +12809,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Constant_description(PyObject *SWIGUNUSEDPARM( 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()); + 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: @@ -15909,29 +12835,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Constant_status(PyObject *SWIGUNUSEDPARM(self) 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -15951,29 +12861,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Constant_datatype(PyObject *SWIGUNUSEDPARM(sel 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -15997,29 +12891,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Constant_getValueAsInt64(PyObject *SWIGUNUSEDP 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)); + 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 { @@ -16049,29 +12927,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Constant_getValueAsFloat64(PyObject *SWIGUNUSE 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)); + 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 { @@ -16090,44 +12952,30 @@ SWIGINTERN PyObject *_wrap_blpapi_Constant_getValueAsDatetime(PyObject *SWIGUNUS blpapi_Datetime_t *arg2 = (blpapi_Datetime_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; + blpapi_Datetime_t temp2 ; PyObject * obj0 = 0 ; int result; - arg2 = new blpapi_Datetime_t; + 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 = 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()); + 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)); } - - 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; } @@ -16148,29 +12996,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Constant_getValueAsString(PyObject *SWIGUNUSED 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)); + 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: @@ -16191,28 +13023,12 @@ SWIGINTERN PyObject *_wrap_blpapi_ConstantList_name(PyObject *SWIGUNUSEDPARM(sel 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()); + 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: @@ -16233,28 +13049,12 @@ SWIGINTERN PyObject *_wrap_blpapi_ConstantList_description(PyObject *SWIGUNUSEDP 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()); + 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: @@ -16275,29 +13075,13 @@ SWIGINTERN PyObject *_wrap_blpapi_ConstantList_numConstants(PyObject *SWIGUNUSED 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -16317,29 +13101,13 @@ SWIGINTERN PyObject *_wrap_blpapi_ConstantList_datatype(PyObject *SWIGUNUSEDPARM 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)); + 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; @@ -16359,29 +13127,13 @@ SWIGINTERN PyObject *_wrap_blpapi_ConstantList_status(PyObject *SWIGUNUSEDPARM(s 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -16410,43 +13162,27 @@ SWIGINTERN PyObject *_wrap_blpapi_ConstantList_getConstant(PyObject *SWIGUNUSEDP 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); + 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 = reinterpret_cast< char * >(buf2); + 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 = 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()); + 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) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -16468,33 +13204,17 @@ SWIGINTERN PyObject *_wrap_blpapi_ConstantList_getConstantAt(PyObject *SWIGUNUSE 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); + 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 = 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()); + 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: @@ -16515,28 +13235,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_name(PyObject *SWIGUNU 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()); + 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: @@ -16557,28 +13261,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_description(PyObject * 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()); + 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: @@ -16599,29 +13287,13 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_status(PyObject *SWIGU 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -16641,28 +13313,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_type(PyObject *SWIGUNU 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()); + 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: @@ -16683,29 +13339,13 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_numAlternateNames(PyOb 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()); + 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(static_cast< size_t >(result)); + resultobj = SWIG_From_size_t((size_t)(result)); return resultobj; fail: return NULL; @@ -16729,33 +13369,17 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_getAlternateName(PyObj 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); + 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 = 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()); + 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: @@ -16776,29 +13400,13 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_minValues(PyObject *SW 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()); + 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(static_cast< size_t >(result)); + resultobj = SWIG_From_size_t((size_t)(result)); return resultobj; fail: return NULL; @@ -16818,29 +13426,13 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaElementDefinition_maxValues(PyObject *SW 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()); + 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(static_cast< size_t >(result)); + resultobj = SWIG_From_size_t((size_t)(result)); return resultobj; fail: return NULL; @@ -16860,28 +13452,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_name(PyObject *SWIGUNUSED 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()); + 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: @@ -16902,28 +13478,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_description(PyObject *SWI 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()); + 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: @@ -16944,29 +13504,13 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_status(PyObject *SWIGUNUS 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -16986,29 +13530,13 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_datatype(PyObject *SWIGUN 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -17028,29 +13556,13 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_isComplexType(PyObject *S 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -17070,29 +13582,13 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_isSimpleType(PyObject *SW 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -17112,29 +13608,13 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_isEnumerationType(PyObjec 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -17154,29 +13634,13 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_numElementDefinitions(PyO 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()); + 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(static_cast< size_t >(result)); + resultobj = SWIG_From_size_t((size_t)(result)); return resultobj; fail: return NULL; @@ -17205,43 +13669,27 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_getElementDefinition(PyOb 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); + 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 = reinterpret_cast< char * >(buf2); + 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 = 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()); + 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) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -17263,33 +13711,17 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_getElementDefinitionAt(Py 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); + 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 = 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()); + 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: @@ -17310,28 +13742,12 @@ SWIGINTERN PyObject *_wrap_blpapi_SchemaTypeDefinition_enumeration(PyObject *SWI 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()); + 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: @@ -17351,28 +13767,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Request_destroy(PyObject *SWIGUNUSEDPARM(self) 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()); + 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: @@ -17393,28 +13793,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Request_elements(PyObject *SWIGUNUSEDPARM(self 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()); + 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: @@ -17438,33 +13822,17 @@ SWIGINTERN PyObject *_wrap_blpapi_Request_setPreferredRoute(PyObject *SWIGUNUSED 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); + 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 = 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()); + 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: @@ -17485,29 +13853,13 @@ SWIGINTERN PyObject *_wrap_blpapi_RequestTemplate_release(PyObject *SWIGUNUSEDPA 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -17527,28 +13879,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Operation_name(PyObject *SWIGUNUSEDPARM(self), 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()); + 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: @@ -17569,28 +13905,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Operation_description(PyObject *SWIGUNUSEDPARM 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()); + 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: @@ -17614,29 +13934,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Operation_requestDefinition(PyObject *SWIGUNUS 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)); + 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: @@ -17657,29 +13961,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Operation_numResponseDefinitions(PyObject *SWI 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -17706,34 +13994,18 @@ SWIGINTERN PyObject *_wrap_blpapi_Operation_responseDefinition(PyObject *SWIGUNU 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); + 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 = 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)); + 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: @@ -17754,28 +14026,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Service_name(PyObject *SWIGUNUSEDPARM(self), P 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()); + 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: @@ -17796,28 +14052,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Service_description(PyObject *SWIGUNUSEDPARM(s 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()); + 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: @@ -17838,29 +14078,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Service_numOperations(PyObject *SWIGUNUSEDPARM 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -17880,29 +14104,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Service_numEventDefinitions(PyObject *SWIGUNUS 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -17922,29 +14130,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Service_addRef(PyObject *SWIGUNUSEDPARM(self), 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -17963,28 +14155,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Service_release(PyObject *SWIGUNUSEDPARM(self) 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()); + 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: @@ -18005,28 +14181,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Service_authorizationServiceName(PyObject *SWI 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()); + 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: @@ -18059,44 +14219,28 @@ SWIGINTERN PyObject *_wrap_blpapi_Service_getOperation(PyObject *SWIGUNUSEDPARM( 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); + 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 = reinterpret_cast< char * >(buf3); + 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 = 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)); + 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) delete[] buf3; + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return resultobj; fail: - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return NULL; } @@ -18121,34 +14265,18 @@ SWIGINTERN PyObject *_wrap_blpapi_Service_getOperationAt(PyObject *SWIGUNUSEDPAR 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); + 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 = 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)); + 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: @@ -18181,44 +14309,28 @@ SWIGINTERN PyObject *_wrap_blpapi_Service_getEventDefinition(PyObject *SWIGUNUSE 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); + 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 = reinterpret_cast< char * >(buf3); + 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 = 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)); + 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) delete[] buf3; + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return resultobj; fail: - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return NULL; } @@ -18243,34 +14355,18 @@ SWIGINTERN PyObject *_wrap_blpapi_Service_getEventDefinitionAt(PyObject *SWIGUNU 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); + 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 = 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)); + 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: @@ -18299,39 +14395,23 @@ SWIGINTERN PyObject *_wrap_blpapi_Service_createRequest(PyObject *SWIGUNUSEDPARM 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); + 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 = 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)); + 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) delete[] buf3; + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return resultobj; fail: - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return NULL; } @@ -18357,39 +14437,23 @@ SWIGINTERN PyObject *_wrap_blpapi_Service_createAuthorizationRequest(PyObject *S 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); + 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 = 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)); + 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) delete[] buf3; + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return resultobj; fail: - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return NULL; } @@ -18410,29 +14474,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Service_createPublishEvent(PyObject *SWIGUNUSE 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)); + 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: @@ -18456,29 +14504,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Service_createAdminEvent(PyObject *SWIGUNUSEDP 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)); + 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: @@ -18506,34 +14538,18 @@ SWIGINTERN PyObject *_wrap_blpapi_Service_createResponseEvent(PyObject *SWIGUNUS 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); + 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 = 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)); + 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: @@ -18554,28 +14570,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Message_messageType(PyObject *SWIGUNUSEDPARM(s 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()); + 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: @@ -18596,28 +14596,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Message_topicName(PyObject *SWIGUNUSEDPARM(sel 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()); + 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: @@ -18638,28 +14622,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Message_service(PyObject *SWIGUNUSEDPARM(self) 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()); + 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: @@ -18680,29 +14648,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Message_numCorrelationIds(PyObject *SWIGUNUSED 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -18726,35 +14678,19 @@ SWIGINTERN PyObject *_wrap_blpapi_Message_correlationId(PyObject *SWIGUNUSEDPARM 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); + 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 = 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()); + 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)); + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(CorrelationId_t_clone(&result), SWIGTYPE_p_blpapi_CorrelationId_t_, SWIG_POINTER_OWN)); } return resultobj; fail: @@ -18775,28 +14711,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Message_elements(PyObject *SWIGUNUSEDPARM(self 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()); + 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: @@ -18817,29 +14737,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Message_fragmentType(PyObject *SWIGUNUSEDPARM( 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -18859,29 +14763,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Message_recapType(PyObject *SWIGUNUSEDPARM(sel 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -18916,18 +14804,16 @@ SWIGINTERN PyObject *_wrap_blpapi_Message_print(PyObject *SWIGUNUSEDPARM(self), 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); + arg1 = (blpapi_Message_t *)(argp1); { - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_blpapi_StreamWriter_t, 0 | 0); + 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 { - blpapi_StreamWriter_t * temp = reinterpret_cast< blpapi_StreamWriter_t * >(argp2); - arg2 = *temp; - if (SWIG_IsNewObj(res2)) delete temp; + arg2 = *((blpapi_StreamWriter_t *)(argp2)); } } res3 = SWIG_ConvertPtr(obj2,SWIG_as_voidptrptr(&arg3), 0, 0); @@ -18938,34 +14824,18 @@ SWIGINTERN PyObject *_wrap_blpapi_Message_print(PyObject *SWIGUNUSEDPARM(self), 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); + 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 = 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -18985,29 +14855,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Message_addRef(PyObject *SWIGUNUSEDPARM(self), 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -19027,29 +14881,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Message_release(PyObject *SWIGUNUSEDPARM(self) 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -19062,45 +14900,28 @@ SWIGINTERN PyObject *_wrap_blpapi_Message_timeReceived(PyObject *SWIGUNUSEDPARM( blpapi_TimePoint_t *arg2 = (blpapi_TimePoint_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; + blpapi_TimePoint_t temp2 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:blpapi_Message_timeReceived",&obj0,&obj1)) SWIG_fail; + 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 = 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 *""'"); + 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; } - 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((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_int(static_cast< int >(result)); return resultobj; fail: return NULL; @@ -19120,29 +14941,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Event_eventType(PyObject *SWIGUNUSEDPARM(self) 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -19162,29 +14967,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Event_release(PyObject *SWIGUNUSEDPARM(self), 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -19196,27 +14985,11 @@ SWIGINTERN PyObject *_wrap_blpapi_EventQueue_create(PyObject *SWIGUNUSEDPARM(sel 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()); + { + 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: @@ -19237,29 +15010,13 @@ SWIGINTERN PyObject *_wrap_blpapi_EventQueue_destroy(PyObject *SWIGUNUSEDPARM(se 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -19283,33 +15040,17 @@ SWIGINTERN PyObject *_wrap_blpapi_EventQueue_nextEvent(PyObject *SWIGUNUSEDPARM( 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); + 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 = 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()); + 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: @@ -19330,29 +15071,13 @@ SWIGINTERN PyObject *_wrap_blpapi_EventQueue_purge(PyObject *SWIGUNUSEDPARM(self 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -19375,29 +15100,13 @@ SWIGINTERN PyObject *_wrap_blpapi_EventQueue_tryNextEvent(PyObject *SWIGUNUSEDPA 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)); + 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: @@ -19418,28 +15127,12 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageIterator_create(PyObject *SWIGUNUSEDPAR 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()); + 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: @@ -19459,28 +15152,12 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageIterator_destroy(PyObject *SWIGUNUSEDPA 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()); + 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: @@ -19504,29 +15181,13 @@ SWIGINTERN PyObject *_wrap_blpapi_MessageIterator_next(PyObject *SWIGUNUSEDPARM( 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)); + 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: @@ -19546,28 +15207,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Identity_release(PyObject *SWIGUNUSEDPARM(self 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()); + 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: @@ -19588,29 +15233,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Identity_addRef(PyObject *SWIGUNUSEDPARM(self) 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -19654,59 +15283,43 @@ SWIGINTERN PyObject *_wrap_blpapi_Identity_hasEntitlements(PyObject *SWIGUNUSEDP 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); + 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 = reinterpret_cast< blpapi_Service_t * >(argp2); + 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 = reinterpret_cast< blpapi_Element_t * >(argp3); + 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 = reinterpret_cast< int * >(argp4); + 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 = static_cast< size_t >(val5); + 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 = reinterpret_cast< int * >(argp6); + 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 = 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -19730,34 +15343,18 @@ SWIGINTERN PyObject *_wrap_blpapi_Identity_isAuthorized(PyObject *SWIGUNUSEDPARM 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); + 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 = 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -19781,29 +15378,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Identity_getSeatType(PyObject *SWIGUNUSEDPARM( 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)); + 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 { @@ -19816,6 +15397,31 @@ SWIGINTERN PyObject *_wrap_blpapi_Identity_getSeatType(PyObject *SWIGUNUSEDPARM( } +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 ; @@ -19846,53 +15452,37 @@ SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_cancel(PyObject *SWIGUNUSEDPAR 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); + 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 = reinterpret_cast< blpapi_CorrelationId_t * >(argp2); + 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 = static_cast< size_t >(val3); + 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 = reinterpret_cast< char * >(buf4); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc4 == SWIG_NEWOBJ) delete[] buf4; + resultobj = SWIG_From_int((int)(result)); + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); return resultobj; fail: - if (alloc4 == SWIG_NEWOBJ) delete[] buf4; + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); return NULL; } @@ -19935,63 +15525,47 @@ SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_sendAuthorizationRequest(PyObj 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); + 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 = reinterpret_cast< blpapi_Request_t * >(argp2); + 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 = reinterpret_cast< blpapi_Identity_t * >(argp3); + 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 = reinterpret_cast< blpapi_CorrelationId_t * >(argp4); + 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 = reinterpret_cast< blpapi_EventQueue_t * >(argp5); + 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 = reinterpret_cast< char * >(buf6); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc6 == SWIG_NEWOBJ) delete[] buf6; + resultobj = SWIG_From_int((int)(result)); + if (alloc6 == SWIG_NEWOBJ) free((char*)buf6); return resultobj; fail: - if (alloc6 == SWIG_NEWOBJ) delete[] buf6; + if (alloc6 == SWIG_NEWOBJ) free((char*)buf6); return NULL; } @@ -20014,38 +15588,22 @@ SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_openService(PyObject *SWIGUNUS 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); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -20072,43 +15630,27 @@ SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_openServiceAsync(PyObject *SWI 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); + 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 = reinterpret_cast< char * >(buf2); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -20134,39 +15676,23 @@ SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_generateToken(PyObject *SWIGUN 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); + 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 = reinterpret_cast< blpapi_CorrelationId_t * >(argp2); + 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 = 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -20204,55 +15730,39 @@ SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_generateManualToken(PyObject * 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); + 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 = reinterpret_cast< blpapi_CorrelationId_t * >(argp2); + 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 = reinterpret_cast< char * >(buf3); + 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 = reinterpret_cast< char * >(buf4); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; - if (alloc4 == SWIG_NEWOBJ) delete[] buf4; + 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) delete[] buf3; - if (alloc4 == SWIG_NEWOBJ) delete[] buf4; + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); return NULL; } @@ -20278,39 +15788,23 @@ SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_getService(PyObject *SWIGUNUSE 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); + 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 = 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)); + 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) delete[] buf3; + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return resultobj; fail: - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return NULL; } @@ -20328,28 +15822,12 @@ SWIGINTERN PyObject *_wrap_blpapi_AbstractSession_createIdentity(PyObject *SWIGU 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()); + 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: @@ -20370,29 +15848,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_start(PyObject *SWIGUNUSEDPARM(self), 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -20412,29 +15874,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_startAsync(PyObject *SWIGUNUSEDPARM(se 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -20454,29 +15900,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_stop(PyObject *SWIGUNUSEDPARM(self), P 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -20496,29 +15926,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_stopAsync(PyObject *SWIGUNUSEDPARM(sel 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -20545,34 +15959,18 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_nextEvent(PyObject *SWIGUNUSEDPARM(sel 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); + 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 = 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)); + 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: @@ -20596,29 +15994,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_tryNextEvent(PyObject *SWIGUNUSEDPARM( 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)); + 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: @@ -20656,53 +16038,37 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_subscribe(PyObject *SWIGUNUSEDPARM(sel 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); + 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 = reinterpret_cast< blpapi_SubscriptionList_t * >(argp2); + 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 = reinterpret_cast< blpapi_Identity_t * >(argp3); + 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 = reinterpret_cast< char * >(buf4); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc4 == SWIG_NEWOBJ) delete[] buf4; + resultobj = SWIG_From_int((int)(result)); + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); return resultobj; fail: - if (alloc4 == SWIG_NEWOBJ) delete[] buf4; + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); return NULL; } @@ -20733,48 +16099,32 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_resubscribe(PyObject *SWIGUNUSEDPARM(s 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); + 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 = reinterpret_cast< blpapi_SubscriptionList_t * >(argp2); + 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 = reinterpret_cast< char * >(buf3); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + resultobj = SWIG_From_int((int)(result)); + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return resultobj; fail: - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return NULL; } @@ -20809,53 +16159,37 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_resubscribeWithId(PyObject *SWIGUNUSED 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); + 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 = reinterpret_cast< blpapi_SubscriptionList_t * >(argp2); + 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 = static_cast< int >(val3); + 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 = reinterpret_cast< char * >(buf4); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc4 == SWIG_NEWOBJ) delete[] buf4; + resultobj = SWIG_From_int((int)(result)); + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); return resultobj; fail: - if (alloc4 == SWIG_NEWOBJ) delete[] buf4; + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); return NULL; } @@ -20886,48 +16220,32 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_unsubscribe(PyObject *SWIGUNUSEDPARM(s 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); + 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 = reinterpret_cast< blpapi_SubscriptionList_t * >(argp2); + 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 = reinterpret_cast< char * >(buf3); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + resultobj = SWIG_From_int((int)(result)); + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return resultobj; fail: - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return NULL; } @@ -20957,44 +16275,28 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_setStatusCorrelationId(PyObject *SWIGU 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); + 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 = reinterpret_cast< blpapi_Service_t * >(argp2); + 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 = reinterpret_cast< blpapi_Identity_t * >(argp3); + 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 = 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -21039,63 +16341,47 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_sendRequest(PyObject *SWIGUNUSEDPARM(s 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); + 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 = reinterpret_cast< blpapi_Request_t * >(argp2); + 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 = reinterpret_cast< blpapi_CorrelationId_t * >(argp3); + 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 = reinterpret_cast< blpapi_Identity_t * >(argp4); + 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 = reinterpret_cast< blpapi_EventQueue_t * >(argp5); + 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 = reinterpret_cast< char * >(buf6); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc6 == SWIG_NEWOBJ) delete[] buf6; + resultobj = SWIG_From_int((int)(result)); + if (alloc6 == SWIG_NEWOBJ) free((char*)buf6); return resultobj; fail: - if (alloc6 == SWIG_NEWOBJ) delete[] buf6; + if (alloc6 == SWIG_NEWOBJ) free((char*)buf6); return NULL; } @@ -21121,39 +16407,23 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_sendRequestTemplate(PyObject *SWIGUNUS 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); + 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 = reinterpret_cast< blpapi_RequestTemplate_t * >(argp2); + 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 = 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -21189,49 +16459,33 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_createSnapshotRequestTemplate(PyObject 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); + 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 = reinterpret_cast< char * >(buf3); + 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 = reinterpret_cast< blpapi_Identity_t * >(argp4); + 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 = 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)); + 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) delete[] buf3; + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return resultobj; fail: - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return NULL; } @@ -21249,28 +16503,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Session_getAbstractSession(PyObject *SWIGUNUSE 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()); + 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: @@ -21295,33 +16533,17 @@ SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_extractAttributeFromResolutionS 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); + 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 = 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()); + 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: @@ -21342,28 +16564,12 @@ SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_create(PyObject *SWIGUNUSEDPARM 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()); + 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: @@ -21383,28 +16589,12 @@ SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_destroy(PyObject *SWIGUNUSEDPAR 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()); + 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: @@ -21434,43 +16624,27 @@ SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_add(PyObject *SWIGUNUSEDPARM(se 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); + 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 = reinterpret_cast< char * >(buf2); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -21496,39 +16670,23 @@ SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_addFromMessage(PyObject *SWIGUN 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); + 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 = reinterpret_cast< blpapi_Message_t * >(argp2); + 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 = 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -21552,34 +16710,18 @@ SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_addAttribute(PyObject *SWIGUNUS 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); + 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 = 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -21606,35 +16748,23 @@ SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_correlationIdAt(PyObject *SWIGU 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); + 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 = 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()); + 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()); } - - 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; @@ -21661,34 +16791,18 @@ SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_topicString(PyObject *SWIGUNUSE 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); + 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 = 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)); + 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: @@ -21716,34 +16830,18 @@ SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_topicStringAt(PyObject *SWIGUNU 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); + 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 = 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)); + 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: @@ -21772,34 +16870,18 @@ SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_status(PyObject *SWIGUNUSEDPARM 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); + 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 = 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)); + 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 { @@ -21833,34 +16915,18 @@ SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_statusAt(PyObject *SWIGUNUSEDPA 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); + 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 = 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)); + 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 { @@ -21897,39 +16963,23 @@ SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_attribute(PyObject *SWIGUNUSEDP 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); + 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 = reinterpret_cast< blpapi_Name_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 = 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)); + 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: @@ -21961,39 +17011,23 @@ SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_attributeAt(PyObject *SWIGUNUSE 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); + 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 = reinterpret_cast< blpapi_Name_t * >(argp3); + 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 = 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)); + 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: @@ -22021,34 +17055,18 @@ SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_message(PyObject *SWIGUNUSEDPAR 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); + 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 = 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)); + 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: @@ -22076,34 +17094,18 @@ SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_messageAt(PyObject *SWIGUNUSEDP 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); + 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 = 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)); + 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: @@ -22124,29 +17126,13 @@ SWIGINTERN PyObject *_wrap_blpapi_ResolutionList_size(PyObject *SWIGUNUSEDPARM(s 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -22166,28 +17152,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Topic_create(PyObject *SWIGUNUSEDPARM(self), P 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()); + 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: @@ -22207,28 +17177,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Topic_destroy(PyObject *SWIGUNUSEDPARM(self), 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()); + 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: @@ -22253,34 +17207,18 @@ SWIGINTERN PyObject *_wrap_blpapi_Topic_compare(PyObject *SWIGUNUSEDPARM(self), 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); + 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 = 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -22300,28 +17238,12 @@ SWIGINTERN PyObject *_wrap_blpapi_Topic_service(PyObject *SWIGUNUSEDPARM(self), 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()); + 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: @@ -22342,29 +17264,13 @@ SWIGINTERN PyObject *_wrap_blpapi_Topic_isActive(PyObject *SWIGUNUSEDPARM(self), 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -22384,28 +17290,12 @@ SWIGINTERN PyObject *_wrap_blpapi_TopicList_create(PyObject *SWIGUNUSEDPARM(self 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()); + 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: @@ -22425,28 +17315,12 @@ SWIGINTERN PyObject *_wrap_blpapi_TopicList_destroy(PyObject *SWIGUNUSEDPARM(sel 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()); + 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: @@ -22476,43 +17350,27 @@ SWIGINTERN PyObject *_wrap_blpapi_TopicList_add(PyObject *SWIGUNUSEDPARM(self), 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); + 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 = reinterpret_cast< char * >(buf2); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -22538,39 +17396,23 @@ SWIGINTERN PyObject *_wrap_blpapi_TopicList_addFromMessage(PyObject *SWIGUNUSEDP 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); + 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 = reinterpret_cast< blpapi_Message_t * >(argp2); + 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 = 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -22597,35 +17439,23 @@ SWIGINTERN PyObject *_wrap_blpapi_TopicList_correlationIdAt(PyObject *SWIGUNUSED 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); + 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 = 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()); + 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()); } - - 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; @@ -22652,34 +17482,18 @@ SWIGINTERN PyObject *_wrap_blpapi_TopicList_topicString(PyObject *SWIGUNUSEDPARM 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); + 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 = 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)); + 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: @@ -22707,34 +17521,18 @@ SWIGINTERN PyObject *_wrap_blpapi_TopicList_topicStringAt(PyObject *SWIGUNUSEDPA 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); + 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 = 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)); + 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: @@ -22763,34 +17561,18 @@ SWIGINTERN PyObject *_wrap_blpapi_TopicList_status(PyObject *SWIGUNUSEDPARM(self 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); + 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 = 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)); + 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 { @@ -22824,34 +17606,18 @@ SWIGINTERN PyObject *_wrap_blpapi_TopicList_statusAt(PyObject *SWIGUNUSEDPARM(se 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); + 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 = 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)); + 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 { @@ -22884,34 +17650,18 @@ SWIGINTERN PyObject *_wrap_blpapi_TopicList_message(PyObject *SWIGUNUSEDPARM(sel 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); + 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 = 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)); + 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: @@ -22939,34 +17689,18 @@ SWIGINTERN PyObject *_wrap_blpapi_TopicList_messageAt(PyObject *SWIGUNUSEDPARM(s 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); + 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 = 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)); + 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: @@ -22987,29 +17721,13 @@ SWIGINTERN PyObject *_wrap_blpapi_TopicList_size(PyObject *SWIGUNUSEDPARM(self), 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -23038,9 +17756,9 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_create(PyObject *SWIGUNUSEDPAR 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); + arg1 = (blpapi_SessionOptions_t *)(argp1); { - int res = SWIG_ConvertFunctionPtr(obj1, (void**)(&arg2), SWIGTYPE_p_f_p_blpapi_Event_p_blpapi_ProviderSession_p_void__void); + 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""'"); } @@ -23049,32 +17767,16 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_create(PyObject *SWIGUNUSEDPAR 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); + 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 *""'"); } - - 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()); + { + 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: @@ -23094,28 +17796,12 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_destroy(PyObject *SWIGUNUSEDPA 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()); + 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: @@ -23136,29 +17822,13 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_start(PyObject *SWIGUNUSEDPARM 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -23178,29 +17848,13 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_startAsync(PyObject *SWIGUNUSE 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -23220,29 +17874,13 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_stop(PyObject *SWIGUNUSEDPARM( 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -23262,29 +17900,13 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_stopAsync(PyObject *SWIGUNUSED 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -23311,34 +17933,18 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_nextEvent(PyObject *SWIGUNUSED 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); + 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 = 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)); + 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: @@ -23362,29 +17968,13 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_tryNextEvent(PyObject *SWIGUNU 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)); + 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: @@ -23418,48 +18008,32 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_registerService(PyObject *SWIG 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); + 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 = reinterpret_cast< char * >(buf2); + 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 = reinterpret_cast< blpapi_Identity_t * >(argp3); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -23494,53 +18068,37 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_activateSubServiceCodeRange(Py 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); + 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 = reinterpret_cast< char * >(buf2); + 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 = static_cast< int >(val3); + 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 = static_cast< int >(val4); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -23571,48 +18129,32 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_deactivateSubServiceCodeRange( 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); + 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 = reinterpret_cast< char * >(buf2); + 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 = static_cast< int >(val3); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -23647,53 +18189,37 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_registerServiceAsync(PyObject 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); + 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 = reinterpret_cast< char * >(buf2); + 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 = reinterpret_cast< blpapi_Identity_t * >(argp3); + 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 = reinterpret_cast< blpapi_CorrelationId_t * >(argp4); + 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 = 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; + 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) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -23716,38 +18242,22 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_deregisterService(PyObject *SW 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); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } @@ -23777,44 +18287,28 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_resolve(PyObject *SWIGUNUSEDPA 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); + 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 = reinterpret_cast< blpapi_ResolutionList_t * >(argp2); + 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 = static_cast< int >(val3); + 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 = 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -23846,44 +18340,28 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_resolveAsync(PyObject *SWIGUNU 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); + 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 = reinterpret_cast< blpapi_ResolutionList_t * >(argp2); + 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 = static_cast< int >(val3); + 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 = 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -23915,44 +18393,28 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_createTopics(PyObject *SWIGUNU 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); + 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 = reinterpret_cast< blpapi_TopicList_t * >(argp2); + 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 = static_cast< int >(val3); + 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 = 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -23984,44 +18446,28 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_createTopicsAsync(PyObject *SW 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); + 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 = reinterpret_cast< blpapi_TopicList_t * >(argp2); + 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 = static_cast< int >(val3); + 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 = 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -24048,34 +18494,18 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_getTopic(PyObject *SWIGUNUSEDP 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); + 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 = 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)); + 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: @@ -24103,34 +18533,18 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_createTopic(PyObject *SWIGUNUS 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); + 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 = 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)); + 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: @@ -24158,34 +18572,18 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_createServiceStatusTopic(PyObj 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); + 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 = 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)); + 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: @@ -24214,39 +18612,23 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_deleteTopics(PyObject *SWIGUNU 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); + 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 = reinterpret_cast< blpapi_Topic_t ** >(argp2); + 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 = 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -24279,48 +18661,32 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_terminateSubscriptionsOnTopics 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); + 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 = reinterpret_cast< blpapi_Topic_t ** >(argp2); + 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 = static_cast< size_t >(val3); + 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 = 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()); + 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(static_cast< int >(result)); - if (alloc4 == SWIG_NEWOBJ) delete[] buf4; + resultobj = SWIG_From_int((int)(result)); + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); return resultobj; fail: - if (alloc4 == SWIG_NEWOBJ) delete[] buf4; + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); return NULL; } @@ -24342,34 +18708,18 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_publish(PyObject *SWIGUNUSEDPA 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); + 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 = 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -24397,39 +18747,23 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_sendResponse(PyObject *SWIGUNU 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); + 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 = reinterpret_cast< blpapi_Event_t * >(argp2); + 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 = 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -24449,28 +18783,12 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_getAbstractSession(PyObject *S 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()); + 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: @@ -24478,32 +18796,61 @@ SWIGINTERN PyObject *_wrap_blpapi_ProviderSession_getAbstractSession(PyObject *S } +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; - - 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()); + { + 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: @@ -24524,28 +18871,12 @@ SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_duplicate(PyObject 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()); + 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: @@ -24565,28 +18896,12 @@ SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_destroy(PyObject *S 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()); + 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: @@ -24610,33 +18925,17 @@ SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_copy(PyObject *SWIG 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); + 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 = 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()); + 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: @@ -24669,44 +18968,28 @@ SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_addActiveSubService 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); + 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 = static_cast< int >(val2); + 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 = static_cast< int >(val3); + 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 = 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -24725,28 +19008,12 @@ SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_removeAllActiveSubS 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()); + 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: @@ -24769,7 +19036,7 @@ SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_setGroupId(PyObject 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); + arg1 = (blpapi_ServiceRegistrationOptions_t *)(argp1); { arg2 = PyString_AsString(obj1); arg3 = PyString_Size(obj1); @@ -24779,27 +19046,11 @@ SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_setGroupId(PyObject 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()); + { + 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: @@ -24824,34 +19075,18 @@ SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_setServicePriority( 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); + 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 = 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()); + arg2 = (int)(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)blpapi_ServiceRegistrationOptions_setServicePriority(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; } - - resultobj = SWIG_From_int(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -24874,33 +19109,17 @@ SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_setPartsToRegister( 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); + 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 = 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()); + 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: @@ -24927,29 +19146,13 @@ SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_getGroupId(PyObject 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)); + 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)); } @@ -24972,29 +19175,13 @@ SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_getServicePriority( 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()); + 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(static_cast< int >(result)); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; @@ -25014,29 +19201,57 @@ SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_getPartsToRegister( 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()); + 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; - resultobj = SWIG_From_int(static_cast< 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; @@ -25046,11 +19261,10 @@ SWIGINTERN PyObject *_wrap_blpapi_ServiceRegistrationOptions_getPartsToRegister( 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_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}, @@ -25075,61 +19289,37 @@ static PyMethodDef SwigMethods[] = { { (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" + "``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" - "- 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" + "If no arguments are specified, then the type will be :attr:`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" + "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}, { (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}, @@ -25209,7 +19399,6 @@ 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 *)"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}, @@ -25238,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}, @@ -25262,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}, @@ -25282,6 +19473,12 @@ static PyMethodDef SwigMethods[] = { { (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}, @@ -25399,6 +19596,7 @@ static PyMethodDef SwigMethods[] = { { (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}, @@ -25480,6 +19678,7 @@ static PyMethodDef SwigMethods[] = { { (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}, @@ -25492,74 +19691,67 @@ static PyMethodDef SwigMethods[] = { { (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_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_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 *|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_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", "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_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_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_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", "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_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}; @@ -25570,13 +19762,11 @@ static swig_type_info _swigt__p_unsigned_long_long = {"_p_unsigned_long_long", " 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_CorrelationId_t__value, &_swigt__p_blpapi_Datetime_tag, &_swigt__p_blpapi_Element, &_swigt__p_blpapi_Event, @@ -25603,13 +19793,13 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_blpapi_StreamWriter_t, &_swigt__p_blpapi_SubscriptionItrerator, &_swigt__p_blpapi_SubscriptionList, - &_swigt__p_blpapi_TimePoint_t, + &_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_blpapi_Event_p_blpapi_ProviderSession_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, @@ -25633,13 +19823,11 @@ static swig_type_info *swig_type_initial[] = { &_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_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}}; @@ -25666,13 +19854,13 @@ static swig_cast_info _swigc__p_blpapi_SessionOptions[] = { {&_swigt__p_blpapi_ 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_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_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_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}}; @@ -25696,13 +19884,11 @@ static swig_cast_info _swigc__p_unsigned_long_long[] = { {&_swigt__p_unsigned_l 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_CorrelationId_t__value, _swigc__p_blpapi_Datetime_tag, _swigc__p_blpapi_Element, _swigc__p_blpapi_Event, @@ -25729,13 +19915,13 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_blpapi_StreamWriter_t, _swigc__p_blpapi_SubscriptionItrerator, _swigc__p_blpapi_SubscriptionList, - _swigc__p_blpapi_TimePoint_t, + _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_blpapi_Event_p_blpapi_ProviderSession_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, @@ -26447,137 +20633,139 @@ SWIG_init(void) { 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)))); + 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; diff --git a/blpapi/logging.py b/blpapi/logging.py index b7bddac..ce19796 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=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..7b117f2 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 @@ -30,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 @@ -67,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: @@ -101,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 = [] @@ -165,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() @@ -204,18 +239,49 @@ 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.""" - original = internals.blpapi_Message_timeReceived_wrapper(self.__handle) + """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: + 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..fa2e7f9 100644 --- a/blpapi/name.py +++ b/blpapi/name.py @@ -7,51 +7,57 @@ """ - - 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. - - 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 \ @@ -59,9 +65,15 @@ def findName(nameString): @staticmethod def hasName(nameString): - """Return True if a Name object representing 'nameString' exists. """ - return internals.blpapi_Name_hasName(nameString) + 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)) @staticmethod def _createInternally(handle): @@ -105,9 +117,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 @@ -125,20 +136,28 @@ 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): - 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..57bbdad 100644 --- a/blpapi/providersession.py +++ b/blpapi/providersession.py @@ -76,15 +76,31 @@ 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,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 @@ -95,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): @@ -127,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 @@ -135,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')) @@ -148,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) @@ -194,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) @@ -216,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 = \ @@ -265,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): @@ -332,80 +388,114 @@ 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.""" - return internals.ProviderSession_flushPublishedEvents(self.__handle, timeoutMsecs) + """Wait at most ``timeoutMsecs`` milliseconds for all the published + events to be sent through the underlying channel. - def stop(self): - """Stop operation of this session and wait until it stops. + 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. + """ - 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. + 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 :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 + + 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_ProviderSession_nextEvent( self.__handle, @@ -416,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) @@ -431,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() @@ -462,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() @@ -496,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( @@ -528,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( @@ -553,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``. - 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. + Args: + message (Message): Message to get the topic from + + 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, @@ -569,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 + + Returns: + Topic: A service status 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. + On success invoking :meth:`~Topic.isValid()` on the returned + :class:`Topic` will return ``False``. """ errorCode, topic = \ internals.blpapi_ProviderSession_createServiceStatusTopic( @@ -583,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, @@ -600,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( @@ -625,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( @@ -646,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 @@ -702,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``. + + Args: + topics ([Topic]): Topics to delete + message (Message): Message to convey additional information to + subscribers regarding the termination - See terminateSubscriptionsOnTopic(topic,message) for additional details. + See :meth:`terminateSubscriptionsOnTopic()` for additional details. """ if not topics: return @@ -726,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 100f318..d6e4880 100644 --- a/blpapi/request.py +++ b/blpapi/request.py @@ -7,27 +7,28 @@ """ - - +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. - Request objects are created using Service.createRequest() or - Service.createAuthorizationRequest(). They are used with - Session.sendRequest() or Session.sendAuthorizationRequest(). + :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 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. + 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): @@ -42,6 +43,7 @@ def __del__(self): pass def destroy(self): + """Destructor.""" if self.__handle: internals.blpapi_Request_destroy(self.__handle) self.__handle = None @@ -57,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() @@ -76,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/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..133f86a 100644 --- a/blpapi/resolutionlist.py +++ b/blpapi/resolutionlist.py @@ -5,25 +5,29 @@ 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. + 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,31 +44,36 @@ 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( - message._handle(), attribute._handle()) + get_handle(message), get_handle(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 - 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. + Returns: + int: ``0`` on success, negative number on failure + + Raises: + TypeError: If ``correlationId`` is not an instance of + :class:`CorrelationId` + + 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() @@ -98,30 +118,36 @@ 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. + """Add the specified ``attribute`` to the list of attributes. - 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. + Args: + attribute (str): Attribute to add + + Returns: + int: ``0`` on success, negative number on failure. """ 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'. + """ + 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, @@ -130,23 +156,35 @@ 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``. + + Args: + correlationId (CorrelationId): Correlation id that identifies the + topic + + Returns: + str: Topic string 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. + Raises: + Exception: If ``correlationId`` does not identify an entry in this + :class:`ResolutionList`. """ errorCode, topic = internals.blpapi_ResolutionList_topicString( self.__handle, - correlationId._handle()) + get_handle(correlationId)) _ExceptionUtil.raiseOnError(errorCode) 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, @@ -155,33 +193,41 @@ 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, - correlationId._handle()) + get_handle(correlationId)) _ExceptionUtil.raiseOnError(errorCode) 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, @@ -190,38 +236,51 @@ 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( self.__handle, - attribute._handle(), - correlationId._handle()) + get_handle(attribute), + get_handle(correlationId)) _ExceptionUtil.raiseOnError(errorCode) 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 + + Returns: + Element: Value for the specified ``attribute`` of this list 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. + 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, - attribute._handle(), + get_handle(attribute), index) _ExceptionUtil.raiseOnError(errorCode) @@ -229,31 +288,47 @@ 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, - correlationId._handle()) + get_handle(correlationId)) _ExceptionUtil.raiseOnError(errorCode) 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, @@ -262,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 6d06bbb..f40e5af 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,31 +25,23 @@ 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): """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""" + """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""" + """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) @@ -64,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. - - Application clients need never create 'SchemaElementDefinition' objects - directly; applications will typically work with objects returned by other - 'blpapi' components. + ``maxValues() == UNBOUNDED``. - Class attributes: + :class:`SchemaElementDefinition` objects are read-only. - 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 @@ -113,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 = [] @@ -185,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( @@ -208,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 @@ -219,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. + 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. - 'SchemaTypeDefinition' objects are read-only. - - 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): @@ -246,104 +239,115 @@ 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) - 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. + """ + 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): @@ -369,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, @@ -381,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 80f1bcc..7ba4bed 100644 --- a/blpapi/service.py +++ b/blpapi/service.py @@ -8,25 +8,23 @@ """ - - - 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. + """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): @@ -34,44 +32,52 @@ 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( self.__handle) - return None if 0 != errCode else\ + return None if errCode != 0 else\ 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( @@ -81,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, @@ -102,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): @@ -137,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, @@ -154,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( @@ -166,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( @@ -178,48 +193,64 @@ 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( self.__handle, - correlationId._handle()) + get_handle(correlationId)) _ExceptionUtil.raiseOnError(errCode) 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) - 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. + """ + 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): @@ -235,40 +266,55 @@ 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) - 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. + """Get the definition of a specified event. + + Args: + nameOrIndex (Name or str or int): Name or index of the 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. + 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): @@ -286,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, @@ -298,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( @@ -325,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 7ecca79..65b2290 100644 --- a/blpapi/session.py +++ b/blpapi/session.py @@ -20,61 +20,66 @@ 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. 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 @@ -94,6 +99,7 @@ class Session(AbstractSession): @staticmethod def __dispatchEvent(sessionRef, eventHandle): + """ event dispatcher """ try: session = sessionRef() if session is not None: @@ -105,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( @@ -156,9 +160,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)) @@ -175,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) @@ -246,112 +272,144 @@ 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: 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. - 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, - subscriptionList._handle(), - None if identity is None else identity._handle(), + get_handle(subscriptionList), + get_handle(identity), 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, - subscriptionList._handle(), + get_handle(subscriptionList), None, 0)) - def resubscribe(self, 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 + def resubscribe( + self, + subscriptionList, + requestLabel="", + resubscriptionId=None): + """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: 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) 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( 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, @@ -359,31 +417,48 @@ 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() 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) @@ -392,97 +467,124 @@ 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() 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' - 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. """ 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..c7b668e 100644 --- a/blpapi/sessionoptions.py +++ b/blpapi/sessionoptions.py @@ -24,22 +24,21 @@ 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): """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 @@ -50,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): @@ -70,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 @@ -78,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( @@ -91,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( @@ -101,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``. + + 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'. + Set the server address at the specified ``index`` using the specified + ``serverHost`` and ``serverPort``. """ _ExceptionUtil.raiseOnError( @@ -114,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, @@ -123,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( @@ -138,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( @@ -152,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( @@ -169,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( @@ -182,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( @@ -200,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, @@ -216,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( @@ -226,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) @@ -241,156 +270,262 @@ 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) + 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) + 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.""" - internals.blpapi_SessionOptions_setMaxEventQueueSize(self.__handle, - eventQueueSize) + """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) + 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) + 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) + 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) + 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) + 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) + self.__handle, timeoutMsecs) _ExceptionUtil.raiseOnError(err) def setTlsOptions(self, tlsOptions): - """Set the TLS options""" - internals.blpapi_SessionOptions_setTlsOptions(self.__handle, - tlsOptions._handle()) + """Set the TLS options + + Args: + tlsOptions (TlsOptions): The TLS options + """ + internals.blpapi_SessionOptions_setTlsOptions( + 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): - """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(self.__handle, - index) + internals.blpapi_SessionOptions_getServerAddress( + self.__handle, + index) _ExceptionUtil.raiseOnError(errorCode) 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, @@ -398,176 +533,224 @@ 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) + 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) + 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) + 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) + 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) + 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) + 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.""" - return internals.blpapi_SessionOptions_serviceCheckTimeout(self.__handle) + """ + 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.""" - return internals.blpapi_SessionOptions_serviceDownloadTimeout(self.__handle) + """ + Returns: + int: 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): + """ + 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 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 + + Returns: + str: This object formatted as a 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'). + 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) + 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. + :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 @@ -579,6 +762,7 @@ def __del__(self): pass def destroy(self): + """Destructor.""" if self.__handle: internals.blpapi_TlsOptions_destroy(self.__handle) self.__handle = None @@ -587,46 +771,72 @@ 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.""" - internals.blpapi_TlsOptions_setCrlFetchTimeoutMs(self.__handle, timeoutMs) + """ + 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) @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) + """ + 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, + 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.""" + """ + 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( - credentials, - clientCredentialsPassword, - certs) + credentials, + clientCredentialsPassword, + certs) return TlsOptions(handle) __copyright__ = """ diff --git a/blpapi/subscriptionlist.py b/blpapi/subscriptionlist.py index 0e16c0f..dd68f95 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,46 +87,54 @@ 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. 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. | - |-----------------------------------------------------------------------| + + +-------------+--------------------------+----------------------------+ + | 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): @@ -136,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() @@ -165,43 +181,55 @@ 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) 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, - other.__handle) + get_handle(other)) def clear(self): """Remove all entries from this object.""" 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 + + Returns: + CorrelationId: Correlation id of the ``index``\ th entry. - Return the CorrelationId of the specified 'index'th entry - in this 'SubscriptionList' object. An exception is raised if - 'index >= size()'. + Raises: + Exception: If ``index >= size()``. """ errorCode, cid = internals.blpapi_SubscriptionList_correlationIdAt( self.__handle, @@ -210,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 + + Returns: + str: The full topic string at the specified ``index``. - 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()'. + Raises: + Exception: If ``index >= size()``. """ errorCode, topic = internals.blpapi_SubscriptionList_topicStringAt( self.__handle, @@ -223,28 +255,44 @@ 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, correlationId._handle()) + 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) + 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..4ae1901 100644 --- a/blpapi/topic.py +++ b/blpapi/topic.py @@ -5,29 +5,30 @@ 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 :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. + + Args: + handle: Handle to the internal implementation + sessions: Sessions associated with this 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. + 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: @@ -41,46 +42,50 @@ 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) 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..0e2ed8c 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): @@ -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,15 +35,19 @@ 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``. + + Args: + original (TopicList): Original topiclist to copy off of - If 'original' is None - create empty TopicList. Otherwise create a - TopicList from 'original'. + If ``original`` is ``None`` - create empty :class:`TopicList`. + Otherwise create a :class:`TopicList` from ``original``. """ 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) @@ -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() @@ -81,19 +100,23 @@ 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'. + """ + Args: + index (int): Index of the entry in the list - Return the CorrelationId of the specified 'index'th entry - in this TopicList. 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_TopicList_correlationIdAt( self.__handle, @@ -102,23 +125,35 @@ 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. - 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. + Returns: + str: Topic of the entry identified by 'correlationId'. + + Raises: + Exception: If the ``correlationId`` does not identify an entry in + this list. """ errorCode, topic = internals.blpapi_TopicList_topicString( self.__handle, - correlationId._handle()) + get_handle(correlationId)) _ExceptionUtil.raiseOnError(errorCode) 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, @@ -127,25 +162,37 @@ 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, - correlationId._handle()) + get_handle(correlationId)) _ExceptionUtil.raiseOnError(errorCode) return status def statusAt(self, index): - """Return the status at the specified 'index'. + """ + Args: + index (int): Index of the entry - 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(). + Returns: + int: Status of the ``index``\ th entry in this list. This may be + :attr:`NOT_CREATED`, :attr:`CREATED` and :attr:`FAILURE`. + + Raises: + Exception: If ``index >= size()``. """ errorCode, status = internals.blpapi_TopicList_statusAt( self.__handle, @@ -154,31 +201,44 @@ 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, - correlationId._handle()) + get_handle(correlationId)) _ExceptionUtil.raiseOnError(errorCode) 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, @@ -187,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 301b499..8410ddd 100644 --- a/blpapi/version.py +++ b/blpapi/version.py @@ -5,19 +5,25 @@ from __future__ import print_function from . import versionhelper -__version__ = "3.12.1" +__version__ = "3.14.0" 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/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.cxx b/blpapi/versionhelper_wrap.c similarity index 95% rename from blpapi/versionhelper_wrap.cxx rename to blpapi/versionhelper_wrap.c index 53fb4b1..ce020cf 100644 --- a/blpapi/versionhelper_wrap.cxx +++ b/blpapi/versionhelper_wrap.c @@ -16,30 +16,6 @@ #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. @@ -443,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 */ @@ -453,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; @@ -470,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 */ @@ -480,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; @@ -3004,12 +2984,10 @@ SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { /* -------- 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 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) @@ -3037,81 +3015,8 @@ static swig_module_info swig_module = {swig_types, 4, 0, 0, 0, 0}; #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; - } - }; -} +#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" @@ -3144,20 +3049,20 @@ SWIG_FromCharPtrAndSize(const char* carray, size_t size) 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(); + 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, static_cast< Py_ssize_t >(size)); + return PyBytes_FromStringAndSize(carray, (Py_ssize_t)(size)); #else #if PY_VERSION_HEX >= 0x03010000 - return PyUnicode_DecodeUTF8(carray, static_cast< Py_ssize_t >(size), "surrogateescape"); + return PyUnicode_DecodeUTF8(carray, (Py_ssize_t)(size), "surrogateescape"); #else - return PyUnicode_FromStringAndSize(carray, static_cast< Py_ssize_t >(size)); + return PyUnicode_FromStringAndSize(carray, (Py_ssize_t)(size)); #endif #endif #else - return PyString_FromStringAndSize(carray, static_cast< Py_ssize_t >(size)); + return PyString_FromStringAndSize(carray, (Py_ssize_t)(size)); #endif } } else { @@ -3248,80 +3153,30 @@ SWIGINTERN PyObject *_wrap_blpapi_getVersionIdentifier(PyObject *SWIGUNUSEDPARM( } -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, }; diff --git a/blpapi/zfputil.py b/blpapi/zfputil.py new file mode 100644 index 0000000..4bd1e44 --- /dev/null +++ b/blpapi/zfputil.py @@ -0,0 +1,107 @@ +# 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): + """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 :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. + + Note: + 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..08cbea4 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,44 @@ +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 + 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 + 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 @@ -23,7 +64,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/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/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/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 1c9ed93..62f8556 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.3' + +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') @@ -32,6 +47,7 @@ blpapiLibraryName = 'blpapi3_32' cmdclass = {} +extraLinkArgs = [] if platform == 'windows': from distutils.command import build_ext from ctypes import windll, create_string_buffer, c_uint, byref, string_at, wstring_at, c_void_p @@ -123,7 +139,7 @@ def build_extension(self, ext): machine = "/MACHINE:" + ("X64" if is64bit else "X86") self.compiler.spawn([self.compiler.lib, machine, "/DEF:" + deffile, "/OUT:" + libfile]) - # copy the versioned dll the the build output + # copy the versioned dll to the build output if self.force or not os.path.exists(os.path.join(build_dir, versionedLibName + ".dll")): if not os.path.exists(build_dir): os.makedirs(build_dir) @@ -146,26 +162,28 @@ def build_extension(self, ext): # 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': 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") - - blpapiLibraryPath = blpapiLibVar or blpapiLibraryPath blpapiIncludes = blpapiIncludesVar or os.path.join(blpapiRoot, 'include') blpapi_wrap = Extension( 'blpapi._internals', - sources=['blpapi/internals_wrap.cxx'], + sources=['blpapi/internals_wrap.c'], include_dirs=[blpapiIncludes], library_dirs=[blpapiLibraryPath], libraries=[blpapiLibraryName], @@ -174,7 +192,7 @@ def build_extension(self, ext): versionhelper_wrap = Extension( 'blpapi._versionhelper', - sources=['blpapi/versionhelper_wrap.cxx'], + sources=['blpapi/versionhelper_wrap.c'], include_dirs=[blpapiIncludes], library_dirs=[blpapiLibraryPath], libraries=[blpapiLibraryName], @@ -183,7 +201,7 @@ def build_extension(self, ext): 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',