FIX::BoolField Class Reference

Field that contains a boolean value. More...

`#include <Field.h>`

Inheritance diagram for FIX::BoolField:
[legend]
Collaboration diagram for FIX::BoolField:
[legend]

## Public Member Functions

| BoolField (int field, bool data)
| BoolField (int field)
void | setValue (bool value)
bool | getValue () const throw ( IncorrectDataFormat )
| operator bool () const
Public Member Functions inherited from FIX::FieldBase
| FieldBase (int tag, const std::string &string)
virtual | ~FieldBase ()
| FieldBase (const FieldBase &rhs)
FieldBase & | operator= (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 boolean value.

Definition at line 423 of file Field.h.

## Constructor & Destructor Documentation

## BoolField() [1/2]

FIX::BoolField::BoolField | ( | int | field,
|  | bool | data
| ) |  |

inline explicit

Definition at line 426 of file Field.h.

: FieldBase( field, BoolConvertor::convert( data ) ) {}
FIX::FieldBase::FieldBase
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
FIX::BoolConvertor::convert
static std::string convert(bool value)
Definition: FieldConvertors.h:401

## BoolField() [2/2]

FIX::BoolField::BoolField | ( | int | field | ) |

inline

Definition at line 428 of file Field.h.

: FieldBase( field, "" ) {}

## Member Function Documentation

## getValue()

bool FIX::BoolField::getValue | ( |  | ) | const
throw | ( | IncorrectDataFormat
| ) |  |

inline

Definition at line 433 of file Field.h.

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

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

Referenced by operator bool().

## operator bool()

FIX::BoolField::operator bool | ( |  | ) | const

inline

Definition at line 438 of file Field.h.

{ return getValue(); }
FIX::BoolField::getValue
bool getValue() const
Definition: Field.h:433

References getValue().

## setValue()

void FIX::BoolField::setValue | ( | bool | value | ) |

inline

Definition at line 431 of file Field.h.

{ setString( BoolConvertor::convert( value ) ); }
FIX::FieldBase::setString
void setString(const std::string &string)
Definition: Field.h:136

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

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

- Field.h