BLPAPI C++ 3.25.7
Loading...
Searching...
No Matches
blpapi_resolutionlist.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_RESOLUTIONLIST
29#define INCLUDED_BLPAPI_RESOLUTIONLIST
30
61#ifndef INCLUDED_BLPAPI_TYPES
62#include <blpapi_types.h>
63#endif
64
65#ifndef INCLUDED_BLPAPI_CORRELATIONID
67#endif
68
69#ifndef INCLUDED_BLPAPI_DEFS
70#include <blpapi_defs.h>
71#endif
72
73#ifndef INCLUDED_BLPAPI_ELEMENT
74#include <blpapi_element.h>
75#endif
76
77#ifndef INCLUDED_BLPAPI_NAME
78#include <blpapi_name.h>
79#endif
80
81#ifndef INCLUDED_BLPAPI_MESSAGE
82#include <blpapi_message.h>
83#endif
84
85#include <stddef.h>
86
87struct blpapi_ResolutionList;
88typedef struct blpapi_ResolutionList blpapi_ResolutionList_t;
89
90#ifdef __cplusplus
91extern "C" {
92#endif
93
96 const blpapi_Message_t *message, const blpapi_Name_t *attribute);
97
101
104
107 const char *topic,
108 const blpapi_CorrelationId_t *correlationId);
109
112 const blpapi_Message_t *topic,
113 const blpapi_CorrelationId_t *correlationId);
114
117 blpapi_ResolutionList_t *list, const blpapi_Name_t *name);
118
121 blpapi_CorrelationId_t *result,
122 size_t index);
123
126 const char **topic,
127 const blpapi_CorrelationId_t *id);
128
131 const blpapi_ResolutionList_t *list, const char **topic, size_t index);
132
135 int *status,
136 const blpapi_CorrelationId_t *id);
137
140 const blpapi_ResolutionList_t *list, int *status, size_t index);
141
144 blpapi_Element_t **element,
145 const blpapi_Name_t *attribute,
146 const blpapi_CorrelationId_t *id);
147
150 blpapi_Element_t **element,
151 const blpapi_Name_t *attribute,
152 size_t index);
153
156 blpapi_Message_t **element,
157 const blpapi_CorrelationId_t *id);
158
161 blpapi_Message_t **element,
162 size_t index);
163
166
167#ifdef __cplusplus
168}
169
170#ifndef INCLUDED_BLPAPI_EXCEPTION
171#include <blpapi_exception.h>
172#endif
173
181namespace BloombergLP {
182namespace blpapi {
183
196
197 blpapi_ResolutionList_t *d_handle_p;
198
199 public:
226
227 // CLASS METHODS
229 Message const& message, Name const& attribute);
247 ResolutionList(const ResolutionList& original);
252 virtual ~ResolutionList();
257 // MANIPULATORS
258
259 virtual int add(const char *topic,
260 const CorrelationId& correlationId = CorrelationId());
268 virtual int add(Message const& topicSubscribedMessage,
269 const CorrelationId& correlationId = CorrelationId());
278 int addAttribute(const Name& attribute);
287 // ACCESSORS
288
289 virtual CorrelationId correlationIdAt(size_t index) const;
296 virtual const char *topicString(const CorrelationId& correlationId) const;
303 virtual const char *topicStringAt(size_t index) const;
309 virtual int status(const CorrelationId& correlationId) const;
321 virtual int statusAt(size_t index) const;
333 const Name& attribute, const CorrelationId& correlationId) const;
346 Element attributeAt(const Name& attribute, size_t index) const;
357 virtual Message const message(const CorrelationId& correlationId) const;
368 virtual Message const messageAt(size_t index) const;
378 virtual size_t size() const;
383 const blpapi_ResolutionList_t *impl() const;
384
386};
387
391// ============================================================================
392// INLINE FUNCTION DEFINITIONS
393// ============================================================================
394
395// --------------------
396// class ResolutionList
397// --------------------
398
400 Message const&, Name const&)
401{
403
404 // Unreachable code, previous statement throws.
405 return Element();
406}
407
409 : d_handle_p(blpapi_ResolutionList_create(0))
410{
411}
412
414 : d_handle_p(blpapi_ResolutionList_create(original.d_handle_p))
415{
416}
417
422
424 const char *topic, const CorrelationId& correlationId)
425{
426 return blpapi_ResolutionList_add(d_handle_p, topic, &correlationId.impl());
427}
428
429inline int ResolutionList::add(Message const& topicSubscribedMessage,
430 const CorrelationId& correlationId)
431{
433 d_handle_p, topicSubscribedMessage.impl(), &correlationId.impl());
434}
435
437{
439
440 // Unreachable code, previous statement throws.
442}
443
445{
446 blpapi_CorrelationId_t correlationId;
448 d_handle_p, &correlationId, index));
449
450 return CorrelationId(correlationId);
451}
452
454 const CorrelationId& correlationId) const
455{
456 const char *topic = 0;
458 d_handle_p, &topic, &correlationId.impl()));
459
460 return topic;
461}
462
463inline const char *ResolutionList::topicStringAt(size_t index) const
464{
465 const char *topic = 0;
467 blpapi_ResolutionList_topicStringAt(d_handle_p, &topic, index));
468
469 return topic;
470}
471
472inline int ResolutionList::status(const CorrelationId& correlationId) const
473{
474 int result = 0;
476 d_handle_p, &result, &correlationId.impl()));
477
478 return result;
479}
480
481inline int ResolutionList::statusAt(size_t index) const
482{
483 int result = 0;
485 blpapi_ResolutionList_statusAt(d_handle_p, &result, index));
486
487 return result;
488}
489
491 const Name&, const CorrelationId&) const
492{
494
495 // Unreachable code, previous statement throws.
496 return Element();
497}
498
499inline Element ResolutionList::attributeAt(const Name&, size_t) const
500{
502
503 // Unreachable code, previous statement throws.
504 return Element();
505}
506
508 const CorrelationId& correlationId) const
509{
510 blpapi_Message_t *messageByCid = 0;
512 d_handle_p, &messageByCid, &correlationId.impl()));
513
514 bool makeMessageCopyable = true;
515 BLPAPI_CALL_MESSAGE_ADDREF(messageByCid);
516 return Message(messageByCid, makeMessageCopyable);
517}
518
519inline Message const ResolutionList::messageAt(size_t index) const
520{
521 blpapi_Message_t *messageByIndex = 0;
523 d_handle_p, &messageByIndex, index));
524
525 bool makeMessageCopyable = true;
526 BLPAPI_CALL_MESSAGE_ADDREF(messageByIndex);
527 return Message(messageByIndex, makeMessageCopyable);
528}
529
530inline size_t ResolutionList::size() const
531{
532 return static_cast<size_t>(blpapi_ResolutionList_size(d_handle_p));
533}
534
536{
537 return d_handle_p;
538}
539
540inline blpapi_ResolutionList_t *ResolutionList::impl() { return d_handle_p; }
541
542} // close namespace blpapi
543} // close namespace BloombergLP
544
545#endif // #ifdef __cplusplus
546#endif // #ifndef INCLUDED_BLPAPI_RESOLUTIONLIST
#define BLPAPI_CALL_MESSAGE_ADDREF(a1)
Definition blpapi_call.h:360
Provide a key to identify individual subscriptions or requests.
Common definitions used by the library.
#define BLPAPI_RESOLUTIONLIST_RESOLUTION_FAILURE_TOPIC_AUTHORIZATION_FAILED
Definition blpapi_defs.h:142
#define BLPAPI_RESOLUTIONLIST_RESOLUTION_FAILURE_SERVICE_AUTHORIZATION_FAILED
Definition blpapi_defs.h:140
#define BLPAPI_RESOLUTIONLIST_RESOLUTION_FAILURE_BAD_SERVICE
Definition blpapi_defs.h:139
#define BLPAPI_RESOLUTIONLIST_RESOLVED
Definition blpapi_defs.h:138
#define BLPAPI_EXPORT
Definition blpapi_defs.h:171
#define BLPAPI_RESOLUTIONLIST_UNRESOLVED
Definition blpapi_defs.h:137
#define BLPAPI_RESOLUTIONLIST_RESOLUTION_FAILURE_BAD_TOPIC
Definition blpapi_defs.h:141
struct blpapi_Message blpapi_Message_t
Definition blpapi_dispatchtbl.h:78
Provide a representation of an item in a message.
#define BLPAPI_ERROR_UNSUPPORTED_OPERATION
Definition blpapi_error.h:84
Defines Exceptions that can be thrown by the blpapi library.
Defines a message containing elements.
Provide a representation of strings for use as container keys.
BLPAPI_EXPORT blpapi_Element_t * blpapi_ResolutionList_extractAttributeFromResolutionSuccess(const blpapi_Message_t *message, const blpapi_Name_t *attribute)
BLPAPI_EXPORT void blpapi_ResolutionList_destroy(blpapi_ResolutionList_t *list)
BLPAPI_EXPORT int blpapi_ResolutionList_messageAt(const blpapi_ResolutionList_t *list, blpapi_Message_t **element, size_t index)
BLPAPI_EXPORT int blpapi_ResolutionList_addAttribute(blpapi_ResolutionList_t *list, const blpapi_Name_t *name)
BLPAPI_EXPORT int blpapi_ResolutionList_status(const blpapi_ResolutionList_t *list, int *status, const blpapi_CorrelationId_t *id)
struct blpapi_ResolutionList blpapi_ResolutionList_t
Definition blpapi_resolutionlist.h:88
BLPAPI_EXPORT int blpapi_ResolutionList_message(const blpapi_ResolutionList_t *list, blpapi_Message_t **element, const blpapi_CorrelationId_t *id)
BLPAPI_EXPORT int blpapi_ResolutionList_correlationIdAt(const blpapi_ResolutionList_t *list, blpapi_CorrelationId_t *result, size_t index)
BLPAPI_EXPORT blpapi_ResolutionList_t * blpapi_ResolutionList_create(blpapi_ResolutionList_t *from)
BLPAPI_EXPORT int blpapi_ResolutionList_topicStringAt(const blpapi_ResolutionList_t *list, const char **topic, size_t index)
BLPAPI_EXPORT int blpapi_ResolutionList_statusAt(const blpapi_ResolutionList_t *list, int *status, size_t index)
BLPAPI_EXPORT int blpapi_ResolutionList_add(blpapi_ResolutionList_t *list, const char *topic, const blpapi_CorrelationId_t *correlationId)
BLPAPI_EXPORT int blpapi_ResolutionList_topicString(const blpapi_ResolutionList_t *list, const char **topic, const blpapi_CorrelationId_t *id)
BLPAPI_EXPORT int blpapi_ResolutionList_attributeAt(const blpapi_ResolutionList_t *list, blpapi_Element_t **element, const blpapi_Name_t *attribute, size_t index)
BLPAPI_EXPORT int blpapi_ResolutionList_size(const blpapi_ResolutionList_t *list)
BLPAPI_EXPORT int blpapi_ResolutionList_addFromMessage(blpapi_ResolutionList_t *list, const blpapi_Message_t *topic, const blpapi_CorrelationId_t *correlationId)
BLPAPI_EXPORT int blpapi_ResolutionList_attribute(const blpapi_ResolutionList_t *list, blpapi_Element_t **element, const blpapi_Name_t *attribute, const blpapi_CorrelationId_t *id)
Provide BLPAPI types.
Definition blpapi_correlationid.h:201
Definition blpapi_element.h:465
static void throwOnError(int errorCode)
Definition blpapi_exception.h:526
Definition blpapi_message.h:161
Definition blpapi_name.h:150
Definition blpapi_resolutionlist.h:195
Element attributeAt(const Name &attribute, size_t index) const
Definition blpapi_resolutionlist.h:499
virtual const char * topicString(const CorrelationId &correlationId) const
Definition blpapi_resolutionlist.h:453
virtual ~ResolutionList()
Definition blpapi_resolutionlist.h:418
virtual Message const message(const CorrelationId &correlationId) const
Definition blpapi_resolutionlist.h:507
virtual const char * topicStringAt(size_t index) const
Definition blpapi_resolutionlist.h:463
virtual size_t size() const
Definition blpapi_resolutionlist.h:530
static Element extractAttributeFromResolutionSuccess(Message const &message, Name const &attribute)
Definition blpapi_resolutionlist.h:399
Status
Definition blpapi_resolutionlist.h:200
@ RESOLUTION_FAILURE_SERVICE_AUTHORIZATION_FAILED
Definition blpapi_resolutionlist.h:211
@ RESOLUTION_FAILURE_BAD_SERVICE
Definition blpapi_resolutionlist.h:205
@ RESOLUTION_FAILURE_TOPIC_AUTHORIZATION_FAILED
Currently unused.
Definition blpapi_resolutionlist.h:222
@ RESOLUTION_FAILURE_BAD_TOPIC
Definition blpapi_resolutionlist.h:216
@ UNRESOLVED
Not yet resolved.
Definition blpapi_resolutionlist.h:201
@ RESOLVED
Resolved successfully.
Definition blpapi_resolutionlist.h:203
Element attribute(const Name &attribute, const CorrelationId &correlationId) const
Definition blpapi_resolutionlist.h:490
virtual int statusAt(size_t index) const
Definition blpapi_resolutionlist.h:481
virtual CorrelationId correlationIdAt(size_t index) const
Definition blpapi_resolutionlist.h:444
int addAttribute(const Name &attribute)
Definition blpapi_resolutionlist.h:436
virtual int status(const CorrelationId &correlationId) const
Definition blpapi_resolutionlist.h:472
ResolutionList()
Definition blpapi_resolutionlist.h:408
virtual int add(const char *topic, const CorrelationId &correlationId=CorrelationId())
Definition blpapi_resolutionlist.h:423
virtual Message const messageAt(size_t index) const
Definition blpapi_resolutionlist.h:519
const blpapi_ResolutionList_t * impl() const
Definition blpapi_resolutionlist.h:535
struct blpapi_Name blpapi_Name_t
Definition blpapi_types.h:154
struct blpapi_Element blpapi_Element_t
Definition blpapi_types.h:136
Definition blpapi_abstractsession.h:195