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> 722 template <
typename BYTES,
723 typename std::enable_if<IsByteSequence<BYTES>::value,
bool>::type
741 void setValue(
bool value,
size_t index = 0);
750 void setValue(
char value,
size_t index = 0);
804 void setValue(
const char *value,
size_t index = 0);
813 void setValue(
const std::string& value,
size_t index = 0);
833 void setValue(
const void *value,
size_t length,
size_t index);
842 template <
typename BYTES,
843 typename std::enable_if<IsByteSequence<BYTES>::value,
bool>::type
845 void setValue(
const BYTES& value,
size_t index = 0);
1070 bool hasElement(
const char *
name,
bool excludeNullElements =
false)
const;
1086 int getValueAs(
bool *result,
size_t index = 0)
const;
1095 int getValueAs(
char *result,
size_t index = 0)
const;
1152 int getValueAs(std::string *result,
size_t index = 0)
const;
1534 std::ostream&
print(
1535 std::ostream& stream,
int level = 0,
int spacesPerLevel = 4)
const;
1582 : d_handle_p(newHandle)
1588 d_handle_p = element;
1594 d_handle_p, elementName, 0, value ? 1 : 0));
1618 d_handle_p, elementName, 0, value));
1624 d_handle_p, elementName, 0, value));
1639 d_handle_p, elementName, 0, value));
1645 d_handle_p, elementName, 0, value.
impl()));
1651 d_handle_p, 0, elementName.
impl(), value ? 1 : 0));
1657 d_handle_p, 0, elementName.
impl(), value));
1663 d_handle_p, 0, elementName.
impl(), value));
1669 d_handle_p, 0, elementName.
impl(), value));
1675 d_handle_p, 0, elementName.
impl(), value));
1681 d_handle_p, 0, elementName.
impl(), value));
1696 d_handle_p, 0, elementName.
impl(), value));
1700 const Name& elementName,
const std::string& value)
1708 d_handle_p, 0, elementName.
impl(), value.
impl()));
1712 const Name& elementName,
const void *value,
size_t length)
1718 reinterpret_cast<const char *>(value),
1722 template <
typename BYTES,
1723 typename std::enable_if<IsByteSequence<BYTES>::value,
bool>::type>
1726 setElement(elementName, value.data(), value.size());
1786 d_handle_p, valueName.
impl(), index));
1792 d_handle_p, reinterpret_cast<const char *>(value), length, index));
1795 template <
typename BYTES,
1796 typename std::enable_if<IsByteSequence<BYTES>::value,
bool>::type>
1799 setValue(value.data(), value.size(), index);
1868 return Element(appendedElement);
1875 d_handle_p, &resultElement, selectionName, 0, 0));
1876 return Element(resultElement);
1883 d_handle_p, &resultElement, 0, selectionName.
impl(), 0));
1884 return Element(resultElement);
1910 d_handle_p, &fldt, 0, elementName.
impl());
1976 if (rc != 0 && rc != 1) {
1979 return rc ? true :
false;
1983 const char *nameString,
bool excludeNullElements)
const 1985 if (excludeNullElements) {
1987 d_handle_p, nameString, 0, excludeNullElements, 0)
1995 const Name& elementName,
bool excludeNullElements)
const 1997 if (excludeNullElements) {
2001 excludeNullElements,
2015 d_handle_p, &fldt, 0, elementName.
impl()));
2042 *buffer = tmp ? true :
false;
2074 d_handle_p, buffer, index);
2081 const char *buffer = 0;
2093 const char *buffer = 0;
2096 d_handle_p, &buffer, &length, index);
2098 result->
assign(buffer, length);
2108 d_handle_p, &buffer->d_handle_p, index);
2118 *buffer =
Name(tmpName);
2174 const char *tmpStringBuffer = 0;
2176 d_handle_p, &tmpStringBuffer, index));
2177 return tmpStringBuffer;
2213 return getElement(elementName).getValueAsBool();
2218 return getElement(elementName).getValueAsBool();
2223 return getElement(elementName).getValueAsChar();
2228 return getElement(elementName).getValueAsChar();
2233 return getElement(elementName).getValueAsInt32();
2238 return getElement(elementName).getValueAsInt32();
2243 return getElement(elementName).getValueAsInt64();
2248 return getElement(elementName).getValueAsInt64();
2253 return getElement(elementName).getValueAsFloat32();
2258 return getElement(elementName).getValueAsFloat32();
2263 return getElement(elementName).getValueAsFloat64();
2268 return getElement(elementName).getValueAsFloat64();
2273 return getElement(elementName).getValueAsDatetime();
2278 return getElement(elementName).getValueAsDatetime();
2283 return getElement(elementName).getValueAsString();
2288 return getElement(elementName).getValueAsString();
2293 return getElement(elementName).getValueAsBytes();
2298 return getElement(elementName).getValueAsName();
2303 return getElement(elementName).getValueAsName();
2309 std::ostream& stream,
int level,
int spacesPerLevel)
const 2321 element.
print(stream, 0, -1);
2328 #endif // #ifdef __cplusplus 2329 #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:1887
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:2211
Datetime getValueAsDatetime(size_t index=0) const
Definition: blpapi_element.h:2165
Float64 getValueAsFloat64(size_t index=0) const
Definition: blpapi_element.h:2158
#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:1971
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:2251
Float64 getElementAsFloat64(const char *name) const
Definition: blpapi_element.h:2261
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:2203
bool getValueAsBool(size_t index=0) const
Definition: blpapi_element.h:2123
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:1973
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:1941
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:2296
char getValueAsChar(size_t index=0) const
Definition: blpapi_element.h:2130
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:1936
void appendValue(bool value)
Definition: blpapi_element.h:1802
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:1576
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:2195
#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:2271
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:2151
Int32 getValueAsInt32(size_t index=0) const
Definition: blpapi_element.h:2137
Int64 getValueAsInt64(size_t index=0) const
Definition: blpapi_element.h:2144
bool isNull() const
Definition: blpapi_element.h:1946
Bytes getValueAsBytes(size_t index=0) const
Definition: blpapi_element.h:2180
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:2231
size_t numValues() const
Definition: blpapi_element.h:1961
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:1729
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:2035
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:1931
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:1891
#define BLPAPI_CALL_ELEMENT_GETVALUEASHIGHPRECISIONDATETIME(a1, a2, a3)
Definition: blpapi_call.h:403
Int64 getElementAsInt64(const char *name) const
Definition: blpapi_element.h:2241
Element appendElement()
Definition: blpapi_element.h:1863
blpapi_HighPrecisionDatetime_t & rawHighPrecisionValue()
Definition: blpapi_datetime.h:1954
size_t numElements() const
Definition: blpapi_element.h:1966
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:1591
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:2221
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:1982
Bytes getElementAsBytes(const Name &name) const
Definition: blpapi_element.h:2291
Element setChoice(const char *selectionName)
Definition: blpapi_element.h:1871
std::ostream & print(std::ostream &stream, int level=0, int spacesPerLevel=4) const
Definition: blpapi_element.h:2308
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:1889
SchemaElementDefinition elementDefinition() const
Definition: blpapi_element.h:1956
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:2187
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:2281
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:1586
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:1951
const char * getValueAsString(size_t index=0) const
Definition: blpapi_element.h:2172