BLPAPI C++
3.24.2
|
#include <blpapi_service.h>
Classes | |
struct | TestService |
Defines a service which provides access to API data.
A Service object is obtained from a Session and contains the Operations (each of which contains its own schema) and the schema for Events which this Service may produce. A Service object is also used to create Request objects used with a Session to issue requests.
All API data is associated with a service. Before accessing API data using either request-reply or subscription, the appropriate Service must be opened and, if necessary, authorized.
Provider services are created to generate API data and must be registered before use.
The Service object is a handle to the underlying data which is owned by the Session. Once a Service has been successfully opened in a Session it remains accessible until the Session is terminated.
Service | ( | ) |
|
explicit |
Assume ownership of the raw handle
Service | ( | blpapi_Service_t * | handle, |
TestService | tag | ||
) |
Assume ownership of the de-serialised service
~Service | ( | ) |
const char * authorizationServiceName | ( | ) | const |
blpapi_Event_t * createAdminEvent | ( | ) | const |
DEPRECATED Use Service::createPublishEvent() instead
Create an Admin Event suitable for publishing to this Service. Use an EventFormatter to add Messages to the Event and set fields.
Request createAuthorizationRequest | ( | const char * | authorizationOperation = 0 | ) | const |
Returns an empty Request object for the specified authorizationOperation
. The request id of the new Request
, i.e. Request::getRequestId(), is null.
An application must populate the Request before issuing it using Session::sendAuthorizationRequest().
If the authorizationOperation
does not identify a valid operation for this Service then an exception is thrown.
blpapi_Event_t * createPublishEvent | ( | ) | const |
Create an Event suitable for publishing to this Service. Use an EventFormatter to add Messages to the Event and set fields.
Request createRequest | ( | const char * | operation | ) | const |
Returns a empty Request object for the specified operation
. If operation
does not identify a valid operation in the Service then an exception is thrown.
An application must populate the Request before issuing it using Session::sendRequest().
blpapi_Event_t * createResponseEvent | ( | const CorrelationId & | correlationId | ) | const |
Create a response Event to answer the request. Use an EventFormatter to add a Message to the Event and set fields.
const char * description | ( | ) | const |
SchemaElementDefinition getEventDefinition | ( | size_t | index | ) | const |
Returns the SchemaElementDefinition of the specified index
th unsolicited event defined by this service. If index >= numEventDefinitions()
an exception is thrown.
SchemaElementDefinition getEventDefinition | ( | const char * | name | ) | const |
Return the SchemaElementDefinition of the unsolicited event defined by this Service identified by the specified name
. If this Service does not define an unsolicited event name
an exception is thrown.
SchemaElementDefinition getEventDefinition | ( | const Name & | name | ) | const |
Return the definition of the unsolicited message having the specified name
defined by this service. Throw exception of the no unsolicited message having the specified name
is defined by this service.
Operation getOperation | ( | size_t | index | ) | const |
Returns the specified index
th Operation in this Service. If index
>=numOperations() then an exception is thrown.
Operation getOperation | ( | const char * | name | ) | const |
blpapi_Service_t * handle | ( | ) | const |
bool hasEventDefinition | ( | const char * | name | ) | const |
Returns true if the specified name
identifies a valid event in this Service.
bool hasEventDefinition | ( | const Name & | name | ) | const |
Returns true if the specified name
identifies a valid event in this Service.
bool hasOperation | ( | const char * | name | ) | const |
bool hasOperation | ( | const Name & | name | ) | const |
bool isValid | ( | ) | const |
const char * name | ( | ) | const |
int numEventDefinitions | ( | ) | const |
Returns the number of unsolicited events defined by this Service.
size_t numOperations | ( | ) | const |
Returns the number of Operations defined by this Service.
std::ostream & print | ( | std::ostream & | stream, |
int | level = 0 , |
||
int | spacesPerLevel = 4 |
||
) | const |
Format this Service schema to the specified output stream
at (absolute value specified for) the optionally specified indentation level
and return a reference to stream
. If level
is specified, optionally specify spacesPerLevel
, the number of spaces per indentation level for this and all of its nested objects. If level
is negative, suppress indentation of the first line. If spacesPerLevel
is negative, format the entire output on one line, suppressing all but the initial indentation (as governed by level
).