Index  Source Files  Annotated Class List  Alphabetical Class List  Class Hierarchy  Graphical Class Hierarchy   
 

FIX::Settings Class Reference

Internal representation of QuickFIX configuration settings. More...

#include <Settings.h>

List of all members.

Public Types

typedef std::vector< DictionarySections

Public Member Functions

Sections get (std::string name) const

Private Attributes

Sections m_sections

Friends

std::istream & operator>> (std::istream &, Settings &)


Detailed Description

Internal representation of QuickFIX configuration settings.

Definition at line 38 of file Settings.h.


Member Typedef Documentation

typedef std::vector< Dictionary > FIX::Settings::Sections
 

Definition at line 41 of file Settings.h.

Referenced by get(), and FIX::operator>>().


Member Function Documentation

Settings::Sections FIX::Settings::get std::string  name  )  const
 

Definition at line 62 of file Settings.cpp.

References m_sections, QF_STACK_POP, QF_STACK_PUSH, and Sections.

Referenced by FIX::operator>>().

00063 { QF_STACK_PUSH(Settings::get)
00064 
00065   Sections sections;
00066   for ( Sections::size_type i = 0; i < m_sections.size(); ++i )
00067     if ( m_sections[ i ].getName() == name )
00068       sections.push_back( m_sections[ i ] );
00069   return sections;
00070 
00071   QF_STACK_POP
00072 }


Friends And Related Function Documentation

std::istream& operator>> std::istream &  stream,
Settings s
[friend]
 

Definition at line 32 of file Settings.cpp.

00033 {
00034   ConfigLexer lexer( &stream );
00035   int lcState = 0;
00036   Settings::Sections::iterator currentSection = s.m_sections.end();
00037   std::string currentName;
00038   while ( 0 != ( lcState = lexer.yylex() ) )
00039   {
00040     switch ( lcState )
00041     {
00042       case ConfigLexer::LC_STATE_SECTION:
00043       currentSection = s.m_sections.insert
00044                        ( s.m_sections.end(),
00045                          Dictionary( lexer.YYText() ) );
00046       break;
00047       case ConfigLexer::LC_STATE_NAME:
00048       currentName = lexer.YYText();
00049       break;
00050       case ConfigLexer::LC_STATE_VALUE:
00051       std::string value = lexer.YYText();
00052       std::string::size_type pos = value.find_last_not_of( ' ' );
00053       if ( pos == std::string::npos ) continue;
00054       value.resize( pos + 1 );
00055       ( *currentSection ).setString( currentName, value );
00056       break;
00057     }
00058   }
00059   return stream;
00060 }


Member Data Documentation

Sections FIX::Settings::m_sections [private]
 

Definition at line 47 of file Settings.h.

Referenced by get(), and FIX::operator>>().


The documentation for this class was generated from the following files:
Generated on Mon Jul 24 19:36:50 2006 for QuickFIX by doxygen 1.3.6-20040222 written by Dimitri van Heesch, © 1997-2001