BLPAPI C++  3.24.11
EventFormatter Class Reference

#include <blpapi_eventformatter.h>

Public Member Functions

 EventFormatter (Event &event)
 
 ~EventFormatter ()
 
void appendMessage (const Name &messageType, const Topic &topic)
 
void appendMessage (const Name &messageType, const Topic &topic, unsigned int sequenceNumber)
 
void appendResponse (const Name &operationName)
 
void appendRecapMessage (const Topic &topic, const CorrelationId *cid=0)
 
void appendRecapMessage (const Topic &topic, Message::Fragment fragmentType)
 
void appendRecapMessage (const Name &messageType, const Topic &topic, Message::Fragment fragmentType=Message::FRAGMENT_NONE)
 
void appendRecapMessage (const Topic &topic, unsigned int sequenceNumber, const CorrelationId *cid=0)
 
void appendRecapMessage (const Name &messageType, const Topic &topic, unsigned int sequenceNumber)
 
void appendRecapMessage (const Topic &topic, Message::Fragment fragmentType, unsigned int sequenceNumber)
 
void appendRecapMessage (const Name &messageType, const Topic &topic, Message::Fragment fragmentType, unsigned int sequenceNumber)
 
void appendRecapMessage (const CorrelationId &cid, Message::Fragment fragmentType=Message::FRAGMENT_NONE)
 
void appendRecapMessage (const Name &messageType, const CorrelationId &cid, Message::Fragment fragmentType=Message::FRAGMENT_NONE)
 
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 Datetime::HighPrecision &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 setElementNull (const Name &name)
 
void pushElement (const Name &name)
 
void popElement ()
 
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 char *value)
 
void appendValue (const std::string &value)
 
void appendValue (const Name &value)
 
void appendValue (const Datetime &value)
 
void appendValue (const Datetime::HighPrecision &value)
 
void appendElement ()
 
DEPRECATED:

These functions are deprecated and maintained only for backwards compatibility

BLPAPI_DEPRECATE_STRING_NAME void appendMessage (const char *messageType, const Topic &topic)
 
BLPAPI_DEPRECATE_STRING_NAME void appendMessage (const char *messageType, const Topic &topic, unsigned int sequenceNumber)
 
BLPAPI_DEPRECATE_STRING_NAME void appendResponse (const char *operationName)
 
BLPAPI_DEPRECATE_STRING_NAME void appendRecapMessage (const char *messageType, const Topic &topic, Message::Fragment fragmentType=Message::FRAGMENT_NONE)
 
BLPAPI_DEPRECATE_STRING_NAME void appendRecapMessage (const char *messageType, const Topic &topic, unsigned int sequenceNumber)
 
BLPAPI_DEPRECATE_STRING_NAME void appendRecapMessage (const char *messageType, const Topic &topic, Message::Fragment fragmentType, unsigned int sequenceNumber)
 
BLPAPI_DEPRECATE_STRING_NAME void appendRecapMessage (const char *messageType, const CorrelationId &cid, Message::Fragment fragmentType=Message::FRAGMENT_NONE)
 
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 Datetime::HighPrecision &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)
 
BLPAPI_DEPRECATE_STRING_NAME void setElementNull (const char *name)
 
BLPAPI_DEPRECATE_STRING_NAME void pushElement (const char *name)
 

Detailed Description

EventFormatter is used to populate Events for publishing.

An EventFormatter is created from an Event obtained from Service::createPublishEvent(). Once the Message or messages have been appended to the Event using the EventFormatter the Event can be published using ProviderSession::publish().

EventFormatter objects cannot be copied or assigned so as to ensure there is no ambiguity about what happens if two EventFormatters are both formatting the same Event.

The EventFormatter supports appending multiple messages of the same type to the same Event. However the EventFormatter supports write once only to each field. It is an error to call setElement() or pushElement() for the same name more than once at a particular level of the schema when creating a message.

The EventFormatter supports appending recap messages with an user-provided messageType. If the user doesn't specify the messageType for the recap message, then the type is determined by the service schema, with the FORCED_RECAP_TICK_TYPE (10000) message used for un-solicited recap messages, and RECAP_TICK_TYPE (9999) used for solicited recap messages. In addition to that, services can send recaps in more than one tick through the fragmentType flag for recap messages. Recap messages with fragmentType other than Message::FRAGMENT_NONE must send message fragments in order. A recap message with Message::FRAGMENT_START may be followed by zero or more messages with fragmentType Message::FRAGMENT_INTERMEDIATE. Publishers must also publish a recap message with Message::FRAGMENT_END for each recap that was started with Message::FRAGMENT_START. Trying to publish recap messages with flags in a different order is undefined behavior.

See Component blpapi_eventformatter

Constructor & Destructor Documentation

◆ EventFormatter()

EventFormatter ( Event event)
explicit

Create an EventFormatter to create Messages in the specified Event. An Event may only be referenced by one EventFormatter at any time. Attempting to create a second EventFormatter referencing the same Event will result in an exception being thrown.

◆ ~EventFormatter()

Destroy this EventFormatter object.

Member Function Documentation

◆ appendElement()

void appendElement ( )

Create an element and append it to the array element on which this EventFormatter is operating on. Throw an exception if the current element to which value is appended is not an array.

◆ appendMessage() [1/4]

void appendMessage ( const Name messageType,
const Topic topic 
)

Append an (empty) message of the specified messageType that will be published under the specified topic to the Event referenced by this EventFormatter. After a message has been appended its elements can be set using the various setElement() methods.

◆ appendMessage() [2/4]

void appendMessage ( const Name messageType,
const Topic topic,
unsigned int  sequenceNumber 
)

Append an (empty) message of the specified messageType that will be published under the specified topic with the specified sequenceNumber to the Event referenced by this EventFormatter. It is expected that sequenceNumber is greater (unless the value wrapped) than the last value used in any previous message on this topic, otherwise the behavior is undefined. After a message has been appended its elements can be set using the various setElement() methods.

◆ appendMessage() [3/4]

void appendMessage ( const char *  messageType,
const Topic topic 
)
Deprecated:
Use the form that takes Name instead of const char*.

Append an (empty) message of the specified messageType that will be published under the specified topic to the Event referenced by this EventFormatter. After a message has been appended its elements can be set using the various setElement() methods.

◆ appendMessage() [4/4]

void appendMessage ( const char *  messageType,
const Topic topic,
unsigned int  sequenceNumber 
)
Deprecated:
Use the form that takes Name instead of const char*.

Append an (empty) message of the specified messageType that will be published under the specified topic with the specified sequenceNumber to the Event referenced by this EventFormatter. It is expected that sequenceNumber is greater (unless the value wrapped) than the last value used in any previous message on this topic, otherwise the behavior is undefined. After a message has been appended its elements can be set using the various setElement() methods.

◆ appendRecapMessage() [1/13]

void appendRecapMessage ( const Topic topic,
const CorrelationId cid = 0 
)

Append an empty recap message with the default messageType that will be published under the specified topic to the event referenced by this EventFormatter. Specify the optional CorrelationId pointer cid if this recap message is added in response to a TOPIC_RECAP message. It is undefined behavior to call this function with a non-null cid for a TOPIC_RECAP message with a different Topic than that referenced by topic. This method will create a recap message with fragment type FRAGMENT_NONE. After a message has been appended its elements can be set using the various setElement() methods. It is an error to append a recap message to an Admin event.

Deprecated:
The use of this function with non-null cid is deprecated. Utilize the overload appendRecapMessage(const CorrelationId&, ...) to respond to TOPIC_RECAP messages.

◆ appendRecapMessage() [2/13]

void appendRecapMessage ( const Topic topic,
Message::Fragment  fragmentType 
)

Append an empty recap message with the default messageType that will be published under the specified topic to the event referenced by this EventFormatter. The specified fragmentType determines what fragment flag to apply to this recap message. Single-tick recap messages should have fragmentType Message::FRAGMENT_NONE. After a message has been appended its elements can be set using the various setElement() methods. It is an error to append a recap message to an Admin event. Note that it is undefined behavior to send multi-tick recaps with a fragment ordering other than one Message::FRAGMENT_START, and zero or more Message::FRAGMENT_INTERMEDIATE followed by a Message::FRAGMENT_END fragment. Refer to the component documentation for more information on message fragments.

◆ appendRecapMessage() [3/13]

void appendRecapMessage ( const Name messageType,
const Topic topic,
Message::Fragment  fragmentType = Message::FRAGMENT_NONE 
)

Append an empty recap message of type messageType that will be published under the specified topic to the event referenced by this EventFormatter. Specify the optional fragmentType to create a recap message with fragment type other than Message::FRAGMENT_NONE, if fragmentType is not provided, append a recap message with fragment type Message::FRAGMENT_NONE. Single-tick recap messages should have fragmentType Message::FRAGMENT_NONE. After a message has been appended its elements can be set using the various setElement() methods. It is an error to append a recap message to an Admin event. Note that it is undefined behavior to send multi-tick recaps with a fragment ordering other than one Message::FRAGMENT_START, and zero or more Message::FRAGMENT_INTERMEDIATE followed by a Message::FRAGMENT_END fragment. Refer to the component documentation for more information on message fragments.

◆ appendRecapMessage() [4/13]

void appendRecapMessage ( const Topic topic,
unsigned int  sequenceNumber,
const CorrelationId cid = 0 
)

Append an empty recap message with the default messageType that will be published under the specified topic with the specified sequenceNumber to the event referenced by this EventFormatter. Specify the optional CorrelationId pointer cid if this recap message is added in response to a TOPIC_RECAP message. It is undefined behavior to call this function with a non-null cid for a TOPIC_RECAP message with a different Topic than that referenced by topic. It is expected that sequenceNumber is greater (unless the value wrapped) than the last value used in any previous message on this topic, otherwise the behavior is undefined. This method will create a recap message with fragment type FRAGMENT_NONE. After a message has been appended its elements can be set using the various setElement() methods. It is an error to append a recap message to an Admin event.

Deprecated:
The use of this function with non-null cid is deprecated. Utilize the overload appendRecapMessage(const CorrelationId&, ...) to respond to TOPIC_RECAP messages.

◆ appendRecapMessage() [5/13]

void appendRecapMessage ( const Name messageType,
const Topic topic,
unsigned int  sequenceNumber 
)

Append an empty recap message of type messageType that will be published under the specified topic with the specified sequenceNumber to the event referenced by this EventFormatter. It is expected that sequenceNumber is greater (unless the value wrapped) than the last value used in any previous message on this topic, otherwise the behavior is undefined. This method will create a recap message with fragment type FRAGMENT_NONE. After a message has been appended its elements can be set using the various setElement() methods. It is an error to append a recap message to an Admin event.

◆ appendRecapMessage() [6/13]

void appendRecapMessage ( const Topic topic,
Message::Fragment  fragmentType,
unsigned int  sequenceNumber 
)

Append an empty recap message with the default messageType that will be published under the specified topic with the specified sequenceNumber to the event referenced by this EventFormatter. It is expected that sequenceNumber is greater (unless the value wrapped) than the last value used in any previous message on this topic, otherwise the behavior is undefined. The specified fragmentType determines what fragment flag to apply to this recap message. Single-tick recap messages should have fragmentType Message::FRAGMENT_NONE. After a message has been appended its elements can be set using the various setElement() methods. It is an error to append a recap message to an Admin event. Note that it is undefined behavior to send multi-tick recaps with a fragment ordering other than one Message::FRAGMENT_START, and zero or more Message::FRAGMENT_INTERMEDIATE followed by a Message::FRAGMENT_END fragment. Refer to the component documentation for more information on message fragments.

◆ appendRecapMessage() [7/13]

void appendRecapMessage ( const Name messageType,
const Topic topic,
Message::Fragment  fragmentType,
unsigned int  sequenceNumber 
)

Append an empty recap message of the specified messageType that will be published under the specified topic with the specified sequenceNumber to the event referenced by this EventFormatter. It is expected that sequenceNumber is greater (unless the value wrapped) than the last value used in any previous message on this topic, otherwise the behavior is undefined.The specified fragmentType determines what fragment flag to apply to this recap message. Single-tick recap messages should have fragmentType Message::FRAGMENT_NONE. After a message has been appended its elements can be set using the various setElement() methods. It is an error to append a recap message to an Admin event. Note that it is undefined behavior to send multi-tick recaps with a fragment ordering other than one Message::FRAGMENT_START, and zero or more Message::FRAGMENT_INTERMEDIATE followed by a Message::FRAGMENT_END fragment. Refer to the component documentation for more information on message fragments.

◆ appendRecapMessage() [8/13]

void appendRecapMessage ( const CorrelationId cid,
Message::Fragment  fragmentType = Message::FRAGMENT_NONE 
)

Append an empty recap message with the default messageType that will be published to the event referenced by this EventFormatter. The specified cid identifies the TOPIC_RECAP message that this recap message is in response to. Specify the optional fragmentType to create a recap message with fragment type other than Message::FRAGMENT_NONE, if fragmentType is not provided, append a recap message with fragment type FRAGMENT_NONE. Single-tick recap messages should have fragmentType Message::FRAGMENT_NONE. After a message has been appended its elements can be set using the various setElement() methods. It is an error to append a recap message to an Admin event. Note that it is undefined behavior to send multi-tick recaps with a fragment ordering other than one Message::FRAGMENT_START, and zero or more Message::FRAGMENT_INTERMEDIATE followed by a Message::FRAGMENT_END fragment. Refer to the component documentation for more information on message fragments.

◆ appendRecapMessage() [9/13]

void appendRecapMessage ( const Name messageType,
const CorrelationId cid,
Message::Fragment  fragmentType = Message::FRAGMENT_NONE 
)

Append an empty recap message of type messageType that will be published to the event referenced by this EventFormatter. The specified cid identifies the TOPIC_RECAP message that this recap message is in response to. Specify the optional fragmentType to create a recap message with fragment type other than Message::FRAGMENT_NONE, if fragmentType is not provided, append a recap message with fragment type FRAGMENT_NONE. Single-tick recap messages should have fragmentType Message::FRAGMENT_NONE. After a message has been appended its elements can be set using the various setElement() methods. It is an error to append a recap message to an Admin event. Note that it is undefined behavior to send multi-tick recaps with a fragment ordering other than one Message::FRAGMENT_START, and zero or more Message::FRAGMENT_INTERMEDIATE followed by a Message::FRAGMENT_END fragment. Refer to the component documentation for more information on message fragments.

◆ appendRecapMessage() [10/13]

void appendRecapMessage ( const char *  messageType,
const Topic topic,
Message::Fragment  fragmentType = Message::FRAGMENT_NONE 
)
Deprecated:
Use the form that takes Name instead of const char*.

Append an empty recap message of type messageType that will be published under the specified topic to the event referenced by this EventFormatter. Specify the optional fragmentType to create a recap message with fragment type other than Message::FRAGMENT_NONE, if fragmentType is not provided, append a recap message with fragment type Message::FRAGMENT_NONE. Single-tick recap messages should have fragmentType Message::FRAGMENT_NONE. After a message has been appended its elements can be set using the various setElement() methods. It is an error to append a recap message to an Admin event. Note that it is undefined behavior to send multi-tick recaps with a fragment ordering other than one Message::FRAGMENT_START, and zero or more Message::FRAGMENT_INTERMEDIATE followed by a Message::FRAGMENT_END fragment. Refer to the component documentation for more information on message fragments.

◆ appendRecapMessage() [11/13]

void appendRecapMessage ( const char *  messageType,
const Topic topic,
unsigned int  sequenceNumber 
)
Deprecated:
Use the form that takes Name instead of const char*.

Append an empty recap message of type messageType that will be published under the specified topic with the specified sequenceNumber to the event referenced by this EventFormatter. It is expected that sequenceNumber is greater (unless the value wrapped) than the last value used in any previous message on this topic, otherwise the behavior is undefined. This method will create a recap message with fragment type'FRAGMENT_NONE'. After a message has been appended its elements can be set using the various setElement() methods. It is an error to append a recap message to an Admin event.

◆ appendRecapMessage() [12/13]

void appendRecapMessage ( const char *  messageType,
const Topic topic,
Message::Fragment  fragmentType,
unsigned int  sequenceNumber 
)
Deprecated:
Use the form that takes Name instead of const char*.

Append an empty recap message of the specified messageType that will be published under the specified topic with the specified sequenceNumber to the event referenced by this EventFormatter. It is expected that sequenceNumber is greater (unless the value wrapped) than the last value used in any previous message on this topic, otherwise the behavior is undefined. The specified fragmentType determines what fragment flag to apply to this recap message. Single-tick recap messages should have fragmentType Message::FRAGMENT_NONE. After a message has been appended its elements can be set using the various setElement() methods. It is an error to append a recap message to an Admin event. Note that it is undefined behavior to send multi-tick recaps with a fragment ordering other than one Message::FRAGMENT_START, and zero or more Message::FRAGMENT_INTERMEDIATE followed by a Message::FRAGMENT_END fragment. Refer to the component documentation for more information on message fragments.

◆ appendRecapMessage() [13/13]

void appendRecapMessage ( const char *  messageType,
const CorrelationId cid,
Message::Fragment  fragmentType = Message::FRAGMENT_NONE 
)
Deprecated:
Use the form that takes Name instead of const char*.

Append an empty recap message of type messageType that will be published to the event referenced by this EventFormatter.The specified cid identifies the TOPIC_RECAP message that this recap message is in response to. Specify the optional fragmentType to create a recap message with fragment type other than Message::FRAGMENT_NONE, if fragmentType is not provided, append a recap message with fragment type FRAGMENT_NONE. Single-tick recap messages should have fragmentType Message::FRAGMENT_NONE. After a message has been appended its elements can be set using the various setElement() methods. It is an error to append a recap message to an Admin event. Note that it is undefined behavior to send multi-tick recaps with a fragment ordering other than one Message::FRAGMENT_START, and zero or more Message::FRAGMENT_INTERMEDIATE followed by a Message::FRAGMENT_END fragment. Refer to the component documentation for more information on message fragments.

◆ appendResponse() [1/2]

void appendResponse ( const Name operationName)

Append an (empty) response message for the specified operationName (e.g. "ReferenceDataRequest") that will be sent in response to the previously received operation request. For "PermissionRequest" messages, use "PermissionResponse". After a message for this operation has been appended its elements can be set using the various setElement() methods. Only one response can be appended to an event. The behavior is undefined unless the Event is currently empty.

◆ appendResponse() [2/2]

void appendResponse ( const char *  operationName)
Deprecated:
Use the form that takes Name instead of const char*.

Equivalent to appendResponse(const Name& operationName) with a Name object with the specified operationName value.

Note that using Name overloads is preferred, as the Name objects have better performance if they are re-used after being created.

◆ appendValue() [1/11]

void appendValue ( bool  value)

Append the specified value to the element on which this EventFormatter is operating. Throw an exception if the schema of the message is flat or the current element to which value is appended is not an array.

◆ appendValue() [2/11]

void appendValue ( char  value)

Append the specified value to the element on which this EventFormatter is operating. Throw an exception if the schema of the message is flat or the current element to which value is appended is not an array.

◆ appendValue() [3/11]

void appendValue ( Int32  value)

Append the specified value to the element on which this EventFormatter is operating. Throw an exception if the schema of the message is flat or the current element to which value is appended is not an array.

◆ appendValue() [4/11]

void appendValue ( Int64  value)

Append the specified value to the element on which this EventFormatter is operating. Throw an exception if the schema of the message is flat or the current element to which value is appended is not an array.

◆ appendValue() [5/11]

void appendValue ( Float32  value)

Append the specified value to the element on which this EventFormatter is operating. Throw an exception if the schema of the message is flat or the current element to which value is appended is not an array.

◆ appendValue() [6/11]

void appendValue ( Float64  value)

Append the specified value to the element on which this EventFormatter is operating. Throw an exception if the schema of the message is flat or the current element to which value is appended is not an array.

◆ appendValue() [7/11]

void appendValue ( const char *  value)

Append the specified value to the element on which this EventFormatter is operating. Throw an exception if the schema of the message is flat or the current element to which value is appended is not an array.

◆ appendValue() [8/11]

void appendValue ( const std::string &  value)

Append the specified value to the element on which this EventFormatter is operating. Throw an exception if the schema of the message is flat or the current element to which value is appended is not an array.

◆ appendValue() [9/11]

void appendValue ( const Name value)

Append the specified value to the element on which this EventFormatter is operating. Throw an exception if the schema of the message is flat or the current element to which value is appended is not an array.

◆ appendValue() [10/11]

void appendValue ( const Datetime value)

Append the specified value to the element on which this EventFormatter is operating. Throw an exception if the schema of the message is flat or the current element to which value is appended is not an array.

◆ appendValue() [11/11]

void appendValue ( const Datetime::HighPrecision value)

Append the specified value to the element on which this EventFormatter is operating. Throw an exception if the schema of the message is flat or the current element to which value is appended is not an array.

◆ popElement()

void popElement ( )

Undoes the most recent call to pushElement() or appendElement() on this EventFormatter and returns the context of the EventFormatter to where it was before the call to pushElement() or appendElement(). Once popElement() has been called it is invalid to attempt to re-visit the same context.

◆ pushElement() [1/2]

void pushElement ( const Name name)

Changes the level at which this EventFormatter is operating to the specified element name. The element name must identify either a choice, a sequence or an array at the current level of the schema or the behavior is undefined. If the name is invalid for the current message, if appendMessage() has never been called or if the element identified by name has already been set an exception is thrown. After this returns the context of the EventFormatter is set to the element name in the schema and any calls to setElement() or pushElement() are applied at that level. If name represents an array of scalars then appendValue() must be used to add values. If name represents an array of complex types then appendElement() creates the first entry and set the context of the EventFormatter to that element. Calling appendElement() again will create another entry.

◆ pushElement() [2/2]

void pushElement ( const char *  name)
Deprecated:
Use the form that takes Name instead of const char*.

Note that using Name overloads is preferred, as the Name objects have better performance if they are re-used after being created.

◆ setElement() [1/23]

void setElement ( const Name name,
bool  value 
)

Set the element with the specified name to the specified value in the current message in the Event referenced by this EventFormatter. If the name is invalid for the current message, if appendMessage() has never been called or if the element identified by name has already been set an exception is thrown.

◆ setElement() [2/23]

void setElement ( const Name name,
char  value 
)

Set the element with the specified name to the specified value in the current message in the Event referenced by this EventFormatter. If the name is invalid for the current message, if appendMessage() has never been called or if the element identified by name has already been set an exception is thrown.

◆ setElement() [3/23]

void setElement ( const Name name,
Int32  value 
)

Set the element with the specified name to the specified value in the current message in the Event referenced by this EventFormatter. If the name is invalid for the current message, if appendMessage() has never been called or if the element identified by name has already been set an exception is thrown.

◆ setElement() [4/23]

void setElement ( const Name name,
Int64  value 
)

Set the element with the specified name to the specified value in the current message in the Event referenced by this EventFormatter. If the name is invalid for the current message, if appendMessage() has never been called or if the element identified by name has already been set an exception is thrown.

◆ setElement() [5/23]

void setElement ( const Name name,
Float32  value 
)

Set the element with the specified name to the specified value in the current message in the Event referenced by this EventFormatter. If the name is invalid for the current message, if appendMessage() has never been called or if the element identified by name has already been set an exception is thrown.

◆ setElement() [6/23]

void setElement ( const Name name,
Float64  value 
)

Set the element with the specified name to the specified value in the current message in the Event referenced by this EventFormatter. If the name is invalid for the current message, if appendMessage() has never been called or if the element identified by name has already been set an exception is thrown.

◆ setElement() [7/23]

void setElement ( const Name name,
const Datetime value 
)

Set the element with the specified name to the specified value in the current message in the Event referenced by this EventFormatter. If the name is invalid for the current message, if appendMessage() has never been called or if the element identified by name has already been set an exception is thrown. This function sets the Datetime value with millisecond resolution.

◆ setElement() [8/23]

void setElement ( const Name name,
const Datetime::HighPrecision value 
)

Set the element with the specified name to the specified value in the current message in the Event referenced by this EventFormatter. If the name is invalid for the current message, if appendMessage() has never been called or if the element identified by name has already been set an exception is thrown. This function sets the Datetime value with full precision. Note that while Datetime supports picosecond resolution, messages on the wire won't have the full resolution.

◆ setElement() [9/23]

void setElement ( const Name name,
const char *  value 
)

Set the element with the specified name to the specified value in the current message in the Event referenced by this EventFormatter. If the name is invalid for the current message, if appendMessage() has never been called or if the element identified by name has already been set an exception is thrown. The behavior is undefined unless value is not NULL. Clients wishing to format and publish null values (e.g. for the purpose of cache management) should not use this function; use setElementNull instead.

◆ setElement() [10/23]

void setElement ( const Name name,
const std::string &  value 
)

Set the element with the specified name to the specified value in the current message in the Event referenced by this EventFormatter. If the name is invalid for the current message, if appendMessage() has never been called or if the element identified by name has already been set an exception is thrown. The behaviour is undefined if the specified value contains embedded zero-characters.

◆ setElement() [11/23]

void setElement ( const Name name,
const Name value 
)

Set the element with the specified name to the specified value in the current message in the Event referenced by this EventFormatter. If the name is invalid for the current message, if appendMessage() has never been called or if the element identified by name has already been set an exception is thrown.

◆ setElement() [12/23]

void setElement ( const Name name,
const void *  value,
size_t  length 
)

Set the element with the specified name to the specified value and length in bytes in the current message in the Event referenced by this EventFormatter. If the name is invalid for the current message, if appendMessage() has never been called or if the element identified by name has already been set an exception is thrown. The behavior is undefined unless value is not NULL or length is zero. Clients wishing to format and publish null values (e.g. for the purpose of cache management) should not use this function; use setElementNull instead.

◆ setElement() [13/23]

void setElement ( const Name name,
const BYTES &  value 
)

Set the element with the specified name to the specified value in the current message in the Event referenced by this EventFormatter. If the name is invalid for the current message, if appendMessage() has never been called or if the element identified by name has already been set an exception is thrown. 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.

◆ setElement() [14/23]

void setElement ( const char *  name,
bool  value 
)
Deprecated:
Use the form that takes Name instead of const char*.

Set the element with the specified name to the specified value in the current message in the Event referenced by this EventFormatter. If the name is invalid for the current message, if appendMessage() has never been called or if the element identified by name has already been set an exception is thrown.

Note that using Name overloads is preferred, as the Name objects have better performance if they are re-used after being created.

◆ setElement() [15/23]

void setElement ( const char *  name,
char  value 
)
Deprecated:
Use the form that takes Name instead of const char*.

Set the element with the specified name to the specified value in the current message in the Event referenced by this EventFormatter. If the name is invalid for the current message, if appendMessage() has never been called or if the element identified by name has already been set an exception is thrown.

Note that using Name overloads is preferred, as the Name objects have better performance if they are re-used after being created.

◆ setElement() [16/23]

void setElement ( const char *  name,
Int32  value 
)
Deprecated:
Use the form that takes Name instead of const char*.

Set the element with the specified name to the specified value in the current message in the Event referenced by this EventFormatter. If the name is invalid for the current message, if appendMessage() has never been called or if the element identified by name has already been set an exception is thrown.

Note that using Name overloads is preferred, as the Name objects have better performance if they are re-used after being created.

◆ setElement() [17/23]

void setElement ( const char *  name,
Int64  value 
)
Deprecated:
Use the form that takes Name instead of const char*.

Set the element with the specified name to the specified value in the current message in the Event referenced by this EventFormatter. If the name is invalid for the current message, if appendMessage() has never been called or if the element identified by name has already been set an exception is thrown.

Note that using Name overloads is preferred, as the Name objects have better performance if they are re-used after being created.

◆ setElement() [18/23]

void setElement ( const char *  name,
Float32  value 
)
Deprecated:
Use the form that takes Name instead of const char*.

Set the element with the specified name to the specified value in the current message in the Event referenced by this EventFormatter. If the name is invalid for the current message, if appendMessage() has never been called or if the element identified by name has already been set an exception is thrown.

Note that using Name overloads is preferred, as the Name objects have better performance if they are re-used after being created.

◆ setElement() [19/23]

void setElement ( const char *  name,
Float64  value 
)
Deprecated:
Use the form that takes Name instead of const char*.

Set the element with the specified name to the specified value in the current message in the Event referenced by this EventFormatter. If the name is invalid for the current message, if appendMessage() has never been called or if the element identified by name has already been set an exception is thrown.

Note that using Name overloads is preferred, as the Name objects have better performance if they are re-used after being created.

◆ setElement() [20/23]

void setElement ( const char *  name,
const Datetime value 
)
Deprecated:
Use the form that takes Name instead of const char*.

Set the element with the specified name to the specified value in the current message in the Event referenced by this EventFormatter. If the name is invalid for the current message, if appendMessage() has never been called or if the element identified by name has already been set an exception is thrown. This function sets the Datetime value with millisecond resolution.

Note that using Name overloads is preferred, as the Name objects have better performance if they are re-used after being created.

◆ setElement() [21/23]

void setElement ( const char *  name,
const Datetime::HighPrecision value 
)
Deprecated:
Use the form that takes Name instead of const char*.

Set the element with the specified name to the specified value in the current message in the Event referenced by this EventFormatter. If the name is invalid for the current message, if appendMessage() has never been called or if the element identified by name has already been set an exception is thrown. This function sets the Datetime value with full precision. Note that while Datetime supports picosecond resolution, messages on the wire won't have the full resolution.

Note that using Name overloads is preferred, as the Name objects have better performance if they are re-used after being created.

◆ setElement() [22/23]

void setElement ( const char *  name,
const char *  value 
)
Deprecated:
Use the form that takes Name instead of const char*.

Set the element with the specified name to the specified value in the current message in the Event referenced by this EventFormatter. If the name is invalid for the current message, if appendMessage() has never been called or if the element identified by name has already been set an exception is thrown. The behavior is undefined unless value is not NULL. Clients wishing to format and publish null values (e.g. for the purpose of cache management) should not use this function; use setElementNull instead.

Note that using Name overloads is preferred, as the Name objects have better performance if they are re-used after being created.

◆ setElement() [23/23]

void setElement ( const char *  name,
const Name value 
)
Deprecated:
Use the form that takes Name instead of const char*.

Set the element with the specified name to the specified value in the current message in the Event referenced by this EventFormatter. If the name is invalid for the current message, if appendMessage() has never been called or if the element identified by name has already been set an exception is thrown.

Note that using Name overloads is preferred, as the Name objects have better performance if they are re-used after being created.

◆ setElementNull() [1/2]

void setElementNull ( const Name name)

Create a null element with the specified name. Note that whether or not fields containing null values are published to subscribers is dependent upon details of the service and schema configuration. If the name is invalid for the current message, if appendMessage() has never been called or if the element identified by name has already been set an exception is thrown.

◆ setElementNull() [2/2]

void setElementNull ( const char *  name)
Deprecated:
Use the form that takes Name instead of const char*.

Create a null element with the specified name. Note that whether or not fields containing null values are published to subscribers is dependent upon details of the service and schema configuration. If the name is invalid for the current message, if appendMessage() has never been called or if the element identified by name has already been set an exception is thrown.

Note that using Name overloads is preferred, as the Name objects have better performance if they are re-used after being created.


The documentation for this class was generated from the following file: