AMPS C/C++ Client Class Reference AMPS C/C++ Client Version 5.3.5.1

Public Member Functions | List of all members
AMPS::_FIXBuilder< T > Class Template Reference

Provides a convenient way of building messages in FIX format, typically referenced using the typedefs AMPS::FIXBuilder or AMPS::NVFIXBuilder. More...

`#include <ampsplusplus.hpp>`

## Public Member Functions
| _FIXBuilder (char fieldSep_=(char) 1)
| Construct an instance of _FIXBuilder, using the specified separator between fields. More...
void | append (const T &tag, const char *value, size_t offset, size_t length)
| Write a field with the provided tag and value to the message being constructed. More...
void | append (const T &tag, const std::string &value)
| Write a field with the provided tag and value to the message being constructed. More...
std::string | getString () const
| Returns the current contents of this builder as a string. More...
void | reset ()
| Clear all data from the builder.

## Detailed Description

### template<class T>
class AMPS::_FIXBuilder< T >

Provides a convenient way of building messages in FIX format, typically referenced using the typedefs AMPS::FIXBuilder or AMPS::NVFIXBuilder.

This builder simply writes to an underlying `std::stringstream` as fields are added. It does not maintain a dictionary of key/value pairs or otherwise attempt to normalize or optimize the message. This also means that the builder is not validating, and does not prevent an application from producing FIX that is semantically invalid, is missing required fields, or that contains unexpected characters.

Template Parameters

  T | The type to accept for keys. This type must provide the `<<` operator to write to a `std::ostream`.

## Constructor & Destructor Documentation

## ◆ _FIXBuilder()

template<class T >

AMPS::_FIXBuilder< T >::_FIXBuilder | ( | char | fieldSep_ = `(char)1` | ) |
| inline

Construct an instance of _FIXBuilder, using the specified separator between fields.

Parameters

  fieldSep_ | separator to use between fields (defaults to 0x01)

## Member Function Documentation

## ◆ append() [1/2]

template<class T >

void AMPS::_FIXBuilder< T >::append | ( | const T & | tag,
|  | const char * | value,
|  | size_t | offset,
|  | size_t | length
| ) |  |
| inline

Write a field with the provided tag and value to the message being constructed.

Parameters

  tag | The tag to use for the field.
  value | A pointer to the memory that contains the value to use for the field.
  offset | The offset from `value` at which the value begins.
  length | The length of the value.

## ◆ append() [2/2]

template<class T >

void AMPS::_FIXBuilder< T >::append | ( | const T & | tag,
|  | const std::string & | value
| ) |  |
| inline

Write a field with the provided tag and value to the message being constructed.

Parameters

  tag | The tag to use for the field.
  value | The value to use for the field.

## ◆ getString()

template<class T >

std::string AMPS::_FIXBuilder< T >::getString | ( |  | ) | const
| inline

Returns the current contents of this builder as a string.

Returns
  the current message

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

- include/amps/ampsplusplus.hpp