BLPAPI C++
3.24.10
|
#include <blpapi_constant.h>
Public Member Functions | |
ConstantList (blpapi_ConstantList_t *handle) | |
void | setUserData (void *userData) |
Name | name () const |
const char * | description () const |
int | status () const |
int | numConstants () const |
int | datatype () const |
Constant | getConstant (const Name &name) const |
Constant | getConstant (const char *name) const |
Constant | getConstantAt (size_t index) const |
void * | userData () const |
const blpapi_ConstantList_t * | impl () const |
Represents a list schema enumeration constants.
As well as the list of Constant
objects, this class also provides access to the symbolic name, description, and status of the list as a whole, and provides a facility for associating arbitrary user data (in the form of a void*
) with the list. All Constant
objects in a ConstantList
are of the same DataType.
ConstantList
objects are read-only, with the exception of a single void*
attribute for storing user data. ConstantList
objects have reference semantics with respect to this user data field: calling c.setUserData(void*)
modifies the user data associated with c
, as well as that associated with all copies of c
. As a result, functions which set or read this field are NOT per-object thread-safe. Clients must synchronize such operations across all copies of an object.
Application clients need never create fresh ConstantList
objects directly; applications will typically work with copies of objects returned by other blpapi
components.
|
explicit |
int datatype | ( | ) | const |
Return the data type used to represent the value of this constant as an integer specified by the blpapi_DataType_t
enumeration defined in blpapi_types
.
const char * description | ( | ) | const |
Return a null-terminated string containing a human-readable description of this ConstantList
. The returned pointer remains valid until this ConstantList
is destroyed.
Return the Constant
in this ConstantList
identified by the specified name
. If this ConstantList
does not contain a Constant
with the specified name
then an exception is thrown.
Constant getConstant | ( | const char * | name | ) | const |
Return the Constant
in this ConstantList
identified by the specified name
. If this ConstantList
does not contain a Constant
with the specified name
then an exception is thrown.
Constant getConstantAt | ( | size_t | index | ) | const |
Return the Constant
at the specified index
in this ConstantList
. If index
is not in the range from 0 to numConstants() - 1
then an exception is thrown.
const blpapi_ConstantList_t * impl | ( | ) | const |
Return the internal implementation.
Name name | ( | ) | const |
Return the symbolic name of this ConstantList
.
int numConstants | ( | ) | const |
Return the number of Constant
objects contained in this ConstantList
.
void setUserData | ( | void * | userData | ) |
Set the user data associated with this ConstantList
– and all copies of this ConstantList
– to the specified userData
. Clients are responsible for synchronizing calls to this function, and to userData()
, across all copies of this ConstantList
object.
int status | ( | ) | const |
Return the status, as a'SchemaStatus::Value', of this ConstantList
.
void * userData | ( | ) | const |
Return the user data associated with this ConstantList
. If no user data has been associated with this ConstantList
then return 0. Clients are responsible for synchronizing calls to this function with calls to setUserData(void*)
made on not only this ConstantList
, but also all copies of this ConstantList
. Note that ConstantList
objects have reference semantics: this function will reflect the last value set on any copy of this ConstantList
.