BLPAPI C++
3.24.11
|
#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 () | |
Identity & | operator= (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_t * | handle () const |
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.
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. |
|
explicit |
Assume ownership of the raw handle
Identity | ( | ) |
~Identity | ( | ) |
Destructor. Destroying the last Identity for a specific user cancels any authorizations associated with it.
Identity::SeatType getSeatType | ( | ) | const |
Return the seat type of this Identity
.
blpapi_Identity_t * handle | ( | ) | const |
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.
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:
failedEntitlements
array, the function will fill only up to *failedEntitlementsCount
elements.failedEntitlements
array. 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:
failedEntitlements
array, the function will fill only up to *failedEntitlementsCount
elements.failedEntitlements
array. bool isAuthorized | ( | const Service & | service | ) | const |
Return true if this Identity
is authorized to consume the specified service
; otherwise return false.
bool isValid | ( | ) | const |