Public Member Functions

blpapi::test::MessageFormatter Class Reference

#include <blpapi_messageformatter.h>

List of all members.

Public Member Functions

 MessageFormatter (blpapi_MessageFormatter_t *handle)
 MessageFormatter (const MessageFormatter &original)
 ~MessageFormatter ()
MessageFormatteroperator= (const MessageFormatter &rhs)
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 Name &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 Datetime &value)
void appendValue (const Datetime::HighPrecision &value)
void appendValue (const char *value)
void appendValue (const Name &value)
void appendElement ()
void formatMessageJson (const char *message)
void formatMessageXml (const char *message)
blpapi_MessageFormatter_timpl () const

Detailed Description

MessageFormatter is used to populate/format a message. It supports writing once only to each field. Attempting to set an already set element will fail.

Note that the behavior is undefined if


Constructor & Destructor Documentation

blpapi::test::MessageFormatter::MessageFormatter ( blpapi_MessageFormatter_t handle  )  [explicit]

Creates MessageFormatter from handle and takes ownership of the handle.

blpapi::test::MessageFormatter::MessageFormatter ( const MessageFormatter original  ) 

Creates MessageFormatter from original. Changes made by one copy is visible to the other.

blpapi::test::MessageFormatter::~MessageFormatter (  ) 

Destroy this MessageFormatter and release the d_handle.


Member Function Documentation

MessageFormatter& blpapi::test::MessageFormatter::operator= ( const MessageFormatter rhs  ) 

Make this MessageFormatter same as rhs.

void blpapi::test::MessageFormatter::setElement ( const Name name,
bool  value 
)

Set the element with the specified name to the specified value in the current message referenced by this MessageFormatter. If the name is invalid for the current message or if the element identified by name has already been set an exception is thrown.

void blpapi::test::MessageFormatter::setElement ( const Name name,
char  value 
)

Set the element with the specified name to the specified value in the current message referenced by this MessageFormatter. If the name is invalid for the current message or if the element identified by name has already been set an exception is thrown.

void blpapi::test::MessageFormatter::setElement ( const Name name,
Int32  value 
)

Set the element with the specified name to the specified value in the current message referenced by this MessageFormatter. If the name is invalid for the current message or if the element identified by name has already been set an exception is thrown.

void blpapi::test::MessageFormatter::setElement ( const Name name,
Int64  value 
)

Set the element with the specified name to the specified value in the current message referenced by this MessageFormatter. If the name is invalid for the current message or if the element identified by name has already been set an exception is thrown.

void blpapi::test::MessageFormatter::setElement ( const Name name,
Float32  value 
)

Set the element with the specified name to the specified value in the current message referenced by this MessageFormatter. If the name is invalid for the current message or if the element identified by name has already been set an exception is thrown.

void blpapi::test::MessageFormatter::setElement ( const Name name,
Float64  value 
)

Set the element with the specified name to the specified value in the current message referenced by this MessageFormatter. If the name is invalid for the current message or if the element identified by name has already been set an exception is thrown.

void blpapi::test::MessageFormatter::setElement ( const Name name,
const Datetime value 
)

Set the element with the specified name to the specified value in the current message referenced by this MessageFormatter. If the name is invalid for the current message or if the element identified by name has already been set an exception is thrown.

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

Set the element with the specified name to the specified value in the current message referenced by this MessageFormatter. If the name is invalid for the current message or if the element identified by name has already been set an exception is thrown.

void blpapi::test::MessageFormatter::setElement ( const Name name,
const char *  value 
)

Set the element with the specified name to the specified value in the current message referenced by this MessageFormatter. If the name is invalid for the current message, 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 null values (e.g. for the purpose of cache management) should not use this function; use setElementNull instead.

void blpapi::test::MessageFormatter::setElement ( const Name name,
const Name value 
)

Set the element with the specified name to the specified value in the current message referenced by this MessageFormatter. If the name is invalid for the current message or if the element identified by name has already been set an exception is thrown.

void blpapi::test::MessageFormatter::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 or if the element identified by name has already been set an exception is thrown.

void blpapi::test::MessageFormatter::pushElement ( const Name name  ) 

Change the level at which this MessageFormatter 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 or if the element identified by name has already been set an exception is thrown.

After this returns, the context of the MessageFormatter 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() must be used.

void blpapi::test::MessageFormatter::popElement (  ) 

Undo the most recent call to pushElement() on this MessageFormatter and return the context of the MessageFormatter to where it was before the call to pushElement(). Once popElement() has been called it is invalid to attempt to re-visit the same context.

void blpapi::test::MessageFormatter::appendValue ( bool  value  ) 

Append the specified value to element on which this MessageFormatter 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.

void blpapi::test::MessageFormatter::appendValue ( char  value  ) 

Append the specified value to element on which this MessageFormatter 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.

void blpapi::test::MessageFormatter::appendValue ( Int32  value  ) 

Append the specified value to element on which this MessageFormatter 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.

void blpapi::test::MessageFormatter::appendValue ( Int64  value  ) 

Append the specified value to element on which this MessageFormatter 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.

void blpapi::test::MessageFormatter::appendValue ( Float32  value  ) 

Append the specified value to element on which this MessageFormatter 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.

void blpapi::test::MessageFormatter::appendValue ( Float64  value  ) 

Append the specified value to element on which this MessageFormatter 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.

void blpapi::test::MessageFormatter::appendValue ( const Datetime value  ) 

Append the specified value to element on which this MessageFormatter 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.

void blpapi::test::MessageFormatter::appendValue ( const Datetime::HighPrecision value  ) 

Append the specified value to element on which this MessageFormatter 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.

void blpapi::test::MessageFormatter::appendValue ( const char *  value  ) 

Append the specified value to element on which this MessageFormatter 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.

void blpapi::test::MessageFormatter::appendValue ( const Name value  ) 

Append the specified value to element on which this MessageFormatter 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.

void blpapi::test::MessageFormatter::appendElement (  ) 

Create an array element and append it to the element on which this MessageFormatter is operating on. Throw an exception if the schema of the message is flat or the current element to which value is appended is not an array, a sequence or a choice.

void blpapi::test::MessageFormatter::formatMessageJson ( const char *  message  ) 

Format the message from its JSON representation. An exception is thrown if the method fails to format the message. The behavior is undefined if further formatting is done using this Messageformatter.

void blpapi::test::MessageFormatter::formatMessageXml ( const char *  message  ) 

Format the message from its XML representation. An exception is thrown if the method fails to format the message. The behavior is undefined if further formatting is done using this Messageformatter.

blpapi_MessageFormatter_t* blpapi::test::MessageFormatter::impl (  )  const

Returns underlying implementation of MessageFormatter. For internal use only.


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