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

Field that contains a boolean value. More...

#include <Field.h>

Inheritance diagram for FIX::BoolField:
Inheritance graph
[legend]
Collaboration diagram for FIX::BoolField:
Collaboration graph
[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 field, const std::string &string)
 
virtual ~FieldBase ()
 
void setField (int field)
 
void setString (const std::string &string)
 
int getField () const
 Get the fields integer tag. More...
 
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 372 of file Field.h.

Constructor & Destructor Documentation

◆ BoolField() [1/2]

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

Definition at line 375 of file Field.h.

376 : FieldBase( field, BoolConvertor::convert( data ) ) {}
static std::string convert(bool value)
FieldBase(int field, 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:76

◆ BoolField() [2/2]

FIX::BoolField::BoolField ( int  field)
inline

Definition at line 377 of file Field.h.

378 : FieldBase( field, "" ) {}
FieldBase(int field, 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:76

Member Function Documentation

◆ getValue()

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

Definition at line 382 of file Field.h.

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

383  { try
384  { return BoolConvertor::convert( getString() ); }
385  catch( FieldConvertError& )
386  { throw IncorrectDataFormat( getField(), getString() ); } }
const std::string & getString() const
Get the string representation of the fields value.
Definition: Field.h:112
int getField() const
Get the fields integer tag.
Definition: Field.h:108
static std::string convert(bool value)

◆ operator bool()

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

Definition at line 387 of file Field.h.

388  { return getValue(); }
bool getValue() const
Definition: Field.h:382

◆ setValue()

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

Definition at line 380 of file Field.h.

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

381  { setString( BoolConvertor::convert( value ) ); }
static std::string convert(bool value)
void setString(const std::string &string)
Definition: Field.h:100

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

Generated on Thu Sep 5 2019 11:07:58 for QuickFIX by doxygen 1.8.13 written by Dimitri van Heesch, © 1997-2001