├── .gitignore ├── .npmignore ├── .travis.yml ├── LICENSE ├── README.md ├── binding.gyp ├── blpapi.js ├── blpapijs.cpp ├── deps └── blpapi │ ├── LICENSE │ ├── include-3.8.1.1 │ ├── blpapi_abstractsession.h │ ├── blpapi_call.h │ ├── blpapi_constant.h │ ├── blpapi_correlationid.h │ ├── blpapi_datetime.h │ ├── blpapi_defs.h │ ├── blpapi_diagnosticsutil.h │ ├── blpapi_dispatchtbl.h │ ├── blpapi_element.h │ ├── blpapi_error.h │ ├── blpapi_event.h │ ├── blpapi_eventdispatcher.h │ ├── blpapi_eventformatter.h │ ├── blpapi_exception.h │ ├── blpapi_highresolutionclock.h │ ├── blpapi_identity.h │ ├── blpapi_logging.h │ ├── blpapi_message.h │ ├── blpapi_name.h │ ├── blpapi_providersession.h │ ├── blpapi_request.h │ ├── blpapi_resolutionlist.h │ ├── blpapi_schema.h │ ├── blpapi_service.h │ ├── blpapi_session.h │ ├── blpapi_sessionoptions.h │ ├── blpapi_streamproxy.h │ ├── blpapi_subscriptionlist.h │ ├── blpapi_timepoint.h │ ├── blpapi_topic.h │ ├── blpapi_topiclist.h │ ├── blpapi_types.h │ ├── blpapi_versioninfo.h │ └── blpapi_versionmacros.h │ ├── include-3.8.8.1 │ ├── blpapi_abstractsession.h │ ├── blpapi_call.h │ ├── blpapi_constant.h │ ├── blpapi_correlationid.h │ ├── blpapi_datetime.h │ ├── blpapi_defs.h │ ├── blpapi_diagnosticsutil.h │ ├── blpapi_dispatchtbl.h │ ├── blpapi_element.h │ ├── blpapi_error.h │ ├── blpapi_event.h │ ├── blpapi_eventdispatcher.h │ ├── blpapi_eventformatter.h │ ├── blpapi_exception.h │ ├── blpapi_highresolutionclock.h │ ├── blpapi_identity.h │ ├── blpapi_logging.h │ ├── blpapi_message.h │ ├── blpapi_name.h │ ├── blpapi_providersession.h │ ├── blpapi_request.h │ ├── blpapi_resolutionlist.h │ ├── blpapi_schema.h │ ├── blpapi_service.h │ ├── blpapi_session.h │ ├── blpapi_sessionoptions.h │ ├── blpapi_streamproxy.h │ ├── blpapi_subscriptionlist.h │ ├── blpapi_timepoint.h │ ├── blpapi_topic.h │ ├── blpapi_topiclist.h │ ├── blpapi_types.h │ ├── blpapi_versioninfo.h │ └── blpapi_versionmacros.h │ ├── linux │ ├── libblpapi3_32.so │ └── libblpapi3_64.so │ ├── osx │ ├── libblpapi3_32.so │ └── libblpapi3_64.so │ └── win │ ├── blpapi3_32.dll │ ├── blpapi3_32.lib │ ├── blpapi3_64.dll │ └── blpapi3_64.lib ├── examples ├── AuthorizationApplication.js ├── Console.js ├── FieldSearchRequest.js ├── HistoricalDataRequest.js ├── IntradayBarRequest.js ├── IntradayTickRequest.js ├── MarketBarSubscription.js ├── MarketSubUnsubscription.js ├── MarketSubscription.js ├── MarketVwapSubscription.js ├── OptionChain.js └── node_modules │ └── blpapi └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | Debug/ 3 | Release/ 4 | npm-debug.log 5 | /node_modules/ 6 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .npmignore 2 | .gitignore 3 | README.md 4 | build/ 5 | Debug/ 6 | Release/ 7 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.12" 4 | - "iojs" 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2014 Bloomberg Finance L.P. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: The copyright notice 9 | below and this permission notice shall be included in all copies or 10 | substantial portions of the Software. 11 | 12 | THE SOFTWARE IS PROVIDED "AS IS," WITHOUT WARRANTY OF ANY KIND, EXPRESS 13 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | SOFTWARE. 19 | 20 | BLOOMBERG is a registered trademark of Bloomberg Finance L.P. or its affiliates. 21 | 22 | All other trademarks and registered trademarks are the property of their 23 | respective owners. 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![build status](https://secure.travis-ci.org/bloomberg/blpapi-node.svg)](http://travis-ci.org/bloomberg/blpapi-node) 2 | blpapi-node 3 | =========== 4 | 5 | [Bloomberg Open API] binding for [Node.js]. 6 | 7 | Find source code in the [Github repository]. 8 | 9 | [Bloomberg Open API]: http://www.bloomberglabs.com/api/about/ 10 | [Node.js]: http://nodejs.org 11 | [Github repository]: https://github.com/bloomberg/blpapi-node 12 | 13 | **Note:** This repository was renamed from `node-blpapi` to `blpapi-node`. 14 | 15 | Dependencies 16 | ------------ 17 | 18 | This module requires: 19 | 20 | + Node.js version >= **0.12.x** (io.js >= **1.0.x** is supported) 21 | + Linux, Windows, or Mac OS X (32 or 64-bit) 22 | + GCC (Linux), MSVC++ (Windows), or Xcode (Mac OS X) 23 | + Bloomberg Desktop API (DAPI), Server API (SAPI), or [B-PIPE] subscription 24 | 25 | This module includes: 26 | 27 | + [Bloomberg BLPAPI C++ SDK] v3.7.9.1 (Linux/Windows) 28 | + [Bloomberg BLPAPI C++ SDK] v3.8.1.1 (Mac OS X) 29 | 30 | **Note:** Mac OS X users can only connect to SAPI or [B-PIPE] products. 31 | 32 | [Bloomberg BLPAPI C++ SDK]: http://www.bloomberglabs.com/api/libraries/ 33 | [B-PIPE]: http://www.bloomberg.com/enterprise/enterprise_products/data_optimization/data_feeds 34 | 35 | Installation 36 | ------------ 37 | 38 | From your project directory, run: 39 | 40 | ``` 41 | $ npm install blpapi 42 | ``` 43 | 44 | To install directly from github source, run: 45 | 46 | ``` 47 | $ npm install git://github.com/bloomberg/blpapi-node.git 48 | ``` 49 | 50 | This will download and build `blpapi` in `node_modules/`. 51 | 52 | **Note:** Windows users using the Express version of Visual Studio may not 53 | have the 64-bit compiler platform installed. If errors are seen related 54 | to the `x64` platform not being found, please force a 32-bit arch before 55 | invoking `npm` by running from the command shell: 56 | 57 | ``` 58 | > set npm_config_arch="ia32" 59 | ``` 60 | 61 | Usage 62 | ----- 63 | 64 | The module design closely follows the BLPAPI SDK design, with slight 65 | modifications in syntax for easier consumption in Javascript. The SDK 66 | developer's guide should serve as the main guide for the module's 67 | functionality. 68 | 69 | Full examples contained in the `examples` directory demonstrate how to 70 | use most SDK functionality. Full descriptions of all available requests, 71 | responses, and options are contained within the BLPAPI API 72 | [Developer Guide](http://www.bloomberglabs.com/api/documentation/). 73 | 74 | 75 | ### Opening A Session ### 76 | 77 | var blpapi = require('blpapi'); 78 | var session = new blpapi.Session({ host: '127.0.0.1', port: 8194 }); 79 | 80 | session.on('SessionStarted', function(m) { 81 | // ready for work 82 | }); 83 | 84 | ### Opening A Subscription Service ### 85 | 86 | var service_id = 1; 87 | 88 | session.on('SessionStarted', function(m) { 89 | session.openService('//blp/mktdata', service_id); 90 | }); 91 | 92 | session.on('ServiceOpened', function(m) { 93 | // m.correlations[0].value == service_id 94 | // ready for subscriptions 95 | }); 96 | 97 | ### Subscribing To Market Data ### 98 | 99 | var securities = [ 100 | { security: 'AAPL US Equity', correlation: 0, fields: ['LAST_TRADE'] }, 101 | { security: 'GOOG US Equity', correlation: 1, fields: ['LAST_TRADE'] } 102 | ]; 103 | 104 | session.on('ServiceOpened', function(m) { 105 | if (m.correlations[0].value == service_id) { 106 | session.subscribe(securities); 107 | } 108 | }); 109 | 110 | session.on('MarketDataEvents', function(m) { 111 | if (m.data.hasOwnProperty('LAST_TRADE')) { 112 | console.log(securities[m.correlations[0].value].security, 113 | 'LAST_TRADE', m.data.LAST_TRADE); 114 | // outputs: 115 | // AAPL US Equity LAST_TRADE 600.00 116 | // AAPL US Equity LAST_TRADE 601.00 117 | // GOOG US Equity LAST_TRADE 650.00 118 | // ... 119 | } 120 | }); 121 | 122 | ### Creating An Authorized Identity ### 123 | 124 | Some session configurations, for example when connecting to a B-PIPE, may 125 | require calls to `request` and `subscribe` to specify an authorized Identity. 126 | The `authorizeUser` function performs an `AuthorizationRequest` on the 127 | `//blp/apiauth`. This function differs slightly from the BLPAPI SDK design in 128 | two ways. First, rather than having separate response events for success and 129 | failure, it emits the `AuthorizationResponse` event for both. Second, the 130 | `Identity` object is returned via the response as `data.identity`. This is only 131 | set for successful authorization, so its presence or absence can be used to 132 | determine whether the `AuthorizationResponse` indicates success or failure. 133 | `data.identity` is an opaque object representing the authorized user. Its only 134 | use is to be passed to `request` and `subscribe`. 135 | 136 | var auth_service_id = 2; 137 | var token_correlation_id = 3; 138 | var identity_correlation_id = 4; 139 | 140 | session.on('SessionStarted', function(m) { 141 | session.openService('//blp/apiauth', auth_service_id); 142 | }); 143 | 144 | session.on('ServiceOpened', function(m) { 145 | if (m.correlations[0].value == auth_service_id) { 146 | // Request a token to be sent to you via MSG. 147 | session.request('//blp/apiauth', 'AuthorizationTokenRequest', 148 | { uuid: 12345678, label: 'testApp' }, token_correlation_id); 149 | } 150 | }); 151 | 152 | session.on('AuthorizationTokenResponse', function(m) { 153 | if (m.correlations[0].value == token_correlation_id) { 154 | // Request the identity 155 | session.authorizeUser({ uuid: 12345678, token: 'token from MSG' }, 156 | identity_correlation_id); 157 | } 158 | }); 159 | 160 | session.on('AuthorizationResponse', function(m) { 161 | if (m.correlations[0].value == identity_correlation_id) { 162 | if (m.data.hasOwnProperty('identity') { 163 | // Authorization successful; 164 | // Save m.data.identity for use with later requests. 165 | } 166 | } 167 | }); 168 | 169 | ### Using An Authorized Identity To Make A Request ### 170 | 171 | var identity; // Assumed to be set by a previous AuthorizationResponse 172 | 173 | var refdata_service_id = 5; 174 | var refdata_correlation_id = 6; 175 | 176 | session.on('SessionStarted', function(m) { 177 | session.openService('//blp/refdata', refdata_service_id); 178 | }); 179 | 180 | session.on('ServiceOpened', function(m) { 181 | if (m.correlations[0].value == refdata_service_id) { 182 | session.request('//blp/refdata', 'ReferenceDataRequest', 183 | { securities: ['IBM US Equity'], fields: [PX_LAST'] }, 184 | refdata_correlation_id, identity); 185 | } 186 | }); 187 | 188 | session.on('ReferenceDataResponse', function(m) { 189 | if (m.correlations[0].value == refdata_correlation_id) { 190 | console.log(m.data); 191 | } 192 | }); 193 | 194 | Error Handling 195 | -------------- 196 | 197 | Exceptions thrown from the C++ SDK layer are translated into 198 | JavaScript exceptions with the same type name. The JavaScript 199 | exception types inherit from `Error` with the `message` property set 200 | to the description obtained from the original C++ exception. 201 | Refer to the C++ SDK documentation for additional information on 202 | exceptions. 203 | 204 | This is a list of the exception types: 205 | 206 | + DuplicateCorrelationIdException 207 | + InvalidStateException 208 | + InvalidArgumentException 209 | + InvalidConversionException 210 | + IndexOutOfRangeException 211 | + FieldNotFoundException 212 | + NotFoundException 213 | + UnknownErrorException 214 | + UnsupportedOperationException 215 | 216 | License 217 | ------- 218 | 219 | MIT license. See license text in [LICENSE](https://github.com/bloomberg/blpapi-node/blob/master/LICENSE). 220 | -------------------------------------------------------------------------------- /binding.gyp: -------------------------------------------------------------------------------- 1 | { 2 | 'targets': [ 3 | { 4 | 'target_name': 'blpapijs', 5 | 'sources': [ 'blpapijs.cpp' ], 6 | 'cflags!': [ '-fno-exceptions' ], 7 | 'cflags_cc!': [ '-fno-exceptions' ], 8 | 'conditions': [ 9 | ['OS=="win"', { 10 | 'include_dirs': [ 11 | '<(module_root_dir)/deps/blpapi/include-3.8.8.1' 12 | ], 13 | 'msvs_settings': { 14 | 'VCCLCompilerTool': { 15 | 'AdditionalOptions': [ '/EHsc' ] 16 | } 17 | }, 18 | 'conditions': [ 19 | ['target_arch=="ia32"', { 20 | 'libraries': [ 21 | '<(module_root_dir)/deps/blpapi/win/blpapi3_32.lib' 22 | ], 23 | 'copies': [{ 24 | 'destination': '<(PRODUCT_DIR)', 25 | 'files': [ 26 | '<(module_root_dir)/deps/blpapi/win/blpapi3_32.dll' 27 | ] 28 | }] 29 | }], 30 | ['target_arch=="x64"', { 31 | 'msvs_configuration_platform': 'x64', 32 | 'msbuild_toolset': 'v120_xp', 33 | 'libraries': [ 34 | '<(module_root_dir)/deps/blpapi/win/blpapi3_64.lib' 35 | ], 36 | 'copies': [{ 37 | 'destination': '<(PRODUCT_DIR)', 38 | 'files': [ 39 | '<(module_root_dir)/deps/blpapi/win/blpapi3_64.dll' 40 | ] 41 | }] 42 | }] 43 | ] 44 | }], 45 | ['OS=="linux"', { 46 | 'include_dirs': [ 47 | '<(module_root_dir)/deps/blpapi/include-3.8.8.1' 48 | ], 49 | 'ldflags': [ 50 | '-Wl,-R<(module_root_dir)/deps/blpapi/linux', 51 | '-L<(module_root_dir)/deps/blpapi/linux' 52 | ], 53 | 'conditions': [ 54 | ['target_arch=="ia32"', { 55 | 'libraries': [ '-lblpapi3_32' ] 56 | }], 57 | ['target_arch=="x64"', { 58 | 'libraries': [ '-lblpapi3_64' ] 59 | }] 60 | ] 61 | }], 62 | ['OS=="mac"', { 63 | 'include_dirs': [ 64 | '<(module_root_dir)/deps/blpapi/include-3.8.1.1' 65 | ], 66 | 'ldflags': [ 67 | '-Wl,-rpath,<(module_root_dir)/deps/blpapi/osx', 68 | '-L<(module_root_dir)/deps/blpapi/osx' 69 | ], 70 | 'conditions': [ 71 | ['target_arch=="ia32"', { 72 | 'libraries': [ '-lblpapi3_32' ], 73 | 'xcode_settings': { 'ARCHS': [ 'i386' ] } 74 | }], 75 | ['target_arch=="x64"', { 76 | 'libraries': [ '-lblpapi3_64' ], 77 | 'xcode_settings': { 'ARCHS': [ 'x86_64' ] } 78 | }] 79 | ], 80 | 'xcode_settings': { 81 | 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES', 82 | 'GCC_ENABLE_CPP_RTTI': 'NO', 83 | 'INSTALL_PATH': '@rpath', 84 | 'LD_DYLIB_INSTALL_NAME': '', 85 | 'OTHER_LDFLAGS': [ 86 | '-Wl,-search_paths_first', 87 | '-Wl,-rpath,<(module_root_dir)/deps/blpapi/osx', 88 | '-L<(module_root_dir)/deps/blpapi/osx' 89 | ] 90 | } 91 | }] 92 | ] 93 | } 94 | ] 95 | } 96 | -------------------------------------------------------------------------------- /blpapi.js: -------------------------------------------------------------------------------- 1 | var EventEmitter = require('events').EventEmitter; 2 | var util = require('util'); 3 | var path = require('path'); 4 | var blpapi = require(path.join(__dirname, '/build/Release/blpapijs')); 5 | var createCustomError = require('custom-error-generator'); 6 | 7 | // Note: When support for authorizing multiple identities was added, this 8 | // added an optional identity parameter to functions that could be called on 9 | // different identities. In all cases, this was added before the optional 10 | // label. To avoid breaking existing callers, when these functions are called 11 | // with the old number of arguments, they check the last argument and will 12 | // accept either a label or identity. 13 | 14 | var getError = function () { 15 | var errorTypeNames = [ 16 | 'DuplicateCorrelationIdException', 17 | 'InvalidStateException', 18 | 'InvalidArgumentException', 19 | 'InvalidConversionException', 20 | 'IndexOutOfRangeException', 21 | 'FieldNotFoundException', 22 | 'NotFoundException', 23 | 'UnknownErrorException', 24 | 'UnsupportedOperationException' 25 | ]; 26 | 27 | errorTypeNames.forEach(function(typeName) { 28 | exports[typeName] = createCustomError(typeName, Error); 29 | }); 30 | return function(error) { 31 | var typeName = error.typeName; 32 | if (typeName in exports) { 33 | return new exports[typeName](error.message); 34 | } else { 35 | return error; 36 | } 37 | } 38 | }(); 39 | 40 | var invoke = function(func) { 41 | try { 42 | return func.apply(this, 43 | Array.prototype.slice.call(arguments, 1)); 44 | } catch(err) { 45 | throw getError(err); 46 | } 47 | }; 48 | 49 | exports.Session = function(args) { 50 | this.session = new blpapi.Session(args); 51 | var that = this; 52 | this.session.emit = function() { 53 | that.emit.apply(that, arguments); 54 | }; 55 | }; 56 | util.inherits(exports.Session, EventEmitter); 57 | 58 | exports.Session.prototype.start = 59 | function() { 60 | return invoke.call(this.session, this.session.start); 61 | } 62 | exports.Session.prototype.authorize = 63 | function(uri, cid) { 64 | return invoke.call(this.session, this.session.authorize, uri, cid); 65 | } 66 | exports.Session.prototype.authorizeUser = 67 | function(request, cid) { 68 | return invoke.call(this.session, 69 | this.session.authorizeUser, 70 | request, 71 | cid); 72 | } 73 | exports.Session.prototype.stop = 74 | function() { 75 | return invoke.call(this.session, this.session.stop); 76 | } 77 | exports.Session.prototype.destroy = 78 | function() { 79 | return invoke.call(this.session, this.session.destroy); 80 | } 81 | exports.Session.prototype.openService = 82 | function(uri, cid) { 83 | return invoke.call(this.session, this.session.openService, uri, cid); 84 | } 85 | exports.Session.prototype.subscribe = 86 | function(sub, arg2, arg3) { 87 | var identity = arg2; 88 | var label = arg3; 89 | if (2 === arguments.length && typeof arg2 === 'string') { 90 | identity = undefined; 91 | label = arg2; 92 | } 93 | return invoke.call(this.session, 94 | this.session.subscribe, 95 | sub, 96 | identity, 97 | label); 98 | } 99 | exports.Session.prototype.resubscribe = 100 | function(sub, label) { 101 | return invoke.call(this.session, this.session.resubscribe, sub, label); 102 | } 103 | exports.Session.prototype.unsubscribe = 104 | function(sub, label) { 105 | return invoke.call(this.session, this.session.unsubscribe, sub, label); 106 | } 107 | exports.Session.prototype.request = 108 | function(uri, name, request, cid, arg5, arg6) { 109 | var identity = arg5; 110 | var label = arg6; 111 | if (5 === arguments.length && typeof arg5 === 'string') { 112 | identity = undefined; 113 | label = arg5; 114 | } 115 | return invoke.call(this.session, this.session.request, 116 | uri, name, request, cid, identity, label); 117 | } 118 | 119 | // Local variables: 120 | // c-basic-offset: 4 121 | // tab-width: 4 122 | // indent-tabs-mode: nil 123 | // End: 124 | // 125 | // vi: set shiftwidth=4 tabstop=4 expandtab: 126 | // :indentSize=4:tabSize=4:noTabs=true: 127 | 128 | // ---------------------------------------------------------------------------- 129 | // Copyright (C) 2014 Bloomberg L.P. 130 | // 131 | // Permission is hereby granted, free of charge, to any person obtaining a copy 132 | // of this software and associated documentation files (the "Software"), to 133 | // deal in the Software without restriction, including without limitation the 134 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 135 | // sell copies of the Software, and to permit persons to whom the Software is 136 | // furnished to do so, subject to the following conditions: 137 | // 138 | // The above copyright notice and this permission notice shall be included in 139 | // all copies or substantial portions of the Software. 140 | // 141 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 142 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 143 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 144 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 145 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 146 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 147 | // IN THE SOFTWARE. 148 | // ----------------------------- END-OF-FILE ---------------------------------- 149 | -------------------------------------------------------------------------------- /deps/blpapi/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2012. Bloomberg Finance L.P. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this proprietary software and associated documentation files (the "Software"), 5 | to use, publish, or distribute copies of the Software, and to permit persons to 6 | whom the Software is furnished to do so. 7 | 8 | Any other use, including modifying, adapting, reverse engineering, decompiling, 9 | or disassembling, is not permitted. 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | SOFTWARE. 21 | -------------------------------------------------------------------------------- /deps/blpapi/include-3.8.1.1/blpapi_defs.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2012. Bloomberg Finance L.P. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: The above 9 | * copyright notice and this permission notice shall be included in all copies 10 | * or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 18 | * IN THE SOFTWARE. 19 | */ 20 | // blpapi_defs.h -*-C++-*- 21 | #ifndef INCLUDED_BLPAPI_DEFS 22 | #define INCLUDED_BLPAPI_DEFS 23 | 24 | //@PURPOSE: Common definitions used by the library. 25 | // 26 | //@DESCRIPTION: This component provides a list of preprocessors that are used 27 | // by the library. 28 | 29 | #include 30 | 31 | #define BLPAPI_CORRELATION_TYPE_UNSET 0 32 | #define BLPAPI_CORRELATION_TYPE_INT 1 33 | #define BLPAPI_CORRELATION_TYPE_POINTER 2 34 | #define BLPAPI_CORRELATION_TYPE_AUTOGEN 3 35 | #define BLPAPI_CORRELATION_MAX_CLASS_ID ((1 << 16)-1) 36 | 37 | #define BLPAPI_MANAGEDPTR_COPY 1 38 | #define BLPAPI_MANAGEDPTR_DESTROY (-1) 39 | 40 | 41 | #define BLPAPI_DATETIME_YEAR_PART 0x1 42 | #define BLPAPI_DATETIME_MONTH_PART 0x2 43 | #define BLPAPI_DATETIME_DAY_PART 0x4 44 | #define BLPAPI_DATETIME_OFFSET_PART 0x8 45 | #define BLPAPI_DATETIME_HOURS_PART 0x10 46 | #define BLPAPI_DATETIME_MINUTES_PART 0x20 47 | #define BLPAPI_DATETIME_SECONDS_PART 0x40 48 | #define BLPAPI_DATETIME_MILLISECONDS_PART 0x80 49 | #define BLPAPI_DATETIME_FRACSECONDS_PART 0x80 50 | #define BLPAPI_DATETIME_DATE_PART (BLPAPI_DATETIME_YEAR_PART| \ 51 | BLPAPI_DATETIME_MONTH_PART| \ 52 | BLPAPI_DATETIME_DAY_PART) 53 | #define BLPAPI_DATETIME_TIME_PART (BLPAPI_DATETIME_HOURS_PART| \ 54 | BLPAPI_DATETIME_MINUTES_PART| \ 55 | BLPAPI_DATETIME_SECONDS_PART) 56 | #define BLPAPI_DATETIME_TIMEMILLI_PART (BLPAPI_DATETIME_TIME_PART| \ 57 | BLPAPI_DATETIME_MILLISECONDS_PART) 58 | #define BLPAPI_DATETIME_TIMEFRACSECONDS_PART (BLPAPI_DATETIME_TIME_PART| \ 59 | BLPAPI_DATETIME_FRACSECONDS_PART) 60 | 61 | 62 | #define BLPAPI_EVENTTYPE_ADMIN 1 63 | #define BLPAPI_EVENTTYPE_SESSION_STATUS 2 64 | #define BLPAPI_EVENTTYPE_SUBSCRIPTION_STATUS 3 65 | #define BLPAPI_EVENTTYPE_REQUEST_STATUS 4 66 | #define BLPAPI_EVENTTYPE_RESPONSE 5 67 | #define BLPAPI_EVENTTYPE_PARTIAL_RESPONSE 6 68 | #define BLPAPI_EVENTTYPE_SUBSCRIPTION_DATA 8 69 | #define BLPAPI_EVENTTYPE_SERVICE_STATUS 9 70 | #define BLPAPI_EVENTTYPE_TIMEOUT 10 71 | #define BLPAPI_EVENTTYPE_AUTHORIZATION_STATUS 11 72 | #define BLPAPI_EVENTTYPE_RESOLUTION_STATUS 12 73 | #define BLPAPI_EVENTTYPE_TOPIC_STATUS 13 74 | #define BLPAPI_EVENTTYPE_TOKEN_STATUS 14 75 | #define BLPAPI_EVENTTYPE_REQUEST 15 76 | 77 | 78 | #define BLPAPI_ELEMENT_INDEX_END 0xffffffff 79 | 80 | #define BLPAPI_STATUS_ACTIVE 0 81 | #define BLPAPI_STATUS_DEPRECATED 1 82 | #define BLPAPI_STATUS_INACTIVE 2 83 | #define BLPAPI_STATUS_PENDING_DEPRECATION 3 84 | 85 | #define BLPAPI_SUBSCRIPTIONSTATUS_UNSUBSCRIBED 0 86 | #define BLPAPI_SUBSCRIPTIONSTATUS_SUBSCRIBING 1 87 | #define BLPAPI_SUBSCRIPTIONSTATUS_SUBSCRIBED 2 88 | #define BLPAPI_SUBSCRIPTIONSTATUS_CANCELLED 3 89 | #define BLPAPI_SUBSCRIPTIONSTATUS_PENDING_CANCELLATION 4 90 | 91 | #define BLPAPI_CLIENTMODE_AUTO 0 92 | #define BLPAPI_CLIENTMODE_DAPI 1 93 | #define BLPAPI_CLIENTMODE_SAPI 2 94 | #define BLPAPI_CLIENTMODE_COMPAT_33X 16 95 | 96 | #define BLPAPI_ELEMENTDEFINITION_UNBOUNDED -1 97 | 98 | #define BLPAPI_RESOLVEMODE_DONT_REGISTER_SERVICES 0 99 | #define BLPAPI_RESOLVEMODE_AUTO_REGISTER_SERVICES 1 100 | 101 | #define BLPAPI_SEATTYPE_INVALID_SEAT -1 102 | #define BLPAPI_SEATTYPE_BPS 0 103 | #define BLPAPI_SEATTYPE_NONBPS 1 104 | 105 | #define BLPAPI_SERVICEREGISTRATIONOPTIONS_PRIORITY_LOW 0 106 | #define BLPAPI_SERVICEREGISTRATIONOPTIONS_PRIORITY_MEDIUM INT_MAX/2 107 | #define BLPAPI_SERVICEREGISTRATIONOPTIONS_PRIORITY_HIGH INT_MAX 108 | 109 | #define BLPAPI_REGISTRATIONPARTS_DEFAULT 0x1 110 | #define BLPAPI_REGISTRATIONPARTS_PUBLISHING 0x2 111 | #define BLPAPI_REGISTRATIONPARTS_OPERATIONS 0x4 112 | #define BLPAPI_REGISTRATIONPARTS_SUBSCRIBER_RESOLUTION 0x8 113 | #define BLPAPI_REGISTRATIONPARTS_PUBLISHER_RESOLUTION 0x10 114 | 115 | #if defined(_WIN32) || defined(__WIN32__) && \ 116 | ! (defined(cygwin) || defined(__cygwin)) 117 | #ifdef BLPAPI_BUILD 118 | #define BLPAPI_EXPORT __declspec(dllexport) 119 | #else 120 | #define BLPAPI_EXPORT __declspec(dllimport) 121 | #endif 122 | #elif __APPLE__ 123 | #define BLPAPI_EXPORT __attribute__((visibility("default"))) 124 | #else 125 | #define BLPAPI_EXPORT 126 | #endif 127 | 128 | #endif // #ifndef INCLUDED_BLPAPI_DEFS 129 | -------------------------------------------------------------------------------- /deps/blpapi/include-3.8.1.1/blpapi_diagnosticsutil.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2013. Bloomberg Finance L.P. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: The above 9 | * copyright notice and this permission notice shall be included in all copies 10 | * or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 18 | * IN THE SOFTWARE. 19 | */ 20 | // blpapi_diagnosticsutil.h -*-C++-*- 21 | #ifndef INCLUDED_BLPAPI_DIAGNOSTICSUTIL 22 | #define INCLUDED_BLPAPI_DIAGNOSTICSUTIL 23 | 24 | //@PURPOSE: Provide api to access diagnostics information on the blpapi library 25 | // 26 | //@CLASSES: 27 | // blpapi::DiagnosticsUtil: collection of diagnostics information functions 28 | // 29 | //@DESCRIPTION: This component provide a collection of functions which give 30 | // access to various sets of diagnostics information on the 'blpapi' library. 31 | 32 | 33 | #ifndef INCLUDED_BLPAPI_CALL 34 | #include 35 | #endif 36 | 37 | #ifndef INCLUDED_BLPAPI_DEFS 38 | #include 39 | #endif 40 | 41 | #ifndef INCLUDED_STDDEF 42 | #include 43 | #define INCLUDED_STDDEF 44 | #endif 45 | 46 | #ifdef __cplusplus 47 | extern "C" { 48 | #endif 49 | 50 | BLPAPI_EXPORT 51 | int blpapi_DiagnosticsUtil_memoryInfo(char *buffer, 52 | size_t bufferLength); 53 | 54 | #ifdef __cplusplus 55 | } 56 | 57 | namespace BloombergLP { 58 | namespace blpapi { 59 | // ===================== 60 | // class DiagnosticsUtil 61 | // ===================== 62 | 63 | class DiagnosticsUtil { 64 | public: 65 | static int memoryInfo(char *buffer, 66 | size_t bufferLength); 67 | // Load into the specified 'buffer' up to the specified 'bufferLength' 68 | // characters of a null-terminated string describing the 'blpapi' 69 | // library's memory usage; the format of the string is 70 | // platform-specific. On success, return the number of characters 71 | // required to output the entire string, not including the null 72 | // terminator; otherwise return a negative value. Note that if the 73 | // value returned from this function is greater than or equal to 74 | // 'bufferLength' then the output is truncated and is *not* 75 | // null-terminated. 76 | }; 77 | 78 | 79 | // --------------------- 80 | // class DiagnosticsUtil 81 | // --------------------- 82 | 83 | inline 84 | int DiagnosticsUtil::memoryInfo(char *buffer, 85 | size_t bufferLength) 86 | { 87 | BLPAPI_CALL_DIAGNOSTICSUTIL_MEMORYINFO(buffer, bufferLength); 88 | } 89 | 90 | } 91 | } 92 | 93 | #endif 94 | 95 | #endif 96 | -------------------------------------------------------------------------------- /deps/blpapi/include-3.8.1.1/blpapi_dispatchtbl.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2012. Bloomberg Finance L.P. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: The above 9 | * copyright notice and this permission notice shall be included in all copies 10 | * or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 18 | * IN THE SOFTWARE. 19 | */ 20 | // blpapi_dispatchtbl.h -*-C++-*- 21 | #ifndef INCLUDED_BLPAPI_DISPATCHTBL 22 | #define INCLUDED_BLPAPI_DISPATCHTBL 23 | 24 | //@PURPOSE: Work with dispatch table 25 | // 26 | //@DESCRIPTION: This provides dispatch table for extended exported functions. 27 | // These functions are called through dispatch table based on preprocessors. It 28 | // avoids direct call of these functions by applications. So when blpapi DLL 29 | // is rolled back to the previous versions, blpapi DLL still can be loaded. 30 | 31 | // We only support dispatchtbl on windows currently 32 | #if defined(_WIN32) || defined(__WIN32__) 33 | 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | #ifdef __cplusplus 42 | 43 | #ifndef BLPAPI_MIN_VERSION 44 | #define BLPAPI_MIN_VERSION BLPAPI_SDK_VERSION 45 | #endif 46 | 47 | #ifndef BLPAPI_TARGET_VERSION 48 | #define BLPAPI_TARGET_VERSION BLPAPI_SDK_VERSION 49 | #endif 50 | 51 | #if BLPAPI_MIN_VERSION > BLPAPI_TARGET_VERSION 52 | #error "Min required version cannot be greater than target version" 53 | #endif 54 | 55 | extern "C" { 56 | 57 | // Forward declarations 58 | struct blpapi_EventFormatter; 59 | typedef struct blpapi_EventFormatter blpapi_EventFormat_t; 60 | 61 | struct blpapi_Topic; 62 | typedef struct blpapi_Topic blpapi_Topic_t; 63 | 64 | struct blpapi_Message; 65 | typedef struct blpapi_Message blpapi_Message_t; 66 | 67 | struct blpapi_Request; 68 | typedef struct blpapi_Request blpapi_Request_t; 69 | 70 | struct blpapi_HighPrecisionDatetime_tag; 71 | typedef struct blpapi_HighPrecisionDatetime_tag blpapi_HighPrecisionDatetime_t; 72 | 73 | struct blpapi_TimePoint; 74 | typedef struct blpapi_TimePoint blpapi_TimePoint_t; 75 | 76 | struct blpapi_SubscriptionList; 77 | typedef struct blpapi_SubscriptionList blpapi_SubscriptionList_t; 78 | 79 | struct blpapi_ServiceRegistrationOptions; 80 | typedef struct blpapi_ServiceRegistrationOptions 81 | blpapi_ServiceRegistrationOptions_t; 82 | 83 | // End Forward declarations 84 | 85 | // Function dispatch table declaration 86 | typedef struct blpapi_FunctionEntries { 87 | int (*blpapi_EventFormatter_appendMessageSeq)( 88 | blpapi_EventFormatter_t* formatter, 89 | char const* typeString, 90 | blpapi_Name_t* typeName, 91 | const blpapi_Topic_t* topic, 92 | unsigned int sequenceNumber, 93 | unsigned int); 94 | int (*blpapi_EventFormatter_appendRecapMessageSeq)( 95 | blpapi_EventFormatter_t* formatter, 96 | const blpapi_Topic_t *topic, 97 | const blpapi_CorrelationId_t *cid, 98 | unsigned int sequenceNumber, 99 | unsigned int); 100 | int (*blpapi_Message_addRef)( 101 | const blpapi_Message_t* message); 102 | int (*blpapi_Message_release)( 103 | const blpapi_Message_t* message); 104 | void (*blpapi_SessionOptions_setMaxEventQueueSize)( 105 | blpapi_SessionOptions_t *parameters, 106 | size_t maxEventQueueSize); 107 | int (*blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark)( 108 | blpapi_SessionOptions_t *parameters, 109 | float hiWaterMark); 110 | int (*blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark)( 111 | blpapi_SessionOptions_t *parameters, 112 | float loWaterMark); 113 | void (*blpapi_Request_setPreferredRoute)( 114 | blpapi_Request_t *request, 115 | blpapi_CorrelationId_t *correlationId); 116 | int (*blpapi_Message_fragmentType)( 117 | const blpapi_Message_t *message); 118 | size_t (*blpapi_SessionOptions_maxEventQueueSize)( 119 | blpapi_SessionOptions_t *parameters); 120 | float (*blpapi_SessionOptions_slowConsumerWarningHiWaterMark)( 121 | blpapi_SessionOptions_t *parameters); 122 | float (*blpapi_SessionOptions_slowConsumerWarningLoWaterMark)( 123 | blpapi_SessionOptions_t *parameters); 124 | int (*blpapi_SessionOptions_setDefaultKeepAliveInactivityTime)( 125 | blpapi_SessionOptions_t *parameters, 126 | int inactivityTime); 127 | int (*blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout)( 128 | blpapi_SessionOptions_t *parameters, 129 | int responseTimeout); 130 | int (*blpapi_SessionOptions_defaultKeepAliveInactivityTime)( 131 | blpapi_SessionOptions_t *parameters); 132 | int (*blpapi_SessionOptions_defaultKeepAliveResponseTimeout)( 133 | blpapi_SessionOptions_t *parameters); 134 | int (*blpapi_HighPrecisionDatetime_compare)( 135 | const blpapi_HighPrecisionDatetime_t*, 136 | const blpapi_HighPrecisionDatetime_t*); 137 | int (*blpapi_HighPrecisionDatetime_print)( 138 | const blpapi_HighPrecisionDatetime_t*, 139 | blpapi_StreamWriter_t, 140 | void*, 141 | int, 142 | int); 143 | int (*blpapi_Element_getValueAsHighPrecisionDatetime)( 144 | const blpapi_Element_t*, 145 | blpapi_HighPrecisionDatetime_t*, 146 | size_t); 147 | int (*blpapi_Element_setValueHighPrecisionDatetime)( 148 | blpapi_Element_t*, 149 | const blpapi_HighPrecisionDatetime_t*, 150 | size_t); 151 | int (*blpapi_Element_setElementHighPrecisionDatetime)( 152 | blpapi_Element_t*, 153 | const char*, 154 | const blpapi_Name_t*, 155 | const blpapi_HighPrecisionDatetime_t*); 156 | int (*blpapi_Session_resubscribeWithId)( 157 | blpapi_Session_t*, 158 | const blpapi_SubscriptionList_t*, 159 | int, 160 | const char*, 161 | int); 162 | int (*blpapi_EventFormatter_setValueNull)( 163 | blpapi_EventFormatter_t *, 164 | const char *, 165 | const blpapi_Name_t *); 166 | int (*blpapi_DiagnosticsUtil_memoryInfo)( 167 | char *, 168 | size_t); 169 | int (*blpapi_SessionOptions_setKeepAliveEnabled)( 170 | blpapi_SessionOptions_t *, 171 | int); 172 | int (*blpapi_SessionOptions_keepAliveEnabled)( 173 | blpapi_SessionOptions_t *); 174 | int (*blpapi_SubscriptionList_addResolved)( 175 | blpapi_SubscriptionList_t *, 176 | const char *, 177 | const blpapi_CorrelationId_t *); 178 | int (*blpapi_SubscriptionList_isResolvedAt)( 179 | blpapi_SubscriptionList_t *, 180 | int *, 181 | size_t); 182 | int (*blpapi_ProviderSession_deregisterService)( 183 | blpapi_ProviderSession_t *session, 184 | const char* serviceName); 185 | void (*blpapi_ServiceRegistrationOptions_setPartsToRegister)( 186 | blpapi_ServiceRegistrationOptions_t *session, 187 | int parts); 188 | int (*blpapi_ServiceRegistrationOptions_getPartsToRegister)( 189 | blpapi_ServiceRegistrationOptions_t *session); 190 | int (*blpapi_ProviderSession_deleteTopics)( 191 | blpapi_ProviderSession_t* session, 192 | const blpapi_Topic_t** topics, 193 | size_t numTopics); 194 | int (*blpapi_ProviderSession_activateSubServiceCodeRange)( 195 | blpapi_ProviderSession_t *session, 196 | const char* serviceName, 197 | int begin, 198 | int end, 199 | int priority); 200 | int (*blpapi_ProviderSession_deactivateSubServiceCodeRange)( 201 | blpapi_ProviderSession_t *session, 202 | const char* serviceName, 203 | int begin, 204 | int end); 205 | int (*blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange)( 206 | blpapi_ServiceRegistrationOptions_t *parameters, 207 | int start, 208 | int end, 209 | int priority); 210 | void 211 | (*blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges)( 212 | blpapi_ServiceRegistrationOptions_t *parameters); 213 | void (*blpapi_Logging_logTestMessage)( 214 | blpapi_Logging_Severity_t severity); 215 | const char *(*blpapi_getVersionIdentifier)(); 216 | int (*blpapi_Message_timeReceived)( 217 | const blpapi_Message_t *message, 218 | blpapi_TimePoint_t *timeReceived); 219 | int (*blpapi_SessionOptions_recordSubscriptionDataReceiveTimes)( 220 | blpapi_SessionOptions_t *parameters); 221 | void (*blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes)( 222 | blpapi_SessionOptions_t *parameters, 223 | int shouldRecord); 224 | long long (*blpapi_TimePointUtil_nanosecondsBetween)( 225 | const blpapi_TimePoint_t *start, 226 | const blpapi_TimePoint_t *end); 227 | int (*blpapi_HighResolutionClock_now)( 228 | blpapi_TimePoint_t *timePoint); 229 | int (*blpapi_HighPrecisionDatetime_fromTimePoint)( 230 | blpapi_HighPrecisionDatetime_t *datetime, 231 | const blpapi_TimePoint_t *timePoint, 232 | short offset); 233 | 234 | } blpapi_FunctionEntries_t; 235 | 236 | BLPAPI_EXPORT extern size_t g_blpapiFunctionTableSize; 237 | BLPAPI_EXPORT extern blpapi_FunctionEntries_t g_blpapiFunctionEntries; 238 | 239 | } // extern "C" 240 | 241 | #endif // __cplusplus 242 | 243 | #endif // if defined(_WIN32) || defined(__WIN32__) 244 | 245 | #endif // INCLUDED_BLPAPI_DISPATCHTBL 246 | -------------------------------------------------------------------------------- /deps/blpapi/include-3.8.1.1/blpapi_error.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2012. Bloomberg Finance L.P. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: The above 9 | * copyright notice and this permission notice shall be included in all copies 10 | * or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 18 | * IN THE SOFTWARE. 19 | */ 20 | // blpapi_error.h -*-C++-*- 21 | #ifndef INCLUDED_BLPAPI_ERROR 22 | #define INCLUDED_BLPAPI_ERROR 23 | 24 | //@PURPOSE: Provide a collection of errors that library can return 25 | // 26 | //@DESCRIPTION: This component provides a collection of preprocessor macros 27 | // that define the errors that library can generate. 28 | 29 | #ifndef INCLUDED_BLPAPI_DEFS 30 | #include 31 | #endif 32 | 33 | #define BLPAPI_RESULTCODE(res) ((res) & 0xffff) 34 | #define BLPAPI_RESULTCLASS(res) ((res) & 0xff0000) 35 | 36 | #define BLPAPI_UNKNOWN_CLASS 0x00000 37 | #define BLPAPI_INVALIDSTATE_CLASS 0x10000 38 | #define BLPAPI_INVALIDARG_CLASS 0x20000 39 | #define BLPAPI_IOERROR_CLASS 0x30000 40 | #define BLPAPI_CNVERROR_CLASS 0x40000 41 | #define BLPAPI_BOUNDSERROR_CLASS 0x50000 42 | #define BLPAPI_NOTFOUND_CLASS 0x60000 43 | #define BLPAPI_FLDNOTFOUND_CLASS 0x70000 44 | #define BLPAPI_UNSUPPORTED_CLASS 0x80000 45 | 46 | #define BLPAPI_ERROR_UNKNOWN (BLPAPI_UNKNOWN_CLASS | 1) 47 | #define BLPAPI_ERROR_ILLEGAL_ARG (BLPAPI_INVALIDARG_CLASS | 2) 48 | #define BLPAPI_ERROR_ILLEGAL_ACCESS (BLPAPI_UNKNOWN_CLASS | 3) 49 | #define BLPAPI_ERROR_INVALID_SESSION (BLPAPI_INVALIDARG_CLASS | 4) 50 | #define BLPAPI_ERROR_DUPLICATE_CORRELATIONID (BLPAPI_INVALIDARG_CLASS | 5) 51 | #define BLPAPI_ERROR_INTERNAL_ERROR (BLPAPI_UNKNOWN_CLASS | 6) 52 | #define BLPAPI_ERROR_RESOLVE_FAILED (BLPAPI_IOERROR_CLASS | 7) 53 | #define BLPAPI_ERROR_CONNECT_FAILED (BLPAPI_IOERROR_CLASS | 8) 54 | #define BLPAPI_ERROR_ILLEGAL_STATE (BLPAPI_INVALIDSTATE_CLASS| 9) 55 | #define BLPAPI_ERROR_CODEC_FAILURE (BLPAPI_UNKNOWN_CLASS | 10) 56 | #define BLPAPI_ERROR_INDEX_OUT_OF_RANGE (BLPAPI_BOUNDSERROR_CLASS | 11) 57 | #define BLPAPI_ERROR_INVALID_CONVERSION (BLPAPI_CNVERROR_CLASS | 12) 58 | #define BLPAPI_ERROR_ITEM_NOT_FOUND (BLPAPI_NOTFOUND_CLASS | 13) 59 | #define BLPAPI_ERROR_IO_ERROR (BLPAPI_IOERROR_CLASS | 14) 60 | #define BLPAPI_ERROR_CORRELATION_NOT_FOUND (BLPAPI_NOTFOUND_CLASS | 15) 61 | #define BLPAPI_ERROR_SERVICE_NOT_FOUND (BLPAPI_NOTFOUND_CLASS | 16) 62 | #define BLPAPI_ERROR_LOGON_LOOKUP_FAILED (BLPAPI_UNKNOWN_CLASS | 17) 63 | #define BLPAPI_ERROR_DS_LOOKUP_FAILED (BLPAPI_UNKNOWN_CLASS | 18) 64 | #define BLPAPI_ERROR_UNSUPPORTED_OPERATION (BLPAPI_UNSUPPORTED_CLASS | 19) 65 | #define BLPAPI_ERROR_DS_PROPERTY_NOT_FOUND (BLPAPI_NOTFOUND_CLASS | 20) 66 | 67 | #ifdef __cplusplus 68 | extern "C" { 69 | #endif 70 | 71 | BLPAPI_EXPORT 72 | const char* blpapi_getLastErrorDescription(int resultCode); 73 | 74 | #ifdef __cplusplus 75 | } 76 | 77 | namespace BloombergLP { 78 | namespace blpapi { 79 | 80 | } // close namespace blpapi 81 | } // close namespace BloombergLP 82 | 83 | #endif 84 | 85 | 86 | #endif // #ifndef INCLUDED_BLPAPI_ERROR 87 | -------------------------------------------------------------------------------- /deps/blpapi/include-3.8.1.1/blpapi_eventdispatcher.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2012. Bloomberg Finance L.P. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: The above 9 | * copyright notice and this permission notice shall be included in all copies 10 | * or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 18 | * IN THE SOFTWARE. 19 | */ 20 | // blpapi_eventdispatcher.h -*-C++-*- 21 | #ifndef INCLUDED_BLPAPI_EVENTDISPATCHER 22 | #define INCLUDED_BLPAPI_EVENTDISPATCHER 23 | 24 | //@PURPOSE: Provide a dispatcher to dispatch events. 25 | // 26 | //@CLASSES: 27 | // blpapi::EventDispatcher: Dispatches events from one or more Sessions through 28 | // callbacks 29 | // 30 | //@DESCRIPTION: This component implements a dispatcher to dispatch events from 31 | // one or more 'Session' through callbacks. 32 | 33 | #ifndef INCLUDED_BLPAPI_DEFS 34 | #include 35 | #endif 36 | 37 | #ifndef INCLUDED_BLPAPI_TYPES 38 | #include 39 | #endif 40 | 41 | #include // for size_t 42 | 43 | #ifdef __cplusplus 44 | extern "C" { 45 | #endif 46 | 47 | BLPAPI_EXPORT 48 | blpapi_EventDispatcher_t* blpapi_EventDispatcher_create( 49 | size_t numDispatcherThreads); 50 | 51 | BLPAPI_EXPORT 52 | void blpapi_EventDispatcher_destroy(blpapi_EventDispatcher_t *handle); 53 | 54 | BLPAPI_EXPORT 55 | int blpapi_EventDispatcher_start(blpapi_EventDispatcher_t *handle); 56 | 57 | BLPAPI_EXPORT 58 | int blpapi_EventDispatcher_stop(blpapi_EventDispatcher_t *handle, 59 | int async); 60 | 61 | BLPAPI_EXPORT 62 | int blpapi_EventDispatcher_dispatchEvents(blpapi_EventDispatcher_t *handle); 63 | 64 | #ifdef __cplusplus 65 | } // extern "C" 66 | 67 | namespace BloombergLP { 68 | namespace blpapi { 69 | // ===================== 70 | // class EventDispatcher 71 | // ===================== 72 | 73 | class EventDispatcher { 74 | // Dispatches events from one or more Sessions through callbacks 75 | // 76 | // EventDispatcher objects are optionally specified when Session 77 | // objects are constructed. A single EventDispatcher can be shared 78 | // by multiple Session objects. 79 | // 80 | // The EventDispatcher provides an event-driven interface, 81 | // generating callbacks from one or more internal threads for one 82 | // or more sessions. 83 | 84 | blpapi_EventDispatcher_t *d_impl_p; 85 | 86 | private: 87 | // NOT IMPLEMENTED 88 | EventDispatcher(const EventDispatcher&); 89 | EventDispatcher &operator=(const EventDispatcher&); 90 | 91 | public: 92 | EventDispatcher(size_t numDispatcherThreads = 1); 93 | // Construct an EventDispatcher with the specified 94 | // 'numDispatcherThreads'. If 'numDispatcherThreads' is 1 (the 95 | // default) then a single internal thread is created to 96 | // dispatch events. If 'numDispatcherThreads' is greater than 97 | // 1 then an internal pool of 'numDispatcherThreads' threads 98 | // is created to dispatch events. The behavior is undefined 99 | // if 'numDispatcherThreads' is 0. 100 | 101 | ~EventDispatcher(); 102 | // Destructor. 103 | 104 | int start(); 105 | // Start generating callbacks for events from sessions 106 | // associated with this EventDispatcher. Return 0 on success 107 | // and a non zero value otherwise. 108 | 109 | int stop(bool async = false); 110 | // Shutdown this event dispatcher object and stop generating 111 | // callbacks for events from sessions associated with it. 112 | // If the specified 'async' is false (the default) then this 113 | // method blocks until all current callbacks which were dispatched 114 | // through this EventDispatcher have completed. 115 | // Return 0 on success and a non zero value otherwise. 116 | // 117 | // Note: Calling stop with 'async' of false from within a callback 118 | // dispatched by this EventDispatcher is undefined and may result 119 | // in a deadlock. 120 | 121 | blpapi_EventDispatcher_t *impl() const; 122 | // Returns the internal implementation. 123 | }; 124 | 125 | // ============================================================================ 126 | // INLINE AND TEMPLATE FUNCTION IMPLEMENTATIONS 127 | // ============================================================================ 128 | 129 | // --------------------- 130 | // class EventDispatcher 131 | // --------------------- 132 | 133 | 134 | inline 135 | EventDispatcher::EventDispatcher(size_t numDispatcherThreads) 136 | : d_impl_p(blpapi_EventDispatcher_create(numDispatcherThreads)) 137 | { 138 | } 139 | 140 | inline 141 | EventDispatcher::~EventDispatcher() 142 | { 143 | blpapi_EventDispatcher_destroy(d_impl_p); 144 | } 145 | 146 | inline 147 | int EventDispatcher::start() 148 | { 149 | return blpapi_EventDispatcher_start(d_impl_p); 150 | } 151 | 152 | inline 153 | int EventDispatcher::stop(bool async) 154 | { 155 | return blpapi_EventDispatcher_stop(d_impl_p, async); 156 | } 157 | 158 | inline 159 | blpapi_EventDispatcher_t *EventDispatcher::impl() const 160 | { 161 | return d_impl_p; 162 | } 163 | 164 | 165 | } // close namespace blpapi 166 | } // close namespace BloombergLP 167 | 168 | #endif // ifdef __cplusplus 169 | 170 | #endif // #ifndef INCLUDED_BLPAPI_EVENTDISPATCHER 171 | -------------------------------------------------------------------------------- /deps/blpapi/include-3.8.1.1/blpapi_highresolutionclock.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2012. Bloomberg Finance L.P. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: The above 9 | * copyright notice and this permission notice shall be included in all copies 10 | * or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 18 | * IN THE SOFTWARE. 19 | */ 20 | // blpapi_clock.h -*-C++-*- 21 | #ifndef INCLUDED_BLPAPI_HIGHRESOLUTIONCLOCK 22 | #define INCLUDED_BLPAPI_HIGHRESOLUTIONCLOCK 23 | //@PURPOSE: Provide a high resolution clock. 24 | // 25 | //@CLASSES: 26 | // blpapi::HighResolutionClock: a high resolution clock 27 | // 28 | //@DESCRIPTION: This component provides a way to access the current time as a 29 | // 'blpapi::TimePoint' value. 30 | 31 | #ifndef INCLUDED_BLPAPI_CALL 32 | #include 33 | #endif 34 | 35 | #ifndef INCLUDED_BLPAPI_DEFS 36 | #include 37 | #endif 38 | 39 | #ifndef INCLUDED_BLPAPI_TIMEPOINT 40 | #include 41 | #endif 42 | 43 | #ifndef INCLUDED_BLPAPI_TYPES 44 | #include 45 | #endif 46 | 47 | #ifdef __cplusplus 48 | extern "C" { 49 | #endif 50 | 51 | BLPAPI_EXPORT 52 | int blpapi_HighResolutionClock_now(blpapi_TimePoint_t *timePoint); 53 | // Load the current time into the specified 'timePoint' and return zero, or 54 | // leave timePoint unchanged and return a non-zero value. 55 | #ifdef __cplusplus 56 | } 57 | 58 | namespace BloombergLP { 59 | namespace blpapi { 60 | // ========================== 61 | // struct HighResolutionClock 62 | // ========================== 63 | 64 | struct HighResolutionClock { 65 | // This utility struct provides a source for the current moment in time as 66 | // a 'blpapi::TimePoint' object. This is currently intended for use 67 | // primarily in conjunction with the 'blpapi::Message::timeReceived' 68 | // interfaces, to allow measurement of the amount of time a message spends 69 | // in the client event queue. 70 | 71 | static TimePoint now(); 72 | // Return the current moment in time as a 'TimePoint' value. 73 | }; 74 | 75 | // ============================================================================ 76 | // INLINE AND TEMPLATE FUNCTION IMPLEMENTATIONS 77 | // ============================================================================ 78 | 79 | // -------------------------- 80 | // struct HighResolutionClock 81 | // -------------------------- 82 | inline 83 | TimePoint HighResolutionClock::now() 84 | { 85 | TimePoint tp; 86 | BLPAPI_CALL_HIGHRESOLUTIONCLOCK_NOW(&tp); 87 | return tp; 88 | } 89 | 90 | } // close namespace blpapi 91 | } // close namespace BloombergLP 92 | 93 | #endif // #ifdef __cplusplus 94 | #endif // #ifndef INCLUDED_BLPAPI_HIGHRESOLUTIONCLOCK 95 | -------------------------------------------------------------------------------- /deps/blpapi/include-3.8.1.1/blpapi_logging.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2012. Bloomberg Finance L.P. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: The above 9 | * copyright notice and this permission notice shall be included in all copies 10 | * or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 18 | * IN THE SOFTWARE. 19 | */ 20 | // blpapi_logging.h -*-C++-*- 21 | #ifndef INCLUDED_BLPAPI_LOGGING 22 | #define INCLUDED_BLPAPI_LOGGING 23 | 24 | //@PURPOSE: Provide a C call to register a call back for logging 25 | // 26 | //@DESCRIPTION: This component provides a C function that is used to 27 | // register a callback for logging 28 | // 29 | ///Usage 30 | ///----- 31 | // To use the call back a function needs to be created with the same definition 32 | // of blpapi_Logging_Func_t. 33 | // The callback will be called for all the log messages that have severity 34 | // greater than or equal to the specified 'thresholdSeverity'. 35 | // A callback can be registered multiple number of times but only the last 36 | // registered callback will be used. 37 | // Registering with a 'NULL' callback will de-register the callback. 38 | //.. 39 | // extern "C" { 40 | // void myLoggerCallback(blpapi_UInt64_t threadId, 41 | // int severity, 42 | // blpapi_Datetime_t timestamp, 43 | // const char *category, 44 | // const char *message) 45 | // { 46 | // if (severity == blpapi_Logging_SEVERITY_FATAL) { 47 | // // Do some logic for abort here 48 | // } 49 | // std::cout << severity << "-->" << message << std::endl; 50 | // } 51 | //.. 52 | // This callback needs to be registered with the library as 53 | //.. 54 | // int main() { 55 | // // .... 56 | // blpapi_Logging_registerCallback(myLoggerCallback, 57 | // blpapi_Logging_SEVERITY_TRACE); 58 | // // .... 59 | // } 60 | //.. 61 | 62 | #ifndef INCLUDED_BLPAPI_CALL 63 | #include 64 | #endif 65 | 66 | #ifndef INCLUDED_BLPAPI_DATETIME 67 | #include 68 | #endif 69 | 70 | #ifndef INCLUDED_BLPAPI_DEFS 71 | #include 72 | #endif 73 | 74 | #ifdef __cplusplus 75 | extern "C" { 76 | #endif 77 | 78 | typedef void (*blpapi_Logging_Func_t)(blpapi_UInt64_t threadId, 79 | int severity, 80 | blpapi_Datetime_t timestamp, 81 | const char *category, 82 | const char *message); 83 | // Provide a type definition for the callback that will be called when a 84 | // message is logged. The specified 'threadId' is the id of the calling 85 | // thread. The specified 'severity' is the severity of the log message 86 | // whose value is defined by the type 'blpapi_Logging_Severity_t'. The 87 | // specified 'timestamp' is the date and time the message is logged. The 88 | // specified 'category' identifies the source of the logged message. The 89 | // specified 'message' is the actual log message text. 90 | 91 | BLPAPI_EXPORT 92 | int blpapi_Logging_registerCallback( 93 | blpapi_Logging_Func_t callback, 94 | blpapi_Logging_Severity_t thresholdSeverity); 95 | // Register the specified 'callback' that will be called for all log 96 | // messages with severity greater than or equal to the specified 97 | // 'thresholdSeverity'. The callback needs to be registered before the 98 | // start of all sessions. If this function is called multiple times, only 99 | // the last registered callback will take effect. 100 | // '0' is returned if callback is registered and a non-zero otherwise. 101 | 102 | BLPAPI_EXPORT 103 | void blpapi_Logging_logTestMessage(blpapi_Logging_Severity_t severity); 104 | // Log a test message at the specified 'severity'. Note that this 105 | // function is intended for testing of the logging configuration only. 106 | 107 | 108 | #ifdef __cplusplus 109 | } 110 | 111 | namespace BloombergLP { 112 | namespace blpapi { 113 | 114 | struct Logging { 115 | // This utility 'struct' provides a namespace for functions to test the 116 | // logging configuration. 117 | 118 | struct Severity { 119 | enum Type { 120 | // Enumeration used to specify different logging severity levels. 121 | 122 | e_off = blpapi_Logging_SEVERITY_OFF, 123 | e_fatal = blpapi_Logging_SEVERITY_FATAL, 124 | e_error = blpapi_Logging_SEVERITY_ERROR, 125 | e_warn = blpapi_Logging_SEVERITY_WARN, 126 | e_info = blpapi_Logging_SEVERITY_INFO, 127 | e_debug = blpapi_Logging_SEVERITY_DEBUG, 128 | e_trace = blpapi_Logging_SEVERITY_TRACE 129 | }; 130 | }; 131 | 132 | // CLASS METHODS 133 | static void logTestMessage(Severity::Type severity); 134 | // Log a test message with the specified 'severity'. Note that this 135 | // function is intended for testing of the logging configuration only. 136 | }; 137 | 138 | 139 | // ============================================================================ 140 | // INLINE FUNCTION DEFINITIONS 141 | // ============================================================================ 142 | 143 | // -------------- 144 | // struct Logging 145 | // -------------- 146 | 147 | // CLASS METHODS 148 | inline 149 | void Logging::logTestMessage(Severity::Type severity) 150 | { 151 | BLPAPI_CALL(blpapi_Logging_logTestMessage)( 152 | static_cast(severity)); 153 | } 154 | 155 | } // close namespace blpapi 156 | } // close namespace BloombergLP 157 | 158 | #endif 159 | 160 | #endif 161 | -------------------------------------------------------------------------------- /deps/blpapi/include-3.8.1.1/blpapi_streamproxy.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2012. Bloomberg Finance L.P. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: The above 9 | * copyright notice and this permission notice shall be included in all copies 10 | * or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 18 | * IN THE SOFTWARE. 19 | */ 20 | // blpapi_streamproxy.h -*-C++-*- 21 | #ifndef INCLUDED_BLPAPI_STREAMPROXY 22 | #define INCLUDED_BLPAPI_STREAMPROXY 23 | 24 | //@PURPOSE: A signature for callback on print and default C++ implementation 25 | // 26 | //@DESCRIPTION: 27 | // This file defines 'blpapi_StreamWriter_t' a function pointer type. 28 | // The user of the C API need to specify a callback of above type which will 29 | // be called on xxx_print(...) with the formatted data. For C++ API, a default 30 | // callback is specified which writes data to the stream specified in 31 | // xxx::print 32 | 33 | typedef int(*blpapi_StreamWriter_t)(const char* data, 34 | int length, 35 | void *stream); 36 | 37 | #ifdef __cplusplus 38 | 39 | #include 40 | 41 | namespace BloombergLP { 42 | namespace blpapi { 43 | 44 | static int OstreamWriter(const char* data, int length, void *stream) 45 | { 46 | reinterpret_cast(stream)->write(data, length); 47 | return 0; 48 | } 49 | 50 | } // close namespace blpapi 51 | } // close namespace BloombergLP 52 | 53 | #endif // #ifdef __cplusplus 54 | #endif // #ifndef INCLUDED_BLPAPI_STREAMPROXY 55 | -------------------------------------------------------------------------------- /deps/blpapi/include-3.8.1.1/blpapi_timepoint.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2012. Bloomberg Finance L.P. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: The above 9 | * copyright notice and this permission notice shall be included in all copies 10 | * or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 18 | * IN THE SOFTWARE. 19 | */ 20 | // blpapi_timepoint.h -*-C++-*- 21 | #ifndef INCLUDED_BLPAPI_TIMEPOINT 22 | #define INCLUDED_BLPAPI_TIMEPOINT 23 | //@PURPOSE: Provide a time point with respect to an epoch 24 | // 25 | //@CLASSES: 26 | // blpapi::TimePoint: a fixed moment in a linear model of time 27 | // blpapi::TimePointUtil: namespace for 'TimePoint' Utility functions 28 | // 29 | //@SEE_ALSO: blpapi_highresolutionclock, blpapi_datetime 30 | // 31 | //@DESCRIPTION: This component provides a representation of a fixed moment in 32 | // a strict linear model of time. A function to measure the distance between 33 | // two such moments is provided. Note that such a moment is not associated 34 | // with any particular calendar or wall-clock conventions---see 35 | // 'blpapi_datetime' for such representations (and for functions to apply such 36 | // conventions to an existing time point). 37 | 38 | #ifndef INCLUDED_BLPAPI_CALL 39 | #include 40 | #endif 41 | 42 | #ifndef INCLUDED_BLPAPI_DEFS 43 | #include 44 | #endif 45 | 46 | #ifndef INCLUDED_BLPAPI_TYPES 47 | #include 48 | #endif 49 | 50 | struct blpapi_TimePoint { 51 | // This struct provides an *in-core* *value* *semantic* type for 52 | // representing a single moment in time, assuming a simple linear model of 53 | // time. The precision of such representations is guaranteed to be at 54 | // least at the granularity of nanoseconds, but only times relatively near 55 | // (within a few years of) the current moment are guaranteed to be 56 | // representable. The actual implementation of a time point is 57 | // implementation-defined and opaque to client code; in particular, time 58 | // points can *not* be transferred between processes. (The SDK reserves 59 | // the right to alter the epoch used as a base from run to run.) Clients 60 | // wishing to persist time points should use the 61 | // 'TimePointUtil::nanosecondsBetween' function to measure distance from a 62 | // known epoch value, or convert the time point to some standard calendar 63 | // and wall-clock convention (e.g. 'blpapi::Datetime'). 64 | 65 | blpapi_Int64_t d_value; 66 | }; 67 | 68 | typedef struct blpapi_TimePoint blpapi_TimePoint_t; 69 | 70 | #ifdef __cplusplus 71 | extern "C" { 72 | #endif 73 | 74 | BLPAPI_EXPORT 75 | long long blpapi_TimePointUtil_nanosecondsBetween( 76 | const blpapi_TimePoint_t *start, 77 | const blpapi_TimePoint_t *end); 78 | // Return the difference between 'start' and 'end' 'TimePoint' objects. The 79 | // returned value is in nanoseconds representing 'end - start'. 80 | 81 | #ifdef __cplusplus 82 | } 83 | 84 | namespace BloombergLP { 85 | namespace blpapi { 86 | // ================ 87 | // struct TimePoint 88 | // ================ 89 | 90 | typedef blpapi_TimePoint_t TimePoint; 91 | 92 | // ==================== 93 | // struct TimePointUtil 94 | // ==================== 95 | struct TimePointUtil { 96 | // This provides a namespace for 'TimePoint' utility functions. 97 | 98 | static long long nanosecondsBetween(const TimePoint& start, 99 | const TimePoint& end); 100 | // Return the difference between 'start' and 'end' 'TimePoint' 101 | // objects. The returned value is in nanoseconds representing 102 | // 'end - start'. 103 | }; 104 | 105 | // ============================================================================ 106 | // INLINE AND TEMPLATE FUNCTION IMPLEMENTATIONS 107 | // ============================================================================ 108 | 109 | // -------------------- 110 | // struct TimePointUtil 111 | // -------------------- 112 | 113 | inline 114 | long long TimePointUtil::nanosecondsBetween(const TimePoint& start, 115 | const TimePoint& end) 116 | { 117 | return BLPAPI_CALL_TIMEPOINTUTIL_NANOSECONDSBETWEEN(&start, &end); 118 | } 119 | 120 | } // close namespace blpapi 121 | } // close namespace BloombergLP 122 | 123 | #endif // #ifdef __cplusplus 124 | #endif // #ifndef INCLUDED_BLPAPI_TIMEPOINT 125 | -------------------------------------------------------------------------------- /deps/blpapi/include-3.8.1.1/blpapi_topic.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2012. Bloomberg Finance L.P. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: The above 9 | * copyright notice and this permission notice shall be included in all copies 10 | * or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 18 | * IN THE SOFTWARE. 19 | */ 20 | // blpapi_topic.h -*-C++-*- 21 | #ifndef INCLUDED_BLPAPI_TOPIC 22 | #define INCLUDED_BLPAPI_TOPIC 23 | 24 | //@PURPOSE: Provide representation of a Topic 25 | // 26 | //@CLASSES: 27 | // blpapi::Topic: Represents a Topic 28 | // 29 | //@DESCRIPTION: This component provides a topic that is used for publishing 30 | // data on. 31 | 32 | #ifndef INCLUDED_BLPAPI_DEFS 33 | #include 34 | #endif 35 | 36 | #ifndef INCLUDED_BLPAPI_SERVICE 37 | #include 38 | #endif 39 | 40 | struct blpapi_Topic; 41 | typedef struct blpapi_Topic blpapi_Topic_t; 42 | 43 | #ifdef __cplusplus 44 | extern "C" { 45 | #endif 46 | 47 | BLPAPI_EXPORT 48 | blpapi_Topic_t* blpapi_Topic_create(blpapi_Topic_t* from); 49 | 50 | BLPAPI_EXPORT 51 | void blpapi_Topic_destroy(blpapi_Topic_t* victim); 52 | 53 | BLPAPI_EXPORT 54 | int blpapi_Topic_compare(const blpapi_Topic_t* lhs, const blpapi_Topic_t* rhs); 55 | 56 | BLPAPI_EXPORT 57 | blpapi_Service_t* blpapi_Topic_service(const blpapi_Topic_t *topic); 58 | 59 | BLPAPI_EXPORT 60 | int blpapi_Topic_isActive(const blpapi_Topic_t *topic); 61 | 62 | #ifdef __cplusplus 63 | } 64 | 65 | namespace BloombergLP { 66 | namespace blpapi { 67 | // =========== 68 | // class Topic 69 | // =========== 70 | 71 | class Topic { 72 | // Used to identify the stream on which a message is published. 73 | // 74 | // Topic objects are obtained from createTopic() on 75 | // ProviderSession. They are used when adding a message to an 76 | // Event for publishing using appendMessage() on EventFormatter. 77 | 78 | blpapi_Topic_t *d_handle; 79 | 80 | public: 81 | 82 | Topic(); 83 | // Create a Topic object. A Topic created from the default 84 | // constructor is not a valid topic and must be assigned to 85 | // from a valid topic before it can be used. 86 | 87 | Topic(blpapi_Topic_t* handle); 88 | // Create a Topic object from a handle (main constructor) 89 | 90 | Topic(const Topic& original); 91 | // Create a copy of the specified 'original' Topic. 92 | 93 | ~Topic(); 94 | // Destroy this Topic object. 95 | 96 | // MANIPULATORS 97 | 98 | Topic& operator=(const Topic& rhs); 99 | 100 | // ACCESSORS 101 | 102 | bool isValid() const; 103 | // Returns true if this Topic is valid and can be used to 104 | // publish a message on. 105 | 106 | bool isActive() const; 107 | // Returns true if this topic was elected by the platform to become 108 | // the primary publisher. 109 | 110 | Service service() const; 111 | // Returns the service for which this topic was created. 112 | 113 | const blpapi_Topic_t* impl() const; 114 | 115 | blpapi_Topic_t* impl(); 116 | }; 117 | 118 | bool operator==(Topic const& lhs, Topic const& rhs); 119 | 120 | bool operator!=(Topic const& lhs, Topic const& rhs); 121 | 122 | bool operator<(Topic const& lhs, Topic const& rhs); 123 | 124 | // ============================================================================ 125 | // INLINE FUNCTION DEFINITIONS 126 | // ============================================================================ 127 | 128 | // ----------- 129 | // class Topic 130 | // ----------- 131 | 132 | inline 133 | Topic::Topic() : 134 | d_handle(0) 135 | {} 136 | 137 | inline 138 | Topic::Topic(blpapi_Topic_t* handle) : 139 | d_handle(blpapi_Topic_create(handle)) 140 | {} 141 | 142 | inline 143 | Topic::Topic(Topic const& original) : 144 | d_handle(blpapi_Topic_create(original.d_handle)) 145 | { 146 | } 147 | 148 | inline 149 | Topic::~Topic() 150 | { 151 | blpapi_Topic_destroy(d_handle); 152 | } 153 | 154 | inline 155 | Topic& Topic::operator=(Topic const& rhs) 156 | { 157 | if (this != &rhs) { 158 | blpapi_Topic_destroy(d_handle); 159 | d_handle = blpapi_Topic_create(rhs.d_handle); 160 | } 161 | return *this; 162 | } 163 | 164 | inline 165 | bool Topic::isValid() const 166 | { 167 | return 0 != d_handle; 168 | } 169 | 170 | inline 171 | bool Topic::isActive() const 172 | { 173 | return blpapi_Topic_isActive(d_handle) != 0; 174 | } 175 | 176 | inline 177 | Service Topic::service() const 178 | { 179 | return blpapi_Topic_service(d_handle); 180 | } 181 | 182 | inline 183 | const blpapi_Topic_t* Topic::impl() const 184 | { 185 | return d_handle; 186 | } 187 | 188 | inline 189 | blpapi_Topic_t* Topic::impl() 190 | { 191 | return d_handle; 192 | } 193 | 194 | inline 195 | bool operator==(Topic const& lhs, Topic const& rhs) 196 | { 197 | return blpapi_Topic_compare(lhs.impl(), rhs.impl())==0; 198 | } 199 | 200 | inline 201 | bool operator!=(Topic const& lhs, Topic const& rhs) 202 | { 203 | return blpapi_Topic_compare(lhs.impl(), rhs.impl())!=0; 204 | } 205 | 206 | inline 207 | bool operator<(Topic const& lhs, Topic const& rhs) 208 | { 209 | return blpapi_Topic_compare(lhs.impl(), rhs.impl())<0; 210 | } 211 | 212 | 213 | } // close namespace blpapi 214 | } // close namespace BloombergLP 215 | 216 | #endif // #ifdef __cplusplus 217 | #endif // #ifndef INCLUDED_BLPAPI_TOPIC 218 | -------------------------------------------------------------------------------- /deps/blpapi/include-3.8.1.1/blpapi_types.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2012. Bloomberg Finance L.P. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: The above 9 | * copyright notice and this permission notice shall be included in all copies 10 | * or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 18 | * IN THE SOFTWARE. 19 | */ 20 | // blpapi_types.h -*-C++-*- 21 | #ifndef INCLUDED_BLPAPI_TYPES 22 | #define INCLUDED_BLPAPI_TYPES 23 | 24 | //@PURPOSE: Provide BLPAPI types. 25 | // 26 | //@CLASSES: 27 | // blpapi::DataType: Data types in the schema 28 | // 29 | //@DESCRIPTION: This component implements BLPAPI types. 30 | 31 | typedef int blpapi_Bool_t; 32 | typedef char blpapi_Char_t; 33 | typedef unsigned char blpapi_UChar_t; 34 | typedef short blpapi_Int16_t; 35 | typedef unsigned short blpapi_UInt16_t; 36 | typedef int blpapi_Int32_t; 37 | typedef unsigned int blpapi_UInt32_t; 38 | typedef long long blpapi_Int64_t; 39 | typedef unsigned long long blpapi_UInt64_t; 40 | typedef float blpapi_Float32_t; 41 | typedef double blpapi_Float64_t; 42 | 43 | 44 | enum blpapi_DataType_t { 45 | BLPAPI_DATATYPE_BOOL = 1 // Bool 46 | , BLPAPI_DATATYPE_CHAR = 2 // Char 47 | , BLPAPI_DATATYPE_BYTE = 3 // Unsigned 8 bit value 48 | , BLPAPI_DATATYPE_INT32 = 4 // 32 bit Integer 49 | , BLPAPI_DATATYPE_INT64 = 5 // 64 bit Integer 50 | , BLPAPI_DATATYPE_FLOAT32 = 6 // 32 bit Floating point - IEEE 51 | , BLPAPI_DATATYPE_FLOAT64 = 7 // 64 bit Floating point - IEEE 52 | , BLPAPI_DATATYPE_STRING = 8 // ASCIIZ string 53 | , BLPAPI_DATATYPE_BYTEARRAY = 9 // Opaque binary data 54 | , BLPAPI_DATATYPE_DATE = 10 // Date 55 | , BLPAPI_DATATYPE_TIME = 11 // Timestamp 56 | , BLPAPI_DATATYPE_DECIMAL = 12 // 57 | , BLPAPI_DATATYPE_DATETIME = 13 // Date and time 58 | , BLPAPI_DATATYPE_ENUMERATION = 14 // An opaque enumeration 59 | , BLPAPI_DATATYPE_SEQUENCE = 15 // Sequence type 60 | , BLPAPI_DATATYPE_CHOICE = 16 // Choice type 61 | , BLPAPI_DATATYPE_CORRELATION_ID = 17 // Used for some internal 62 | // messages 63 | }; 64 | 65 | typedef enum blpapi_Logging_Severity_t { 66 | blpapi_Logging_SEVERITY_OFF = 0, 67 | blpapi_Logging_SEVERITY_FATAL = 1, 68 | blpapi_Logging_SEVERITY_ERROR = 2, 69 | blpapi_Logging_SEVERITY_WARN = 3, 70 | blpapi_Logging_SEVERITY_INFO = 4, 71 | blpapi_Logging_SEVERITY_DEBUG = 5, 72 | blpapi_Logging_SEVERITY_TRACE = 6 73 | } blpapi_Logging_Severity_t; 74 | 75 | struct blpapi_AbstractSession; 76 | typedef struct blpapi_AbstractSession blpapi_AbstractSession_t; 77 | 78 | struct blpapi_Constant; 79 | typedef struct blpapi_Constant blpapi_Constant_t; 80 | 81 | struct blpapi_ConstantList; 82 | typedef struct blpapi_ConstantList blpapi_ConstantList_t; 83 | 84 | struct blpapi_Element; 85 | typedef struct blpapi_Element blpapi_Element_t; 86 | 87 | struct blpapi_Event; 88 | typedef struct blpapi_Event blpapi_Event_t; 89 | 90 | struct blpapi_EventDispatcher; 91 | typedef struct blpapi_EventDispatcher blpapi_EventDispatcher_t; 92 | 93 | struct blpapi_EventFormatter; 94 | typedef struct blpapi_EventFormatter blpapi_EventFormatter_t; 95 | 96 | struct blpapi_EventQueue; 97 | typedef struct blpapi_EventQueue blpapi_EventQueue_t; 98 | 99 | struct blpapi_MessageIterator; 100 | typedef struct blpapi_MessageIterator blpapi_MessageIterator_t; 101 | 102 | struct blpapi_Name; 103 | typedef struct blpapi_Name blpapi_Name_t; 104 | 105 | struct blpapi_Operation; 106 | typedef struct blpapi_Operation blpapi_Operation_t; 107 | 108 | struct blpapi_ProviderSession; 109 | typedef struct blpapi_ProviderSession blpapi_ProviderSession_t; 110 | 111 | struct blpapi_Service; 112 | typedef struct blpapi_Service blpapi_Service_t; 113 | 114 | struct blpapi_Session; 115 | typedef struct blpapi_Session blpapi_Session_t; 116 | 117 | struct blpapi_SessionOptions; 118 | typedef struct blpapi_SessionOptions blpapi_SessionOptions_t; 119 | 120 | struct blpapi_SubscriptionItrerator; 121 | typedef struct blpapi_SubscriptionItrerator blpapi_SubscriptionIterator_t; 122 | 123 | struct blpapi_Identity; 124 | typedef struct blpapi_Identity blpapi_UserHandle; 125 | typedef struct blpapi_Identity blpapi_UserHandle_t; 126 | 127 | struct blpapi_Identity; 128 | typedef struct blpapi_Identity blpapi_Identity_t; 129 | 130 | #ifdef __cplusplus 131 | 132 | namespace BloombergLP { 133 | namespace blpapi { 134 | // =============== 135 | // struct DataType 136 | // =============== 137 | 138 | struct DataType { 139 | // Contains the possible data types which can be represented in an 140 | // Element. 141 | 142 | public: 143 | enum Value { 144 | // The possible data types which can be represented in an Element. 145 | BOOL = BLPAPI_DATATYPE_BOOL, // Boolean 146 | CHAR = BLPAPI_DATATYPE_CHAR, // Char 147 | BYTE = BLPAPI_DATATYPE_BYTE, // Unsigned 8 bit value 148 | INT32 = BLPAPI_DATATYPE_INT32, // 32 bit Integer 149 | INT64 = BLPAPI_DATATYPE_INT64, // 64 bit Integer 150 | FLOAT32 = BLPAPI_DATATYPE_FLOAT32, // 32 bit Floating point 151 | FLOAT64 = BLPAPI_DATATYPE_FLOAT64, // 64 bit Floating point 152 | STRING = BLPAPI_DATATYPE_STRING, // ASCIIZ string 153 | BYTEARRAY = BLPAPI_DATATYPE_BYTEARRAY, // Opaque binary data 154 | DATE = BLPAPI_DATATYPE_DATE, // Date 155 | TIME = BLPAPI_DATATYPE_TIME, // Timestamp 156 | DECIMAL = BLPAPI_DATATYPE_DECIMAL, // Currently Unsupported 157 | DATETIME = BLPAPI_DATATYPE_DATETIME, // Date and time 158 | ENUMERATION = BLPAPI_DATATYPE_ENUMERATION, // An opaque enumeration 159 | SEQUENCE = BLPAPI_DATATYPE_SEQUENCE, // Sequence type 160 | CHOICE = BLPAPI_DATATYPE_CHOICE, // Choice type 161 | CORRELATION_ID = BLPAPI_DATATYPE_CORRELATION_ID // Used for some 162 | // internal messages 163 | }; 164 | }; 165 | 166 | typedef blpapi_Bool_t Bool; 167 | typedef blpapi_Char_t Char; 168 | typedef blpapi_UChar_t UChar; 169 | typedef blpapi_Int16_t Int16; 170 | typedef blpapi_UInt16_t UInt16; 171 | typedef blpapi_Int32_t Int32; 172 | typedef blpapi_UInt32_t UInt32; 173 | typedef blpapi_Int64_t Int64; 174 | typedef blpapi_UInt64_t UInt64; 175 | typedef blpapi_Float32_t Float32; 176 | typedef blpapi_Float64_t Float64; 177 | 178 | } // close namespace blpapi 179 | } // close namespace BloombergLP 180 | 181 | #endif // ifdef __cplusplus 182 | 183 | #endif // #ifndef INCLUDED_BLPAPI_TYPES 184 | -------------------------------------------------------------------------------- /deps/blpapi/include-3.8.1.1/blpapi_versioninfo.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2012. Bloomberg Finance L.P. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: The above 9 | * copyright notice and this permission notice shall be included in all copies 10 | * or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 18 | * IN THE SOFTWARE. 19 | */ 20 | // blpapi_versioninfo.h -*-C++-*- 21 | #ifndef INCLUDED_BLPAPI_VERSIONINFO 22 | #define INCLUDED_BLPAPI_VERSIONINFO 23 | 24 | //@PURPOSE: Provide BLPAPI SDK library version information. 25 | // 26 | //@CLASSES: 27 | // blpapi::VersionInfo: basic BLPAPI SDK library version attribute class 28 | // 29 | //@DESCRIPTION: This component provides access the BLPAPI SDK library version 30 | // information. Each version of the BLPAPI library is identified by four 31 | // integers: major, minor, patch, and build. 32 | // 33 | // The current major version is 3; there is no guarantee of compatibility 34 | // between different major versions. 35 | // 36 | // Differences in minor version numbers indicate significant feature additions. 37 | // Standard distributions of the BLPAPI have minor version numbers below 128, 38 | // and higher minor numbers are expected to provide APIs that are a superset of 39 | // the APIs provided by lower minor version numbers; i.e. all functionality and 40 | // interfaces supported by BLPAPI 3.7 is also provided by BLPAPI 3.8, while the 41 | // inverse is not typically true. (Bloomberg occasionally distributes library 42 | // versions with version numbers above 127; consult the release information 43 | // distributed with these libraries to determine interoperability with other 44 | // minor versions.) 45 | // 46 | // Increments to patch numbers indicate performance or stability enhancements 47 | // to the library. 48 | // 49 | // Build numbers typically do not carry any information about the library 50 | // version's functionality, but can be used along with the other parts of the 51 | // build number to uniquely identity a precise library binary version (e.g. for 52 | // the purpose of code signing and auditing). 53 | // 54 | ///Usage 55 | ///----- 56 | ///C++ usage 57 | ///- - - - - 58 | // This example logs the BLPAPI version in order to make the logs analysis more 59 | // productive: 60 | //.. 61 | // blpapi::VersionInfo blpapiVersion; 62 | // // Client log the library version for reference and future debugging 63 | // log("BLPAPI version: %d.%d.%d.%d", 64 | // blpapiVersion.majorVersion(), 65 | // blpapiVersion.minorVersion(), 66 | // blpapiVersion.patchVersion(), 67 | // blpapiVersion.buildVersion()); 68 | //.. 69 | // 70 | ///C usage 71 | ///- - - - 72 | // This example logs the BLPAPI version in order to make the logs analysis more 73 | // productive: 74 | //.. 75 | // int majorVersion, minorVersion, patchVersion, buildVersion; 76 | // blpapi_getVersionInfo(&majorVersion, &minorVersion, &patchVersion, 77 | // &buildVersion); 78 | // // Client log the library version for reference and future debugging 79 | // log("BLPAPI version: %d.%d.%d.%d", majorVersion, minorVersion, 80 | // patchVersion, buildVersion); 81 | //.. 82 | // 83 | // 84 | // This example provide shows how to use the backward API signature 85 | // compatibility macros BLPAPI_SDK_VERSION and BLPAPI_MAKE_VERSION (see 86 | // blpapi_dispatchtbl.h): 87 | //.. 88 | // #if BLPAPI_SDK_VERSION >= BLPAPI_MAKE_VERSION(3, 3, 7) 89 | // // Do version 3.3.7 specific stuff here (e.g. adding functions with old 90 | // // signature to an array so a client code that was compiled with 91 | // // version 3.3.7 will still be able to run using the new version. 92 | // ... 93 | // #elif BLPAPI_SDK_VERSION ... 94 | //.. 95 | 96 | #ifndef INCLUDED_BLPAPI_CALL 97 | #include 98 | #endif 99 | 100 | #ifndef INCLUDED_BLPAPI_DEFS 101 | #include 102 | #endif 103 | 104 | #ifndef INCLUDED_BLPAPI_VERSIONMACROS 105 | #include 106 | #endif 107 | 108 | #include 109 | #include 110 | #include 111 | 112 | #ifdef __cplusplus 113 | extern "C" { 114 | #endif // ifdef __cplusplus 115 | 116 | BLPAPI_EXPORT 117 | void blpapi_getVersionInfo(int *majorVersion, 118 | int *minorVersion, 119 | int *patchVersion, 120 | int *buildVersion); 121 | // Initialize the 4 parameters with the current release version information 122 | // which include the following version parts: Major, Minor, Patch, and 123 | // Build. 124 | 125 | BLPAPI_EXPORT 126 | const char *blpapi_getVersionIdentifier(); 127 | // Return a null-terminated sequence of printable ascii characters (with 128 | // values from 0x20 to 0x7e, inclusive) identifying the version of the 129 | // blpapi runtime library. The lifetime of the returned string is 130 | // guaranteed until the end of `main()` (but is *not* necessarily usable 131 | // during the C++ static destruction phase). 132 | 133 | #ifdef __cplusplus 134 | } 135 | 136 | namespace BloombergLP { 137 | 138 | namespace blpapi { 139 | // ================= 140 | // class VersionInfo 141 | // ================= 142 | class VersionInfo { 143 | // This attribute class holds the four integer components of a BLPAPI 144 | // version number, provides factory methods to obtain such version numbers 145 | // for both the headers used at compile time and the library loaded at run 146 | // time, and provides a static function to obtain an opaque version 147 | // identifer string for use by Bloomberg support. 148 | 149 | private: 150 | // INSTANCE DATA 151 | int d_major; // BLPAPI SDK library major version 152 | int d_minor; // BLPAPI SDK library minor version 153 | int d_patch; // BLPAPI SDK library patch version 154 | int d_build; // BLPAPI SDK library build version 155 | 156 | VersionInfo(int major, int minor, int patch, int build); 157 | // Create a 'VersionInfo' object containing the specified 'major', 158 | // 'minor', 'patch', and 'build' numbers. 159 | 160 | public: 161 | // CREATORS 162 | static VersionInfo headerVersion(); 163 | // Return a 'VersionInfo' object containing the version of the BLPAPI 164 | // headers against which the client application was compiled. Note 165 | // that the version of the BLPAPI library loaded at runtime may be 166 | // different than the version of the headers against which the code was 167 | // compiled. 168 | 169 | static VersionInfo runtimeVersion(); 170 | // Return a 'VersionInfo' object containing the version of the BLPAPI 171 | // runtime library that is currently running. Note that the version of 172 | // the BLPAPI library loaded at runtime may be different than the 173 | // version of the headers against which the code was compiled. 174 | 175 | VersionInfo(); 176 | // This function is a synonym for 'VersionInfo::runtimeVersion()'. 177 | // DEPRECATED 178 | 179 | // ACCESSORS 180 | int majorVersion() const; 181 | // Return the major version number. 182 | int minorVersion() const; 183 | // Return the minor version number. 184 | int patchVersion() const; 185 | // Return the patch version number. 186 | int buildVersion() const; 187 | // Return the build version number. 188 | 189 | static std::string versionIdentifier(); 190 | // Return a string containing a sequence of printable ascii characters 191 | // (with values from 0x20 to 0x7e, inclusive) identifying the version 192 | // of the blpapi runtime library. The format of this string is 193 | // unspecified. 194 | 195 | }; 196 | 197 | std::ostream& operator<<(std::ostream& stream, const VersionInfo& rhs); 198 | // Output the specified 'rhs' to the specified 'stream' in a human-readable 199 | // format. Note that the exact details of this format are not specified 200 | // and may be differ between different library versions. 201 | 202 | //============================================================================= 203 | // INLINE FUNCTION DEFINITIONS 204 | //============================================================================= 205 | 206 | // ----------------- 207 | // class VersionInfo 208 | // ----------------- 209 | // CREATORS 210 | inline 211 | VersionInfo::VersionInfo(int major, int minor, int patch, int build) 212 | : d_major(major) 213 | , d_minor(minor) 214 | , d_patch(patch) 215 | , d_build(build) 216 | { 217 | } 218 | 219 | inline 220 | VersionInfo VersionInfo::headerVersion() 221 | { 222 | return VersionInfo(BLPAPI_VERSION_MAJOR, 223 | BLPAPI_VERSION_MINOR, 224 | BLPAPI_VERSION_PATCH, 225 | BLPAPI_VERSION_BUILD); 226 | } 227 | 228 | inline 229 | VersionInfo VersionInfo::runtimeVersion() 230 | { 231 | int major, minor, patch, build; 232 | blpapi_getVersionInfo(&major, &minor, &patch, &build); 233 | return VersionInfo(major, minor, patch, build); 234 | } 235 | 236 | inline 237 | VersionInfo::VersionInfo() 238 | { 239 | blpapi_getVersionInfo(&d_major, &d_minor, &d_patch, &d_build); 240 | } 241 | 242 | // ACCESSORS 243 | inline 244 | int VersionInfo::majorVersion() const 245 | { 246 | return d_major; 247 | } 248 | 249 | inline 250 | int VersionInfo::minorVersion() const 251 | { 252 | return d_minor; 253 | } 254 | 255 | inline 256 | int VersionInfo::patchVersion() const 257 | { 258 | return d_patch; 259 | } 260 | 261 | inline 262 | int VersionInfo::buildVersion() const 263 | { 264 | return d_build; 265 | } 266 | 267 | inline 268 | std::string VersionInfo::versionIdentifier() 269 | { 270 | std::ostringstream oss; 271 | oss << "blpapi-cpp; headers " 272 | << headerVersion() 273 | << "; runtime " 274 | << runtimeVersion(); 275 | if (BLPAPI_CALL_AVAILABLE(blpapi_getVersionIdentifier)) { 276 | oss << '-' << BLPAPI_CALL(blpapi_getVersionIdentifier)(); 277 | } 278 | return oss.str(); 279 | } 280 | 281 | inline 282 | std::ostream& operator<<(std::ostream& stream, const VersionInfo& rhs) 283 | { 284 | return stream << rhs.majorVersion() << '.' 285 | << rhs.minorVersion() << '.' 286 | << rhs.patchVersion() << '.' 287 | << rhs.buildVersion(); 288 | } 289 | 290 | } // close namespace blpapi 291 | } // close namespace BloombergLP 292 | 293 | #endif // ifdef __cplusplus 294 | 295 | #endif // INCLUDED_BLPAPI_VERSIONINFO 296 | -------------------------------------------------------------------------------- /deps/blpapi/include-3.8.1.1/blpapi_versionmacros.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2012. Bloomberg Finance L.P. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: The above 9 | * copyright notice and this permission notice shall be included in all copies 10 | * or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 18 | * IN THE SOFTWARE. 19 | */ 20 | // blpapi_versionmacros.h -*-C++-*- 21 | #ifndef INCLUDED_BLPAPI_VERSIONMACROS 22 | #define INCLUDED_BLPAPI_VERSIONMACROS 23 | 24 | //@PURPOSE: Provide preprocessor macros for BLPAPI library version information. 25 | // 26 | //@DESCRIPTION: This file is not meant to be included directly; see 27 | // 'blpapi_versioninfo.h' for library version interfaces. 28 | 29 | #define BLPAPI_VERSION_MAJOR 3 30 | #define BLPAPI_VERSION_MINOR 8 31 | #define BLPAPI_VERSION_PATCH 1 32 | #define BLPAPI_VERSION_BUILD 1 33 | 34 | #define BLPAPI_MAKE_VERSION(MAJOR, MINOR, PATCH) ((MAJOR) * 65536 + \ 35 | (MINOR) * 256 + \ 36 | (PATCH)) 37 | // Combine the specified 'MAJOR', 'MINOR', and 'PATCH' values to form 38 | // a single integer that can be used for comparisons at compile time. 39 | 40 | #define BLPAPI_SDK_VERSION BLPAPI_MAKE_VERSION(BLPAPI_VERSION_MAJOR, \ 41 | BLPAPI_VERSION_MINOR, \ 42 | BLPAPI_VERSION_PATCH) 43 | // Form a single integer representing the version of the BLPAPI headers 44 | // that can be compared with values formed by 'BLPAPI_MAKE_VERSION' at 45 | // compile time. 46 | 47 | #endif // INCLUDED_BLPAPI_VERSIONMACROS 48 | -------------------------------------------------------------------------------- /deps/blpapi/include-3.8.8.1/blpapi_defs.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2012. Bloomberg Finance L.P. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: The above 9 | * copyright notice and this permission notice shall be included in all copies 10 | * or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 18 | * IN THE SOFTWARE. 19 | */ 20 | // blpapi_defs.h -*-C++-*- 21 | #ifndef INCLUDED_BLPAPI_DEFS 22 | #define INCLUDED_BLPAPI_DEFS 23 | 24 | //@PURPOSE: Common definitions used by the library. 25 | // 26 | //@DESCRIPTION: This component provides a list of preprocessors that are used 27 | // by the library. 28 | 29 | #include 30 | 31 | #define BLPAPI_CORRELATION_TYPE_UNSET 0 32 | #define BLPAPI_CORRELATION_TYPE_INT 1 33 | #define BLPAPI_CORRELATION_TYPE_POINTER 2 34 | #define BLPAPI_CORRELATION_TYPE_AUTOGEN 3 35 | #define BLPAPI_CORRELATION_MAX_CLASS_ID ((1 << 16)-1) 36 | 37 | #define BLPAPI_MANAGEDPTR_COPY 1 38 | #define BLPAPI_MANAGEDPTR_DESTROY (-1) 39 | 40 | 41 | #define BLPAPI_DATETIME_YEAR_PART 0x1 42 | #define BLPAPI_DATETIME_MONTH_PART 0x2 43 | #define BLPAPI_DATETIME_DAY_PART 0x4 44 | #define BLPAPI_DATETIME_OFFSET_PART 0x8 45 | #define BLPAPI_DATETIME_HOURS_PART 0x10 46 | #define BLPAPI_DATETIME_MINUTES_PART 0x20 47 | #define BLPAPI_DATETIME_SECONDS_PART 0x40 48 | #define BLPAPI_DATETIME_MILLISECONDS_PART 0x80 49 | #define BLPAPI_DATETIME_FRACSECONDS_PART 0x80 50 | #define BLPAPI_DATETIME_DATE_PART (BLPAPI_DATETIME_YEAR_PART| \ 51 | BLPAPI_DATETIME_MONTH_PART| \ 52 | BLPAPI_DATETIME_DAY_PART) 53 | #define BLPAPI_DATETIME_TIME_PART (BLPAPI_DATETIME_HOURS_PART| \ 54 | BLPAPI_DATETIME_MINUTES_PART| \ 55 | BLPAPI_DATETIME_SECONDS_PART) 56 | #define BLPAPI_DATETIME_TIMEMILLI_PART (BLPAPI_DATETIME_TIME_PART| \ 57 | BLPAPI_DATETIME_MILLISECONDS_PART) 58 | #define BLPAPI_DATETIME_TIMEFRACSECONDS_PART (BLPAPI_DATETIME_TIME_PART| \ 59 | BLPAPI_DATETIME_FRACSECONDS_PART) 60 | 61 | 62 | #define BLPAPI_EVENTTYPE_ADMIN 1 63 | #define BLPAPI_EVENTTYPE_SESSION_STATUS 2 64 | #define BLPAPI_EVENTTYPE_SUBSCRIPTION_STATUS 3 65 | #define BLPAPI_EVENTTYPE_REQUEST_STATUS 4 66 | #define BLPAPI_EVENTTYPE_RESPONSE 5 67 | #define BLPAPI_EVENTTYPE_PARTIAL_RESPONSE 6 68 | #define BLPAPI_EVENTTYPE_SUBSCRIPTION_DATA 8 69 | #define BLPAPI_EVENTTYPE_SERVICE_STATUS 9 70 | #define BLPAPI_EVENTTYPE_TIMEOUT 10 71 | #define BLPAPI_EVENTTYPE_AUTHORIZATION_STATUS 11 72 | #define BLPAPI_EVENTTYPE_RESOLUTION_STATUS 12 73 | #define BLPAPI_EVENTTYPE_TOPIC_STATUS 13 74 | #define BLPAPI_EVENTTYPE_TOKEN_STATUS 14 75 | #define BLPAPI_EVENTTYPE_REQUEST 15 76 | 77 | 78 | #define BLPAPI_ELEMENT_INDEX_END 0xffffffff 79 | 80 | #define BLPAPI_STATUS_ACTIVE 0 81 | #define BLPAPI_STATUS_DEPRECATED 1 82 | #define BLPAPI_STATUS_INACTIVE 2 83 | #define BLPAPI_STATUS_PENDING_DEPRECATION 3 84 | 85 | #define BLPAPI_SUBSCRIPTIONSTATUS_UNSUBSCRIBED 0 86 | #define BLPAPI_SUBSCRIPTIONSTATUS_SUBSCRIBING 1 87 | #define BLPAPI_SUBSCRIPTIONSTATUS_SUBSCRIBED 2 88 | #define BLPAPI_SUBSCRIPTIONSTATUS_CANCELLED 3 89 | #define BLPAPI_SUBSCRIPTIONSTATUS_PENDING_CANCELLATION 4 90 | 91 | #define BLPAPI_CLIENTMODE_AUTO 0 92 | #define BLPAPI_CLIENTMODE_DAPI 1 93 | #define BLPAPI_CLIENTMODE_SAPI 2 94 | #define BLPAPI_CLIENTMODE_COMPAT_33X 16 95 | 96 | #define BLPAPI_ELEMENTDEFINITION_UNBOUNDED -1 97 | 98 | #define BLPAPI_RESOLVEMODE_DONT_REGISTER_SERVICES 0 99 | #define BLPAPI_RESOLVEMODE_AUTO_REGISTER_SERVICES 1 100 | 101 | #define BLPAPI_SEATTYPE_INVALID_SEAT -1 102 | #define BLPAPI_SEATTYPE_BPS 0 103 | #define BLPAPI_SEATTYPE_NONBPS 1 104 | 105 | #define BLPAPI_SERVICEREGISTRATIONOPTIONS_PRIORITY_LOW 0 106 | #define BLPAPI_SERVICEREGISTRATIONOPTIONS_PRIORITY_MEDIUM INT_MAX/2 107 | #define BLPAPI_SERVICEREGISTRATIONOPTIONS_PRIORITY_HIGH INT_MAX 108 | 109 | #define BLPAPI_REGISTRATIONPARTS_DEFAULT 0x1 110 | #define BLPAPI_REGISTRATIONPARTS_PUBLISHING 0x2 111 | #define BLPAPI_REGISTRATIONPARTS_OPERATIONS 0x4 112 | #define BLPAPI_REGISTRATIONPARTS_SUBSCRIBER_RESOLUTION 0x8 113 | #define BLPAPI_REGISTRATIONPARTS_PUBLISHER_RESOLUTION 0x10 114 | 115 | #if defined(_WIN32) || defined(__WIN32__) && \ 116 | ! (defined(cygwin) || defined(__cygwin)) 117 | #ifdef BLPAPI_BUILD 118 | #define BLPAPI_EXPORT __declspec(dllexport) 119 | #else 120 | #define BLPAPI_EXPORT __declspec(dllimport) 121 | #endif 122 | #else 123 | #define BLPAPI_EXPORT 124 | #endif 125 | 126 | #endif // #ifndef INCLUDED_BLPAPI_DEFS 127 | -------------------------------------------------------------------------------- /deps/blpapi/include-3.8.8.1/blpapi_diagnosticsutil.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2013. Bloomberg Finance L.P. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: The above 9 | * copyright notice and this permission notice shall be included in all copies 10 | * or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 18 | * IN THE SOFTWARE. 19 | */ 20 | // blpapi_diagnosticsutil.h -*-C++-*- 21 | #ifndef INCLUDED_BLPAPI_DIAGNOSTICSUTIL 22 | #define INCLUDED_BLPAPI_DIAGNOSTICSUTIL 23 | 24 | //@PURPOSE: Provide api to access diagnostics information on the blpapi library 25 | // 26 | //@CLASSES: 27 | // blpapi::DiagnosticsUtil: collection of diagnostics information functions 28 | // 29 | //@DESCRIPTION: This component provide a collection of functions which give 30 | // access to various sets of diagnostics information on the 'blpapi' library. 31 | 32 | 33 | #ifndef INCLUDED_BLPAPI_CALL 34 | #include 35 | #endif 36 | 37 | #ifndef INCLUDED_BLPAPI_DEFS 38 | #include 39 | #endif 40 | 41 | #ifndef INCLUDED_STDDEF 42 | #include 43 | #define INCLUDED_STDDEF 44 | #endif 45 | 46 | #ifdef __cplusplus 47 | extern "C" { 48 | #endif 49 | 50 | BLPAPI_EXPORT 51 | int blpapi_DiagnosticsUtil_memoryInfo(char *buffer, 52 | size_t bufferLength); 53 | 54 | #ifdef __cplusplus 55 | } 56 | 57 | namespace BloombergLP { 58 | namespace blpapi { 59 | // ===================== 60 | // class DiagnosticsUtil 61 | // ===================== 62 | 63 | class DiagnosticsUtil { 64 | public: 65 | static int memoryInfo(char *buffer, 66 | size_t bufferLength); 67 | // Load into the specified 'buffer' up to the specified 'bufferLength' 68 | // characters of a null-terminated string describing the 'blpapi' 69 | // library's memory usage; the format of the string is 70 | // platform-specific. On success, return the number of characters 71 | // required to output the entire string, not including the null 72 | // terminator; otherwise return a negative value. Note that if the 73 | // value returned from this function is greater than or equal to 74 | // 'bufferLength' then the output is truncated and is *not* 75 | // null-terminated. 76 | }; 77 | 78 | 79 | // --------------------- 80 | // class DiagnosticsUtil 81 | // --------------------- 82 | 83 | inline 84 | int DiagnosticsUtil::memoryInfo(char *buffer, 85 | size_t bufferLength) 86 | { 87 | BLPAPI_CALL_DIAGNOSTICSUTIL_MEMORYINFO(buffer, bufferLength); 88 | } 89 | 90 | } 91 | } 92 | 93 | #endif 94 | 95 | #endif 96 | -------------------------------------------------------------------------------- /deps/blpapi/include-3.8.8.1/blpapi_dispatchtbl.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2012. Bloomberg Finance L.P. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: The above 9 | * copyright notice and this permission notice shall be included in all copies 10 | * or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 18 | * IN THE SOFTWARE. 19 | */ 20 | // blpapi_dispatchtbl.h -*-C++-*- 21 | #ifndef INCLUDED_BLPAPI_DISPATCHTBL 22 | #define INCLUDED_BLPAPI_DISPATCHTBL 23 | 24 | //@PURPOSE: Work with dispatch table 25 | // 26 | //@DESCRIPTION: This provides dispatch table for extended exported functions. 27 | // These functions are called through dispatch table based on preprocessors. It 28 | // avoids direct call of these functions by applications. So when blpapi DLL 29 | // is rolled back to the previous versions, blpapi DLL still can be loaded. 30 | 31 | // We only support dispatchtbl on windows currently 32 | #if defined(_WIN32) || defined(__WIN32__) 33 | 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | #ifdef __cplusplus 42 | 43 | #ifndef BLPAPI_MIN_VERSION 44 | #define BLPAPI_MIN_VERSION BLPAPI_SDK_VERSION 45 | #endif 46 | 47 | #ifndef BLPAPI_TARGET_VERSION 48 | #define BLPAPI_TARGET_VERSION BLPAPI_SDK_VERSION 49 | #endif 50 | 51 | #if BLPAPI_MIN_VERSION > BLPAPI_TARGET_VERSION 52 | #error "Min required version cannot be greater than target version" 53 | #endif 54 | 55 | extern "C" { 56 | 57 | // Forward declarations 58 | struct blpapi_EventFormatter; 59 | typedef struct blpapi_EventFormatter blpapi_EventFormat_t; 60 | 61 | struct blpapi_Topic; 62 | typedef struct blpapi_Topic blpapi_Topic_t; 63 | 64 | struct blpapi_Message; 65 | typedef struct blpapi_Message blpapi_Message_t; 66 | 67 | struct blpapi_Request; 68 | typedef struct blpapi_Request blpapi_Request_t; 69 | 70 | struct blpapi_HighPrecisionDatetime_tag; 71 | typedef struct blpapi_HighPrecisionDatetime_tag blpapi_HighPrecisionDatetime_t; 72 | 73 | struct blpapi_TimePoint; 74 | typedef struct blpapi_TimePoint blpapi_TimePoint_t; 75 | 76 | struct blpapi_SubscriptionList; 77 | typedef struct blpapi_SubscriptionList blpapi_SubscriptionList_t; 78 | 79 | struct blpapi_ServiceRegistrationOptions; 80 | typedef struct blpapi_ServiceRegistrationOptions 81 | blpapi_ServiceRegistrationOptions_t; 82 | 83 | // End Forward declarations 84 | 85 | // Function dispatch table declaration 86 | typedef struct blpapi_FunctionEntries { 87 | int (*blpapi_EventFormatter_appendMessageSeq)( 88 | blpapi_EventFormatter_t* formatter, 89 | char const* typeString, 90 | blpapi_Name_t* typeName, 91 | const blpapi_Topic_t* topic, 92 | unsigned int sequenceNumber, 93 | unsigned int); 94 | int (*blpapi_EventFormatter_appendRecapMessageSeq)( 95 | blpapi_EventFormatter_t* formatter, 96 | const blpapi_Topic_t *topic, 97 | const blpapi_CorrelationId_t *cid, 98 | unsigned int sequenceNumber, 99 | unsigned int); 100 | int (*blpapi_Message_addRef)( 101 | const blpapi_Message_t* message); 102 | int (*blpapi_Message_release)( 103 | const blpapi_Message_t* message); 104 | void (*blpapi_SessionOptions_setMaxEventQueueSize)( 105 | blpapi_SessionOptions_t *parameters, 106 | size_t maxEventQueueSize); 107 | int (*blpapi_SessionOptions_setSlowConsumerWarningHiWaterMark)( 108 | blpapi_SessionOptions_t *parameters, 109 | float hiWaterMark); 110 | int (*blpapi_SessionOptions_setSlowConsumerWarningLoWaterMark)( 111 | blpapi_SessionOptions_t *parameters, 112 | float loWaterMark); 113 | void (*blpapi_Request_setPreferredRoute)( 114 | blpapi_Request_t *request, 115 | blpapi_CorrelationId_t *correlationId); 116 | int (*blpapi_Message_fragmentType)( 117 | const blpapi_Message_t *message); 118 | size_t (*blpapi_SessionOptions_maxEventQueueSize)( 119 | blpapi_SessionOptions_t *parameters); 120 | float (*blpapi_SessionOptions_slowConsumerWarningHiWaterMark)( 121 | blpapi_SessionOptions_t *parameters); 122 | float (*blpapi_SessionOptions_slowConsumerWarningLoWaterMark)( 123 | blpapi_SessionOptions_t *parameters); 124 | int (*blpapi_SessionOptions_setDefaultKeepAliveInactivityTime)( 125 | blpapi_SessionOptions_t *parameters, 126 | int inactivityTime); 127 | int (*blpapi_SessionOptions_setDefaultKeepAliveResponseTimeout)( 128 | blpapi_SessionOptions_t *parameters, 129 | int responseTimeout); 130 | int (*blpapi_SessionOptions_defaultKeepAliveInactivityTime)( 131 | blpapi_SessionOptions_t *parameters); 132 | int (*blpapi_SessionOptions_defaultKeepAliveResponseTimeout)( 133 | blpapi_SessionOptions_t *parameters); 134 | int (*blpapi_HighPrecisionDatetime_compare)( 135 | const blpapi_HighPrecisionDatetime_t*, 136 | const blpapi_HighPrecisionDatetime_t*); 137 | int (*blpapi_HighPrecisionDatetime_print)( 138 | const blpapi_HighPrecisionDatetime_t*, 139 | blpapi_StreamWriter_t, 140 | void*, 141 | int, 142 | int); 143 | int (*blpapi_Element_getValueAsHighPrecisionDatetime)( 144 | const blpapi_Element_t*, 145 | blpapi_HighPrecisionDatetime_t*, 146 | size_t); 147 | int (*blpapi_Element_setValueHighPrecisionDatetime)( 148 | blpapi_Element_t*, 149 | const blpapi_HighPrecisionDatetime_t*, 150 | size_t); 151 | int (*blpapi_Element_setElementHighPrecisionDatetime)( 152 | blpapi_Element_t*, 153 | const char*, 154 | const blpapi_Name_t*, 155 | const blpapi_HighPrecisionDatetime_t*); 156 | int (*blpapi_Session_resubscribeWithId)( 157 | blpapi_Session_t*, 158 | const blpapi_SubscriptionList_t*, 159 | int, 160 | const char*, 161 | int); 162 | int (*blpapi_EventFormatter_setValueNull)( 163 | blpapi_EventFormatter_t *, 164 | const char *, 165 | const blpapi_Name_t *); 166 | int (*blpapi_DiagnosticsUtil_memoryInfo)( 167 | char *, 168 | size_t); 169 | int (*blpapi_SessionOptions_setKeepAliveEnabled)( 170 | blpapi_SessionOptions_t *, 171 | int); 172 | int (*blpapi_SessionOptions_keepAliveEnabled)( 173 | blpapi_SessionOptions_t *); 174 | int (*blpapi_SubscriptionList_addResolved)( 175 | blpapi_SubscriptionList_t *, 176 | const char *, 177 | const blpapi_CorrelationId_t *); 178 | int (*blpapi_SubscriptionList_isResolvedAt)( 179 | blpapi_SubscriptionList_t *, 180 | int *, 181 | size_t); 182 | int (*blpapi_ProviderSession_deregisterService)( 183 | blpapi_ProviderSession_t *session, 184 | const char* serviceName); 185 | void (*blpapi_ServiceRegistrationOptions_setPartsToRegister)( 186 | blpapi_ServiceRegistrationOptions_t *session, 187 | int parts); 188 | int (*blpapi_ServiceRegistrationOptions_getPartsToRegister)( 189 | blpapi_ServiceRegistrationOptions_t *session); 190 | int (*blpapi_ProviderSession_deleteTopics)( 191 | blpapi_ProviderSession_t* session, 192 | const blpapi_Topic_t** topics, 193 | size_t numTopics); 194 | int (*blpapi_ProviderSession_activateSubServiceCodeRange)( 195 | blpapi_ProviderSession_t *session, 196 | const char* serviceName, 197 | int begin, 198 | int end, 199 | int priority); 200 | int (*blpapi_ProviderSession_deactivateSubServiceCodeRange)( 201 | blpapi_ProviderSession_t *session, 202 | const char* serviceName, 203 | int begin, 204 | int end); 205 | int (*blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange)( 206 | blpapi_ServiceRegistrationOptions_t *parameters, 207 | int start, 208 | int end, 209 | int priority); 210 | void 211 | (*blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges)( 212 | blpapi_ServiceRegistrationOptions_t *parameters); 213 | void (*blpapi_Logging_logTestMessage)( 214 | blpapi_Logging_Severity_t severity); 215 | const char *(*blpapi_getVersionIdentifier)(); 216 | int (*blpapi_Message_timeReceived)( 217 | const blpapi_Message_t *message, 218 | blpapi_TimePoint_t *timeReceived); 219 | int (*blpapi_SessionOptions_recordSubscriptionDataReceiveTimes)( 220 | blpapi_SessionOptions_t *parameters); 221 | void (*blpapi_SessionOptions_setRecordSubscriptionDataReceiveTimes)( 222 | blpapi_SessionOptions_t *parameters, 223 | int shouldRecord); 224 | long long (*blpapi_TimePointUtil_nanosecondsBetween)( 225 | const blpapi_TimePoint_t *start, 226 | const blpapi_TimePoint_t *end); 227 | int (*blpapi_HighResolutionClock_now)( 228 | blpapi_TimePoint_t *timePoint); 229 | int (*blpapi_HighPrecisionDatetime_fromTimePoint)( 230 | blpapi_HighPrecisionDatetime_t *datetime, 231 | const blpapi_TimePoint_t *timePoint, 232 | short offset); 233 | 234 | } blpapi_FunctionEntries_t; 235 | 236 | BLPAPI_EXPORT extern size_t g_blpapiFunctionTableSize; 237 | BLPAPI_EXPORT extern blpapi_FunctionEntries_t g_blpapiFunctionEntries; 238 | 239 | } // extern "C" 240 | 241 | #endif // __cplusplus 242 | 243 | #endif // if defined(_WIN32) || defined(__WIN32__) 244 | 245 | #endif // INCLUDED_BLPAPI_DISPATCHTBL 246 | -------------------------------------------------------------------------------- /deps/blpapi/include-3.8.8.1/blpapi_error.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2012. Bloomberg Finance L.P. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: The above 9 | * copyright notice and this permission notice shall be included in all copies 10 | * or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 18 | * IN THE SOFTWARE. 19 | */ 20 | // blpapi_error.h -*-C++-*- 21 | #ifndef INCLUDED_BLPAPI_ERROR 22 | #define INCLUDED_BLPAPI_ERROR 23 | 24 | //@PURPOSE: Provide a collection of errors that library can return 25 | // 26 | //@DESCRIPTION: This component provides a collection of preprocessor macros 27 | // that define the errors that library can generate. 28 | 29 | #ifndef INCLUDED_BLPAPI_DEFS 30 | #include 31 | #endif 32 | 33 | #define BLPAPI_RESULTCODE(res) ((res) & 0xffff) 34 | #define BLPAPI_RESULTCLASS(res) ((res) & 0xff0000) 35 | 36 | #define BLPAPI_UNKNOWN_CLASS 0x00000 37 | #define BLPAPI_INVALIDSTATE_CLASS 0x10000 38 | #define BLPAPI_INVALIDARG_CLASS 0x20000 39 | #define BLPAPI_IOERROR_CLASS 0x30000 40 | #define BLPAPI_CNVERROR_CLASS 0x40000 41 | #define BLPAPI_BOUNDSERROR_CLASS 0x50000 42 | #define BLPAPI_NOTFOUND_CLASS 0x60000 43 | #define BLPAPI_FLDNOTFOUND_CLASS 0x70000 44 | #define BLPAPI_UNSUPPORTED_CLASS 0x80000 45 | 46 | #define BLPAPI_ERROR_UNKNOWN (BLPAPI_UNKNOWN_CLASS | 1) 47 | #define BLPAPI_ERROR_ILLEGAL_ARG (BLPAPI_INVALIDARG_CLASS | 2) 48 | #define BLPAPI_ERROR_ILLEGAL_ACCESS (BLPAPI_UNKNOWN_CLASS | 3) 49 | #define BLPAPI_ERROR_INVALID_SESSION (BLPAPI_INVALIDARG_CLASS | 4) 50 | #define BLPAPI_ERROR_DUPLICATE_CORRELATIONID (BLPAPI_INVALIDARG_CLASS | 5) 51 | #define BLPAPI_ERROR_INTERNAL_ERROR (BLPAPI_UNKNOWN_CLASS | 6) 52 | #define BLPAPI_ERROR_RESOLVE_FAILED (BLPAPI_IOERROR_CLASS | 7) 53 | #define BLPAPI_ERROR_CONNECT_FAILED (BLPAPI_IOERROR_CLASS | 8) 54 | #define BLPAPI_ERROR_ILLEGAL_STATE (BLPAPI_INVALIDSTATE_CLASS| 9) 55 | #define BLPAPI_ERROR_CODEC_FAILURE (BLPAPI_UNKNOWN_CLASS | 10) 56 | #define BLPAPI_ERROR_INDEX_OUT_OF_RANGE (BLPAPI_BOUNDSERROR_CLASS | 11) 57 | #define BLPAPI_ERROR_INVALID_CONVERSION (BLPAPI_CNVERROR_CLASS | 12) 58 | #define BLPAPI_ERROR_ITEM_NOT_FOUND (BLPAPI_NOTFOUND_CLASS | 13) 59 | #define BLPAPI_ERROR_IO_ERROR (BLPAPI_IOERROR_CLASS | 14) 60 | #define BLPAPI_ERROR_CORRELATION_NOT_FOUND (BLPAPI_NOTFOUND_CLASS | 15) 61 | #define BLPAPI_ERROR_SERVICE_NOT_FOUND (BLPAPI_NOTFOUND_CLASS | 16) 62 | #define BLPAPI_ERROR_LOGON_LOOKUP_FAILED (BLPAPI_UNKNOWN_CLASS | 17) 63 | #define BLPAPI_ERROR_DS_LOOKUP_FAILED (BLPAPI_UNKNOWN_CLASS | 18) 64 | #define BLPAPI_ERROR_UNSUPPORTED_OPERATION (BLPAPI_UNSUPPORTED_CLASS | 19) 65 | #define BLPAPI_ERROR_DS_PROPERTY_NOT_FOUND (BLPAPI_NOTFOUND_CLASS | 20) 66 | 67 | #ifdef __cplusplus 68 | extern "C" { 69 | #endif 70 | 71 | BLPAPI_EXPORT 72 | const char* blpapi_getLastErrorDescription(int resultCode); 73 | 74 | #ifdef __cplusplus 75 | } 76 | 77 | namespace BloombergLP { 78 | namespace blpapi { 79 | 80 | } // close namespace blpapi 81 | } // close namespace BloombergLP 82 | 83 | #endif 84 | 85 | 86 | #endif // #ifndef INCLUDED_BLPAPI_ERROR 87 | -------------------------------------------------------------------------------- /deps/blpapi/include-3.8.8.1/blpapi_eventdispatcher.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2012. Bloomberg Finance L.P. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: The above 9 | * copyright notice and this permission notice shall be included in all copies 10 | * or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 18 | * IN THE SOFTWARE. 19 | */ 20 | // blpapi_eventdispatcher.h -*-C++-*- 21 | #ifndef INCLUDED_BLPAPI_EVENTDISPATCHER 22 | #define INCLUDED_BLPAPI_EVENTDISPATCHER 23 | 24 | //@PURPOSE: Provide a dispatcher to dispatch events. 25 | // 26 | //@CLASSES: 27 | // blpapi::EventDispatcher: Dispatches events from one or more Sessions through 28 | // callbacks 29 | // 30 | //@DESCRIPTION: This component implements a dispatcher to dispatch events from 31 | // one or more 'Session' through callbacks. 32 | 33 | #ifndef INCLUDED_BLPAPI_DEFS 34 | #include 35 | #endif 36 | 37 | #ifndef INCLUDED_BLPAPI_TYPES 38 | #include 39 | #endif 40 | 41 | #include // for size_t 42 | 43 | #ifdef __cplusplus 44 | extern "C" { 45 | #endif 46 | 47 | BLPAPI_EXPORT 48 | blpapi_EventDispatcher_t* blpapi_EventDispatcher_create( 49 | size_t numDispatcherThreads); 50 | 51 | BLPAPI_EXPORT 52 | void blpapi_EventDispatcher_destroy(blpapi_EventDispatcher_t *handle); 53 | 54 | BLPAPI_EXPORT 55 | int blpapi_EventDispatcher_start(blpapi_EventDispatcher_t *handle); 56 | 57 | BLPAPI_EXPORT 58 | int blpapi_EventDispatcher_stop(blpapi_EventDispatcher_t *handle, 59 | int async); 60 | 61 | BLPAPI_EXPORT 62 | int blpapi_EventDispatcher_dispatchEvents(blpapi_EventDispatcher_t *handle); 63 | 64 | #ifdef __cplusplus 65 | } // extern "C" 66 | 67 | namespace BloombergLP { 68 | namespace blpapi { 69 | // ===================== 70 | // class EventDispatcher 71 | // ===================== 72 | 73 | class EventDispatcher { 74 | // Dispatches events from one or more Sessions through callbacks 75 | // 76 | // EventDispatcher objects are optionally specified when Session 77 | // objects are constructed. A single EventDispatcher can be shared 78 | // by multiple Session objects. 79 | // 80 | // The EventDispatcher provides an event-driven interface, 81 | // generating callbacks from one or more internal threads for one 82 | // or more sessions. 83 | 84 | blpapi_EventDispatcher_t *d_impl_p; 85 | 86 | private: 87 | // NOT IMPLEMENTED 88 | EventDispatcher(const EventDispatcher&); 89 | EventDispatcher &operator=(const EventDispatcher&); 90 | 91 | public: 92 | EventDispatcher(size_t numDispatcherThreads = 1); 93 | // Construct an EventDispatcher with the specified 94 | // 'numDispatcherThreads'. If 'numDispatcherThreads' is 1 (the 95 | // default) then a single internal thread is created to 96 | // dispatch events. If 'numDispatcherThreads' is greater than 97 | // 1 then an internal pool of 'numDispatcherThreads' threads 98 | // is created to dispatch events. The behavior is undefined 99 | // if 'numDispatcherThreads' is 0. 100 | 101 | ~EventDispatcher(); 102 | // Destructor. 103 | 104 | int start(); 105 | // Start generating callbacks for events from sessions 106 | // associated with this EventDispatcher. Return 0 on success 107 | // and a non zero value otherwise. 108 | 109 | int stop(bool async = false); 110 | // Shutdown this event dispatcher object and stop generating 111 | // callbacks for events from sessions associated with it. 112 | // If the specified 'async' is false (the default) then this 113 | // method blocks until all current callbacks which were dispatched 114 | // through this EventDispatcher have completed. 115 | // Return 0 on success and a non zero value otherwise. 116 | // 117 | // Note: Calling stop with 'async' of false from within a callback 118 | // dispatched by this EventDispatcher is undefined and may result 119 | // in a deadlock. 120 | 121 | blpapi_EventDispatcher_t *impl() const; 122 | // Returns the internal implementation. 123 | }; 124 | 125 | // ============================================================================ 126 | // INLINE AND TEMPLATE FUNCTION IMPLEMENTATIONS 127 | // ============================================================================ 128 | 129 | // --------------------- 130 | // class EventDispatcher 131 | // --------------------- 132 | 133 | 134 | inline 135 | EventDispatcher::EventDispatcher(size_t numDispatcherThreads) 136 | : d_impl_p(blpapi_EventDispatcher_create(numDispatcherThreads)) 137 | { 138 | } 139 | 140 | inline 141 | EventDispatcher::~EventDispatcher() 142 | { 143 | blpapi_EventDispatcher_destroy(d_impl_p); 144 | } 145 | 146 | inline 147 | int EventDispatcher::start() 148 | { 149 | return blpapi_EventDispatcher_start(d_impl_p); 150 | } 151 | 152 | inline 153 | int EventDispatcher::stop(bool async) 154 | { 155 | return blpapi_EventDispatcher_stop(d_impl_p, async); 156 | } 157 | 158 | inline 159 | blpapi_EventDispatcher_t *EventDispatcher::impl() const 160 | { 161 | return d_impl_p; 162 | } 163 | 164 | 165 | } // close namespace blpapi 166 | } // close namespace BloombergLP 167 | 168 | #endif // ifdef __cplusplus 169 | 170 | #endif // #ifndef INCLUDED_BLPAPI_EVENTDISPATCHER 171 | -------------------------------------------------------------------------------- /deps/blpapi/include-3.8.8.1/blpapi_highresolutionclock.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2012. Bloomberg Finance L.P. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: The above 9 | * copyright notice and this permission notice shall be included in all copies 10 | * or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 18 | * IN THE SOFTWARE. 19 | */ 20 | // blpapi_clock.h -*-C++-*- 21 | #ifndef INCLUDED_BLPAPI_HIGHRESOLUTIONCLOCK 22 | #define INCLUDED_BLPAPI_HIGHRESOLUTIONCLOCK 23 | //@PURPOSE: Provide a high resolution clock. 24 | // 25 | //@CLASSES: 26 | // blpapi::HighResolutionClock: a high resolution clock 27 | // 28 | //@DESCRIPTION: This component provides a way to access the current time as a 29 | // 'blpapi::TimePoint' value. 30 | 31 | #ifndef INCLUDED_BLPAPI_CALL 32 | #include 33 | #endif 34 | 35 | #ifndef INCLUDED_BLPAPI_DEFS 36 | #include 37 | #endif 38 | 39 | #ifndef INCLUDED_BLPAPI_TIMEPOINT 40 | #include 41 | #endif 42 | 43 | #ifndef INCLUDED_BLPAPI_TYPES 44 | #include 45 | #endif 46 | 47 | #ifdef __cplusplus 48 | extern "C" { 49 | #endif 50 | 51 | BLPAPI_EXPORT 52 | int blpapi_HighResolutionClock_now(blpapi_TimePoint_t *timePoint); 53 | // Load the current time into the specified 'timePoint' and return zero, or 54 | // leave timePoint unchanged and return a non-zero value. 55 | #ifdef __cplusplus 56 | } 57 | 58 | namespace BloombergLP { 59 | namespace blpapi { 60 | // ========================== 61 | // struct HighResolutionClock 62 | // ========================== 63 | 64 | struct HighResolutionClock { 65 | // This utility struct provides a source for the current moment in time as 66 | // a 'blpapi::TimePoint' object. This is currently intended for use 67 | // primarily in conjunction with the 'blpapi::Message::timeReceived' 68 | // interfaces, to allow measurement of the amount of time a message spends 69 | // in the client event queue. 70 | 71 | static TimePoint now(); 72 | // Return the current moment in time as a 'TimePoint' value. 73 | }; 74 | 75 | // ============================================================================ 76 | // INLINE AND TEMPLATE FUNCTION IMPLEMENTATIONS 77 | // ============================================================================ 78 | 79 | // -------------------------- 80 | // struct HighResolutionClock 81 | // -------------------------- 82 | inline 83 | TimePoint HighResolutionClock::now() 84 | { 85 | TimePoint tp; 86 | BLPAPI_CALL_HIGHRESOLUTIONCLOCK_NOW(&tp); 87 | return tp; 88 | } 89 | 90 | } // close namespace blpapi 91 | } // close namespace BloombergLP 92 | 93 | #endif // #ifdef __cplusplus 94 | #endif // #ifndef INCLUDED_BLPAPI_HIGHRESOLUTIONCLOCK 95 | -------------------------------------------------------------------------------- /deps/blpapi/include-3.8.8.1/blpapi_logging.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2012. Bloomberg Finance L.P. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: The above 9 | * copyright notice and this permission notice shall be included in all copies 10 | * or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 18 | * IN THE SOFTWARE. 19 | */ 20 | // blpapi_logging.h -*-C++-*- 21 | #ifndef INCLUDED_BLPAPI_LOGGING 22 | #define INCLUDED_BLPAPI_LOGGING 23 | 24 | //@PURPOSE: Provide a C call to register a call back for logging 25 | // 26 | //@DESCRIPTION: This component provides a C function that is used to 27 | // register a callback for logging 28 | // 29 | ///Usage 30 | ///----- 31 | // To use the call back a function needs to be created with the same definition 32 | // of blpapi_Logging_Func_t. 33 | // The callback will be called for all the log messages that have severity 34 | // greater than or equal to the specified 'thresholdSeverity'. 35 | // A callback can be registered multiple number of times but only the last 36 | // registered callback will be used. 37 | // Registering with a 'NULL' callback will de-register the callback. 38 | //.. 39 | // extern "C" { 40 | // void myLoggerCallback(blpapi_UInt64_t threadId, 41 | // int severity, 42 | // blpapi_Datetime_t timestamp, 43 | // const char *category, 44 | // const char *message) 45 | // { 46 | // if (severity == blpapi_Logging_SEVERITY_FATAL) { 47 | // // Do some logic for abort here 48 | // } 49 | // std::cout << severity << "-->" << message << std::endl; 50 | // } 51 | //.. 52 | // This callback needs to be registered with the library as 53 | //.. 54 | // int main() { 55 | // // .... 56 | // blpapi_Logging_registerCallback(myLoggerCallback, 57 | // blpapi_Logging_SEVERITY_TRACE); 58 | // // .... 59 | // } 60 | //.. 61 | 62 | #ifndef INCLUDED_BLPAPI_CALL 63 | #include 64 | #endif 65 | 66 | #ifndef INCLUDED_BLPAPI_DATETIME 67 | #include 68 | #endif 69 | 70 | #ifndef INCLUDED_BLPAPI_DEFS 71 | #include 72 | #endif 73 | 74 | #ifdef __cplusplus 75 | extern "C" { 76 | #endif 77 | 78 | typedef void (*blpapi_Logging_Func_t)(blpapi_UInt64_t threadId, 79 | int severity, 80 | blpapi_Datetime_t timestamp, 81 | const char *category, 82 | const char *message); 83 | // Provide a type definition for the callback that will be called when a 84 | // message is logged. The specified 'threadId' is the id of the calling 85 | // thread. The specified 'severity' is the severity of the log message 86 | // whose value is defined by the type 'blpapi_Logging_Severity_t'. The 87 | // specified 'timestamp' is the date and time the message is logged. The 88 | // specified 'category' identifies the source of the logged message. The 89 | // specified 'message' is the actual log message text. 90 | 91 | BLPAPI_EXPORT 92 | int blpapi_Logging_registerCallback( 93 | blpapi_Logging_Func_t callback, 94 | blpapi_Logging_Severity_t thresholdSeverity); 95 | // Register the specified 'callback' that will be called for all log 96 | // messages with severity greater than or equal to the specified 97 | // 'thresholdSeverity'. The callback needs to be registered before the 98 | // start of all sessions. If this function is called multiple times, only 99 | // the last registered callback will take effect. 100 | // '0' is returned if callback is registered and a non-zero otherwise. 101 | 102 | BLPAPI_EXPORT 103 | void blpapi_Logging_logTestMessage(blpapi_Logging_Severity_t severity); 104 | // Log a test message at the specified 'severity'. Note that this 105 | // function is intended for testing of the logging configuration only. 106 | 107 | 108 | #ifdef __cplusplus 109 | } 110 | 111 | namespace BloombergLP { 112 | namespace blpapi { 113 | 114 | struct Logging { 115 | // This utility 'struct' provides a namespace for functions to test the 116 | // logging configuration. 117 | 118 | struct Severity { 119 | enum Type { 120 | // Enumeration used to specify different logging severity levels. 121 | 122 | e_off = blpapi_Logging_SEVERITY_OFF, 123 | e_fatal = blpapi_Logging_SEVERITY_FATAL, 124 | e_error = blpapi_Logging_SEVERITY_ERROR, 125 | e_warn = blpapi_Logging_SEVERITY_WARN, 126 | e_info = blpapi_Logging_SEVERITY_INFO, 127 | e_debug = blpapi_Logging_SEVERITY_DEBUG, 128 | e_trace = blpapi_Logging_SEVERITY_TRACE 129 | }; 130 | }; 131 | 132 | // CLASS METHODS 133 | static void logTestMessage(Severity::Type severity); 134 | // Log a test message with the specified 'severity'. Note that this 135 | // function is intended for testing of the logging configuration only. 136 | }; 137 | 138 | 139 | // ============================================================================ 140 | // INLINE FUNCTION DEFINITIONS 141 | // ============================================================================ 142 | 143 | // -------------- 144 | // struct Logging 145 | // -------------- 146 | 147 | // CLASS METHODS 148 | inline 149 | void Logging::logTestMessage(Severity::Type severity) 150 | { 151 | BLPAPI_CALL(blpapi_Logging_logTestMessage)( 152 | static_cast(severity)); 153 | } 154 | 155 | } // close namespace blpapi 156 | } // close namespace BloombergLP 157 | 158 | #endif 159 | 160 | #endif 161 | -------------------------------------------------------------------------------- /deps/blpapi/include-3.8.8.1/blpapi_streamproxy.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2012. Bloomberg Finance L.P. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: The above 9 | * copyright notice and this permission notice shall be included in all copies 10 | * or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 18 | * IN THE SOFTWARE. 19 | */ 20 | // blpapi_streamproxy.h -*-C++-*- 21 | #ifndef INCLUDED_BLPAPI_STREAMPROXY 22 | #define INCLUDED_BLPAPI_STREAMPROXY 23 | 24 | //@PURPOSE: A signature for callback on print and default C++ implementation 25 | // 26 | //@DESCRIPTION: 27 | // This file defines 'blpapi_StreamWriter_t' a function pointer type. 28 | // The user of the C API need to specify a callback of above type which will 29 | // be called on xxx_print(...) with the formatted data. For C++ API, a default 30 | // callback is specified which writes data to the stream specified in 31 | // xxx::print 32 | 33 | typedef int(*blpapi_StreamWriter_t)(const char* data, 34 | int length, 35 | void *stream); 36 | 37 | #ifdef __cplusplus 38 | 39 | #include 40 | 41 | namespace BloombergLP { 42 | namespace blpapi { 43 | 44 | inline int OstreamWriter(const char *data, int length, void *stream); 45 | // DEPRECATED 46 | 47 | // ================== 48 | // struct StreamProxy 49 | // ================== 50 | 51 | struct StreamProxyOstream { 52 | 53 | static int writeToStream(const char* data, int length, void *stream); 54 | // Format, to the specified 'stream', which must be a pointer to a 55 | // 'std::ostream', the specified 'length' bytes of the specified 'data'. 56 | 57 | }; 58 | 59 | //============================================================================= 60 | // INLINE FUNCTION DEFINITIONS 61 | //============================================================================= 62 | 63 | inline 64 | int StreamProxyOstream::writeToStream(const char *data, 65 | int length, 66 | void *stream) 67 | { 68 | reinterpret_cast(stream)->write(data, length); 69 | return 0; 70 | } 71 | 72 | inline 73 | int OstreamWriter(const char *data, int length, void *stream) 74 | { 75 | return StreamProxyOstream::writeToStream(data, length, stream); 76 | } 77 | 78 | } // close namespace blpapi 79 | } // close namespace BloombergLP 80 | 81 | #endif // #ifdef __cplusplus 82 | #endif // #ifndef INCLUDED_BLPAPI_STREAMPROXY 83 | -------------------------------------------------------------------------------- /deps/blpapi/include-3.8.8.1/blpapi_timepoint.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2012. Bloomberg Finance L.P. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: The above 9 | * copyright notice and this permission notice shall be included in all copies 10 | * or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 18 | * IN THE SOFTWARE. 19 | */ 20 | // blpapi_timepoint.h -*-C++-*- 21 | #ifndef INCLUDED_BLPAPI_TIMEPOINT 22 | #define INCLUDED_BLPAPI_TIMEPOINT 23 | //@PURPOSE: Provide a time point with respect to an epoch 24 | // 25 | //@CLASSES: 26 | // blpapi::TimePoint: a fixed moment in a linear model of time 27 | // blpapi::TimePointUtil: namespace for 'TimePoint' Utility functions 28 | // 29 | //@SEE_ALSO: blpapi_highresolutionclock, blpapi_datetime 30 | // 31 | //@DESCRIPTION: This component provides a representation of a fixed moment in 32 | // a strict linear model of time. A function to measure the distance between 33 | // two such moments is provided. Note that such a moment is not associated 34 | // with any particular calendar or wall-clock conventions---see 35 | // 'blpapi_datetime' for such representations (and for functions to apply such 36 | // conventions to an existing time point). 37 | 38 | #ifndef INCLUDED_BLPAPI_CALL 39 | #include 40 | #endif 41 | 42 | #ifndef INCLUDED_BLPAPI_DEFS 43 | #include 44 | #endif 45 | 46 | #ifndef INCLUDED_BLPAPI_TYPES 47 | #include 48 | #endif 49 | 50 | struct blpapi_TimePoint { 51 | // This struct provides an *in-core* *value* *semantic* type for 52 | // representing a single moment in time, assuming a simple linear model of 53 | // time. The precision of such representations is guaranteed to be at 54 | // least at the granularity of nanoseconds, but only times relatively near 55 | // (within a few years of) the current moment are guaranteed to be 56 | // representable. The actual implementation of a time point is 57 | // implementation-defined and opaque to client code; in particular, time 58 | // points can *not* be transferred between processes. (The SDK reserves 59 | // the right to alter the epoch used as a base from run to run.) Clients 60 | // wishing to persist time points should use the 61 | // 'TimePointUtil::nanosecondsBetween' function to measure distance from a 62 | // known epoch value, or convert the time point to some standard calendar 63 | // and wall-clock convention (e.g. 'blpapi::Datetime'). 64 | 65 | blpapi_Int64_t d_value; 66 | }; 67 | 68 | typedef struct blpapi_TimePoint blpapi_TimePoint_t; 69 | 70 | #ifdef __cplusplus 71 | extern "C" { 72 | #endif 73 | 74 | BLPAPI_EXPORT 75 | long long blpapi_TimePointUtil_nanosecondsBetween( 76 | const blpapi_TimePoint_t *start, 77 | const blpapi_TimePoint_t *end); 78 | // Return the difference between 'start' and 'end' 'TimePoint' objects. The 79 | // returned value is in nanoseconds representing 'end - start'. 80 | 81 | #ifdef __cplusplus 82 | } 83 | 84 | namespace BloombergLP { 85 | namespace blpapi { 86 | // ================ 87 | // struct TimePoint 88 | // ================ 89 | 90 | typedef blpapi_TimePoint_t TimePoint; 91 | 92 | // ==================== 93 | // struct TimePointUtil 94 | // ==================== 95 | struct TimePointUtil { 96 | // This provides a namespace for 'TimePoint' utility functions. 97 | 98 | static long long nanosecondsBetween(const TimePoint& start, 99 | const TimePoint& end); 100 | // Return the difference between 'start' and 'end' 'TimePoint' 101 | // objects. The returned value is in nanoseconds representing 102 | // 'end - start'. 103 | }; 104 | 105 | // ============================================================================ 106 | // INLINE AND TEMPLATE FUNCTION IMPLEMENTATIONS 107 | // ============================================================================ 108 | 109 | // -------------------- 110 | // struct TimePointUtil 111 | // -------------------- 112 | 113 | inline 114 | long long TimePointUtil::nanosecondsBetween(const TimePoint& start, 115 | const TimePoint& end) 116 | { 117 | return BLPAPI_CALL_TIMEPOINTUTIL_NANOSECONDSBETWEEN(&start, &end); 118 | } 119 | 120 | } // close namespace blpapi 121 | } // close namespace BloombergLP 122 | 123 | #endif // #ifdef __cplusplus 124 | #endif // #ifndef INCLUDED_BLPAPI_TIMEPOINT 125 | -------------------------------------------------------------------------------- /deps/blpapi/include-3.8.8.1/blpapi_topic.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2012. Bloomberg Finance L.P. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: The above 9 | * copyright notice and this permission notice shall be included in all copies 10 | * or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 18 | * IN THE SOFTWARE. 19 | */ 20 | // blpapi_topic.h -*-C++-*- 21 | #ifndef INCLUDED_BLPAPI_TOPIC 22 | #define INCLUDED_BLPAPI_TOPIC 23 | 24 | //@PURPOSE: Provide representation of a Topic 25 | // 26 | //@CLASSES: 27 | // blpapi::Topic: Represents a Topic 28 | // 29 | //@DESCRIPTION: This component provides a topic that is used for publishing 30 | // data on. 31 | 32 | #ifndef INCLUDED_BLPAPI_DEFS 33 | #include 34 | #endif 35 | 36 | #ifndef INCLUDED_BLPAPI_SERVICE 37 | #include 38 | #endif 39 | 40 | struct blpapi_Topic; 41 | typedef struct blpapi_Topic blpapi_Topic_t; 42 | 43 | #ifdef __cplusplus 44 | extern "C" { 45 | #endif 46 | 47 | BLPAPI_EXPORT 48 | blpapi_Topic_t* blpapi_Topic_create(blpapi_Topic_t* from); 49 | 50 | BLPAPI_EXPORT 51 | void blpapi_Topic_destroy(blpapi_Topic_t* victim); 52 | 53 | BLPAPI_EXPORT 54 | int blpapi_Topic_compare(const blpapi_Topic_t* lhs, const blpapi_Topic_t* rhs); 55 | 56 | BLPAPI_EXPORT 57 | blpapi_Service_t* blpapi_Topic_service(const blpapi_Topic_t *topic); 58 | 59 | BLPAPI_EXPORT 60 | int blpapi_Topic_isActive(const blpapi_Topic_t *topic); 61 | 62 | #ifdef __cplusplus 63 | } 64 | 65 | namespace BloombergLP { 66 | namespace blpapi { 67 | // =========== 68 | // class Topic 69 | // =========== 70 | 71 | class Topic { 72 | // Used to identify the stream on which a message is published. 73 | // 74 | // Topic objects are obtained from createTopic() on 75 | // ProviderSession. They are used when adding a message to an 76 | // Event for publishing using appendMessage() on EventFormatter. 77 | 78 | blpapi_Topic_t *d_handle; 79 | 80 | public: 81 | 82 | Topic(); 83 | // Create a Topic object. A Topic created from the default 84 | // constructor is not a valid topic and must be assigned to 85 | // from a valid topic before it can be used. 86 | 87 | Topic(blpapi_Topic_t* handle); 88 | // Create a Topic object from a handle (main constructor) 89 | 90 | Topic(const Topic& original); 91 | // Create a copy of the specified 'original' Topic. 92 | 93 | ~Topic(); 94 | // Destroy this Topic object. 95 | 96 | // MANIPULATORS 97 | 98 | Topic& operator=(const Topic& rhs); 99 | 100 | // ACCESSORS 101 | 102 | bool isValid() const; 103 | // Returns true if this Topic is valid and can be used to 104 | // publish a message on. 105 | 106 | bool isActive() const; 107 | // Returns true if this topic was elected by the platform to become 108 | // the primary publisher. 109 | 110 | Service service() const; 111 | // Returns the service for which this topic was created. 112 | 113 | const blpapi_Topic_t* impl() const; 114 | 115 | blpapi_Topic_t* impl(); 116 | }; 117 | 118 | bool operator==(Topic const& lhs, Topic const& rhs); 119 | 120 | bool operator!=(Topic const& lhs, Topic const& rhs); 121 | 122 | bool operator<(Topic const& lhs, Topic const& rhs); 123 | 124 | // ============================================================================ 125 | // INLINE FUNCTION DEFINITIONS 126 | // ============================================================================ 127 | 128 | // ----------- 129 | // class Topic 130 | // ----------- 131 | 132 | inline 133 | Topic::Topic() : 134 | d_handle(0) 135 | {} 136 | 137 | inline 138 | Topic::Topic(blpapi_Topic_t* handle) : 139 | d_handle(blpapi_Topic_create(handle)) 140 | {} 141 | 142 | inline 143 | Topic::Topic(Topic const& original) : 144 | d_handle(blpapi_Topic_create(original.d_handle)) 145 | { 146 | } 147 | 148 | inline 149 | Topic::~Topic() 150 | { 151 | blpapi_Topic_destroy(d_handle); 152 | } 153 | 154 | inline 155 | Topic& Topic::operator=(Topic const& rhs) 156 | { 157 | if (this != &rhs) { 158 | blpapi_Topic_destroy(d_handle); 159 | d_handle = blpapi_Topic_create(rhs.d_handle); 160 | } 161 | return *this; 162 | } 163 | 164 | inline 165 | bool Topic::isValid() const 166 | { 167 | return 0 != d_handle; 168 | } 169 | 170 | inline 171 | bool Topic::isActive() const 172 | { 173 | return blpapi_Topic_isActive(d_handle) != 0; 174 | } 175 | 176 | inline 177 | Service Topic::service() const 178 | { 179 | return blpapi_Topic_service(d_handle); 180 | } 181 | 182 | inline 183 | const blpapi_Topic_t* Topic::impl() const 184 | { 185 | return d_handle; 186 | } 187 | 188 | inline 189 | blpapi_Topic_t* Topic::impl() 190 | { 191 | return d_handle; 192 | } 193 | 194 | inline 195 | bool operator==(Topic const& lhs, Topic const& rhs) 196 | { 197 | return blpapi_Topic_compare(lhs.impl(), rhs.impl())==0; 198 | } 199 | 200 | inline 201 | bool operator!=(Topic const& lhs, Topic const& rhs) 202 | { 203 | return blpapi_Topic_compare(lhs.impl(), rhs.impl())!=0; 204 | } 205 | 206 | inline 207 | bool operator<(Topic const& lhs, Topic const& rhs) 208 | { 209 | return blpapi_Topic_compare(lhs.impl(), rhs.impl())<0; 210 | } 211 | 212 | 213 | } // close namespace blpapi 214 | } // close namespace BloombergLP 215 | 216 | #endif // #ifdef __cplusplus 217 | #endif // #ifndef INCLUDED_BLPAPI_TOPIC 218 | -------------------------------------------------------------------------------- /deps/blpapi/include-3.8.8.1/blpapi_types.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2012. Bloomberg Finance L.P. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: The above 9 | * copyright notice and this permission notice shall be included in all copies 10 | * or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 18 | * IN THE SOFTWARE. 19 | */ 20 | // blpapi_types.h -*-C++-*- 21 | #ifndef INCLUDED_BLPAPI_TYPES 22 | #define INCLUDED_BLPAPI_TYPES 23 | 24 | //@PURPOSE: Provide BLPAPI types. 25 | // 26 | //@CLASSES: 27 | // blpapi::DataType: Data types in the schema 28 | // 29 | //@DESCRIPTION: This component implements BLPAPI types. 30 | 31 | typedef int blpapi_Bool_t; 32 | typedef char blpapi_Char_t; 33 | typedef unsigned char blpapi_UChar_t; 34 | typedef short blpapi_Int16_t; 35 | typedef unsigned short blpapi_UInt16_t; 36 | typedef int blpapi_Int32_t; 37 | typedef unsigned int blpapi_UInt32_t; 38 | typedef long long blpapi_Int64_t; 39 | typedef unsigned long long blpapi_UInt64_t; 40 | typedef float blpapi_Float32_t; 41 | typedef double blpapi_Float64_t; 42 | 43 | 44 | enum blpapi_DataType_t { 45 | BLPAPI_DATATYPE_BOOL = 1 // Bool 46 | , BLPAPI_DATATYPE_CHAR = 2 // Char 47 | , BLPAPI_DATATYPE_BYTE = 3 // Unsigned 8 bit value 48 | , BLPAPI_DATATYPE_INT32 = 4 // 32 bit Integer 49 | , BLPAPI_DATATYPE_INT64 = 5 // 64 bit Integer 50 | , BLPAPI_DATATYPE_FLOAT32 = 6 // 32 bit Floating point - IEEE 51 | , BLPAPI_DATATYPE_FLOAT64 = 7 // 64 bit Floating point - IEEE 52 | , BLPAPI_DATATYPE_STRING = 8 // ASCIIZ string 53 | , BLPAPI_DATATYPE_BYTEARRAY = 9 // Opaque binary data 54 | , BLPAPI_DATATYPE_DATE = 10 // Date 55 | , BLPAPI_DATATYPE_TIME = 11 // Timestamp 56 | , BLPAPI_DATATYPE_DECIMAL = 12 // 57 | , BLPAPI_DATATYPE_DATETIME = 13 // Date and time 58 | , BLPAPI_DATATYPE_ENUMERATION = 14 // An opaque enumeration 59 | , BLPAPI_DATATYPE_SEQUENCE = 15 // Sequence type 60 | , BLPAPI_DATATYPE_CHOICE = 16 // Choice type 61 | , BLPAPI_DATATYPE_CORRELATION_ID = 17 // Used for some internal 62 | // messages 63 | }; 64 | 65 | typedef enum blpapi_Logging_Severity_t { 66 | blpapi_Logging_SEVERITY_OFF = 0, 67 | blpapi_Logging_SEVERITY_FATAL = 1, 68 | blpapi_Logging_SEVERITY_ERROR = 2, 69 | blpapi_Logging_SEVERITY_WARN = 3, 70 | blpapi_Logging_SEVERITY_INFO = 4, 71 | blpapi_Logging_SEVERITY_DEBUG = 5, 72 | blpapi_Logging_SEVERITY_TRACE = 6 73 | } blpapi_Logging_Severity_t; 74 | 75 | struct blpapi_AbstractSession; 76 | typedef struct blpapi_AbstractSession blpapi_AbstractSession_t; 77 | 78 | struct blpapi_Constant; 79 | typedef struct blpapi_Constant blpapi_Constant_t; 80 | 81 | struct blpapi_ConstantList; 82 | typedef struct blpapi_ConstantList blpapi_ConstantList_t; 83 | 84 | struct blpapi_Element; 85 | typedef struct blpapi_Element blpapi_Element_t; 86 | 87 | struct blpapi_Event; 88 | typedef struct blpapi_Event blpapi_Event_t; 89 | 90 | struct blpapi_EventDispatcher; 91 | typedef struct blpapi_EventDispatcher blpapi_EventDispatcher_t; 92 | 93 | struct blpapi_EventFormatter; 94 | typedef struct blpapi_EventFormatter blpapi_EventFormatter_t; 95 | 96 | struct blpapi_EventQueue; 97 | typedef struct blpapi_EventQueue blpapi_EventQueue_t; 98 | 99 | struct blpapi_MessageIterator; 100 | typedef struct blpapi_MessageIterator blpapi_MessageIterator_t; 101 | 102 | struct blpapi_Name; 103 | typedef struct blpapi_Name blpapi_Name_t; 104 | 105 | struct blpapi_Operation; 106 | typedef struct blpapi_Operation blpapi_Operation_t; 107 | 108 | struct blpapi_ProviderSession; 109 | typedef struct blpapi_ProviderSession blpapi_ProviderSession_t; 110 | 111 | struct blpapi_Service; 112 | typedef struct blpapi_Service blpapi_Service_t; 113 | 114 | struct blpapi_Session; 115 | typedef struct blpapi_Session blpapi_Session_t; 116 | 117 | struct blpapi_SessionOptions; 118 | typedef struct blpapi_SessionOptions blpapi_SessionOptions_t; 119 | 120 | struct blpapi_SubscriptionItrerator; 121 | typedef struct blpapi_SubscriptionItrerator blpapi_SubscriptionIterator_t; 122 | 123 | struct blpapi_Identity; 124 | typedef struct blpapi_Identity blpapi_UserHandle; 125 | typedef struct blpapi_Identity blpapi_UserHandle_t; 126 | 127 | struct blpapi_Identity; 128 | typedef struct blpapi_Identity blpapi_Identity_t; 129 | 130 | #ifdef __cplusplus 131 | 132 | namespace BloombergLP { 133 | namespace blpapi { 134 | // =============== 135 | // struct DataType 136 | // =============== 137 | 138 | struct DataType { 139 | // Contains the possible data types which can be represented in an 140 | // Element. 141 | 142 | public: 143 | enum Value { 144 | // The possible data types which can be represented in an Element. 145 | BOOL = BLPAPI_DATATYPE_BOOL, // Boolean 146 | CHAR = BLPAPI_DATATYPE_CHAR, // Char 147 | BYTE = BLPAPI_DATATYPE_BYTE, // Unsigned 8 bit value 148 | INT32 = BLPAPI_DATATYPE_INT32, // 32 bit Integer 149 | INT64 = BLPAPI_DATATYPE_INT64, // 64 bit Integer 150 | FLOAT32 = BLPAPI_DATATYPE_FLOAT32, // 32 bit Floating point 151 | FLOAT64 = BLPAPI_DATATYPE_FLOAT64, // 64 bit Floating point 152 | STRING = BLPAPI_DATATYPE_STRING, // ASCIIZ string 153 | BYTEARRAY = BLPAPI_DATATYPE_BYTEARRAY, // Opaque binary data 154 | DATE = BLPAPI_DATATYPE_DATE, // Date 155 | TIME = BLPAPI_DATATYPE_TIME, // Timestamp 156 | DECIMAL = BLPAPI_DATATYPE_DECIMAL, // Currently Unsupported 157 | DATETIME = BLPAPI_DATATYPE_DATETIME, // Date and time 158 | ENUMERATION = BLPAPI_DATATYPE_ENUMERATION, // An opaque enumeration 159 | SEQUENCE = BLPAPI_DATATYPE_SEQUENCE, // Sequence type 160 | CHOICE = BLPAPI_DATATYPE_CHOICE, // Choice type 161 | CORRELATION_ID = BLPAPI_DATATYPE_CORRELATION_ID // Used for some 162 | // internal messages 163 | }; 164 | }; 165 | 166 | typedef blpapi_Bool_t Bool; 167 | typedef blpapi_Char_t Char; 168 | typedef blpapi_UChar_t UChar; 169 | typedef blpapi_Int16_t Int16; 170 | typedef blpapi_UInt16_t UInt16; 171 | typedef blpapi_Int32_t Int32; 172 | typedef blpapi_UInt32_t UInt32; 173 | typedef blpapi_Int64_t Int64; 174 | typedef blpapi_UInt64_t UInt64; 175 | typedef blpapi_Float32_t Float32; 176 | typedef blpapi_Float64_t Float64; 177 | 178 | } // close namespace blpapi 179 | } // close namespace BloombergLP 180 | 181 | #endif // ifdef __cplusplus 182 | 183 | #endif // #ifndef INCLUDED_BLPAPI_TYPES 184 | -------------------------------------------------------------------------------- /deps/blpapi/include-3.8.8.1/blpapi_versioninfo.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2012. Bloomberg Finance L.P. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: The above 9 | * copyright notice and this permission notice shall be included in all copies 10 | * or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 18 | * IN THE SOFTWARE. 19 | */ 20 | // blpapi_versioninfo.h -*-C++-*- 21 | #ifndef INCLUDED_BLPAPI_VERSIONINFO 22 | #define INCLUDED_BLPAPI_VERSIONINFO 23 | 24 | //@PURPOSE: Provide BLPAPI SDK library version information. 25 | // 26 | //@CLASSES: 27 | // blpapi::VersionInfo: basic BLPAPI SDK library version attribute class 28 | // 29 | //@DESCRIPTION: This component provides access the BLPAPI SDK library version 30 | // information. Each version of the BLPAPI library is identified by four 31 | // integers: major, minor, patch, and build. 32 | // 33 | // The current major version is 3; there is no guarantee of compatibility 34 | // between different major versions. 35 | // 36 | // Differences in minor version numbers indicate significant feature additions. 37 | // Standard distributions of the BLPAPI have minor version numbers below 128, 38 | // and higher minor numbers are expected to provide APIs that are a superset of 39 | // the APIs provided by lower minor version numbers; i.e. all functionality and 40 | // interfaces supported by BLPAPI 3.7 is also provided by BLPAPI 3.8, while the 41 | // inverse is not typically true. (Bloomberg occasionally distributes library 42 | // versions with version numbers above 127; consult the release information 43 | // distributed with these libraries to determine interoperability with other 44 | // minor versions.) 45 | // 46 | // Increments to patch numbers indicate performance or stability enhancements 47 | // to the library. 48 | // 49 | // Build numbers typically do not carry any information about the library 50 | // version's functionality, but can be used along with the other parts of the 51 | // build number to uniquely identity a precise library binary version (e.g. for 52 | // the purpose of code signing and auditing). 53 | // 54 | ///Usage 55 | ///----- 56 | ///C++ usage 57 | ///- - - - - 58 | // This example logs the BLPAPI version in order to make the logs analysis more 59 | // productive: 60 | //.. 61 | // blpapi::VersionInfo blpapiVersion; 62 | // // Client log the library version for reference and future debugging 63 | // log("BLPAPI version: %d.%d.%d.%d", 64 | // blpapiVersion.majorVersion(), 65 | // blpapiVersion.minorVersion(), 66 | // blpapiVersion.patchVersion(), 67 | // blpapiVersion.buildVersion()); 68 | //.. 69 | // 70 | ///C usage 71 | ///- - - - 72 | // This example logs the BLPAPI version in order to make the logs analysis more 73 | // productive: 74 | //.. 75 | // int majorVersion, minorVersion, patchVersion, buildVersion; 76 | // blpapi_getVersionInfo(&majorVersion, &minorVersion, &patchVersion, 77 | // &buildVersion); 78 | // // Client log the library version for reference and future debugging 79 | // log("BLPAPI version: %d.%d.%d.%d", majorVersion, minorVersion, 80 | // patchVersion, buildVersion); 81 | //.. 82 | // 83 | // 84 | // This example provide shows how to use the backward API signature 85 | // compatibility macros BLPAPI_SDK_VERSION and BLPAPI_MAKE_VERSION (see 86 | // blpapi_dispatchtbl.h): 87 | //.. 88 | // #if BLPAPI_SDK_VERSION >= BLPAPI_MAKE_VERSION(3, 3, 7) 89 | // // Do version 3.3.7 specific stuff here (e.g. adding functions with old 90 | // // signature to an array so a client code that was compiled with 91 | // // version 3.3.7 will still be able to run using the new version. 92 | // ... 93 | // #elif BLPAPI_SDK_VERSION ... 94 | //.. 95 | 96 | #ifndef INCLUDED_BLPAPI_CALL 97 | #include 98 | #endif 99 | 100 | #ifndef INCLUDED_BLPAPI_DEFS 101 | #include 102 | #endif 103 | 104 | #ifndef INCLUDED_BLPAPI_VERSIONMACROS 105 | #include 106 | #endif 107 | 108 | #ifdef __cplusplus 109 | extern "C" { 110 | #endif // ifdef __cplusplus 111 | 112 | BLPAPI_EXPORT 113 | void blpapi_getVersionInfo(int *majorVersion, 114 | int *minorVersion, 115 | int *patchVersion, 116 | int *buildVersion); 117 | // Initialize the 4 parameters with the current release version information 118 | // which include the following version parts: Major, Minor, Patch, and 119 | // Build. 120 | 121 | BLPAPI_EXPORT 122 | const char *blpapi_getVersionIdentifier(void); 123 | // Return a null-terminated sequence of printable ascii characters (with 124 | // values from 0x20 to 0x7e, inclusive) identifying the version of the 125 | // blpapi runtime library. The lifetime of the returned string is 126 | // guaranteed until the end of `main()` (but is *not* necessarily usable 127 | // during the C++ static destruction phase). 128 | 129 | #ifdef __cplusplus 130 | } 131 | 132 | #include 133 | #include 134 | #include 135 | 136 | namespace BloombergLP { 137 | namespace blpapi { 138 | // ================= 139 | // class VersionInfo 140 | // ================= 141 | class VersionInfo { 142 | // This attribute class holds the four integer components of a BLPAPI 143 | // version number, provides factory methods to obtain such version numbers 144 | // for both the headers used at compile time and the library loaded at run 145 | // time, and provides a static function to obtain an opaque version 146 | // identifer string for use by Bloomberg support. 147 | 148 | private: 149 | // INSTANCE DATA 150 | int d_major; // BLPAPI SDK library major version 151 | int d_minor; // BLPAPI SDK library minor version 152 | int d_patch; // BLPAPI SDK library patch version 153 | int d_build; // BLPAPI SDK library build version 154 | 155 | VersionInfo(int major, int minor, int patch, int build); 156 | // Create a 'VersionInfo' object containing the specified 'major', 157 | // 'minor', 'patch', and 'build' numbers. 158 | 159 | public: 160 | // CREATORS 161 | static VersionInfo headerVersion(); 162 | // Return a 'VersionInfo' object containing the version of the BLPAPI 163 | // headers against which the client application was compiled. Note 164 | // that the version of the BLPAPI library loaded at runtime may be 165 | // different than the version of the headers against which the code was 166 | // compiled. 167 | 168 | static VersionInfo runtimeVersion(); 169 | // Return a 'VersionInfo' object containing the version of the BLPAPI 170 | // runtime library that is currently running. Note that the version of 171 | // the BLPAPI library loaded at runtime may be different than the 172 | // version of the headers against which the code was compiled. 173 | 174 | VersionInfo(); 175 | // This function is a synonym for 'VersionInfo::runtimeVersion()'. 176 | // DEPRECATED 177 | 178 | // ACCESSORS 179 | int majorVersion() const; 180 | // Return the major version number. 181 | int minorVersion() const; 182 | // Return the minor version number. 183 | int patchVersion() const; 184 | // Return the patch version number. 185 | int buildVersion() const; 186 | // Return the build version number. 187 | 188 | static std::string versionIdentifier(); 189 | // Return a string containing a sequence of printable ascii characters 190 | // (with values from 0x20 to 0x7e, inclusive) identifying the version 191 | // of the blpapi runtime library. The format of this string is 192 | // unspecified. 193 | 194 | }; 195 | 196 | std::ostream& operator<<(std::ostream& stream, const VersionInfo& rhs); 197 | // Output the specified 'rhs' to the specified 'stream' in a human-readable 198 | // format. Note that the exact details of this format are not specified 199 | // and may be differ between different library versions. 200 | 201 | //============================================================================= 202 | // INLINE FUNCTION DEFINITIONS 203 | //============================================================================= 204 | 205 | // ----------------- 206 | // class VersionInfo 207 | // ----------------- 208 | // CREATORS 209 | inline 210 | VersionInfo::VersionInfo(int major, int minor, int patch, int build) 211 | : d_major(major) 212 | , d_minor(minor) 213 | , d_patch(patch) 214 | , d_build(build) 215 | { 216 | } 217 | 218 | inline 219 | VersionInfo VersionInfo::headerVersion() 220 | { 221 | return VersionInfo(BLPAPI_VERSION_MAJOR, 222 | BLPAPI_VERSION_MINOR, 223 | BLPAPI_VERSION_PATCH, 224 | BLPAPI_VERSION_BUILD); 225 | } 226 | 227 | inline 228 | VersionInfo VersionInfo::runtimeVersion() 229 | { 230 | int major, minor, patch, build; 231 | blpapi_getVersionInfo(&major, &minor, &patch, &build); 232 | return VersionInfo(major, minor, patch, build); 233 | } 234 | 235 | inline 236 | VersionInfo::VersionInfo() 237 | { 238 | blpapi_getVersionInfo(&d_major, &d_minor, &d_patch, &d_build); 239 | } 240 | 241 | // ACCESSORS 242 | inline 243 | int VersionInfo::majorVersion() const 244 | { 245 | return d_major; 246 | } 247 | 248 | inline 249 | int VersionInfo::minorVersion() const 250 | { 251 | return d_minor; 252 | } 253 | 254 | inline 255 | int VersionInfo::patchVersion() const 256 | { 257 | return d_patch; 258 | } 259 | 260 | inline 261 | int VersionInfo::buildVersion() const 262 | { 263 | return d_build; 264 | } 265 | 266 | inline 267 | std::string VersionInfo::versionIdentifier() 268 | { 269 | std::ostringstream oss; 270 | oss << "blpapi-cpp; headers " 271 | << headerVersion() 272 | << "; runtime " 273 | << runtimeVersion(); 274 | if (BLPAPI_CALL_AVAILABLE(blpapi_getVersionIdentifier)) { 275 | oss << '-' << BLPAPI_CALL(blpapi_getVersionIdentifier)(); 276 | } 277 | return oss.str(); 278 | } 279 | 280 | inline 281 | std::ostream& operator<<(std::ostream& stream, const VersionInfo& rhs) 282 | { 283 | return stream << rhs.majorVersion() << '.' 284 | << rhs.minorVersion() << '.' 285 | << rhs.patchVersion() << '.' 286 | << rhs.buildVersion(); 287 | } 288 | 289 | } // close namespace blpapi 290 | } // close namespace BloombergLP 291 | 292 | #endif // ifdef __cplusplus 293 | 294 | #endif // INCLUDED_BLPAPI_VERSIONINFO 295 | -------------------------------------------------------------------------------- /deps/blpapi/include-3.8.8.1/blpapi_versionmacros.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2012. Bloomberg Finance L.P. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: The above 9 | * copyright notice and this permission notice shall be included in all copies 10 | * or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 18 | * IN THE SOFTWARE. 19 | */ 20 | // blpapi_versionmacros.h -*-C++-*- 21 | #ifndef INCLUDED_BLPAPI_VERSIONMACROS 22 | #define INCLUDED_BLPAPI_VERSIONMACROS 23 | 24 | //@PURPOSE: Provide preprocessor macros for BLPAPI library version information. 25 | // 26 | //@DESCRIPTION: This file is not meant to be included directly; see 27 | // 'blpapi_versioninfo.h' for library version interfaces. 28 | 29 | #define BLPAPI_VERSION_MAJOR 3 30 | #define BLPAPI_VERSION_MINOR 8 31 | #define BLPAPI_VERSION_PATCH 8 32 | #define BLPAPI_VERSION_BUILD 1 33 | 34 | #define BLPAPI_MAKE_VERSION(MAJOR, MINOR, PATCH) ((MAJOR) * 65536 + \ 35 | (MINOR) * 256 + \ 36 | (PATCH)) 37 | // Combine the specified 'MAJOR', 'MINOR', and 'PATCH' values to form 38 | // a single integer that can be used for comparisons at compile time. 39 | 40 | #define BLPAPI_SDK_VERSION BLPAPI_MAKE_VERSION(BLPAPI_VERSION_MAJOR, \ 41 | BLPAPI_VERSION_MINOR, \ 42 | BLPAPI_VERSION_PATCH) 43 | // Form a single integer representing the version of the BLPAPI headers 44 | // that can be compared with values formed by 'BLPAPI_MAKE_VERSION' at 45 | // compile time. 46 | 47 | #endif // INCLUDED_BLPAPI_VERSIONMACROS 48 | -------------------------------------------------------------------------------- /deps/blpapi/linux/libblpapi3_32.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bloomberg/blpapi-node/762e61d7593f6f4c24801b3ee685f27760d6b2a8/deps/blpapi/linux/libblpapi3_32.so -------------------------------------------------------------------------------- /deps/blpapi/linux/libblpapi3_64.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bloomberg/blpapi-node/762e61d7593f6f4c24801b3ee685f27760d6b2a8/deps/blpapi/linux/libblpapi3_64.so -------------------------------------------------------------------------------- /deps/blpapi/osx/libblpapi3_32.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bloomberg/blpapi-node/762e61d7593f6f4c24801b3ee685f27760d6b2a8/deps/blpapi/osx/libblpapi3_32.so -------------------------------------------------------------------------------- /deps/blpapi/osx/libblpapi3_64.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bloomberg/blpapi-node/762e61d7593f6f4c24801b3ee685f27760d6b2a8/deps/blpapi/osx/libblpapi3_64.so -------------------------------------------------------------------------------- /deps/blpapi/win/blpapi3_32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bloomberg/blpapi-node/762e61d7593f6f4c24801b3ee685f27760d6b2a8/deps/blpapi/win/blpapi3_32.dll -------------------------------------------------------------------------------- /deps/blpapi/win/blpapi3_32.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bloomberg/blpapi-node/762e61d7593f6f4c24801b3ee685f27760d6b2a8/deps/blpapi/win/blpapi3_32.lib -------------------------------------------------------------------------------- /deps/blpapi/win/blpapi3_64.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bloomberg/blpapi-node/762e61d7593f6f4c24801b3ee685f27760d6b2a8/deps/blpapi/win/blpapi3_64.dll -------------------------------------------------------------------------------- /deps/blpapi/win/blpapi3_64.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bloomberg/blpapi-node/762e61d7593f6f4c24801b3ee685f27760d6b2a8/deps/blpapi/win/blpapi3_64.lib -------------------------------------------------------------------------------- /examples/AuthorizationApplication.js: -------------------------------------------------------------------------------- 1 | var c = require('./Console.js'); 2 | var blpapi = require('blpapi'); 3 | 4 | var hp = c.getHostPort(); 5 | 6 | if (process.argv.length != 4) { 7 | c.usage(''); 8 | } 9 | var appname = process.argv[3]; 10 | 11 | var ao = 'AuthenticationMode=APPLICATION_ONLY;' + 12 | 'ApplicationAuthenticationType=APPNAME_AND_KEY;' + 13 | 'ApplicationName=' + appname; 14 | var session = new blpapi.Session({ serverHost: hp.serverHost, 15 | serverPort: hp.serverPort, 16 | authenticationOptions: ao }); 17 | var service_apiauth = 1; // Unique identifier for apiauth service 18 | var request_apiauth = 100; // Unique identifier for apiauth request 19 | 20 | session.on('SessionStarted', function(m) { 21 | session.openService('//blp/apiauth', service_apiauth); 22 | }); 23 | 24 | session.on('ServiceOpened', function(m) { 25 | // Check to ensure the opened service is the apiauth service 26 | if (m.correlations[0].value == service_apiauth) { 27 | try { 28 | session.authorize('//blp/apiauth', request_apiauth); 29 | } catch(e) { 30 | console.log('Authorization request failure:', e); 31 | session.stop(); 32 | } 33 | } 34 | }); 35 | 36 | session.on('AuthorizationSuccess', function(m) { 37 | // Match correlation identifier used when authorizing 38 | if (m.correlations[0].value == request_apiauth) { 39 | console.log('Authorization successful.'); 40 | session.stop(); 41 | } 42 | }); 43 | 44 | session.on('AuthorizationFailure', function(m) { 45 | // Match correlation identifier used when authorizing 46 | if (m.correlations[0].value == request_apiauth) { 47 | console.log('Authorization response failure.'); 48 | session.stop(); 49 | } 50 | }); 51 | 52 | session.on('SessionTerminated', function(m) { 53 | // Once the session is stopped, release the event loop 54 | session.destroy(); 55 | }); 56 | 57 | session.start(); 58 | 59 | // Local variables: 60 | // c-basic-offset: 4 61 | // tab-width: 4 62 | // indent-tabs-mode: nil 63 | // End: 64 | // 65 | // vi: set shiftwidth=4 tabstop=4 expandtab: 66 | // :indentSize=4:tabSize=4:noTabs=true: 67 | 68 | // ---------------------------------------------------------------------------- 69 | // Copyright (C) 2014 Bloomberg L.P. 70 | // 71 | // Permission is hereby granted, free of charge, to any person obtaining a copy 72 | // of this software and associated documentation files (the "Software"), to 73 | // deal in the Software without restriction, including without limitation the 74 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 75 | // sell copies of the Software, and to permit persons to whom the Software is 76 | // furnished to do so, subject to the following conditions: 77 | // 78 | // The above copyright notice and this permission notice shall be included in 79 | // all copies or substantial portions of the Software. 80 | // 81 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 82 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 83 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 84 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 85 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 86 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 87 | // IN THE SOFTWARE. 88 | // ----------------------------- END-OF-FILE ---------------------------------- 89 | -------------------------------------------------------------------------------- /examples/Console.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var util = require('util'); 3 | 4 | // Utility for console apps monitoring market data. 5 | // 6 | // When the user hits or , stop the session and 7 | // destroy it once the 'SessionTerminated' message is received. 8 | // This is intended for console apps which continually monitor 9 | // data and are not request/response based. 10 | module.exports.createConsole = function(session) { 11 | session.on('SessionTerminated', function(m) { 12 | session.destroy(); 13 | process.exit(); 14 | }); 15 | }; 16 | 17 | // Utility to print command line usage. 18 | module.exports.usage = function(extra) { 19 | console.log('Usage:', 20 | process.argv[0], 21 | path.basename(process.argv[1]), 22 | '[:]', extra); 23 | process.exit(-1); 24 | }; 25 | 26 | // Utility to extract host:port information from the command line. 27 | module.exports.getHostPort = function() { 28 | if (process.argv.length < 3) { 29 | module.exports.usage('...'); 30 | } 31 | var hp = /\b((?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))\b(?::([\d]+))?/.exec(process.argv[2]); 32 | if (hp === null) 33 | module.exports.usage('...'); 34 | var port = (hp[2] === undefined) ? 8194 : hp[2]; 35 | return { serverHost: hp[1], serverPort: parseInt(port) }; 36 | }; 37 | 38 | // Utility for dumping full message contents to the console. 39 | module.exports.log = function(m) { 40 | if (m) 41 | console.log(m.messageType, '=>', 42 | (m ? util.inspect(m, true, null) : 'null')); 43 | }; 44 | 45 | // Local variables: 46 | // c-basic-offset: 4 47 | // tab-width: 4 48 | // indent-tabs-mode: nil 49 | // End: 50 | // 51 | // vi: set shiftwidth=4 tabstop=4 expandtab: 52 | // :indentSize=4:tabSize=4:noTabs=true: 53 | 54 | // ---------------------------------------------------------------------------- 55 | // Copyright (C) 2014 Bloomberg L.P. 56 | // 57 | // Permission is hereby granted, free of charge, to any person obtaining a copy 58 | // of this software and associated documentation files (the "Software"), to 59 | // deal in the Software without restriction, including without limitation the 60 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 61 | // sell copies of the Software, and to permit persons to whom the Software is 62 | // furnished to do so, subject to the following conditions: 63 | // 64 | // The above copyright notice and this permission notice shall be included in 65 | // all copies or substantial portions of the Software. 66 | // 67 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 68 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 69 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 70 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 71 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 72 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 73 | // IN THE SOFTWARE. 74 | // ----------------------------- END-OF-FILE ---------------------------------- 75 | -------------------------------------------------------------------------------- /examples/FieldSearchRequest.js: -------------------------------------------------------------------------------- 1 | var c = require('./Console.js'); 2 | var blpapi = require('blpapi'); 3 | 4 | var hp = c.getHostPort(); 5 | // Add 'authenticationOptions' key to session options if necessary. 6 | var session = new blpapi.Session({ serverHost: hp.serverHost, 7 | serverPort: hp.serverPort }); 8 | var service_apiflds = 1; // Unique identifier for apiflds service 9 | 10 | if (process.argv.length != 4) { 11 | c.usage(''); 12 | } 13 | var search = process.argv[3]; 14 | 15 | session.on('SessionStarted', function(m) { 16 | session.openService('//blp/apiflds', service_apiflds); 17 | }); 18 | 19 | session.on('ServiceOpened', function(m) { 20 | // Check to ensure the opened service is the apiflds service 21 | if (m.correlations[0].value == service_apiflds) { 22 | session.request('//blp/apiflds', 'FieldSearchRequest', 23 | { searchSpec: search }, 100); 24 | } 25 | }); 26 | 27 | var results = 0; 28 | var limit = 20; 29 | 30 | session.on('fieldResponse', function(m) { 31 | //c.log(m); 32 | // At this point, m.correlations[0].value will equal: 33 | // 100 -> FieldResponse for the free-form FieldSearchRequest 34 | if (m.correlations[0].value == 100) { 35 | if (results < limit) { 36 | for (var i in m.data.fieldData) { 37 | var fd = m.data.fieldData[i]; 38 | console.log(fd.fieldInfo.mnemonic, "=>", 39 | fd.fieldInfo.description); 40 | results++; 41 | if (results === limit) 42 | break; 43 | } 44 | } 45 | // Stop once the final response is received 46 | if (m.eventType === 'RESPONSE') { 47 | session.stop(); 48 | } 49 | } 50 | }); 51 | 52 | session.on('SessionTerminated', function(m) { 53 | // Once the session is stopped, release the event loop 54 | session.destroy(); 55 | }); 56 | 57 | session.start(); 58 | 59 | // Local variables: 60 | // c-basic-offset: 4 61 | // tab-width: 4 62 | // indent-tabs-mode: nil 63 | // End: 64 | // 65 | // vi: set shiftwidth=4 tabstop=4 expandtab: 66 | // :indentSize=4:tabSize=4:noTabs=true: 67 | 68 | // ---------------------------------------------------------------------------- 69 | // Copyright (C) 2014 Bloomberg L.P. 70 | // 71 | // Permission is hereby granted, free of charge, to any person obtaining a copy 72 | // of this software and associated documentation files (the "Software"), to 73 | // deal in the Software without restriction, including without limitation the 74 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 75 | // sell copies of the Software, and to permit persons to whom the Software is 76 | // furnished to do so, subject to the following conditions: 77 | // 78 | // The above copyright notice and this permission notice shall be included in 79 | // all copies or substantial portions of the Software. 80 | // 81 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 82 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 83 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 84 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 85 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 86 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 87 | // IN THE SOFTWARE. 88 | // ----------------------------- END-OF-FILE ---------------------------------- 89 | -------------------------------------------------------------------------------- /examples/HistoricalDataRequest.js: -------------------------------------------------------------------------------- 1 | var c = require('./Console.js'); 2 | var blpapi = require('blpapi'); 3 | 4 | var hp = c.getHostPort(); 5 | // Add 'authenticationOptions' key to session options if necessary. 6 | var session = new blpapi.Session({ serverHost: hp.serverHost, 7 | serverPort: hp.serverPort }); 8 | var service_refdata = 1; // Unique identifier for refdata service 9 | 10 | var seclist = ['AAPL US Equity', 'VOD LN Equity']; 11 | 12 | session.on('SessionStarted', function(m) { 13 | c.log(m); 14 | session.openService('//blp/refdata', service_refdata); 15 | }); 16 | 17 | session.on('ServiceOpened', function(m) { 18 | c.log(m); 19 | // Check to ensure the opened service is the refdata service 20 | if (m.correlations[0].value == service_refdata) { 21 | // Request the long-form company name for each security 22 | session.request('//blp/refdata', 'ReferenceDataRequest', 23 | { securities: seclist, fields: ['LONG_COMP_NAME'] }, 100); 24 | // Request intraday tick data for each security, 10:30 - 14:30 25 | session.request('//blp/refdata', 'HistoricalDataRequest', 26 | { securities: seclist, 27 | fields: ['PX_LAST', 'OPEN'], 28 | startDate: "20120101", 29 | endDate: "20120301", 30 | periodicitySelection: "DAILY" }, 101); 31 | } 32 | }); 33 | 34 | var responses = 0; 35 | function checkStop() { 36 | responses++; 37 | // Signal stop once all final responses have been received 38 | if (responses == 2) 39 | session.stop(); 40 | } 41 | 42 | session.on('ReferenceDataResponse', function(m) { 43 | c.log(m); 44 | // At this point, m.correlations[0].value will equal: 45 | // 100 -> ReferenceDataResponse for long-form company names 46 | if (m.correlations[0].value === 100 && m.eventType === 'RESPONSE') 47 | checkStop(); 48 | }); 49 | 50 | session.on('HistoricalDataResponse', function(m) { 51 | c.log(m); 52 | // At this point, m.correlations[0].value will equal: 53 | // 101 -> HistoricalDataResponse for both securities 54 | // 55 | // m.eventType == 'PARTIAL_RESPONSE' until finally 56 | // m.eventType == 'RESPONSE' to indicate there is no more data 57 | if (m.correlations[0].value === 101 && m.eventType === 'RESPONSE') 58 | checkStop(); 59 | }); 60 | 61 | session.on('SessionTerminated', function(m) { 62 | session.destroy(); 63 | }); 64 | 65 | session.start(); 66 | 67 | // Local variables: 68 | // c-basic-offset: 4 69 | // tab-width: 4 70 | // indent-tabs-mode: nil 71 | // End: 72 | // 73 | // vi: set shiftwidth=4 tabstop=4 expandtab: 74 | // :indentSize=4:tabSize=4:noTabs=true: 75 | 76 | // ---------------------------------------------------------------------------- 77 | // Copyright (C) 2014 Bloomberg L.P. 78 | // 79 | // Permission is hereby granted, free of charge, to any person obtaining a copy 80 | // of this software and associated documentation files (the "Software"), to 81 | // deal in the Software without restriction, including without limitation the 82 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 83 | // sell copies of the Software, and to permit persons to whom the Software is 84 | // furnished to do so, subject to the following conditions: 85 | // 86 | // The above copyright notice and this permission notice shall be included in 87 | // all copies or substantial portions of the Software. 88 | // 89 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 90 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 91 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 92 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 93 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 94 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 95 | // IN THE SOFTWARE. 96 | // ----------------------------- END-OF-FILE ---------------------------------- 97 | -------------------------------------------------------------------------------- /examples/IntradayBarRequest.js: -------------------------------------------------------------------------------- 1 | var c = require('./Console.js'); 2 | var blpapi = require('blpapi'); 3 | 4 | var hp = c.getHostPort(); 5 | // Add 'authenticationOptions' key to session options if necessary. 6 | var session = new blpapi.Session({ serverHost: hp.serverHost, 7 | serverPort: hp.serverPort }); 8 | var service_refdata = 1; // Unique identifier for refdata service 9 | 10 | var seclist = ['AAPL US Equity', 'VOD LN Equity']; 11 | 12 | session.on('SessionStarted', function(m) { 13 | c.log(m); 14 | session.openService('//blp/refdata', service_refdata); 15 | }); 16 | 17 | session.on('ServiceOpened', function(m) { 18 | c.log(m); 19 | // Check to ensure the opened service is the refdata service 20 | if (m.correlations[0].value == service_refdata) { 21 | // Request the long-form company name for each security 22 | session.request('//blp/refdata', 'ReferenceDataRequest', 23 | { securities: seclist, fields: ['LONG_COMP_NAME'] }, 100); 24 | // Request intraday tick data for each security, 10:30 - 14:30 25 | session.request('//blp/refdata', 'IntradayBarRequest', 26 | { security: seclist[0], 27 | eventType: 'TRADE', interval: 60, 28 | startDateTime: new Date(2012, 2, 1, 10, 30, 0, 0), 29 | endDateTime: new Date(2012, 2, 1, 14, 30, 0, 0) }, 101); 30 | session.request('//blp/refdata', 'IntradayBarRequest', 31 | { security: seclist[1], 32 | eventType: 'TRADE', interval: 60, 33 | startDateTime: new Date(2012, 2, 1, 10, 30, 0, 0), 34 | endDateTime: new Date(2012, 2, 1, 14, 30, 0, 0) }, 102); 35 | // NOTE: Intraday bar data is only available for a limited 36 | // historical window. Adjust the YYYY-MM-DD values if 37 | // running this example in the far future. No data will 38 | // be returned if the date is > 140 days in the past. 39 | } 40 | }); 41 | 42 | var responses = 0; 43 | function checkStop() { 44 | responses++; 45 | // Signal stop once all final responses have been received 46 | if (responses == 3) 47 | session.stop(); 48 | } 49 | 50 | session.on('ReferenceDataResponse', function(m) { 51 | c.log(m); 52 | // At this point, m.correlations[0].value will equal: 53 | // 100 -> ReferenceDataResponse for long-form company names 54 | if (m.correlations[0].value === 100 && m.eventType === 'RESPONSE') 55 | checkStop(); 56 | }); 57 | 58 | session.on('IntradayBarResponse', function(m) { 59 | c.log(m); 60 | // At this point, m.correlations[0].value will equal: 61 | // 101 -> IntradayBarResponse for AAPL US Equity 62 | // 102 -> IntradayBarResponse for VOD LN Equity 63 | // 64 | // m.eventType == 'PARTIAL_RESPONSE' until finally 65 | // m.eventType == 'RESPONSE' to indicate there is no more data 66 | if ((m.correlations[0].value === 101 || 67 | m.correlations[0].value === 102) && 68 | m.eventType === 'RESPONSE') 69 | checkStop(); 70 | }); 71 | 72 | session.on('SessionTerminated', function(m) { 73 | session.destroy(); 74 | }); 75 | 76 | session.start(); 77 | 78 | // Local variables: 79 | // c-basic-offset: 4 80 | // tab-width: 4 81 | // indent-tabs-mode: nil 82 | // End: 83 | // 84 | // vi: set shiftwidth=4 tabstop=4 expandtab: 85 | // :indentSize=4:tabSize=4:noTabs=true: 86 | 87 | // ---------------------------------------------------------------------------- 88 | // Copyright (C) 2014 Bloomberg L.P. 89 | // 90 | // Permission is hereby granted, free of charge, to any person obtaining a copy 91 | // of this software and associated documentation files (the "Software"), to 92 | // deal in the Software without restriction, including without limitation the 93 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 94 | // sell copies of the Software, and to permit persons to whom the Software is 95 | // furnished to do so, subject to the following conditions: 96 | // 97 | // The above copyright notice and this permission notice shall be included in 98 | // all copies or substantial portions of the Software. 99 | // 100 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 101 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 102 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 103 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 104 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 105 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 106 | // IN THE SOFTWARE. 107 | // ----------------------------- END-OF-FILE ---------------------------------- 108 | -------------------------------------------------------------------------------- /examples/IntradayTickRequest.js: -------------------------------------------------------------------------------- 1 | var c = require('./Console.js'); 2 | var blpapi = require('blpapi'); 3 | 4 | var hp = c.getHostPort(); 5 | // Add 'authenticationOptions' key to session options if necessary. 6 | var session = new blpapi.Session({ serverHost: hp.serverHost, 7 | serverPort: hp.serverPort }); 8 | var service_refdata = 1; // Unique identifier for refdata service 9 | 10 | var seclist = ['AAPL US Equity', 'VOD LN Equity']; 11 | 12 | session.on('SessionStarted', function(m) { 13 | c.log(m); 14 | session.openService('//blp/refdata', service_refdata); 15 | }); 16 | 17 | session.on('ServiceOpened', function(m) { 18 | c.log(m); 19 | // Check to ensure the opened service is the refdata service 20 | if (m.correlations[0].value == service_refdata) { 21 | // Request the long-form company name for each security 22 | session.request('//blp/refdata', 'ReferenceDataRequest', 23 | { securities: seclist, fields: ['LONG_COMP_NAME'] }, 100); 24 | // Request intraday tick data for each security, 10:30 - 11:00 25 | session.request('//blp/refdata', 'IntradayTickRequest', 26 | { security: seclist[0], 27 | eventTypes: ['TRADE'], 28 | startDateTime: new Date(2012, 2, 1, 10, 30, 0, 0), 29 | endDateTime: new Date(2012, 2, 1, 11, 00, 0, 0) }, 101); 30 | session.request('//blp/refdata', 'IntradayTickRequest', 31 | { security: seclist[1], 32 | eventTypes: ['TRADE'], 33 | startDateTime: new Date(2012, 2, 1, 10, 30, 0, 0), 34 | endDateTime: new Date(2012, 2, 1, 11, 00, 0, 0) }, 102); 35 | // NOTE: Intraday tick data is only available for a limited 36 | // historical window. Adjust the YYYY-MM-DD values if 37 | // running this example in the far future. No data will 38 | // be returned if the date is > 140 days in the past. 39 | } 40 | }); 41 | 42 | var responses = 0; 43 | function checkStop() { 44 | responses++; 45 | // Signal stop once all final responses have been received 46 | if (responses == 3) 47 | session.stop(); 48 | } 49 | 50 | session.on('ReferenceDataResponse', function(m) { 51 | c.log(m); 52 | // At this point, m.correlations[0].value will equal: 53 | // 100 -> ReferenceDataResponse for long-form company names 54 | if (m.correlations[0].value === 100 && m.eventType === 'RESPONSE') 55 | checkStop(); 56 | }); 57 | 58 | session.on('IntradayTickResponse', function(m) { 59 | c.log(m); 60 | // At this point, m.correlations[0].value will equal: 61 | // 101 -> IntradayTickResponse for AAPL US Equity 62 | // 102 -> IntradayTickResponse for VOD LN Equity 63 | // 64 | // m.eventType == 'PARTIAL_RESPONSE' until finally 65 | // m.eventType == 'RESPONSE' to indicate there is no more data 66 | if ((m.correlations[0].value === 101 || 67 | m.correlations[0].value === 102) && 68 | m.eventType === 'RESPONSE') 69 | checkStop(); 70 | }); 71 | 72 | session.on('SessionTerminated', function(m) { 73 | session.destroy(); 74 | }); 75 | 76 | session.start(); 77 | 78 | // Local variables: 79 | // c-basic-offset: 4 80 | // tab-width: 4 81 | // indent-tabs-mode: nil 82 | // End: 83 | // 84 | // vi: set shiftwidth=4 tabstop=4 expandtab: 85 | // :indentSize=4:tabSize=4:noTabs=true: 86 | 87 | // ---------------------------------------------------------------------------- 88 | // Copyright (C) 2014 Bloomberg L.P. 89 | // 90 | // Permission is hereby granted, free of charge, to any person obtaining a copy 91 | // of this software and associated documentation files (the "Software"), to 92 | // deal in the Software without restriction, including without limitation the 93 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 94 | // sell copies of the Software, and to permit persons to whom the Software is 95 | // furnished to do so, subject to the following conditions: 96 | // 97 | // The above copyright notice and this permission notice shall be included in 98 | // all copies or substantial portions of the Software. 99 | // 100 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 101 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 102 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 103 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 104 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 105 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 106 | // IN THE SOFTWARE. 107 | // ----------------------------- END-OF-FILE ---------------------------------- 108 | -------------------------------------------------------------------------------- /examples/MarketBarSubscription.js: -------------------------------------------------------------------------------- 1 | var c = require('./Console.js'); 2 | var blpapi = require('blpapi'); 3 | 4 | var hp = c.getHostPort(); 5 | // Add 'authenticationOptions' key to session options if necessary. 6 | var session = new blpapi.Session({ serverHost: hp.serverHost, 7 | serverPort: hp.serverPort }); 8 | var service_mktbar = 1; // Unique identifier for mktbar service 9 | 10 | var seclist = ['//blp/mktbar/ticker/AAPL US Equity', 11 | '//blp/mktbar/ticker/VOD LN Equity']; 12 | 13 | session.on('SessionStarted', function(m) { 14 | c.log(m); 15 | session.openService('//blp/mktbar', service_mktbar); 16 | }); 17 | 18 | session.on('ServiceOpened', function(m) { 19 | c.log(m); 20 | // Check to ensure the opened service is the mktbar service 21 | if (m.correlations[0].value == service_mktbar) { 22 | // Subscribe to market bars for each security 23 | session.subscribe([ 24 | { security: seclist[0], correlation: 100, 25 | fields: ['LAST_PRICE'], options: { interval: 5 } }, 26 | { security: seclist[1], correlation: 101, 27 | fields: ['LAST_PRICE'], options: { interval: 5 } } 28 | ]); 29 | } 30 | }); 31 | 32 | session.on('MarketBarStart', function(m) { 33 | c.log(m); 34 | // At this point, m.correlations[0].value will equal: 35 | // 100 -> MarketBarStart for AAPL US Equity 36 | // 101 -> MarketBarStart for VOD LN Equity 37 | }); 38 | 39 | session.on('MarketBarUpdate', function(m) { 40 | c.log(m); 41 | // At this point, m.correlations[0].value will equal: 42 | // 100 -> MarketBarUpdate for AAPL US Equity 43 | // 101 -> MarketBarUpdate for VOD LN Equity 44 | }); 45 | 46 | session.on('MarketBarEnd', function(m) { 47 | c.log(m); 48 | // At this point, m.correlations[0].value will equal: 49 | // 100 -> MarketBarEnd for AAPL US Equity 50 | // 101 -> MarketBarEnd for VOD LN Equity 51 | }); 52 | 53 | // Helper to put the console in raw mode and shutdown session on close 54 | c.createConsole(session); 55 | 56 | session.start(); 57 | 58 | // Local variables: 59 | // c-basic-offset: 4 60 | // tab-width: 4 61 | // indent-tabs-mode: nil 62 | // End: 63 | // 64 | // vi: set shiftwidth=4 tabstop=4 expandtab: 65 | // :indentSize=4:tabSize=4:noTabs=true: 66 | 67 | // ---------------------------------------------------------------------------- 68 | // Copyright (C) 2014 Bloomberg L.P. 69 | // 70 | // Permission is hereby granted, free of charge, to any person obtaining a copy 71 | // of this software and associated documentation files (the "Software"), to 72 | // deal in the Software without restriction, including without limitation the 73 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 74 | // sell copies of the Software, and to permit persons to whom the Software is 75 | // furnished to do so, subject to the following conditions: 76 | // 77 | // The above copyright notice and this permission notice shall be included in 78 | // all copies or substantial portions of the Software. 79 | // 80 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 81 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 82 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 83 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 84 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 85 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 86 | // IN THE SOFTWARE. 87 | // ----------------------------- END-OF-FILE ---------------------------------- 88 | -------------------------------------------------------------------------------- /examples/MarketSubUnsubscription.js: -------------------------------------------------------------------------------- 1 | var c = require('./Console.js'); 2 | var blpapi = require('blpapi'); 3 | 4 | var hp = c.getHostPort(); 5 | // Add 'authenticationOptions' key to session options if necessary. 6 | var session = new blpapi.Session({ serverHost: hp.serverHost, 7 | serverPort: hp.serverPort }); 8 | var service_mktdata = 1; // Unique identifier for mktdata service 9 | 10 | var seclist = ['AAPL US Equity', 'VOD LN Equity']; 11 | 12 | session.on('SessionStarted', function(m) { 13 | c.log(m); 14 | session.openService('//blp/mktdata', service_mktdata); 15 | }); 16 | 17 | var sublist = [ 18 | { security: seclist[0], correlation: 100, fields: ['LAST_PRICE', 'BID', 'ASK'] }, 19 | { security: seclist[1], correlation: 101, fields: ['LAST_PRICE', 'BID', 'ASK'] } 20 | ]; 21 | 22 | session.on('ServiceOpened', function(m) { 23 | c.log(m); 24 | // Check to ensure the opened service is the mktdata service 25 | if (m.correlations[0].value == service_mktdata) { 26 | // Subscribe to market bars for each security 27 | session.subscribe(sublist); 28 | 29 | setTimeout(function() { 30 | session.unsubscribe(sublist); 31 | }, 10000); 32 | } 33 | }); 34 | 35 | session.on('MarketDataEvents', function(m) { 36 | c.log(m); 37 | // At this point, m.correlations[0].value will equal: 38 | // 100 -> MarketBarStart for AAPL US Equity 39 | // 101 -> MarketBarStart for VOD LN Equity 40 | }); 41 | 42 | // Helper to put the console in raw mode and shutdown session on close 43 | c.createConsole(session); 44 | 45 | session.start(); 46 | 47 | // Local variables: 48 | // c-basic-offset: 4 49 | // tab-width: 4 50 | // indent-tabs-mode: nil 51 | // End: 52 | // 53 | // vi: set shiftwidth=4 tabstop=4 expandtab: 54 | // :indentSize=4:tabSize=4:noTabs=true: 55 | 56 | // ---------------------------------------------------------------------------- 57 | // Copyright (C) 2014 Bloomberg L.P. 58 | // 59 | // Permission is hereby granted, free of charge, to any person obtaining a copy 60 | // of this software and associated documentation files (the "Software"), to 61 | // deal in the Software without restriction, including without limitation the 62 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 63 | // sell copies of the Software, and to permit persons to whom the Software is 64 | // furnished to do so, subject to the following conditions: 65 | // 66 | // The above copyright notice and this permission notice shall be included in 67 | // all copies or substantial portions of the Software. 68 | // 69 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 70 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 71 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 72 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 73 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 74 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 75 | // IN THE SOFTWARE. 76 | // ----------------------------- END-OF-FILE ---------------------------------- 77 | -------------------------------------------------------------------------------- /examples/MarketSubscription.js: -------------------------------------------------------------------------------- 1 | var c = require('./Console.js'); 2 | var blpapi = require('blpapi'); 3 | 4 | var hp = c.getHostPort(); 5 | // Add 'authenticationOptions' key to session options if necessary. 6 | var session = new blpapi.Session({ serverHost: hp.serverHost, 7 | serverPort: hp.serverPort }); 8 | var service_mktdata = 1; // Unique identifier for mktdata service 9 | 10 | var seclist = ['AAPL US Equity', 'VOD LN Equity']; 11 | 12 | session.on('SessionStarted', function(m) { 13 | c.log(m); 14 | session.openService('//blp/mktdata', service_mktdata); 15 | }); 16 | 17 | session.on('ServiceOpened', function(m) { 18 | c.log(m); 19 | // Check to ensure the opened service is the mktdata service 20 | if (m.correlations[0].value == service_mktdata) { 21 | // Subscribe to market bars for each security 22 | session.subscribe([ 23 | { security: seclist[0], correlation: 100, 24 | fields: ['LAST_PRICE', 'BID', 'ASK'] }, 25 | { security: seclist[1], correlation: 101, 26 | fields: ['LAST_PRICE', 'BID', 'ASK'] } 27 | ]); 28 | } 29 | }); 30 | 31 | session.on('MarketDataEvents', function(m) { 32 | c.log(m); 33 | // At this point, m.correlations[0].value will equal: 34 | // 100 -> MarketBarStart for AAPL US Equity 35 | // 101 -> MarketBarStart for VOD LN Equity 36 | }); 37 | 38 | // Helper to put the console in raw mode and shutdown session on close 39 | c.createConsole(session); 40 | 41 | session.start(); 42 | 43 | // Local variables: 44 | // c-basic-offset: 4 45 | // tab-width: 4 46 | // indent-tabs-mode: nil 47 | // End: 48 | // 49 | // vi: set shiftwidth=4 tabstop=4 expandtab: 50 | // :indentSize=4:tabSize=4:noTabs=true: 51 | 52 | // ---------------------------------------------------------------------------- 53 | // Copyright (C) 2014 Bloomberg L.P. 54 | // 55 | // Permission is hereby granted, free of charge, to any person obtaining a copy 56 | // of this software and associated documentation files (the "Software"), to 57 | // deal in the Software without restriction, including without limitation the 58 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 59 | // sell copies of the Software, and to permit persons to whom the Software is 60 | // furnished to do so, subject to the following conditions: 61 | // 62 | // The above copyright notice and this permission notice shall be included in 63 | // all copies or substantial portions of the Software. 64 | // 65 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 66 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 67 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 68 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 69 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 70 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 71 | // IN THE SOFTWARE. 72 | // ----------------------------- END-OF-FILE ---------------------------------- 73 | -------------------------------------------------------------------------------- /examples/MarketVwapSubscription.js: -------------------------------------------------------------------------------- 1 | var c = require('./Console.js'); 2 | var blpapi = require('blpapi'); 3 | 4 | var hp = c.getHostPort(); 5 | // Add 'authenticationOptions' key to session options if necessary. 6 | var session = new blpapi.Session({ serverHost: hp.serverHost, 7 | serverPort: hp.serverPort }); 8 | var service_mktvwap = 1; // Unique identifier for mktvwap service 9 | 10 | var seclist = ['//blp/mktvwap/ticker/AAPL US Equity', 11 | '//blp/mktvwap/ticker/VOD LN Equity']; 12 | 13 | session.on('SessionStarted', function(m) { 14 | c.log(m); 15 | session.openService('//blp/mktvwap', service_mktvwap); 16 | }); 17 | 18 | session.on('ServiceOpened', function(m) { 19 | c.log(m); 20 | // Check to ensure the opened service is the mktvwap service 21 | if (m.correlations[0].value == service_mktvwap) { 22 | // Subscribe to market bars for each security 23 | session.subscribe([ 24 | { security: seclist[0], correlation: 100, 25 | fields: ['LAST_PRICE', 'BID', 'ASK'], 26 | options: { 27 | VWAP_START_TIME: '10:00', 28 | VWAP_END_TIME: '16:00' 29 | } }, 30 | { security: seclist[1], correlation: 101, 31 | fields: ['LAST_PRICE', 'BID', 'ASK'], 32 | options: { 33 | VWAP_START_TIME: '10:00', 34 | VWAP_END_TIME: '16:00' 35 | } } 36 | ]); 37 | } 38 | }); 39 | 40 | session.on('MarketDataEvents', function(m) { 41 | c.log(m); 42 | // At this point, m.correlations[0].value will equal: 43 | // 100 -> MarketBarStart for AAPL US Equity 44 | // 101 -> MarketBarStart for VOD LN Equity 45 | }); 46 | 47 | // Helper to put the console in raw mode and shutdown session on close 48 | c.createConsole(session); 49 | 50 | session.start(); 51 | 52 | // Local variables: 53 | // c-basic-offset: 4 54 | // tab-width: 4 55 | // indent-tabs-mode: nil 56 | // End: 57 | // 58 | // vi: set shiftwidth=4 tabstop=4 expandtab: 59 | // :indentSize=4:tabSize=4:noTabs=true: 60 | 61 | // ---------------------------------------------------------------------------- 62 | // Copyright (C) 2014 Bloomberg L.P. 63 | // 64 | // Permission is hereby granted, free of charge, to any person obtaining a copy 65 | // of this software and associated documentation files (the "Software"), to 66 | // deal in the Software without restriction, including without limitation the 67 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 68 | // sell copies of the Software, and to permit persons to whom the Software is 69 | // furnished to do so, subject to the following conditions: 70 | // 71 | // The above copyright notice and this permission notice shall be included in 72 | // all copies or substantial portions of the Software. 73 | // 74 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 75 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 76 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 77 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 78 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 79 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 80 | // IN THE SOFTWARE. 81 | // ----------------------------- END-OF-FILE ---------------------------------- 82 | -------------------------------------------------------------------------------- /examples/OptionChain.js: -------------------------------------------------------------------------------- 1 | var c = require('./Console.js'); 2 | var blpapi = require('blpapi'); 3 | 4 | var hp = c.getHostPort(); 5 | // Add 'authenticationOptions' key to session options if necessary. 6 | var session = new blpapi.Session({ serverHost: hp.serverHost, 7 | serverPort: hp.serverPort }); 8 | var service_refdata = 1; // Unique identifier for refdata service 9 | 10 | var seclist = ['AAPL US Equity']; 11 | 12 | session.on('SessionStarted', function(m) { 13 | //c.log(m); 14 | session.openService('//blp/refdata', service_refdata); 15 | }); 16 | 17 | session.on('ServiceOpened', function(m) { 18 | //c.log(m); 19 | // Check to ensure the opened service is the refdata service 20 | if (m.correlations[0].value == service_refdata) { 21 | // Request the long-form company name and option chain 22 | session.request('//blp/refdata', 'ReferenceDataRequest', 23 | { securities: seclist, 24 | fields: ['LONG_COMP_NAME', 'CHAIN_FULL'] 25 | }, 100); 26 | } 27 | }); 28 | 29 | var options = []; 30 | 31 | session.on('ReferenceDataResponse', function(m) { 32 | //c.log(m); 33 | // At this point, m.correlations[0].value will equal: 34 | // 100 -> ReferenceDataResponse for option chain 35 | // 101 -> ReferenceDataResponse for LAST_PRICE of individual options 36 | if (m.correlations[0].value === 100) { 37 | var chain = m.data.securityData[0].fieldData.CHAIN_FULL; 38 | for (i in chain) { 39 | var strike = chain[i]; 40 | var call = strike['Call Ticker'] + " Equity"; 41 | var put = strike['Put Ticker'] + " Equity"; 42 | options.push(call, put); 43 | } 44 | if (m.eventType === 'RESPONSE') { 45 | session.request('//blp/refdata', 'ReferenceDataRequest', 46 | { securities: options, fields: ['LAST_PRICE'] }, 101); 47 | } 48 | } else if (m.correlations[0].value === 101) { 49 | for (i in m.data.securityData) { 50 | var data = m.data.securityData[i]; 51 | console.log(data.security, '=>', data.fieldData.LAST_PRICE); 52 | } 53 | if (m.eventType === 'RESPONSE') { 54 | session.stop(); 55 | } 56 | } 57 | }); 58 | 59 | session.on('SessionTerminated', function(m) { 60 | session.destroy(); 61 | }); 62 | 63 | session.start(); 64 | 65 | // Local variables: 66 | // c-basic-offset: 4 67 | // tab-width: 4 68 | // indent-tabs-mode: nil 69 | // End: 70 | // 71 | // vi: set shiftwidth=4 tabstop=4 expandtab: 72 | // :indentSize=4:tabSize=4:noTabs=true: 73 | 74 | // ---------------------------------------------------------------------------- 75 | // Copyright (C) 2014 Bloomberg L.P. 76 | // 77 | // Permission is hereby granted, free of charge, to any person obtaining a copy 78 | // of this software and associated documentation files (the "Software"), to 79 | // deal in the Software without restriction, including without limitation the 80 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 81 | // sell copies of the Software, and to permit persons to whom the Software is 82 | // furnished to do so, subject to the following conditions: 83 | // 84 | // The above copyright notice and this permission notice shall be included in 85 | // all copies or substantial portions of the Software. 86 | // 87 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 88 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 89 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 90 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 91 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 92 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 93 | // IN THE SOFTWARE. 94 | // ----------------------------- END-OF-FILE ---------------------------------- 95 | -------------------------------------------------------------------------------- /examples/node_modules/blpapi: -------------------------------------------------------------------------------- 1 | ../.. -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "blpapi", 3 | "version": "1.2.0", 4 | "main": "./blpapi.js", 5 | "description": "Bloomberg Open API (BLPAPI) binding for node.js", 6 | "os": [ 7 | "linux", 8 | "win32", 9 | "darwin" 10 | ], 11 | "cpu": [ 12 | "x64", 13 | "ia32" 14 | ], 15 | "scripts": { 16 | "install": "node-gyp configure build" 17 | }, 18 | "dependencies": { 19 | "custom-error-generator": "7.0.0" 20 | }, 21 | "devDependencies": { 22 | "node-gyp": "^2.0.1" 23 | }, 24 | "repository": { 25 | "type": "git", 26 | "url": "https://github.com/bloomberg/blpapi-node.git" 27 | }, 28 | "bugs": { 29 | "url": "https://github.com/bloomberg/blpapi-node/issues", 30 | "email": "open-tech@bloomberg.net" 31 | }, 32 | "maintainers": [ 33 | { 34 | "name": "Andrew Paprocki", 35 | "email": "andrew@ishiboo.com" 36 | } 37 | ], 38 | "keywords": [ 39 | "finance", 40 | "stocks", 41 | "stock", 42 | "quotes", 43 | "tick", 44 | "realtime", 45 | "market" 46 | ], 47 | "license": "MIT", 48 | "engines": { 49 | "node": ">=0.12", 50 | "iojs": ">=1.0" 51 | } 52 | } 53 | --------------------------------------------------------------------------------