BLPAPI C++ 3.26.3
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);
791 const char *serviceName, int begin, int end);
801 virtual CorrelationId registerServiceAsync(const char *serviceName,
802 const Identity& providerIdentity = Identity(),
803 const CorrelationId& correlationId = CorrelationId(),
804 const ServiceRegistrationOptions& registrationOptions
830 virtual bool deregisterService(const char *serviceName);
847 virtual void resolve(ResolutionList *resolutionList,
849 const Identity& providerIdentity = Identity());
874 virtual void resolveAsync(const ResolutionList& resolutionList,
876 const Identity& providerIdentity = Identity());
899 virtual Topic getTopic(const Message& message);
909 virtual Topic createServiceStatusTopic(const Service& service);
916 virtual void publish(const Event& event);
921 virtual void sendResponse(
922 const Event& event, bool isPartialResponse = false);
929 virtual void createTopics(TopicList *topicList,
931 const Identity& providerIdentity = Identity());
950 virtual void createTopicsAsync(const TopicList& topicList,
952 const Identity& providerIdentity = Identity());
968 virtual void deleteTopic(const Topic& topic);
985 virtual void deleteTopics(const std::vector<Topic>& topics);
991 virtual void deleteTopics(const Topic *topics, size_t numTopics);
999 const Topic& topic, const char *message = 0);
1010 virtual void terminateSubscriptionsOnTopics(
1011 const std::vector<Topic>& topics, const char *message = 0);
1018 virtual void terminateSubscriptionsOnTopics(
1019 const Topic *topics, size_t numTopics, const char *message = 0);
1027 virtual bool flushPublishedEvents(int timeoutMsecs);
1041 blpapi_ProviderSession_t *handle() const;
1046
1048 virtual Topic createTopic(const Message& message);
1055};
1056
1060//=============================================================================
1061// INLINE FUNCTION DEFINITIONS
1062//=============================================================================
1063
1064// ---------------------
1065// class ProviderSession
1066// ---------------------
1067
1068inline ProviderSession::ProviderSession(const SessionOptions& parameters,
1069 EventHandler *handler,
1070 EventDispatcher *dispatcher)
1071 : d_eventHandler_p(handler)
1072{
1073 if (dispatcher && !handler) {
1075 "Event dispatcher provided without handler.");
1076 }
1077 d_handle_p = blpapi_ProviderSession_create(parameters.handle(),
1079 dispatcher ? dispatcher->impl() : 0,
1080 this);
1081 initAbstractSessionHandle(
1083}
1084
1085inline ProviderSession::ProviderSession(blpapi_ProviderSession_t *newHandle)
1086 : d_handle_p(newHandle)
1087{
1088 initAbstractSessionHandle(
1090}
1091
1096
1098{
1099 return blpapi_ProviderSession_start(d_handle_p) ? false : true;
1100}
1101
1103{
1104 return blpapi_ProviderSession_startAsync(d_handle_p) ? false : true;
1105}
1106
1108{
1109 blpapi_ProviderSession_stop(d_handle_p);
1110}
1111
1113{
1115}
1116
1118{
1119 if (timeout < 0) {
1120 throw InvalidArgumentException("Timeout must be >= 0.");
1121 }
1122
1123 blpapi_Event_t *event = 0;
1125 d_handle_p, &event, static_cast<unsigned>(timeout)));
1126 return Event(event);
1127}
1128
1130{
1131 assert(event);
1132
1133 blpapi_Event_t *impl = 0;
1134 int ret = blpapi_ProviderSession_tryNextEvent(d_handle_p, &impl);
1135 if (0 == ret) {
1136 *event = Event(impl);
1137 }
1138 return ret;
1139}
1140
1141inline bool ProviderSession::registerService(const char *serviceName,
1142 const Identity& identity,
1143 const ServiceRegistrationOptions& registrationOptions)
1144{
1146 serviceName,
1147 identity.handle(),
1148 registrationOptions.handle())
1149 ? false
1150 : true;
1151}
1152
1154 const char *serviceName, int begin, int end, int priority)
1155{
1158 d_handle_p, serviceName, begin, end, priority));
1159}
1160
1162 const char *serviceName, int begin, int end)
1163{
1166 d_handle_p, serviceName, begin, end));
1167}
1168
1170 const char *serviceName,
1171 const Identity& identity,
1172 const CorrelationId& correlationId,
1173 const ServiceRegistrationOptions& registrationOptions)
1174{
1175 blpapi_CorrelationId_t retv = correlationId.impl();
1178 serviceName,
1179 identity.handle(),
1180 &retv,
1181 registrationOptions.handle()));
1182
1183 return CorrelationId(retv);
1184}
1185
1186inline bool ProviderSession::deregisterService(const char *serviceName)
1187{
1189 d_handle_p, serviceName)
1190 == 0
1191 ? true
1192 : false;
1193}
1194
1195inline void ProviderSession::resolve(ResolutionList *resolutionList,
1196 ResolveMode resolveMode,
1197 const Identity& identity)
1198{
1199 assert(resolutionList);
1200
1202 resolutionList->impl(),
1203 resolveMode,
1204 identity.handle()));
1205 return;
1206}
1207
1208inline void ProviderSession::resolveAsync(const ResolutionList& resolutionList,
1209 ResolveMode resolveMode,
1210 const Identity& identity)
1211{
1213 resolutionList.impl(),
1214 resolveMode,
1215 identity.handle()));
1216 return;
1217}
1218
1220{
1221 blpapi_Topic_t *topic = 0;
1223 d_handle_p, message.impl(), &topic));
1224
1225 return Topic(topic);
1226}
1227
1229{
1230 blpapi_Topic_t *topic = 0;
1232 d_handle_p, message.impl(), &topic));
1233
1234 return Topic(topic);
1235}
1236
1238{
1239 blpapi_Topic_t *topic = 0;
1242 d_handle_p, service.handle(), &topic));
1243
1244 return Topic(topic);
1245}
1246
1248 ResolveMode resolveMode,
1249 const Identity& identity)
1250{
1251 assert(topicList);
1252
1254 d_handle_p, topicList->impl(), resolveMode, identity.handle()));
1255 return;
1256}
1257
1259 ResolveMode resolveMode,
1260 const Identity& identity)
1261{
1263 d_handle_p, topicList.impl(), resolveMode, identity.handle()));
1264 return;
1265}
1266
1267inline void ProviderSession::deleteTopic(const Topic& topic)
1268{
1269 const blpapi_Topic_t *topicImpl = topic.impl();
1271 d_handle_p, &topicImpl, 1));
1272}
1273
1274inline void ProviderSession::deleteTopics(const std::vector<Topic>& topics)
1275{
1276 if (topics.size() == 0) {
1277 return;
1278 }
1279 std::vector<const blpapi_Topic_t *> topicImplList;
1280 topicImplList.reserve(topics.size());
1281 for (std::vector<Topic>::const_iterator it = topics.begin();
1282 it != topics.end();
1283 ++it) {
1284 topicImplList.push_back(it->impl());
1285 }
1287 d_handle_p, &topicImplList[0], topicImplList.size()));
1288}
1289
1291 const Topic *topics, size_t numTopics)
1292{
1293 if (numTopics == 0) {
1294 return;
1295 }
1296
1297 assert(topics);
1298
1299 std::vector<const blpapi_Topic_t *> topicImplList;
1300 topicImplList.reserve(numTopics);
1301 for (size_t i = 0; i < numTopics; ++i) {
1302 topicImplList.push_back(topics[i].impl());
1303 }
1305 d_handle_p, &topicImplList[0], topicImplList.size()));
1306}
1307
1309 const Topic& topic, const char *message)
1310{
1311 const blpapi_Topic_t *topicImpl = topic.impl();
1314 d_handle_p, &topicImpl, 1, message));
1315}
1316
1318 const std::vector<Topic>& topics, const char *message)
1319{
1320 if (topics.empty()) {
1321 return;
1322 }
1323 terminateSubscriptionsOnTopics(&topics.front(), topics.size(), message);
1324}
1325
1327 const Topic *topics, size_t numTopics, const char *message)
1328{
1329 if (numTopics == 0) {
1330 return;
1331 }
1332
1333 assert(topics);
1334
1335 std::vector<const blpapi_Topic_t *> topicImplList;
1336 topicImplList.reserve(numTopics);
1337 for (size_t i = 0; i < numTopics; ++i) {
1338 topicImplList.push_back(topics[i].impl());
1339 }
1342 d_handle_p,
1343 &topicImplList[0],
1344 topicImplList.size(),
1345 message));
1346}
1347
1348inline void ProviderSession::publish(const Event& event)
1349{
1351 blpapi_ProviderSession_publish(d_handle_p, event.impl()));
1352 return;
1353}
1354
1356 const Event& event, bool isPartialResponse)
1357{
1359 d_handle_p, event.impl(), isPartialResponse));
1360 return;
1361}
1362
1363inline blpapi_ProviderSession_t *ProviderSession::handle() const
1364{
1365 return d_handle_p;
1366}
1367
1368inline void ProviderSession::dispatchEvent(const Event& event)
1369{
1370 assert(d_eventHandler_p);
1371
1372 d_eventHandler_p->processEvent(event, this);
1373}
1374
1375inline bool ProviderSession::flushPublishedEvents(int timeoutMsecs)
1376{
1377 int allFlushed = 0;
1379 d_handle_p, &allFlushed, timeoutMsecs);
1380 if (rc != 0) {
1382 }
1383 return allFlushed ? true : false;
1384}
1385
1386// --------------------------------
1387// class ServiceRegistrationOptions
1388// --------------------------------
1389
1394
1396 const ServiceRegistrationOptions& original)
1397{
1398 d_handle_p
1400}
1401
1406
1408 const ServiceRegistrationOptions& rhs)
1409{
1410 blpapi_ServiceRegistrationOptions_copy(this->handle(), rhs.handle());
1411 return *this;
1412}
1413
1414// SUBSERVICE CODES
1416 int begin, int end, int priority)
1417{
1420 d_handle_p, begin, end, priority));
1421}
1422
1428
1430 const char *groupId, unsigned int groupIdLength)
1431{
1433 d_handle_p, groupId, groupIdLength);
1434}
1435
1437{
1439 d_handle_p, priority);
1440}
1441
1447
1449 char *groupIdBuffer, int *groupIdLength) const
1450{
1452 d_handle_p, groupIdBuffer, groupIdLength);
1453}
1454
1459
1465
1467ServiceRegistrationOptions::handle() const
1468{
1469 return d_handle_p;
1470}
1471
1472// --------------------------
1473// class ProviderEventHandler
1474// --------------------------
1475
1477extern "C" inline void blpapi_providerEventHandlerAdapter(
1478 blpapi_Event_t *event, blpapi_ProviderSession_t *, void *userData)
1479{
1480 assert(userData);
1481
1482 reinterpret_cast<ProviderSession *>(userData)->dispatchEvent(Event(event));
1483}
1485
1486} // close namespace blpapi
1487} // close namespace BloombergLP
1488
1489#endif // #ifdef __cplusplus
1490#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:1267
virtual void deleteTopics(const std::vector< Topic > &topics)
Definition blpapi_providersession.h:1274
virtual void publish(const Event &event)
Definition blpapi_providersession.h:1348
virtual ~ProviderSession()
Definition blpapi_providersession.h:1092
virtual int tryNextEvent(Event *event)
Definition blpapi_providersession.h:1129
virtual void resolve(ResolutionList *resolutionList, ResolveMode resolveMode=DONT_REGISTER_SERVICES, const Identity &providerIdentity=Identity())
Definition blpapi_providersession.h:1195
virtual void activateSubServiceCodeRange(const char *serviceName, int begin, int end, int priority)
Definition blpapi_providersession.h:1153
virtual bool registerService(const char *serviceName, const Identity &providerIdentity=Identity(), const ServiceRegistrationOptions &registrationOptions=ServiceRegistrationOptions())
Definition blpapi_providersession.h:1141
virtual bool startAsync()
Definition blpapi_providersession.h:1102
virtual Topic createServiceStatusTopic(const Service &service)
Definition blpapi_providersession.h:1237
virtual Topic createTopic(const Message &message)
Definition blpapi_providersession.h:1219
virtual void deactivateSubServiceCodeRange(const char *serviceName, int begin, int end)
Definition blpapi_providersession.h:1161
virtual Topic getTopic(const Message &message)
Definition blpapi_providersession.h:1228
virtual void sendResponse(const Event &event, bool isPartialResponse=false)
Definition blpapi_providersession.h:1355
virtual Event nextEvent(int timeout=0)
Definition blpapi_providersession.h:1117
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:1107
virtual void createTopics(TopicList *topicList, ResolveMode resolveMode=DONT_REGISTER_SERVICES, const Identity &providerIdentity=Identity())
Definition blpapi_providersession.h:1247
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:1258
::BloombergLP::blpapi::ProviderEventHandler EventHandler
Definition blpapi_providersession.h:646
virtual void terminateSubscriptionsOnTopic(const Topic &topic, const char *message=0)
Definition blpapi_providersession.h:1308
virtual bool start()
Definition blpapi_providersession.h:1097
virtual bool flushPublishedEvents(int timeoutMsecs)
Definition blpapi_providersession.h:1375
virtual bool deregisterService(const char *serviceName)
Definition blpapi_providersession.h:1186
virtual void stopAsync()
Definition blpapi_providersession.h:1112
virtual CorrelationId registerServiceAsync(const char *serviceName, const Identity &providerIdentity=Identity(), const CorrelationId &correlationId=CorrelationId(), const ServiceRegistrationOptions &registrationOptions=ServiceRegistrationOptions())
Definition blpapi_providersession.h:1169
virtual void resolveAsync(const ResolutionList &resolutionList, ResolveMode resolveMode=DONT_REGISTER_SERVICES, const Identity &providerIdentity=Identity())
Definition blpapi_providersession.h:1208
virtual void terminateSubscriptionsOnTopics(const std::vector< Topic > &topics, const char *message=0)
Definition blpapi_providersession.h:1317
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:1448
void removeAllActiveSubServiceCodeRanges()
Definition blpapi_providersession.h:1423
ServiceRegistrationOptions()
Definition blpapi_providersession.h:1390
void setGroupId(const char *groupId, unsigned int groupIdLength)
Definition blpapi_providersession.h:1429
ServiceRegistrationOptions & operator=(const ServiceRegistrationOptions &rhs)
Definition blpapi_providersession.h:1407
int getPartsToRegister() const
Definition blpapi_providersession.h:1460
int setServicePriority(int priority)
Definition blpapi_providersession.h:1436
~ServiceRegistrationOptions()
Definition blpapi_providersession.h:1402
int getServicePriority() const
Definition blpapi_providersession.h:1455
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:1442
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:1415
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