BLPAPI C++ 3.26.4
Loading...
Searching...
No Matches
blpapi_providersession.h
Go to the documentation of this file.
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
28#ifndef INCLUDED_BLPAPI_PROVIDERSESSION
29#define INCLUDED_BLPAPI_PROVIDERSESSION
30
147#ifndef INCLUDED_BLPAPI_ABSTRACTSESSION
149#endif
150
151#ifndef INCLUDED_BLPAPI_CALL
152#include <blpapi_call.h>
153#endif
154
155#ifndef INCLUDED_BLPAPI_CORRELATIONID
156#include <blpapi_correlationid.h>
157#endif
158
159#ifndef INCLUDED_BLPAPI_DEFS
160#include <blpapi_defs.h>
161#endif
162
163#ifndef INCLUDED_BLPAPI_EVENT
164#include <blpapi_event.h>
165#endif
166
167#ifndef INCLUDED_BLPAPI_EVENTDISPATCHER
169#endif
170
171#ifndef INCLUDED_BLPAPI_IDENTITY
172#include <blpapi_identity.h>
173#endif
174
175#ifndef INCLUDED_BLPAPI_REQUEST
176#include <blpapi_request.h>
177#endif
178
179#ifndef INCLUDED_BLPAPI_RESOLUTIONLIST
181#endif
182
183#ifndef INCLUDED_BLPAPI_SERVICE
184#include <blpapi_service.h>
185#endif
186
187#ifndef INCLUDED_BLPAPI_SESSIONOPTIONS
189#endif
190
191#ifndef INCLUDED_BLPAPI_SUBSCRIPTIONLIST
193#endif
194
195#ifndef INCLUDED_BLPAPI_TOPIC
196#include <blpapi_topic.h>
197#endif
198
199#ifndef INCLUDED_BLPAPI_TOPICLIST
200#include <blpapi_topiclist.h>
201#endif
202
203#ifndef INCLUDED_BLPAPI_TYPES
204#include <blpapi_types.h>
205#endif
206
207#include <stddef.h>
208
209#ifdef __cplusplus
210extern "C" {
211#endif
212
213struct blpapi_ServiceRegistrationOptions;
214typedef struct blpapi_ServiceRegistrationOptions
216
219 void *userData);
220
223 blpapi_SessionOptions_t *parameters,
225 blpapi_EventDispatcher_t *dispatcher,
226 void *userData);
227
230
233
236
239
242
245 blpapi_Event_t **eventPointer,
246 unsigned int timeoutInMilliseconds);
247
250 blpapi_ProviderSession_t *session, blpapi_Event_t **eventPointer);
251
254 const char *serviceName,
255 const blpapi_Identity_t *identity,
256 blpapi_ServiceRegistrationOptions_t *registrationOptions);
257
261 const char *serviceName,
262 int begin,
263 int end,
264 int priority);
265
269 const char *serviceName,
270 int begin,
271 int end);
272
276 const char *serviceName,
277 const blpapi_Identity_t *identity,
278 blpapi_CorrelationId_t *correlationId,
279 blpapi_ServiceRegistrationOptions_t *registrationOptions);
280
283 blpapi_ProviderSession_t *session, const char *serviceName);
284
287 blpapi_ResolutionList_t *resolutionList,
288 int resolveMode,
289 const blpapi_Identity_t *identity);
290
293 const blpapi_ResolutionList_t *resolutionList,
294 int resolveMode,
295 const blpapi_Identity_t *identity);
296
299 blpapi_TopicList_t *topicList,
300 int resolveMode,
301 const blpapi_Identity_t *identity);
302
305 const blpapi_TopicList_t *topicList,
306 int resolveMode,
307 const blpapi_Identity_t *identity);
308
311 const blpapi_Message_t *message,
312 blpapi_Topic_t **topic);
313
316 const blpapi_Message_t *message,
317 blpapi_Topic_t **topic);
318
322 const blpapi_Service_t *service,
323 blpapi_Topic_t **topic);
324
327 const blpapi_Topic_t **topics,
328 size_t numTopics);
329
333 const blpapi_Topic_t **topics,
334 size_t numTopics,
335 const char *message);
336
340
343 blpapi_Event_t *event,
344 int isPartialResponse);
345
348 blpapi_ProviderSession_t *session);
349
352 blpapi_ProviderSession_t *session, int *allFlushed, int timeoutMsecs);
353
354// ServiceRegistrationOptions
355
358 void);
359
363 const blpapi_ServiceRegistrationOptions_t *parameters);
364
368
373
374// SUBSERVICE CODES
378 int start,
379 int end,
380 int priority);
381
385
389 const char *groupId,
390 unsigned int groupIdLength);
391
394 blpapi_ServiceRegistrationOptions_t *parameters, int priority);
395
398 blpapi_ServiceRegistrationOptions_t *parameters, int parts);
399
403 char *groupdIdBuffer,
404 int *groupIdLength);
405
409
413
414#ifdef __cplusplus
415}
416
417#include <cassert>
418
426namespace BloombergLP {
427namespace blpapi {
428
430extern "C" inline void blpapi_providerEventHandlerAdapter(
431 blpapi_Event_t *event,
433 void *userData);
435
436class ProviderSession;
437// ==========================
438// class ProviderEventHandler
439// ==========================
440
442 public:
444
445 virtual bool processEvent(const Event& event, ProviderSession *session)
446 = 0;
457};
458
613
644
645 public:
647
648 private:
649 blpapi_ProviderSession_t *d_handle_p;
650 EventHandler *d_eventHandler_p;
651
652 private:
655 void *userData);
656
657 void dispatchEvent(const Event& event);
658
659 private:
660 // NOT IMPLEMENTED
662 ProviderSession& operator=(const ProviderSession&);
663
664 public:
672
673 explicit ProviderSession(const SessionOptions& options = SessionOptions(),
674 EventHandler *eventHandler = 0,
675 EventDispatcher *eventDispatcher = 0);
713
714 virtual ~ProviderSession();
719 // MANIPULATORS
720 virtual bool start();
725 virtual bool startAsync();
730 virtual void stop();
735 virtual void stopAsync();
740 virtual Event nextEvent(int timeout = 0);
745 virtual int tryNextEvent(Event *event);
750 virtual bool registerService(const char *serviceName,
751 const Identity& providerIdentity = Identity(),
752 const ServiceRegistrationOptions& registrationOptions
777 virtual void activateSubServiceCodeRange(
778 const char *serviceName, int begin, int end, int priority);
792 const char *serviceName, int begin, int end);
802 virtual CorrelationId registerServiceAsync(const char *serviceName,
803 const Identity& providerIdentity = Identity(),
804 const CorrelationId& correlationId = CorrelationId(),
805 const ServiceRegistrationOptions& registrationOptions
831 virtual bool deregisterService(const char *serviceName);
848 virtual void resolve(ResolutionList *resolutionList,
850 const Identity& providerIdentity = Identity());
875 virtual void resolveAsync(const ResolutionList& resolutionList,
877 const Identity& providerIdentity = Identity());
900 virtual Topic getTopic(const Message& message);
910 virtual Topic createServiceStatusTopic(const Service& service);
917 virtual void publish(const Event& event);
922 virtual void sendResponse(
923 const Event& event, bool isPartialResponse = false);
930 virtual void createTopics(TopicList *topicList,
932 const Identity& providerIdentity = Identity());
950 virtual void createTopicsAsync(const TopicList& topicList,
952 const Identity& providerIdentity = Identity());
967 virtual void deleteTopic(const Topic& topic);
984 virtual void deleteTopics(const std::vector<Topic>& topics);
990 virtual void deleteTopics(const Topic *topics, size_t numTopics);
998 const Topic& topic, const char *message = 0);
1009 virtual void terminateSubscriptionsOnTopics(
1010 const std::vector<Topic>& topics, const char *message = 0);
1019 virtual void terminateSubscriptionsOnTopics(
1020 const Topic *topics, size_t numTopics, const char *message = 0);
1030 virtual bool flushPublishedEvents(int timeoutMsecs);
1044 blpapi_ProviderSession_t *handle() const;
1049
1051 virtual Topic createTopic(const Message& message);
1058};
1059
1063//=============================================================================
1064// INLINE FUNCTION DEFINITIONS
1065//=============================================================================
1066
1067// ---------------------
1068// class ProviderSession
1069// ---------------------
1070
1071inline ProviderSession::ProviderSession(const SessionOptions& parameters,
1072 EventHandler *handler,
1073 EventDispatcher *dispatcher)
1074 : d_eventHandler_p(handler)
1075{
1076 if (dispatcher && !handler) {
1078 "Event dispatcher provided without handler.");
1079 }
1080 d_handle_p = blpapi_ProviderSession_create(parameters.handle(),
1082 dispatcher ? dispatcher->impl() : 0,
1083 this);
1084 initAbstractSessionHandle(
1086}
1087
1088inline ProviderSession::ProviderSession(blpapi_ProviderSession_t *newHandle)
1089 : d_handle_p(newHandle)
1090{
1091 initAbstractSessionHandle(
1093}
1094
1099
1101{
1102 return blpapi_ProviderSession_start(d_handle_p) ? false : true;
1103}
1104
1106{
1107 return blpapi_ProviderSession_startAsync(d_handle_p) ? false : true;
1108}
1109
1111{
1112 blpapi_ProviderSession_stop(d_handle_p);
1113}
1114
1116{
1118}
1119
1121{
1122 if (timeout < 0) {
1123 throw InvalidArgumentException("Timeout must be >= 0.");
1124 }
1125
1126 blpapi_Event_t *event = 0;
1128 d_handle_p, &event, static_cast<unsigned>(timeout)));
1129 return Event(event);
1130}
1131
1133{
1134 assert(event);
1135
1136 blpapi_Event_t *impl = 0;
1137 int ret = blpapi_ProviderSession_tryNextEvent(d_handle_p, &impl);
1138 if (0 == ret) {
1139 *event = Event(impl);
1140 }
1141 return ret;
1142}
1143
1144inline bool ProviderSession::registerService(const char *serviceName,
1145 const Identity& identity,
1146 const ServiceRegistrationOptions& registrationOptions)
1147{
1149 serviceName,
1150 identity.handle(),
1151 registrationOptions.handle())
1152 ? false
1153 : true;
1154}
1155
1157 const char *serviceName, int begin, int end, int priority)
1158{
1161 d_handle_p, serviceName, begin, end, priority));
1162}
1163
1165 const char *serviceName, int begin, int end)
1166{
1169 d_handle_p, serviceName, begin, end));
1170}
1171
1173 const char *serviceName,
1174 const Identity& identity,
1175 const CorrelationId& correlationId,
1176 const ServiceRegistrationOptions& registrationOptions)
1177{
1178 blpapi_CorrelationId_t retv = correlationId.impl();
1181 serviceName,
1182 identity.handle(),
1183 &retv,
1184 registrationOptions.handle()));
1185
1186 return CorrelationId(retv);
1187}
1188
1189inline bool ProviderSession::deregisterService(const char *serviceName)
1190{
1192 d_handle_p, serviceName)
1193 == 0
1194 ? true
1195 : false;
1196}
1197
1198inline void ProviderSession::resolve(ResolutionList *resolutionList,
1199 ResolveMode resolveMode,
1200 const Identity& identity)
1201{
1202 assert(resolutionList);
1203
1205 resolutionList->impl(),
1206 resolveMode,
1207 identity.handle()));
1208 return;
1209}
1210
1211inline void ProviderSession::resolveAsync(const ResolutionList& resolutionList,
1212 ResolveMode resolveMode,
1213 const Identity& identity)
1214{
1216 resolutionList.impl(),
1217 resolveMode,
1218 identity.handle()));
1219 return;
1220}
1221
1223{
1224 blpapi_Topic_t *topic = 0;
1226 d_handle_p, message.impl(), &topic));
1227
1228 return Topic(topic);
1229}
1230
1232{
1233 blpapi_Topic_t *topic = 0;
1235 d_handle_p, message.impl(), &topic));
1236
1237 return Topic(topic);
1238}
1239
1241{
1242 blpapi_Topic_t *topic = 0;
1245 d_handle_p, service.handle(), &topic));
1246
1247 return Topic(topic);
1248}
1249
1251 ResolveMode resolveMode,
1252 const Identity& identity)
1253{
1254 assert(topicList);
1255
1257 d_handle_p, topicList->impl(), resolveMode, identity.handle()));
1258 return;
1259}
1260
1262 ResolveMode resolveMode,
1263 const Identity& identity)
1264{
1266 d_handle_p, topicList.impl(), resolveMode, identity.handle()));
1267 return;
1268}
1269
1270inline void ProviderSession::deleteTopic(const Topic& topic)
1271{
1272 const blpapi_Topic_t *topicImpl = topic.impl();
1274 d_handle_p, &topicImpl, 1));
1275}
1276
1277inline void ProviderSession::deleteTopics(const std::vector<Topic>& topics)
1278{
1279 if (topics.size() == 0) {
1280 return;
1281 }
1282 std::vector<const blpapi_Topic_t *> topicImplList;
1283 topicImplList.reserve(topics.size());
1284 for (std::vector<Topic>::const_iterator it = topics.begin();
1285 it != topics.end();
1286 ++it) {
1287 topicImplList.push_back(it->impl());
1288 }
1290 d_handle_p, &topicImplList[0], topicImplList.size()));
1291}
1292
1294 const Topic *topics, size_t numTopics)
1295{
1296 if (numTopics == 0) {
1297 return;
1298 }
1299
1300 assert(topics);
1301
1302 std::vector<const blpapi_Topic_t *> topicImplList;
1303 topicImplList.reserve(numTopics);
1304 for (size_t i = 0; i < numTopics; ++i) {
1305 topicImplList.push_back(topics[i].impl());
1306 }
1308 d_handle_p, &topicImplList[0], topicImplList.size()));
1309}
1310
1312 const Topic& topic, const char *message)
1313{
1314 const blpapi_Topic_t *topicImpl = topic.impl();
1317 d_handle_p, &topicImpl, 1, message));
1318}
1319
1321 const std::vector<Topic>& topics, const char *message)
1322{
1323 if (topics.empty()) {
1324 return;
1325 }
1326 terminateSubscriptionsOnTopics(&topics.front(), topics.size(), message);
1327}
1328
1330 const Topic *topics, size_t numTopics, const char *message)
1331{
1332 if (numTopics == 0) {
1333 return;
1334 }
1335
1336 assert(topics);
1337
1338 std::vector<const blpapi_Topic_t *> topicImplList;
1339 topicImplList.reserve(numTopics);
1340 for (size_t i = 0; i < numTopics; ++i) {
1341 topicImplList.push_back(topics[i].impl());
1342 }
1345 d_handle_p,
1346 &topicImplList[0],
1347 topicImplList.size(),
1348 message));
1349}
1350
1351inline void ProviderSession::publish(const Event& event)
1352{
1354 blpapi_ProviderSession_publish(d_handle_p, event.impl()));
1355 return;
1356}
1357
1359 const Event& event, bool isPartialResponse)
1360{
1362 d_handle_p, event.impl(), isPartialResponse));
1363 return;
1364}
1365
1366inline blpapi_ProviderSession_t *ProviderSession::handle() const
1367{
1368 return d_handle_p;
1369}
1370
1371inline void ProviderSession::dispatchEvent(const Event& event)
1372{
1373 assert(d_eventHandler_p);
1374
1375 d_eventHandler_p->processEvent(event, this);
1376}
1377
1378inline bool ProviderSession::flushPublishedEvents(int timeoutMsecs)
1379{
1380 int allFlushed = 0;
1382 d_handle_p, &allFlushed, timeoutMsecs);
1383 if (rc != 0) {
1385 }
1386 return allFlushed ? true : false;
1387}
1388
1389// --------------------------------
1390// class ServiceRegistrationOptions
1391// --------------------------------
1392
1397
1399 const ServiceRegistrationOptions& original)
1400{
1401 d_handle_p
1403}
1404
1409
1411 const ServiceRegistrationOptions& rhs)
1412{
1413 blpapi_ServiceRegistrationOptions_copy(this->handle(), rhs.handle());
1414 return *this;
1415}
1416
1417// SUBSERVICE CODES
1419 int begin, int end, int priority)
1420{
1423 d_handle_p, begin, end, priority));
1424}
1425
1431
1433 const char *groupId, unsigned int groupIdLength)
1434{
1436 d_handle_p, groupId, groupIdLength);
1437}
1438
1440{
1442 d_handle_p, priority);
1443}
1444
1450
1452 char *groupIdBuffer, int *groupIdLength) const
1453{
1455 d_handle_p, groupIdBuffer, groupIdLength);
1456}
1457
1462
1468
1470ServiceRegistrationOptions::handle() const
1471{
1472 return d_handle_p;
1473}
1474
1475// --------------------------
1476// class ProviderEventHandler
1477// --------------------------
1478
1480extern "C" inline void blpapi_providerEventHandlerAdapter(
1481 blpapi_Event_t *event, blpapi_ProviderSession_t *, void *userData)
1482{
1483 assert(userData);
1484
1485 reinterpret_cast<ProviderSession *>(userData)->dispatchEvent(Event(event));
1486}
1488
1489} // close namespace blpapi
1490} // close namespace BloombergLP
1491
1492#endif // #ifdef __cplusplus
1493#endif // #ifndef INCLUDED_BLPAPI_PROVIDERSESSION
A common interface shared between publisher and consumer sessions.
Provide functions for dispatchtbl.
#define BLPAPI_CALL_SERVICEREGISTRATIONOPTIONS_ADDACTIVATESUBSERVICECODERANGE(a1, a2, a3, a4)
Definition blpapi_call.h:444
#define BLPAPI_CALL_PROVIDERSESSION_DEACTIVATESUBSERVICECODERANGE( a1, a2, a3, a4)
Definition blpapi_call.h:440
#define BLPAPI_CALL_SERVICEREGISTRATIONOPTIONS_SETPARTSTOREGISTER(a1, a2)
Definition blpapi_call.h:423
#define BLPAPI_CALL_PROVIDERSESSION_DEREGISTERSERVICE(a1, a2)
Definition blpapi_call.h:420
#define BLPAPI_CALL_SERVICEREGISTRATIONOPTIONS_GETPARTSTOREGISTER(a1)
Definition blpapi_call.h:426
#define BLPAPI_CALL_SERVICEREGISTRATIONOPTIONS_REMOVEALLACTIVESUBSERVICECODERANGES(a1)
Definition blpapi_call.h:449
#define BLPAPI_CALL_PROVIDERSESSION_ACTIVATESUBSERVICECODERANGE( a1, a2, a3, a4, a5)
Definition blpapi_call.h:436
#define BLPAPI_CALL_PROVIDERSESSION_DELETETOPICS(a1, a2, a3)
Definition blpapi_call.h:429
#define BLPAPI_CALL(FUNCNAME)
Definition blpapi_call.h:353
#define BLPAPI_CALL_PROVIDERSESSION_TERMINATESUBSCRIPTIONSONTOPICS( a1, a2, a3, a4)
Definition blpapi_call.h:432
Provide a key to identify individual subscriptions or requests.
Common definitions used by the library.
#define BLPAPI_SERVICEREGISTRATIONOPTIONS_PRIORITY_HIGH
Definition blpapi_defs.h:126
#define BLPAPI_REGISTRATIONPARTS_PUBLISHING
Definition blpapi_defs.h:129
#define BLPAPI_RESOLVEMODE_AUTO_REGISTER_SERVICES
Definition blpapi_defs.h:118
#define BLPAPI_REGISTRATIONPARTS_PUBLISHER_RESOLUTION
Definition blpapi_defs.h:132
#define BLPAPI_REGISTRATIONPARTS_OPERATIONS
Definition blpapi_defs.h:130
#define BLPAPI_SERVICEREGISTRATIONOPTIONS_PRIORITY_LOW
Definition blpapi_defs.h:124
#define BLPAPI_REGISTRATIONPARTS_DEFAULT
Definition blpapi_defs.h:128
#define BLPAPI_RESOLVEMODE_DONT_REGISTER_SERVICES
Definition blpapi_defs.h:117
#define BLPAPI_EXPORT
Definition blpapi_defs.h:172
#define BLPAPI_REGISTRATIONPARTS_SUBSCRIBER_RESOLUTION
Definition blpapi_defs.h:131
#define BLPAPI_SERVICEREGISTRATIONOPTIONS_PRIORITY_MEDIUM
Definition blpapi_defs.h:125
struct blpapi_CorrelationId_t_ blpapi_CorrelationId_t
Definition blpapi_dispatchtbl.h:74
struct blpapi_Topic blpapi_Topic_t
Definition blpapi_dispatchtbl.h:77
struct blpapi_ServiceRegistrationOptions blpapi_ServiceRegistrationOptions_t
Definition blpapi_dispatchtbl.h:95
struct blpapi_Message blpapi_Message_t
Definition blpapi_dispatchtbl.h:80
A component which defines events related operations.
Provide a dispatcher to dispatch events.
Provide access to the entitlements for a user.
BLPAPI_EXPORT int blpapi_ProviderSession_createTopics(blpapi_ProviderSession_t *session, blpapi_TopicList_t *topicList, int resolveMode, const blpapi_Identity_t *identity)
BLPAPI_EXPORT int blpapi_ProviderSession_start(blpapi_ProviderSession_t *session)
BLPAPI_EXPORT void blpapi_ServiceRegistrationOptions_destroy(blpapi_ServiceRegistrationOptions_t *parameters)
BLPAPI_EXPORT blpapi_ServiceRegistrationOptions_t * blpapi_ServiceRegistrationOptions_create(void)
BLPAPI_EXPORT int blpapi_ProviderSession_createTopic(blpapi_ProviderSession_t *session, const blpapi_Message_t *message, blpapi_Topic_t **topic)
BLPAPI_EXPORT int blpapi_ProviderSession_registerServiceAsync(blpapi_ProviderSession_t *session, const char *serviceName, const blpapi_Identity_t *identity, blpapi_CorrelationId_t *correlationId, blpapi_ServiceRegistrationOptions_t *registrationOptions)
BLPAPI_EXPORT int blpapi_ProviderSession_terminateSubscriptionsOnTopics(blpapi_ProviderSession_t *session, const blpapi_Topic_t **topics, size_t numTopics, const char *message)
BLPAPI_EXPORT blpapi_ServiceRegistrationOptions_t * blpapi_ServiceRegistrationOptions_duplicate(const blpapi_ServiceRegistrationOptions_t *parameters)
BLPAPI_EXPORT int blpapi_ProviderSession_tryNextEvent(blpapi_ProviderSession_t *session, blpapi_Event_t **eventPointer)
BLPAPI_EXPORT int blpapi_ProviderSession_startAsync(blpapi_ProviderSession_t *session)
BLPAPI_EXPORT int blpapi_ProviderSession_getTopic(blpapi_ProviderSession_t *session, const blpapi_Message_t *message, blpapi_Topic_t **topic)
BLPAPI_EXPORT int blpapi_ProviderSession_deregisterService(blpapi_ProviderSession_t *session, const char *serviceName)
BLPAPI_EXPORT int blpapi_ProviderSession_resolve(blpapi_ProviderSession_t *session, blpapi_ResolutionList_t *resolutionList, int resolveMode, const blpapi_Identity_t *identity)
BLPAPI_EXPORT int blpapi_ProviderSession_createTopicsAsync(blpapi_ProviderSession_t *session, const blpapi_TopicList_t *topicList, int resolveMode, const blpapi_Identity_t *identity)
BLPAPI_EXPORT int blpapi_ProviderSession_createServiceStatusTopic(blpapi_ProviderSession_t *session, const blpapi_Service_t *service, blpapi_Topic_t **topic)
BLPAPI_EXPORT int blpapi_ServiceRegistrationOptions_getGroupId(blpapi_ServiceRegistrationOptions_t *parameters, char *groupdIdBuffer, int *groupIdLength)
BLPAPI_EXPORT int blpapi_ProviderSession_activateSubServiceCodeRange(blpapi_ProviderSession_t *session, const char *serviceName, int begin, int end, int priority)
void(* blpapi_ProviderEventHandler_t)(blpapi_Event_t *event, blpapi_ProviderSession_t *session, void *userData)
Definition blpapi_providersession.h:217
BLPAPI_EXPORT int blpapi_ProviderSession_publish(blpapi_ProviderSession_t *session, blpapi_Event_t *event)
BLPAPI_EXPORT int blpapi_ProviderSession_deactivateSubServiceCodeRange(blpapi_ProviderSession_t *session, const char *serviceName, int begin, int end)
BLPAPI_EXPORT blpapi_ProviderSession_t * blpapi_ProviderSession_create(blpapi_SessionOptions_t *parameters, blpapi_ProviderEventHandler_t handler, blpapi_EventDispatcher_t *dispatcher, void *userData)
BLPAPI_EXPORT void blpapi_ServiceRegistrationOptions_setPartsToRegister(blpapi_ServiceRegistrationOptions_t *parameters, int parts)
BLPAPI_EXPORT int blpapi_ServiceRegistrationOptions_addActiveSubServiceCodeRange(blpapi_ServiceRegistrationOptions_t *parameters, int start, int end, int priority)
BLPAPI_EXPORT void blpapi_ProviderSession_destroy(blpapi_ProviderSession_t *session)
BLPAPI_EXPORT void blpapi_ServiceRegistrationOptions_copy(blpapi_ServiceRegistrationOptions_t *lhs, const blpapi_ServiceRegistrationOptions_t *rhs)
BLPAPI_EXPORT int blpapi_ServiceRegistrationOptions_getServicePriority(blpapi_ServiceRegistrationOptions_t *parameters)
BLPAPI_EXPORT int blpapi_ProviderSession_sendResponse(blpapi_ProviderSession_t *session, blpapi_Event_t *event, int isPartialResponse)
BLPAPI_EXPORT blpapi_AbstractSession_t * blpapi_ProviderSession_getAbstractSession(blpapi_ProviderSession_t *session)
BLPAPI_EXPORT int blpapi_ServiceRegistrationOptions_setServicePriority(blpapi_ServiceRegistrationOptions_t *parameters, int priority)
BLPAPI_EXPORT void blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges(blpapi_ServiceRegistrationOptions_t *parameters)
BLPAPI_EXPORT int blpapi_ProviderSession_deleteTopics(blpapi_ProviderSession_t *session, const blpapi_Topic_t **topics, size_t numTopics)
BLPAPI_EXPORT int blpapi_ProviderSession_resolveAsync(blpapi_ProviderSession_t *session, const blpapi_ResolutionList_t *resolutionList, int resolveMode, const blpapi_Identity_t *identity)
BLPAPI_EXPORT int blpapi_ServiceRegistrationOptions_getPartsToRegister(blpapi_ServiceRegistrationOptions_t *parameters)
BLPAPI_EXPORT int blpapi_ProviderSession_registerService(blpapi_ProviderSession_t *session, const char *serviceName, const blpapi_Identity_t *identity, blpapi_ServiceRegistrationOptions_t *registrationOptions)
BLPAPI_EXPORT int blpapi_ProviderSession_stop(blpapi_ProviderSession_t *session)
BLPAPI_EXPORT int blpapi_ProviderSession_stopAsync(blpapi_ProviderSession_t *session)
BLPAPI_EXPORT int blpapi_ProviderSession_nextEvent(blpapi_ProviderSession_t *session, blpapi_Event_t **eventPointer, unsigned int timeoutInMilliseconds)
BLPAPI_EXPORT void blpapi_ServiceRegistrationOptions_setGroupId(blpapi_ServiceRegistrationOptions_t *parameters, const char *groupId, unsigned int groupIdLength)
BLPAPI_EXPORT int blpapi_ProviderSession_flushPublishedEvents(blpapi_ProviderSession_t *session, int *allFlushed, int timeoutMsecs)
Defines a request which can be sent for a service.
Provide a representation of a list of topics.
struct blpapi_ResolutionList blpapi_ResolutionList_t
Definition blpapi_resolutionlist.h:88
A service which provides access to API data (provide or consume).
A common interface shared between publish and consumer sessions.
Provide a list of subscriptions.
Provide representation of a Topic.
Provide a representation of a list of topics.
struct blpapi_TopicList blpapi_TopicList_t
Definition blpapi_topiclist.h:88
Provide BLPAPI types.
Definition blpapi_abstractsession.h:261
Definition blpapi_correlationid.h:206
Definition blpapi_eventdispatcher.h:116
blpapi_EventDispatcher_t * impl() const
Definition blpapi_eventdispatcher.h:198
Definition blpapi_session.h:334
Definition blpapi_event.h:196
blpapi_Event_t * impl() const
Definition blpapi_event.h:553
static void throwOnError(int errorCode)
Definition blpapi_exception.h:526
Definition blpapi_identity.h:131
blpapi_Identity_t * handle() const
Definition blpapi_identity.h:380
Definition blpapi_exception.h:238
Definition blpapi_message.h:161
Definition blpapi_providersession.h:441
virtual ~ProviderEventHandler()
Definition blpapi_providersession.h:443
virtual bool processEvent(const Event &event, ProviderSession *session)=0
Definition blpapi_providersession.h:643
virtual void deleteTopic(const Topic &topic)
Definition blpapi_providersession.h:1270
virtual void deleteTopics(const std::vector< Topic > &topics)
Definition blpapi_providersession.h:1277
virtual void publish(const Event &event)
Definition blpapi_providersession.h:1351
virtual ~ProviderSession()
Definition blpapi_providersession.h:1095
virtual int tryNextEvent(Event *event)
Definition blpapi_providersession.h:1132
virtual void resolve(ResolutionList *resolutionList, ResolveMode resolveMode=DONT_REGISTER_SERVICES, const Identity &providerIdentity=Identity())
Definition blpapi_providersession.h:1198
virtual void activateSubServiceCodeRange(const char *serviceName, int begin, int end, int priority)
Definition blpapi_providersession.h:1156
virtual bool registerService(const char *serviceName, const Identity &providerIdentity=Identity(), const ServiceRegistrationOptions &registrationOptions=ServiceRegistrationOptions())
Definition blpapi_providersession.h:1144
virtual bool startAsync()
Definition blpapi_providersession.h:1105
virtual Topic createServiceStatusTopic(const Service &service)
Definition blpapi_providersession.h:1240
virtual Topic createTopic(const Message &message)
Definition blpapi_providersession.h:1222
virtual void deactivateSubServiceCodeRange(const char *serviceName, int begin, int end)
Definition blpapi_providersession.h:1164
virtual Topic getTopic(const Message &message)
Definition blpapi_providersession.h:1231
virtual void sendResponse(const Event &event, bool isPartialResponse=false)
Definition blpapi_providersession.h:1358
virtual Event nextEvent(int timeout=0)
Definition blpapi_providersession.h:1120
ResolveMode
Definition blpapi_providersession.h:665
@ DONT_REGISTER_SERVICES
Definition blpapi_providersession.h:668
@ AUTO_REGISTER_SERVICES
Try to register services found in ResolutionList if necessary.
Definition blpapi_providersession.h:666
virtual void stop()
Definition blpapi_providersession.h:1110
virtual void createTopics(TopicList *topicList, ResolveMode resolveMode=DONT_REGISTER_SERVICES, const Identity &providerIdentity=Identity())
Definition blpapi_providersession.h:1250
friend void blpapi_providerEventHandlerAdapter(blpapi_Event_t *event, blpapi_ProviderSession_t *session, void *userData)
virtual void createTopicsAsync(const TopicList &topicList, ResolveMode resolveMode=DONT_REGISTER_SERVICES, const Identity &providerIdentity=Identity())
Definition blpapi_providersession.h:1261
::BloombergLP::blpapi::ProviderEventHandler EventHandler
Definition blpapi_providersession.h:646
virtual void terminateSubscriptionsOnTopic(const Topic &topic, const char *message=0)
Definition blpapi_providersession.h:1311
virtual bool start()
Definition blpapi_providersession.h:1100
virtual bool flushPublishedEvents(int timeoutMsecs)
Definition blpapi_providersession.h:1378
virtual bool deregisterService(const char *serviceName)
Definition blpapi_providersession.h:1189
virtual void stopAsync()
Definition blpapi_providersession.h:1115
virtual CorrelationId registerServiceAsync(const char *serviceName, const Identity &providerIdentity=Identity(), const CorrelationId &correlationId=CorrelationId(), const ServiceRegistrationOptions &registrationOptions=ServiceRegistrationOptions())
Definition blpapi_providersession.h:1172
virtual void resolveAsync(const ResolutionList &resolutionList, ResolveMode resolveMode=DONT_REGISTER_SERVICES, const Identity &providerIdentity=Identity())
Definition blpapi_providersession.h:1211
virtual void terminateSubscriptionsOnTopics(const std::vector< Topic > &topics, const char *message=0)
Definition blpapi_providersession.h:1320
Definition blpapi_resolutionlist.h:195
const blpapi_ResolutionList_t * impl() const
Definition blpapi_resolutionlist.h:535
Definition blpapi_providersession.h:469
int getGroupId(char *groupId, int *groupIdLength) const
Definition blpapi_providersession.h:1451
void removeAllActiveSubServiceCodeRanges()
Definition blpapi_providersession.h:1426
ServiceRegistrationOptions()
Definition blpapi_providersession.h:1393
void setGroupId(const char *groupId, unsigned int groupIdLength)
Definition blpapi_providersession.h:1432
ServiceRegistrationOptions & operator=(const ServiceRegistrationOptions &rhs)
Definition blpapi_providersession.h:1410
int getPartsToRegister() const
Definition blpapi_providersession.h:1463
int setServicePriority(int priority)
Definition blpapi_providersession.h:1439
~ServiceRegistrationOptions()
Definition blpapi_providersession.h:1405
int getServicePriority() const
Definition blpapi_providersession.h:1458
RegistrationParts
Definition blpapi_providersession.h:489
@ PART_PUBLISHING
register to receive subscribe and unsubscribe messages
Definition blpapi_providersession.h:491
@ PART_DEFAULT
Definition blpapi_providersession.h:509
@ PART_OPERATIONS
Definition blpapi_providersession.h:494
@ PART_PUBLISHER_RESOLUTION
Definition blpapi_providersession.h:503
@ PART_SUBSCRIBER_RESOLUTION
Definition blpapi_providersession.h:498
void setPartsToRegister(int parts)
Definition blpapi_providersession.h:1445
ServiceRegistrationPriority
Definition blpapi_providersession.h:478
@ PRIORITY_MEDIUM
Medium priority (INT_MAX/2)
Definition blpapi_providersession.h:481
@ PRIORITY_LOW
Low priority (0)
Definition blpapi_providersession.h:479
@ PRIORITY_HIGH
High priority (INT_MAX)
Definition blpapi_providersession.h:483
void addActiveSubServiceCodeRange(int begin, int end, int priority)
Definition blpapi_providersession.h:1418
Definition blpapi_service.h:304
blpapi_Service_t * handle() const
Definition blpapi_service.h:706
Definition blpapi_sessionoptions.h:431
blpapi_SessionOptions_t * handle() const
Definition blpapi_sessionoptions.h:1400
Definition blpapi_topiclist.h:177
const blpapi_TopicList_t * impl() const
Definition blpapi_topiclist.h:410
Definition blpapi_topic.h:114
const blpapi_Topic_t * impl() const
Definition blpapi_topic.h:221
struct blpapi_Service blpapi_Service_t
Definition blpapi_types.h:166
struct blpapi_Identity blpapi_Identity_t
Definition blpapi_types.h:188
struct blpapi_Event blpapi_Event_t
Definition blpapi_types.h:139
struct blpapi_EventDispatcher blpapi_EventDispatcher_t
Definition blpapi_types.h:142
struct blpapi_SessionOptions blpapi_SessionOptions_t
Definition blpapi_types.h:172
struct blpapi_AbstractSession blpapi_AbstractSession_t
Definition blpapi_types.h:127
struct blpapi_ProviderSession blpapi_ProviderSession_t
Definition blpapi_types.h:160
Definition blpapi_abstractsession.h:195