Public Member Functions

blpapi::ConstantList Class Reference

#include <blpapi_constant.h>

List of all members.

Public Member Functions

 ConstantList (blpapi_ConstantList_t *handle)
 ConstantList (const ConstantList &original)
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_timpl () const

Detailed Description

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


Constructor & Destructor Documentation

blpapi::ConstantList::ConstantList ( blpapi_ConstantList_t handle  ) 
blpapi::ConstantList::ConstantList ( const ConstantList original  ) 

Create a ConstantList object having the same value as the specified original. Note that this function does not require cross-object thread synchronization, as it does not directly read or modify the userData field.


Member Function Documentation

void blpapi::ConstantList::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 syncrhonizing calls to this function, and to userData(), across all copies of this ConstantList object.

Name blpapi::ConstantList::name (  )  const

Return the symbolic name of this ConstantList.

const char* blpapi::ConstantList::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.

int blpapi::ConstantList::status (  )  const

Return the status, as a'SchemaStatusValue', of this ConstantList.

int blpapi::ConstantList::numConstants (  )  const

Return the number of Constant objects contained in this ConstantList.

int blpapi::ConstantList::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.

Constant blpapi::ConstantList::getConstant ( const Name 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 blpapi::ConstantList::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 blpapi::ConstantList::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.

void* blpapi::ConstantList::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.

const blpapi_ConstantList_t* blpapi::ConstantList::impl (  )  const

Return the internal implementation.


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