28#ifndef INCLUDED_BLPAPI_ELEMENT
29#define INCLUDED_BLPAPI_ELEMENT
62#include <blpapi_deprecate.h>
116 const char *nameString,
121 const char *nameString,
126 const char *nameString,
128 int excludeNullElements,
245 const char *nameString,
251 const char *nameString,
257 const char *nameString,
263 const char *nameString,
269 const char *nameString,
275 const char *nameString,
281 const char *nameString,
287 const char *nameString,
293 const char *nameString,
299 const char *nameString,
306 const char *nameString,
312 const char *elementName,
323 const char *nameCstr,
334#include <type_traits>
483 BLPAPI_DEPRECATE_STRING_NAME
void setElement(
const char *
name,
bool value);
496 BLPAPI_DEPRECATE_STRING_NAME
void setElement(
const char *
name,
char value);
580 const char *
name,
const char *value);
594 const char *
name,
const Name& value);
730 template <
typename BYTES,
731 typename std::enable_if<IsByteSequence<BYTES>::value,
bool>::type
749 void setValue(
bool value,
size_t index = 0);
758 void setValue(
char value,
size_t index = 0);
812 void setValue(
const char *value,
size_t index = 0);
821 void setValue(
const std::string& value,
size_t index = 0);
841 void setValue(
const void *value,
size_t length,
size_t index);
850 template <
typename BYTES,
851 typename std::enable_if<IsByteSequence<BYTES>::value,
bool>::type
853 void setValue(
const BYTES& value,
size_t index = 0);
1078 BLPAPI_DEPRECATE_STRING_NAME
bool hasElement(
1079 const char *
name,
bool excludeNullElements =
false)
const;
1095 int getValueAs(
bool *result,
size_t index = 0)
const;
1104 int getValueAs(
char *result,
size_t index = 0)
const;
1161 int getValueAs(std::string *result,
size_t index = 0)
const;
1378 const char *
name)
const;
1399 const char *
name)
const;
1420 const char *
name)
const;
1441 const char *
name)
const;
1462 const char *
name)
const;
1490 const char *
name)
const;
1550 std::ostream&
print(
1551 std::ostream& stream,
int level = 0,
int spacesPerLevel = 4)
const;
1598 : d_handle_p(newHandle)
1604 d_handle_p = element;
1610 d_handle_p, elementName, 0, value ? 1 : 0));
1634 d_handle_p, elementName, 0, value));
1640 d_handle_p, elementName, 0, value));
1655 d_handle_p, elementName, 0, value));
1661 d_handle_p, elementName, 0, value.
impl()));
1667 d_handle_p, 0, elementName.
impl(), value ? 1 : 0));
1673 d_handle_p, 0, elementName.
impl(), value));
1679 d_handle_p, 0, elementName.
impl(), value));
1685 d_handle_p, 0, elementName.
impl(), value));
1691 d_handle_p, 0, elementName.
impl(), value));
1697 d_handle_p, 0, elementName.
impl(), value));
1712 d_handle_p, 0, elementName.
impl(), value));
1716 const Name& elementName,
const std::string& value)
1724 d_handle_p, 0, elementName.
impl(), value.
impl()));
1728 const Name& elementName,
const void *value,
size_t length)
1734 reinterpret_cast<const char *
>(value),
1738template <
typename BYTES,
1739 typename std::enable_if<IsByteSequence<BYTES>::value,
bool>::type>
1742 setElement(elementName, value.data(), value.size());
1802 d_handle_p, valueName.
impl(), index));
1808 d_handle_p,
reinterpret_cast<const char *
>(value), length, index));
1811template <
typename BYTES,
1812 typename std::enable_if<IsByteSequence<BYTES>::value,
bool>::type>
1815 setValue(value.data(), value.size(), index);
1884 return Element(appendedElement);
1891 d_handle_p, &resultElement, selectionName, 0, 0));
1892 return Element(resultElement);
1899 d_handle_p, &resultElement, 0, selectionName.
impl(), 0));
1900 return Element(resultElement);
1929 d_handle_p, &fldt, 0, elementName.
impl());
1995 if (rc != 0 && rc != 1) {
1998 return rc ? true :
false;
2002 const char *nameString,
bool excludeNullElements)
const
2004 if (excludeNullElements) {
2006 d_handle_p, nameString, 0, excludeNullElements, 0)
2014 const Name& elementName,
bool excludeNullElements)
const
2016 if (excludeNullElements) {
2020 excludeNullElements,
2034 d_handle_p, &fldt, 0, elementName.
impl()));
2061 *buffer = tmp ? true :
false;
2093 d_handle_p, buffer, index);
2100 const char *buffer = 0;
2112 const char *buffer = 0;
2115 d_handle_p, &buffer, &length, index);
2117 result->
assign(buffer, length);
2127 d_handle_p, &buffer->d_handle_p, index);
2137 *buffer =
Name(tmpName);
2193 const char *tmpStringBuffer = 0;
2195 d_handle_p, &tmpStringBuffer, index));
2196 return tmpStringBuffer;
2219 return Name(nameValue);
2237 return getElement(elementName).getValueAsBool();
2247 return getElement(elementName).getValueAsChar();
2257 return getElement(elementName).getValueAsInt32();
2267 return getElement(elementName).getValueAsInt64();
2277 return getElement(elementName).getValueAsFloat32();
2287 return getElement(elementName).getValueAsFloat64();
2297 return getElement(elementName).getValueAsDatetime();
2307 return getElement(elementName).getValueAsString();
2312 return getElement(elementName).getValueAsBytes();
2322 return getElement(elementName).getValueAsName();
2328 std::ostream& stream,
int level,
int spacesPerLevel)
const
2340 element.
print(stream, 0, -1);
Provide functions for dispatchtbl.
#define BLPAPI_CALL_ELEMENT_GETVALUEASHIGHPRECISIONDATETIME(a1, a2, a3)
Definition blpapi_call.h:403
#define BLPAPI_CALL_ELEMENT_SETELEMENTHIGHPRECISIONDATETIME(a1, a2, a3, a4)
Definition blpapi_call.h:401
#define BLPAPI_CALL_ELEMENT_SETVALUEHIGHPRECISIONDATETIME(a1, a2, a3)
Definition blpapi_call.h:399
#define BLPAPI_CALL(FUNCNAME)
Definition blpapi_call.h:353
Represents a date and/or time.
Common definitions used by the library.
#define BLPAPI_EXPORT
Definition blpapi_defs.h:171
#define BLPAPI_ELEMENT_INDEX_END
Definition blpapi_defs.h:96
BLPAPI_EXPORT int blpapi_Element_setValueHighPrecisionDatetime(blpapi_Element_t *element, const blpapi_HighPrecisionDatetime_t *value, size_t index)
BLPAPI_EXPORT int blpapi_Element_getValueAsInt32(const blpapi_Element_t *element, blpapi_Int32_t *buffer, size_t index)
BLPAPI_EXPORT int blpapi_Element_setValueFromName(blpapi_Element_t *element, const blpapi_Name_t *value, size_t index)
BLPAPI_EXPORT int blpapi_Element_datatype(const blpapi_Element_t *element)
BLPAPI_EXPORT int blpapi_Element_setElementHighPrecisionDatetime(blpapi_Element_t *element, const char *nameString, const blpapi_Name_t *name, const blpapi_HighPrecisionDatetime_t *value)
BLPAPI_EXPORT blpapi_Name_t * blpapi_Element_name(const blpapi_Element_t *element)
BLPAPI_EXPORT int blpapi_Element_setValueFromElement(blpapi_Element_t *element, blpapi_Element_t *value, size_t index)
BLPAPI_EXPORT int blpapi_Element_setElementFromField(blpapi_Element_t *element, const char *nameString, const blpapi_Name_t *name, blpapi_Element_t *sourcebuffer)
BLPAPI_EXPORT int blpapi_Element_setElementFromName(blpapi_Element_t *element, const char *elementName, const blpapi_Name_t *name, const blpapi_Name_t *buffer)
BLPAPI_EXPORT int blpapi_Element_appendElement(blpapi_Element_t *element, blpapi_Element_t **appendedElement)
BLPAPI_EXPORT size_t blpapi_Element_numValues(const blpapi_Element_t *element)
BLPAPI_EXPORT int blpapi_Element_getValueAsFloat64(const blpapi_Element_t *element, blpapi_Float64_t *buffer, size_t index)
BLPAPI_EXPORT int blpapi_Element_setValueString(blpapi_Element_t *element, const char *value, size_t index)
BLPAPI_EXPORT int blpapi_Element_isReadOnly(const blpapi_Element_t *element)
BLPAPI_EXPORT int blpapi_Element_setElementInt32(blpapi_Element_t *element, const char *nameString, const blpapi_Name_t *name, blpapi_Int32_t value)
BLPAPI_EXPORT size_t blpapi_Element_numElements(const blpapi_Element_t *element)
BLPAPI_EXPORT int blpapi_Element_setValueInt32(blpapi_Element_t *element, blpapi_Int32_t value, size_t index)
BLPAPI_EXPORT const char * blpapi_Element_nameString(const blpapi_Element_t *element)
BLPAPI_EXPORT int blpapi_Element_setElementChar(blpapi_Element_t *element, const char *nameString, const blpapi_Name_t *name, blpapi_Char_t value)
BLPAPI_EXPORT int blpapi_Element_getElement(const blpapi_Element_t *element, blpapi_Element_t **result, const char *nameString, const blpapi_Name_t *name)
BLPAPI_EXPORT int blpapi_Element_setValueFloat32(blpapi_Element_t *element, blpapi_Float32_t value, size_t index)
BLPAPI_EXPORT int blpapi_Element_setValueBytes(blpapi_Element_t *element, const char *value, size_t length, size_t index)
BLPAPI_EXPORT int blpapi_Element_isNull(const blpapi_Element_t *element)
BLPAPI_EXPORT int blpapi_Element_setElementBytes(blpapi_Element_t *element, const char *nameString, const blpapi_Name_t *name, const char *value, size_t length)
BLPAPI_EXPORT int blpapi_Element_isComplexType(const blpapi_Element_t *element)
BLPAPI_EXPORT int blpapi_Element_getValueAsString(const blpapi_Element_t *element, const char **buffer, size_t index)
BLPAPI_EXPORT int blpapi_Element_setValueChar(blpapi_Element_t *element, blpapi_Char_t value, size_t index)
BLPAPI_EXPORT int blpapi_Element_getValueAsDatetime(const blpapi_Element_t *element, blpapi_Datetime_t *buffer, size_t index)
BLPAPI_EXPORT int blpapi_Element_setElementString(blpapi_Element_t *element, const char *nameString, const blpapi_Name_t *name, const char *value)
BLPAPI_EXPORT int blpapi_Element_setValueBool(blpapi_Element_t *element, blpapi_Bool_t value, size_t index)
BLPAPI_EXPORT int blpapi_Element_getValueAsChar(const blpapi_Element_t *element, blpapi_Char_t *buffer, size_t index)
BLPAPI_EXPORT int blpapi_Element_getElementAt(const blpapi_Element_t *element, blpapi_Element_t **result, size_t position)
BLPAPI_EXPORT int blpapi_Element_getValueAsBool(const blpapi_Element_t *element, blpapi_Bool_t *buffer, size_t index)
BLPAPI_EXPORT int blpapi_Element_setElementInt64(blpapi_Element_t *element, const char *nameString, const blpapi_Name_t *name, blpapi_Int64_t value)
BLPAPI_EXPORT int blpapi_Element_getValueAsFloat32(const blpapi_Element_t *element, blpapi_Float32_t *buffer, size_t index)
BLPAPI_EXPORT int blpapi_Element_hasElementEx(const blpapi_Element_t *element, const char *nameString, const blpapi_Name_t *name, int excludeNullElements, int reserved)
BLPAPI_EXPORT int blpapi_Element_setElementBool(blpapi_Element_t *element, const char *nameString, const blpapi_Name_t *name, blpapi_Bool_t value)
BLPAPI_EXPORT int blpapi_Element_setValueInt64(blpapi_Element_t *element, blpapi_Int64_t value, size_t index)
BLPAPI_EXPORT int blpapi_Element_isArray(const blpapi_Element_t *element)
BLPAPI_EXPORT int blpapi_Element_getChoice(const blpapi_Element_t *element, blpapi_Element_t **result)
BLPAPI_EXPORT int blpapi_Element_setElementFloat64(blpapi_Element_t *element, const char *nameString, const blpapi_Name_t *name, blpapi_Float64_t value)
BLPAPI_EXPORT int blpapi_Element_print(const blpapi_Element_t *element, blpapi_StreamWriter_t streamWriter, void *stream, int level, int spacesPerLevel)
BLPAPI_EXPORT int blpapi_Element_setElementDatetime(blpapi_Element_t *element, const char *nameString, const blpapi_Name_t *name, const blpapi_Datetime_t *value)
BLPAPI_EXPORT int blpapi_Element_getValueAsElement(const blpapi_Element_t *element, blpapi_Element_t **buffer, size_t index)
BLPAPI_EXPORT blpapi_SchemaElementDefinition_t * blpapi_Element_definition(const blpapi_Element_t *element)
BLPAPI_EXPORT int blpapi_Element_hasElement(const blpapi_Element_t *element, const char *nameString, const blpapi_Name_t *name)
BLPAPI_EXPORT int blpapi_Element_getValueAsHighPrecisionDatetime(const blpapi_Element_t *element, blpapi_HighPrecisionDatetime_t *buffer, size_t index)
BLPAPI_EXPORT int blpapi_Element_getValueAsName(const blpapi_Element_t *element, blpapi_Name_t **buffer, size_t index)
BLPAPI_EXPORT int blpapi_Element_getValueAsInt64(const blpapi_Element_t *element, blpapi_Int64_t *buffer, size_t index)
BLPAPI_EXPORT int blpapi_Element_setChoice(blpapi_Element_t *element, blpapi_Element_t **resultElement, const char *nameCstr, const blpapi_Name_t *name, size_t index)
BLPAPI_EXPORT int blpapi_Element_setValueFloat64(blpapi_Element_t *element, blpapi_Float64_t value, size_t index)
BLPAPI_EXPORT int blpapi_Element_setElementFloat32(blpapi_Element_t *element, const char *nameString, const blpapi_Name_t *name, blpapi_Float32_t value)
BLPAPI_EXPORT int blpapi_Element_getValueAsBytes(const blpapi_Element_t *element, const char **buffer, size_t *length, size_t index)
BLPAPI_EXPORT int blpapi_Element_isNullValue(const blpapi_Element_t *element, size_t position)
BLPAPI_EXPORT 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.
Provide a representation of strings for use as container keys.
Provide a representation of a schema describing structured messages.
A signature for callback on print and default C++ implementation.
int(* blpapi_StreamWriter_t)(const char *data, int length, void *stream)
Definition blpapi_streamproxy.h:53
int blpapi_Bool_t
Definition blpapi_types.h:62
char blpapi_Char_t
Definition blpapi_types.h:63
float blpapi_Float32_t
Definition blpapi_types.h:71
long long blpapi_Int64_t
Definition blpapi_types.h:69
int blpapi_Int32_t
Definition blpapi_types.h:67
double blpapi_Float64_t
Definition blpapi_types.h:72
Definition blpapi_types.h:312
void assign(pointer ptr, size_type length) noexcept
Definition blpapi_types.h:496
Definition blpapi_datetime.h:245
blpapi_HighPrecisionDatetime_t & rawHighPrecisionValue()
Definition blpapi_datetime.h:1954
Definition blpapi_element.h:465
BLPAPI_DEPRECATE_STRING_NAME Datetime getElementAsDatetime(const char *name) const
Definition blpapi_element.h:2290
Name name() const
Definition blpapi_element.h:1905
void rebind(blpapi_Element_t *element)
Definition blpapi_element.h:1602
int getValueAs(bool *result, size_t index=0) const
Definition blpapi_element.h:2054
BLPAPI_DEPRECATE_STRING_NAME Element setChoice(const char *selectionName)
Definition blpapi_element.h:1887
Bytes getElementAsBytes(const Name &name) const
Definition blpapi_element.h:2310
bool isNullValue(size_t position=0) const
Definition blpapi_element.h:1992
BLPAPI_DEPRECATE_STRING_NAME int getElement(Element *result, const char *name) const
Definition blpapi_element.h:1910
Float64 getValueAsFloat64(size_t index=0) const
Definition blpapi_element.h:2177
Element getValueAsElement(size_t index=0) const
Definition blpapi_element.h:2206
Name getValueAsName(size_t index=0) const
Definition blpapi_element.h:2214
int datatype() const
Definition blpapi_element.h:1950
BLPAPI_DEPRECATE_STRING_NAME Name getElementAsName(const char *name) const
Definition blpapi_element.h:2315
Int64 getValueAsInt64(size_t index=0) const
Definition blpapi_element.h:2163
Bytes getValueAsBytes(size_t index=0) const
Definition blpapi_element.h:2199
blpapi_Element_t * handle()
Definition blpapi_element.h:1903
BLPAPI_DEPRECATE_STRING_NAME Float64 getElementAsFloat64(const char *name) const
Definition blpapi_element.h:2280
size_t numValues() const
Definition blpapi_element.h:1980
bool isReadOnly() const
Definition blpapi_element.h:1970
BLPAPI_DEPRECATE_STRING_NAME bool hasElement(const char *name, bool excludeNullElements=false) const
Definition blpapi_element.h:2001
void appendValue(bool value)
Definition blpapi_element.h:1818
bool isValid() const
Definition blpapi_element.h:1990
BLPAPI_DEPRECATE_STRING_NAME bool getElementAsBool(const char *name) const
Definition blpapi_element.h:2230
bool getValueAsBool(size_t index=0) const
Definition blpapi_element.h:2142
std::ostream & print(std::ostream &stream, int level=0, int spacesPerLevel=4) const
Definition blpapi_element.h:2327
void setValue(bool value, size_t index=0)
Definition blpapi_element.h:1745
BLPAPI_DEPRECATE_STRING_NAME char getElementAsChar(const char *name) const
Definition blpapi_element.h:2240
Element appendElement()
Definition blpapi_element.h:1879
const char * getValueAsString(size_t index=0) const
Definition blpapi_element.h:2191
bool isComplexType() const
Definition blpapi_element.h:1955
char getValueAsChar(size_t index=0) const
Definition blpapi_element.h:2149
BLPAPI_DEPRECATE_STRING_NAME void setElement(const char *name, bool value)
Definition blpapi_element.h:1607
Element()
Definition blpapi_element.h:1592
Datetime getValueAsDatetime(size_t index=0) const
Definition blpapi_element.h:2184
bool isNull() const
Definition blpapi_element.h:1965
SchemaElementDefinition elementDefinition() const
Definition blpapi_element.h:1975
BLPAPI_DEPRECATE_STRING_NAME Int64 getElementAsInt64(const char *name) const
Definition blpapi_element.h:2260
BLPAPI_DEPRECATE_STRING_NAME Int32 getElementAsInt32(const char *name) const
Definition blpapi_element.h:2250
Element getChoice() const
Definition blpapi_element.h:2222
Float32 getValueAsFloat32(size_t index=0) const
Definition blpapi_element.h:2170
bool isArray() const
Definition blpapi_element.h:1960
Int32 getValueAsInt32(size_t index=0) const
Definition blpapi_element.h:2156
BLPAPI_DEPRECATE_STRING_NAME const char * getElementAsString(const char *name) const
Definition blpapi_element.h:2300
BLPAPI_DEPRECATE_STRING_NAME Float32 getElementAsFloat32(const char *name) const
Definition blpapi_element.h:2270
size_t numElements() const
Definition blpapi_element.h:1985
static void throwOnError(int errorCode)
Definition blpapi_exception.h:526
Definition blpapi_name.h:150
blpapi_Name_t * impl() const
Definition blpapi_name.h:403
Definition blpapi_schema.h:327
struct blpapi_Name blpapi_Name_t
Definition blpapi_types.h:154
struct blpapi_SchemaElementDefinition blpapi_SchemaElementDefinition_t
Definition blpapi_types.h:191
struct blpapi_Element blpapi_Element_t
Definition blpapi_types.h:136
blpapi_Float64_t Float64
Definition blpapi_types.h:474
blpapi_Float32_t Float32
Definition blpapi_types.h:473
blpapi_Int64_t Int64
Definition blpapi_types.h:471
std::ostream & operator<<(std::ostream &os, const CorrelationId &correlator)
Definition blpapi_correlationid.h:592
blpapi_Int32_t Int32
Definition blpapi_types.h:469
Definition blpapi_abstractsession.h:195
static int writeToStream(const char *data, int length, void *stream)
Definition blpapi_streamproxy.h:93
Definition blpapi_datetime.h:102
Definition blpapi_datetime.h:115