28 #ifndef INCLUDED_BLPAPI_ELEMENT 29 #define INCLUDED_BLPAPI_ELEMENT 115 const char *nameString,
120 const char *nameString,
125 const char *nameString,
127 int excludeNullElements,
244 const char *nameString,
250 const char *nameString,
256 const char *nameString,
262 const char *nameString,
268 const char *nameString,
274 const char *nameString,
280 const char *nameString,
286 const char *nameString,
292 const char *nameString,
298 const char *nameString,
305 const char *nameString,
311 const char *elementName,
322 const char *nameCstr,
333 #include <type_traits> 482 [[deprecated(
"Use the form that takes Name instead of const char*")]]
void 496 [[deprecated(
"Use the form that takes Name instead of const char*")]]
void 510 [[deprecated(
"Use the form that takes Name instead of const char*")]]
void 524 [[deprecated(
"Use the form that takes Name instead of const char*")]]
void 538 [[deprecated(
"Use the form that takes Name instead of const char*")]]
void 552 [[deprecated(
"Use the form that takes Name instead of const char*")]]
void 566 [[deprecated(
"Use the form that takes Name instead of const char*")]]
void 580 [[deprecated(
"Use the form that takes Name instead of const char*")]]
void 594 [[deprecated(
"Use the form that takes Name instead of const char*")]]
void 731 template <
typename BYTES,
732 typename std::enable_if<IsByteSequence<BYTES>::value,
bool>::type
750 void setValue(
bool value,
size_t index = 0);
759 void setValue(
char value,
size_t index = 0);
813 void setValue(
const char *value,
size_t index = 0);
822 void setValue(
const std::string& value,
size_t index = 0);
842 void setValue(
const void *value,
size_t length,
size_t index);
851 template <
typename BYTES,
852 typename std::enable_if<IsByteSequence<BYTES>::value,
bool>::type
854 void setValue(
const BYTES& value,
size_t index = 0);
979 "Use the form that takes Name instead of const char*")]]
Element 1081 [[deprecated(
"Use the form that takes Name instead of const char*")]]
bool 1082 hasElement(
const char *
name,
bool excludeNullElements =
false)
const;
1098 int getValueAs(
bool *result,
size_t index = 0)
const;
1107 int getValueAs(
char *result,
size_t index = 0)
const;
1164 int getValueAs(std::string *result,
size_t index = 0)
const;
1283 [[deprecated(
"Use the form that takes Name instead of const char*")]]
int 1330 "Use the form that takes Name instead of const char*")]]
Element 1342 [[deprecated(
"Use the form that takes Name instead of const char*")]]
bool 1363 [[deprecated(
"Use the form that takes Name instead of const char*")]]
char 1384 [[deprecated(
"Use the form that takes Name instead of const char*")]]
Int32 1405 [[deprecated(
"Use the form that takes Name instead of const char*")]]
Int64 1427 "Use the form that takes Name instead of const char*")]]
Float32 1449 "Use the form that takes Name instead of const char*")]]
Float64 1471 "Use the form that takes Name instead of const char*")]]
Datetime 1499 [[deprecated(
"Use the form that takes Name instead of const " 1500 "char*")]]
const char *
1533 [[deprecated(
"Use the form that takes Name instead of const char*")]]
Name 1562 std::ostream&
print(
1563 std::ostream& stream,
int level = 0,
int spacesPerLevel = 4)
const;
1610 : d_handle_p(newHandle)
1616 d_handle_p = element;
1622 d_handle_p, elementName, 0, value ? 1 : 0));
1646 d_handle_p, elementName, 0, value));
1652 d_handle_p, elementName, 0, value));
1667 d_handle_p, elementName, 0, value));
1673 d_handle_p, elementName, 0, value.
impl()));
1679 d_handle_p, 0, elementName.
impl(), value ? 1 : 0));
1685 d_handle_p, 0, elementName.
impl(), value));
1691 d_handle_p, 0, elementName.
impl(), value));
1697 d_handle_p, 0, elementName.
impl(), value));
1703 d_handle_p, 0, elementName.
impl(), value));
1709 d_handle_p, 0, elementName.
impl(), value));
1724 d_handle_p, 0, elementName.
impl(), value));
1728 const Name& elementName,
const std::string& value)
1736 d_handle_p, 0, elementName.
impl(), value.
impl()));
1740 const Name& elementName,
const void *value,
size_t length)
1746 reinterpret_cast<const char *>(value),
1750 template <
typename BYTES,
1751 typename std::enable_if<IsByteSequence<BYTES>::value,
bool>::type>
1754 setElement(elementName, value.data(), value.size());
1814 d_handle_p, valueName.
impl(), index));
1820 d_handle_p, reinterpret_cast<const char *>(value), length, index));
1823 template <
typename BYTES,
1824 typename std::enable_if<IsByteSequence<BYTES>::value,
bool>::type>
1827 setValue(value.data(), value.size(), index);
1896 return Element(appendedElement);
1903 d_handle_p, &resultElement, selectionName, 0, 0));
1904 return Element(resultElement);
1911 d_handle_p, &resultElement, 0, selectionName.
impl(), 0));
1912 return Element(resultElement);
1941 d_handle_p, &fldt, 0, elementName.
impl());
2007 if (rc != 0 && rc != 1) {
2010 return rc ? true :
false;
2014 const char *nameString,
bool excludeNullElements)
const 2016 if (excludeNullElements) {
2018 d_handle_p, nameString, 0, excludeNullElements, 0)
2026 const Name& elementName,
bool excludeNullElements)
const 2028 if (excludeNullElements) {
2032 excludeNullElements,
2046 d_handle_p, &fldt, 0, elementName.
impl()));
2073 *buffer = tmp ? true :
false;
2105 d_handle_p, buffer, index);
2112 const char *buffer = 0;
2124 const char *buffer = 0;
2127 d_handle_p, &buffer, &length, index);
2129 result->
assign(buffer, length);
2139 d_handle_p, &buffer->d_handle_p, index);
2149 *buffer =
Name(tmpName);
2205 const char *tmpStringBuffer = 0;
2207 d_handle_p, &tmpStringBuffer, index));
2208 return tmpStringBuffer;
2231 return Name(nameValue);
2249 return getElement(elementName).getValueAsBool();
2259 return getElement(elementName).getValueAsChar();
2269 return getElement(elementName).getValueAsInt32();
2279 return getElement(elementName).getValueAsInt64();
2289 return getElement(elementName).getValueAsFloat32();
2299 return getElement(elementName).getValueAsFloat64();
2309 return getElement(elementName).getValueAsDatetime();
2319 return getElement(elementName).getValueAsString();
2324 return getElement(elementName).getValueAsBytes();
2334 return getElement(elementName).getValueAsName();
2340 std::ostream& stream,
int level,
int spacesPerLevel)
const 2352 element.
print(stream, 0, -1);
2359 #endif // #ifdef __cplusplus 2360 #endif // #ifndef INCLUDED_BLPAPI_ELEMENT blpapi_SchemaElementDefinition_t * blpapi_Element_definition(const blpapi_Element_t *element)
int blpapi_Element_setElementHighPrecisionDatetime(blpapi_Element_t *element, const char *nameString, const blpapi_Name_t *name, const blpapi_HighPrecisionDatetime_t *value)
int blpapi_Element_getChoice(const blpapi_Element_t *element, blpapi_Element_t **result)
blpapi_Element_t * handle()
Definition: blpapi_element.h:1915
int blpapi_Element_setChoice(blpapi_Element_t *element, blpapi_Element_t **resultElement, const char *nameCstr, const blpapi_Name_t *name, size_t index)
bool getElementAsBool(const char *name) const
Definition: blpapi_element.h:2242
Datetime getValueAsDatetime(size_t index=0) const
Definition: blpapi_element.h:2196
Float64 getValueAsFloat64(size_t index=0) const
Definition: blpapi_element.h:2189
#define BLPAPI_CALL_ELEMENT_SETELEMENTHIGHPRECISIONDATETIME(a1, a2, a3, a4)
Definition: blpapi_call.h:401
int blpapi_Element_setValueBytes(blpapi_Element_t *element, const char *value, size_t length, size_t index)
int blpapi_Element_getValueAsString(const blpapi_Element_t *element, const char **buffer, size_t index)
struct blpapi_Element blpapi_Element_t
Definition: blpapi_types.h:136
int blpapi_Element_getValueAsInt32(const blpapi_Element_t *element, blpapi_Int32_t *buffer, size_t index)
int blpapi_Element_isReadOnly(const blpapi_Element_t *element)
int blpapi_Element_isNull(const blpapi_Element_t *element)
Common definitions used by the library.
bool isValid() const
Definition: blpapi_element.h:2002
blpapi_Int32_t Int32
Definition: blpapi_types.h:469
int blpapi_Element_hasElement(const blpapi_Element_t *element, const char *nameString, const blpapi_Name_t *name)
Represents a date and/or time.
Float32 getElementAsFloat32(const char *name) const
Definition: blpapi_element.h:2282
Float64 getElementAsFloat64(const char *name) const
Definition: blpapi_element.h:2292
Definition: blpapi_abstractsession.h:220
Definition: blpapi_name.h:150
#define BLPAPI_CALL(FUNCNAME)
Definition: blpapi_call.h:353
blpapi_Float64_t Float64
Definition: blpapi_types.h:474
Element getChoice() const
Definition: blpapi_element.h:2234
bool getValueAsBool(size_t index=0) const
Definition: blpapi_element.h:2154
int blpapi_Element_isComplexType(const blpapi_Element_t *element)
int blpapi_Element_getValueAsChar(const blpapi_Element_t *element, blpapi_Char_t *buffer, size_t index)
int blpapi_Element_getValueAsName(const blpapi_Element_t *element, blpapi_Name_t **buffer, size_t index)
bool isNullValue(size_t position=0) const
Definition: blpapi_element.h:2004
int blpapi_Element_setElementChar(blpapi_Element_t *element, const char *nameString, const blpapi_Name_t *name, blpapi_Char_t value)
int blpapi_Element_getValueAsDatetime(const blpapi_Element_t *element, blpapi_Datetime_t *buffer, size_t index)
blpapi_Name_t * impl() const
Definition: blpapi_name.h:403
bool isArray() const
Definition: blpapi_element.h:1972
int blpapi_Int32_t
Definition: blpapi_types.h:67
int blpapi_Element_setElementFloat64(blpapi_Element_t *element, const char *nameString, const blpapi_Name_t *name, blpapi_Float64_t value)
struct blpapi_Name blpapi_Name_t
Definition: blpapi_types.h:154
Name getElementAsName(const char *name) const
Definition: blpapi_element.h:2327
char getValueAsChar(size_t index=0) const
Definition: blpapi_element.h:2161
int blpapi_Element_setValueInt64(blpapi_Element_t *element, blpapi_Int64_t value, size_t index)
int blpapi_Element_isArray(const blpapi_Element_t *element)
bool isComplexType() const
Definition: blpapi_element.h:1967
void appendValue(bool value)
Definition: blpapi_element.h:1830
Definition: blpapi_schema.h:327
int(* blpapi_StreamWriter_t)(const char *data, int length, void *stream)
Definition: blpapi_streamproxy.h:53
int blpapi_Element_setValueFloat64(blpapi_Element_t *element, blpapi_Float64_t value, size_t index)
int blpapi_Bool_t
Definition: blpapi_types.h:62
int blpapi_Element_getValueAsFloat32(const blpapi_Element_t *element, blpapi_Float32_t *buffer, size_t index)
int blpapi_Element_getValueAsBool(const blpapi_Element_t *element, blpapi_Bool_t *buffer, size_t index)
blpapi_Float32_t Float32
Definition: blpapi_types.h:473
size_t blpapi_Element_numElements(const blpapi_Element_t *element)
Element()
Definition: blpapi_element.h:1604
int blpapi_Element_getElementAt(const blpapi_Element_t *element, blpapi_Element_t **result, size_t position)
Name getValueAsName(size_t index=0) const
Definition: blpapi_element.h:2226
#define BLPAPI_ELEMENT_INDEX_END
Definition: blpapi_defs.h:96
struct blpapi_SchemaElementDefinition blpapi_SchemaElementDefinition_t
Definition: blpapi_types.h:191
Datetime getElementAsDatetime(const char *name) const
Definition: blpapi_element.h:2302
int blpapi_Element_setValueChar(blpapi_Element_t *element, blpapi_Char_t value, size_t index)
int blpapi_Element_setValueBool(blpapi_Element_t *element, blpapi_Bool_t value, size_t index)
static void throwOnError(int errorCode)
Definition: blpapi_exception.h:526
Provide a representation of a schema describing structured messages.
Definition: blpapi_element.h:464
Float32 getValueAsFloat32(size_t index=0) const
Definition: blpapi_element.h:2182
Int32 getValueAsInt32(size_t index=0) const
Definition: blpapi_element.h:2168
Int64 getValueAsInt64(size_t index=0) const
Definition: blpapi_element.h:2175
bool isNull() const
Definition: blpapi_element.h:1977
Bytes getValueAsBytes(size_t index=0) const
Definition: blpapi_element.h:2211
int blpapi_Element_getValueAsHighPrecisionDatetime(const blpapi_Element_t *element, blpapi_HighPrecisionDatetime_t *buffer, size_t index)
Int32 getElementAsInt32(const char *name) const
Definition: blpapi_element.h:2262
size_t numValues() const
Definition: blpapi_element.h:1992
int blpapi_Element_setElementInt32(blpapi_Element_t *element, const char *nameString, const blpapi_Name_t *name, blpapi_Int32_t value)
int blpapi_Element_getElement(const blpapi_Element_t *element, blpapi_Element_t **result, const char *nameString, const blpapi_Name_t *name)
void setValue(bool value, size_t index=0)
Definition: blpapi_element.h:1757
int blpapi_Element_print(const blpapi_Element_t *element, blpapi_StreamWriter_t streamWriter, void *stream, int level, int spacesPerLevel)
int blpapi_Element_datatype(const blpapi_Element_t *element)
int getValueAs(bool *result, size_t index=0) const
Definition: blpapi_element.h:2066
int blpapi_Element_setElementString(blpapi_Element_t *element, const char *nameString, const blpapi_Name_t *name, const char *value)
int datatype() const
Definition: blpapi_element.h:1962
std::ostream & operator<<(std::ostream &os, const CorrelationId &correlator)
Definition: blpapi_correlationid.h:592
#define BLPAPI_CALL_ELEMENT_SETVALUEHIGHPRECISIONDATETIME(a1, a2, a3)
Definition: blpapi_call.h:399
size_t blpapi_Element_numValues(const blpapi_Element_t *element)
int blpapi_Element_setValueFloat32(blpapi_Element_t *element, blpapi_Float32_t value, size_t index)
blpapi_Int64_t Int64
Definition: blpapi_types.h:471
int blpapi_Element_setValueFromName(blpapi_Element_t *element, const blpapi_Name_t *value, size_t index)
int blpapi_Element_setValueFromElement(blpapi_Element_t *element, blpapi_Element_t *value, size_t index)
Definition: blpapi_datetime.h:102
int getElement(Element *result, const char *name) const
Definition: blpapi_element.h:1922
#define BLPAPI_CALL_ELEMENT_GETVALUEASHIGHPRECISIONDATETIME(a1, a2, a3)
Definition: blpapi_call.h:403
Int64 getElementAsInt64(const char *name) const
Definition: blpapi_element.h:2272
Element appendElement()
Definition: blpapi_element.h:1891
blpapi_HighPrecisionDatetime_t & rawHighPrecisionValue()
Definition: blpapi_datetime.h:1954
size_t numElements() const
Definition: blpapi_element.h:1997
int blpapi_Element_getValueAsFloat64(const blpapi_Element_t *element, blpapi_Float64_t *buffer, size_t index)
A signature for callback on print and default C++ implementation.
double blpapi_Float64_t
Definition: blpapi_types.h:72
void assign(pointer ptr, size_type length) noexcept
Definition: blpapi_types.h:496
void setElement(const char *name, bool value)
Definition: blpapi_element.h:1619
int blpapi_Element_hasElementEx(const blpapi_Element_t *element, const char *nameString, const blpapi_Name_t *name, int excludeNullElements, int reserved)
int blpapi_Element_getValueAsInt64(const blpapi_Element_t *element, blpapi_Int64_t *buffer, size_t index)
int blpapi_Element_getValueAsElement(const blpapi_Element_t *element, blpapi_Element_t **buffer, size_t index)
int blpapi_Element_setElementFromField(blpapi_Element_t *element, const char *nameString, const blpapi_Name_t *name, blpapi_Element_t *sourcebuffer)
int blpapi_Element_setElementFloat32(blpapi_Element_t *element, const char *nameString, const blpapi_Name_t *name, blpapi_Float32_t value)
char getElementAsChar(const char *name) const
Definition: blpapi_element.h:2252
char blpapi_Char_t
Definition: blpapi_types.h:63
int blpapi_Element_getValueAsBytes(const blpapi_Element_t *element, const char **buffer, size_t *length, size_t index)
int blpapi_Element_setValueInt32(blpapi_Element_t *element, blpapi_Int32_t value, size_t index)
long long blpapi_Int64_t
Definition: blpapi_types.h:69
const char * blpapi_Element_nameString(const blpapi_Element_t *element)
int blpapi_Element_setValueDatetime(blpapi_Element_t *element, const blpapi_Datetime_t *value, size_t index)
Defines Exceptions that can be thrown by the blpapi library.
int blpapi_Element_setValueHighPrecisionDatetime(blpapi_Element_t *element, const blpapi_HighPrecisionDatetime_t *value, size_t index)
int blpapi_Element_setElementDatetime(blpapi_Element_t *element, const char *nameString, const blpapi_Name_t *name, const blpapi_Datetime_t *value)
int blpapi_Element_setValueString(blpapi_Element_t *element, const char *value, size_t index)
bool hasElement(const char *name, bool excludeNullElements=false) const
Definition: blpapi_element.h:2013
Bytes getElementAsBytes(const Name &name) const
Definition: blpapi_element.h:2322
Element setChoice(const char *selectionName)
Definition: blpapi_element.h:1899
std::ostream & print(std::ostream &stream, int level=0, int spacesPerLevel=4) const
Definition: blpapi_element.h:2339
float blpapi_Float32_t
Definition: blpapi_types.h:71
static int writeToStream(const char *data, int length, void *stream)
Definition: blpapi_streamproxy.h:93
blpapi_Name_t * blpapi_Element_name(const blpapi_Element_t *element)
Name name() const
Definition: blpapi_element.h:1917
SchemaElementDefinition elementDefinition() const
Definition: blpapi_element.h:1987
int blpapi_Element_setElementBytes(blpapi_Element_t *element, const char *nameString, const blpapi_Name_t *name, const char *value, size_t length)
int blpapi_Element_setElementFromName(blpapi_Element_t *element, const char *elementName, const blpapi_Name_t *name, const blpapi_Name_t *buffer)
#define BLPAPI_EXPORT
Definition: blpapi_defs.h:171
Definition: blpapi_datetime.h:245
Provide functions for dispatchtbl.
int blpapi_Element_isNullValue(const blpapi_Element_t *element, size_t position)
Element getValueAsElement(size_t index=0) const
Definition: blpapi_element.h:2218
int blpapi_Element_setElementInt64(blpapi_Element_t *element, const char *nameString, const blpapi_Name_t *name, blpapi_Int64_t value)
const char * getElementAsString(const char *name) const
Definition: blpapi_element.h:2312
Provide a representation of strings for use as container keys.
Definition: blpapi_types.h:312
int blpapi_Element_appendElement(blpapi_Element_t *element, blpapi_Element_t **appendedElement)
void rebind(blpapi_Element_t *element)
Definition: blpapi_element.h:1614
Definition: blpapi_datetime.h:115
int blpapi_Element_setElementBool(blpapi_Element_t *element, const char *nameString, const blpapi_Name_t *name, blpapi_Bool_t value)
bool isReadOnly() const
Definition: blpapi_element.h:1982
const char * getValueAsString(size_t index=0) const
Definition: blpapi_element.h:2203