Public Member Functions

blpapi::Service Class Reference

#include <blpapi_service.h>

List of all members.

Public Member Functions

 Service ()
 Service (blpapi_Service_t *handle)
 Service (const Service &original)
 ~Service ()
Serviceoperator= (const Service &rhs)
Request createRequest (const char *operation) const
Request createAuthorizationRequest (const char *authorizationOperation=0) const
blpapi_Event_tcreatePublishEvent () const
blpapi_Event_tcreateAdminEvent () const
blpapi_Event_tcreateResponseEvent (const CorrelationId &correlationId) const
const char * name () const
const char * description () const
size_t numOperations () const
bool hasOperation (const char *name) const
bool hasOperation (const Name &name) const
Operation getOperation (size_t index) const
Operation getOperation (const char *name) const
Operation getOperation (const Name &name) const
int numEventDefinitions () const
bool hasEventDefinition (const char *name) const
bool hasEventDefinition (const Name &name) const
SchemaElementDefinition getEventDefinition (size_t index) const
SchemaElementDefinition getEventDefinition (const char *name) const
SchemaElementDefinition getEventDefinition (const Name &name) const
const char * authorizationServiceName () const
bool isValid () const
blpapi_Service_thandle () const
std::ostream & print (std::ostream &stream, int level=0, int spacesPerLevel=4) const

Detailed Description

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.


Constructor & Destructor Documentation

blpapi::Service::Service (  ) 

Create an uninitialized Service. The only valid operations on an uninitialized Service are assignment, isValid() and destruction.

blpapi::Service::Service ( blpapi_Service_t handle  ) 

Assume ownership of the raw handle

blpapi::Service::Service ( const Service original  ) 

Copy constructor.

blpapi::Service::~Service (  ) 

Destructor. Destroying a Service object obtained from a Session does not close the underlying service.


Member Function Documentation

Service& blpapi::Service::operator= ( const Service rhs  ) 

Assignment operator.

Request blpapi::Service::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().

Request blpapi::Service::createAuthorizationRequest ( const char *  authorizationOperation = 0  )  const

Returns an empty Request object for the specified authorizationOperation. If the authorizationOperation does not identify a valid operation for this Service then an exception is thrown.

An application must populate the Request before issuing it using Session::sendAuthorizationRequest().

blpapi_Event_t* blpapi::Service::createPublishEvent (  )  const

Create an Event suitable for publishing to this Service. Use an EventFormatter to add Messages to the Event and set fields.

blpapi_Event_t* blpapi::Service::createAdminEvent (  )  const

Create an Admin Event suitable for publishing to this Service. Use an EventFormatter to add Messages to the Event and set fields.

blpapi_Event_t* blpapi::Service::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* blpapi::Service::name (  )  const

Returns a pointer to a null-terminated, read-only string which contains the name of this Service. The pointer remains valid until this Service object is destroyed.

const char* blpapi::Service::description (  )  const

Returns a pointer to a null-terminated, read-only string which contains a human-readable description of this Service. The pointer remains valid until this Service object is destroyed.

size_t blpapi::Service::numOperations (  )  const

Returns the number of Operations defined by this Service.

bool blpapi::Service::hasOperation ( const char *  name  )  const

Returns true if the specified name identifies a valid Operation in this Service. Otherwise returns false.

bool blpapi::Service::hasOperation ( const Name name  )  const

Returns true if the specified name identifies a valid Operation in this Service. Otherwise returns false.

Operation blpapi::Service::getOperation ( size_t  index  )  const

Returns the specified indexth Operation in this Service. If index>=numOperations() then an exception is thrown.

Operation blpapi::Service::getOperation ( const char *  name  )  const

Return the definition of the Operation identified by the specified name. If this Service does not define an operation name an exception is thrown.

Operation blpapi::Service::getOperation ( const Name name  )  const

Return the definition of the Operation having the specified name. Throw exception if no such Operation exists in this service.

int blpapi::Service::numEventDefinitions (  )  const

Returns the number of unsolicited events defined by this Service.

bool blpapi::Service::hasEventDefinition ( const char *  name  )  const

Returns true if the specified name identifies a valid event in this Service.

bool blpapi::Service::hasEventDefinition ( const Name name  )  const

Returns true if the specified name identifies a valid event in this Service.

SchemaElementDefinition blpapi::Service::getEventDefinition ( size_t  index  )  const

Returns the SchemaElementDefinition of the specified indexth unsolicited event defined by this service. If index>=numEventDefinitions() an exception is thrown.

SchemaElementDefinition blpapi::Service::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 blpapi::Service::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.

const char* blpapi::Service::authorizationServiceName (  )  const

Returns the name of the Service which must be used in order to authorize access to restricted operations on this Service. If no authorization is required to access operations on this service an empty string is returned. Authorization services never require authorization to use.

bool blpapi::Service::isValid (  )  const

Returns true if this Service is valid. That is, it was returned from a Session.

blpapi_Service_t* blpapi::Service::handle (  )  const
std::ostream& blpapi::Service::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).


The documentation for this class was generated from the following file: