Click or drag to resize
EventFormatter Class
EventFormatter is used to format publisher events or responses to certain ProviderSession requests.
Inheritance Hierarchy
SystemObject
  Bloomberglp.BlpapiEventFormatter

Namespace:  Bloomberglp.Blpapi
Assembly:  Bloomberglp.Blpapi (in Bloomberglp.Blpapi.dll) Version: 3.24.11.1
Syntax
public class EventFormatter

The EventFormatter type exposes the following members.

Constructors
  NameDescription
Public methodEventFormatter
Creates an instance of EventFormatter to create messages in the specified event. The behavior is undefined if the specified event already has another EventFormatter attached.
Top
Methods
  NameDescription
Public methodAppendElement
Append an empty complex element of the appropriate type to the element which represents an array of 'Element' type.
Public methodAppendMessage(String, Topic) Obsolete.
Appends a (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. Deprecated, use AppendMessage(Name, Topic) instead.
Public methodAppendMessage(Name, Topic)
Appends a (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.
Public methodAppendMessage(String, Topic, NullableInt32) Obsolete.
Appends a (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. After a message has been appended its elements can be set using the various 'SetElement' methods. The behavior is undefined unless the 'sequenceNumber' is greater (unless the value wrapped) than the last value used in any previous message on this 'topic'. Deprecated, use AppendMessage(Name, Topic, NullableInt32) instead.
Public methodAppendMessage(Name, Topic, NullableInt32)
Appends a (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. After a message has been appended its elements can be set using the various 'SetElement' methods. The behavior is undefined unless the 'sequenceNumber' is greater (unless the value wrapped) than the last value used in any previous message on this 'topic'.
Public methodAppendRecapMessage(Topic, CorrelationID)
Appends a (empty) recap message that will be published under the specified 'topic' to the event referenced by this EventFormatter. Specifies the optional 'cid' if this recap message is added in response to a 'TopicRecap' message. After a message has been appended its elements can be set using the various 'SetElement' methods. It is an error to create append a recap message to an admin event.
Public methodAppendRecapMessage(Topic, NullableInt32, CorrelationID)
Appends a (empty) recap message that will be published under the specified 'topic' to the event referenced by this EventFormatter. Specifies the optional 'cid' if this recap message is added in response to a 'TopicRecap' message. After a message has been appended its elements can be set using the various 'SetElement' methods. It is an error to create append a recap message to an admin event. The behavior is undefined unless the 'sequenceNumber' is greater (unless the value wrapped) than the last value used in any previous message on this 'topic'.
Public methodAppendResponse(String) Obsolete.
Append an (empty) response message that will be sent in response to the previously received operation request.

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.

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

Deprecated, use AppendResponse(Name) instead.
Public methodAppendResponse(Name)
Append an (empty) response message that will be sent in response to the previously received operation request.

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.

Public methodAppendValue(Boolean)
Appends the specified 'value' to the element which represents an array of 'bool'.
Public methodAppendValue(Char)
Appends the specified 'value' to the element which represents an array of 'char'
Public methodAppendValue(Double)
Appends the specified 'value' to the element which represents an array of 'double'.
Public methodAppendValue(Int32)
Appends the specified 'value' to the element which represents an array of 'int'.
Public methodAppendValue(Int64)
Appends the specified 'value' to the element which represents an array of 'long'
Public methodAppendValue(Single)
Appends the specified 'value' to the element which represents an array of 'float'.
Public methodAppendValue(String)
Appends the specified 'value' to the element which represents an array of 'String'
Public methodAppendValue(Datetime)
Appends the specified 'value' to the element which represents an array of 'Datetime'.
Public methodAppendValue(Name)
Appends the specified 'value' to the element which represents an array of 'Name'.
Public methodPopElement
Returns this formatter's context back to the location where it was before the most recent call to 'PushElement' or 'AppendElement()'.
Public methodPushElement(String) Obsolete.
Changes the level at which this formatter is operating to the specified element 'name'. After this returns the context of this formatter is set to the element 'name' in the schema and subsequent 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 formatter to that element. Calling 'AppendElement()' again will create another entry. Deprecated, use PushElement(Name) instead.
Public methodPushElement(Name)
Changes the level at which this formatter is operating to the specified element 'name'. After this returns the context of this formatter is set to the element 'name' in the schema and subsequent 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 formatter to that element. Calling 'AppendElement()' again will create another entry.
Public methodSetElement(String, Datetime) Obsolete.
Sets the element with the specified 'name' within the current element to the specified 'value'. The behavior of this function is undefined if 'value' is 'null'. Note that this function is not intended for publication of null values; uses SetElementNull(String) instead. Deprecated, use SetElement(Name, Datetime) instead.
Public methodSetElement(String, Name) Obsolete.
Sets the element with the specified 'name' within the current element to the specified 'value'. The behavior of this function is undefined if 'value' is 'null'. Note that this function is not intended for publication of null values; uses SetElementNull(String) instead. Deprecated, use SetElement(Name, Name) instead.
Public methodSetElement(String, Boolean) Obsolete.
Sets the element with the specified 'name' within the current element to the specified 'value'. Deprecated, use SetElement(Name, Boolean) instead.
Public methodSetElement(String, Char) Obsolete.
Sets the element with the specified 'name' within the current element to the specified 'value'. Deprecated, use SetElement(Name, Char) instead.
Public methodSetElement(String, Double) Obsolete.
Sets the element with the specified 'name' within the current element to the specified 'value'. Deprecated, use SetElement(Name, Double) instead.
Public methodSetElement(String, Int32) Obsolete.
Sets the element with the specified 'name' within the current element to the specified 'value'. Deprecated, use SetElement(Name, Int32) instead.
Public methodSetElement(String, Int64) Obsolete.
Sets the element with the specified 'name' within the current element to the specified 'value'. Deprecated, use SetElement(Name, Int64) instead.
Public methodSetElement(String, Single) Obsolete.
Sets the element with the specified 'name' within the current element to the specified 'value'. Deprecated, use SetElement(Name, Single) instead.
Public methodSetElement(String, String) Obsolete.
Sets the element with the specified 'name' within the current element to the specified 'value'. The behavior of this function is undefined if 'value' is 'null'. Note that this function is not intended for publication of null values; uses SetElementNull(String) instead. Deprecated, use SetElement(Name, String) instead.
Public methodSetElement(Name, Datetime)
Sets the element with the specified 'name' within the current element to the specified 'value'. The behavior of this function is undefined if 'value' is 'null'. Note that this function is not intended for publication of null values; uses SetElementNull(String) instead.
Public methodSetElement(Name, Name)
Sets the element with the specified 'name' within the current element to the specified 'value'. The behavior of this function is undefined if 'value' is 'null'. Note that this function is not intended for publication of null values; uses SetElementNull(Name) instead.
Public methodSetElement(Name, Boolean)
Sets the element with the specified 'name' within the current element to the specified 'value'.
Public methodSetElement(Name, Byte)
Sets the element with the specified 'name' within the current element to the specified 'value'. The behavior of this function is undefined if 'value' is 'null'. Note that this function is not intended for publication of null values; uses SetElementNull(Name) instead.
Public methodSetElement(Name, Char)
Sets the element with the specified 'name' within the current element to the specified 'value'.
Public methodSetElement(Name, Double)
Sets the element with the specified 'name' within the current element to the specified 'value'.
Public methodSetElement(Name, Int32)
Sets the element with the specified 'name' within the current element to the specified 'value'.
Public methodSetElement(Name, Int64)
Sets the element with the specified 'name' within the current element to the specified 'value'.
Public methodSetElement(Name, Single)
Sets the element with the specified 'name' within the current element to the specified 'value'.
Public methodSetElement(Name, String)
Sets the element with the specified 'name' within the current element to the specified 'value'. The behavior of this function is undefined if 'value' is 'null'. Note that this function is not intended for publication of null values; uses SetElementNull(Name) instead.
Public methodSetElementNull(String) Obsolete.
Creates 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. [Obsolete("Deprecated, use SetElementNull(Name) instead.")]
Public methodSetElementNull(Name)
Creates 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.
Top
Remarks

An EventFormatter is created either from an Event obtained from Service.CreatePublishEvent() or from Service.CreateResponseEvent(). Once one or more Messages have been appended to the Event using the EventFormatter the Event can be published using ProviderSession.Publish(Event)} or sent back as a response using ProviderSession.SendResponse(Event).

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 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.

See Also