BLPAPI C++
3.24.11
|
#include <blpapi_element.h>
Public Member Functions | |
Element () | |
Element (blpapi_Element_t *element) | |
void | rebind (blpapi_Element_t *element) |
BLPAPI_DEPRECATE_STRING_NAME void | setElement (const char *name, bool value) |
BLPAPI_DEPRECATE_STRING_NAME void | setElement (const char *name, char value) |
BLPAPI_DEPRECATE_STRING_NAME void | setElement (const char *name, Int32 value) |
BLPAPI_DEPRECATE_STRING_NAME void | setElement (const char *name, Int64 value) |
BLPAPI_DEPRECATE_STRING_NAME void | setElement (const char *name, Float32 value) |
BLPAPI_DEPRECATE_STRING_NAME void | setElement (const char *name, Float64 value) |
BLPAPI_DEPRECATE_STRING_NAME void | setElement (const char *name, const Datetime &value) |
BLPAPI_DEPRECATE_STRING_NAME void | setElement (const char *name, const char *value) |
BLPAPI_DEPRECATE_STRING_NAME void | setElement (const char *name, const Name &value) |
void | setElement (const Name &name, bool value) |
void | setElement (const Name &name, char value) |
void | setElement (const Name &name, Int32 value) |
void | setElement (const Name &name, Int64 value) |
void | setElement (const Name &name, Float32 value) |
void | setElement (const Name &name, Float64 value) |
void | setElement (const Name &name, const Datetime &value) |
void | setElement (const Name &name, const char *value) |
void | setElement (const Name &name, const std::string &value) |
void | setElement (const Name &name, const Name &value) |
void | setElement (const Name &name, const void *value, size_t length) |
template<typename BYTES , typename std::enable_if< IsByteSequence< BYTES >::value, bool >::type = true> | |
void | setElement (const Name &name, const BYTES &value) |
void | setValue (bool value, size_t index=0) |
void | setValue (char value, size_t index=0) |
void | setValue (Int32 value, size_t index=0) |
void | setValue (Int64 value, size_t index=0) |
void | setValue (Float32 value, size_t index=0) |
void | setValue (Float64 value, size_t index=0) |
void | setValue (const Datetime &value, size_t index=0) |
void | setValue (const char *value, size_t index=0) |
void | setValue (const std::string &value, size_t index=0) |
void | setValue (const Name &valueName, size_t index=0) |
void | setValue (const void *value, size_t length, size_t index) |
template<typename BYTES , typename std::enable_if< IsByteSequence< BYTES >::value, bool >::type = true> | |
void | setValue (const BYTES &value, size_t index=0) |
void | appendValue (bool value) |
void | appendValue (char value) |
void | appendValue (Int32 value) |
void | appendValue (Int64 value) |
void | appendValue (Float32 value) |
void | appendValue (Float64 value) |
void | appendValue (const Datetime &value) |
void | appendValue (const char *value) |
void | appendValue (const std::string &value) |
void | appendValue (const Name &value) |
Element | appendElement () |
BLPAPI_DEPRECATE_STRING_NAME Element | setChoice (const char *selectionName) |
Element | setChoice (const Name &selectionName) |
blpapi_Element_t * | handle () |
Name | name () const |
int | datatype () const |
bool | isComplexType () const |
bool | isArray () const |
bool | isNull () const |
bool | isReadOnly () const |
SchemaElementDefinition | elementDefinition () const |
size_t | numValues () const |
size_t | numElements () const |
bool | isValid () const |
bool | isNullValue (size_t position=0) const |
BLPAPI_DEPRECATE_STRING_NAME bool | hasElement (const char *name, bool excludeNullElements=false) const |
bool | hasElement (const Name &name, bool excludeNullElements=false) const |
int | getValueAs (bool *result, size_t index=0) const |
int | getValueAs (char *result, size_t index=0) const |
int | getValueAs (Int32 *result, size_t index=0) const |
int | getValueAs (Int64 *result, size_t index=0) const |
int | getValueAs (Float32 *result, size_t index=0) const |
int | getValueAs (Float64 *result, size_t index=0) const |
int | getValueAs (Datetime *result, size_t index=0) const |
int | getValueAs (std::string *result, size_t index=0) const |
int | getValueAs (Bytes *result, size_t index=0) const |
int | getValueAs (Element *result, size_t index=0) const |
int | getValueAs (Name *result, size_t index=0) const |
bool | getValueAsBool (size_t index=0) const |
char | getValueAsChar (size_t index=0) const |
Int32 | getValueAsInt32 (size_t index=0) const |
Int64 | getValueAsInt64 (size_t index=0) const |
Float32 | getValueAsFloat32 (size_t index=0) const |
Float64 | getValueAsFloat64 (size_t index=0) const |
Datetime | getValueAsDatetime (size_t index=0) const |
const char * | getValueAsString (size_t index=0) const |
Bytes | getValueAsBytes (size_t index=0) const |
Element | getValueAsElement (size_t index=0) const |
Name | getValueAsName (size_t index=0) const |
BLPAPI_DEPRECATE_STRING_NAME int | getElement (Element *result, const char *name) const |
int | getElement (Element *result, const Name &name) const |
int | getElement (Element *result, size_t position) const |
Element | getElement (size_t position) const |
Element | getElement (const Name &name) const |
BLPAPI_DEPRECATE_STRING_NAME Element | getElement (const char *name) const |
BLPAPI_DEPRECATE_STRING_NAME bool | getElementAsBool (const char *name) const |
bool | getElementAsBool (const Name &name) const |
BLPAPI_DEPRECATE_STRING_NAME char | getElementAsChar (const char *name) const |
char | getElementAsChar (const Name &name) const |
BLPAPI_DEPRECATE_STRING_NAME Int32 | getElementAsInt32 (const char *name) const |
Int32 | getElementAsInt32 (const Name &name) const |
BLPAPI_DEPRECATE_STRING_NAME Int64 | getElementAsInt64 (const char *name) const |
Int64 | getElementAsInt64 (const Name &name) const |
BLPAPI_DEPRECATE_STRING_NAME Float32 | getElementAsFloat32 (const char *name) const |
Float32 | getElementAsFloat32 (const Name &name) const |
BLPAPI_DEPRECATE_STRING_NAME Float64 | getElementAsFloat64 (const char *name) const |
Float64 | getElementAsFloat64 (const Name &name) const |
BLPAPI_DEPRECATE_STRING_NAME Datetime | getElementAsDatetime (const char *name) const |
Datetime | getElementAsDatetime (const Name &name) const |
BLPAPI_DEPRECATE_STRING_NAME const char * | getElementAsString (const char *name) const |
const char * | getElementAsString (const Name &name) const |
Bytes | getElementAsBytes (const Name &name) const |
BLPAPI_DEPRECATE_STRING_NAME Name | getElementAsName (const char *name) const |
Name | getElementAsName (const Name &name) const |
Element | getChoice () const |
const blpapi_Element_t * | handle () const |
std::ostream & | print (std::ostream &stream, int level=0, int spacesPerLevel=4) const |
Element represents an item in a message.
An Element can represent: a single value of any data type supported by the Bloomberg API; an array of values; a sequence or a choice.
The value(s) in an Element can be queried in a number of ways. For an Element which represents a single value or an array of values use the getValueAs() functions or getValueAsBool() etc. For an Element which represents a sequence or choice use getElementAsBool() etc. In addition, for choices and sequences, hasElement() and getElement() are useful.
This example shows how to access the value of a scalar element s
as a floating point number:
Similarly, this example shows how to retrieve the third value in an array element a
, as a floating pointer number:
Use numValues() to determine the number of values available. For single values, it will return either 0 or 1. For arrays it will return the actual number of values in the array.
To retrieve values from a complex element types (sequences and choices) use the getElementAs...() family of methods. This example shows how to get the value of the element city
in the sequence element address
:
The value(s) of an Element can be set in a number of ways. For an Element which represents a single value or an array of values use the setValue() or appendValue() functions. For an element which represents a sequence or a choice use the setElement() functions.
This example shows how to set the value of an Element s
from an integer:
This example shows how to append an integer a value to an array element a
:
To set values in a complex element (a sequence or a choice) use the setElement() family of functions. This example shows how to set the value of the element city
in the sequence element address
to a string.
The API will convert data types as long as there is no loss of precision involved. So:
Element | ( | ) |
|
explicit |
Element appendElement | ( | ) |
If this Element is an array of sequence or choice Elements, then append an element to this element and return the appended element; otherwise an exception is thrown.
void appendValue | ( | bool | value | ) |
Appends the specified value
to this Element as the last element. An exception is thrown if this Element's DataType means it cannot be initialized from an instance of the supplied value
, or if the current size of this Element (numValues()
) is equal to the maximum defined by elementDefinition().maxValues()
.
void appendValue | ( | char | value | ) |
Appends the specified value
to this Element as the last element. An exception is thrown if this Element's DataType means it cannot be initialized from an instance of the supplied value
, or if the current size of this Element (numValues()
) is equal to the maximum defined by elementDefinition().maxValues()
.
void appendValue | ( | Int32 | value | ) |
Appends the specified value
to this Element as the last element. An exception is thrown if this Element's DataType means it cannot be initialized from an instance of the supplied value
, or if the current size of this Element (numValues()
) is equal to the maximum defined by elementDefinition().maxValues()
.
void appendValue | ( | Int64 | value | ) |
Appends the specified value
to this Element as the last element. An exception is thrown if this Element's DataType means it cannot be initialized from an instance of the supplied value
, or if the current size of this Element (numValues()
) is equal to the maximum defined by elementDefinition().maxValues()
.
void appendValue | ( | Float32 | value | ) |
Appends the specified value
to this Element as the last element. An exception is thrown if this Element's DataType means it cannot be initialized from an instance of the supplied value
, or if the current size of this Element (numValues()
) is equal to the maximum defined by elementDefinition().maxValues()
.
void appendValue | ( | Float64 | value | ) |
Appends the specified value
to this Element as the last element. An exception is thrown if this Element's DataType means it cannot be initialized from an instance of the supplied value
, or if the current size of this Element (numValues()
) is equal to the maximum defined by elementDefinition().maxValues()
.
void appendValue | ( | const Datetime & | value | ) |
Appends the specified value
to this Element as the last element. An exception is thrown if this Element's DataType means it cannot be initialized from an instance of the supplied value
, or if the current size of this Element (numValues()
) is equal to the maximum defined by elementDefinition().maxValues()
.
void appendValue | ( | const char * | value | ) |
Appends the specified value
to this Element as the last element. An exception is thrown if this Element's DataType means it cannot be initialized from an instance of the supplied value
, or if the current size of this Element (numValues()
) is equal to the maximum defined by elementDefinition().maxValues()
.
void appendValue | ( | const std::string & | value | ) |
Appends the specified value
to this Element as the last element. An exception is thrown if this Element's DataType means it cannot be initialized from an instance of the supplied value
, or if the current size of this Element (numValues()
) is equal to the maximum defined by elementDefinition().maxValues()
. The behaviour is undefined if the specified value
contains embedded zero-characters.
void appendValue | ( | const Name & | value | ) |
Appends the specified value
to this Element as the last element. An exception is thrown if this element's datatype is not an enumeration type, or if value
does not refer to a constant in the enumeration type of this element. An exception is also thrown if the current size of this Element (numValues()
) is equal to the maximum defined by elementDefinition().maxValues()
.
int datatype | ( | ) | const |
Return the basic data type used to represent a value in this element as an integer specified by the blpapi_DataType_t
enumeration defined in blpapi_types.h
.
SchemaElementDefinition elementDefinition | ( | ) | const |
Return a reference to the read-only element definition object that defines the properties of this elements value.
Element getChoice | ( | ) | const |
Return the selection name of this element if this element is a "choice" element. Otherwise, an exception is thrown.
int getElement | ( | Element * | result, |
const char * | name | ||
) | const |
If this Element is either a sequence or a choice and contains a valid Element identified by the specified name
then load that element into the specified result
and return 0; otherwise, return an error (non-zero). The behavior of this function is undefined unless name
is a valid null-terminated string.
int getElement | ( | Element * | result, |
size_t | position | ||
) | const |
If this Element is either a sequence or a choice and numElements()
is greater than the specified position
, then load the element at position
into the specified result
and return 0; otherwise return an error (non-zero).
Element getElement | ( | size_t | position | ) | const |
If this Element is either a sequence or a choice and numElements()
is greater than the specified position
return the position
th element. Otherwise, an exception is thrown.
Element getElement | ( | const char * | name | ) | const |
If this Element is either a sequence or a choice and contains a valid Element identified by the specified name
, then return that Element. Otherwise, an exception is thrown. The behavior of this function is undefined unless name
is a valid null-terminated string.
bool getElementAsBool | ( | const char * | name | ) | const |
If this Element is either a sequence or a choice and contains a valid Element identified by the specified name
which can be returned as a bool then its value is returned. Otherwise an exception is thrown. The behavior of this function is undefined unless name
is a valid null-terminated string.
bool getElementAsBool | ( | const Name & | name | ) | const |
If this Element is either a sequence or a choice and contains a valid Element identified by the specified name
which can be returned as a byte array, then a byte array struct is returned. The pointer remains valid until this Element is destroyed. Otherwise an exception is thrown. The behavior of this function is undefined if name
is uninitialized.
char getElementAsChar | ( | const char * | name | ) | const |
If this Element is either a sequence or a choice and contains a valid Element identified by the specified name
which can be returned as a char then its value is returned. Otherwise an exception is thrown. The behavior of this function is undefined unless name
is a valid null-terminated string.
char getElementAsChar | ( | const Name & | name | ) | const |
Datetime getElementAsDatetime | ( | const char * | name | ) | const |
If this Element is either a sequence or a choice and contains a valid Element identified by the specified name
which can be returned as a Datetime then its value is returned. Otherwise an exception is thrown. The behavior of this function is undefined unless name
is a valid null-terminated string. Note this function will not necessarily set all fields of the returned value – callers should check rv.hasParts(...)
or rv.parts()
before accessing the fields of the returned value rv
.
If this Element is either a sequence or a choice and contains a valid Element identified by the specified name
which can be returned as Datetime then its value is returned. Otherwise an exception is thrown. The behavior of this function is undefined if name
is uninitialized. Note that this function will not necessarily set all fields of the returned value – callers should check rv.hasParts(...)
or rv.parts()
before accessing the fields of the returned value rv
.
Float32 getElementAsFloat32 | ( | const char * | name | ) | const |
If this Element is either a sequence or a choice and contains a valid Element identified by the specified name
which can be returned as a Float32 then its value is returned. Otherwise an exception is thrown. The behavior of this function is undefined unless name
is a valid null-terminated string.
Float64 getElementAsFloat64 | ( | const char * | name | ) | const |
If this Element is either a sequence or a choice and contains a valid Element identified by the specified name
which can be returned as a Float64 then its value is returned. Otherwise an exception is thrown. The behavior of this function is undefined unless name
is a valid null-terminated string.
Int32 getElementAsInt32 | ( | const char * | name | ) | const |
If this Element is either a sequence or a choice and contains a valid Element identified by the specified name
which can be returned as an Int32 then its value is returned. Otherwise an exception is thrown. The behavior of this function is undefined unless name
is a valid null-terminated string.
Int64 getElementAsInt64 | ( | const char * | name | ) | const |
If this Element is either a sequence or a choice and contains a valid Element identified by the specified name
which can be returned as an Int64 then its value is returned. Otherwise an exception is thrown. The behavior of this function is undefined unless name
is a valid null-terminated string.
Name getElementAsName | ( | const char * | name | ) | const |
If this Element is either a sequence or a choice and contains a valid Element identified by the specified name
which can be returned as a Name then its value is returned. Otherwise an exception is thrown. The behavior of this function is undefined unless name
is a valid null-terminated string.
const char * getElementAsString | ( | const char * | name | ) | const |
If this Element is either a sequence or a choice and contains a valid Element identified by the specified name
which can be returned as a null-terminated string then a pointer to a string is returned. The pointer remains valid until this Element is destroyed. Otherwise an exception is thrown. The behavior of this function is undefined unless name
is a valid null-terminated string.
const char * getElementAsString | ( | const Name & | name | ) | const |
If this Element is either a sequence or a choice and contains a valid Element identified by the specified name
which can be returned as a null-terminated string then a pointer to a string is returned. The pointer remains valid until this Element is destroyed. Otherwise an exception is thrown. The behavior of this function is undefined if name
is uninitialized.
int getValueAs | ( | bool * | result, |
size_t | index = 0 |
||
) | const |
Set the specified result
to the value of the specified index
th entry in this Element and return 0. An error (non-zero) is returned if the DataType of this Element cannot be converted to the type of result
or if numValues() <= index
.
int getValueAs | ( | char * | result, |
size_t | index = 0 |
||
) | const |
Set the specified result
to the value of the specified index
th entry in this Element and return 0. An error (non-zero) is returned if the DataType of this Element cannot be converted to the type of result
or if numValues() <= index
.
int getValueAs | ( | Int32 * | result, |
size_t | index = 0 |
||
) | const |
Set the specified result
to the value of the specified index
th entry in this Element and return 0. An error (non-zero) is returned if the DataType of this Element cannot be converted to the type of result
or if numValues() <= index
.
int getValueAs | ( | Int64 * | result, |
size_t | index = 0 |
||
) | const |
Set the specified result
to the value of the specified index
th entry in this Element and return 0. An error (non-zero) is returned if the DataType of this Element cannot be converted to the type of result
or if numValues() <= index
.
int getValueAs | ( | Float32 * | result, |
size_t | index = 0 |
||
) | const |
Set the specified result
to the value of the specified index
th entry in this Element and return 0. An error (non-zero) is returned if the DataType of this Element cannot be converted to the type of result
or if numValues() <= index
.
int getValueAs | ( | Float64 * | result, |
size_t | index = 0 |
||
) | const |
Set the specified result
to the value of the specified index
th entry in this Element and return 0. An error (non-zero) is returned if the DataType of this Element cannot be converted to the type of result
or if numValues() <= index
.
int getValueAs | ( | Datetime * | result, |
size_t | index = 0 |
||
) | const |
Set the specified result
to the value of the specified index
th entry in this Element and return 0. An error (non-zero) is returned if the DataType of this Element cannot be converted to the type of result
or if numValues() <= index
. Note that this function will not necessarily set all fields of *result
– callers should check result->hasParts(...)
or result->parts()
before accessing the fields of result
.
int getValueAs | ( | std::string * | result, |
size_t | index = 0 |
||
) | const |
Set the specified result
to the value of the specified index
th entry in this Element and return 0. An error (non-zero) is returned if the DataType of this Element cannot be converted to the type of result
or if numValues() <= index
.
int getValueAs | ( | Bytes * | result, |
size_t | index = 0 |
||
) | const |
Set the specified result
to the value of the specified index
th entry in this Element and return 0. An error (non-zero) is returned if the DataType of this Element is not `DataType.BYTEARRAY or if numValues() <= index
.
int getValueAs | ( | Element * | result, |
size_t | index = 0 |
||
) | const |
Set the specified result
to the value of the specified index
th entry in this Element and return 0. An error (non-zero) is returned if the DataType of this Element cannot be converted to the type of result
or if numValues() <= index
.
int getValueAs | ( | Name * | result, |
size_t | index = 0 |
||
) | const |
Set the specified result
to the value of the specified index
th entry in this Element and return 0. An error (non-zero) is returned if the DataType of this Element is not of type enumeration or if numValues() <= index
.
bool getValueAsBool | ( | size_t | index = 0 | ) | const |
Return the specified index
th entry in the Element as a bool. An exception is thrown if the DataType of this Element cannot be converted to bool or if numValues() <= index
.
Bytes getValueAsBytes | ( | size_t | index = 0 | ) | const |
Returns the specified index
th entry in the Element as Bytes. An exception is thrown if the DataType of this Element is not DataType.BYTEARRAY
or if numValues() <= index
. The pointer returned remains valid until this Element is destroyed.
char getValueAsChar | ( | size_t | index = 0 | ) | const |
Return the specified index
th entry in the Element as a char. An exception is thrown if the DataType of this Element cannot be converted to char or if numValues() <= index
.
Datetime getValueAsDatetime | ( | size_t | index = 0 | ) | const |
Returns the specified index
th entry in the Element as a Datetime. An exception is thrown if the DataType of this Element cannot be converted to Datetime or if numValues() <= index
. Note that this function will not necessarily set all fields of the returned value – callers should check rv.hasParts(...)
or rv.parts()
before accessing the fields of the returned value rv
.
Element getValueAsElement | ( | size_t | index = 0 | ) | const |
Float32 getValueAsFloat32 | ( | size_t | index = 0 | ) | const |
Returns the specified index
th entry in the Element as a Float32. An exception is thrown if the DataType of this Element cannot be converted to Float32 or if numValues() <= index
.
Float64 getValueAsFloat64 | ( | size_t | index = 0 | ) | const |
Returns the specified index
th entry in the Element as a Float64. An exception is thrown if the DataType of this Element cannot be converted to Float64 or if numValues() <= index
.
Int32 getValueAsInt32 | ( | size_t | index = 0 | ) | const |
Return the specified index
th entry in the Element as a Int32. An exception is thrown if the DataType of this Element cannot be converted to Int32 or if numValues() <= index
.
Int64 getValueAsInt64 | ( | size_t | index = 0 | ) | const |
Returns the specified index
th entry in the Element as a Int64. An exception is thrown if the DataType of this Element cannot be converted to Int64 or if numValues() <= index
.
Name getValueAsName | ( | size_t | index = 0 | ) | const |
Returns the specified index
th entry in the Element as a Name. An exception is thrown if the DataType of this Element is not of type enumeration or if numValues() <= index
.
const char * getValueAsString | ( | size_t | index = 0 | ) | const |
Returns the specified index
th entry in the Element as a pointer to a null-terminated string. An exception is thrown if the DataType of this Element cannot be converted to a null-terminated string or if numValues() <= index
. The pointer returned remains valid until this Element is destroyed.
blpapi_Element_t * handle | ( | ) |
const blpapi_Element_t * handle | ( | ) | const |
bool hasElement | ( | const char * | name, |
bool | excludeNullElements = false |
||
) | const |
hasElement(Name::findName(name))
when fields are not known ahead of time.Equivalent to hasElement(Name::findName(name)).
bool hasElement | ( | const Name & | name, |
bool | excludeNullElements = false |
||
) | const |
Return true if this Element is a choice or sequence (isComplexType() == true
) and it contains an Element with the specified name
.
bool isArray | ( | ) | const |
Return true if elementDefinition().maxValues() > 1
or elementDefinition().maxValues() == UNBOUNDED
, and false otherwise.
bool isComplexType | ( | ) | const |
Return true if the DataType is either SEQUENCE or CHOICE and the element is not an array element. Return false otherwise.
bool isNull | ( | ) | const |
Return true if this element has a null value, and false otherwise.
bool isNullValue | ( | size_t | position = 0 | ) | const |
Return true if the value of the sub-element at the specified position
in a sequence or choice element is a null value. An exception is thrown if position >= numElements()
.
bool isReadOnly | ( | ) | const |
Return true if this element cannot be modified, and false otherwise.
bool isValid | ( | ) | const |
Name name | ( | ) | const |
size_t numElements | ( | ) | const |
Return the number of elements contained by this element. The number of elements is 0 if isComplex()
returns false, and no greater than 1 if the Datatype is CHOICE; if the DataType is SEQUENCE this may return any number (including 0).
size_t numValues | ( | ) | const |
Return the number of values contained by this element. The number of values is 0 if isNull()
returns true, and no greater than 1 if isComplexType()
returns true. The value returned will always be in the range defined by elementDefinition().minValues()
and elementDefinition().maxValues()
.
std::ostream & print | ( | std::ostream & | stream, |
int | level = 0 , |
||
int | spacesPerLevel = 4 |
||
) | const |
Format this Element to the specified output stream
at the (absolute value of) the optionally specified indentation level
and return a reference to stream
. If level
is specified, optionally specify spacesPerLevel
, the number of spaces per indentation level for this and all of its nested objects. If level
is negative, suppress indentation of the first line. If spacesPerLevel
is negative, format the entire output on one line, suppressing all but the initial indentation (as governed by level
).
void rebind | ( | blpapi_Element_t * | element | ) |
Element setChoice | ( | const char * | selectionName | ) |
If datatype() == DataType::CHOICE
and the specified selectionName
is valid for this Element, then set the active Element to the one specified by selectionName
and return it; otherwise an exception is thrown.
If datatype() == DataType::CHOICE
and the specified selectionName
is value for this Element, then set the active Element to the one specified by selectionName
and return it; otherwise an exception is thrown.
void setElement | ( | const char * | name, |
bool | value | ||
) |
Set the specified element name
within this sequence or choice Element to the specified value
. An exception is thrown if the specified name
is not valid for this Element, or if the Element identified by the specified name
cannot be initialized from the type of the specified value
. The behavior of this function is undefined unless name
is a valid null-terminated string.
void setElement | ( | const char * | name, |
char | value | ||
) |
Set the specified element name
within this sequence or choice Element to the specified value
. An exception is thrown if the specified name
is not valid for this Element, or if the Element identified by the specified name
cannot be initialized from the type of the specified value
. The behavior of this function is undefined unless name
is a valid null-terminated string.
void setElement | ( | const char * | name, |
Int32 | value | ||
) |
Set the specified element name
within this sequence or choice Element to the specified value
. An exception is thrown if the specified name
is not valid for this Element, or if the Element identified by the specified name
cannot be initialized from the type of the specified value
. The behavior of this function is undefined unless name
is a valid null-terminated string.
void setElement | ( | const char * | name, |
Int64 | value | ||
) |
Set the specified element name
within this sequence or choice Element to the specified value
. An exception is thrown if the specified name
is not valid for this Element, or if the Element identified by the specified name
cannot be initialized from the type of the specified value
. The behavior of this function is undefined unless name
is a valid null-terminated string.
void setElement | ( | const char * | name, |
Float32 | value | ||
) |
Set the specified element name
within this sequence or choice Element to the specified value
. An exception is thrown if the specified name
is not valid for this Element, or if the Element identified by the specified name
cannot be initialized from the type of the specified value
. The behavior of this function is undefined unless name
is a valid null-terminated string.
void setElement | ( | const char * | name, |
Float64 | value | ||
) |
Set the specified element name
within this sequence or choice Element to the specified value
. An exception is thrown if the specified name
is not valid for this Element, or if the Element identified by the specified name
cannot be initialized from the type of the specified value
. The behavior of this function is undefined unless name
is a valid null-terminated string.
void setElement | ( | const char * | name, |
const Datetime & | value | ||
) |
Set the specified element name
within this sequence or choice Element to the specified value
. An exception is thrown if the specified name
is not valid for this Element, or if the Element identified by the specified name
cannot be initialized from the type of the specified value
. The behavior of this function is undefined unless name
is a valid null-terminated string.
void setElement | ( | const char * | name, |
const char * | value | ||
) |
Set the specified element name
within this sequence or choice Element to the specified value
. An exception is thrown if the specified name
is not valid for this Element, or if the Element identified by the specified name
cannot be initialized from the type of the specified value
. The behavior of this function is undefined unless name
is a valid null-terminated string.
void setElement | ( | const char * | name, |
const Name & | value | ||
) |
Set the specified element name
within this sequence or choice Element to the specified value
. An exception is thrown if the specified name
is not valid for this Element. An exception is also thrown if the specified Element's type is not an enumeration type, or if value
does not refer to a constant in the enumeration type of the specified Element. The behavior of this function is undefined unless name
is a valid null-terminated string.
void setElement | ( | const Name & | name, |
bool | value | ||
) |
Set the specified element name
within this sequence or choice Element to the specified value
. An exception is thrown if the specified name
is not valid for this Element, or if the Element identified by the specified name
cannot be initialized from the type of the specified value
. The behavior of this function is undefined if name
is uninitialized.
void setElement | ( | const Name & | name, |
char | value | ||
) |
Set the specified element name
within this sequence or choice Element to the specified value
. An exception is thrown if the specified name
is not valid for this Element, or if the Element identified by the specified name
cannot be initialized from the type of the specified value
. The behavior of this function is undefined if name
is uninitialized.
Set the specified element name
within this sequence or choice Element to the specified value
. An exception is thrown if the specified name
is not valid for this Element, or if the Element identified by the specified name
cannot be initialized from the type of the specified value
. The behavior of this function is undefined if name
is uninitialized.
Set the specified element name
within this sequence or choice Element to the specified value
. An exception is thrown if the specified name
is not valid for this Element, or if the Element identified by the specified name
cannot be initialized from the type of the specified value
. The behavior of this function is undefined if name
is uninitialized.
Set the specified element name
within this sequence or choice Element to the specified value
. An exception is thrown if the specified name
is not valid for this Element, or if the Element identified by the specified name
cannot be initialized from the type of the specified value
. The behavior of this function is undefined if name
is uninitialized.
Set the specified element name
within this sequence or choice Element to the specified value
. An exception is thrown if the specified name
is not valid for this Element, or if the Element identified by the specified name
cannot be initialized from the type of the specified value
. The behavior of this function is undefined if name
is uninitialized.
Set the specified element name
within this sequence or choice Element to the specified value
. An exception is thrown if the specified name
is not valid for this Element, or if the Element identified by the specified name
cannot be initialized from the type of the specified value
. The behavior of this function is undefined if name
is uninitialized.
void setElement | ( | const Name & | name, |
const char * | value | ||
) |
Set the specified element name
within this sequence or choice Element to the specified value
. An exception is thrown if the specified name
is not valid for this Element, or if the Element identified by the specified name
cannot be initialized from the type of the specified value
. The behavior of this function is undefined if name
is uninitialized.
void setElement | ( | const Name & | name, |
const std::string & | value | ||
) |
Set the specified element name
within this sequence or choice Element to the specified value
. An exception is thrown if the specified name
is not valid for this Element, or if the Element identified by the specified name
cannot be initialized from the type of the specified value
. The behavior of this function is undefined if name
is uninitialized. The behaviour is undefined if the specified value
contains embedded zero-characters.
Set the specified element name
within this sequence or choice Element to the specified value
. An exception is thrown if the specified name
is not valid for this Element. An exception is also thrown if the specified Element's type is not an enumeration type, or if value
does not refer to a constant in the enumeration type of the specified Element. The behavior of this function is undefined if name
is uninitialized.
void setElement | ( | const Name & | name, |
const void * | value, | ||
size_t | length | ||
) |
Set the specified element name
within this sequence or choice Element to the specified value
and length
in bytes. An exception is thrown if the specified name
is not valid for this Element, or if the Element identified by the specified name
does not have the data type BYTEARRAY
. The behavior of this function is undefined if name
is uninitialized.
void setElement | ( | const Name & | name, |
const BYTES & | value | ||
) |
Set the specified element name
within this sequence or choice Element to the specified value
. An exception is thrown if the specified name
is not valid for this Element, or if the Element identified by the specified name
does not have the data type BYTEARRAY
. The behavior of this function is undefined if name
is uninitialized. This function accepts any BYTES
that provides const BYTES::value_type * BYTES::data() const
method, does not provide BYTES::c_str()
method and sizeof(BYTES::value_type) == 1
, for example std::vector<char>
. The behaviour of this function is undefined unless data()
returns a pointer to a contiguous block of memory.
void setValue | ( | bool | value, |
size_t | index = 0 |
||
) |
Set the value of the specified index
th entry in this Element to the specified value
. An exception is thrown if this Element's DataType means it cannot be initialized from an instance of the supplied value
. An exception is thrown if index >= numValues()
.
void setValue | ( | char | value, |
size_t | index = 0 |
||
) |
Set the value of the specified index
th entry in this Element to the specified value
. An exception is thrown if this Element's DataType means it cannot be initialized from an instance of the supplied value
. An exception is thrown if index >= numValues()
.
void setValue | ( | Int32 | value, |
size_t | index = 0 |
||
) |
Set the value of the specified index
th entry in this Element to the specified value
. An exception is thrown if this Element's DataType means it cannot be initialized from an instance of the supplied value
. An exception is thrown if index >= numValues()
.
void setValue | ( | Int64 | value, |
size_t | index = 0 |
||
) |
Set the value of the specified index
th entry in this Element to the specified value
. An exception is thrown if this Element's DataType means it cannot be initialized from an instance of the supplied value
. An exception is thrown if index >= numValues()
.
void setValue | ( | Float32 | value, |
size_t | index = 0 |
||
) |
Set the value of the specified index
th entry in this Element to the specified value
. An exception is thrown if this Element's DataType means it cannot be initialized from an instance of the supplied value
. An exception is thrown if index >= numValues()
.
void setValue | ( | Float64 | value, |
size_t | index = 0 |
||
) |
Set the value of the specified index
th entry in this Element to the specified value
. An exception is thrown if this Element's DataType means it cannot be initialized from an instance of the supplied value
. An exception is thrown if index >= numValues()
.
void setValue | ( | const Datetime & | value, |
size_t | index = 0 |
||
) |
Set the value of the specified index
th entry in this Element to the specified value
. An exception is thrown if this Element's DataType means it cannot be initialized from an instance of the supplied value
. An exception is thrown if index >= numValues()
.
void setValue | ( | const char * | value, |
size_t | index = 0 |
||
) |
Set the value of the specified index
th entry in this Element to the specified value
. An exception is thrown if this Element's DataType means it cannot be initialized from an instance of the supplied value
. An exception is thrown if index >= numValues()
.
void setValue | ( | const std::string & | value, |
size_t | index = 0 |
||
) |
Set the value of the specified index
th entry in this Element to the specified value
. An exception is thrown if this Element's DataType means it cannot be initialized from an instance of the supplied value
. An exception is thrown if index >= numValues()
. The behaviour is undefined if the specified value
contains embedded zero-characters.
void setValue | ( | const Name & | valueName, |
size_t | index = 0 |
||
) |
Set the value of the specified index
th entry in this Element to the specified valueName
. An exception is thrown if this element's datatype is not an enumeration type, or if valueName
does not refer to a constant in the enumeration type of this element. An exception is also thrown if index >= numValues()
.
void setValue | ( | const void * | value, |
size_t | length, | ||
size_t | index | ||
) |
Set the value of the specified index
th entry in this Element to the specified value
and length
in bytes. An exception is thrown if this Element's DataType is not BYTEARRAY
. An exception is also thrown if index >= numValues()
.
void setValue | ( | const BYTES & | value, |
size_t | index = 0 |
||
) |
Set the value of the specified index
th entry in this Element to the specified value
. An exception is thrown if this Element's DataType is not BYTEARRAY
. An exception is also thrown if index >= numValues()
. This function accepts any BYTES
that provides const BYTES::value_type * BYTES::data() const
method, does not provide BYTES::c_str()
method and sizeof(BYTES::value_type) == 1
, for example std::vector<char>
. The behaviour of this function is undefined unless data()
returns a pointer to a contiguous block of memory.