![]() |
![]() |
|
Index
Source Files
Annotated Class List
Alphabetical Class List
Class Hierarchy
Graphical Class Hierarchy
|
||
![]() |
![]() |
#include <FileLog.h>
Inheritance diagram for FIX::FileLog:


Public Member Functions | |
| FileLog (const std::string &path) | |
| FileLog (const std::string &path, const SessionID &sessionID) | |
| virtual | ~FileLog () |
| void | clear () |
| void | onIncoming (const std::string &value) |
| void | onOutgoing (const std::string &value) |
| void | onEvent (const std::string &value) |
Private Member Functions | |
| void | init (std::string path, const std::string &prefix) |
Private Attributes | |
| std::ofstream | m_messages |
| std::ofstream | m_event |
| std::string | m_messagesFileName |
| std::string | m_eventFileName |
Three files are created by this implementation. One for outgoing messages, one for incoming message, and one for events.
The formats of the files are:
[path]+[BeginString]-[SenderCompID]-[TargetCompID].messages
[path]+[BeginString]-[SenderCompID]-[TargetCompID].event
Definition at line 73 of file FileLog.h.
|
|
Definition at line 86 of file FileLog.cpp. References init().
00087 {
00088 init( path, "GLOBAL" );
00089 }
|
|
||||||||||||
|
Definition at line 91 of file FileLog.cpp. References FIX::SessionID::getBeginString(), FIX::SessionID::getSenderCompID(), FIX::SessionID::getSessionQualifier(), FIX::SessionID::getTargetCompID(), and init().
00092 {
00093 const std::string& begin =
00094 s.getBeginString().getString();
00095 const std::string& sender =
00096 s.getSenderCompID().getString();
00097 const std::string& target =
00098 s.getTargetCompID().getString();
00099 const std::string& qualifier =
00100 s.getSessionQualifier();
00101
00102 std::string prefix = begin + "-" + sender + "-" + target;
00103 if( qualifier.size() )
00104 prefix += "-" + qualifier;
00105
00106 init( path, prefix );
00107 }
|
|
|
Definition at line 130 of file FileLog.cpp.
00131 {
00132 m_messages.close();
00133 m_event.close();
00134 }
|
|
|
Implements FIX::Log. Definition at line 136 of file FileLog.cpp. References m_eventFileName, and m_messagesFileName.
00137 {
00138 m_messages.close();
00139 m_event.close();
00140
00141 m_messages.open( m_messagesFileName.c_str(), std::ios::out | std::ios::trunc );
00142 m_event.open( m_eventFileName.c_str(), std::ios::out | std::ios::trunc );
00143 }
|
|
||||||||||||
|
Definition at line 109 of file FileLog.cpp. References FIX::file_appendpath(), FIX::file_mkdir(), m_eventFileName, m_messagesFileName, QF_STACK_POP, and QF_STACK_PUSH. Referenced by FileLog().
00110 { QF_STACK_PUSH(FileLog::init)
00111
00112 file_mkdir( path.c_str() );
00113
00114 if ( path.empty() ) path = ".";
00115
00116 std::string fullPrefix
00117 = file_appendpath(path, prefix + ".");
00118
00119 m_messagesFileName = fullPrefix + "messages.log";
00120 m_eventFileName = fullPrefix + "event.log";
00121
00122 m_messages.open( m_messagesFileName.c_str(), std::ios::out | std::ios::app );
00123 if ( !m_messages.is_open() ) throw ConfigError( "Could not open messages file" );
00124 m_event.open( m_eventFileName.c_str(), std::ios::out | std::ios::app );
00125 if ( !m_event.is_open() ) throw ConfigError( "Could not open event file" );
00126
00127 QF_STACK_POP
00128 }
|
|
|
Implements FIX::Log. Definition at line 86 of file FileLog.h.
00087 {
00088 UtcTimeStamp now;
00089 m_event << UtcTimeStampConvertor::convert( now )
00090 << " : " << value << std::endl << std::flush;
00091 }
|
|
|
Implements FIX::Log. Definition at line 82 of file FileLog.h.
00083 { m_messages << value << std::endl << std::flush; }
|
|
|
Implements FIX::Log. Definition at line 84 of file FileLog.h.
00085 { m_messages << value << std::endl << std::flush; }
|
|
|
|
|
|
|
|
|
|
|
|
|
1.3.6-20040222 written by Dimitri van Heesch,
© 1997-2001