Public Member Functions | List of all members
FIX::DoubleField Class Reference

Field that contains a double value. More...

#include <Field.h>

Inheritance diagram for FIX::DoubleField:
Inheritance graph
[legend]
Collaboration diagram for FIX::DoubleField:
Collaboration graph
[legend]

Public Member Functions

 DoubleField (int field, double data, int padding=0)
 
 DoubleField (int field)
 
void setValue (double value, int padding=0)
 
double getValue () const throw ( IncorrectDataFormat )
 
 operator double () const
 
- Public Member Functions inherited from FIX::FieldBase
 FieldBase (int tag, const std::string &string)
 
virtual ~FieldBase ()
 
 FieldBase (const FieldBase &rhs)
 
FieldBaseoperator= (const FieldBase &rhs)
 
void swap (FieldBase &rhs)
 
void setTag (int tag)
 
void setField (int field)
 
void setString (const std::string &string)
 
int getTag () const
 Get the fields integer tag. More...
 
int getField () const
 
const std::string & getString () const
 Get the string representation of the fields value. More...
 
const std::string & getFixString () const
 Get the string representation of the Field (i.e.) 55=MSFT[SOH]. More...
 
size_t getLength () const
 Get the length of the fields string representation. More...
 
int getTotal () const
 Get the total value the fields characters added together. More...
 
bool operator< (const FieldBase &field) const
 Compares fields based on their tag numbers. More...
 

Detailed Description

Field that contains a double value.

Definition at line 383 of file Field.h.

Constructor & Destructor Documentation

◆ DoubleField() [1/2]

FIX::DoubleField::DoubleField ( int  field,
double  data,
int  padding = 0 
)
inlineexplicit

Definition at line 386 of file Field.h.

387 : FieldBase( field, DoubleConvertor::convert( data, padding ) ) {}
FieldBase(int tag, std::string::const_iterator valueStart, std::string::const_iterator valueEnd, std::string::const_iterator tagStart, std::string::const_iterator tagEnd)
Constructor which also calculates field metrics.
Definition: Field.h:80
static std::string convert(double value, int padding=0)

◆ DoubleField() [2/2]

FIX::DoubleField::DoubleField ( int  field)
inline

Definition at line 388 of file Field.h.

389 : FieldBase( field, "" ) {}

Member Function Documentation

◆ getValue()

double FIX::DoubleField::getValue ( ) const
throw (IncorrectDataFormat
)
inline

Definition at line 393 of file Field.h.

394  { try
395  { return DoubleConvertor::convert( getString() ); }
396  catch( FieldConvertError& )
397  { throw IncorrectDataFormat( getTag(), getString() ); } }
int getTag() const
Get the fields integer tag.
Definition: Field.h:144
const std::string & getString() const
Get the string representation of the fields value.
Definition: Field.h:152

References FIX::DoubleConvertor::convert(), FIX::FieldBase::getString(), and FIX::FieldBase::getTag().

Referenced by operator double().

◆ operator double()

FIX::DoubleField::operator double ( ) const
inline

Definition at line 398 of file Field.h.

399  { return getValue(); }
double getValue() const
Definition: Field.h:393

References getValue().

◆ setValue()

void FIX::DoubleField::setValue ( double  value,
int  padding = 0 
)
inline

Definition at line 391 of file Field.h.

392  { setString( DoubleConvertor::convert( value, padding ) ); }
void setString(const std::string &string)
Definition: Field.h:136

References FIX::DoubleConvertor::convert(), and FIX::FieldBase::setString().


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

Generated on Wed Nov 24 2021 09:55:53 for QuickFIX by doxygen 1.9.1 written by Dimitri van Heesch, © 1997-2001