38#ifndef INCLUDED_BLPAPI_TESTUTIL
39#define INCLUDED_BLPAPI_TESTUTIL
166int blpapi_TestUtil_createEvent(blpapi_Event_t **event,
int eventType);
187int blpapi_TestUtil_deserializeService(
188 const char *schema,
size_t schemaLength, blpapi_Service_t **service);
205int blpapi_TestUtil_serializeService(blpapi_StreamWriter_t streamWriter,
207 const blpapi_Service_t *service);
231int blpapi_TestUtil_appendMessage(blpapi_MessageFormatter_t **formatter,
232 blpapi_Event_t *event,
233 const blpapi_SchemaElementDefinition_t *messageType,
234 const blpapi_MessageProperties_t *properties);
254int blpapi_TestUtil_createTopic(
255 blpapi_Topic_t **topic,
const blpapi_Service_t *service,
int isActive);
273int blpapi_TestUtil_getAdminMessageDefinition(
274 blpapi_SchemaElementDefinition_t **definition,
275 blpapi_Name_t *messageName);
295int blpapi_MessageProperties_create(
296 blpapi_MessageProperties_t **messageProperties);
310void blpapi_MessageProperties_destroy(
311 blpapi_MessageProperties_t *messageProperties);
329int blpapi_MessageProperties_copy(blpapi_MessageProperties_t **dest,
330 const blpapi_MessageProperties_t *src);
345int blpapi_MessageProperties_assign(blpapi_MessageProperties_t *lhs,
346 const blpapi_MessageProperties_t *rhs);
365int blpapi_MessageProperties_setCorrelationIds(
366 blpapi_MessageProperties_t *messageProperties,
367 const blpapi_CorrelationId_t *correlationIds,
368 size_t numCorrelationIds);
392int blpapi_MessageProperties_setRecapType(
393 blpapi_MessageProperties_t *messageProperties,
412int blpapi_MessageProperties_setTimeReceived(
413 blpapi_MessageProperties_t *messageProperties,
414 const blpapi_HighPrecisionDatetime_t *timestamp);
431int blpapi_MessageProperties_setService(
432 blpapi_MessageProperties_t *messageProperties,
433 const blpapi_Service_t *service);
452int blpapi_MessageProperties_setRequestId(
453 blpapi_MessageProperties_t *messageProperties,
const char *requestId);
491 blpapi_MessageProperties_t *d_handle_p;
523 const blpapi_CorrelationId_t *correlationIds,
524 size_t correlationIdCount);
535 const std::vector<CorrelationId>& correlationIds);
575 blpapi_MessageProperties_t *handle()
const;
657 const Name& messageName);
677 blpapi_Event_t *
event = 0;
679 BLPAPI_CALL(blpapi_TestUtil_createEvent)(&event, eventType));
685 blpapi_Service_t *buffer = 0;
690 std::getline(stream, schema,
'\0');
693 BLPAPI_CALL(blpapi_TestUtil_deserializeService)(
694 schema.c_str(), schema.length(), &buffer));
699 std::ostream& stream,
const Service& service)
709 blpapi_MessageFormatter_t *formatter = 0;
711 &formatter, event.impl(), elementDef.impl(), properties.handle()));
718 blpapi_Topic_t *topic = 0;
720 &topic, service.handle(), isActive));
725 const Name& messageName)
727 blpapi_SchemaElementDefinition_t *definition = 0;
729 BLPAPI_CALL(blpapi_TestUtil_getAdminMessageDefinition)(
730 &definition, messageName.impl()));
737 BLPAPI_CALL(blpapi_MessageProperties_create)(&d_handle_p));
743 &d_handle_p, original.handle()));
750 d_handle_p, rhs.handle()));
756 BLPAPI_CALL_UNCHECKED(blpapi_MessageProperties_destroy)(d_handle_p);
760inline blpapi_MessageProperties_t *MessageProperties::handle()
const
770 BLPAPI_CALL(blpapi_MessageProperties_setCorrelationIds)(
771 d_handle_p, &cid.impl(), 1));
776 const std::vector<CorrelationId>& cids)
778 assert(!cids.empty());
781 BLPAPI_CALL(blpapi_MessageProperties_setCorrelationIds)(
782 d_handle_p, &cids[0].impl(), cids.size()));
787 const blpapi_CorrelationId_t *correlationIds,
788 size_t correlationIdCount)
791 BLPAPI_CALL(blpapi_MessageProperties_setCorrelationIds)(
792 d_handle_p, correlationIds, correlationIdCount));
800 BLPAPI_CALL(blpapi_MessageProperties_setRecapType)(d_handle_p,
801 static_cast<int>(recapType),
802 static_cast<int>(fragmentType)));
810 BLPAPI_CALL(blpapi_MessageProperties_setTimeReceived)(
818 BLPAPI_CALL(blpapi_MessageProperties_setService)(
819 d_handle_p, service.handle()));
824 const char *requestId)
827 blpapi_MessageProperties_setRequestId)(d_handle_p, requestId));
Provide a key to identify individual subscriptions or requests.
Represents a date and/or time.
Common definitions used by the library.
A component which defines events related operations.
A service which provides access to API data (provide or consume).
A signature for callback on print and default C++ implementation.
Provide representation of a Topic.
Definition blpapi_correlationid.h:306
Definition blpapi_datetime.h:312
blpapi_HighPrecisionDatetime_t & rawHighPrecisionValue()
Definition blpapi_datetime.h:2020
Definition blpapi_event.h:325
EventType
The possible types of event.
Definition blpapi_event.h:331
static void throwOnError(int errorCode)
Definition blpapi_exception.h:556
Fragment
Definition blpapi_message.h:354
@ FRAGMENT_NONE
message is not fragmented
Definition blpapi_message.h:356
Definition blpapi_name.h:228
Definition blpapi_schema.h:597
Definition blpapi_service.h:619
Definition blpapi_topic.h:177
Definition blpapi_testutil.h:488
MessageProperties & setRecapType(Message::RecapType::Type recapType, Message::Fragment fragmentType=Message::FRAGMENT_NONE)
Definition blpapi_testutil.h:796
MessageProperties & setRequestId(const char *requestId)
Definition blpapi_testutil.h:823
~MessageProperties()
Definition blpapi_testutil.h:754
MessageProperties & setService(const Service &service)
Definition blpapi_testutil.h:815
MessageProperties & setCorrelationIds(const blpapi_CorrelationId_t *correlationIds, size_t correlationIdCount)
Definition blpapi_testutil.h:786
MessageProperties & operator=(const MessageProperties &rhs)
Definition blpapi_testutil.h:746
MessageProperties & setTimeReceived(const Datetime &timeReceived)
Definition blpapi_testutil.h:806
MessageProperties()
Definition blpapi_testutil.h:734
MessageProperties & setCorrelationId(const CorrelationId &correlationId)
Definition blpapi_testutil.h:766
Definition blpapi_testutil.h:594
static MessageFormatter appendMessage(Event &event, const SchemaElementDefinition &elementDef, const MessageProperties &properties=MessageProperties())
Definition blpapi_testutil.h:705
static void serializeService(std::ostream &stream, const Service &service)
Definition blpapi_testutil.h:698
static Topic createTopic(const Service &service, bool isActive=true)
Definition blpapi_testutil.h:716
static Event createEvent(Event::EventType eventType)
Definition blpapi_testutil.h:675
static SchemaElementDefinition getAdminMessageDefinition(const Name &messageName)
Definition blpapi_testutil.h:724
test::MessageProperties MessageProperties
Definition blpapi_testutil.h:603
static Service deserializeService(std::istream &stream)
Definition blpapi_testutil.h:683
test::TestUtil TestUtil
Definition blpapi_testutil.h:836
Definition blpapi_messageformatter.h:791
Definition blpapi_abstractsession.h:452
Definition blpapi_abstractsession.h:451
Type
Definition blpapi_message.h:380
Definition blpapi_service.h:628
static int writeToStream(const char *data, int length, void *stream)
Definition blpapi_streamproxy.h:108