BLPAPI C++  3.24.2
Identity Class Reference

#include <blpapi_identity.h>

Public Types

enum  SeatType {
  INVALID_SEAT = -1,
  BPS = 0,
  NONBPS = 1
}
 

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.

See Component blpapi_identity

Member Enumeration Documentation

◆ SeatType

enum SeatType
Enumerator
INVALID_SEAT 

Invalid seat type. Also used for Identity instances that have not yet been authorized, or failed to authorize.

BPS 

Bloomberg Professional Service.

NONBPS 

Not permissioned for Bloomberg Professional Service.

Constructor & Destructor Documentation

◆ Identity() [1/3]

Identity ( blpapi_Identity_t handle)
explicit

Assume ownership of the raw handle

◆ Identity() [2/3]

Identity ( )

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

◆ Identity() [3/3]

Identity ( const Identity original)

Copy constructor

◆ ~Identity()

~Identity ( )

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

Member Function Documentation

◆ getSeatType()

Identity::SeatType getSeatType ( ) const

Return the seat type of this Identity.

◆ handle()

blpapi_Identity_t * handle ( ) const

◆ hasEntitlements() [1/3]

bool 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.

◆ hasEntitlements() [2/3]

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

Return true if this Identity is authorized both for the specified service and for the first numEntitlements elements in 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.

failedEntitlementsCount is used both as an input and as an output parameter:

  • As input, it is the size of the specified failedEntitlements array, the function will fill only up to *failedEntitlementsCount elements.
  • As output, it is the number of the failed entitlements in failedEntitlements array.

◆ hasEntitlements() [3/3]

bool 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 entitlementIds, which must be an Element which is either an integer, or 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.

failedEntitlementsCount is used both as an input and as an output parameter:

  • As input, it is the size of the specified failedEntitlements array, the function will fill only up to *failedEntitlementsCount elements.
  • As output, it is the number of the failed entitlements in failedEntitlements array.

◆ isAuthorized()

bool isAuthorized ( const Service service) const

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

◆ isValid()

bool 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.

◆ operator=()

Identity & operator= ( const Identity rhs)

Assignment operator.


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