AMPS C/C++ Client Class Reference
AMPS C/C++ Client Version 5.3.4.4
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
TThe type to accept for keys. This type must provide the << operator to write to a std::ostream.

Constructor & Destructor Documentation

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

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
tagThe tag to use for the field.
valueA pointer to the memory that contains the value to use for the field.
offsetThe offset from value at which the value begins.
lengthThe length of the value.
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
tagThe tag to use for the field.
valueThe value to use for the field.
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: