Public Types | Public Member Functions

blpapi::Identity Class Reference

#include <blpapi_identity.h>

List of all members.

Public Types

enum  SeatType { INVALID_SEAT = BLPAPI_SEATTYPE_INVALID_SEAT, BPS = BLPAPI_SEATTYPE_BPS, NONBPS = BLPAPI_SEATTYPE_NONBPS }

Public Member Functions

 Identity (blpapi_Identity_t *handle)
 Identity ()
 Identity (const Identity &original)
 ~Identity ()
Identityoperator= (const Identity &)
bool hasEntitlements (const Service &service, const int *entitlementIds, size_t numEntitlements) const
bool hasEntitlements (const Service &service, const int *entitlementIds, size_t numEntitlements, int *failedEntitlements, int *failedEntitlementsCount) const
bool hasEntitlements (const Service &service, const Element &entitlementIds, int *failedEntitlements, int *failedEntitlementsCount) const
bool isValid () const
bool isAuthorized (const Service &service) const
SeatType getSeatType () const
blpapi_Identity_thandle () const

Detailed Description

Provides access to the entitlements for a specific user.

An unauthorized Identity is created using Session::createIdentity(). Once a Identity has been created it can be authorized using Session::sendAuthorizationRequest(). The authorized Identity can then be queried or used in Session::subscribe() or Session::sendRequest() calls.

Once authorized a Identity has access to the entitlements of the user which it was validated for.

The Identity is a reference counted handle, copying it or assigning it does not duplicate the underlying entitlement data. Once the last Identity referring to the underlying entitlement data is destroyed that entitlement data is discarded and can only be re-established using Session::sendAuthorizationRequest() again.


Member Enumeration Documentation

Enumerator:
INVALID_SEAT 
BPS 

Bloomberg Professional Service.

NONBPS 

Constructor & Destructor Documentation

blpapi::Identity::Identity ( blpapi_Identity_t handle  ) 

Assume ownership of the raw handle

blpapi::Identity::Identity (  ) 

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

blpapi::Identity::Identity ( const Identity original  ) 

Copy constructor

blpapi::Identity::~Identity (  ) 

Destructor. Destroying the last Identity for a specific user cancels any authorizations associated with it.


Member Function Documentation

Identity& blpapi::Identity::operator= ( const Identity  ) 

Assignment operator.

bool blpapi::Identity::hasEntitlements ( const Service service,
const int *  entitlementIds,
size_t  numEntitlements 
) const

Return true if this Identity is authorized for the specified service and the first numEntitlements elements of the specified entitlementIds array; otherwise return false. The behavior is undefined unless entitlementIds is an array containing at least numEntitlements elements.

bool blpapi::Identity::hasEntitlements ( const Service service,
const int *  entitlementIds,
size_t  numEntitlements,
int *  failedEntitlements,
int *  failedEntitlementsCount 
) const

Return true if this Identity is authorized for the specified service and the first numEntitlements elements of the specified entitlementIds array; otherwise fill the specified failedEntitlements array with the subset of entitlementIds this Identity is not authorized for, load the number of such entitlements into the specified failedEntitlementsCount, and return false. The behavior is undefined unless entitlementIds and failedEntitlements are arrays containing at least numEntitlements elements, and failedEntitlementsCount is non-null.

bool blpapi::Identity::hasEntitlements ( const Service service,
const Element entitlementIds,
int *  failedEntitlements,
int *  failedEntitlementsCount 
) const

Return true if this Identity is authorized for the specified service and for each of the entitlement IDs contained in the specified entitlementIds, which must be an Element which is an array of integers; otherwise, fill the specified failedEntitlements array with the subset of entitlement IDs this Identity is not authorized for, load the number of such entitlements into the specified failedEntitlementsCount, and return false. The behavior is undefined unless failedEntitlements is an array containing at least entitlementIds.numValues() elements and failedEntitlementsCount is non-null.

bool blpapi::Identity::isValid (  )  const

Return true if this Identity is valid; otherwise return false. Note that a valid Identity has not necessarily been authorized. This function is deprecated.

bool blpapi::Identity::isAuthorized ( const Service service  )  const

Return true if this Identity is authorized for the specified service; otherwise return false.

SeatType blpapi::Identity::getSeatType (  )  const

Return the seat type of this Identity.

blpapi_Identity_t* blpapi::Identity::handle (  )  const

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