#include <blpapi_constant.h>
List of all members.
Detailed Description
Represents the value of a schema enumeration constant.
Constants can be any of the following DataTypes: BOOL, CHAR, BYTE, INT32, INT64, FLOAT32, FLOAT64, STRING, DATE, TIME, DATETIME. This class provides access to not only the constant value, but also the symbolic name, the description, and the status of the constant. It also provides an interface for associating arbitrary user-defined data (specified as a void*) with a Constant.
Constant objects are read-only, with the exception of a single void* attribute for storing user data. Constant 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 Constant objects directly; applications will typically work with copies of objects returned by other blpapi components.
Constructor & Destructor Documentation
| blpapi::Constant::Constant |
( |
const Constant & |
original |
) |
|
Create a Constant 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::Constant::setUserData |
( |
void * |
userData |
) |
|
Set the user data associated with this Constant -- and all copies of this Constant -- to the specified userData. Clients are responsible for synchronizing calls to this function, and to userData(), across all copies of this Constant object.
| Name blpapi::Constant::name |
( |
|
) |
const |
Return the symbolic name of this Constant.
| const char* blpapi::Constant::description |
( |
|
) |
const |
Return a null-terminated string containing a human-readable description of this Constant. The returned pointer remains valid until this Constant is destroyed.
| int blpapi::Constant::status |
( |
|
) |
const |
| int blpapi::Constant::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.
| int blpapi::Constant::getValueAs |
( |
char * |
buffer |
) |
const |
Load the char value of this Constant into the specified buffer and return 0; if this Constant cannot be converted into a char then return a nonzero value and leave buffer unchanged.
| int blpapi::Constant::getValueAs |
( |
Int32 * |
buffer |
) |
const |
Load the Int32 value of this Constant into the specified buffer and return 0; if this Constant cannot be converted into an Int32 then return a nonzero value and leave buffer unchanged.
| int blpapi::Constant::getValueAs |
( |
Int64 * |
buffer |
) |
const |
Load the Int64 value of this Constant into the specified buffer and return 0; if this Constant cannot be converted into an Int64 then return a nonzero value and leave buffer unchanged.
| int blpapi::Constant::getValueAs |
( |
Float32 * |
buffer |
) |
const |
Load the Float32 value of this Constant into the specified buffer and return 0; if this Constant cannot be converted into a Float32 then return a nonzero value and leave buffer unchanged.
| int blpapi::Constant::getValueAs |
( |
Float64 * |
buffer |
) |
const |
Load the Float64 value of this Constant into the specified buffer and return 0; if this Constant cannot be converted into a Float64 then return a nonzero value and leave buffer unchanged.
| int blpapi::Constant::getValueAs |
( |
Datetime * |
buffer |
) |
const |
Load the Datetime value of this Constant into the specified buffer and return 0; if this Constant cannot be converted into a Datetime then return a nonzero value and leave buffer unchanged.
| int blpapi::Constant::getValueAs |
( |
std::string * |
buffer |
) |
const |
Load the std::string value of this Constant into the specified buffer and return 0; if this Constant cannot be converted into a std::string then return a nonzero value and leave buffer unchanged.
| char blpapi::Constant::getValueAsChar |
( |
|
) |
const |
Return the value of this object as a char. If the value cannot be converted to a char an exception is thrown.
| Int32 blpapi::Constant::getValueAsInt32 |
( |
|
) |
const |
Return the value of this object as an Int32. If the value cannot be converted to an Int32 an exception is thrown.
| Int64 blpapi::Constant::getValueAsInt64 |
( |
|
) |
const |
Return the value of this object as an Int64. If the value cannot be converted to an Int64 an exception is thrown.
| Float32 blpapi::Constant::getValueAsFloat32 |
( |
|
) |
const |
Return the value of this object as a Float32. If the value cannot be converted to a Float32 an exception is thrown.
| Float64 blpapi::Constant::getValueAsFloat64 |
( |
|
) |
const |
Return the value of this object as a Float64. If the value cannot be converted to a Float64 an exception is thrown.
| Datetime blpapi::Constant::getValueAsDatetime |
( |
|
) |
const |
Return the value of this object as a Datetime. If the value cannot be converted to a Datetime an exception is thrown.
| std::string blpapi::Constant::getValueAsString |
( |
|
) |
const |
Return the value of this object as a std::string. If the value cannot be converted to a std::string an exception is thrown.
| void* blpapi::Constant::userData |
( |
|
) |
const |
Return the user data associated with this Constant. If no user data has been associated with this Constant then return 0. Clients are responsible for synchronizing calls to this function with calls to setUserData(void*) made on not only this Constant, but also all copies of this Constant. Note that Constant objects have reference semantics: this function will reflect the last value set on any copy of this Constant.
The documentation for this class was generated from the following file: