BLPAPI C++ 3.25.8
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
615
646
647 public:
649
650 private:
651 blpapi_ProviderSession_t *d_handle_p;
652 EventHandler *d_eventHandler_p;
653
654 private:
657 void *userData);
658
659 void dispatchEvent(const Event& event);
660
661 private:
662 // NOT IMPLEMENTED
664 ProviderSession& operator=(const ProviderSession&);
665
666 public:
674
675 explicit ProviderSession(const SessionOptions& options = SessionOptions(),
676 EventHandler *eventHandler = 0,
677 EventDispatcher *eventDispatcher = 0);
715
716 virtual ~ProviderSession();
721 // MANIPULATORS
722 virtual bool start();
727 virtual bool startAsync();
732 virtual void stop();
737 virtual void stopAsync();
742 virtual Event nextEvent(int timeout = 0);
747 virtual int tryNextEvent(Event *event);
752 virtual bool registerService(const char *serviceName,
753 const Identity& providerIdentity = Identity(),
754 const ServiceRegistrationOptions& registrationOptions
779 virtual void activateSubServiceCodeRange(
780 const char *serviceName, int begin, int end, int priority);
793 const char *serviceName, int begin, int end);
803 virtual CorrelationId registerServiceAsync(const char *serviceName,
804 const Identity& providerIdentity = Identity(),
805 const CorrelationId& correlationId = CorrelationId(),
806 const ServiceRegistrationOptions& registrationOptions
832 virtual bool deregisterService(const char *serviceName);
849 virtual void resolve(ResolutionList *resolutionList,
851 const Identity& providerIdentity = Identity());
876 virtual void resolveAsync(const ResolutionList& resolutionList,
878 const Identity& providerIdentity = Identity());
901 virtual Topic getTopic(const Message& message);
911 virtual Topic createServiceStatusTopic(const Service& service);
918 virtual void publish(const Event& event);
923 virtual void sendResponse(
924 const Event& event, bool isPartialResponse = false);
931 virtual void createTopics(TopicList *topicList,
933 const Identity& providerIdentity = Identity());
952 virtual void createTopicsAsync(const TopicList& topicList,
954 const Identity& providerIdentity = Identity());
970 virtual void deleteTopic(const Topic& topic);
987 virtual void deleteTopics(const std::vector<Topic>& topics);
993 virtual void deleteTopics(const Topic *topics, size_t numTopics);
1000 virtual void terminateSubscriptionsOnTopic(
1001 const Topic& topic, const char *message = 0);
1012 virtual void terminateSubscriptionsOnTopics(
1013 const std::vector<Topic>& topics, const char *message = 0);
1020 virtual void terminateSubscriptionsOnTopics(
1021 const Topic *topics, size_t numTopics, const char *message = 0);
1029 virtual bool flushPublishedEvents(int timeoutMsecs);
1043 blpapi_ProviderSession_t *handle() const;
1048
1050 virtual Topic createTopic(const Message& message);
1057};
1058
1062//=============================================================================
1063// INLINE FUNCTION DEFINITIONS
1064//=============================================================================
1065
1066// ---------------------
1067// class ProviderSession
1068// ---------------------
1069
1070inline ProviderSession::ProviderSession(const SessionOptions& parameters,
1071 EventHandler *handler,
1072 EventDispatcher *dispatcher)
1073 : d_eventHandler_p(handler)
1074{
1075 if (dispatcher && !handler) {
1077 "Event dispatcher provided without handler.");
1078 }
1079 d_handle_p = blpapi_ProviderSession_create(parameters.handle(),
1081 dispatcher ? dispatcher->impl() : 0,
1082 this);
1083 initAbstractSessionHandle(
1085}
1086
1087inline ProviderSession::ProviderSession(blpapi_ProviderSession_t *newHandle)
1088 : d_handle_p(newHandle)
1089{
1090 initAbstractSessionHandle(
1092}
1093
1098
1100{
1101 return blpapi_ProviderSession_start(d_handle_p) ? false : true;
1102}
1103
1105{
1106 return blpapi_ProviderSession_startAsync(d_handle_p) ? false : true;
1107}
1108
1110{
1111 blpapi_ProviderSession_stop(d_handle_p);
1112}
1113
1115{
1117}
1118
1120{
1121 if (timeout < 0) {
1122 throw InvalidArgumentException("Timeout must be >= 0.");
1123 }
1124
1125 blpapi_Event_t *event = 0;
1127 d_handle_p, &event, static_cast<unsigned>(timeout)));
1128 return Event(event);
1129}
1130
1132{
1133 assert(event);
1134
1135 blpapi_Event_t *impl = 0;
1136 int ret = blpapi_ProviderSession_tryNextEvent(d_handle_p, &impl);
1137 if (0 == ret) {
1138 *event = Event(impl);
1139 }
1140 return ret;
1141}
1142
1143inline bool ProviderSession::registerService(const char *serviceName,
1144 const Identity& identity,
1145 const ServiceRegistrationOptions& registrationOptions)
1146{
1148 serviceName,
1149 identity.handle(),
1150 registrationOptions.handle())
1151 ? false
1152 : true;
1153}
1154
1156 const char *serviceName, int begin, int end, int priority)
1157{
1160 d_handle_p, serviceName, begin, end, priority));
1161}
1162
1164 const char *serviceName, int begin, int end)
1165{
1168 d_handle_p, serviceName, begin, end));
1169}
1170
1172 const char *serviceName,
1173 const Identity& identity,
1174 const CorrelationId& correlationId,
1175 const ServiceRegistrationOptions& registrationOptions)
1176{
1177 blpapi_CorrelationId_t retv = correlationId.impl();
1180 serviceName,
1181 identity.handle(),
1182 &retv,
1183 registrationOptions.handle()));
1184
1185 return CorrelationId(retv);
1186}
1187
1188inline bool ProviderSession::deregisterService(const char *serviceName)
1189{
1191 d_handle_p, serviceName)
1192 == 0
1193 ? true
1194 : false;
1195}
1196
1197inline void ProviderSession::resolve(ResolutionList *resolutionList,
1198 ResolveMode resolveMode,
1199 const Identity& identity)
1200{
1201 assert(resolutionList);
1202
1204 resolutionList->impl(),
1205 resolveMode,
1206 identity.handle()));
1207 return;
1208}
1209
1210inline void ProviderSession::resolveAsync(const ResolutionList& resolutionList,
1211 ResolveMode resolveMode,
1212 const Identity& identity)
1213{
1215 resolutionList.impl(),
1216 resolveMode,
1217 identity.handle()));
1218 return;
1219}
1220
1222{
1223 blpapi_Topic_t *topic = 0;
1225 d_handle_p, message.impl(), &topic));
1226
1227 return Topic(topic);
1228}
1229
1231{
1232 blpapi_Topic_t *topic = 0;
1234 d_handle_p, message.impl(), &topic));
1235
1236 return Topic(topic);
1237}
1238
1240{
1241 blpapi_Topic_t *topic = 0;
1244 d_handle_p, service.handle(), &topic));
1245
1246 return Topic(topic);
1247}
1248
1250 ResolveMode resolveMode,
1251 const Identity& identity)
1252{
1253 assert(topicList);
1254
1256 d_handle_p, topicList->impl(), resolveMode, identity.handle()));
1257 return;
1258}
1259
1261 ResolveMode resolveMode,
1262 const Identity& identity)
1263{
1265 d_handle_p, topicList.impl(), resolveMode, identity.handle()));
1266 return;
1267}
1268
1269inline void ProviderSession::deleteTopic(const Topic& topic)
1270{
1271 const blpapi_Topic_t *topicImpl = topic.impl();
1273 d_handle_p, &topicImpl, 1));
1274}
1275
1276inline void ProviderSession::deleteTopics(const std::vector<Topic>& topics)
1277{
1278 if (topics.size() == 0) {
1279 return;
1280 }
1281 std::vector<const blpapi_Topic_t *> topicImplList;
1282 topicImplList.reserve(topics.size());
1283 for (std::vector<Topic>::const_iterator it = topics.begin();
1284 it != topics.end();
1285 ++it) {
1286 topicImplList.push_back(it->impl());
1287 }
1289 d_handle_p, &topicImplList[0], topicImplList.size()));
1290}
1291
1293 const Topic *topics, size_t numTopics)
1294{
1295 if (numTopics == 0) {
1296 return;
1297 }
1298
1299 assert(topics);
1300
1301 std::vector<const blpapi_Topic_t *> topicImplList;
1302 topicImplList.reserve(numTopics);
1303 for (size_t i = 0; i < numTopics; ++i) {
1304 topicImplList.push_back(topics[i].impl());
1305 }
1307 d_handle_p, &topicImplList[0], topicImplList.size()));
1308}
1309
1311 const Topic& topic, const char *message)
1312{
1313 const blpapi_Topic_t *topicImpl = topic.impl();
1316 d_handle_p, &topicImpl, 1, message));
1317}
1318
1320 const std::vector<Topic>& topics, const char *message)
1321{
1322 if (topics.empty()) {
1323 return;
1324 }
1325 terminateSubscriptionsOnTopics(&topics.front(), topics.size(), message);
1326}
1327
1329 const Topic *topics, size_t numTopics, const char *message)
1330{
1331 if (numTopics == 0) {
1332 return;
1333 }
1334
1335 assert(topics);
1336
1337 std::vector<const blpapi_Topic_t *> topicImplList;
1338 topicImplList.reserve(numTopics);
1339 for (size_t i = 0; i < numTopics; ++i) {
1340 topicImplList.push_back(topics[i].impl());
1341 }
1344 d_handle_p,
1345 &topicImplList[0],
1346 topicImplList.size(),
1347 message));
1348}
1349
1350inline void ProviderSession::publish(const Event& event)
1351{
1353 blpapi_ProviderSession_publish(d_handle_p, event.impl()));
1354 return;
1355}
1356
1358 const Event& event, bool isPartialResponse)
1359{
1361 d_handle_p, event.impl(), isPartialResponse));
1362 return;
1363}
1364
1365inline blpapi_ProviderSession_t *ProviderSession::handle() const
1366{
1367 return d_handle_p;
1368}
1369
1370inline void ProviderSession::dispatchEvent(const Event& event)
1371{
1372 assert(d_eventHandler_p);
1373
1374 d_eventHandler_p->processEvent(event, this);
1375}
1376
1377inline bool ProviderSession::flushPublishedEvents(int timeoutMsecs)
1378{
1379 int allFlushed = 0;
1381 d_handle_p, &allFlushed, timeoutMsecs);
1382 if (rc != 0) {
1384 }
1385 return allFlushed ? true : false;
1386}
1387
1388// --------------------------------
1389// class ServiceRegistrationOptions
1390// --------------------------------
1391
1396
1398 const ServiceRegistrationOptions& original)
1399{
1400 d_handle_p
1402}
1403
1408
1410 const ServiceRegistrationOptions& rhs)
1411{
1412 blpapi_ServiceRegistrationOptions_copy(this->handle(), rhs.handle());
1413 return *this;
1414}
1415
1416// SUBSERVICE CODES
1418 int begin, int end, int priority)
1419{
1422 d_handle_p, begin, end, priority));
1423}
1424
1430
1432 const char *groupId, unsigned int groupIdLength)
1433{
1435 d_handle_p, groupId, groupIdLength);
1436}
1437
1439{
1441 d_handle_p, priority);
1442}
1443
1449
1451 char *groupIdBuffer, int *groupIdLength) const
1452{
1454 d_handle_p, groupIdBuffer, groupIdLength);
1455}
1456
1461
1467
1469ServiceRegistrationOptions::handle() const
1470{
1471 return d_handle_p;
1472}
1473
1474// --------------------------
1475// class ProviderEventHandler
1476// --------------------------
1477
1479extern "C" inline void blpapi_providerEventHandlerAdapter(
1480 blpapi_Event_t *event, blpapi_ProviderSession_t *, void *userData)
1481{
1482 assert(userData);
1483
1484 reinterpret_cast<ProviderSession *>(userData)->dispatchEvent(Event(event));
1485}
1487
1488} // close namespace blpapi
1489} // close namespace BloombergLP
1490
1491#endif // #ifdef __cplusplus
1492#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:125
#define BLPAPI_REGISTRATIONPARTS_PUBLISHING
Definition blpapi_defs.h:128
#define BLPAPI_RESOLVEMODE_AUTO_REGISTER_SERVICES
Definition blpapi_defs.h:117
#define BLPAPI_REGISTRATIONPARTS_PUBLISHER_RESOLUTION
Definition blpapi_defs.h:131
#define BLPAPI_REGISTRATIONPARTS_OPERATIONS
Definition blpapi_defs.h:129
#define BLPAPI_SERVICEREGISTRATIONOPTIONS_PRIORITY_LOW
Definition blpapi_defs.h:123
#define BLPAPI_REGISTRATIONPARTS_DEFAULT
Definition blpapi_defs.h:127
#define BLPAPI_RESOLVEMODE_DONT_REGISTER_SERVICES
Definition blpapi_defs.h:116
#define BLPAPI_EXPORT
Definition blpapi_defs.h:171
#define BLPAPI_REGISTRATIONPARTS_SUBSCRIBER_RESOLUTION
Definition blpapi_defs.h:130
#define BLPAPI_SERVICEREGISTRATIONOPTIONS_PRIORITY_MEDIUM
Definition blpapi_defs.h:124
struct blpapi_Topic blpapi_Topic_t
Definition blpapi_dispatchtbl.h:75
struct blpapi_ServiceRegistrationOptions blpapi_ServiceRegistrationOptions_t
Definition blpapi_dispatchtbl.h:93
struct blpapi_Message blpapi_Message_t
Definition blpapi_dispatchtbl.h:78
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:201
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:645
virtual void deleteTopic(const Topic &topic)
Definition blpapi_providersession.h:1269
virtual void deleteTopics(const std::vector< Topic > &topics)
Definition blpapi_providersession.h:1276
virtual void publish(const Event &event)
Definition blpapi_providersession.h:1350
virtual ~ProviderSession()
Definition blpapi_providersession.h:1094
virtual int tryNextEvent(Event *event)
Definition blpapi_providersession.h:1131
virtual void resolve(ResolutionList *resolutionList, ResolveMode resolveMode=DONT_REGISTER_SERVICES, const Identity &providerIdentity=Identity())
Definition blpapi_providersession.h:1197
virtual void activateSubServiceCodeRange(const char *serviceName, int begin, int end, int priority)
Definition blpapi_providersession.h:1155
virtual bool registerService(const char *serviceName, const Identity &providerIdentity=Identity(), const ServiceRegistrationOptions &registrationOptions=ServiceRegistrationOptions())
Definition blpapi_providersession.h:1143
virtual bool startAsync()
Definition blpapi_providersession.h:1104
virtual Topic createServiceStatusTopic(const Service &service)
Definition blpapi_providersession.h:1239
virtual Topic createTopic(const Message &message)
Definition blpapi_providersession.h:1221
virtual void deactivateSubServiceCodeRange(const char *serviceName, int begin, int end)
Definition blpapi_providersession.h:1163
virtual Topic getTopic(const Message &message)
Definition blpapi_providersession.h:1230
virtual void sendResponse(const Event &event, bool isPartialResponse=false)
Definition blpapi_providersession.h:1357
virtual Event nextEvent(int timeout=0)
Definition blpapi_providersession.h:1119
ResolveMode
Definition blpapi_providersession.h:667
@ DONT_REGISTER_SERVICES
Definition blpapi_providersession.h:670
@ AUTO_REGISTER_SERVICES
Try to register services found in ResolutionList if necessary.
Definition blpapi_providersession.h:668
virtual void stop()
Definition blpapi_providersession.h:1109
virtual void createTopics(TopicList *topicList, ResolveMode resolveMode=DONT_REGISTER_SERVICES, const Identity &providerIdentity=Identity())
Definition blpapi_providersession.h:1249
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:1260
::BloombergLP::blpapi::ProviderEventHandler EventHandler
Definition blpapi_providersession.h:648
virtual void terminateSubscriptionsOnTopic(const Topic &topic, const char *message=0)
Definition blpapi_providersession.h:1310
virtual bool start()
Definition blpapi_providersession.h:1099
virtual bool flushPublishedEvents(int timeoutMsecs)
Definition blpapi_providersession.h:1377
virtual bool deregisterService(const char *serviceName)
Definition blpapi_providersession.h:1188
virtual void stopAsync()
Definition blpapi_providersession.h:1114
virtual CorrelationId registerServiceAsync(const char *serviceName, const Identity &providerIdentity=Identity(), const CorrelationId &correlationId=CorrelationId(), const ServiceRegistrationOptions &registrationOptions=ServiceRegistrationOptions())
Definition blpapi_providersession.h:1171
virtual void resolveAsync(const ResolutionList &resolutionList, ResolveMode resolveMode=DONT_REGISTER_SERVICES, const Identity &providerIdentity=Identity())
Definition blpapi_providersession.h:1210
virtual void terminateSubscriptionsOnTopics(const std::vector< Topic > &topics, const char *message=0)
Definition blpapi_providersession.h:1319
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:1450
void removeAllActiveSubServiceCodeRanges()
Definition blpapi_providersession.h:1425
ServiceRegistrationOptions()
Definition blpapi_providersession.h:1392
void setGroupId(const char *groupId, unsigned int groupIdLength)
Definition blpapi_providersession.h:1431
ServiceRegistrationOptions & operator=(const ServiceRegistrationOptions &rhs)
Definition blpapi_providersession.h:1409
int getPartsToRegister() const
Definition blpapi_providersession.h:1462
int setServicePriority(int priority)
Definition blpapi_providersession.h:1438
~ServiceRegistrationOptions()
Definition blpapi_providersession.h:1404
int getServicePriority() const
Definition blpapi_providersession.h:1457
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:1444
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:1417
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